Friday Recap 4/18/2008

About two months ago I created a google calendar entry to remind me to post a Friday recap post every week. This will be my first such recap.

  • Been playing a lot with Silverlight 2. It is fun and slightly powerful. I say slightly powerful because it is not as powerful as WPF. Not that it was supposed to be. But they both use Xaml to define their controls, so you expect a level of similarity. And, sure enough, there is one. But…
  • Silverlight 2 has no ComboBox control! Perhaps a better name for Silverlight 2 would be WTF. Because it is a lot like WPF, except for the parts that make you go WTF?
    Having no ComboBox control means that everybody and their left butt cheek will be creating their own specially styled, half-assed version of a ComboBox control. Everyone who writes an application in WTF will create their own ComboBox that has a subset of the features of a normal ComboBox. Woe to a user who has to use two WTF apps written by two different people. Microsoft cannot let WTF ship without a ComboBox. It is just too fundamental of a control. PLEASE Microsoft do not let this happen. Remember: Heroes Happen at the Special Olympics too.
  • I have re-fallen in love with Twitter. Follow me at www.twitter.com/demosthe. I don’t know that I can describe why I like twitter as much as I do. Twitter is to chat as blogging is to email. I twit more than I blog. Is twit the right word? It can’t be. Though it probably describes me uncomfortably well.

  • I went to the doctor today. She’s a she. Kind of attractive. She’s a full service doctor. Took my blood pressure. Felt my testicles.
  • I took my car in for service today as well. The mechanic felt around in my asshole for $3,000. Between the people doctor and the car doctor I am feeling a little violated right now. I need to go take a shower until the hot water is gone. Hold me.
  • Apparently everything that can possibly wear down on my car has worn down. All at the same time. Every one of the things that were wrong I pretty much knew going in. For instance, in 80,000 miles of driving this car, I have never had new breaks. So no surprise that I need those. All my tires were bad, so I knew I needed those. My two rear power windows were broke, and I knew that as well. And so on… I am here to tell you, just because you know ahead of time that someone is going to shove their fist up your ass – it doesn’t make it any easier to take.
  • I ordered a new color printer. It just now arrived.
  • I ordered a pizza. It hasn’t arrived yet.

A Basic use of Max in Linq

It took me an unfortunately long time to figure out the Linq equivalent to the following SQL Statement:

SELECT Max(SomeField)
FROM SomeTable
WHERE SomeOtherField = 1

I tried every combination of putting Max somewhere I could think of. Turns out the trick is to put it *outside* of the from statement. So, the resulting Linq looks like this:

(from p in blah.SomeTable
where p.SomeOtherField == 1
select p.SomeField).Max()

Perhaps that seems obvious to everyone else. But it took me awhile to “think outside the from” so to speak.