# Monday, 26 May 2008

I've been using VMware in production for two years now.  During that time, I've been thrilled with it.  I run my mail server and my web server on my host OS without any problems.  About 2 months ago, I upgraded the hardware on my server from a recycled desktop PC to a dual core box.

Since I the machine now had two physical CPU's, I figured I would set my VM's to have two processors in the VMware config.  I figured this way, each VM could use both CPU's as needed, and they could do there work faster, and there would be less latency when say IIS is starting up a new worker process, or the CLR is JIT'ing my blog.

Did I notice a speed improvement, very hard to say.  I did notice that things like browsing around in Windows Explorer seemed very very laggy.

So I decided to make a maintenance window this afternoon and shutdown both VM's, and set there processor count back to 1 and see if that made a difference.  Boy did it ever!  Now the host CPU is mostly idle, the GUI on my web server is much more responsive, life is good.

I'm speculating that the reason the performance got a lot better when I switched the VM's to one CPU on a dual core machine has a lot to do with how VMware handles multiprocessor machines, and moving the tasks between CPU's, and the CPU's L1 and L2 cache, and cache hits.  But thats just wild speculation :)

Monday, 26 May 2008 22:51:52 (Alaskan Daylight Time, UTC-08:00)
# Monday, 19 May 2008

I tried Windows Vista for a week, loved the new Explorer, loved the new visuals and animations, hated the crashes and Explorer would lock up a lot.

A while back, a few bloggers talked about how much faster and better Windows Server 2008 was than Windows Vista; so I figured I would give Server 2008 a shot.  A quick Google search turned up www.Win2008Workstation.com. I followed the guides on that site, and I now have a desktop which looks like Vista, but performs much faster, and I get MUCH fewer lockups of Windows Explorer.

I did have to set DEP to "Essential Windows programs and services only" otherwise some games and programs wouldn't install.  But other than that, its been a great experience! Way to go Windows Server 2008 team!

Server | Vista | Windows
Monday, 19 May 2008 11:55:47 (Alaskan Daylight Time, UTC-08:00)
# Tuesday, 13 May 2008

First, a little bit of legal house keeping: The views I am about to post are not necessarily those of my employer.

Having just done a batch of interviews (Yes, we're hiring), if your interviewing at a shop that does technology X, please be familiar with technology X.  Being able to spell that there "c pound" language does not give you the right to put it on your resume.

Oh, and please, if your going to come interview with us, at least know what an interface is in the context of programming languages, such as C# or Java.

That is all.

Tuesday, 13 May 2008 22:58:24 (Alaskan Daylight Time, UTC-08:00)
# Friday, 09 May 2008
 #
 

The trending feature in DasBlog is pretty much non-existant, and the reporting is pretty lack luster, so I've decided to switch over to FeedBurner so I can get a handle on whats going on with this blog and its readers.  So, if you wouldn't mind, please kindly update your feed reader to pull from my feed burner feed. http://feeds.feedburner.com/akcoder

Update! - I upgraded to DasBlogCE 2.0 which has an option to set your feedburner information. So you shouldn't have to do anything if to quote Scott Hanselman "Aggregrators worth their salt know to update their local records when a feed issues a 301. DasBlog will automatically get everyone over to your new feed."

Friday, 09 May 2008 10:35:27 (Alaskan Daylight Time, UTC-08:00)

The Problem

For the last few days I've been trying to figure out how to do this SQL in linq:

   1: select from customers where substring(customers.Name, 1, 1) IN ('a', 'b', 'c', 'd');
The problem is the list (a, b, c, d) is variable, on one page I need all the results where foo.Name starts with a or b, on another it could be b, c, d, e and f.  This is trivial to do in SQL, you just break out a little dynamic sql and your done.  But being a noob to LINQ, I'm not so sure how to go about doing this.

I had a lot of failed queries, and failed code, before giving up and just looping through the letters for that particular page and manually building up what I wanted.

But that's kind of a hack. OK, its not kind of a hack, its a big hack.

The Solution

This LINQ goodness (using the Customers db in LINQPad) will pull back all the customers who's names begin with a t, d, or j (note the .ToList() on line 4, I'll discuss it next).

   1: string[] letters = { "t", "d", "j" }; 
   2:  
   3: var customers = (from c in Customers
   4:     select c).ToList(); 
   5:  
   6: var results = from c in customers
   7:     join letter in letters on c.Name.First().ToString().ToUpper() equals letter.ToUpper()
   8:     select c; 
   9:  
  10: customers.Dump("Customers");
  11: results.Dump("Filtered by first letter");

