D-Day 2008 at Surly Brewery

This Saturday I headed out to the Surly Brewery in Brooklyn Center for D-Day. D-Day is the one day a year that you can buy bottles of Surly Darkness. Darkness is one of the best beers I’ve ever had and waiting a whole year just to get to taste it again certainly makes it extra special.

We arrived at 8am and waited in line, freezing our butts off, for 4 hours before the gates opened to let us in. The first 700 people were guaranteed to get their maximum of 6 bottles of darkness for $17 for one, or $100 for 6. Here are some pictures.
12 Bottles of Darkness
Darkness Label up Close

Double Wax Dipped Tops

Darkness and tulips on my keggerator

Boo Presentation 2008

I am making available my boo presentation source code and slide deck in case anyone would like to take a look at it. It has many examples of the various features of boo. The way the presentation starts out is by quickly running through the boo slides and answering any preliminary questions as they come up then by going project by project down the list in the solution.

I gave this presentation at the Fall 2008 Twin Cities Code Camp and I will be giving it again November 11th at the Twin Cities Languages User Group.
Some of the various examples provided by this presentation include:
1.       Hello World!
2.       Strong Typing
3.       Type Inference
4.       Auto Casting
5.       Indentation for Blocks
6.       Object Oriented, uses the CTS
7.       Syntax features
a.       Array, List and Hash literals
b.      Slicing
c.       Comprehensions (generators)
d.      Time
e.      Commenting
8.       Regular expressions
9.       Functional
10.   Closures
a.       Lambdas
b.      Anonymous methods
c.       Currying
11.   Duck Typing and IQuackFu
12.   Extensibility
a.       Macros
b.      Attribute Macros
13.   Internal DSLs
a.       Specter
14.   Compiler Pipline

Appearance in CoDe Magazine

If you haven’t already taken a look at the Nov / Dec 2008 issue of CoDe magazine I would highly recommend it 😉 On my last gig at Magenic I had the pleasure of working for Rocky Lhotka, Sergey Barskiy and Nermin Dibek on CSLA Light. Along the way we managed to crank out an article for CoDe Magazine related to the work we were doing. Here is a link to the article online, Using CSLA .NET for Silverlight to Build Line-of-Business Applications.

I got a copy of this magazine at the last Twin Cities Code Camp and didn’t even know that I was a co-author of one of the articles in it! It wasn’t until the following monday that a coworker of mine pointed out to me that I was in the magazine and he only knew because he recognized my picture. That was pretty funny.

Now that I’m famous if anyone wants me to autograph their copy of CoDe magazine just let me know!

LINQ methods under the hood

As an intellectual exercise I decided to write up 3 different ways to perform the same LINQ tasks. Actually I saw a comment on one of Don Box’s blog posts where someone asked why the Find and Exists methods weren’t static and I suddenly realized that they were, just with different names!

Since LINQ is simply an internal DSL that wraps calls to extension methods I realized these methods must exist for us to call them explicitly as well. Here is how you can perform a Find or an Exists using LINQ (or not).
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
 
// Find an assembly that starts with System.
Func<Assembly, bool> startsWithSystem = a => a.FullName.StartsWith(“System”);
 
//List<T>.Exists equivalents for any enumerable
bool extensionAny = assemblies.Any(startsWithSystem);
bool explictAny = Enumerable.Any(assemblies, startsWithSystem);
bool linqAny = (from a in assemblies where startsWithSystem(a) select a).Any();
Debug.Assert(extensionAny == explictAny == linqAny == true);
 
// List<T>.Find equivalents for any enumerable
int extensionWhere = assemblies.Where(startsWithSystem).Count();
int explicitWhere = Enumerable.Where(assemblies, startsWithSystem).Count();
int linqWhere = (from a in assemblies where startsWithSystem(a) select a).Count();
Debug.Assert(extensionWhere == explicitWhere && extensionWhere == linqWhere);