Below is a little Dictionary extension method for mimicking upsert functionality on in-memory
System.Collections.Generic.
1: public static class DictionaryExtensions
2: {
3: public static TValue Upsert<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, TKey key, TValue value)
4: {
5: if (dictionary.ContainsKey(key))
6: {
7: // Update value to existing key
8: dictionary[key] = value;
9: }
10: else
11: {
12: // Insert new key
13: dictionary.Add(key, value);
14: }
15: return value;
16: }
17: }
Disclaimer: There are several instances where it is inappropriate to leverage upsert-like functionality for your in-memory hashtables. As with any particular code abstraction, the consumer will need to determine when it is fair to use the syntax shortcut.
As a short sidebar, if you use Code Snippet plugin for Live Writer, you’ll have to run as administrator as it operates on:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at WLWPluginBase.Win32.Win32IEHelper.GetSelectedText(IntPtr handle)
at CodeSnippet.CodeSnippetPlugin.CreateContent(IWin32Window dialogOwner, String& content)
at WindowsLive.Writer.PostEditor.ContentSources.ContentSourceManager.PerformInsertion(IContentSourceSite sourceSite, ContentSourceInfo contentSource)
I finally got around to upgrading my Windows 7 RC to RTM version and decided to dive into Virtual PC. So far so good:
- Unlike per usual where I'd backup, reformat, boot from DVD drive and do a clean install of the OS, I opted for the standard setup.exe experience. It got rid of everything but kept directories into windows.old. From what I can tell, everything worked as expected post-install experience. (I backed up everything just in case....I'm not quite that bold yet to trust the default behaviors)
- Installed antivirus software and followed this up by setting up Windows Virtual PC. I hadn't tried this during the RC but wanted to try out XP mode per Virtual PC Guy's Quake 2 entries.
- I also setup a Windows Vista virtual machine for betaware. In particular, I wanted to get VS2010 Beta 2 in there so that I could try it both within VPC and as a virtual application. Once I installed the VPC integration components, the virtual instances ran smoothly.
Overall, I have to say I was pleasantly surprised with the overall Virtual PC experience after years of abuse. I had setup VMs with dev environments in the past (WinXP with VPC 2004, Vista with VPC 2007) but it was too much to bear. I'm hoping third time is the charm for VM dev environments. If not, I could always take the less virtual more machine approach, even if there are caveats.
Back in March, I came across John Resig's articulate post about the pain of frontend testing in general. Unvealing the dirty "secret" that no one likes to talk about but everyone has to deal with at some point in development. But unlike other folks' rants on this topic, he proposed a solution that would tackle this and take advantage of the internet audience. I was very much looking forward to his architecture diagram coming to fruition.

The TestSwarm source is now available on GitHub. The interesting parts are here and repositories for libraries under test are here. By the way, GitHub is awesome; albeit, it would be cool if it had permalink for generating friendly url for linking purposes.
Granted, this is still in fairly early stage, but there is great potential for a distributed testing environment. Having said that, testswarm.com itself may have a harder time getting the entire spectrum of users/browsers as its audience will most likely be developer/techie folks. However, perhaps the spirit of this effort can live on in public sites that are highly trafficked?
For example, if a user with a specific browser agent comes in, you could either display a link to TestSwarm and politely ask them to participate in these efforts OR ask them to participate in a local "TestSwarm" instance that will also run through your own js aside from shared js.
Back during the myspace days, I would come across all sorts of user agents. Some were obviously bots whereas others were legit but unexpected scenarios. Who would've thought at the time that there'd be decent # of users accessing myspace on their PS3? Not that a dev shop would want to be in a reactive mode of fixing things post-production push, but this could fill the niche of covering environments that shops simply don't have available. The hope is that this is a win-win situation for both the user and the site (and potentially rest of the internet community). Lots of exciting stuff coming out from Mozilla with this and Bespin. Outside Mozilla, looking forward to seeing the latest mobile results from QuirksBlog.
Recently, I wrapped up my duties as a lead developer at myspace and headed to ArenaNet over in Bellevue, Washington. My team is hiring and we’re looking for awesome services and web developers. If you’re looking for a new challenge and would like to be part of the next Guild Wars gaming experience, check out the descriptions at:
Services Programmer
Web Developer
And you can hit me up at yow-hann at arena dot net. Hope to see some of the GWB community folks out there!
Been playing around with IE8 RC for the last couple days and am pleased with the upgrade from IE8 Beta.
The features are well publicized on IEBlog: Overview of Platform Improvements in IE8 RC1; it’s not really the web slices and accelerators that are of interest.
Two favorites thus far:
1. Debugger/Profiler
You no longer need Visual Studio or to download a script debugger separately. It has all the features you know and love from IE Dev Toolbar along with a decent script debugger/profiler.
2. XDomainRequest
Will be interesting to see how this pans out.
Other notable include the security and performance improvements since Beta. Perhaps this will help recover some of IE's lost market share?
I was recently reminded of an article for
"Things to Say When You're Losing a Technical Argument". In recent years with RoR and ASP.NET MVC, you've probably come across Reason #66 more often. What's old is new again.
How many of these have you run across? And how would you re-sort the list if judged on frequency?

