Tracking… Tracking… Broken… Fixed!

My trackball, which I’ve been using instead of a mouse for several years now thanks to a push from my friend Dave O’Hara and my chiropractor bill started to go on the fritz this week.  It wouldn’t click correctly and sometimes would register a double click (a few times causing me frustration).  I ordered one to come from Amazon to replace this broken device.  This afternoon it seemed toast.  It wouldn’t click, it would just make clicking sounds but fail to actually send the correct signal.

In desperation as the replacement hadn’t arrived I cracked it open and blew it out with a compressed air can.  After replacing the batteries this thing is humming along and working like new.  Except I still have a new one on order.  Anyone looking for a trackball? 🙂

You Are Not Reading This Here

[as per my wife’s instructions this is not an announcement]

I am so excited I can’t tell you how excited I am.  But I CAN tell you that we’re having another baby (gender unknown) and its pretty darn awesome.  Just have to let you know.

Names that will cheese off people who think we should name the baby other names, or who think it should be kept a secret:

Girl: Charlotte Rose Peterman – nickname: Charlie, though Unkle Kurt has said he’ll call her Lotty.

Boy: Eric Matthew Peterman – nickname: Eric, though Unkle Kurt has said he’ll call him Eric.

We’re excited and hope you’ll celebrate with us!

Go Native: JSON Vs eval is evil

In the world of browser performance you can find yourself looking for the little things to make big differences, or even a lot of little things to make a bigger difference together.  I’ve been researching one particular change that is coming down the pike: native JSON handling.  John Resig wrote about the need for native JSON support in the browser in 2007 and its finally come.  The difference it makes between Firefox 3.0 and 3.5 is major, the difference between Internet Explorer 7 and 8 is important, and the safety that native support brings for prevention of cross site scripting (XSS) is critical.

I’ve created two tests that you can try for yourself: the eval test and the JSON test.  The tests loop 20 times to give you a broader test range and reveal the average time.  There are notes in the test pages to clarify a few observations, but I’ll put them here just for the sake of a single source.  The test pulls in 1600 JSON objects and either evaluates them using the JavaScript eval function (eval(/*JSON String*/);), or it parses them with the native JSON parser (JSON.parse(/*JSON String*/)).  For consistency’s sake I used the data from John Resig’s test which I have copied onto my server to reduce the load on his server and not steal bandwidth.  My tests were run locally to reduce bandwidth latency influencing results, but you can see that over the Internet, even on a broadband connection, the performance only gets worse.

Firefox 3.5 has javascript tracing enabled and the typical test results will show a much slower first pass with subsequent results being much, much faster. It should never be assumed that the user will be getting the exact same data back like this test shows, so the slower performance should be expected.

Internet Explorer 8’s Eval test appears to be almost as fast as the JSON test and their eval code’s execution is pretty fast already. However, the JSON.parse() code appears to be much safer to use and is thus preferable.

The final results are based on the averages (which are much more consistent than comparing the ‘best’ numbers): eval is roughly 500 milliseconds (or 500%) slower in Firefox 3.5 the first time and nearly the same speed in Internet Explorer 8 with an average of 10 seconds slower in 20 passes.  So for either identical or much faster performance and greater safety against XSS it is a no-brainer to switch to including native JSON support as a preferred method of dealing with JSON data over eval.

I do want to note that I was impressed by Internet Explorer 8’s eval speed, it was much greater than I had expected, and generally disappointed with Firefox’s, but since it is an evil function to use, that’s not all bad.

King Corn: A Movie You Should Watch

Uncle Ben, in the first of the 2000’s Spiderman franchise, tells a young Peter Parker, “With great power comes great responsibility.”  Watching King Corn (website) tonight over Netflix’s instant watching service was sobering.  It isn’t the most entertaining movie you will ever watch.  Comparing it to Spiderman might be cruel because one is for fantasy and fun and the other is for education and presenting reality in a film format.  Despite my stating that it isn’t ‘fun’ to watch, you should watch it because the contents of the film are disturbing.

If you think that government spending is out of hand: watch this film.

If you think that Americans are nutritionally screwed up and need to eat better: watch this film.

If you think that you’ve got everything together and your life is all roses: watch this film.

I am allergic to corn grain and corn syrup, though corn oil does seem to be OK in moderation, and so for me corn is just not a great item to eat.  After watching how corn syrup is made, I’m pretty sure I wouldn’t want to eat corn syrup even if I were able to eat it.  I’m convicted, once again, that I should be careful what I put into this body, but don’t take my word for it.  Watch this film, read Michael Pollard’s book “In Defense of Food” – and see where you land.  I bet it isn’t in a field of corn, or in line at McDonalds.

Coffee with Jeremy

I should have taken a picture.  It would have lasted longer.  However, I had a great time with a brother in the Lord, Jeremy, this morning.  We talked about a lot of stuff, but I can’t tell you about it because what happens in Starbucks, stays in Starbucks.  More blogging will be coming soon.  I’m stoked about that.