This is me blogging the experience of programming at the speed of me. I work mostly on web apps and Windows Phone 7 and enjoy writing about the ups and downs of development in those spaces. I program on the .NET stack, am lovin' Windows 7 and Visual Studio 2010. Truth be told, the only ones that call me 'Mister James' are the three- and four-year-olds at Sunday school. But I'll take what I can get...
Thursday, April 21, 2011
Time to Move On
Monday, April 4, 2011
Canadians Pay for Music
…but you have to let us at it.
In 2010 Canadians purchased 31.5 million albums. Folks, that’s darn near the equivalent of one CD per person in the country.
I’m guessing the average album would have sold around the $10 mark. A digital music store would have taken $3.33 of that.
I hate to continually flog the Zune folks here, but I fail to understand how there is absolutely NO UPDATE or additional information of music in the Zune Marketplace. I started following a few threads in the forums and it seems there is a rising level of frustration, more with the fact that there are no straight answers.
Like I’ve previously said, tell me who the hold up is, and I’d be happy to chase resolution.
This is a market worth 1/3 of a billion dollars, and one that will continue to grow when Canadians have access to reasonable digital content from multiple competitors at a fair price.
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:
- 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.
- 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 (yet), 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:
- 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.
- 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.
- 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!
- 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.