Scott Hanselman

Root Cause Analysis for Toddlers and Medical Eyeball Tweezers

April 19, '12 Comments [51] Posted in Musings
Sponsored By

Eye picture from BMJThis has been a very stressful week. Our four year old had a piece of metal in his cornea. Twice. That's two different pieces over multiple days in the same eye. In one week. He's great now, no lasting damage and no vision trouble. That's not his eye pictured at right.

He was having trouble sleeping and was complaining about his eye hurting. He's had eyelashes in his eye before so we check it out, didn't see much, and flushed with saline eye drops anyway. He wouldn't fall asleep and kept waking in a start. About 1 in the morning it was clear that he was in some considerable pain and wasn't going to sleep. We looked again with a bright flashlight. Turns out that little kids not only don't like standing still but they don't like staying still with a bright light in their eyeball. We did get a hint of something, right on the surface of the eye next to the pupil. I couldn't get it out with the edge of a tissue so we headed to the emergency room.

The very kind doctor at the ER took a look with a slit lamp and exclaimed: "It's something metal!" She numbed the eye and tried to remove it but quickly decided it was out of her expertise and call the on call ophthalmologist. They woke up the eye surgeon and brought him in to check it out. We found ourselves with a tired toddler and a tired (but kind) eye doctor after 2am trying to get this metal out of his little eye with some kind of special set of medical eyeball tweezers. Again, may I mention that while my son is and was a trooper, no one likes to hear "eyeball" and "tweezers" in the same sentence, especially when combined into one super scary term: "medical eyeball tweezers."

His patience exhausted, my baby fell asleep crying. The doctor said I got all the metal and 80% of the rust.

Rust? Yes, rust. Rust that looks roughly like this.

Rust rings in your eyeball

Iron rusts in the eye very quickly and creates a rust ring (iron oxide). That ring often needs to be removed as well usually with the equivalent of an "eyeball Dremel tool," like this one below.

Eye Dremel picture from @mycastleproject

We were told to return the following day to get the remainder of the rust. We went home, tired but feeling reasonably comfortable that this strange thing was a fluke and that everything would be cool. The following day an attempt was made to get the last bit of rust but bless him, he wouldn't stay still so the we and doctor decided against further trauma. The chances are that the very small bit of rust will just dissipate. If not, we'd deal with it later when he's older.

My son went to school and the next day came home complaining about his eye. The doctor had said it would feel like there was something in his eye (even though it had been removed) and that this was common. However, he couldn't sleep and insisted something was wrong. We have learned to listen to little people, even and especially at 2am.

There was something new in his eye - the same eye.

I could only assume that the doctor didn't get everything the last time. Off to the ER again (don't mess with eyes) but this time they were not wiling to wake up the eye doctor. We saw him a few hours later first thing in the morning. I asked if it was the same piece and he said, "no, it's the same eye but a different location. You can tell because the original rust ring is a marker."

He was shocked to say the least. "In 30 years I've never seen someone get something in their eye twice. Not even in people who grind metal for a living."

He tried to get it out but my baby wasn't having it. The decision was made (and not lightly) to use general anesthesia to perform the eye surgery procedure and get it out. This kind of thing requires one stays completely still and you just can't ask a 4 year old to do that.

I just couldn't get my head around the idea that this was a new piece of metal. What if a third one showed up? What was he doing or what was he around to cause this? Was he banging metal cars together? Was it shavings off his metal bed? Maybe sandbox sand being thrown in the air? Something from our new car?

My wife and I became obsessed with "root causing." I spent a day moving through my son's life, touching everything. Toys, beds, toothbrushes, car seats, furniture. No luck.

We were at the hospital yesterday and he was put under and had the procedure done. The doctor said it was successful and not only did he get th second piece of metal out but also cleaned up the now two rust rings.

We asked again, "How do we keep this from happening again?"

The doctor said, "You've got to find the cause or it very well could reoccur. The thing is..." he reiterated, "I've never seen this, even in metal grinders or folks in manufacturing."

We took baby home with a healthy dose of paranoia. Should he wear glasses until this is figured out? Then we had an idea. Where does a 4 year old come in contact with grinding metal. Why our son and not the other kids?

Wait. Metal grinders. Where does my son go where metal grinds together?

The playground swing. Specifically the tire swing. I've seen him spin on the swing for hours with his head parallel to the ground, eyes wide open looking at the clouds.

I went to the playground, found the swing and touched the metal ball where the hip joint fits into the bearings. My finger came out covered in what looked like glitter. Metal shavings. The tire swing joint was dry and cold - effectively a metal grinder rotating directly over his eyes.

