July 2008 Blog Posts

A Programming Job Interview Challenge #13 - Brackets, and Me...

Ok, I've been doing the programming quizzes here and have a solution... In Perl:$FILE = "expressions.txt";open(FILE) or die("Could not open expressions file.");foreach $OLINE (<FILE>){ $LINE = $OLINE; if ($LINE =~ m/(^[\]}\)>])|([\[{\(<]$)/) { print "bad : $OLINE" } else { while ($LINE =~ m/(\[\])|({})|(\(\))|(<>)/) { $LINE =~ s/(\[\])|({})|(\(\))|(<>)//g } $strLen = length($LINE); if ($strLen > 1) { print "bad : $OLINE" } else { print "good : $OLINE" } }}And a C# console app to generate the "sample" strings (i.e. the "expressions.txt" file used above):using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{...

Conway's Game of Life, Java, Smoking, and Me...

Ok, I've done it again. Another Conway's Game of Life, this time in Java: The source code can be had here. It's called Gola (Game Of Life Applet). So, I've quit smoking. I started July 6 at 11:27pm (my last cigarette). It is going much better this time.  This is my third time.  The first two times I quit for 2+ years each time.  I know this time is my final one.  Why?  I had a "moment" where I just didn't want them anymore. That feeling stayed, even after I failed, so I set a...

Conway's Game of Life in Javascript, and Me...

Ok, I went and done it...With my inability to purge my rotting brain of Conway's Game of Life, I have produced none-other than a super double-buffered javascript only Conway's Game of Life!Hopefully I can sleep now. Below is it in all it's glory. You can get the javascript to run it here.NOTE: ARRRRRRGGGGHHH!!! Ok, trying to get javascript to run in blogger, but it'll take a little work. Here's so you can see it worksADDENDUM: In Blogspot, IE doesn't like this script so well, nor does Firefox. I've removed it from the page but you can still see it at...

«July»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789