1. Display series of numbers (1,2,3,4, 5....etc) in an infinite loop. The program should quit if someone hits a specific key (Say ESCAPE key). using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace lrn2CSharp1 { class Program { static void Main( string[ ] args ) { for ( int i = 0; ; i++ ) { if ( Console.KeyAvailable && keyPressHandler( Console.ReadKey( true ) ) ) break; Console.Write( i + " " ); Thread.Sleep( 250 ); } } protected static Boolean keyPressHandler( ConsoleKeyInfo input ) { if ( input.Key == ConsoleKey.Escape ) return true; return false; } } }

posted by dharh 7:13 PM Feb 10th, 2008

So I saw this page which gives a list of 15 Exercises for Learning a new Programming Language. I thought, this could also be a good way to compare different languages. In that spirit I'm going to do just that and try to complete the list in different popular languages. To start with I will do them in C# and Java.

As it turns out I'm much less familiar with C# than Java so it will also be a learning experience as the original article had intended. You can see the progress in Programming.


posted by dharh 6:43 PM Feb 10th, 2008

function trim(str) { var str = str.replace(/^ss*/, ''), ws = /s/, i = str.length; while (ws.test(str.charAt(--i))); return str.slice(0, i + 1); }

source: http://blog.stevenlevithan.com/archives/faster-trim-javascript


posted by dharh 1:11 PM Feb 4th, 2008

This guy seems to have the right idea on why people would ever choose open source.

posted by dharh 8:58 PM Jan 27th, 2008

Experimental HTML and AJAX stuff i'm playing around with.


posted by dharh 9:58 PM Oct 6th, 2006

Someone has already done the leg work for the question I know everyone had. How many fucks are in the code on the web? You can find out here.

posted by dharh 5:08 PM Oct 5th, 2006

Slashdot has the skinny on Google Code Search which Google just released. Here's a direct link to the cnet story.

posted by dharh 8:44 AM Oct 5th, 2006


« Previous 1 2 3 4 Next »

2011: 5 3 1
2010: 12 9 7 1
2009: 12 11 8 5
2008: 12 5 4 3 2 1
2007: 12 11 10 9 8 7 6 5 4 3 2 1
2006: 12 11 10 9 8 7 6 5 4 3 2 1
2005: 12 10 7 6
2004: 10 9 6 5 4 3 2 1