This blog has, IMO, some great resources. Unfortunately, some of those resources are becoming less relevant. I'm still blogging, learning tech and helping others...please find me at my new home on

Friday, March 25, 2011

Problems with Diamond DisplayLink BVU160

I run a multi-monitor setup and love the extra real estate.  Unfortunately, due to an error in ordering my PC I ended up with a slim chasis and can’t find a dual-head card that fits. I resorted to using the Diamond USB adapter, which for the most part has been a nice way to get that third monitor running.

But lately this little guy has been causing me headaches.


Here’s the formula:

  • Windows 7 Ultimate x64
  • Diamond BVU160 v1.0 DisplayLink adapter, driver is up to date
  • Windows Phone 7 attached (Samsung Focus)
  • Dell E198FP monitor
  • ATI Radeon HD 3400 Series display drivers, up to date

The screen “freezes” up and does one of two things:

  1. The image is locked in a sense, and only redraws small invalidated regions as I drag my mouse across the monitor.  I can also restore a window, invalidating the whole screen, and get the whole thing to redraw.  This works a few times, but then the screen goes black.
  2. It skips #1 (or I just don’t notice as I’m working on a different monitor) and just goes black.

At this point I have to unplug the power of the monitor (power cycling doesn’t do anything, I have to physically remove the AC cable), disconnect the Diamond adapter, reconnect power and then attach the USB adapter again.

This is happening about 2-3 times a day when I have the phone connected and the display adapter is almost hot to the touch when it gets to this state.

I have a fairly high level of certainty that this is related to a conflict with Diamond’s adapter and Windows Phone.  It only ever freezes like this with the WP7 device attached.  I thought it was perhaps Folding@Home, but I uninstalled that and I’m still getting this problem.

If anyone else is running into this and has a workaround, please let me know!

Wednesday, March 23, 2011

How Windows Phone 7 Could Fail in Canada

Folks, let me start by saying that I love my Samsung Focus.  Everyone’s seen an iPhone by now, but you can still turn heads when you’re zipping through the home screen on a WP7 device.  The interface is slick, the apps you need are mostly in the marketplace and the cooler ones – I’m still waiting for the possibilities of augmented reality apps with video and compass APIs – are on the way.

The phone is well integrated into my other communication points, from email and messaging to scheduling and sharing, and though I’m a heavy user I’ve seen little by the way of bugs.

But I live in Canada.  And the sale of this phone platform to my friends will be tough.  It’s not because the platform isn’t great – and I do think WP7 phones are on a great platform – it’s because the phones in Canada are crippled.

The Show Me Factor

We are moving away from a people with music players to a people with multifunction devices that have music players on them.  At least, those of us with the ability to support a smartphone contract are.  Well, us and the teenagers whose parents spoil them, but I digress.  I had my first MP3 player over 10 years ago and haven’t missed it a bit.

But the music marketplace in Canada Sucks.  Yes, “sucks” with a capital “S”.  We have very limited choices in where we can purchase our digital content outside of the iVerse.  I’ve used Puretracks and played with the paid versions of some other services but not all the content I want is there and I’ve previously had troubles with DRM content on mulitple devices.

I want my family – we have four PCs all running Windows 7 as well our our Xbox 360 – to be able to use something more fluid within our ecosystem, connected to and built into the devices we use.

Including our phones.

Look, there’s going to be a point where people will have seen it/been there/done that and if the experience isn’t positive they won’t want to go there again.  There’s a really good, but shortening, window that Microsoft should be able to leverage.

The Switchover Debate

Look, if I can’t convince my wife, my soul mate, my partner until forever to buy a Windows Phone device then I’m not going to get too far with others.  These things should sell themselves, but this media marketplace keeps kicking WP7 in the face.

We’ve talked about the switch to a smart phone and she’s been leaning towards an iPhone for some time.  All of her music is in iTunes and we’d need to spend some time converting it (in some cases with DRM that might not be possible) and then we’d be left with the purchase void.

