Sunday, July 27, 2008

Sigur Ros

So who are Sigur Ros?

Well if you just clicked on their name you can read all about them on Wikipedia.  The overall description given to them on the site is this:

Sigur Rós (['sɪːɣʏr rouːs] (help·info)) are an Icelandic post-rock band with melodic, classical and minimalist elements. The band is known for its ethereal sound and lead singer Jónsi Birgisson's falsetto voice.

Basically, they are a band that does not sing in english, but that doesn't even matter... the music is that good. Another interesting thing is the lead singer often plays the guitar with a violin bow like this:

image

They are, without a doubt, my favorite band. Radiohead had top billing in my mind for a while, but a new favorite has emerged. I've been to 2 Radiohead concerts... both were amazing. However, they both pale when compared to the first time I saw Sigur Ros 2 years ago in Detroit.

The just released a new album and I heard it for the first time today. It is unbelievably good. I can't give it justice through words... so here is what I felt like when hearing it for the first time:

happywalrus

Ok, enough of me giving them praise. Check them out at their official website. I think they have most, if not all, of their new album on the main page with free streaming.  They are also playing again in Detroit on September 23rd. I believe the show is sold out already, but I am sure they can be found on eBay! I will be there!

Weekend Ramblings

  • Stepbrothers is a funny movie.
  • Crunchy's once again proves to be a fun bar in East Lansing. Good luck to my cousin Steve on his new job and move to Fort Wayne!
  • The new Magic: The Gathering set 'Eventide' was fun to draft on Friday night.
  • My new computer shows up on Monday, I got my place all set up for it in the basement.
  • The new Sigur Ros album 'Med Sud I Eyrum Vid Spilum Endalaust' is the cats pajamas
  • Cleaning the bathroom is not the cats pajamas.
  • The term 'cats pajamas' is the cats pajamas.
  • TCBY in downtown Kalamazoo (the only TCBY left here that I know of) has good and bad days for their vanilla/fudge swirl. Saturday was a bad day.
  • I got my place measured for new carpet. We'll see if I can actually afford it.
  • Jen visited on Saturday afternoon. It was fun, but fairly ackward.
  • Combining genoa salami, ham, pepperoni, and mozzerella on pita bread then baking it and putting italian dressing and lettuce on it creates an awesome meal.

Thursday, July 24, 2008

Reusing runtime compiled LINQ queries

Sometimes I want to execute the same LINQ generated SQL statement multiple times with different parameters, but don't want the overhead of conversion from an expression tree to the actual SQL statement to occur each time. I did some research and found that you can cache the compiled query using the CompiledQuery.Compile method which allows you to store the compiled method into a Func variable.
In the example below I am caching a query to get Employees by City in the Northwind database. The GetByCity method exposes the stored function to the caller and will only compile the query the first time it is executed.
using System;
using System.Data.Linq;
using System.Linq;

namespace NorthwindSandbox
{
public static class Class1
{
public static void Main()
{
var db = new NorthwindDataContext();

DisplayEmployeesByCity( db, "London" );
DisplayEmployeesByCity( db, "Seattle" );
DisplayEmployeesByCity( db, "Walrus" );

Console.ReadKey();
}

private static void DisplayEmployeesByCity (
NorthwindDataContext db, string city )
{
Console.WriteLine(
string.Concat( city, " Employees: " ) );

IQueryable< Employee > employees =
Employee.GetByCity( db, city );

foreach ( Employee e in employees )
{
string name = string.Concat(
e.FirstName, " ", e.LastName );

Console.WriteLine( name );
}

Console.WriteLine();
}
}

partial class Employee
{
private static Func< NorthwindDataContext,
string, IQueryable< Employee > > byCity_;

public static IQueryable< Employee > GetByCity(
NorthwindDataContext dbContext,
string cityName )
{
if ( byCity_ == null )
{
byCity_ = CompiledQuery.Compile(
( NorthwindDataContext db, string city )
=> from employee in db.Employees
where employee.City == city
select employee );
}

return byCity_( dbContext, cityName );
}
}
}

Wednesday, July 23, 2008

First attempt at code formatting in my blog

return from number in Enumerable.Range( 
1, products.Max( p => p.UnitsInStock ) ?? 0 )
select new Walrus
{
UnitsInStock = number,
ProductNames = (
from product in products
where product.UnitsInStock == number
select product.ProductName )
} as IWalrus;

Sunday, July 20, 2008

Why Walrus?

So why is this blog walrus themed? Let me explain...

I was trying to think of some kind of theme to use that is rather silly and recalled a project in my BIS 380 class during my junior year at WMU. For this project I needed to do some basic image transformations using Fireworks. I came up with the really dumb picture below. Roar.

Tuesday, July 15, 2008

First blog!

This is my first blog. WOOHOOOOOO!