And LINQPad renders this for us:

image

Limitations

LINQ to SQL doesn't support querying a SQL database with if one of your sources is an in-memory store, except if you use the Contains operator.  So, to work around that, you have to pull back ALL the results from the db, and then convert it to a List before you use it in the above query.

I'm my opinion, this is kind of a painful limitation, but for my particular purpose, I'm willing to live with it because my particular database will only ever have around 100 or so rows, so pulling everything back in memory isn't such a big deal...

P.S. if you are reading this in a feed reader, let me know how it renders, I've updated my code snippet plugin to try and fix the previous rendering problems.

.NET | C# | LINQ
Friday, 09 May 2008 01:13:08 (Alaskan Daylight Time, UTC-08:00)
# Saturday, 03 May 2008

So in my last post, I ranted (well, tried to, but my rant got wiped out when Vista crashed) about what I didn't like about Vista.  Now I'll rant about what I do like about Vista.

Task Manager and Resource Monitor

Both the Task Manager and the Resource Monitor (formally performance monitor) on Vista received a much needed revamp.  The fact that task man now allows you to go to one place and see all your running programs and services, and even allows you to start/stop services from within the task man is a huge improvement.  And with perfmon, being about to see at a glance what is going on with your CPU, disk, network and memory is awesome!  While the old perfmon was OK, the fact that you had to 1) add all those things separately and then try to discern one from another because they were all overlayed on one graph was kind of a pain.

Animations / Eye Candy

In ALL previous version of Microsoft Windows, the first thing I would do is turn off ALL the animations, I always found them to be annoying, distracting, and a waste of my time.  But I've found the animations and eye candy with Vista to actually enhance the experience of using the OS.

Start Menu

The start menu in all previous versions of Microsoft Windows was always a jumbled mess of applications, and God forbid you had more than a dozen or so applications installed, your start menu would become just unwieldy.  I used to organize all my programs by type, Internet, Utilities, Audio & Video, and Development to try and tame the mess that was the start menu.  Now, it really doesn't matter how big a mess it becomes, the fact that I can press the Win key and start typing makes the whole thing more manageable, and a heck of a lot easier to use.

Programs and Features

The abomination that was formally Add/Remove Programs has finally been fixed!  As a developer, with all the software I had to have installed, it would take several minutes for the Add/Remove Programs dialog to come up and populate. Now, it pops up right away, and starts populating.  I haven't had it take more than 10-15 seconds for it to fully populate with all my programs!  And, it even tells me down at the bottom that I have 101 programs installed, for a total of 9.57 GB of space.  Pretty handy. That fact that I can sort all my installed programs by size is really nice as well.

Overall

Overall, when I can get Windows Vista to not lockup, I'm happy with it.  If things continue the way they have been today, I think I'll stick with Windows Vista.  I can say though, that game performance is pretty crappy.  I'm getting a solid 10-15 frames per second less in Half Life 2 :(

Saturday, 03 May 2008 18:44:27 (Alaskan Daylight Time, UTC-08:00)
# Friday, 02 May 2008

I was 3 or 4 paragraphs into what was going to be a very long rant about Windows Vista.  About how some programs were crashing and other programs were losing there settings under Vista, and wouldn't you know it, I was trying to move some files around and Vista locks up.  Not a hard lock (nothing works), but explorer got wedged, and then one by one every process on the laptop got wedged.  I couldn't even use taskman to kill off the offending processes.

If things don't improve dramaticly for me this weekend, then I'm either going back to XP, or switching to Server 2008.

I really wanted to like Vista, but right now, I'm inclined to agree with everyone else out there that Vista sucks

Review | Vista | Windows
Friday, 02 May 2008 21:47:02 (Alaskan Daylight Time, UTC-08:00)

I just replaced the OS on my laptop with Microsoft Windows Vista (tm).  So far, I'm fairly impressed with it.  As I'm rebuilding my laptop and installing my software I come across this nonsense:

image

Mind you, I purchased this software via Digital River almost 1.5 years ago and have used it very successfully.  Why is software that I legally purchased preventing me from installing it?  I used to think that DRM was a minor annoyance.  Now...  I believe DRM is pure evil...

Well, I emailed the folks at Digital River and pleaded my case.  They then looked up my account information and sent me everything I needed to get my copy of MS Money working again.  But still, what a pain in the butt.

DRM
Friday, 02 May 2008 20:23:48 (Alaskan Daylight Time, UTC-08:00)