That chasm is too far to cross at the moment.  We’ve agreed to wait for a bit to see if the marketplace changes, but at this point it’s a wide open yawn’s worth of information available and no one is giving any updated information.  For fully three years we’ve been hearing “Keep checking the Zune web site for your region” and nothing more.

Challenge #1 - Marketing

I eagerly waited for the Zune HD here in Canada, only to have my hopes dashed when Future Shop pulled the remaining original Zune devices from the shelves.  A new employee said to me, literally three days after I almost bought one, that he’d never even heard of Zune.

What?!  How could that be?  How could the only device poised to be an iPod killer not even enter the general population’s vernacular? We are talking about a company who did the unthinkable here and broke into the video game industry, a move previously believed impossible as the market already had enough players.  How could, in this young and developing area with few serious players, Microsoft miss the boat with visibility?

The same thing seems to be happening with Windows Phone.  I can still walk into a room of people completely unaware that WP7 devices were actually out.

Challenge #2 – The Marketplace

This appears as #2 on my list, but not because it’s less important.  I will say this as directly as possible, Microsoft: the music marketplace must be fixed.

Technically, it’s not broken.  Because it’s not here.  This is the number one reason my wife won’t buy into the ecosystem, and it’s almost always one of the first things I’m asked of when I’m showing my phone.  You fire up Shazam and it’s right in your face: excellent execution followed by a lack of follow-through.

I am a sell out here, folks and I know it.  I’m a die hard.  This is a platform with great potential and I’ve even gone so far as to evaluate my “grey area” options (US credit card, friend’s address).  But I’d much rather see the ecosystem change for WP7 in Canada so that we can do things legitimately and without hassle.

I understand that there may be other problems.  I’ve heard everything from the CRTC blocking Microsoft, to third party licensing complications, to Apple threatening to make things messy.  But Microsoft hasn’t said peep squat about what the problems are.

Challenge #3 – Marketing

Yes, it’s the same as reason one, but different.  You see, the thing is that Apple didn’t sell it’s iPods to the millions of customers that have them.  The other customers did. Unfortunately, proud Canadians wielding their WP7 phones are ill-equipped to make the sale.

Heck, even the stores clerks aren’t really there as far as sales pitches.  When I asked to see the Focus at Future Shop, I was greeted with a, “Really? Why?”.  He was even more shocked when I took it home with me.

I’m not selling these phones and I don’t work for a cell phone company or Microsoft (yetWinking smile), but if a guy can’t convince his wife to get one, we’ve got a problem.  Shoot, I even convinced her to marry me, but I can’t pawn a phone on her!

The Fix

Actually, Fixes.  It’s plural.  Here are the things that can right the course for this beauty of a ship:

  1. Figure out the content licensing and make music available in the marketplace. If it’s a ways out, for now you must, must clearly communicate what the issues are.  Customers would be happy to lobby any group that is blocking the process.
  2. Set up Zune Pass now, even at a lower cost and with limited content. Get buy in from the Canadian content providers to get them in the streaming mix be it independent radio stations, the CBC, CTV or the sports broadcasters. Flesh out the product and give Canadians the same level of product that’s available in other countries around the world.
  3. Give out some more free phones.  Future Shop wouldn’t even let me play with one of WP7 phones until I said I was surely going to buy one.  They wouldn’t take it out of the box.  This is wrong and bad and a poor purchase experience and bad, too.  Apple has kiosks setup to demo different models of the iPod/Pad/Phone/Thing and for WP7 I get to look at a cellophane wrapped box? Boo!
  4. Increase visibility.  Get storefront space. Encourage cell phone dealers to use and promote the phone.  Roger’s booth in our mall here had the iPhone 4 announcement posters up six weeks before the phone was launched.  There is still nothing in the mall about WP7.  Nada.

