Genetic Algorithm Library – CodeProject

Genetic Algorithms

Genetic algorithms operate on a set of possible solutions. Because of the random nature of genetic algorithms, solutions found by an algorithm can be good, poor, or infeasible [defective, erroneous], so there should be a way to specify how good that solution is. This is done by assigning a fitness value [or just fitness] to the solution. Chromosomes represent solutions within the genetic algorithm. The two basic components of chromosomes are the coded solution and its fitness value.

via Genetic Algorithm Library – CodeProject.

My new toy: Pivot

The joy of coding kicked in again the other night after a colleague mentioned Pivot, a tool made by MS. Part of my organisations work involves ingesting and understanding massive datasets. My colleague was interested in using Pivot to help display information to the business users. What is Pivot? Watch this TED Talk for a quick run-down:

After hearing my colleague talk about it and seeing the aforementioned TED Talk my coding juices started flowing. It was as if Pivot was my hammer. So many things at work could be displayed so efficiently via Pivot.  Not having coded in a while I had to reinstall Visual Studio. (I downloaded the Express version as I suspect my MSDN licence will soon be given away to another employee…)

After playing with PhotoPivot and grabbing the source I thought I’d have a go at creating some pivot data files that let me browser my music collection in Pivot. I figured that as I’ve got the album art for most of the albums it would look pretty good. Plus I can pull out metadata like Artist, Release Year, Album Name, Genre, File Type, Bit Rate, Beats Per Minute, Track Count, Album Size, Album Duration straight from either the audio files or from their directories.

I bashed out some code late at night the last two evenings after the family had gone to bed. Very happy with the outcome so far, but the size of the collection smashed Pivot. I have not optimised the images at all – not using DeepZoom yet. Trying to view the entire collection caused Pivot to hang 4 out of 5 times.

Progress so far is good. I’ve whipped up a shoddy Visual Studio (Express) solution that creates the cxml file, based only on facets like Artist, Release Year and Album Name. So far so good. Tonight I’ll be working on implementing DeepZoom. That should free up a lot of RAM on my poor box – it only has 4GB RAM and Pivot seems to use every bit of it. That being said the memory requirements of my collection should drop by a large degree when I properly implement DeepZoom. I found a little discussion regarding how to implement DeepZoom using the pAuthor libraries so I will probably implement the same thing in my code.

I have found a few implementations of Pivot libraries online. I am using them as a reference of things I can do…

Good to-the-point articles about Delegates, Func Types and Lambda expresssions

  1. C# Delegates, Anonymous Methods, and Lambda Expressions – O My! [Code Project]:  Explains delegates, func types, anaonymous methods and demonstrates how using them all together dramatically reduces lines of code from older C# frameworks
  2. C# Func Type [dotnetperls.com]: Demonstration of a small program using Func generic type and lambdas
  3. Lambda Expressions (C# Programming Guide) [MSDN]: Discussion of what a lambda expression is and some examples of how it is used. Bingo! Explains that the lambda operator => is read as “goes to”.
  4. Extension delegates [csharpindepth]: Demonstration of how to specify an extension method as a method group using extension syntax.
  5. Intro to LINQ: Examples and discussion of LINQ in terms of  Type Inference, Lamda Expressions, Extension Methods and Anonymous Types

C# Delegates, Anonymous Methods, and Lambda Expressions – O My!