Shawn Wildermuth


My Rants and Raves about technology, programming, everything else...

Using ASP.NET Authentication in Web API

Web API is a pretty sexy REST stack (though others are cool too). As I’ve been talking about it a lot lately, the biggest question by far is authentication and authorization. There are many options including OAuth, Token-based authentication, basic authentication, and even custom solutions. One option that should be included is to use your existing ASP.NET Forms-Based Authentication.

As a preview to my recently released course on ASP.NET Web API, we’ve released a clip that shows you how to piggy-back on ASP.NET Authentication to protect your Web API interfaces:

JavaScript Function Scopes

As some of you know, I authored a Pluralsight course on JavaScript for C# Developers. We’ve released an excerpt from that course covering how JavaScript function scopes work.

If you’re just getting started learning JavaScript, it can be easy to bring your C# biases to the language since they both have curly braces. Hopefully this excerpt will help:

My Opinions in eBook Form

I recently released my new writing project: “The Opinionated Software Developer”. This short book (about 35 pages according to Kindle) is a quick look at my experience in software development. It includes a history of my experience in the field as well as a look at the software developer psyche. The hope was to share my opinions about being a developer in the industry including how to deal with co-workers, how to avoid being a brat developer and how to motivate developers in larger organizations.

Editing Styles with Firebug

firebugMost developers I know simply hate web design. As far as many developers are concerned CSS is evil. What CSS does for the web is magical but can be painful for developers that are used to functional or structural languages.

Luckily the browsers come to the rescue with great tooling. Here is a preview from my “Debugging the Web” Pluralsight course” which shows some of the basics:

Getting Ready for AngularJS 1.2

AngularJS is going through their release cycle now and that means that AngularJS 1.2 is going to be released soon with some specific changes that you'll need to address. I'll be updating my Pluralsight Course with the 1.2 changes as soon as the new version ships.

The biggest change for most people is the routing support is now packaged separately. To use routing you'll need to do two things:

Refactoring Nested CSS Rules using LESS

One of my favorite features of LESS is the ability to simplify my CSS rules that are deeply nested by using LESS to compose them more simply. I like this feature because it gives me the ability to clean up messy CSS files and make them more maintainable. Take a look to see what I am talking about.

LESS is an open-source dynamic stylesheet language for adding features to the CSS language that help you build better CSS. LESS parsing is supported in the free Web Essentials extension for Visual Studio 2012 and 2013 (though not supported for the Express editions) as well as in the free WebMatrix tool from Microsoft. It is also supported in most IDEs, as a JavaScript library and even a command-line LESS builder.

Debugging Like a Knucklehead

So I've been writing a new Web API course Pluralsight. I am digging in how to handle versioning for an API and I think I've gotten it figured out but it just doesn't work. Throwing a crazy exception and just isn't working. I waste four hours trying to figure it out and I am cursing and grunting. The other people in the coffee shop are staring.

I spend a bunch of time on Google trying to find someone with a similar problem but no luck. Looking at the data and walking through the bug with the debugger didn't yield anything. Desperate, I reach out to Glenn Block himself for an answer. He's very gracious and agrees to help me out with a quick Skype session.

DevLink 2013

Thanks to everyone for attending my sessions at this year's DevLink 2013 conference in Chattanooga, TN. I had a great time at the aquarium and enjoyed meeting so many of the attendees. If you get a chance, you should add this to your conference attendance next year.

I gave two talks at this year's event. I promised the attendees to get them the code from my talks. Here they are:

Zen Coding (Emmit) with Visual Studio

As many of you know, I have a new course with Pluralsight called "Building a Site with Bootstrap, AngularJS, ASP.NET, EF and Azure". I had the opportunity to use Zen Coding (renamed Emmet for some reason) in the course. We've released a snippet of the course on YouTube that shows off this cool productivity enhancement that Web Essentials powers. Caveat: Web Essentials doesn't work with free versions of Visual Studio.

NOTE: The title of the video is incorrect and we're trying to change it...it is about Zen coding.

Atlanta Code Camp 2013: Done!

I want to thank all the attendees, speakers and my compatriots in planning the Atlanta Code Camp. I had a great time helping make this event the best one we've had so far. Some of the numbers:

428 attendees (including speakers and sponsors)

Need LINQ but Writing JavaScript?

sketchArchOne of the tasks that I found cumbersome when writing JavaScript is simple collection manipulation. I have gotten spoiled in C# with LINQ. Sorting, filtering, shaping and more is easy with LINQ but what about in JavaScript? Underscore.js to the rescue.