I am a software developer and though my previous experience has been on other platforms and technologies, right now I work exclusively on the MS stack.  I am going to MIX11 and am super pumped to see what the year ahead will bring us.

I’ve already come to terms with the fact that most of my concerns will not be addressed by the time the event rolls around, but you can be sure I’ll be sharing my thoughts with whomever will give me an audience.  Basically, it’s a conference where I’ll be hanging out with a ton of folks who’s phones are cooler than mine; sadly, we’ll have the same phone.

This is a phone that can really give customers a fresh experience with a unique level of integration with communication, search, maps, gaming and social networking.  I really hope that WP7 survives in Canada long enough to bear the fruit it is longing to produce.

Sunday, March 20, 2011

jQuery IntelliSense with ASP.NET MVC and the Razor View Engine

The Razor view engine in ASP.NET MVC3 brings great improvements to the readability of code in the view.  Unfortunately, some of what I’d previously lamented in missed productivity improvements has stuck around.

If you are working with Razor’s reimplementation of Master Pages – Layouts – then you will likely run into the same kind of limitations with IntelliSense that existed in previous ASP.NET editors: you simply don’t get IntelliSense for jQuery on your views when you include the script reference in your _Layout.cshtml.

Enabling IntelliSense

The only way to get those digits moving at the speed of computer-type-it-for-me is to add the script references to your view.  Because we don’t want the script written to the page twice – once through the viewstart/layout and once through the view – we simply use our old if(false) trick (see part way down) to get IntelliSense back online.

@if (false)
    <script src="../../Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui.min.js" type="text/javascript"></script>

Write the if block out and then drag and drop the files from your scripts folder in the Solution Explorer as an easy way to do this.  Once you’ve done this once, you can then put it in your Toolbox by highlighting the code and dragging it to the Toolbox window.  Here, I’m about to rename it to something more useful:


How This Could Be Fixed

To understand why it’s not working we have to look at what the IDE is aware of and what it does to figure out what styles/scripts are available in the editor.

When you’re on a view, Visual Studio doesn’t really know which layout will be used to render the view.  In some cases you may have many and you may be dynamically selecting it based on, for instance, the role of a logged in user.

However, we also know that the MVC Framework relies heavily on convention, and chances are that the default, most-used scenario with the ViewStart/_Layout.cshtml being used is likely the one that most folks will be dealing with.

So I would propose this: in the event that there is only one _Layout in the Views folder, assume that this is the one that will be used. Infer style sheet and script references from this file and enable IntelliSense based on the same.

Making the Most of It

Well, we’re set to receive up to a total of 35cm of snow in the next 24 hours. With the gorgeous weather at hand, but the threat of a raging river looming, you need to do something to take your mind off the impending flood.

We had a great afternoon of sledding, snow ball fights, snowman building and hot chocolate with marshmallows.


Mr. Frosty here is a good 45cm taller than my son. An incredible afternoon.

After completing the snow adventures we drove back home past the sandbagging efforts of the city, which are required in order to keep major traffic routes from being submerged.

Thursday, March 17, 2011

ASP.NET MVC3: The Razor View Engine and Text

I knew this, but I had a brain fart here and couldn’t figure out what was wrong. I was trying to output some simple text to the browser based on some condition:


I started to get the following error message:

The type or namespace name 'Do' could not be found (are you missing a using directive or an assembly reference?)

Along with a list of others:


But nothing really said what was wrong.

Nothing’s really wrong, per se, but Razor can’t figure out what I want to do here and doesn’t know that Do should be text and not me trying to code something. To fix it, simply wrap the text in a <span> tag and roll:


Tada! </facepalm>

The only reason I ran into this was because I copy & pasted the text. Normally you’d get IntelliSense as soon as you start typing and that should throw up a context flag pretty quick.

Tuesday, March 15, 2011

Google News Fail

Ran into this today when checking the news:


The headline reads: Japan’s PM warns of radiation risk

