Of Code and Me

Somewhere to write down all the stuff I'm going to forget and then need

links for 2010-11-26 November 26, 2010

Filed under: Uncategorized — Rupert Bates @ 10:02 pm
 

links for 2010-11-09 November 9, 2010

Filed under: Uncategorized — Rupert Bates @ 10:04 pm
 

links for 2010-10-22 October 22, 2010

Filed under: Uncategorized — Rupert Bates @ 10:03 pm
 

links for 2010-10-21 October 21, 2010

Filed under: Uncategorized — Rupert Bates @ 10:02 pm
 

Convert any IEnumerable to a comma separated string of values May 25, 2010

Filed under: Uncategorized — Rupert Bates @ 1:12 pm

This extension method allows you to create a comma separated string from any IEnumerable by passing in a function which takes T and returns the string value which you are interested in:

public static string AsCommaSeparatedString<T>(this IEnumerable<T> enumerable, Func<T, string> value)
        {
            StringBuilder sb = new StringBuilder();
            foreach (T item in enumerable)
            {
                sb.Append(value(item));
                sb.Append(",");
            }
            return sb.ToString().TrimEnd(new []{','});
        }

Use it as follows:

            //get a commma separated list of usernames
            var usernames = users.AsCommaSeparatedList(u => u.Name);
 

links for 2010-04-15 April 15, 2010

Filed under: Uncategorized — Rupert Bates @ 10:04 pm
 

Svn integration for notepad++

Filed under: Uncategorized — Rupert Bates @ 11:13 am

http://www.switchonthecode.com/tech-news/notepadplusplus-subversion-plugin
Download, unzip and copy the binary to your notepad++\plugins directory (probably C:\Program Files\Notepad++\plugins)