<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ramblings of a Geek - Jeremy Johnstone &#187; Blog</title>
	<atom:link href="http://www.jeremyjohnstone.com/category/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jeremyjohnstone.com</link>
	<description>Ramblings of a Geek</description>
	<lastBuildDate>Wed, 01 Sep 2010 18:33:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iOS DRM&#8217;d video playback failure</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-07-16-ios-drmd-video-playback-failure.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-07-16-ios-drmd-video-playback-failure.html#comments</comments>
		<pubDate>Fri, 16 Jul 2010 07:44:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[DRM]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/2010-07-16-ios-drmd-video-playback-failure.html</guid>
		<description><![CDATA[I&#8217;ve long been looking for a solution for playing back iTunes movies on my iPad/iPhone without having to sync the content to the device over USB. By luck, a friend tipped me off to the fact that MobileSafari would allow you to playback DRM&#8217;d content served over HTTP. From that news, I quickly SSH&#8217;d into [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve long been looking for a solution for playing back iTunes movies on my iPad/iPhone without having to sync the content to the device over USB. By luck, a friend tipped me off to the fact that MobileSafari would allow you to playback DRM&#8217;d content served over HTTP. From that news, I quickly SSH&#8217;d into my home machine and setup an HTTP server pointing at my iTunes Media folder. Much to my amazement, not only did the content play, but my AT&#038;T U-verse account had more than enough bandwidth to stream even HD content!</p>
<p>This of course set my wheels spinning and made me wonder why apps like AirVideo couldn&#8217;t do the same. Being friends with several well respected iOS devs, I asked them what they thought. One (who will remain nameless) emphatically stated that AirVideo didn&#8217;t work because they &#8220;were doing it wrong&#8221; in his own typical cocky style response. I asked how he would suggest doing it, to which I got a rundown of different video frameworks on the platform with no specific details (again, typical). Being suspicious it couldn&#8217;t be that easy, I set off to ask a few more developers. Everyone I spoke to seemed to think it would be possible somehow. Sadly, they were all mistaken.</p>
<p>My first course of action was to try the MediaPlayer framework, as it&#8217;s the older API and thus had better sample code. After going through the motions to get an MPMoviePlayerController instance, I found that on my iPad the same thing happened as does in AirVideo, complete blackness. Wondering if it might be an iOS version thing, I then tested on three other devices ranging from an iPhone 4 down to a 3G still on 3.0 and still no dice.</p>
<p>My next thought was to use AVFoundation. Unfortunately this is limited to iOS 4, so it ruled out playback on my iPad which is where I wanted it most. Despite that, I set out to learn how to use it.  Freaking A did I not expect how hard that would be! Not only are the docs extremely lacking on how to use AVPlayer, there isn&#8217;t any sample code available either from Apple. Searching the web, apparently nobody had ever thought to write a blog post on it either. Apple&#8217;s developer forums were a bit of help, but just barely. After a bit of trial and error getting a CALayer to render properly in my rudimentary test app, I was up and running with a basic video clip. Then upon switching to an iTunes DRM video, I was back at a black screen again. All that effort, still no dice! <img src='http://www.jeremyjohnstone.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Feeling mighty dejected at this point, I decided to see if it working was a browser only thing somehow. My first test was to fire up iCabMobile (a custom Safari implementation). Not to my surprise at this point, it shot up an error immediately about unsupported content type. On a long shot, I decided to test out a UIWebView. Again, still no luck as it errored out too.</p>
<p>At this point, it seems the only way to play DRM&#8217;d iTunes content is either via syncing it in iTunes or via MobileSafari over HTTP. With the later being supported, that&#8217;s still a big win, but I&#8217;m very disappointed there doesn&#8217;t seem to be anyway to do it in a custom app. I&#8217;m going to keep digging to see if there is a way to do it in a jail broke app, but I doubt it.</p>
<p>If anyone has any tips here, I&#8217;m definitely all ears!</p>
<p>-Jeremy</p>
<p>P.S. &#8211; after I get a little sleep, I&#8217;ll write up a blog post on using AVPlayer &#038; AVPlayerLayer so others don&#8217;t endure the same pain I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-07-16-ios-drmd-video-playback-failure.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>When things just go as planned&#8230;</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-06-13-when-things-just-go-as-planned.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-06-13-when-things-just-go-as-planned.html#comments</comments>
		<pubDate>Sun, 13 Jun 2010 18:36:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/2010-06-13-when-things-just-go-as-planned.html</guid>
		<description><![CDATA[One of the several things I love about using Apple computers is the fact in general, when I set out to do some project, things just work as planned (not sure if Apple deserves credit in all cases though). This is definitely not always the case, as evidenced by some of my angry tweets in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the several things I love about using Apple computers is the fact in general, when I set out to do some project, things just work as planned (not sure if Apple deserves credit in all cases though). This is definitely not always the case, as evidenced by some of my angry tweets in the past, but in general that holds true more often than not.</p>
<p>This even holds true for things one would think would be easy anywhere (oh, if only that were true), case in point being today&#8217;s project. I bought a new hard drive for my Mac mini to replace the internal booting drive. I slapped the new drive into my NexStar bay, formatted it, and then used SuperDuper to make a mirror image of the existing drive. The whole process took about 5 mouse clicks and 1.5 hours of waiting for the copy to complete.</p>
<p>Next I powered down the machine, popped off the cover, removed eight screws, swapped in the new drive, then reversed the process. All in all, the physical portion took about 15 minutes and that&#8217;s just because I was being careful to not break the plastic cover. Booting up the machine, I reset the PRAM (cmd-opt-P-R) and watched it then boot like normal. </p>
<p>Sure, this is a simple project relatively speaking, but the fact I had zero issues (well, except maybe the fact I had to reset the PRAM to boot, but that&#8217;s easy) just makes me marvel a tad bit over how much easier things have become in the past decade of computing. The horror stories I could tell doing the same thing on Linux in the mid-90s (admittedly also much easier now there too) could scare even the most fearless sysadmins.</p>
<p>Happy Sunday!</p>
<p>-Jeremy </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-06-13-when-things-just-go-as-planned.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Holiday Weekend meal planning</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-05-29-holiday-weekend-meal-planning.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-05-29-holiday-weekend-meal-planning.html#comments</comments>
		<pubDate>Sat, 29 May 2010 20:54:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[food]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/2010-05-29-holiday-weekend-meal-planning.html</guid>
		<description><![CDATA[As is typically tradition for me, I&#8217;m going to be cooking for some friends again this holiday weekend. Lately that seems to involve me and a grill more often than not and I wanted something a bit healthier than steaks or ribs (despite their tastiness), so I decided to dig through the recipe books and [...]]]></description>
			<content:encoded><![CDATA[<p>As is typically tradition for me, I&#8217;m going to be cooking for some friends again this holiday weekend. Lately that seems to involve me and a grill more often than not and I wanted something a bit healthier than steaks or ribs (despite their tastiness), so I decided to dig through the recipe books and come up with something a bit more creative for a change.</p>
<p>After a half hour or so pondering different options, I think I&#8217;ve landed on a winner:</p>
<p>Lemon Artichoke Chicken<br />
Quinoa and Black Bean salad<br />
Glazed Pearl Onions<br />
Pan Seared Purple Asparagus<br />
Peppered Fontina Breadsticks<br />
Homemade Sangria</p>
<p>So, based on that list, what do you think? Sound like an delicious Memorial Day feast?</p>
<p>I&#8217;ll try and post photos later after I make it.</p>
<p>Enjoy!</p>
<p>-Jeremy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-05-29-holiday-weekend-meal-planning.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad Geo Location Accuracy</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-04-08-ipad-geo-location-accuracy.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-04-08-ipad-geo-location-accuracy.html#comments</comments>
		<pubDate>Thu, 08 Apr 2010 07:20:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[MyWi]]></category>
		<category><![CDATA[tethering]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1668</guid>
		<description><![CDATA[On Monday while riding into the city (the city = San Francisco for those not from this area), I took the opportunity to play with my iPad. Needing an internet connection and not having a 3G model yet, I used my iPhone + MyWi to get online. Randomly, I decided to open up the maps [...]]]></description>
			<content:encoded><![CDATA[<p>On Monday while riding into the city (the city = San Francisco for those not from this area), I took the opportunity to play with my iPad. Needing an internet connection and not having a 3G model yet, I used my iPhone + MyWi to get online. Randomly, I decided to open up the maps app and hit the location finder button. Much to my amazement, not only did it find me, it did so with amazing accuracy and even roughly tracked the progress of my movement. Being impressed, I <a href="http://twitter.com/jsjohnst/status/11668088394">tweeted</a> about it and people had a number of theories why it worked.</p>
<p>One of the leading theories people had was that the iPad was using <a href="http://www.skyhookwireless.com">SkyHook</a> to do a lookup based on cell tower triangulation. I knew this was an immediately flawed concept based on prior knowledge of how it works. What Skyhook and similar services do is interface with the gsm modem to get the towers in the area. It&#8217;s not even really triangulation, basically they get the cell tower ID from the modem and then lookup that in their database. This is why you see a relatively big circle on 1st gen iPhones, as it&#8217;s not a very precise lookup since towers cover a several square mile area each. Not only was my location being shown with pinpoint accuracy, since my iPad was talking to my iPhone via wifi there is no possible way for it to have gathered the gsm data directly.</p>
<p>Another theory was that the iPad was doing a lookup on the IP address. While this method is a last ditch fallback employed by SkyHook, this is also flawed because one can drive a long way and still retain the same IP. As previously indicated, the location pinpointed me following a curve in the road, something even triangulation couldn&#8217;t do let alone IP lookup.</p>
<p>Not having an explanation which seemed plausible, I decided to do some experimentation this evening with the help of a friend. Over dinner, we found the location was perfectly spot on (see second photo below). Firing up an app which showed the location data directly, I observed a couple curious things. The first thing was that altitude data wasn&#8217;t being reported. Based on this, our assumption was that it wasn&#8217;t getting actual gps data from the phone via some &#8220;magical&#8221; method. The second thing was that the location accuracy was <300ft (see the first photo below). This further confirmed the hypothesis that tower data was not being used.</p>
<p>Still stumped, we decided to drive around and see if any patterns emerged. Driving around, the accuracy wasn't as accurate as before and would jump every few seconds to where we were. When it did track the road, updating in virtual realtime, we were in densely residential areas. The farther we were from any homes or buildings, the less accurate it was, leading up to a total loss of location when we were on the 280 heading north. </p>
<p>That's when it dawned on me how it worked and I was embarrassed to have not immediately thought of it before. Just because I was associated to the wifi access point created by MyWi running on my phone, doesn't mean the iPad can't see the numerous other access points in the area. One of Skyhook's differentiating features is that they have one of the largest databases in the world mapping wifi access points to their geo location. Using technology they call WPS (short for "wifi position system"), it can then triangulate my location with much greater accuracy (since wifi aps have a very small coverage area compared to a cell tower) than any other non-gps based solution and hence what I was observing.</p>
<p>All in all nothing extraordinary or new, but still a nice unexpected surprise none the less!</p>
<p>-Jeremy</p>
<p>P.S. This blog post 100% penned via the Wordpress app running on my iPad using the onscreen keyboard. Surprisingly easy to do even without a physical keyboard.   </p>
<p><a href="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/04/p_640_427_8B2947E8-4F2B-42EC-8F1E-E1767CE2D2B2.jpeg"><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/04/p_640_427_8B2947E8-4F2B-42EC-8F1E-E1767CE2D2B2.jpeg" alt="" class="alignnone size-full" /></a></p>
<p><a href="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/04/p_1024_768_F30D77AD-A6AE-4114-8B00-AA12A009D38A.jpeg"><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/04/p_1024_768_F30D77AD-A6AE-4114-8B00-AA12A009D38A.jpeg" alt="" class="alignnone size-full" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-04-08-ipad-geo-location-accuracy.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Solving exponential distribution probability using Calculus</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-02-01-solving-exponential-distribution-probability-using-calculus.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-02-01-solving-exponential-distribution-probability-using-calculus.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 07:28:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[calculus]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1542</guid>
		<description><![CDATA[Today I was challenged with the following advanced statistics problem:
Two variables are exponentially distributed with rate parameters lambda 1 (&#160;&#955;1&#160;) and lambda 2 (&#160;&#955;2&#160;). What is the probability (&#160;p&#160;) that variable 1 (&#160;X1&#160;) is less than variable 2 (&#160;X2&#160;) in terms of lambdas?
Being one who is usually up to a good challenge, this sounded like [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was challenged with the following advanced statistics problem:</p>
<blockquote><p>Two variables are exponentially distributed with rate parameters lambda 1 (&nbsp;&#955;<sub>1</sub>&nbsp;) and lambda 2 (&nbsp;&#955;<sub>2</sub>&nbsp;). What is the probability (&nbsp;p&nbsp;) that variable 1 (&nbsp;X<sub>1</sub>&nbsp;) is less than variable 2 (&nbsp;X<sub>2</sub>&nbsp;) in terms of lambdas?</p></blockquote>
<p>Being one who is usually up to a good challenge, this sounded like a fun Sunday task, especially as there are many practical applications of this knowledge (see end of post for one example). It sadly took me much longer than I anticipated, but I learned a lot along the way. </p>
<p>Let&#8217;s start off with some definitions. First off, we need to brush up a little bit on <a href="http://en.wikipedia.org/wiki/Exponential_distribution">exponential distribution</a> and we then can see that to get the probability that X<sub>1</sub>&nbsp;&lt;&nbsp;X<sub>2</sub> for all possible legal values from zero to infinity, we use the following problem definition:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/definition.png" alt="p = \int^\infty_0 P(X_2=x)P(X_1<x) dx" /></center></p>
<p>What it&#8217;s essentially saying is that the probability that X<sub>1</sub>&nbsp;&lt;&nbsp;X<sub>2</sub> is the combined probability that X<sub>2</sub>&nbsp;=&nbsp;x AND X<sub>1</sub>&nbsp;&lt;&nbsp;x. From there, we can do some simple replacements. To find the probability that X<sub>2</sub>&nbsp;=&nbsp;x we use the <a href="http://en.wikipedia.org/wiki/Probability_density_function">Probability density function</a> (PDF). Then to find the probability that X<sub>1</sub>&nbsp;&lt;&nbsp;x we use the <a href="http://en.wikipedia.org/wiki/Cumulative_distribution_function">Cumulative distribution function</a> (CDF). Based on the definition that P(A and B) is the same as P(A)P(B), we end up with:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step1.png" title="p = \int^\infty_0 PDF_{X_2}(x) CDF_{X_1}(x) dx" alt="p = \int^\infty_0 PDF_{X_2}(x) CDF_{X_1}(x) dx"/></center></p>
<p>Next up, we need to do some substitutions for PDF and CDF respectively. According to Wikipedia, PDF is defined as:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/PDF.png" alt="definition of probability density function (PDF)" title="definition of probability density function (PDF)" /></center></p>
<p>And CDF is defined as:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/CDF.png" alt="definition of cumulative distribution function (CDF)" title="definition of cumulative distribution function (CDF)"/></center></p>
<p>So with that in mind, we now arrive at this:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step2.png" alt="p = \int^\infty_0 \lambda_2 e^{-\lambda_2 x}(1-e^{-\lambda_1 x}) dx" title="p = \int^\infty_0 \lambda_2 e^{-\lambda_2 x}(1-e^{-\lambda_1 x}) dx" /></center></p>
<p>Before solving the integral, we will do some simplification. First up, using the distributive property of subtraction, we can simplify the above into this:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step3.png" alt="p = \int^\infty_0 \lambda_2 e^{-\lambda_2 x} dx - \lambda_2 e^{-\lambda_2 x} \lambda_2 e^{-\lambda_1 x} dx" title="p = \int^\infty_0 \lambda_2 e^{-\lambda_2 x} dx - \lambda_2 e^{-\lambda_2 x} \lambda_2 e^{-\lambda_1 x} dx" /></center></p>
<p>After that, we will use exponential identities to refactor the problem down a bit further to this:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step4.png" alt="p = \int^\infty_0 \lambda_2  e^{-\lambda_2 x} dx - \lambda_2 e^{-\lambda_2 x - \lambda_1 x} dx" title="p = \int^\infty_0 \lambda_2  e^{-\lambda_2 x} dx - \lambda_2 e^{-\lambda_2 x - \lambda_1 x} dx" /></center></p>
<p>At this point, we can now proceed to solve the integral and using the definition that the integration of e^x&nbsp;=&nbsp;e^x and subsequently e^-x&nbsp;=&nbsp;-e^-x we end up with the following:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step5.png" alt="p = (-\frac{\lambda_2 e^{-\lambda_2 x}}{\lambda_2} + \frac{\lambda_2 e^{-\lambda_2 x - \lambda_1 x}}{\lambda_2 + \lambda_1})\Big |^\infty_0" title="p = (-\frac{\lambda_2 e^{-\lambda_2 x}}{\lambda_2} + \frac{\lambda_2 e^{-\lambda_2 x - \lambda_1 x}}{\lambda_2 + \lambda_1})\Big |^\infty_0" /></center></p>
<p>After then doing some basic simplification of the fractions, we now end up with this:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step6.png" alt="p = (-e^{-\lambda_2 x} + \frac{\lambda_2 e^{-\lambda_2 x - \lambda_1 x}}{\lambda_2 + \lambda_1})\Big |^\infty_0" title="p =(-e^{-\lambda_2 x} + \frac{\lambda_2 e^{-\lambda_2 x - \lambda_1 x}}{\lambda_2 + \lambda_1})\Big |^\infty_0" /></center></p>
<p>Next up, we need to apply the closed interval to the function using the <a href="http://">fundamental theorem of calculus</a>. The fundamental theorem states that when integrating f(x) over the interval [a,b] the result is F(b) &#8211; F(a) as seen here in this definition:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/fundamental_calc_theorem.png" alt="integrating f(x) over the interval [a,b] the result is F(b) - F(a)" title="integrating f(x) over the interval [a,b] the result is F(b) - F(a)" /></center></p>
<p>When we apply the fundamental theorem to our equation it gives us this result:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step7.png" alt="p = (-\displaystyle\lim_{c\to{-\infty}}e^{\lambda_2 c} + \frac{\displaystyle\lim_{c\to{-\infty}} \lambda_2 e^{\lambda_2 c + \lambda_1 c}}{\lambda_2 + \lambda_1}) - (-e^0 + \frac{\lambda_2 e^0}{\lambda_2 + \lambda_1})" title="p  = (-\displaystyle\lim_{c\to{-\infty}}e^{\lambda_2 c} + \frac{\displaystyle\lim_{c\to{-\infty}} \lambda_2 e^{\lambda_2 c + \lambda_1 c}}{\lambda_2 + \lambda_1}) - (-e^0 + \frac{\lambda_2 e^0}{\lambda_2 + \lambda_1})" /></center></p>
<p>Next up, we now need to calculate the results of the <a href="http://en.wikipedia.org/wiki/Exponential_function">exponential functions</a>. By definition, with e raised to the power of c as c approaches negative infinity, the result becomes zero. Also by definition, e raised to the zeroth power is one, which when both definitions are applied leaves us with this:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step8.png" alt="p = (-0 + \frac{0}{\lambda_2 + \lambda_1}) - (-1 + \frac{\lambda_2}{\lambda_2 + \lambda_1})" title="p = (-0 + \frac{0}{\lambda_2 + \lambda_1}) - (-1 + \frac{\lambda_2}{\lambda_2 + \lambda_1})" /></center></p>
<p>Then with some basic mathematical simplification here:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step9.png" alt="p = 0 - (-1 + \frac{\lambda_2}{\lambda_2 + \lambda_1})" title="p = (0 - (-1 + \frac{\lambda_2}{\lambda_2 + \lambda_1})" /></center></p>
<p>We then end up with our solution of p&nbsp;=&nbsp;1&nbsp;-&nbsp;&#955;<sub>2</sub>&nbsp;/&nbsp;(&#955;<sub>2</sub>&nbsp;+&nbsp;&#955;<sub>1</sub>):</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/step10.png" alt="p = 1 - \frac{\lambda_2}{\lambda_2 + \lambda_1}." title="p = 1 - \frac{\lambda_2}{\lambda_2 + \lambda_1}." /></center></p>
<p>Putting it all together, we get the following:</p>
<p><center><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2010/01/final_solution.png" alt="complete solution to statistical calculus problem" title="complete solution to statistical calculus problem" /></center></p>
<p>Now that we worked through that, you might be wondering what&#8217;s the practical application of this knowledge? Well, one example where you could use it would be in determining the lifespan of two different light bulbs. Given that one light bulb has a rating of 750 hours and the other has a rating of 1500 hours, what is the probability that the one with 1500 hours will last a less amount of time than the one with the 750 hour rating? I&#8217;ll leave the answer up to you to solve now that I have explained the steps above, but it must be said, the result is rather surprising.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-02-01-solving-exponential-distribution-probability-using-calculus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using git-svn with non-standard subversion repository layouts</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:01:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[stdlayout]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1508</guid>
		<description><![CDATA[Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:

http://svn.domain.org/svn/trunk/&#60;project_name&#62; -- [...]]]></description>
			<content:encoded><![CDATA[<p>Today while working with a 3rd party&#8217;s codebase, I ran into a situation which git-svn could not directly handle without pulling in massive amounts of unnecessary repository history. Turns out the solution was much simpler than I anticipated, so I&#8217;m sharing here in case it&#8217;s useful for somebody else. The repository was as follows:</p>
<pre>
http://svn.domain.org/svn/trunk/&lt;project_name&gt; -- Production branch
http://svn.domain.org/svn/branches/&lt;project_name&gt; -- Development branch
</pre>
<p><br/></p>
<p>I tried a number of approaches. First off, using the normal &#8211;stdlayout option with http://svn.domain.org/svn repository root to git-svn clone would have pulled in thousands of changesets from the repository which had nothing to do with the project I was working on.</p>
<p>Next I tried to use &#8211;trunk=trunk/&lt;project_name&gt; and &#8211;branches=branches/&lt;project_name&gt; and unfortunately this method tried to create a new branch for every child directory of branches/&lt;project_name&gt;. Obviously this wasn&#8217;t what I wanted either.</p>
<p>After doing a bit of searching on the web, I stumbled across another solution via <a title="Multiple branches using git-svn" href="http://www.dmo.ca/blog/20070608113513/" target="_blank">this blog</a>. Basically what it suggests doing is to use a separate svn-remote for the alternative path. This conveniently works around the issue quite nicely without any side-effects I&#8217;ve run into so far. Here&#8217;s the steps I followed:</p>
<ol>
<li>git svn clone http://svn.domain.org/svn/ &#8211;trunk=trunk/&lt;project_name&gt; &lt;project_name&gt;</li>
<li>cd &lt;project_name&gt;</li>
<li>vim .git/config</li>
<li>Add an additional remote as follows:<br/>
<pre>[svn-remote "svndev"]<br/>url = http://svn.domain.org/svn/<br/>fetch = branches/&lt;project_name&gt;:refs/remotes/dev</pre>
</li>
<li>git svn fetch svndev</li>
<li>git checkout -b dev remotes/dev</li>
</ol>
<p>After following those steps, you now have a new remote &#8216;remotes/dev&#8217; which is a copy of the dev environment branch from the repository and a new local branch called &#8220;dev&#8221;. You should now be able to proceed like normal using your usual git-svn workflow.</p>
<p>Of course the obvious answer would be to use standard repository layouts or to not use Subversion and/or git-svn, but sometimes that&#8217;s not always an option. I hope this helps someone stuck in a similar situation. Also, please be sure and sound off in the comments if you find an alternative solution!</p>
<p>Update:<br />
Here are a <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241084" target="_blank" title="git mailing list">couple</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/26/2241154" target="_blank" title="git mailing list">additional</a> <a href="http://kerneltrap.org/mailarchive/git/2008/6/27/2243984" target="_blank" title="git mailing list">links</a> which might prove useful depending on your desired workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-01-14-using-git-svn-with-non-standard-subversion-repository-layouts.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind Chill Calculator &#8212; In Javascript, Ruby, and PHP</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-01-12-wind-chill-calculator-in-javascript-ruby-and-php.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-01-12-wind-chill-calculator-in-javascript-ruby-and-php.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 09:28:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wind chill]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1494</guid>
		<description><![CDATA[Since I spent the time to dig up the method of calculating the wind chill given a specific temperature and wind speed, I figured I would go ahead and share it in case someone else finds it useful. Here&#8217;s three functions for calculating the wind chill, one each for Javascript, PHP, and Ruby.

// Javascript version
// [...]]]></description>
			<content:encoded><![CDATA[<p>Since I spent the time to dig up the method of calculating the wind chill given a specific temperature and wind speed, I figured I would go ahead and share it in case someone else finds it useful. Here&#8217;s three functions for calculating the wind chill, one each for Javascript, PHP, and Ruby.</p>
<pre class="brush: js">
// Javascript version
// wind = wind speed in knots
// temp = temperature in Celsius
function getWindChill(wind, temp) {
   wind = wind * 1.852;
   var wind2 = Math.pow(wind, 0.16);
   var wind_chill = (13.12 + 0.6215 * temp - 11.37 * wind2 + 0.3965 * temp * wind2);
   wind_chill = parseFloat(wind_chill.toFixed(2));
   wind_chill = (wind <= 4.8) ? temp : wind_chill;
   wind_chill = (temp > 10) ? temp : wind_chill;
   return wind_chill;
}
</pre>
<pre class="brush: php">
// PHP version
// wind = wind speed in knots
// temp = temperature in Celsius
function getWindChill($wind, $temp) {
   $wind = $wind * 1.852;
   $wind2 = pow($wind, 0.16);
   $wind_chill = (13.12 + 0.6215 * $temp - 11.37 * $wind2 + 0.3965 * $temp * $wind2);
   $wind_chill = round($wind_chill, 2);
   $wind_chill = ($wind <= 4.8) ? $temp : $wind_chill;
   $wind_chill = ($temp > 10) ? $temp : $wind_chill;
   return $wind_chill;
}
</pre>
<pre class="brush: ruby">
# Ruby version
# wind = wind speed in knots
# temp = temperature in Celsius
def getWindChill(wind, temp)
   wind = (wind * 1.852)
   wind2 = wind**0.16
   wind_chill = (13.12 + 0.6215 * temp - 11.37 * wind2 + 0.3965 * temp * wind2)
   (temp > 10) ? temp : (wind <= 4.8) ? temp : (wind_chill * 100).round.to_f / 100
end
</pre>
<p>As you can see, pretty simple, but hopefully one will prove useful to someone someday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-01-12-wind-chill-calculator-in-javascript-ruby-and-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friend&#8217;s new blog</title>
		<link>http://www.jeremyjohnstone.com/blog/2010-01-06-friends-new-blog.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2010-01-06-friends-new-blog.html#comments</comments>
		<pubDate>Wed, 06 Jan 2010 07:28:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=1479</guid>
		<description><![CDATA[A good friend of mine started a new blog on Math and Programming related topics. She has an interest in Ruby development, especially with an abstract algebra / math focus, so if you&#8217;re interested in either Ruby or Mathematics, I&#8217;m sure there will be posts there which you will find useful. Already she&#8217;s off to [...]]]></description>
			<content:encoded><![CDATA[<p>A good friend of mine started a new <a title="Math and Programming blog" href="http://mathandprogramming.blogspot.com/" target="_blank">blog on Math and Programming related topics</a>. She has an interest in Ruby development, especially with an abstract algebra / math focus, so if you&#8217;re interested in either Ruby or Mathematics, I&#8217;m sure there will be posts there which you will find useful. Already she&#8217;s off to a great start with a handful of informative Ruby related posts.</p>
<p>Here&#8217;s a sampling of a few to get you started:</p>
<ul>
<li><a title="Math &amp; Programming Blog: Ruby testing of private methods" href="http://mathandprogramming.blogspot.com/2010/01/ruby-testing-private-methods.html" target="_blank">Testing of private class methods in Ruby</a></li>
<li><a title="Math &amp; Programming Blog: Optimal Control Gem for Conway's Game of Life" href="http://mathandprogramming.blogspot.com/2010/01/ruby-gem-for-optimal-control-for.html" target="_blank">Ruby Gem of a library for finding an optimal control strategy for Conway&#8217;s Game of Life</a></li>
<li><a title="Math &amp; Programming Blog: Using Slime.vim to provide irb support to VIM" href="http://mathandprogramming.blogspot.com/2010/01/vim-for-irb.html" target="_blank">Vim for irb</a></li>
<li><a title="Math &amp; Programming Blog: Using obj.send in Ruby 1.9" href="http://mathandprogramming.blogspot.com/2010/01/objectsend-in-ruby-19.html" target="_blank">obj.send available in Ruby 1.9 despite reports</a></li>
</ul>
<p>She&#8217;s also got a post on getting <a title="Math &amp; Programming Blog: Syntax highlighting for blogger" href="http://mathandprogramming.blogspot.com/2010/01/syntax-highlighting-on-blogger.html" target="_blank">syntax highlighting up and running on Blogger</a> as well as a quick <a title="Math &amp; Programming Blog: Git alias tips" href="http://mathandprogramming.blogspot.com/2010/01/git-pushing-to-multiple-repositories.html" target="_blank">Git alias tip</a>.</p>
<p>All this in less than a week? Will be interesting to see if she keeps up this pace.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2010-01-06-friends-new-blog.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First drawing using Brushes.app on the iPhone</title>
		<link>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html#comments</comments>
		<pubDate>Tue, 26 May 2009 03:37:56 +0000</pubDate>
		<dc:creator>flickr</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[trouser mac]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html</guid>
		<description><![CDATA[


First drawing using Brushes, originally uploaded by Jeremy Johnstone.



Today I spent most of the day catching up on my blog reading and I stumbled across an article about a guy using an iPhone app named Brushes to design this month&#8217;s cover of The New Yorker. Highly impressed by the output and the video of it [...]]]></description>
			<content:encoded><![CDATA[<div style="text-align: left; padding: 3px;">
<a href="http://www.flickr.com/photos/jeremyjohnstone/3564935176/" title="photo sharing"><img src="http://farm4.static.flickr.com/3398/3564935176_5ebb97e93c.jpg" style="border: solid 2px #000000;" alt=""  class="aligncenter"/></a><br />
<br />
<span style="font-size: 0.8em; margin-top: 0px;"><a href="http://www.flickr.com/photos/jeremyjohnstone/3564935176/">First drawing using Brushes</a>, originally uploaded by <a href="http://www.flickr.com/people/jeremyjohnstone/">Jeremy Johnstone</a>.</span>
</div>
<p><br/></p>
<p>
Today I spent most of the day catching up on my blog reading and I stumbled across an <a href="http://www.newyorker.com/online/blogs/tny/2009/05/jorge-colombo-iphone-cover.html">article</a> about a guy using an iPhone app named <a href="http://brushesapp.com/">Brushes</a> to design this month&#8217;s cover of <a href="http://www.newyorker.com/">The New Yorker</a>. Highly impressed by the output and the video of it being created, I decided to give it a shot.</p>
<p>Realizing of course that I am definitely not an artist and that using just a finger on the iPhone screen isn&#8217;t the most precise way to dry, I don&#8217;t think my first work is too bad considering. I&#8217;ve done a lot of sketches in the past with various pen tablets and while the experience wasn&#8217;t anywhere near as easy as with them, it was pretty fun and rewarding that such a feat could be accomplished on my iPhone. A company named <a href="http://www.tenonedesign.com/">Ten One Design</a> seems to make a stylus for the iPhone for a very reasonable price ($14.95) and I think I might pick one up not just for this purpose.</p>
<p>I think what impressed me the most is that all this was possible using a $199 &#8220;smartphone&#8221;. Times are changing and when we step back and think about what was possible with a cell phone not even 10 years ago, it simply is amazing, IMHO.</p>
<p>The above image was modified after creation in Brushes to add in the frame and thought bubble. The additional elements were added using Photogene and then the image was uploaded to Flickr via Mobile Foto (both also iPhone apps). See below for a time-lapse video of the creation of the coke zero image created using the Brushes Viewer desktop companion app.</p>
<p><object type="application/x-shockwave-flash" width="267" height="400" data="http://www.flickr.com/apps/video/stewart.swf?v=71377" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  class="aligncenter"><param name="flashvars" value="intl_lang=en-us&#038;photo_secret=d297acfdaa&#038;photo_id=3564482213"></param><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=71377" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-us&#038;photo_secret=d297acfdaa&#038;photo_id=3564482213" height="400" width="267"  class="aligncenter"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2009-05-25-first-drawing-using-brushesapp-on-the-iphone.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Odd high pitched whistling noise from my Accord</title>
		<link>http://www.jeremyjohnstone.com/blog/2009-05-22-odd-high-pitched-whistling-noise-from-my-accord.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2009-05-22-odd-high-pitched-whistling-noise-from-my-accord.html#comments</comments>
		<pubDate>Sat, 23 May 2009 04:43:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[honda accord]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=933</guid>
		<description><![CDATA[Over the past week or so, I&#8217;ve been hearing a faint but very high pitched (>12k hz) whistling like sound coming from my 2006 Honda Accord V6 Coupe. It&#8217;s kind of a cross between an air leak type sound and the sound of a metal ball bearing spinning at high speed inside a metallic dish. [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past week or so, I&#8217;ve been hearing a faint but very high pitched (>12k hz) whistling like sound coming from my 2006 Honda Accord V6 Coupe. It&#8217;s kind of a cross between an air leak type sound and the sound of a metal ball bearing spinning at high speed inside a metallic dish. It usually only happens at night and happens for about the first 3-5 minutes I am driving. Bumps seem to trigger an increase in intensity or at least to make it start producing the sound. Slowing down with the brakes, even very lightly, seems to stop it instantly and dropping below about 20 miles per hour coasting causes it to stop too, so it&#8217;s been hard to pin point exactly where the sound is coming from.</p>
<p>Thankfully this evening I had a coworker in the car and we were able to isolate the sound to the compartment above the rear driver side seat belt. There is a side curtain airbag also inside that compartment, so obvious guess is something to do with that. I have no idiot lights illuminated on my dash of any kind, so a little stumped if that&#8217;s the real issue. </p>
<p>I will obviously take it by a mechanic to have it checked out, but am posting this for two. If anyone happens to have seen or heard of this before, I am all ears and please comment! The second reason of course is to add a post into the search engines as I can&#8217;t seem to find anyone with similar symptoms from their car and I&#8217;m sure my car can&#8217;t be the only one ever to have done this.</p>
<p>Hope it&#8217;s not the airbag as that will be an expensive thing to fix, especially since it just went out of warranty. Figures right!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2009-05-22-odd-high-pitched-whistling-noise-from-my-accord.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Wolfram&#124;Alpha lives up to it&#8217;s &#8220;alpha&#8221; naming</title>
		<link>http://www.jeremyjohnstone.com/blog/2009-05-19-wolframalpha-lives-up-to-its-alpha-naming.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2009-05-19-wolframalpha-lives-up-to-its-alpha-naming.html#comments</comments>
		<pubDate>Tue, 19 May 2009 07:30:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=911</guid>
		<description><![CDATA[Today over lunch coworkers were talking about Wolfram&#124;Alpha and it sparked my interest again now that it&#8217;s finally open to the public. Tonight I decided to give it a whirl and unlike two of my friends, decided to throw it a softball initially with a very easy question:
what is the speed of light in free [...]]]></description>
			<content:encoded><![CDATA[<p>Today over lunch coworkers were talking about Wolfram|Alpha and it sparked my interest again now that it&#8217;s finally open to the public. Tonight I decided to give it a whirl and unlike two of my friends, decided to throw it a softball initially with a very easy question:</p>
<blockquote><p>what is the speed of light in free space?</p></blockquote>
<p>Pretty much any geek worth his/her salt should know the answer to that question without batting an eyelash. Browny points to those who know it down to a couple decimal places in meters per second. Obviously since most of the examples on the homepage of the site are technical / mathematical related, it should get the answer right off, yes?</p>
<p>Well, that logical conclusion is apparently flawed as it failed. See the screenshot here:</p>
<p><a href="http://www45.wolframalpha.com/input/?i=what+is+the+speed+of+light+in+free+space"><img class="aligncenter size-medium wp-image-912" title="wolfram_alpha" src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2009/05/wolfram_alpha-300x104.png" alt="wolfram_alpha" width="300" height="104" /></a></p>
<p>Even Google (which has been lacking lately in search result quality, IMHO) did a better job than that as seen here:</p>
<p><a href="http://www.google.com/search?hl=en&#038;q=what+is+the+speed+of+light+in+free+space&#038;btnG=Google+Search&#038;aq=f&#038;oq="><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2009/05/google-300x82.png" alt="google" title="google" width="300" height="82" class="aligncenter size-medium wp-image-913" /></a></p>
<p>They obviously don&#8217;t provide the answer, but the first result gives one enough confidence that it&#8217;s a no brainer to click on it. Now for the best overall of the three, Yahoo!, does one better than Google by not only including the same result, but also gives me the exact answer I am looking for right there in the result excerpt (which Google conveniently truncated with ellipses) as seen here:</p>
<p><a href="http://search.yahoo.com/search?p=what+is+the+speed+of+light+in+free+space"><img src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2009/05/yahoo-300x100.png" alt="yahoo" title="yahoo" width="300" height="100" class="aligncenter size-medium wp-image-914" /></a></p>
<p>At the end of the day, the score stands at:</p>
<ul>
<li>Wolfram|Alpha = 0</li>
<li>Google = 1</li>
<li>Yahoo! = 1.5</li>
</ul>
<p>With the bonus points for Yahoo! in saving me an extra click. </p>
<p>Glad to see our search still stands proud. Wolfram|Alpha definitely has a <strong>lot</strong> of promise and potential, but it&#8217;s still yet to be seen whether it will live up to that lofty goal.</p>
<p><i>Update:</i> Interestingly, if you wanted to know what the <a href="http://www49.wolframalpha.com/input/?i=speed+of+light+in+parsecs+per+millennium">speed of light in parsecs per millennium</a> was, it could definitely provide that answer to you. <img src='http://www.jeremyjohnstone.com/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Also if you think it failed simply because I said &#8220;what is the&#8221; at the beginning of the query, you would be wrong. For it to provide a result I would have to drop my query down to just &#8220;speed of light&#8221;, which wouldn&#8217;t necessarily be what I am looking for because the speed of light is variable where as the &#8220;speed of light in free space&#8221; is a constant value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2009-05-19-wolframalpha-lives-up-to-its-alpha-naming.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Out with the old, in with the new</title>
		<link>http://www.jeremyjohnstone.com/blog/2009-05-17-out-with-the-old-in-with-the-new.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2009-05-17-out-with-the-old-in-with-the-new.html#comments</comments>
		<pubDate>Sun, 17 May 2009 16:09:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/?p=900</guid>
		<description><![CDATA[This weekend I finally got around to updating my website design again after a year since the last visual update. It seems it&#8217;s more or less become a once a year type deal. The old design just wasn&#8217;t doing it for me so I took the opportunity to scrap everything and start over.
With the new [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I finally got around to updating my website design again after a year <a href="http://www.jeremyjohnstone.com/blog/2008-04-13-finally-updated-my-website.html">since the last visual update</a>. It seems it&#8217;s more or less become a once a year type deal. The old design just wasn&#8217;t doing it for me so I took the opportunity to scrap everything and start over.</p>
<p>With the new design I scrapped the dual Wordpress installation, one being for blog posts and other being for tweets, and instead have a single Wordpress install driving virtually the entire site. I also added a much heavier focus on code highlighting and image viewing, since that is the two biggest things I post about on this site.</p>
<p>I also decided to go with a more clean and polished template, which I purchased from <a href="http://themeforest.net/">Theme Forest</a> instead of designing myself like I did last time. The price was very reasonable and the output, while not unique, looks very good in my opinion. Curious to see what others will say about it so shout off in the comments.</p>
<p>There still are a few areas needing polish, like general pingback appearance and comment / post CSS tweaks, but overall I am very happy for the little amount of work I put into it. In the process of putting the new design online, I also moved primary hosting of my blog from BlueHost to Aptana cloud. I&#8217;ll be posting a more in depth review of my experience with it in the near future.</p>
<p>In closing, here&#8217;s a screenshot of the old homepage for posterity:</p>
<p style="text-align: center;">Above the fold:</p>
<p><img class="aligncenter size-medium wp-image-902" title="old_homepage_top" src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2009/05/home_top-300x225.png" alt="old_homepage_top" width="300" height="225" /></p>
<p style="text-align: center;">Below the fold (slightly different scale, the boxes did match up before):</p>
<p><img class="aligncenter size-medium wp-image-901" title="old_homepage_bottom" src="http://www.jeremyjohnstone.com/wordpress/wp-content/uploads/2009/05/bottom-300x129.png" alt="old_homepage_bottom" width="300" height="129" /></p>
<p>Be sure and let me know your comments / criticism / suggestions!</p>
<p>Thanks!</p>
<p>-Jeremy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2009-05-17-out-with-the-old-in-with-the-new.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP parser for OS X plist XML files</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html#comments</comments>
		<pubDate>Mon, 27 Oct 2008 03:42:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php_class_lib]]></category>
		<category><![CDATA[plist]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=384</guid>
		<description><![CDATA[Digging around today for a PHP parser for OSX plist files, I was surprised to find no good pre-existing solutions. Even Apple&#8217;s own site gives a relatively poor solution to the problem (see here). Normally SimpleXML is enough to handle most XML parsing needs, but the plist XML format is just broken enough to make [...]]]></description>
			<content:encoded><![CDATA[<p>Digging around today for a PHP parser for OSX plist files, I was surprised to find no good pre-existing solutions. Even Apple&#8217;s own site gives a relatively poor solution to the problem (<a href="http://developer.apple.com/internet/opensource/php.html">see here</a>). Normally SimpleXML is enough to handle most XML parsing needs, but the plist XML format is just broken enough to make parsing it with SimpleXML virtually impossible. Since I hadn&#8217;t played with XMLReader much, I thought it would be a good chance to give it a spin. For the anxious types, the code is available on <a href="http://github.com/jsjohnst/php_class_lib/tree/master">github in my php_class_lib project</a>, so dig right in. Read on for a simple example (included in the repos).</p>
<p>The original intent of the parser for me was to parse my iTunes&#8217; library in PHP, so <a href="http://github.com/jsjohnst/php_class_lib/tree/master/classes/parsers/plist/example.php">this example</a> will show doing just that:</p>
<pre class="brush: php">&lt;?php

include("PlistParser.inc");

$parser = new plistParser();
$plist = $parser-&gt;parse(dirname(__FILE__) . "/iTunes.xml");
var_dump($plist);
</pre>
<p>And from that, the output is as follows:</p>
<pre class="brush: php">array(8) {
  ["Major Version"]=&gt;
  int(1)
  ["Minor Version"]=&gt;
  int(1)
  ["Application Version"]=&gt;
  string(5) "8.0.1"
  ["Features"]=&gt;
  int(5)
  ["Show Content Ratings"]=&gt;
  bool(true)
  ["Music Folder"]=&gt;
  string(60) "file://localhost/Users/testUser/Music/iTunes/iTunes%20Music/"
  ["Library Persistent ID"]=&gt;
  string(15) "C39203948AF3D3E"
  ["Tracks"]=&gt;
  array(1) {
    [1]=&gt;
    array(25) {
      ["Track ID"]=&gt;
      int(1)
      ["Name"]=&gt;
      string(8) "My Track"
      ["Artist"]=&gt;
      string(9) "My Artist"
      ["Album"]=&gt;
      string(8) "My Album"
      ["Genre"]=&gt;
      string(8) "My Genre"
      ["Kind"]=&gt;
      string(15) "MPEG audio file"
      ["Size"]=&gt;
      int(123456)
      ["Total Time"]=&gt;
      int(123456)
      ["Track Number"]=&gt;
      int(1)
      ["Year"]=&gt;
      int(2008)
      ["Date Modified"]=&gt;
      string(20) "2008-03-03T03:33:33Z"
      ["Date Added"]=&gt;
      string(20) "2008-03-03T03:33:33Z"
      ["Bit Rate"]=&gt;
      int(128)
      ["Sample Rate"]=&gt;
      int(44100)
      ["Comments"]=&gt;
      string(20) "All Rights Reserved."
      ["Release Date"]=&gt;
      string(20) "2007-03-12T04:01:37Z"
      ["Persistent ID"]=&gt;
      string(14) "C3E339393939E3"
      ["Track Type"]=&gt;
      string(4) "File"
      ["Podcast"]=&gt;
      bool(false)
      ["Unplayed"]=&gt;
      bool(true)
      ["File Type"]=&gt;
      int(123456)
      ["File Creator"]=&gt;
      int(123456)
      ["Location"]=&gt;
      string(66) "file://localhost/Users/testUser/Music/iTunes/iTunes%20Music/my.mp3"
      ["File Folder Count"]=&gt;
      int(4)
      ["Library Folder Count"]=&gt;
      int(1)
    }
  }
}</pre>
<p>As you can see, the PHP parser made short order of that task. From here you now have full access to all the metadata in your iTunes library. Feel free to use the class in your own projects and be sure to let me know what you build with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-10-26-php-parser-for-os-x-plist-xml-files.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Enums in PHP</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-10-05-enums-in-php.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-10-05-enums-in-php.html#comments</comments>
		<pubDate>Sun, 05 Oct 2008 12:11:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHPClassLib]]></category>
		<category><![CDATA[userland]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=383</guid>
		<description><![CDATA[I&#8217;m not sure what lead me to it, but I stumbled across a blog post on how to implement Enums in PHP via userland code written by Jonathan Hohle. I liked the concept he had, but the implementation was a bit unappealing because it used eval() among other more minor issues. You shouldn&#8217;t need to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure what lead me to it, but I stumbled across a blog post on <a href="http://it.toolbox.com/blogs/macsploitation/enums-in-php-a-native-implementation-25228">how to implement Enums in PHP via userland code</a> written by Jonathan Hohle. I liked the concept he had, but the implementation was a bit unappealing because it used eval() among other more minor issues. You shouldn&#8217;t need to generate Enums at runtime, so I took that as a challenge to find a way to do it at compile time, thus making the code much more efficient. Like Jonathan, I also wanted to maintain support for PHP&#8217;s type hinting and it should obviously support the semantics one expects from an enum if feasible. I wasn&#8217;t sure of the real value to having the Enums iterable as well like he did, but I figured if possible I should keep support for that too.</p>
<p>First off, we need the Enum base class as follows:</p>
<pre class="brush: php">
abstract class Enum {
	final public function __toString() {
		return get_class($this);
	}
}
</pre>
<p>From that miniscule amount of code we have the beginnings of Enum support simply by extending that class as follows:</p>
<pre class="brush: php">
abstract class DNSRecordType extends Enum {}

class A extends DNSRecordType {}
class CNAME extends DNSRecordType {}
class MX extends DNSRecordType {}

function printDnsRecord(DNSRecordType $type, ...) {
       // We can now be sure $type is a DNSRecordType
}
</pre>
<p>There are of course a few issues, one of the biggest being that <code>(new A) !== (new A)</code> in the above example code. Here we modify the Enum base class to add support for fixing the equality comparison:</p>
<pre class="brush: php">
abstract class Enum {
	protected static $instances = array();

	final private function __construct() {}

	final public function __toString() {
		return get_class($this);
	}

	final public static function get($name) {
		if(is_subclass_of($name, "Enum")) {
			if(array_key_exists($name, self::$instances)) {
				return self::$instances[$name];
			} else {
				return self::$instances[$name] = new $name();
			}
		} else {
			throw Exception();
		}
	}

	final public static function __callStatic($name, $args) {
		return self::get($name);
	}
}
</pre>
<p>Now if we want to use an enum, instead of instantiating the CNAME class directly, we use <code>DNSRecordType::get("CNAME");</code> on versions of PHP older than 5.3 and in PHP 5.3 we can save a few keystrokes and instead use <code>DNSRecordType::CNAME()</code> to get a CNAME. Obviously in the case of older versions of PHP we are adding a few extra keystrokes, but unfortunately that is required to avoid having to define custom methods for each Enum type due to the lack of the __callStatic() magic method before PHP 5.3.</p>
<p>Ok, so what&#8217;s next? Well, I guess our next issue would be that Enums, in the case of languages based on C style semantics, by default don&#8217;t have the value of a member as the the name of the member, but rather an integer which increments from zero for each member. Furthermore, in C style enums you can set the value too if you like to any integer of your choice and then each member after that which doesn&#8217;t have a specified value will be incremented one higher from it consecutively. To support this style behavior, it forces us partly out of being able to do this at compile time (thus a performance hit). Because of the performance hit, I decided you have to enable this mode before using it, otherwise you get the previous behavior we defined above.</p>
<p>The now updated code is as follows:</p>
<pre class="brush: php">
abstract class Enum {
	protected static $instances = array();
	protected $value = null;

	protected static $pureMode = false;
	protected static $classesWalked = false;
	protected static $typeCounters = array();
	protected static $classIntValues = array();

	final private function __construct() {}

	final public static function enablePureMode() {
		self::$pureMode = true;
	}

	final protected static function walkClasses() {
		if(self::$pureMode &#038;&#038; !self::$classesWalked) {
			foreach(get_declared_classes() as $class) {
				if(is_subclass_of($class, "Enum") &#038;&#038; $class !== "Enum") {
					$parent = get_parent_class($class);
					if($parent == "Enum") continue;
					if(!array_key_exists($parent, self::$typeCounters)) {
						self::$typeCounters[$parent] = 0;
					}
					$obj = new $class;
					$objval = $obj->value;
					if(!is_null($objval)) {
						if(!is_numeric($objval)) {
							$nextval = ord($objval) + 1;
						} else {
							$nextval = $objval + 1;
						}
						if($nextval <= self::$typeCounters[$parent]) {
							throw new Exception("Specified enum member value is impossible");
						}
						self::$classIntValues[$class] = $objval;
						self::$typeCounters[$parent] = $nextval;
					} else {
						self::$classIntValues[$class] = self::$typeCounters[$parent]++;
					}
				}
			}
			self::$classesWalked = true;
		}
	}

	final public function __toString() {
		if(self::$pureMode) {
			// delay the performance hit until we actually need the value of one of the enums
			self::walkClasses();
			return (string) self::$classIntValues[get_class($this)];
		} else {
			return get_class($this);
		}
	}

	final public static function get($name) {
		if(is_subclass_of($name, "Enum")) {
			if(array_key_exists($name, self::$instances)) {
				return self::$instances[$name];
			} else {
				return self::$instances[$name] = new $name();
			}
		} else {
			throw new Exception();
		}
	}

	final public static function __callStatic($name, $args) {
		return self::get($name);
	}
}
</pre>
<p>With the above change, we can now have an enums for months with January's value being 1 for example, like the following:</p>
<pre class="brush: php">
Enum::enablePureMode();
abstract class Month extends Enum {}
class JAN extends Month { var $value = 1; }
class FEB extends Month {}
class MAR extends Month {}
... etc
</pre>
<p>We can also do things like the following too:</p>
<pre class="brush: php">
Enum::enablePureMode();
abstract class Whitespace extends Enum {}
class Newline extends Whitespace { var $value = "\n"; }
class Space extends Whitespace { var $value = " "; }
class Tab extends Whitespace { var $value = "\t"; }
... etc
</pre>
<p>Pretty nifty eh? Please do note, once you enablePureMode it's enabled for all instances of any Enum because you have already incurred the performance loss. Also, due to the nature of how enablePureMode works, you need to make sure you always have all your Enums defined before you try to use one of their values. This shouldn't be an issue in most cases, but just something to keep in mind. Doing quick tests showed the performance hit from having enablePureMode turned on was pretty trivial (less than a millisecond in some cases), but since you might not need the behavior, no point in taking the performance hit if you don't need to.</p>
<p>The last thing left is to make an iterator of all the members of an Enum. This part is really quick and easy and requires us to add the following method to our Enum class:</p>
<pre class="brush: php">
final public static function iterator($enum_type) {
	return new EnumIterator($enum_type);
}
</pre>
<p>As well as also define the following additional class:</p>
<pre class="brush: php">
class EnumIterator implements Iterator {
	protected $classes = array();
	protected $enum_type;

	public function __construct($enum_type) {
		if(!class_exists($enum_type) || !is_subclass_of($enum_type, "Enum")) throw new Exception("Specified Enum type doesn't exist or is not an Enum!");
		$this->enum_type = $enum_type;
		foreach(get_declared_classes() as $class) {
			if(is_subclass_of($class, $this->enum_type)) {
				$this->classes[] = $class;
			}
		}
	}

	public function current() {
		return current($this->classes);
	}

	public function key() {
		return key($this->classes);
	}

	public function next() {
		next($this->classes);
		return $this->current();
	}

	public function rewind() {
		return reset($this->classes);
	}

	public function valid() {
		return (bool) $this->current();
	}
}
</pre>
<p>An example of using the iterator is as follows:</p>
<pre class="brush: php">
echo "DNSRecordType:\n";
foreach(Enum::iterator("DNSRecordType") as $type) {
	echo "\t" . $type . " has value " . (Enum::get($type)) . "\n";
}
</pre>
<p>To get a copy of the code including several example usage demonstrations, please visit the following URL: <a href="http://github.com/jsjohnst/php_class_lib/tree/master/classes/types/enum">http://github.com/jsjohnst/php_class_lib/tree/master/classes/types/enum</a></p>
<p>If you find this useful, please let me know!</p>
<p>-Jeremy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-10-05-enums-in-php.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Bailouts: Ever think of it this way??</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-10-01-bailouts-ever-think-of-it-this-way.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-10-01-bailouts-ever-think-of-it-this-way.html#comments</comments>
		<pubDate>Wed, 01 Oct 2008 06:06:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=382</guid>
		<description><![CDATA[Got an interesting email forward from my father. I haven&#8217;t verified the math and statistical figures, but it looks right on a cursory glance (Update: It&#8217;s bad math, but still sounds like a good plan, no?). Very interesting idea to say the least.

Dear American Citizens,

I&#8217;m against the $85 BILLION bailout of AIG. Instead, I&#8217;m in [...]]]></description>
			<content:encoded><![CDATA[<p>Got an interesting email forward from my father. I haven&#8217;t verified the math and statistical figures, but it looks right on a cursory glance <strong>(Update: It&#8217;s bad math, but still sounds like a good plan, no?)</strong>. Very interesting idea to say the least.</p>
<blockquote><p>
Dear American Citizens,</p>
<p><br/></p>
<p>I&#8217;m against the $85 BILLION bailout of AIG. Instead, I&#8217;m in favor of giving $85,000,000,000 to America in a &#8220;We Deserve It&#8221; dividend. To make the math simple, let&#8217;s assume there are 200,000,000 bona fide U.S. citizens, aged 18+.</p>
<p><br/></p>
<p>Our population is about 301 million counting every man, woman and child. So, 200,000,000 might be a fair stab at adults 18 and up. Now, divide 200 million, 18+ adults into $85 billion &#8211; that equals $425,000.00 each! Yes, my plan is to give that $425,000 to every adult as a &#8220;We Deserve It&#8221; dividend.</p>
<p><br/></p>
<p>Of course, it would NOT be tax free.  So, let&#8217;s assume a tax rate of 30%. Everyone would pay $127,500.00 in taxes. That sends $25.5 billion right back to Uncle Sam! It also means that every adult 18+ has $297,500.00 in their pocket. A husband and wife would have $595,000.00!</p>
<p><br/></p>
<p>What could you do with $297,500.00 to $595,000.00?</p>
<ul>
<li>Pay off your mortgage – housing crisis solved.</li>
<li>Repay college loans – what a great boost to new grads</li>
<li>Put away money for college – it&#8217;ll really be there.</li>
<li>Save in a bank – create money to loan to entrepreneurs.</li>
<li>Buy a new car – create jobs.</li>
<li>Invest in the market – capital drives growth.</li>
<li>Pay for your parent&#8217;s medical insurance – health care improves.</li>
<li>Enable deadbeat parents to come clean – or else.</li>
</ul>
<p>Remember this is for every adult U.S. citizen, 18 and older (including the folks who lost their jobs at Lehmann Brothers and every other company that is cutting back) and of course, for those serving in our Armed Forces.</p>
<p><br/></p>
<p>If we&#8217;re going to re-distribute wealth let&#8217;s really do it! Instead of trickling out a puny $1,000.00  &#8220;economic incentive&#8221;. If we&#8217;re going to do an $85 billion bailout, let&#8217;s bail out every adult U.S. citizen!</p>
<p><br/></p>
<p>As for AIG – liquidate it.</p>
<ul>
<li>Sell off its parts.</li>
<li>Let American General go back to being American General.</li>
<li>Sell off the real estate.</li>
<li>Let the private sector bargain hunters cut it up and clean it up.</li>
</ul>
<p>We deserve the money and AIG doesn&#8217;t.</p>
<p><br/></p>
<p>How do you spell Economic Boom? W-e  D-e-s-e-r-v-e  I-t  d-I-v-I-d-e-n-d!  I trust my fellow adult Americans to know how to use the $85 Billion &#8220;We Deserve It&#8221; dividend more than do the &#8216;geniuses&#8217; at AIG or in Washington, D.C.</p>
<p><br/></p>
<p>And remember, my plan only really costs $59.5 billion because $25.5 billion is returned instantly in taxes to Uncle Sam.  Good idea?  I think so.</p>
<p><br/></p>
<p><strong><em>OK&#8230; let&#8217;s look at that 700 billion bailout now!</em></strong><br />
<br/><br />
-Unknown Source</p>
</blockquote>
<p>What do you think of the idea? Sound off in the comments below!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-10-01-bailouts-ever-think-of-it-this-way.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Where does all the time go? No, really!</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-09-03-where-does-all-the-time-go-no-really.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-09-03-where-does-all-the-time-go-no-really.html#comments</comments>
		<pubDate>Thu, 04 Sep 2008 04:36:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[interests]]></category>
		<category><![CDATA[my life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=381</guid>
		<description><![CDATA[I&#8217;m constantly feeling like I am running 90mph to keep up with everything going on. I&#8217;m not complaining per say, but felt it would be prudent for me to figure out all the things I am involved in and then make a decision on if they are the most important usage of my time. I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m constantly feeling like I am running 90mph to keep up with everything going on. I&#8217;m not complaining per say, but felt it would be prudent for me to figure out all the things I am involved in and then make a decision on if they are the most important usage of my time. I decided to break them down into two categories, work related and strictly personal stuff. The work stuff ended up being specific projects / tasks I work on while it seemed the personal stuff leaned more towards concepts and activities. Probably just the nature of what I am doing. So without further ado, here&#8217;s the list for the world to see:</p>
<p><strong>Work Related</strong></p>
<ul>
<li>ConnectedTV team. This is my day job and rightfully consumes the most of my waking hours of probably anything else. I love my job and what I do, so the time spent here goes by without noticing sometimes.</li>
<li>Photography. This is the second most time consuming thing I do. &#8220;Snapping&#8221; photos doesn&#8217;t take much time one would think, but when you combine sorting, post processing, setup/teardown etc. it easily consumes much more time. I&#8217;ve done like 50-60 exec headshots, 40-50 non-exec headshots, countless corp events, and a ton more in the past year alone so this definitely does consume a lot of my time. I&#8217;ve been slowly scaling back on this, but might decide to scale back more aggressively still.</li>
<li>Evangelism. This is something I do in many forms, ranging from leading up an internal employee evangelism team to attending conference and other tech events. I&#8217;ve been to four major conferences this year alone (Mac World, SWSX, Web 2.0, IDF) with more coming. </li>
<li>Point of contact. I am the point of contact on a lot of different things at Yahoo!, ranging from DHS/FEMA in disaster related things, to handling our Apple EPP relationship for North America, to the League of Women&#8217;s Voters since I maintain hosting for <a title="Vote411.org" href="http://www.vote411.org" target="_blank">vote411.org</a>. </li>
<li>Working groups / committees. These vary from time to time, but I am usually involved in a couple at any given moment either inside Yahoo! or outside but Yahoo! related somehow. These range from stuff like the Green Coding Initiative, to our YEF Grants committee, to outside stuff like being on DHS&#8217;s NetGuard working group. </li>
<li>Side projects / hacks. I&#8217;m always looking for new ways to optimize some process or fill a niche need of mine or others so I am constantly building up small side projects that I am working on or want to do someday.</li>
</ul>
<p><strong>Personal</strong></p>
<ul>
<li>Reading. Probably the single biggest consumer of my time outside work. I love reading and am constantly chewing through books. I think I have like ten I am flipping back and forth between on my Kindle now with over 100 more waiting to be started either on the Kindle or in printed book form.</li>
<li>Photography. Not just something I do for work, but also something I do for fun. It&#8217;s challenging and allows me to try and develop an artistic side.</li>
<li>Yoga. Except for the past two weeks (been injured from my last hike) I&#8217;ve been doing Yoga three times a week for the last two months. This is something I hope to resume very soon once my chest feels up to it.</li>
<li>Traveling. I LOVE to travel to new places. In the past year the new places I&#8217;ve been to are Cayman Islands, England, and Bonaire. I&#8217;m scheduled to go to India sometime in November for the first time and will be spending two weeks in Malaysia, Singapore, Kuala Lumpor, and Sipadan Water Village in March of next year. I&#8217;ve also done a lot of domestic traveling over the past year and will likely do more before the year is out.</li>
<li>Outdoor activities. Predominantly this involves scuba diving and hiking lately, but I also enjoy stuff like sky diving, water skiing, etc too, just not found the time recently.</li>
<li>Programming for fun. I always have some project or another I am working on for fun. This could range from working on my personal website, to building some twitter client, or coding for some platform I am passionate about (like OSX/iPhone).</li>
</ul>
<p>As you can see from the above list, there isn&#8217;t a lot of activities (in the personal category at least) strictly related to just socializing or meeting new people. Maybe that&#8217;s why I am almost 30 and still single. Hmm, something else to think about.</p>
<p>I&#8217;m sure the above list isn&#8217;t all inclusive by any means either, it&#8217;s just what came to mind when I thought about it. So, now that you know where my time is spent, what consumes your time? Feel free to share in the comments or postback from your own blog.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-09-03-where-does-all-the-time-go-no-really.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Trouble With Email</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-07-29-the-trouble-with-email.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-07-29-the-trouble-with-email.html#comments</comments>
		<pubDate>Wed, 30 Jul 2008 06:29:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=380</guid>
		<description><![CDATA[Ok, so I have a problem. One which keeps me up at night and annoys me greatly, but I can&#8217;t seem to find a solution to fix. So what is this problem? Email SUCKS, that&#8217;s the problem! Ok Ok, I am sure you are thinking &#8220;great, and?&#8221; as it&#8217;s a common rant. Here&#8217;s my needs:

 [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I have a problem. One which <span class="afterthought" title="really">keeps me up at night</span> and annoys me greatly, but I can&#8217;t seem to find a solution to fix. So what is this problem? Email SUCKS, that&#8217;s the problem! Ok Ok, I am sure you are thinking &#8220;great, and?&#8221; as it&#8217;s a common rant. Here&#8217;s my needs:</p>
<ol>
<li> I want my email everywhere at every time, with or without network access, on a range of devices. Sitting at my desk with my main desktop? Sitting in a meeting with my laptop? Sipping a coffee with my iPhone in my hand? On a plane flight to some far away place? All of those should be no challenge to doing something as simple as reading an email, right?</li>
<li>I like to organize my email, especially mailing lists which I subscribe to hundreds of at last count. Some lists are important, others less so and should be organized accordingly. As having things &#8220;in view&#8221; can be distracting when I don&#8217;t need to see them, I need the ability to have a <span class="afterthought" title="aka subfolders">nesting system</span> or some other way to have multiple views into my mail. These &#8220;views&#8221; should be synchronized across all devices and possibly have the ability to be <span class="afterthought" title="maybe I don't want some things to show on the iPhone for example">device specific</span>.</li>
<li>When someone sends me an email, it should show up instantly in every client, not five minutes later, not an hour later, certainly not forcing me to <span class="afterthought" title="yeah, I am talking about you damn Mail.app">restart the app just to see the email</span>. The system should also support some type of push system as constantly &#8220;polling&#8221; puts excessive load on the server and sucks up precious power reserves in the case of mobile devices.</li>
<li>I need the ability to find old stuff quickly and painlessly, again on any device. We can have Yahoo! search teh net in under 100ms for anything I could dream up for a search term but even my quad core Xeon can&#8217;t accomplish a similar search across an infinitely smaller dataset in under five minutes? Huh? You&#8217;re kidding right? Guess I won&#8217;t even try it on my iPhone then as I know my battery will then run dead before the search finishes in that case.</li>
</ol>
<p>Seems like fairly modest needs right? Should be doable? Well, I am amazed to say it seems to be about as simple as sending a man in a balloon to the moon.</p>
<p>Currently I am running my own Courier IMAP server, using Procmail and all it&#8217;s powerful mojo to sort my mail, and using Mail.app as the actual MUA. The problems I run into are as follows, in no special order and certainly not all inclusive:</p>
<ol>
<li>My mail server is constantly thrashing the disk. Despite being on a dual G5 w/ plenty of memory and decently fast I/O, it seems the combination of commands Mail.app sends to Courier seems to give it fits. Have two clients hitting it at once and the machine drops to a snail crawl. Heaven forbid you add that third client and the <span class="afterthought" title="I shit you not, true story">machine starts sparking and flames shoot out the back</span>. Of course running it on another OS would probably help as OSX doesn&#8217;t have the best kernel support for things like this, but that&#8217;s not the point. I&#8217;ve also thought about moving over to another IMAP server implementation, but as yet I haven&#8217;t found one which I feel confident will be better performing without enough negative aspects to scare me away.</li>
<li>Mail.app seems to not like to pull subfolders with consistency. It&#8217;s extremely common for me to restart the app and suddenly have hundreds of unread emails suddenly appear across folders. This definitely is a problem no matter how you look at it. Of course there are multiple possible causes to blame, but that&#8217;s irrelevant. I don&#8217;t care if the IMAP spec is brain dead in how it specifies IDLE support, that&#8217;s not my problem. Having a mail client which shows new mail without fail should be one of it&#8217;s developer&#8217;s top priorities.</li>
<li>Procmail while very powerful is extremely error prone. I&#8217;ve had several occasions where things backfired. My dream would be to someday have something which said &#8220;hey, you moved this email into this place, would you like me to move emails like it in the future for you?&#8221;, but then I snap back to reality and realize that&#8217;s a geek&#8217;s wet dream and not anything which will really work as you would expect any time soon.</li>
<li>Keeping multiple devices and offline copies of emails in sync seems to be error prone at best. Isn&#8217;t this exactly the problem IMAP is supposed to solve? Tell me again why there is not a single IMAP client which handles this painlessly? Oh, right, that&#8217;s because the IMAP spec is crap. Please fix, ok? KTHXBAI!
</li>
</ol>
<p>So my question is, is there something I have missed? If you have a solution I am more than ready to apply my hand to my forehead and yell &#8220;Do&#8217;t&#8221; with enthusiasm. Sound off in the comments with what works for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-07-29-the-trouble-with-email.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Photoshop: 1 + 2 = 3</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-05-26-photoshop-1-2-3.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-05-26-photoshop-1-2-3.html#comments</comments>
		<pubDate>Mon, 26 May 2008 09:22:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=379</guid>
		<description><![CDATA[Having a bit of free time this evening, I decided to do a bit of photo editing work. In this example, I took one slightly underexposed image + one highly overexposed image of a statue in London, England and combined them into one HDR image. Here you can see the three images, click one each [...]]]></description>
			<content:encoded><![CDATA[<p>Having a bit of free time this evening, I decided to do a bit of photo editing work. In this example, I took one slightly underexposed image + one highly overexposed image of a statue in London, England and combined them into one HDR image. Here you can see the three images, click one each to see a higher resolution version.</p>
<p><center></p>
<h3>Underexposed Image:</h3>
<p><a href="http://farm4.static.flickr.com/3120/2523212913_51553c91cc_o.jpg" target="_blank"><img src="http://farm3.static.flickr.com/2217/2524036888_fe06e5a184_o.jpg" width="400" height="266" alt="Statue 1-sized" /></a></p>
<h3>Overexposed Image:</h3>
<p><a href="http://farm3.static.flickr.com/2289/2523212927_91542b1795_o.jpg" target="_blank"><img src="http://farm3.static.flickr.com/2304/2524036866_0a2ae941aa_o.jpg" width="400" height="266" alt="Statue 2-sized" /></a></p>
<h3>Final HDR Image:</h3>
<p><a href="http://farm4.static.flickr.com/3265/2524036786_078607b75d_o.jpg" target="_blank"><img src="http://farm4.static.flickr.com/3049/2524036902_d1bd5525d2_o.jpg" width="400" height="267" alt="Statue 3-sized" /></a></p>
<p></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-05-26-photoshop-1-2-3.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>EcoBalls &#8212; Are they for real?</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-05-11-ecoballs-are-they-for-real.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-05-11-ecoballs-are-they-for-real.html#comments</comments>
		<pubDate>Sun, 11 May 2008 21:48:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ecoballs]]></category>
		<category><![CDATA[green]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=378</guid>
		<description><![CDATA[While in London last weekend I stumbled across an interesting laundry detergent alternative called EcoBalls. They are these green UFOish shaped balls with pellets inside. Not hearing of them before and being skeptical, I decided to hold off buying them, especially at £35.
Doing a bit of research online, I&#8217;ve found mixed information. The majority of the skeptics [...]]]></description>
			<content:encoded><![CDATA[<p>While in London last weekend I stumbled across an interesting laundry detergent alternative called EcoBalls. They are these green UFOish shaped balls with pellets inside. Not hearing of them before and being skeptical, I decided to hold off buying them, especially at £35.</p>
<p>Doing a bit of research online, I&#8217;ve found mixed information. The majority of the skeptics I have seen arguing against them seem to focus on the gimicky nature of the product description and/or inaccurately point to debunk stories on &#8220;similar&#8221; products. I use the term &#8220;similar&#8221; like I do because I really feel that after researching it, EcoBalls are a bit different than many of the products out there like it.<span id="more-378"></span></p>
<p><center><a href="http://www.flickr.com/photos/jeremyjohnstone/2484355666/"><img src="http://farm3.static.flickr.com/2186/2484355666_373bdb9a4b_o.jpg" width="500" height="332" /></a></center></p>
<p>The one thing I found most interesting about all of the information I read online attempting to debunk them is that none of them paid any attention to the components of the pellets inside the balls. Reading that they had a limit on the number of wash cycles (albeit high one), I knew the pellets had to break down in some way. Digging a bit more, I found out the ingredients of the pellets are as follows:</p>
<table width="100%">
<tr>
<td>
<ul>
<li>higher alkyl sulfate</li>
<li>non-ionic surfacant</li>
<li>sodium metasilicate</li>
<li>calcium carbonate</li>
<li>sodium carbonate</li>
</ul>
</td>
<td><a href="http://www.flickr.com/photos/jeremyjohnstone/2483540553/"><img src="http://farm4.static.flickr.com/3221/2483540553_1e95fac7b9_o.jpg" height="157" width="235" /></a></td>
</tr>
</table>
<p>For something claiming to be chemical free, that ingredient list definitely seems to point otherwise. Looking at the ingredient list more, I started to recognize some of them as stuff I had heard of before, interestingly enough from cleaning products. Let&#8217;s go through each one, one by one.</p>
<p>First we have &#8220;higher alkyl sulfate&#8221;. This is listed as an &#8220;adjuvant&#8221; which basically means it&#8217;s an inactive ingredient which serves the purpose of assisting the dispersion of the active ingredients. It can be likened to an emulsifier and I&#8217;ve found several references to it being used in cleaning products online.</p>
<p>Next we have &#8220;non-ionic surfacant&#8221;. This one is a wetting agent which assists in lowering the surface tension of water. This allows the cleaning solutions to have better ability to break up stains and soils. Again, a common ingredient in cleaning products.</p>
<p>Then we have &#8220;sodium metasilicate&#8221;. This is one is used to assist the surfacant above by reducing the hardness of the water. Interestingly, this one is both poisonous and reacts fairly violently to acids. For something claiming to be so safe, this ingredient doesn&#8217;t support that claim. It could be a small ingredient, though, reducing the potential for issues. Still something you want to make sure small children don&#8217;t ingest in any event.</p>
<p>The second to last ingredient is &#8220;calcium carbonate&#8221;. This one just about anyone should recognize and thus doesn&#8217;t need much explanation. It&#8217;s a common ingredient in many cleaning products it seems, especially &#8220;green&#8221; ones, so it&#8217;s presence comes as no surprise.</p>
<p>The final ingredient is &#8220;sodium carbonate&#8221;. This is better known to many as &#8220;Washing Soda&#8221;. It&#8217;s a water softener sold in most grocery stores which prevents calcium and magnesium ions from bonding to the detergent. It&#8217;s effective at removing oil, grease, and alcohol stains. Again, it&#8217;s presence comes as no surprise.</p>
<p>So, basically what we have here is moderately large plastic balls which contain a very mild detergent. It&#8217;s thus no surprise that they do a little better than doing laundry with just plain water alone. The large size of the balls would work well at mashing the clothes, sorta akin to a washing board, and the combination of the mild detergent should prove to be effective. It might not brighten your whites as much as the store bought detergent, but otherwise should clean just as well based on what I can gather without actually using the product. Also, since it doesn&#8217;t contain the fragrances which most have gotten used to in laundry detergents, the clothes won&#8217;t have that &#8220;fresh clean&#8221; smell. At about $70 US + shipping, not sure I am going to try them, but I wanted to post this so others doing research on the topic could form a more educated opinion.<br />
 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-05-11-ecoballs-are-they-for-real.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>JetBlue&#8217;s Twitter reply to me shows up in a video interview w/ Twitter founders</title>
		<link>http://www.jeremyjohnstone.com/blog/2008-04-19-jetblues-twitter-reply-to-me-shows-up-in-a-video-interview-w-twitter-founders.html</link>
		<comments>http://www.jeremyjohnstone.com/blog/2008-04-19-jetblues-twitter-reply-to-me-shows-up-in-a-video-interview-w-twitter-founders.html#comments</comments>
		<pubDate>Sat, 19 Apr 2008 23:06:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[betablue]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[jetblue]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[project aero]]></category>
		<category><![CDATA[Tweets]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Yahoo]]></category>
		<category><![CDATA[Yahoo! Messenger]]></category>

		<guid isPermaLink="false">http://www.jeremyjohnstone.com/blog/?p=377</guid>
		<description><![CDATA[Like certain friends of mine, I love seeing my name online on the web, when used in a positive way of course, and love hearing my name mentioned in conversation when people think I am not listening. Because of this, it&#8217;s no surprise when a good friend of mine sent me the following IM this morning, [...]]]></description>
			<content:encoded><![CDATA[<p>Like <a href="http://terrychay.com/blog/article/i-just-like-hearing-my-name.shtml">certain friends of mine</a>, I love seeing my name online on the web, when used in a positive way of course, and love hearing my name mentioned in conversation when people think I am not listening. Because of this, it&#8217;s no surprise when a <a title="Jeff Standen's Website" href="http://www.jeffstanden.com/" target="_blank">good friend of mine</a> sent me the following IM this morning, it brought a bit of a smile to my face:</p>
<p><center><a title="iChat log with a friend earlier today by Jeremy Johnstone, on Flickr" href="http://www.flickr.com/photos/jeremyjohnstone/2425575353/"><img src="http://farm3.static.flickr.com/2161/2425575353_10bfeb5342_o.jpg" alt="iChat log with a friend earlier today" width="523" height="177" /></a></center> </p>
<p>Of course I quickly had to go and watch the video and lo and behold I find he&#8217;s right! The Twitter @reply that JetBlue sent me a while back is fairly prominently visible as shown in this video:</p>
<p> </p>
<p><center><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="350" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/v3yFKx3-AVc" /><embed type="application/x-shockwave-flash" width="425" height="350" src="http://www.youtube.com/v/v3yFKx3-AVc"></embed></object></center> </p>
<p>For reference, here is the twitter thread:</p>
<p><center><a title="Tweet #1 by Jeremy Johnstone, on Flickr" href="http://www.flickr.com/photos/jeremyjohnstone/2425620335/"><img src="http://farm3.static.flickr.com/2044/2425620335_02136ee3df.jpg" alt="Tweet #1" width="500" height="178" /></a> </p>
<p><a title="Tweet #2 by Jeremy Johnstone, on Flickr" href="http://www.flickr.com/photos/jeremyjohnstone/2426434064/"><img src="http://farm4.static.flickr.com/3051/2426434064_06214c9373.jpg" alt="Tweet #2" width="500" height="137" /></a></p>
<p><a title="Tweet #3 by Jeremy Johnstone, on Flickr" href="http://www.flickr.com/photos/jeremyjohnstone/2425620557/"><img src="http://farm3.static.flickr.com/2249/2425620557_f71c91131d.jpg" alt="Tweet #3" width="500" height="210" /></a></center></p>
<p> </p>
<p>Here&#8217;s a couple helpful links for more information in case you are curious:</p>
<p><a href="http://www.ymessengerblog.com/blog/2007/12/11/im-from-the-sky-on-jetblue/">So what is BetaBlue and what does Yahoo! have to do with it?</a></p>
<p><a href="http://www.flickr.com/photos/jeremyjohnstone/sets/72157603439427199/">Photos that the guy from JetBlue was talking about.</a></p>
<p><a href="http://webmessenger.yahoo.com/flightstatus/">Part of the project which is visible from the ground (since most is visible only from the plane) that I developed.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeremyjohnstone.com/blog/2008-04-19-jetblues-twitter-reply-to-me-shows-up-in-a-video-interview-w-twitter-founders.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