There's nothing more satisfying than The Answer.

Tire Swing photo by Craigie3000. Used under CC.

I spoke to the principal of the school and he made some calls and actually spoke to the designer of the playground product who hooked him up with the designer of the swivel. They are swapping the Tire Swing Hanger for a Heavy Duty hanger that includes a rubber boot to cover the joint.Tire SwivelHeavy Duty Tire Swivel

This was a clear and satisfying end to a very painful experience for the little guy. I'm just happy we figured it out but I think we are going to be paranoid about eyeballs for a the foreseeable future.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Given I like reading Source Code by the fire with my smoking jacket and brandy snifter, a list of books

April 17, '12 Comments [34] Posted in Open Source | Source Code
Sponsored By

lilwaynesomecodeandsomebrandyJeff had a blog post yesterday (seems everything he writes in his retirement gets on Hacker News as well) about reading source code. While Jeff's post is largely a pull-quote of a post on Hacker News by Brandon Bloom, one bit stuck out to me as I'm sure it did to others.

"The idea that you'd settle down in a deep leather chair with your smoking jacket and a snifter of brandy for a fine evening of reading through someone else's code is absurd." - Jeff Atwood.

Absurd? Hardly. Nearly every programmer I've ever spoken to enjoys reading and discovering new code. I've been advocating that Developers need to read as much code as they write for at least half the time I've been blogging (10 years now, as of yesterday.) How could you not be excited about reading source with all the wonderful open source that's available in the world today?

In fact I have an entire category of my blog called the "Weekly Source Code" with 58 different specific entries at last code. That's 58 different great opportunities to read and learn from another programmer, some good some bad.

The idea that reading source code is absurd is really the wrong message to send. Here's a list of interesting books about source and source code that I'd recommend you settle down in your leather chair, stoke the fire and read.

Of course, you don't need to buy any of these books or pay for anything. Just read code. Read your coworkers code, your company's code, your favorite open source library's code. Don't stop reading code.

The Weekly Source Code was weekly but then become "whenever I get the time." Because of Jeff's article I'm going to get a smoking jacket and brandy snifter and start doing new Weekly Source Code posts every week. Ok, it will be a Code Zero snifter but you get the idea. Because you can't be a good writer coder if you aren't a good reader.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Visual Studio 11 Express for Web for Front End Development - JavaScript/HTML5/CSS3

April 14, '12 Comments [24] Posted in HTML5 | Javascript | Open Source
Sponsored By

I wanted to work through a new tutorial by former Microsoftie, now Googler Pete LePage along with Chris Wilson. They have a great lab called "WReader" that uses Ember, HTML5 Boilerplate, Moment.js, Bootstrap CSS and LawnChair.js that builds a single page JavaScript application over 12 exercises.

A few weeks ago a non-Microsoft developer saw a post I did on some new HTML5, CSS3 and JavaScript features in VS11 and mentioned he might want to use it over Dreamweaver. I thought that was cool because some client-side developers think VS is all server-side and too "industrial strength."

I wanted to see if VS11 Express Web (the free version) would work well for "front end" web development. This lab that Pete made is all client-side. It doesn't use ASP.NET or anything server-side that Visual Studio is typically built for. However, a lot of work has been done in Visual Studio lately to make web development easier and I wanted to see if it stood up, even when doing all client-side HTML/CSS/JS.

I downloaded Pete's Lab, opened Visual Studio and when Open Web Site and opened the first Exercise's folder.

Opening a folder as a web site

I right-clicked on Index.html and set it as the Startup Page for my project. You can set any page you like a the startup page and they Ctrl-F5 (or a button in the toolbar) will launch the browser without server-side debugging.

At the end of Exercise 2 you will have dynamically created feed items and bound them with a client-side template. Here's a screenshot of what that looks like.

Excercise Two completed and I've got a list of 10 RSS feeds in a list.

While I was typing up this exercise there were a few nice things about VS that made the experience pleasant. The JavaScript editor in VS11 is greatly improved and is actually running the JavaScript in the background as you are running it, so the intellisense autocomplete help is very useful, especially for a JavaScript newbie. It doesn't get everything, but it's VERY smart.

Nice JavaScript intellisense improvements in VS11

There are times when you're working in a JavaScript file that needs to know about objects in another file but the editor can't figure it out. You can add a "hint" or reference so Visual Studio can be smarter for you.