Underscore.js is a small utility library that can help in collection manipulation (as well as other great features). I first started using Underscore.js to replace jQuery's (and AngularJS's) for-each implementations. I find underscore's simple and quick. Like much of JavaScript, the magic is happening in a callback function (think Lambda):

Is It Too Late for Windows RT Tablets?

imageAndroid tablets were a joke. I remember being at a MIX when the Xamarin guys (before Xamarin was Xamarin) were showing off Moonlight on Motorola Xoom tablets. I overheard them complain how bad the devices were compared to their iPad test machines. That was PN7 or Pre-Nexus 7. Sure the Kindle came first, but the real switch for Android tablets was the exceptional Nexus 7. They proved that the OS was usable and that a device was desirable. And they did it for $199. The Nexus 7 was a hit…very late into game. They knew that if they sold it at cost or better that people would learn to believe that Android was more than a haven for Linux-heads.

The problem with the Surface is that Microsoft wanted to make money on it. I know that's their business, but the Surface should have been the loss-leader that got the hardware community to build great tablets around Windows 8. But that didn't happen. Surface RT was $499 at launch (actually $399 but $499 was the right size one). $519 with a touch keyboard. This lined it up against a very successful product but it wasn't going to change any minds of people that already bought it.

My New Web Development Course is Live

Are you getting ready to build a new website? Are you interested in shortening your development by using Bootstrap, AngularJS, Azure and ASP.NET? If so, my new course might be just for you.

In this new course I build a new web site from scratch. I start out with a Bootstrap template (since my design skills suck) and move through creating content, building a database, exposing a REST-ful API and building a Single Page Application. I wrap it up by publishing the site to Azure Web Sites showing you how to not only get your application up an running in the cloud, but also how to monitor it and handle standard tasks like using your own domain in Azure.

My AngularJS Talk at Atlanta .NET UG

Thanks to all who showed up to see me talk about AngularJS at the recent Atlanta .NET User's Group. At the talk, I wrote the client-side code for an AngularJS app by hand. The slides are pretty thin, but the code includes all the functionality I showed. I promised the slides and code so here they are!

If you have questions about any of this, feel free to comment and I'll help as much as I can!

My First Week With Nokia Lumia 1020

imageA week ago I splurged and upgraded my Lumia 920 to the Lumia 1020. So to those of you who were expecting me to switch over the Android or an iDevice; I'm still entrenched in the Windows Phone world. And this phone cements my opinion to stay.  Let's talk about the good and the bad.

I like the weight. I was worried that with the camera bulge that this would feel like a much bigger device but if anything it feels smaller than the 920. I haven't looked up the weight but it feels really nice. I actually find the camera bulge useful as a pivot point to hold the phone.

JavaScript Promises

pinky-promiseNo I am not talking the promise that JavaScript will fix everything if you use it. I don't even believe that ;) I am talking about the concept of a promise object that several JavaScript libraries use (including AngularJS, jQuery, Dojo and WinJS).

A promise is a pattern for handling asynchronous operations. The problem is that essentially when you start an asynchronous operation, you need to execute some code as the operation is completed. Asynchronous code is so common that most libraries have found a solution for passing in callbacks. But there is little commonality to how each libraries does this. Let's take jQuery as an example:

750 Windows Phone Apps?

1020Today I picked up a Lumia 1020. I am impressed with the camera as you'd expect but I am also loving the size. It's about the same size as the 920 except for the extra camera bump. It feels lighter than I expected. The AMOLED screen with Gorilla Glass 3 looks great too.

While I was setting up the new phone, I headed over to Windows Phone's website to install my apps. The website has a feature called "purchase history" that allows you to look at what apps you've purchased and re-install them on your phone with a single click. What is interesting is that it seems I've installed over 750 apps over the time I've had with Windows phone. Yeah…750. I was surprised too.

Forcing Orientation in WinRT

7d703de7-03a1-4a9b-8425-841ae065c30fI am working with a client on an enterprise Win8 app that is for order taking. They have a specific page that they require to be only in Portrait mode while the rest of the app can support any orientation. Since I've done so much Windows Phone 7/8 work I thought this would be simple. Just specify the value on the Page. But this didn't work…

Digging through the docs I found a probable solution: DisplayProperties.AutoRotationPreferences (in the Windows.Graphics.Display namespace). The docs specify that this property can be set with the DisplayOrientations enumeration to specify which of the four orientations to support. The enumeration is a flag so you can combine them too:

