The World According to Marc
-
Do It With Style
Along with the introduction of Windows 8 came the induction of formalized user experience design guidelines. This was a pretty revolutionary step in Windows development. The historic lack of any formal UX guidelines for previous versions of Windows had been bemoaned by for years. Developers were left to their own devices with predictable results; including entire web sites devoted to shaming some of the more horrendous examples.
While some members of the community did an excellent job of attempting to educate...
Read More -
Word as Blog Editor
Did you know that Microsoft Word also makes an excellent blog editor? In fact, this post made using Word 2013. So how do you set up Word for blog editing? It is rather simple, albeit a little round about.
The process starts by opening Microsoft Word and selecting "Blog Post" as the template. This is the convoluted part, even if you are looking to edit and existing post you start by opening a new Blog Post template. Like I said, it is a...
Read More -
Custom Headers with HttpClient
I while back I talked about Basic Authentication with HttpClient. Kaysha posted an excellent question about custom headers for things like User-Agent and Content-Type. Here is how you handle those headers.
HttpClient is extremely simple to use out of the box. Most of the plumbing is automatically handled for you. In some cases however you need to change some of that plumbing. As with most abstractions however, you often need to take a few steps back when you need to change the assumptions...
Read More -
Too Clever By Half
So I'm a bit of a stickler for fool-proof configuration, sometimes to my own detriment. In response to my earlier Bing Maps SDK issue with x64 I thought I would be really clever and just remove x64 as a target platform from the solution configuration. I thought it was clever. Heck, It was clever....too clever it seems.
It turns out that removing a Solution Platform from your solution will result in a rather unceremonious Visual Studio crash when you attempt to Create App Package for...
Read More -
Bing Maps SDK
I've been playing around with the Bing Maps SDK over the holidays. The documentation includes a step-by-step guide for adding Bing Maps to my app that got me up and running. I had to make some small changes like targeting specific CPU and not the default 'Any CPU' target and (since this app is written in C#) I had to add a reference to the Microsoft Visual C++ Runtime Package in addition to the Bing Maps SDK.
Once I had the project...
Read More -
Settings Charm
One of the nice things about Windows 8 for developers adoption of some clearly defined (and long needed) user experience standards. While in the past we relied on conventions (Help -> About for example) those conventions were not always followed and often didn't make a lot of sense (Help -> About for example). A great example of these UX standards are the Charms. Here we'll take a look at the Charm you're most likely to encounter; the Settings Charm.
Why is the...
Read More -
Windows Store Apps
I've run into a couple of developers asking where "Metro Style Apps" went in the RTM version of Visual Studio 2012. Don't worry, they are still there. They just have a new name. That term "Metro" was just a placeholder during the beta phase.
There are two different types of Windows Apps. The first is the classic "Desktop App" which you either buy off the shelf (for those under 20, this is how we "old timers" used to buy our software)...
Read More -
Moved to Azure
Well now I've gone and done it, I've moved this site over to Azure. Overall the experience was pretty painless.
Created a new Windows Server 2012 VM instance
Installed WordPress and MySQL via the Web Platform Installer
Imported my old MySQL Database
I have run into a few issues around MySQL. I exported my old data from MySQL using the only tool at my disposal, an automated backup from my old hosting provider. The problem with this method is that my character set information...
Read More -
Basic HTTP Authentication in WinRT
I'm on vacation right now, getting some much needed time with the family and preparing for my wedding at the end of the week. So what does a geek do in the midst of 6 kids and the chaos of wedding planning? Why build a Metro style app of course. Duh!
For my little application I'm working with a REST API that requires Basic HTTP Authentication. This is pretty commonplace and something I've done it many times in the past in web and Silverlight applications. WinRT was very similar but (as with everything in WinRT) has its own nuances.
If you're using WinRT to call REST APIs (and honestly, who isn't?) you will quickly become familiar the HttpClient class. It is very similar to the older WebClient and it pretty straightforward to use (and very clean thanks to the absolutely awesome await keyboard in .NET 4.5).
https://gist.github.com/mlafleur/3d8413879e02a8c9dacb
In order to pass along the authentication we'll need to add a AuthenticationHeaderValue. This took a little noodling to figure out so hopefully this saves you a bit of time. Basic HTTP authentication is handled by passing "username:password" in the header. In order to do this I needed to create a new AuthenticationHeaderValue with "basic" for the scheme and "username:password" for the value. This gets added to my HttpClient so that every call includes the Authentication information. To do that I created a method called CreateBasicHeader that generates what I need and then call that from inside my original method.
https://gist.github.com/mlafleur/13d1f1353e916e4472a9
As it happens, the particular API I'm calling wants the password in an MD5 Hash rather than plain text. Luckily there was a great sample that showed how to do this. The only change I made was to use EncodeToHexString rather than EncodeToBase64String.
Here is the full sample:
https://gist.github.com/mlafleur/04f93e78d1834e010c4d
-
The Internet is for FUD
Sometimes I think Avenue Q got it wrong; The Internet is for FUD. When it comes to generating Fear, Uncertainty and Doubt the internet reigns supreme. Oh the television was good, but it has limitations. When you need to simultaneously scare the pants off someone in NYC and an uncharted island off the coast of New Guinea, only the internet will do.