For example, I was using this Ember.js object and wasn't getting any help so intellisense just added all the info that it had.

Ember in VS without intellisense

You can drag a file from the Solution Explorer into your JavaScript file to make a comment that acts as a reference/hint to Visual Studio like this: /// <reference path="libs/ember-0.9.5.js" />. You can see the results below.

Ember in VS with intellisense

If adding that line bugs you, you can put all your references in a _references.js file and never look at it.

This was helpful to me when I got to adding moment.js as I could see what methods my Date had available:

Intellisense available on dates with VS11 and moment.js

Later in Exercise 2 I make a client-side JavaScript template like this with "mustache/handlebar style" expressions like {{ }}:

<section class="mainContent">
  <section class="summaries">
      <script type="text/x-handlebars">
      {{#each WReader.dataController}}
          {{#view WReader.SummaryListView contentBinding="this"}}
              {{content.title}} from {{content.pub_name}} on {{content.pub_date}}

However, Visual Studio syntax highlighting didn't look useful/pretty to me. This seemed like an opportunity to make it better.

A mustache template without syntax highlighting

I mentioned in an earlier post that we have the ability now to update the web editors (HTML, CSS, and JS) easier and more often now as the editors bits are implemented as extensions themselves. I asked the owner Mads Kristensen to prototype what "mustache" template syntax highlighting could/might/would look like if we did it. We'd want all the general templating libraries to work, like Mustache, HandleBars, JsRender, and others, even if templating as a concept changes or disappears.

Here's some of the prototype work he did tonight. This would make my client-side experience just a little nicer. These are screenshots of the private build he is messing with and he's trying different colors.

An example mustache template with highlighting

I like this one the best. I'm not digging the yellow. I like this more subtle approach.

A nice subtle mustache template

I was testing this lab on multiple browsers and switching back and forth between the Chrome Developer Tools and the Internet Explorer Developers Tools (F12). There's a nice feature in Visual Studio 11 that lets you quickly run your project in different browsers with this dropdown:

All your installed browsers in a list

But sometimes you want to run multiple browsers at the same time. There's a little known feature (I'm working with the team on making this more discoverable) where you can right-click on an HTML file and click Browse With, then "Ctrl-Select" multiple browsers:


If you click Set as Default while there are multiple browsers selected it will change your toolbar and menu to say "Multiple Browsers." CTRL-F5 will then launch more than one browser at the same time.

Multiple Browsers selected in the toolbar

The UI is a little rough now but it's being improved. It's a really nice little feature and a time saver!

Later in the tutorial Pete includes the Twitter Bootstrap CSS and I wanted to change some of the default colors. You can click a color in the CSS editor and edit it interactively like this. It even does opacity.

The VS11 Color Picker for CSS Colors

I encourage you to go check out Pete's tutorial if you're interested in learning more about JavaScript, HTML5, Ember.js (and frameworks like it) and this emerging style of web development.

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Facebook's privacy settings are too complex for ANYONE to use - Change these settings today

April 13, '12 Comments [19] Posted in Blogging
Sponsored By

The Friends privacy setting on status updates extends to tagged friends and their friends

My wife is quite a bit smarter than I am. She is also more educated that I am. Frankly, I'm happy she talks to me at all.

She put a photo on Facebook last week of she and a friend and was careful to double-check that the photo was set to "Friends only."

A few days later she rushed in and told me that she thought the photo was public even though it was set as Friends only.


"Because random people that I don't know are commented on this photo! Like, who is this guy? I don't want him to see this - I don't know him! Why did they let non-friends see it?"

I looked for a minute and noticed that she had "tagged" her other friend in the photo as in this example photo below:

A photo in Facebook with 4 people "tagged"

In this photo there are four people tagged. When you tag someone they are notified that they've been tagged and they can remove the tag which removes it from their "photos of me" list. The photo above is totally public but let's say it was posted by me and I tagged my three friends and marked as "friends only."

Who can see the photo of me and my 3 friends? Who can see the photo of my wife and her friend when the photo is marked Friends?

Who sees the photo? The union of all our friends!

Answer: The union of all the friends of everyone tagged in the photo. If someone else sees the photo and tags some more people, the circle of visibility for that photo or post expands.

This may seem obvious to a software engineer or someone with a background in set theory but it's not obvious even to smart regular folks. It certainly surprised my wife although she gets it now. Here's the thing, though. Now she says she really is less likely to put photos on Facebook and certainly less likely to tag folks in photos.

Confused a little? There's more. Recently my programmer man crush and favorite Canadian Reginald Braithwaite wrote a post called When you share personal data with Facebook friends, you're sharing your personal data with every app your friends use. Read that title again.

Remember that when you aren't paying for something (like Facebook), someone is paying. The advertisers are paying and you, your friends and all your info are the product.

Reginald points out that when you grant an application (Farmville, etc) in Facebook access to your profile you are often granting that application access to your friends personal information. That means that your annoying friend who is always pushing the Mob Wars invites has likely granted an application access to your information by proxy.

UPDATE: When you are sharing something note that you can pull down the privacy dropdown, select custom and make changes then hover your mouse over the gear to get a plain English tooltip showing the resulting visibility of this update:

The Tooltip will show the resulting visiblity of the post

Your Homework - and pass it on

Go log into Facebook and in the upper right corner click Privacy Settings:

Privacy settings in Facebook is in the upper right corner

Then, spend some time in these two areas of Settings. Timeline and Tagging and Apps and Websites.

Update your facebook privacy settings

Under tagging you can choose what happens when someone tags you and tags that friends add to your own posts or photos. You can also control tag suggestions. You can lock this down as much as you want.

Check your Timeline and Tagging settings in Facebook

Next, click on Apps and Websites and freak out when you see how many you (or your teen) has added. You can remove them as you like. Most importantly, click on "How people bring your info into apps they use."

Review the "Apps you use" at Facebook

How much of this info to you want your friends sharing with their applications? Turn this stuff off.

Uncheck all the checkboxes at "How people bring your info info apps they use."

And finally, check out the Public Search option. Do you want Facebook and your public timeline to show up when someone Googles for you  or your child? If not, turn this OFF.

Turn off your Facebook public search settings

You can also go back in time and "limit old posts." This will take posts from years ago when you didn't know this information and make them visible to friends only.

Limit the visiblity of old posts

Facebook will likely try to talk you out of it. Use your judgment.


Now, for a fun over-dinner exercise try explaining this to your 14 year old and why everyone should be careful about information leakage. Seriously. At least try.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The Big Glossary of Open Source JavaScript and Web Frameworks with Cool Names

April 13, '12 Comments [38] Posted in ASP.NET | Javascript | Open Source
Sponsored By

Photo via Dmitry Baranovskiy and used under Creative Commons -'s getting to the point where there are so many cool open source projects that I can't keep up. When you add in the currently battle royale of JavaScript projects that are basically just hip sounding words with ".js" added to the end, it's a little overwhelming. Seriously, just pick a word out of the dictionary at random and that's the name of an up and coming JavaScript library.

JavaScript MVC Frameworks and Libraries

This is an area that is very interesting but also very not-yet-baked. In the DOM manipulation and CSS selector space, jQuery won. That fight is over. The next big question is client side MVC frameworks. It seems everyone wants to make the next "Rails" framework on JavaScript and while there are some contenders, there's still lots of room for someone to "win."

DOM manipulation libraries like jQuery are important, but it's clear that making large and rich web applications requires more than just jQuery. More and more applications want smart asynchrony and dynamic loading.

(Reminder: All this IS overwhelming. That doesn't mean you need to know all these frameworks or feel bad that you don't know them all. Just accept that you DON'T know them all. Be OK with that.)

Here's the major players and ones you might want to be familiar with. Remember, these are client side libraries and while they often mention server-side frameworks like node or rails, these are things written in JavaScript that anyone can use.

  • Ember.js - Attempts to remove tedious boilerplate code. Includes a templating engine (no one will agree on just one), encourages an architecture where the browser does most of the work, supports state-management out of the box. Focus on computed properties, and templates that update themselves.
  • Underscore .js - A library of more than 60 functions to make JavaScript more fun and easier to use. Provides a layer that will use a modern browser's native implementation of a method while still supporting older browsers. Has iterators like each, map, reduce, etc. In a way, it's like LINQ for JavaScript.
  • JavaScriptMVC - A jQuery-friendly framework that adds functional testing, MVC plugins, documentation generation, dependancy management and build tools.
  • Spine.js - Seems like less than a Backbone (these libraries all play with each other's names). Introduces models and controllers, but for views, requires you use your own template engine. Intends to be super lightweight.
  • Backbone.js - Everyone loves Backbone. It's the one you'll hear about the most. There's a large community supporting it. Folks have said that large applications can get a little hairy and difficult to manage, though. Lots of great docs and examples.
  • Knockout.js - MVVM on the client rather than MVC. Lots of interesting client-side data-bind expressions. Rich documentation.
    • And, wait for it, Knockback.js, a library that bridges the gaps between Knockout and Backbone and encourages you to use both effectively.
  • Sammy.js - A very small core library that brings in other adapters and plugins to give you just the parts you need. Focused on developer happiness. Works well with apps that are sitting on top of RESTful JSON server sides.
  • Angular.js - Includes templates, two-way data-binding and MVC, again, all on the client. Very small and starting to make a splash.
  • SproutCore - SproutCore seems to be very complete and more prescriptive than other frameworks. It also has a focus on making apps on tablets and other devices. The NPR for Chrome app used them.
  • Cappuccino - If you like and think in Objective-C, you'll like Cappuccino and Objective-J. Cappuccino is kinda of Cocoa (Mac APIs) for the web.
  • Google Closure - Almost doesn't belong in the list as it's a very complete toolkit with a whole worldview, rich library, templates, and lots of extras. You can choose how much you want to embrace, though.
  • ExtJS4 - This is a Sencha product and now on its fourth major release. It includes not only a framework and architecture but also widgets and charts.
  • PureMVC - Another MVC on the client side implementation, but this one was ported from ActionScript. It was originally used on Adobe Air and the like.
  • Batman.js - Bonus points for the best name. Explicitly embraces CoffeeScript as well as JavaScript. Only 2000 lines and very few extras. Very Rails friendly, prescriptive without being oppressive.
  • Require.js - A JavaScript file and module loader.
  • PrefixFree.js - A nice library that expands all your CSS to use the explosion of vendor prefixes correctly.
  • Lawnchair.js - Client-side storage and persistence. Less than a couch, but smaller and outside.
  • Mustache - Templates for views, explicitly without logic.
var view = {
title: "Joe",
calc: function () {
return 2 + 4;

var output = Mustache.render("{{title}} spends {{calc}}", view);
  • Handlebars.js - An superset of the Mustache template concept with extra features. A fancier mustache. Ahem, "Handlebar Mustache."

Also checkout Gordon Hempton's excellent "consumer reports" table on his blog that covers which JavaScript frameworks support which features.

ASP.NET Libraries, Frameworks and Open Source Projects

You may have heard that ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) are all now open source with contributions. They are up on CodePlex using Git. I thought I'd mention some interesting ASP.NET/CLR server side libraries here also as that's the area I work in.  There are thousands of Open Source projects in the .NET space, but I wanted to take a moment and feature these as they are all related and all emerging.

Just like the JavaScript projects above, these .NET projects are all trying to innovate...trying to make something new and modern and compelling without sacrificing the good things about the past.

  • OWIN - This is the "open web interface for .net." It represents the "spec" of the web app function signature. It serves the same purpose as Rack spec on Ruby or WSGI on Python. "The goal of the OWIN interface is to decouple server and application, encourage the development of simple modules for .NET web development, and, by being an open standard, stimulate the open source ecosystem of .NET web development tools."
  • Gate - An OWIN Reference implementation of utilities, host handlers, and web framework adapters for OWIN. This is essentially glue code, with things like Gate.Hosts.Kayak.dll on one hand, and Gate.Adapters.Nancy.dll on the other, to fit together your stack, e.g. "Kayak->Owin->Nancy"
  • Nancy - A "Sinatra" inspired framework. "Nancy is a lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono. The goal of the framework is to stay out of the way as much as possible and provide a super-duper-happy-path to all interactions."
  • Kayak - A 100% C# HTTP Server assembly that can be embedded in your project. "Kayak is an asynchronous HTTP server written in C#. It has been designed to be easy to embed into a variety of applications. Kayak natively supports the OWIN 1.0 Draft specification."
  • Firefly - Another 100% C# HTTP server assembly.
  • Manos - A 100% C# HTTP server in an assembly that is a part of a larger Manos web server + web framework bundle.
    (web frameworks with owin adapters:)
  • AspNetWebApi - A framework optimized for HTTP APIs and services. Part of the open source ASP.NET Web Stack.
  • SignalR -  A message bus that supports realtime communication over Web Sockets, long polling, forever frame, or server sent events. JavaScript and Server-side components.
  • Fubu - A MVC-inspired framework with the beginnings of some OWIN support.
  • OpenRasta - A development framework for building web-based applications and services. Focused on being RESTful.

There is no question that I've missed some. Leave them in the comments and I'll keep this post updated. Projects for this list should be of some renown and be pushing the envelope in some notable way.

Big thanks to Louis DeJardin for his help and bootstrapping the list.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.