Designing APIs for the Web

Ever get perplexed when designing your API for the web? My new course is now available on PluralSight that helps you design your API. The course covers:

You can view the course here:

Building Atlanta Code Camp Website

I recently helped the Atlanta Code Camp effort by building them a new website. You can see it here: Atlanta Code Camp.  I am pretty proud of what I was able to accomplish in the scant number of hours I had to build it. It's not done as we need to improve it when we have the speakers chosen and set up the schedule, but so far I am pretty happy with it.

I had a number of goals for the project:

Speak at the Atlanta Code Camp 2013

logo-verticalI've been honored to help put together the Atlanta Code Camp this year. This year's event is happening on August 24th here in Atlanta and we're expecting to have eight tracks covering a mix of developer, designer and some IT professional talks. I've attended this event the past eight or so years and it's always a good time. I decided it was time to help out.

We've now opening our Call for Speakers. If you're an experienced speaker or want to do your first talk – we want you to submit talks to the Atlanta Code Camp. This event has done a great job in helping first time speakers get started with their first talk.

Evolving Your Development Skills

TeachingOnGlassIn the last couple of years, I've been adding the HTML/JS/CSS skillset to my stack of required skills and my talks and courses have reflected that change. To my readers who are deep in the XAML stack, this change seems to have come at somewhat a shock to many. I've even been accused by some of abandoning the Silverlight, WPF, Win8, WinPhone folks. This has caused me a lot of frustration because I don't believe that developers can or should only know one possible stack. To reach the full breadth of users, sometimes you need to be able to develop across the ecosystems. In this same time, I've also done quite a number of HTML/JS/CSS talks where I didn't use Visual Studio. Some have conjectured whether I am moving away from the Microsoft stack as a result of the lessened use of Visual Studio in my demos. The frank answer is: nope.

So what is really happening here? I believe the development world is evolving. In fact, this isn't new…in the past 26 years everything has continued to change my entire career. And I expect (and hope) it continues. Software development is unlike many other similar professions. We think of ourselves as engineers but many engineering professions the rules don't change all that often. In civil and mechanical engineering, it can be somewhat stagnant. The requirements change, but torque and setbacks are similar to what they've been for years (AFAIK). But in software everything changes.

An Engagement

IMG_0008I try to keep this blog relatively technology focused but sometimes something happens in my life that requires an announcement. I am also mentioning it here because I think it makes a good story:

I just got back from SDP13 in Israel and spent 10 days in that lovely country. With this trip planned, I thought it a perfect time to ask my girlfriend to marry me. I'm 44 and I've never been married so it's about time, right? Unfortunately we had a minor argument and in my haste I texted "Maybe I'm not getting married…" This text was meant for a friend of mine who I'd been confiding in about the whole diamond buying experience.  But this text went to my lovely girlfriend instead. Foiled by technology again. So the cat was out of the bag and I didn't think I could surprise her with the ring in Israel.

Debugging PhoneGap with the Android Console

facepalm4If you build PhoneGap apps and test with the browser, moving to phones sometimes causes a boatload of problems. Because there isn't a great debugging story, being able to see the console window would be of great help.

My particular problem was that my JavaScript and CSS links weren't cased correctly. And it seems that the Android implementation is case sensitive (like most Linux implementations) but I couldn't even see what was wrong. Unfortunately the PhoneGap Build tools let's you use the console and interrogate the DOM but console log messages are lost. So I simply dropped down to the Android SDK.

The New Design

TeachingOnGlassAfter my recent talk on Mobile-First Design, one of the attendees tweeted that he thought it was ironic that my talk was on responsive design but my blog wasn't mobile-friendly. I told him that my company site was…but that was a cop-out. I hadn't had time to get the blog setup with a good template. So voila! I haven't confirmed that everything works the way I want but we should be close!

As some of you might not know, I don't use a blog engine (it's just a custom ASP.NET MVC site). What I love about ASP.NET MVC, is that since the markup so fairly separated from the code (I try and use as little actual Razor markup as possible), skinning it with a new Bootstrap template was pretty simple. It took me about 8 hours to convert it all.


Application Name WilderBlog Environment Name Production
Application Ver 1.1.0.0 Runtime Framework .NETCoreApp,Version=v1.1
App Path D:\home\site\wwwroot Runtime Version .NET Core 4.6.25211.01
Operating System Microsoft Windows 6.2.9200 Runtime Arch X86