Archive

Posts Tagged ‘OpenSource’

Opensource movies from Blender project

Opensource movies made with Blender (http://www.blender.org)

  1. http://orange.blender.org/download
  2. http://www.bigbuckbunny.org/index.php/download/
  3. http://www.sintel.org/download
  4. http://mango.blender.org/download/

At the download page for some of them you can also find subtitle files.

Also at list of featured Blender movies (http://www.blender.org/features-gallery/movies/) I see the movie Project London which says there it’s an opensource project, but can’t find the movie download (maybe not available yet, just the trailer for now):

http://projectlondonmovie.com/

Combinatorics library (Silverlight for Windows Phone)

I recently found a very nice article at CodeProject on Combinatorics algorithms implementation (specifically Permutations, Combinations and Variations with Repetition option) using C# Generics:

http://www.codeproject.com/KB/recipes/Combinatorics.aspx

It uses a lexicographic algorithm, so it allows one to ask for “next” permutation/combination/variation from the collection of all possible ones, in the spirit of C++ Standard Library’s (STL) “next_permutation” algorithm.

My Anagram app for Windows Phone 7 is using this code (packed it in a Silverlight library)

I packed the files in a Silverlight for Windows Phone class library (named Combinatorics) and modification I had to do was to:

  1. make the IMetaCollection interface public so that I could abstract the use of any combinatorics operation based on user selection
  2. add CombinatoricsOp class to help with using any combinatorics operation via one entry point
  3. As a bonus there is also a Combinatorics.cd there (class diagram)

You can download the library to use with your WP7 Silverlight apps (Portable [PCL] version also available now) from http://github.com/zoomicon/Combinatorics
Please give due credit to original author of Combinatorics code (and myself if you use my additions too).

The code for CombinatoricsOp class I added is below. Just call GetCombinatoricsOp to get a Permutations, Combinations or Variations class instance (all implement IMetaCollection interface) and then use the enumerator (with extra method to get count of items without counting them one-by-one) as described in the CodeProject article mentioned above.

//Version: 20111119
//Author: George Birbilis (birbilis@kagi.com)

using System;
using System.Collections.Generic;   namespace Facet.Combinatorics
{   public static class CombinatoricsOp {   public enum CombinatoricsOpType
    {
      Permutations = 0,
      PermutationsWithRepetition = 1,
      //---
      Combinations = 2,
      CombinationsWithRepetition = 3,
      //---
      Variations = 4,
      VariationsWithRepetition = 5
    }   public static IMetaCollection<string> GetCombinatoricsOp(
                  IList<string> values, CombinatoricsOpType opType, int take){
     switch (opType)
     {
       case CombinatoricsOpType.Permutations:
         return new Permutations<string>(values);

case CombinatoricsOpType.PermutationsWithRepetition: return new Permutations<string>(values,GenerateOption.WithRepetition); case CombinatoricsOpType.Combinations: return new Combinations<string>(values, take); case CombinatoricsOpType.CombinationsWithRepetition: return new Combinations<string>(
values, take, GenerateOption.WithRepetition); case CombinatoricsOpType.Variations: return new Variations<string>(values, take); case CombinatoricsOpType.VariationsWithRepetition: return new Variations<string>(
values, take, GenerateOption.WithRepetition); default: throw new NotImplementedException(); } }   }   }

%d bloggers like this: