Tuesday, May 7, 2013

Index of smallest entry in array

In MKC planner I had to find the index of the array index with the smalles values. I learned how to use Enumerator Aggregator to do this. Even with some random breaking for ties. From memory it went something like:

Random r = new Random();
Enumerator.Range(min,max).OrderBy(i=>r.Next()).Aggregator((a,b)=>array[a]<array[b]? a : b)

I also learned how to install RockBox on an Ipod "Classic" (6th gen) which turns out to be very simple using Emcore.

No comments:

Post a Comment