The body of text below: Scientists say they may have discovered the lost city of Atlantis buried deep under the marshlands of southern Spain, north of Cadiz and near the Straights of Gibraltar.

Sunday, March 6, 2011

Who’s Smarter Now, Mr. Computer?

The New York Times have posted the game Rock-Paper-Scissors – You vs. the Computer in the wake of the big Watson computer win over the human Jeopardy contestants.  They reduce AI to “building on simple rules and statistical averages” and present a game of chance, with some big claims.

They have two versions of the game, one that has to learn as it plays, the other that has some experience in the mix.

Picking an Opponent

I’m no rookie, I have been known to dominate the RPS scene at my office and I know how to stare down an opponent.  Oh, wait…shoot.  I start with the sure-fire winner, the one you should put your money on.

The Veteran Presence

So here’s their idea…after several rounds of play their computer will use statistical analysis to figure out your strategy, backed by 200,000 previous rounds of play. They don’t define the 200,000 rounds – as in, were they human played, were they 200,000 different people, if nationality or race or education played in – but for some reason that’s enough data to “exploit a person’s tendencies”, and yet, I have my doubts.

I decided to play 40 rounds.  If there was anything akin to AI in the pot, this thing should at least win one third of its games.

Here’s where I was a few moves in:


While it made some ground up towards the end, I was able to hold it off of any streak and the closest it got was within two.


After that, I teetered on +2-3 points and as high at +4-5 points, and ended up +4 over the computer, thus solidly proving that, minimally, if we’re going to partner a game of chance with technology called “AI”, we have a long way to go.


There was no stopping me by some ‘simple rules’ engine. ;o)

I want to point something important out about this statistic: for the one who is winning more that the opponent and the tie, they are beating the odds.  I am a combined +10 on 40 rounds here at the end of the game, meaning that not only am I beating an expert player, but I’m beating the tie-chance handily as well.

Bring in the Rookie

Finally, I tried out the “dumb” version, the rookie alter-ego that must first learn the rules and doesn’t get the benefit of 200,000 other players’ moves in a database.  I decided to give it an extra 5 moves as a chance to learn some of the rules before getting into the play.


What? Shocker?! How could it be that with 5 more moves against an (arguably) weaker opponent I could have fewer wins?!

Oh right…it a freeking game of chance. Unless you put on your idiot cap and play the same hand each time, this is a game of odds and they are 1/3, 1/3, 1/3 as to what I’ll play next.  Period.  Just because 200,000 other people picked R-R-P-S-S-R before me doesn’t mean that I’ll play P instead of R on my next move.

This is not a prediction, even when backed by hundreds of thousands of records, not any more than a lady in a tent with a lit glass ball.  Over time I will win 33%, lose 33% and tie 33%.  It’s no different than a coin toss, with one more side to the coin.

The only learning that this ‘AI’ does is around the rules of the game.  To that end, there’s only really six (counting ties), and it seems to know when it’s learned them all, suggesting a bias in the first place.

Okay, Yeah, But…

There’s more going on. I know it does some pattern matching and what not, but that doesn’t mean it’s AI.

After playing these games I walked through it’s demonstration about how it thinks.  It uses some good buzz words making it sound like it’s thinking, but really, this is just straightforward math equations muxed with some simple filtering that any first year CompSci student should be able to figure out. 

No magic here, folks, move along.


The programmers at the New York Times have created a good gimmick that will fool most of the general population into believing that they have created some form of artificial intelligence that, when it mates with Watson, is ready to techno-freak the humans into submission. 

Hey, it may even be an impressive chunk of code, but it does not represent any of the modern complexities that some impressive minds (like those at IBM) have solved.

I could likely to write a version just as capable by picking randomly the answer.

Better yet, I’m going to write a traffic light color prediction engine. 

Look out, Matrix, we’re all about to take the blue pill. Or was that the red?

Saturday, March 5, 2011

This update improves the experience of updating your phone in the future.