Interesting Maintenance page when you check out LinkedIn domain today.

Not having attended PDC 2008, I have been catching some of the recorded sessions online at: https://sessions.microsoftpdc.com/public/timeline.aspx. The above screenshot from The Future of C# (after 4.0) opens up a can of worms. Nice!
Waiting to sign in to Windows Azure and seeing what it offers to Amazon’s EC2.

Catching the keynote at: http://www.microsoftpdc.com/. More information on Azure can be found at: http://blogs.msdn.com/cloud/default.aspx.
http://bluehoo.com/, with 121,476+ hoos found, as an example in action.
Earlier this month, Google released “Enhanced Snippets for Discussion Boards”. Below is an example in action:
Since their experiments here and here, Google has taken a different approach to presenting search results. On the other hand, Yahoo’s SearchMonkey was aimed towards customizing search results and presentation layers to the third party developer and users.
Several month’s after Yahoo’s approach, the search results space also has its version of an open approach vs. a walled garden…
Seattle Code Camp 2008 is once again held at the DigiPen campus. I never got around to recapping the one held earlier this year (v3.0) but have recaps of v2.0 here and here.
Check it out at: https://seattle.codecamp.us/default.aspx.
Well, someone finally stepped up and wrote that article. The one where he/she puts a different spin on the same initiatives in hopes of better adoption. And it was none other than Roy Osherove. Like some sports that are a game of inches, so is software design and testability.
The article is everything that most folks in the industry know about but were afraid to mention or unable to put into a lighter context. Good read at: http://weblogs.asp.net/rosherove/archive/2008/09/20/goodbye-mocks-farewell-stubs.aspx.
All the tooling that came from TDD were intended to drive people into the “pit of success” as they say. Unfortunately, it meant a much steeper curve that most weren’t willing to adopt. There is a funny inertia with masses; even if the given situation is bad (albeit there may still be progress, I didn’t specify good or bad..), an old saying holds strong. “If it ain’t…don’t fix it”.
So by removing as much overhead and putting a spin on the terms, the aim is to drive the masses to those similar goals. Does it mean a smaller “pit of success”? Sure. But it also means the social aspects are really put to the test.
With so much press already here, here and here, it should be interesting to see just how much “value add” there is. Sure, the claim to V8 JavaScript Engine is appealing but how is this for ubiquity?
Another company did it bottom up several years ago as we now witness it being done top down.
What’s the big story of these olympics besides Silverlight enjoying a nice boost in user adoption? How about the folks behind all of the streaming videos, Limelight Networks?
Amongst all the hype, bits of high level information can be found at:
Limelight Networks: Why the Olympics didn’t ‘Melt’ the Internet. Ironically, this is from the same group with the original dramatized predictions.
Others at:
http://blogs.zdnet.com/BTL/?p=9693
http://www.contentinople.com/document.asp?doc_id=158320&page_number=2
http://news.cnet.com/8301-13860_3-10003752-56.html?hhTest=1
http://www.zatznotfunny.com/2008-08/limelight-networks-interview-streaming-the-olympics/
Albeit, this #2 CDN has had its legal troubles and not many papers are published revealing infrastructure details (as opposed to Akamai).
All too often in the software industry, if you are one that follows the latest tools and technologies, you risk getting pigeonholed as the guy who only wants to play with the latest toys. One of the typical sayings being that tools only accelerate your rate of failure (or success)..blah blah blah…
While this is true for some technologists, there are those that look beneath the surface of a technology and truly connect with the problems the new offering is attempting to solve. Most of the time in doing so, you see it is as coal slowly transforming into diamonds. And it is in this potential transformation that excites you as a developer. On the other end of the spectrum, you have the typical “old habits die hard” stereotyped personalities.
In my own past entries, I had mentioned new technologies in passing without fully conveying these. The assumption was that the underlying paradigms were obvious to any observer. But recall the other end of the spectrum? You need to convince those guys you aren’t a bandwagon jumping hippie.
By conveying your focus on paradigm and fundamentals, you can shed more light upon the new technology. No, I’m not talking about the evangelist regurgitations, but the real meaty substance. And ideally, an anecdote or two about life before this “paradigm” and life afterwards. People love war stories; so if you have the scars, feel free to show them. :)