Well, it’s arrived, my phone’s hit the list for updating.  I got the notification on my phone and plugged it into my laptop to start the process.  My update was delayed as I was on the brick list; I have a Samsung Focus.


First Things First

Before I was able to apply the update, Windows Phone 7 required an update to Zune. 


This process took about four minutes, including the download.


Updating the Phone

After the Zune update was complete the software shut down but did not restart on its own.  I left my phone plugged in, but was not prompted to update.

When I restarted Zune I had to go into Settings->Update where I was able to launch the update process.


The only thing different this time around was that the warning had been updated to note that telephony would be disabled.


The estimate was 20 minutes for the entire process and I was on step 6 of 9 in about 15 seconds, so I was optimistic.


When the reboot was complete the updates were pushed to the phone and the computer installed new device drivers. One more reboot, the updates completed installation, and the phone was as good as gold!


Total time: 18 minutes, start to finish.

Thursday, March 3, 2011

Windows Phone 7 Wishlist #3

There are two things I am looking forward to in a big way, but not on my wish list (because these will be realized for sure):

  1. The upgrade to HSPA+ in my area, and,
  2. The Windows Phone 7 first update.

I’ll get to my wish list in a moment.

I am stuck on the Edge service network because of my locale. The towers were upgraded months ago, but one of the partners in the carrier network (not mine) have equipment and services and software older than bunk and they can’t flip the switch until everyone’s ready. This is going to happen in days and I can’t wait until I’m pulling down 7Mbps on my phone.

I have a Samsung device and have not yet received the update. I’m not sure if it’s a candidate thing, or a rolling update thing, or even if my carrier is blocking it (I’ve heard all three) but I am looking forward to the pre-update update that is currently in the works, especially as it paves the way for The-Big-One in the next few weeks.

I wondered here if my carrier might be blocking the update, but I don't think that could really be the case. The phone checks for updates, likely directly to a WP7 service, and the device itself is updated through the Zune software on PC.

Here’s My List

  • I would like a way to search my text messages. This is present in mail, so it seems like it’s not too far fetched in texts. I had someone text me the phone number of my friend ‘Mike’, but I couldn’t remember who sent it to me. The text was something like “Hey Mike’s new cell is…” so I should have been able to find it fairly easily.
  • I would like an editor for my alarms and ring tones. Build it into Zune, or make a Windows Live ZuneTone application that you can download and make your own ringtones and alarms. Let me set cues for vibration. Let me shift pitch and even layer multiple audio tracks. Let me share it through Zune or Live or something with my friends.
  • A first-party, no frills sound recorder. The same level of function as the one built in to Windows 7. In fact, I would love it if I could also use the audio jack as a line in to record. I volunteer on a regular basis and work the sound board (or at least help) and I hate lugging around a laptop to record the audio.
  • Because I feel as strongly as I do about this, I’m going to say it again: Canadians want to pay for their content. Please make Zune Pass available in Canada. If this plea doesn’t work, I’m going to track down folks at MIX11 and talk to them in person! ;o)

I have a couple of other items on my list, as mentioned previously:

Extension Methods for Converting ints and bools

I was recently working on a chunk of code where I had three different scenarios for conversion.  With two external libraries (something I couldn’t change) and this not being a big enough project (so not worth a facade) as driving factors I rolled a couple of simple to use extension methods.

The Code

I won’t lollygag here too much.  You need a namespace and static class name that work for your (they’re more-or-less irrelevant in the grander scheme), and a couple of static methods.

namespace ExtensionMethods
    public static class Extensions
        public static bool ToBool(this int i)
            return i == 0 ? false : true;

        public static int ToInt(this bool b)
            return b ? 1 : 0;

        public static int ToInt(this bool? b)
            return b.HasValue ? (b.Value ? 1 : 0) : 0;

Basically, we’re just using a tertiary operation to decide which value is appropriate to use in each of the contexts.

The third method is there to help out with nullable boolean values.  This was handy in my case, not sure how many people would need this.