<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>unitstep.net</title>
	
	<link>http://unitstep.net</link>
	<description>the home of peter chng</description>
	<lastBuildDate>Sat, 29 May 2010 14:31:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/unitstep" /><feedburner:info uri="unitstep" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Completed the Mississauga Marathon!</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/AHDtVxK69xo/</link>
		<comments>http://unitstep.net/blog/2010/05/29/completed-the-mississauga-marathon/#comments</comments>
		<pubDate>Sat, 29 May 2010 14:30:13 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[exercise]]></category>
		<category><![CDATA[marathon]]></category>
		<category><![CDATA[running]]></category>
		<category><![CDATA[marathon running races exercise training]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1179</guid>
		<description><![CDATA[On May 16th, I ran in the 7th annual Mississauga Marathon. This was my fourth marathon, and I&#8217;d decided to run it sometime back in March, after being unhappy with my result in the Toronto Good Life Marathon in October of last year. (Which I had run only two months after the Edmonton Marathon) Though [...]]]></description>
			<content:encoded><![CDATA[<p class="image align-right"><a href="http://unitstep.net/wordpress/wp-content/uploads/2010/05/mississauga-marathon.jpg"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/05/mississauga-marathon-150x150.jpg" alt="" title="mississauga-marathon" width="150" height="150" class="alignnone size-thumbnail wp-image-1188" /></a></p>
<p>On May 16th, I ran in the 7th annual <a href="http://www.mississaugamarathon.com/default.shtml">Mississauga Marathon</a>.  This was my fourth marathon, and I&#8217;d decided to run it sometime back in March, after being unhappy with my result in the <a href="http://www.torontomarathon.com/">Toronto Good Life Marathon</a> in October of last year. (Which I had run only two months after the <a href="http://www.canadianderbymarathon.ca/">Edmonton Marathon</a>)</p>
<p>Though I had qualified for Boston during the Edmonton Marathon with a time of 3:02:50, I decided not to register for Boston after my poor performance in the Toronto Good Life race.  I wasn&#8217;t sure I&#8217;d be ready again for another marathon in mid-April, and the timing with my schedule wasn&#8217;t ideal either.  </p>
<p>However, by the start of February I was feeling better and started getting back into training mode.  I had a May marathon in mind, which would give me a solid three months of training &#8211; more than enough considering the base level of training I&#8217;d maintained over the winter.  However, I didn&#8217;t want to push myself and commit to something I couldn&#8217;t do &#8211; so I did not register until the end of March, when my condition was more certain.</p>
<p>And so when May 16th came, I was feeling pretty confident.  I&#8217;d run the <a href="http://www.canadarunningseries.com/sportinglife/">Sporting Life 10K</a> two weeks before, finishing in 39:38, within my target time of a sub-40 minute run.  I had a target time for this marathon of anything under 3:20, not enough to qualify for Boston since I didn&#8217;t want to push myself, since this was partly the result of why I&#8217;d done poorly at the Good Life Marathon last year.</p>
<p>The first three-quarters of the race went well, and I was able to maintain a fairly even pace, passing the halfway point at 1:33:55. While things went smoothly for the first 30 km, at about the 35 km mark I started feeling some slight leg cramps and had to slow things down.  I lost quite a bit of time in the last 7 km, and managed to finish in 3:13:06, less than three minutes away from qualifying for Boston again.</p>
<p>While I was disappointed at coming so close to a qualifying time, overall I was happy with the result, having met my original target and improved substantially from my previous marathon.  Despite this being my fourth marathon, I still feel that I&#8217;m very much a beginner at this, as I need to work on my overall race strategy, pacing and training if I want get more consistent results.  I&#8217;ve thought about doing another marathon in the fall, perhaps the <a href="http://www.torontowaterfrontmarathon.com/">Toronto Waterfront Marathon</a> (thus completing the GTA marathon three-pack), but I don&#8217;t want to push myself.  I&#8217;ll see how the summer plays out.</p>
<h2>Review of the Mississauga Marathon</h2>
<p>While the above is more of a personal anecdote, I&#8217;d like to point out some of the pros and cons of this race in case you&#8217;re interested in it.  I decided to run this race because of its close location to me.  The other obvious choice for a May marathon would&#8217;ve been the <a href="http://www.runottawa.ca/">Ottawa Marathon</a>, but I didn&#8217;t want to deal with the extra headaches of travel and staying overnight.  Driving to the race took me only about 40-45 minutes, and would&#8217;ve been faster if the Gardiner Expressway wasn&#8217;t <a href="http://www.cbc.ca/canada/toronto/story/2010/05/15/tor-gardiner-closed.html">closed that weekend</a> for repairs. (What timing!)</p>
<p>The course itself was a point-to-point race, with a net elevation loss of 80 m from start to finish, resulting in a gentle slope along the way.  I&#8217;d say most of that drop came in the first half, with the last part mostly flat.  There&#8217;s a few rolling hills along the way, but nothing steep and unexpected.  Overall, the elevation profile was quite forgiving.  In my experience, large elevation gains <strong>or drops</strong> aren&#8217;t ideal for marathons; running downhill for long periods of time will kill your quads, and running uphill is hard for obvious reasons.  My ideal course would be flat &#8211; but the gentle downhill route of the Mississauga Marathon was still quite runnable.</p>
<p>The course starts at the Square One shopping mall, which ought to mean a lot of parking &#8211; after all, suburbs are the land of the automobile &#8211; but unfortunately only certain sections were available since the mall was open for business that day.  Considering that around 7,000 people were running the marathon or half-marathon that day, that adds up to a lot of cars since that was the only real way to get to the race.  As expected, parking was a nightmare &#8211; I got there about 30 minutes before the race start at 7:30 AM, and that was just enough time to find a parking spot and get ready for the run.  My advice is to arrive early &#8211; earlier than you think necessary &#8211; to avoid rushing.</p>
<p>I had to park some distance away, probably around 500 m, but this wasn&#8217;t a problem &#8211; I used the travel distance as a warm-up for the race.  However, by then the lineups for the porta-potties were too long and I didn&#8217;t get a chance to go before the race start.  This wasn&#8217;t really a problem for me either as I just went at the first opportunity at around the 4 km mark.</p>
<p>The course scenery was pretty relaxing and the atmosphere nice.  Spectators were out in full force even in the first half, adding a nice touch to the calm suburban setting of the race.  The nice thing about the suburban course is that the roads were generally in better shape than the road races I&#8217;ve run in cities.  However, there were some drawbacks.</p>
<h3>Potential drawbacks</h3>
<p>Firstly, some parts of the course were on single-lane roads, with only one side available for runners and the other open to traffic.  Only a sparse line of pylons marked this, and some confused drivers didn&#8217;t seem to understand their meaning.  Traffic control along these stretches could have been better.  This isn&#8217;t to say that police and volunteers didn&#8217;t do a good job &#8211; I just think there could have been more of them along these sections.</p>
<p>Secondly, some of the sections went along the trails at the waterfront.  While these gave a nice few of the downtown Toronto skyline, (made better by the sunny and clear weather that day), the trails limited the width available for runners and really required people to obey proper etiquette.  This didn&#8217;t really bother me, but it&#8217;s something to be aware of.</p>
<p>Lastly, since it&#8217;s a point-to-point course, the marathon organizers had to recruit some public transit buses to get people back to the start from the finish.  With over 7,000 participants, you can immediately see the problems with this.  The wait times were quite long and made worse by the understandably bad traffic in getting back to the start.  Being cramped into a bus full of sweaty runners (myself included in that group) could not have been nice either.  Make sure you have water or are hydrated before lining up to get on the bus, as it took about 45mins-1hr to get back.</p>
<h3>Timing</h3>
<p>The weather was great that day, with a starting temperature of about 9C, rising to 16-17C by the time I finished.  It was sunny, fairly clear and the wind was not bad.  I couldn&#8217;t have asked for better conditions, considering that the weather in May had been a rollercoaster ride &#8211; two weeks ago during the Sporting Life 10K, the temperature had been near 20C with high humidity, while the week before the marathon the temperature hovered just above freezing and I had to wear winter running gear for my last long run!</p>
<p>Considering that the following week temperatures pushed into record highs, I think we were quite lucky with the weather timing of the Mississauga Marathon.  </p>
<p>In general, this is a problem with spring marathon, in that the weather can be unpredictable.  If it&#8217;s hot, things are made worse by the fact that you&#8217;ve done most your training during the colder preceding months, limiting your exposure and tolerance for hot weather running.</p>
<p>Overall, I was pleased with the Mississauga Marathon.  The aid stations were well-organized, and the crowd support was great, with one nice lady even setting up her own lemonade aid station outside her house! I&#8217;d very much consider doing this again and think it makes a great choice for a first marathon or half-marathon.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=AHDtVxK69xo:ojsn9lnmBlw:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=AHDtVxK69xo:ojsn9lnmBlw:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=AHDtVxK69xo:ojsn9lnmBlw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=AHDtVxK69xo:ojsn9lnmBlw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=AHDtVxK69xo:ojsn9lnmBlw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=AHDtVxK69xo:ojsn9lnmBlw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=AHDtVxK69xo:ojsn9lnmBlw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=AHDtVxK69xo:ojsn9lnmBlw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/AHDtVxK69xo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2010/05/29/completed-the-mississauga-marathon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2010/05/29/completed-the-mississauga-marathon/</feedburner:origLink></item>
		<item>
		<title>Opera Mini approved by Apple for the App Store</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/JwoQj0e2fZM/</link>
		<comments>http://unitstep.net/blog/2010/04/24/opera-mini-approved-by-apple-for-the-app-store/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 13:36:52 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[opera browsers iphone mobile appstore apple]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1122</guid>
		<description><![CDATA[On the heels of a controversial update to the iPhone SDK&#8217;s license agreement, Apple has unexpectedly approved Opera Mini for iPhone for distribution in its App Store. Opera had previously announced that it had submitted its browser to the App Store for approval back on March 23rd, in an effort to drum up support for [...]]]></description>
			<content:encoded><![CDATA[<p>On the heels of a <a href="http://arstechnica.com/apple/news/2010/04/apple-takes-aim-at-adobe-or-android.ars">controversial update</a> to the iPhone SDK&#8217;s license agreement, Apple has unexpectedly <a href="http://www.engadget.com/2010/04/12/opera-mini-for-iphone-approved-will-be-available-for-free/">approved Opera Mini for iPhone</a> for distribution in its App Store.</p>
<p>Opera had previously <a href="http://www.opera.com/press/releases/2010/03/23_3/">announced</a> that it had submitted its browser to the App Store for approval back on March 23rd, in an effort to drum up support for its inclusion in the App Store.  Back then, many suspected it would likely be rejected on the basis of it <a href="http://mashable.com/2010/03/23/opera-mini-app-store/">duplicating built-in functionality</a> on the iPhone, namely the included Safari web browser. (Though some <a href="http://reverttosaved.com/2010/03/23/opera-submits-opera-mini-to-app-store-mashable-fires-up-bullshit-machine/">questioned this analysis</a>)</p>
<p>Whatever the reason, this comes as a surprise to many, especially given <a href="http://www.taoeffect.com/blog/2010/04/steve-jobs-response-on-section-3-3-1/">Apple&#8217;s most recent behaviour</a> towards potential competitors and development on the iPhone in general.  Nonetheless, let&#8217;s give <a href="http://itunes.apple.com/app/opera-mini-web-browser/id363729560?mt=8">Opera Mini for iPhone</a> a quick test drive!</p>
<h2>The Opera Mini advantage</h2>
<p>To begin, it&#8217;s worthwhile to understand that Opera Mini is not a regular web browser, in that it does not make direct connections to websites to retrieve their content, unlike Safari on the iPhone or any other desktop web browser.  Instead, all requests are handed through a proxy server that Opera controls.  This proxy server retrieves the remote web page, reformats the content for better display on a mobile screen and finally compressed for delivery to the end device.  The format used is Opera&#8217;s own, called OBML, and furthermore the pages need not be delivered to your device over <acronym class="uttInitialism" title="HyperText Transfer Protocol">HTTP</acronym>. (More information on this Opera Mini infrastructure is <a href="http://en.wikipedia.org/wiki/Opera_mini">available here</a>.)</p>
<p>Ostensibly, all of this work is done to improve the mobile browsing experience in at least two ways.  Firstly, the size of each webpage is reduced, thus speeding load times.  Secondly, the content is reformatted by Opera&#8217;s servers to allow for mobiles to better display content that was only designed with computer monitors in mind.</p>
<p>These features certainly made sense for a phone like the <a href="http://unitstep.net/blog/2007/11/14/going-mobile/">Samsung M510</a>, my first mobile.  But what about the <a href="http://unitstep.net/blog/2009/09/28/joining-the-iphone-cult/">iPhone 3GS</a> and its larger, <a href="http://www.displaymate.com/iPhone_3GS_ShootOut.htm">high-quality screen</a> and faster HSDPA access speeds? In this case, are these optimizations even needed or helpful?</p>
<h2>The iPhone Experience</h2>
<p>The Opera Mini browser has the same general UI layout as Mobile Safari, which is unsurprisingly given the smaller real-estate of mobile screens &#8211; there are only so many UI configurations for a web browser on such a space and even fewer potential effective ones.  There&#8217;s the address bar up top, with a web search field in the upper right corner.  The list of search engines is also configurable.  Standard browser buttons such as back/forward, reload and tabs are at the bottom of the screen.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-01.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p>When opening Opera Mini the previous state of the app is restored, so the current page you&#8217;re on as well as any open tabs you had when you closed the browser remain.  This was pretty much expected &#8211; anything less would be a huge mark against the app.  Opera Mini has a unique tab switcher, one that&#8217;s arguably better than Safari&#8217;s.  When activated, it allows you see to quite a few more tabs than Safari, which just shows you the previous and next.  Switching between them is pretty easy, as is opening a new tab.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-05.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p>When opening a new tab, the default page is Opera&#8217;s &#8220;Speed Dial&#8221; feature, something a heck of a lot more useful than the blank tab Safari gives you.  It&#8217;s easy to configure what pages show up here.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-04.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<h2>Reading webpages with Opera Mini</h2>
<p>The standard tasks of scrolling and zooming were okay, though there are some differences from Safari.  In particular, it didn&#8217;t appear possible to click a link based on &#8220;small&#8221; text without zooming into the appropriate section; zooming is also accomplished with a single-tap, not a double-tap.  I suspect the two changes go hand-in-hand.  This is actually a decrease in functionality from Safari &#8211; Safari had some pretty good detection for helping you click smaller links with fat fingers without having to resort to zooming in on the area.  Opera now forces the issue.</p>
<p>Opera also implements double-tap to zoom out.  But it&#8217;s a bit more sensitive as to exactly what constitutes a &#8220;double-tap&#8221;.  In Safari, you don&#8217;t have to double-tap exactly in the same spot in order to trigger the zoom out action.  Opera Mini seems to be a bit more sensitive to exactly where you double-tap before it zooms out.  This impairs usability somewhat.</p>
<p>Selecting text was straightforward; simply tap and hold a section and you can select text using a resizable box.  The text can then be copied or used to search.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-03.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<h2>Other features</h2>
<p>Because Opera Mini was going through a proxy server and dynamically reformatting the content before passing it to your device, I had some worries that websites would not properly detect the user-agent of the iPhone and thus would not redirect to iPhone-specific sites.  But during my testing, thankfully this was not the case.  Most redirected properly to their mobile versions, if available.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-07.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p>Opera Mini also two other features of note: Full screen and Mobile view.  Full screen (see below for The Globe and Mail&#8217;s website) simply removes the bottom bar and gives you only the minimum amount of browser UI you&#8217;d need, saving you a little more space for the actual website. </p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-08.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-06.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p>Mobile view, which is far less useful, causes Opera Mini to reformat the <strong>entire</strong> website to &#8220;fit&#8221; the layout of the screen, rather than just text.  I use quotes with the term &#8220;fit&#8221;, because the reformatting of Mobile view is in general, quite awful and results in a mangled look.  Perhaps it made sense to do this kind of reformatting on the extremely small screens of older mobiles, but it simply makes no sense on the iPhone.  You can see the results of this by comparing the CBC News website in normal versus mobile rending mode below.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-09.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-10.png" alt="" width="320" height="480" class="alignnone size-full wp-image-1151" /></p>
<h2>Comparison with Safari</h2>
<p>The real question, however, is how does Opera Mini compare with Mobile Safari? After all, this is its main and perhaps only competition it faces on the iPhone, and furthermore Safari is entrenched with most users simply because of its strong tie-in with the iPhone platform.  If Opera Mini hopes to win any market share, it can&#8217;t just be as good as Safari &#8211; it has to be a lot better so people will switch.</p>
<p>Unfortunately, this isn&#8217;t the case.  In my opinion, Opera Mini is actually behind Mobile Safari in many areas.  Furthermore, the main benefits of Opera Mini actually don&#8217;t matter that much on the iPhone.</p>
<p>Opera Mini uses its proxy server setup in order to speed access by compressing pages before they&#8217;re sent to your device.  During testing, this benefit was minimal over 3G or Wi-Fi networks and in fact Opera Mini may have been slower in some cases due to the delay induced by having to wait for page compression on Opera&#8217;s servers.  To be fair, Opera focuses on the comparative speed advantage on 2G/EDGE data networks, so if you&#8217;re in that situation it may have some real benefit.</p>
<p>But even considering this, the entire model that Opera Mini uses completely breaks end-to-end security, so accessing HTTPS sites no longer guarantees confidentiality unless you completely trust Opera and trust that Opera&#8217;s servers won&#8217;t be compromised.  </p>
<p>But these might be implementation details &#8211; what do they matter? Unfortunately, the end user experience also suffers in the way text is rendered and formatted by Opera Mini.  See the comparison of Engadget&#8217;s site below in Opera Mini and Mobile Safari:</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-a.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/safari-a.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p>At the fully-zoomed out level, all text is basically unreadable in Opera Mini, while in Safari this is not the case.  Some images also looked aliased, owing to Opera&#8217;s compression of the page.</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-b.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/safari-b.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p>Even zooming in, we can see some differences.  Firstly, Opera Mini seemingly switches the rendering of the website-specified font to a sans-serif one, while Safari maintains the actual font for the text.  Safari also keep the original layout, allowing the text to flow around the image and still be readable.  Opera Mini seems to just reformat the text to fit the width of the screen without regard for maintaining the overall layout of the site.  In this respect, Safari better preserves the original look and feel.</p>
<p>But perhaps the biggest hit against Opera Mini is its lack of fully supporting JavaScript.  This is again due to the proxy model it is using.  Because of this, the functionality of web applications is severely impaired or even blocked.  Meanwhile, Safari is a fully-featured browser supporting Ajax techniques and even subsets of HTML5.  These differences are most apparent when looking at how Gmail renders in each browser:</p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/opera-c.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p class="image"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/04/safari-c.png" alt="" title="" width="320" height="480" class="alignnone size-full wp-image-1161" /></p>
<p>Opera Mini cause Gmail to step down to a primitive version, something you&#8217;d expect to see on older mobiles.  Safari, however, has access to an iPhone-optimized version of the web application, which Google has been <a href="http://gmailblog.blogspot.com/2008/01/new-gmail-for-iphone.html">available for some time</a>, is being <a href="http://gmailblog.blogspot.com/2009/10/whats-new-with-gmail-on-iphone-and.html">constantly improved</a> and arguably better than the built-in Mail app.</p>
<p>The fact that Safari works so well for the web should be no surprise, since Apple&#8217;s <a href="http://arstechnica.com/apple/news/2007/10/source-iphone-sdk-will-remain-web-based-for-the-foreseeable-future.ars">original plan</a> was for their WebKit browser to be the only &#8220;SDK&#8221; for the iPhone.  That is, web applications would be the way developers would make apps for the iPhone &#8211; no App Store involved.  With this in mind, Apple engineers put a lot of work in to Safari to make sure it would not only be a good web browser, but one that would be able to run the future of web applications, and look good doing so.</p>
<p>Because of this, Opera Mini had a formidable opponent to go up against.  The fact that it couldn&#8217;t beat it is not a reflection of Opera&#8217;s ability, but more a reflection of the time Apple spent on Mobile Safari.</p>
<h2>Conclusion</h2>
<p>I may have seemed a bit harsh and some of the criticism of Opera Mini may have been unwarranted.  After all, it&#8217;s a <em>free</em> download, so can you really complain? I just don&#8217;t think I&#8217;ll be using it to replace Safari any time soon and that its <a href="http://www.engadget.com/2010/04/14/opera-mini-now-the-number-one-free-download-in-all-22-app-stores/">current popularity</a> is simply a result of the drama played out in the App Store and exaggerated by blogs.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=JwoQj0e2fZM:kHWP6Nfr-gY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=JwoQj0e2fZM:kHWP6Nfr-gY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=JwoQj0e2fZM:kHWP6Nfr-gY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=JwoQj0e2fZM:kHWP6Nfr-gY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=JwoQj0e2fZM:kHWP6Nfr-gY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=JwoQj0e2fZM:kHWP6Nfr-gY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=JwoQj0e2fZM:kHWP6Nfr-gY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=JwoQj0e2fZM:kHWP6Nfr-gY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/JwoQj0e2fZM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2010/04/24/opera-mini-approved-by-apple-for-the-app-store/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2010/04/24/opera-mini-approved-by-apple-for-the-app-store/</feedburner:origLink></item>
		<item>
		<title>Triggering links from JavaScript using jQuery</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/erXpfRYAw38/</link>
		<comments>http://unitstep.net/blog/2010/04/12/triggering-links-from-javascript-using-jquery/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 00:56:48 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[jquery javascript tutorials]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1107</guid>
		<description><![CDATA[Sometimes, you may want to trigger a link (that is, an anchor element) directly from JavaScript. That is, you may want to simulate the user clicking on the link programmatically. If you&#8217;re using jQuery, you&#8217;ll no doubt be aware of the click() method which can be used to trigger that event on an object. One [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, you may want to trigger a link (that is, an <a href="http://htmlhelp.com/reference/html40/special/a.html">anchor element</a>) directly from JavaScript.  That is, you may want to simulate the user clicking on the link programmatically.</p>
<p>If you&#8217;re using jQuery, you&#8217;ll no doubt be aware of the <a href="http://api.jquery.com/click/"><code>click()</code></a> method which can be used to trigger that event on an object.  One would think that executing <code>click()</code> on an anchor element would cause the browser to navigate to the <acronym class="uttInitialism" title="Uniform Resource Locator">URL</acronym>, but this isn&#8217;t the case.  <strong>You cannot use jQuery&#8217;s <code>click()</code> method to fully trigger or simulate a user clicking on a link.</strong></p>
<p>Instead, <code>click()</code>, when executed on links, only seems to trigger any event handlers attached to the DOM element rather than any default behaviour.  I&#8217;m not sure if this is the case with other event methods or other DOM elements.</p>
<h2>The solution</h2>
<p>Instead, the solution is to directly manipulate the <code>window.location</code> object from JavaScript.  One would think that since preventing the default action is quite simple (with jQuery&#8217;s <a href="http://api.jquery.com/event.preventDefault/"><code>event.preventDefault()</code></a>), triggering the default action of a link click would also be.  But this isn&#8217;t the case.  Here&#8217;s a simple example on how to simulate a user clicking on a link.</p>
<p>In this contrived example, we have an ordered list of links that we&#8217;ve prevented the default action from executing on each.  Instead, to activate a link we&#8217;ve provided an input box for the user to input the link number and then hit &#8216;Go&#8217;.  When this happens, we grab the identified link and assign the <code>href</code> attribute value of the link to <code>window.location</code>, effectively recreating the default action of clicking the link.</p>
<p><acronym class="uttInitialism" title="HyperText Markup Language">HTML</acronym> Source:</p>
<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD <a href="http://www.w3.org/MarkUp/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible HyperText Markup Language - HTML reformulated as XML">XHTML</acronym></a> 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;

  &lt;title&gt;jQuery Demos&lt;/title&gt;
  &lt;link rel="stylesheet" href="styles.css" media="all" /&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;h1&gt;jQuery Demos&lt;/h1&gt;

&lt;ol id="outboundLinks"&gt;
  &lt;li&gt;&lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.theglobeandmail.com/"&gt;The Globe and Mail&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
Link Number to activate:
&lt;input id="linkNumber" type="text" size="3" /&gt;
&lt;input id="activateLink" type="button" value="Go" /&gt;
&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</code></pre>
<p>JavaScript in <code>scripts.js</code>:</p>
<pre><code>jQuery(function(e)
{
  jQuery("#outboundLinks").click(function(e)
  {
    e.preventDefault();
  });

  jQuery("#activateLink").click(function(e)
  {
    var links = jQuery("#outboundLinks li a");
    var value = parseInt(jQuery("#linkNumber").val());

    if (!isValidNumber(value, links))
    {
      window.alert("Invalid link number.");
      return;
    }
    else
    {
      // This won't work.  We cannot trigger the default
      // behaviour of clicking on a link this way.
      // links.eq(value - 1).click();

      // Instead, manipulate window.location directly.
      window.location = links.eq(value - 1).attr("href");
    }
  });
});

function isValidNumber(value, links)
{
    if (isNaN(value))
    {
      return false;
    }
    else if (value &lt;= 0 || value &gt; links.size())
    {
      return false;
    }
    else {
      return true;
    }
}</code></pre>
<p>Note that <a href="https://developer.mozilla.org/En/DOM/Window.location"><code>window.location</code> is not a regular property</a>; it&#8217;s a special object that when assigned to, changes the <acronym class="uttInitialism" title="Uniform Resource Locator">URL</acronym> in the address bar of the browser.  There&#8217;s some debate over whether to directly <a href="https://developer.mozilla.org/Talk:en/DOM/window.location">use the location object or to use the <code>window.location.href</code> property</a>.</p>
<p>This accomplishes the task of triggering the default action of clicking on a link, albeit in a roundabout fashion.  Note that this example will only work for regular links that use <code>href</code> attributes as the source of the new <acronym class="uttInitialism" title="Uniform Resource Locator">URL</acronym>.  If you have links doing more complicated things via the use of event handlers (i.e. Ajax), then you&#8217;re better off using <a href="http://api.jquery.com/click/"><code>click()</code></a> or directly invoking the JavaScript methods involved.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=erXpfRYAw38:YgTUMy4ro_o:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=erXpfRYAw38:YgTUMy4ro_o:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=erXpfRYAw38:YgTUMy4ro_o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=erXpfRYAw38:YgTUMy4ro_o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=erXpfRYAw38:YgTUMy4ro_o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=erXpfRYAw38:YgTUMy4ro_o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=erXpfRYAw38:YgTUMy4ro_o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=erXpfRYAw38:YgTUMy4ro_o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/erXpfRYAw38" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2010/04/12/triggering-links-from-javascript-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2010/04/12/triggering-links-from-javascript-using-jquery/</feedburner:origLink></item>
		<item>
		<title>Awesome Note for the iPhone is awesome!</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/ExzCl9PQlLY/</link>
		<comments>http://unitstep.net/blog/2010/02/28/awesome-note-for-the-iphone-is-awesome/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 02:28:39 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[asides]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[iphone apps awesome-note]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1081</guid>
		<description><![CDATA[I&#8217;m a bit of an information pack rat. When I have an idea or something I need to keep track of, I have an immediate need to write it down or record it. In the past this has resulted in an assortment of post-it notes, notebooks or even loose papers lying around my desk, all [...]]]></description>
			<content:encoded><![CDATA[<p class="image align-right"><a href="http://bridworks.com/"><img src="http://unitstep.net/wordpress/wp-content/uploads/2010/02/awesome-note.jpg" alt="" title="awesome-note" width="175" height="175" class="alignnone size-full wp-image-1095" /></a></p>
<p>I&#8217;m a bit of an information pack rat.  When I have an idea or something I need to keep track of, I have an immediate need to write it down or record it.  In the past this has resulted in an assortment of post-it notes, notebooks or even loose papers lying around my desk, all used to document my thoughts.  Eventually, I tried to move my note-taking over to the PC in an attempt to make it easier to manage, but over time the notes became spread over a variety of formats and storage mediums, from text files on my local PC to online services such as <a href="https://www.google.com/calendar">Google Calendar</a> and <a href="https://www.dropbox.com/">Dropbox</a>.</p>
<p>This sort of digital storage Balkanization was becoming a nightmare to manage and effectively neutralizing any benefit from taking notes, since finding and keeping track of what I&#8217;d written down was becoming a chore by itself.  Clearly, a unified solution was needed.  Ever since I got my iPhone last year, I&#8217;d been looking for an app or service that would allow me to easily keep track of todo and shopping lists (what most of my notes amounted to), while storing the the data online so that it could be synced or updated from my PC as well.</p>
<p>I think I&#8217;ve finally found that with <a href="http://bridworks.com/">Awesome Note</a>.</p>
<h2>What I was looking for</h2>
<p>As mentioned, I love keeping lists.  So what I needed was an app that could allow me to easily keep track of lists as well as allow me to backup or sync the underlying data in such a way that I could also work with the lists on my PC or online.  The built-in Notes app didn&#8217;t meet my needs because you could only sync it with certain supported software, such as Outlook, which I didn&#8217;t use or care to use at home.</p>
<p>Browsing through the App Store was almost an exercise in futility.  Trying to find a decent note-taking app (or any app, for that matter) is a time-consuming activity; I didn&#8217;t want to shell out any money without being able to first try the app out, so many apps were immediately ruled out.  </p>
<p>The first one I tried was one aptly named <a href="http://www.mobilityware.com/iApps/Lists.htm">Lists</a>.  While it was functional and had support for lists and lists-within-lists, it was buggy and the UI left a lot to be desired.  The next one I tried was <a href="http://www.evernote.com/">Evernote&#8217;s</a> app; while Evernote is a nice service, the iPhone app left a lot to be desired.  While the web application or the PC software allowed you to take all sorts of notes, only basic editing functionality was available on the app, and it was suited for a more general note-taking approach rather than one for lists and the like.</p>
<p>I stumbled upon the free version of Awesome Note soon after, which thankfully was fully-featured but limited you to only a few notes.  Nonetheless, I was immediately impressed.</p>
<h2>Just felt right</h2>
<p>Right off the bat, I was impressed by how easy it was to create a list and add items.  When creating an item, you can use the &#8220;quick-add&#8221; functionality that allows you to nicely add a new item while staying on the same screen; if necessary you can later add a longer description on a separate screen.  Furthermore, it&#8217;s easy to sort items by date, name or priority; more importantly, there&#8217;s a robust search function as well.  Swipe-to-delete functionality is also nicely handled.</p>
<p>You can create multiple folders, each to store separate items, for example, a shopping list and a todo list.  Each folder has its own view options, either thumbnail, lists or todo view, store separately so you can sort through different lists in different ways, each remembered by the app.  Furthermore, it&#8217;s easy to convert an item to a todo item; you simply tap a box next to an item to change its state from done/not done and there&#8217;s no need to navigate complicated setup screens to change this.</p>
<p>There&#8217;s also a &#8220;Quick Memo&#8221; feature, which gives you a notepad to quickly jot down ideas that you can later convert into a fully-fledged note or item.  It basically replicates the functionality of the built-in Notes app, all while providing some other nice features such as adjustable fonts, just like the rest of the app.</p>
<p>Furthermore, the UI was very polished; each folder can be identified by colour and an icon of your choosing.  A nice assortment of these icons/backgrounds is provided, all of them looking great.  In short, everything looks very well refined and well thought out, making list and note management very easy.</p>
<p>But most importantly, the sync worked great out of the box.  I tied it to my Evernote account, and as a result I now have the unified access to my notes that I so badly wanted.  I&#8217;d previously used Dropbox or even my own SVN server to get some semblance of cloud-based storage and access to my notes, but but neither was sufficient to properly work with my iPhone.  Awesome Note now provides that functionality, with a great UI/front-end making list/note management a breeze.</p>
<p>I strongly recommend <a href="http://bridworks.com/">giving it a try</a> if you find yourself using your iPhone/iPod Touch to take notes.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=ExzCl9PQlLY:qBwV0c60bSE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=ExzCl9PQlLY:qBwV0c60bSE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=ExzCl9PQlLY:qBwV0c60bSE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=ExzCl9PQlLY:qBwV0c60bSE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=ExzCl9PQlLY:qBwV0c60bSE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=ExzCl9PQlLY:qBwV0c60bSE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=ExzCl9PQlLY:qBwV0c60bSE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=ExzCl9PQlLY:qBwV0c60bSE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/ExzCl9PQlLY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2010/02/28/awesome-note-for-the-iphone-is-awesome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2010/02/28/awesome-note-for-the-iphone-is-awesome/</feedburner:origLink></item>
		<item>
		<title>Toronto goes open… sort of</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/OZoPKP-RO4M/</link>
		<comments>http://unitstep.net/blog/2009/11/28/toronto-goes-open-sort-of/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 18:06:00 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[geolocation]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[society]]></category>
		<category><![CDATA[toronto]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1061</guid>
		<description><![CDATA[Back on November 2nd, the City of Toronto launched their toronto.ca/open service &#8211; a project aimed to be the &#8220;official data set catalogue&#8221; of the city. Part of the OpenTO initiative to make various data that the city has collected available to developers in formats that make them easy to manipulate, toronto.ca/open is the first [...]]]></description>
			<content:encoded><![CDATA[<p class="image align-right"><a href="http://www.toronto.ca/open/index.htm"><img src="http://unitstep.net/wordpress/wp-content/uploads/2009/11/opento.jpg" alt="opento" title="opento" width="250" height="51" class="alignnone size-full wp-image-1077" /></a></p>
<p>Back on November 2nd, the City of Toronto launched their <a href="http://toronto.ca/open/">toronto.ca/open</a> service &#8211; a project aimed to be the &#8220;official data set catalogue&#8221; of the city.  Part of the OpenTO initiative to make various data that the city has collected available to developers in formats that make them easy to manipulate, <a href="http://toronto.ca/open/">toronto.ca/open</a> is the first step to making the city and its services more &#8220;open and accessible&#8221;.</p>
<p>The hope is that if the city makes this information available in a readily-usable form, developers will take the time to create various services around them, helping citizens enjoy and take advantage of what Toronto has to offer.  For example, data on garbage collection, public transit or upcoming city events could be used to create a service that would alert users through various means of communication.  But at present, the amount and types of data available are fairly limited.</p>
<p>Announced back in April at the <a href="http://www.meshconference.com/">Mesh Conference</a> in Toronto by Mayor David Miller, the openness initiative had a lot to live up to in the half-year following up to its release earlier this month at the <a href="http://rocket9broadcasting.com/Webcasts/2009/11/CoT/index.php?Page=Home">Toronto Innovation Showcase</a>.  </p>
<p>Several cities have already implemented similar projects, leaving Toronto to play catch-up.  Vancouver, for example, launched <a href="http://data.vancouver.ca/">their own Open Data initiative</a> earlier this year, and Toronto&#8217;s data catalogue appears to be modeled after it.  Edmonton, a much smaller and less dense city than Toronto, has also <a href="http://www.edmontonjournal.com/technology/Edmonton+moves+toward+open+data/2251768/story.html">recently begun an initiative</a> to open their city&#8217;s data to the public in a similar manner, <a href="http://wiki.changecamp.ca/ChangeCamp_Edmonton/The_Grid/Open_Data_in_Edmonton">with promising results</a>.</p>
<p>But the data is better late than never, so I applaud the City&#8217;s effort to democratize and help keep citizens better informed.</p>
<h2>The data itself</h2>
<p>Looking at <a href="http://www.toronto.ca/open/catalogue.htm">what&#8217;s offered</a>, you can see that most of the data sets or services have a geographical component to them.  This only makes sense, as hyperlocal information is always of great interest to most people.  </p>
<p>The data is presented in a variety of formats, but the most popular seems to be an <em>ESRI Shapefile</em>, a file format used by a <a href="http://en.wikipedia.org/wiki/Esri">popular suite of GIS software</a>.  With much of the data having a geospatial aspect to them, this makes sense as the data likely didn&#8217;t require much conversion before being released by the City. (I.E., they probably use ESRI&#8217;s application for city planning, etc.)</p>
<p>Thankfully, the format has been <a href="http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf">well-documented by its developer</a>, and <a href="http://en.wikipedia.org/wiki/Shapefile">Wikipedia as well</a>.  All of these ESRI Shapefiles are intended to be downloaded for offline use, as they are typically made available inside of a zip file.  Thus, the process of keeping them up to date may prove tedious, though I&#8217;m sure an enterprising developer could automate it nicely.</p>
<p>Other data has been made available in various <a href="http://www.w3.org/XML/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible Markup Language">XML</acronym></a> formats.  Some are intended to be accessed as online services, with a link to the <a href="http://www.w3.org/XML/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible Markup Language">XML</acronym></a> document and the corresponding XSD file, while at least one is presumably meant to be <a href="http://www.toronto.ca/open/datasets/apartment-standards/">used offline since it&#8217;s zipped up</a>.  Some of the <a href="http://www.w3.org/XML/" class="ubernym uttInitialism"><acronym class="uttInitialism" title="eXtensible Markup Language">XML</acronym></a> &#8220;Feeds&#8221; are also in a format without a defined schema and are not <acronym class="uttInitialism" title="Really Simple Syndication">RSS</acronym> or Atom feeds.  For example, the <a href="http://www.toronto.ca/open/datasets/festival-events/">feed of City-sponsored events</a> would be better served by an <acronym class="uttInitialism" title="Really Simple Syndication">RSS</acronym> or Atom feed, which would not only allow developers to integrate it into an application, but also regular users to sign up to the feed using any newsreader.</p>
<p>There are also some web services explicitly offered.  The first is a <a href="http://www.toronto.ca/open/datasets/geocoder-web-service/">geocoder service</a> that can be used to validate addresses and other place names within the City.  It is a WSDL service, and there is a full <acronym class="uttInitialism" title="Portable Document Format">PDF</acronym> file to document the input parameters and expected output.</p>
<p>The second is a series of services that provide access to &#8220;<a href="http://www.toronto.ca/open/datasets/web-map-services/">live geospatial data from the City of Toronto</a>&#8220;.  These are all <a href="http://en.wikipedia.org/wiki/Web_Map_Service">Web Map Services</a> that conform to a protocol specification developed by the <a href="http://www.opengeospatial.org/">Open Geospatial Consortium</a>.  It would have been nice if they had linked to the <a href="http://portal.opengeospatial.org/files/?artifact_id=4756">WMS Specification</a> (<acronym class="uttInitialism" title="Portable Document Format">PDF</acronym> document) that explained how to query the services, instead of forcing you to find out the information yourself. (See page 14 and onwards of the mentioned document)</p>
<p>Lastly, some of the data is offered in plain old text files. In particular, the <a href="http://www.toronto.ca/open/datasets/ttc-routes/">TTC Routes and Schedules</a> is only available as a series of zipped text files that are periodically updated, presumably manually.  This may be a bit backwards, but thankfully the formatting is <a href="http://www.toronto.ca/open/datasets/ttc-routes/metadata-routes-schedules-1.pdf">well-defined</a>.</p>
<h2>Drawbacks</h2>
<p>Though it may not be fair to criticize at this point, there are some clear limitations to the data.  Firstly, much of the data is intended to be downloaded and then used in an &#8220;offline&#8221; capacity, that is, without further communication between the application and the City&#8217;s servers that host the data.  Though this was probably done due to technical limitations (i.e. reducing bandwidth usage), it limits the ability of an application to stay up to date with the latest data.  For things like the TTC Route and Schedules and the list of <a href="http://www.toronto.ca/open/datasets/apartment-standards/">Apartment Bylaw Infractions</a>, this severely reduced their effectiveness as the data will likely need to be periodically manually updated.</p>
<p>Furthermore, the current data set is somewhat limited and may impede the usefulness of any applications or services that can be developed.  For example, making real-time TTC updates and other data available would be an immense benefit, yet the only TTC data currently available are in zipped text files that are only periodically updated.  Thankfully, the City has <a href="http://www.datato.org/app/">setup a site to allow users to request more data</a>, and there are already <a href="http://www.datato.org/app/need/show/20">many requests</a> for <a href="http://www.datato.org/app/need/show/46">more TTC data</a>. </p>
<p>It would also be nice if crime statistics for Toronto could be made available in an easy to use format.  In particular, the underlying data used by the TPS to produce <a href="http://www.torontopolice.on.ca/statistics/">their crime maps and statistics</a> could be beneficial in developing all sorts of interesting maps.  In fact, this is what the <a href="http://thestar.blogs.com/maps/neighbourhood-crime-maps/">Toronto Star has been doing for some time</a>, but they had to get the data through an explicit request under access-to-information legislation.  Since then, they&#8217;ve produced some <a href="http://www3.thestar.com/static/Flash/inmates/index.html">very interesting maps</a> and it would be beneficial if everyone had access to the same data so that the maps could be improved upon and kept up to date.</p>
<p>Producing such crime-based maps can provide people with one more factor to help them determine what part of the City they&#8217;d like to live in, or just allow them to have access to accurate statistics on crime.  Not all of this is negative &#8211; as any study of crime in Toronto will show that it&#8217;s been following a downward trend for quite some time, so such information could help ward off any potential negative spin that media may put on crime.  However, I do realize the privacy implications that come with releasing such data, so time should be taken to ensure that it is released in a manner where anonymity is preserved as best as possible.</p>
<p>Lastly, it&#8217;s important to note that the OpenTO initiative is still at a very early stage.  Even with the way things move at City Hall, things will eventually improve.  It&#8217;s also very important to give your feedback, either at <a href="http://www.datato.org/app/">DataTO</a> or directly by email to <a href="mailto:opendata@toronto.ca">opendata@toronto.ca</a>.  Additionally, if you&#8217;re a developer, the <a href="http://groups.google.com/group/datato?pli=1">corresponding Google Group</a> is a good place to get started.  Even with the current limitations, I am sure we&#8217;ll see some great applications developed based on the data.  One need <a href="http://myttc.ca/">only to look at MyTTC</a> to see what can be done with some effort and ingenuity &#8211; and this was done well <em>before</em> the City officially released any data!</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=OZoPKP-RO4M:iW5iDSsC4RA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=OZoPKP-RO4M:iW5iDSsC4RA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=OZoPKP-RO4M:iW5iDSsC4RA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=OZoPKP-RO4M:iW5iDSsC4RA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=OZoPKP-RO4M:iW5iDSsC4RA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=OZoPKP-RO4M:iW5iDSsC4RA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=OZoPKP-RO4M:iW5iDSsC4RA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=OZoPKP-RO4M:iW5iDSsC4RA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/OZoPKP-RO4M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/11/28/toronto-goes-open-sort-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/11/28/toronto-goes-open-sort-of/</feedburner:origLink></item>
		<item>
		<title>Google Street View finally comes to Canada</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/c0uMKgvUEB4/</link>
		<comments>http://unitstep.net/blog/2009/10/17/google-street-view-finally-comes-to-canada/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 17:45:43 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[canada]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[street-view]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1031</guid>
		<description><![CDATA[After much delay, possibly due to government meddling, Google Street View finally went live in select Canadian cities last week! Most of the GTA is covered, along with Kitchener/Waterloo, Ottawa, Montreal, Quebec City, Halifax, Calgary and Vancouver. This likely ensures coverage for a majority of Canada&#8217;s population, if only a very small minority of its [...]]]></description>
			<content:encoded><![CDATA[<p class="image align-right"><a href="http://unitstep.net/wordpress/wp-content/uploads/2009/10/google-street-view-canada.jpg"><img src="http://unitstep.net/wordpress/wp-content/uploads/2009/10/google-street-view-canada-150x150.jpg" alt="google-street-view-canada" title="google-street-view-canada" width="150" height="150" class="alignnone size-thumbnail wp-image-1049" /></a></p>
<p>After much delay, possibly due to government meddling, Google Street View <a href="http://www.cbc.ca/technology/story/2009/10/07/tech-internet-google-street-view-toronto.html">finally went live in select Canadian cities</a> last week! Most of the GTA is covered, along with Kitchener/Waterloo, Ottawa, Montreal, Quebec City, Halifax, Calgary and Vancouver.  This likely ensures coverage for a majority of Canada&#8217;s population, if only a very small minority of its geographical area.</p>
<p>This is a welcome move, since street view has been available for our neighbours to the south for the past two years.</p>
<p>According to some reports, Street View was <a href="http://network.nationalpost.com/np/blogs/toronto/archive/2009/04/09/toronto-s-google-street-view-goes-live-within-weeks.aspx">supposed to launch in Canada earlier this year</a>, and some of the imagery was collected as early as 2007. (Though the images around my area seem to be from early this year) Oh well, this is better late than never!</p>
<p>I&#8217;m speculating that the government&#8217;s concern with Google Street View may have slowed deployment, as in 2007 the privacy commissioner <a href="http://www.cbc.ca/canada/story/2007/09/11/streetview-commissioner-privacy.html">voiced strong concerns against the technology</a>.  I&#8217;ve never believed any of that FUD, but it seems that their concerns have been addressed with Google&#8217;s automatic detection and blurring of faces and license plates, along with new straightforwards processes to request that your image be removed from the service.</p>
<p>But it&#8217;s still been much ado about nothing, not really like the <a href="http://mashable.com/2009/07/17/canada-facebook-privacy/">conflict between the government and Facebook</a> earlier this year, which was also <a href="http://www.thestar.com/news/canada/article/682182">subsequently resolved</a>.  In the case with Facebook, privacy settings were often complicated and unclear; with Google Street view, they&#8217;re merely providing public views of public places, so I don&#8217;t see what the problem with that is.</p>
<h2>Also available on the iPhone/iPod Touch</h2>
<p>You can also use Street View on the built in Maps app for the iPhone OS, though it&#8217;s a <a href="http://googlesightseeing.com/2008/11/24/google-street-view-on-iphone/">bit convoluted</a> since there&#8217;s no &#8220;Street View&#8221; button to toggle.  Instead, you must first drop a pin (click on the &#8220;layer peel back&#8221; icon in the lower right corner) and then bring up the dialog box for that pin.  If it&#8217;s in an area with Street View present, the little guy icon on the left will be lit up and you should be able to click it to <a href="http://mashable.com/2009/10/07/google-street-view-canada/">bring up Street View</a>.</p>
<p>Street View only works in landscape mode but it&#8217;s still pretty useful for getting to know an area before you visit it for the first time.  Sometimes an actual image can convey sense better than just a map.</p>
<h2>Competition?</h2>
<p>It remains to be seen how the launch of Street View in Canada will fare for the similar service launched by Canpages in BC.  That service only covers <a href="http://communities.canada.com/vancouversun/blogs/techsense/archive/2009/10/07/google-street-view-launches-in-canada-today.aspx">Vancouver, Whistler and Squamish</a> but was launched back in March.</p>
<p>Nonetheless, it&#8217;s very neat technology, even if it was originally unveiled over two years ago.  Witness this by the fact that reporters are still drooling over it by embedding the service in <a href="http://www.theglobeandmail.com/news/technology/google-street-view-comes-to-canada/article1315242/">every article covering the launch</a>.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=c0uMKgvUEB4:r7RNRmMpGJM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=c0uMKgvUEB4:r7RNRmMpGJM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=c0uMKgvUEB4:r7RNRmMpGJM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=c0uMKgvUEB4:r7RNRmMpGJM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=c0uMKgvUEB4:r7RNRmMpGJM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=c0uMKgvUEB4:r7RNRmMpGJM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=c0uMKgvUEB4:r7RNRmMpGJM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=c0uMKgvUEB4:r7RNRmMpGJM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/c0uMKgvUEB4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/10/17/google-street-view-finally-comes-to-canada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/10/17/google-street-view-finally-comes-to-canada/</feedburner:origLink></item>
		<item>
		<title>Joining the iPhone cult</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/6j4sbW5EQ2s/</link>
		<comments>http://unitstep.net/blog/2009/09/28/joining-the-iphone-cult/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 02:53:00 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[asides]]></category>
		<category><![CDATA[cellphones]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile phones]]></category>
		<category><![CDATA[toys]]></category>
		<category><![CDATA[unboxing]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=1008</guid>
		<description><![CDATA[Well, I finally gave in and joined the cult of iPhone. At the beginning of this month, I decided to splurge and get an iPhone through Fido, Rogers discount brand. Why? I suppose it had something to do with the extension of the 6GB/$30 &#8220;promotion&#8221; or the fact that I was able to find a [...]]]></description>
			<content:encoded><![CDATA[<p class="image align-right"><a href="http://www.zooomr.com/photos/stygiansonic/8248512/" title="Photo Sharing"><img src="http://static.zooomr.com/images/8248512_a50bbf2f26_t.jpg" width="100" height="75" alt="iPhone 3GS vs. iPod Touch 2nd Gen." /></a></p>
<p>Well, I finally gave in and joined the cult of iPhone.  At the beginning of this month, I decided to splurge and get an iPhone through Fido, Rogers discount brand.  Why? I suppose it had something to do with the <a href="http://www.theiphoneblog.com/2009/08/03/rogersfido-canada-extend-6gb30-data-promotion-september-15/">extension of the 6GB/$30 &#8220;promotion&#8221;</a> or the fact that I was able to find a 3GS for sale locally, but mostly it had to do with the fact that I needed a new toy. (Note that the iPhone is hardly a novelty item, with >21 million of them out there)</p>
<p>Keep in mind that I didn&#8217;t have a mobile phone <a href="http://unitstep.net/blog/2007/11/14/going-mobile/">until late 2007</a>, and even then I decided to only go with a prepaid provider (Virgin Mobile) because I didn&#8217;t have much of a need for a phone, but really just wanted Internet access.  However, this past summer my phone got more use than usual, especially with regard to Internet access.  With Internet browsing being anemic on most non-smartphones, I decided it was time to upgrade.</p>
<p>I narrowed my choices down to two: Either the Palm Pre or the iPhone 3GS.  However, I wasn&#8217;t very pleased with what plans Bell had to offer and wasn&#8217;t sure if the Pre developer ecosystem (and thus the applications available) would turn out to be as varied as the iPhone.  So, I decided to join the cult.</p>
<p class="image"><a href="http://www.zooomr.com/photos/stygiansonic/8248482/" title="Photo Sharing"><img src="http://static.zooomr.com/images/8248482_1f0b89b457_m.jpg" width="240" height="180" alt="iPhone 3GS vs. iPod Touch 2nd Gen." /></a></p>
<p>Another reason that led me down this path was the fact that I already had an <a href="http://unitstep.net/blog/2009/02/07/ipod-touch/">iPod Touch from earlier in the year</a>, and so I was already used to the iPhone interface. (I&#8217;ve since sold the Touch)  And yes, I do realize in that very article I berated the monthly cost of the iPhone only to now end up doing a complete 180 on the situation.  It&#8217;s not that I&#8217;m <em>happy</em> with what I&#8217;m paying, but rather that I&#8217;m willing to suck it up.  Such is the power of the cult, and perhaps one of the reasons for the iPod Touch&#8217;s existence &#8211; to suck users into getting an iPhone.  After all, <a href="http://www.independent.co.uk/news/business/news/iphone-finally-arrives-but-its-neither-cheap-nor-g3-402835.html">Steve Jobs did describe it as &#8220;training wheels for the iPhone&#8221;</a>, but perhaps &#8220;gateway drug to the iPhone&#8221; would be more accurate.</p>
<p>Fido actually had some okay plans; okay for Canada that is.  In the end, I&#8217;m paying just about $80 CAD a month. (including taxes) It&#8217;s about $50 more than I was paying for my old phone, which is quite a bit, but the iPhone has been invaluable in the intervening period after moving where I didn&#8217;t have Internet access at home.  We&#8217;ll see if it doesn&#8217;t lose its appeal in the coming months.</p>
<p>In the meantime, however, it&#8217;s been a blast.  There are literally too many apps out there to try, so I&#8217;ve only had a chance to play with the more popular ones.  Some of my favourites include the <a href="http://allrecipes.com/">AllRecipies dinner spinner</a>, <a href="http://www.wikipanion.net/">Wikipanion</a>, <a href="http://www.restaurantica.com/">Restaurantica</a> (which I&#8217;m surprised isn&#8217;t <a href="http://www.restaurantica.com/blog/restaurantica-iphone-app-coming-soon/157/">promoted more</a> on their website), and of course, <a href="http://www.shazam.com/">Shazam</a>, the accuracy of which continues to amaze me!</p>
<p>But the most useful features for me have been the always-available easy-to-use Internet access and the access to Google Maps overlaid with GPS.  It&#8217;s been invaluable, especially after moving to a new city.  Without it, I&#8217;d literally have been lost more than once.</p>
<p>Despite all the positive features, there are still some sore points.  Firstly, battery life on the 3GS is atrocious, as <a href="http://www.wired.com/gadgetlab/2009/07/iphone3gs-battery-test/">reports</a> have <a href="http://gizmodo.com/5025150/how-to-maximize-your-iphone-3gs-questionably-adequate-battery-life">indicated</a>.  On a full charge, I can barely last two days with moderate data usage, some music playback and hardly any YouTube/video usage.  Be prepared for the daily recharge should you get this phone.</p>
<p>Additionally, being an Apple product the iPhone looks very attractive but is a dirt/dust/fingerprint magnet.  Even with the new oleophobic coating (fancy word for anti-fingerprint) you&#8217;ll still probably want to get a screen protector and case for this device.  I&#8217;ve opted for the <a href="http://www.speckproducts.com/products/pixelskin/iphone-3g/143">Speck PixelSkin</a>, which I believe is one of the better cases out there, as it&#8217;s tough, rigid and adds a nice grip to the iPhone.</p>
<p>Lastly, there are <strong>no good default ringtones</strong> supplied with the iPhone! I don&#8217;t need some fancy pop-music ringtone, I just want something that sounds normal.  Thankfully, a coworker directed me to <a href="http://helderluis.net/297">the perfect iPhone ringtone</a>, and I&#8217;ve since been happy with it.</p>
<p>I&#8217;ll leave you with some comparison pictures of the iPhone 3GS and the iPod Touch 2nd generation.</p>
<p class="image"><a href="http://www.zooomr.com/photos/stygiansonic/8248466/" title="Photo Sharing"><img src="http://static.zooomr.com/images/8248466_b9fd37588a_m.jpg" width="240" height="180" alt="iPhone 3GS vs. iPod Touch 2nd Gen." /></a><a href="http://www.zooomr.com/photos/stygiansonic/8248493/" title="Photo Sharing"><img src="http://static.zooomr.com/images/8248493_a7a0a9ed15_m.jpg" width="240" height="180" alt="iPhone 3GS vs. iPod Touch 2nd Gen." /></a><a href="http://www.zooomr.com/photos/stygiansonic/8248506/" title="Photo Sharing"><img src="http://static.zooomr.com/images/8248506_82f1d2e580_m.jpg" width="240" height="180" alt="iPhone 3GS vs. iPod Touch 2nd Gen." /></a></p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=6j4sbW5EQ2s:ZpY4RIhVRmk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=6j4sbW5EQ2s:ZpY4RIhVRmk:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=6j4sbW5EQ2s:ZpY4RIhVRmk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=6j4sbW5EQ2s:ZpY4RIhVRmk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=6j4sbW5EQ2s:ZpY4RIhVRmk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=6j4sbW5EQ2s:ZpY4RIhVRmk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=6j4sbW5EQ2s:ZpY4RIhVRmk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=6j4sbW5EQ2s:ZpY4RIhVRmk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/6j4sbW5EQ2s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/09/28/joining-the-iphone-cult/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/09/28/joining-the-iphone-cult/</feedburner:origLink></item>
		<item>
		<title>Evaluation of boolean values in JavaScript</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/0q8Mv2Z72kE/</link>
		<comments>http://unitstep.net/blog/2009/08/11/evaluation-of-boolean-values-in-javascript/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:20:05 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[logical]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=987</guid>
		<description><![CDATA[If you have a background in a strongly-typed language such as Java, you&#8217;ll be used to using logical operators only with boolean values/expressions. However, in most dynamically-typed languages this doesn&#8217;t have to be the case, due to the nature of dynamic typing: The type of the variable is often determined based on the context in [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a background in a strongly-typed language such as Java, you&#8217;ll be used to using logical operators only with boolean values/expressions.  However, in most dynamically-typed languages this doesn&#8217;t have to be the case, due to the nature of dynamic typing: The type of the variable is often determined based on the <em>context</em> in which it is used.</p>
<p>With <strong>JavaScript</strong> there are actually two concepts at play when using logical operators: What is actually returned from the result of a logical operation, and how variables are converted to boolean values when the context requires it.</p>
<h2>Undergoing a conversion</h2>
<p>Firstly, we&#8217;ll look at how variables in JavaScript are converted to boolean values.  One way to explicitly convert a non-boolean value to a boolean one in JavaScript is to use the <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean#Description">global Boolean object as a function</a>.  By using the following code, you can explicitly get the boolean conversion of a variable or expression:</p>
<pre><code>var asBoolean = Boolean(someVariable);</code></pre>
<p>The variable <code>asBoolean</code> is now guaranteed to have a boolean value.  <strong>Note that this is not the same as the expression <code>new Boolean(someVariable)</code>, as that returns a Boolean (wrapper) object representing the converted value of <code>someVariable</code>, not a boolean primitive.</strong></p>
<p>So what values of <code>someVariable</code> will result in <code>true</code> being returned, and which ones will result in <code>false?</code>  The following values will evaluate to <code>false</code>, while all others will evaluate to <code>true</code>:</p>
<ul>
<li>0 or -0 (Most floating-point implementations have <a href="http://en.wikipedia.org/wiki/Signed_zero">positive and negative zero</a>, due to the IEEE 754 standard)</li>
<li>null</li>
<li>undefined</li>
<li>NaN</li>
<li>The empty string (&#8220;&#8221;)</li>
<li><code>false</code> itself</li>
</ul>
<p>This means that all other expressions or values, including any non-null object (including the <code>Boolean</code> object for false!) and the string &#8220;false&#8221; will be converted to true.</p>
<p>Note that using the <code>Boolean</code> function isn&#8217;t the only way to explicitly convert a variable to its boolean equivalent.  You could also apply the logical NOT operator twice, like so:</p>
<pre><code>var asBoolean = !(!someVariable);</code></pre>
<p>This is because the contract of the logical NOT operator in JavaScript is to return false if the operand can be converted to true and true otherwise.  The second NOT simply reverses the negation done by the first NOT operator.  While all of this may seem dead simple, it will be important to note as we move on to how other logical operators work.</p>
<h2>Logical conversion</h2>
<p>This is perhaps the most important difference with JavaScript.  <strong>Although the logical NOT operator (!) is guaranteed to return a boolean value, the logical AND (&#038;&#038;) and logical OR (||) operators are not</strong>.  This is by design, and although it might be a bit of a change for some developers, the feature can actually be quite useful.</p>
<p>Consider the following code examples:</p>
<pre><code>var result = a &amp;&amp; b</code></pre>
<p><strong>In this example of using logical AND, <code>a</code> is returned if it can be converted to false; otherwise <code>b</code> is returned.</strong></p>
<pre><code>var result = a || b</code></pre>
<p><strong>In this example of using logical OR, <code>a</code> is returned if it can be converted to true; otherwise <code>b</code> is returned.</strong></p>
<p>This means that one of the original operands or expressions used with the logical operators will be returned as a result of the evaluation.  You will not always get an actual boolean value, unless both of the operands were booleans to begin with.  Usually, this doesn&#8217;t matter, since if you use the result in a boolean context, it will get converted to the expected value.  For example:</p>
<pre><code>var string1 = "";
var string2 = "a string that is not empty";
var result = string1 || string2;
if (result)
{
  window.alert("At least one string was not empty");
  window.alert(result);
}</code></pre>
<p>This example will output &#8220;At least one string was empty&#8221;, and then &#8220;a string that is not empty&#8221;.  This is because the logical OR operator first converts <code>string1</code> to a boolean, which results in <code>false</code>.  Thus, the result of the logical OR returns <code>string2</code> into the result.  Since the result is now a non-empty string, it converts to <code>true</code> for the if-conditional.  </p>
<p>This also highlights a convenient way of using logical OR &#8211; give me the first expression if it evaluates to true, otherwise give me the second.  This is usually used to test for the availability of built-in objects in a particular JavaScript environment.</p>
<p>However, consider the following example:</p>
<pre><code>var string1 = "";
var string2 = "a string that is not empty";
var result = string1 || string2;
if (true == result)
{
  // We will never get here.
  window.alert("At least one string was not empty");
  window.alert(result);
}</code></pre>
<p>In this slightly changed example, instead of directly supplying the result to the if-conditional, we test whether it is equal to <code>true</code>.  In this case, it fails, since when using the <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Comparison_Operators">equality operator</a>, operands are not converted to booleans.  (Using the strict equality operator also would not work)</p>
<p>This underscores an important point: <strong>If you actually want a boolean value to work with, you will have to explicitly convert it, using either the <code>Boolean</code> function or a double application of the logical NOT operator</strong>, like so:</p>
<pre><code>result = Boolean(result);
// Or, we could do this:
result = !(!result);</code></pre>
<h2>Conclusion</h2>
<p>JavaScript offers some neat features due to its dynamic typing and these can help speed development, but you just need to be aware of how they work so that you don&#8217;t get tripped up.  This is especially true when dealing with implicit type conversion and how logical operators work.  I hope you found this helpful and as always, any feedback is appreciated!</p>
<h3>References</h3>
<ol class="less note">
<li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Operators/Logical_Operators">Logical Operators</a></li>
<li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Predefined_Core_Objects/Boolean_Object">Boolean Object</a></li>
<li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean#Description">Boolean Description</a></li>
<li><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Comparison_Operators">Comparison Operators</a></li>
</ol>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=0q8Mv2Z72kE:FsKWSywkEw4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=0q8Mv2Z72kE:FsKWSywkEw4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=0q8Mv2Z72kE:FsKWSywkEw4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=0q8Mv2Z72kE:FsKWSywkEw4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=0q8Mv2Z72kE:FsKWSywkEw4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=0q8Mv2Z72kE:FsKWSywkEw4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=0q8Mv2Z72kE:FsKWSywkEw4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=0q8Mv2Z72kE:FsKWSywkEw4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/0q8Mv2Z72kE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/08/11/evaluation-of-boolean-values-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/08/11/evaluation-of-boolean-values-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Separating UI from implementation</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/l7tihUKHhDw/</link>
		<comments>http://unitstep.net/blog/2009/07/05/separating-ui-from-implementation/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 02:21:10 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=960</guid>
		<description><![CDATA[I saw this comic about usability (linked from this question at Stack Overflow) and couldn&#8217;t help but let out a distressed laugh. How often have you seen this happen at your workplace, or in an application you&#8217;ve had the &#8220;pleasure&#8221; of using? For every elegantly designed UI that exists, there seems to be a plethora [...]]]></description>
			<content:encoded><![CDATA[<p>I saw <a href="http://stuffthathappens.com/blog/2008/03/05/simplicity/">this comic about usability</a> (linked from <a href="http://stackoverflow.com/questions/84556/whats-your-favorite-programmer-cartoon">this question at Stack Overflow</a>) and couldn&#8217;t help but let out a distressed laugh.  How often have you seen this happen at your workplace, or in an application you&#8217;ve had the &#8220;pleasure&#8221; of using? For every elegantly designed UI that exists, there seems to be a plethora of poorly designed ones that do their best to confuse users.</p>
<p>To me, a lot of this UI complexity stems directly from a lack of separation between the UI and business logic layers.</p>
<h2>Proper separation</h2>
<p>As developers, we&#8217;re accustomed to the best practices of modularity and separating the implementation from the interface.  This has lead to such patterns as MVC and Interface Oriented Design.  However, when it comes to <strong>designing</strong> the UI layer, these rules sometimes aren&#8217;t followed.  This is why we end up with overly complex &#8220;Search&#8221; pages, offering every option under the Sun, and configuration dialogs/screens with a <a href="http://developers.slashdot.org/comments.pl?sid=102620&#038;cid=8744744">one-to-one relationship</a> to settings files or some other underlying implementation detail under the guise of &#8220;letting the user decide what they want&#8221;.</p>
<p>Without clear UI planning, this one-to-one relationship tends to rear its ugly head more often.  Take our first example of a &#8220;Search&#8221; page.  In most applications, the search functionality is interacting with some sort of a database backend, most likely a SQL RDBMS.  The lazy approach is to design the search form based on the format of the SQL query itself.  This is how we get search forms with multiple fields, drop-down boxes and so forth &#8211; <strong>because this format translates almost directly into a SQL query; </strong> i.e. of the form <code>WHERE col1 LIKE... AND col2 LIKE...</code></p>
<p>Just because this is easier for the developer, doesn&#8217;t mean it&#8217;s the best solution for the end user.  In fact, it&#8217;s often the case that this is the exact opposite.  </p>
<h2>Thinking like a user</h2>
<p>In general, users don&#8217;t care about the implementation of your application or how it stores data.  They shouldn&#8217;t have to know about the columns of the table where the data is stored, so why make a search form that exposes this? Instead, you need to understand what your users want and how they&#8217;re most likely to use your application.  This isn&#8217;t an easy task, as <a href="http://mpt.net.nz/archive/2004/05/23/design">many have pointed out</a>.</p>
<p>This is where I think most UI problems come from &#8211; a misunderstanding of what users want.  This isn&#8217;t to say that these developers are dumb or careless; but just that when it comes to empathizing with their users, they often are unable to because they know their own software and have such an intimate view of it from a coder&#8217;s perspective. </p>
<p>Take the example of <a href="http://qttabbar.wikidot.com/">QTTabBar</a>, a Windows Explorer extension written in .NET that adds many useful features such as tabs, etc. to the interface.  It is an excellent extension and does things very well, but the options page is a complete nightmare.</p>
<p class="image">
<a href="http://unitstep.net/wordpress/wp-content/uploads/2009/07/ui-implementation-1.jpg"><img src="http://unitstep.net/wordpress/wp-content/uploads/2009/07/ui-implementation-1-250x300.jpg" alt="ui-implementation-1" title="ui-implementation-1" width="250" height="300" class="alignnone size-medium wp-image-972" /></a>
</p>
<p>There are just too many options on this one page; what do they all mean? Furthermore, there are nine more tabs, each with roughly the same number of additional options! This is far too complicated, and I&#8217;m guessing most people will never have a use for all of these options.</p>
<p>Of course, it&#8217;s completely unfair of me to pick on <a href="http://qttabbar.wikidot.com">QTTabBar</a> in this manner, considering it&#8217;s written by one guy who has chosen to give it away for free.  And, as I mentioned before, it&#8217;s a very useful utility that I can wholeheartedly recommend.</p>
<h2>A simple story</h2>
<p>Take a simply example, where we want to search a set of <em>items</em>, each of which have four separate properties &#8211; <em>name, description, <acronym class="uttInitialism" title="Uniform Resource Locator">URL</acronym></em> and <em>tags</em>.  The items are displayed on screen with all of the four properties shown.  The naive way would be to provide a search form that had fields for each property and allow users to search that way.</p>
<p>But with this simple (albeit contrived) example, there is an obviously simpler solution.  Since all of the four pieces of information about an item are shown onscreen, it would be much better just to provide a single search field whose input would be used to search all four properties, returning all items that had a match in any of the properties.  From a user&#8217;s point of view, this makes sense, since they are searching through what they know they can see and interact with. </p>
<p>If an advanced search was needed, it could be added later, but I would only do this if I knew it was absolutely needed by users, since the simple case is likely good for >90% of your users.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=l7tihUKHhDw:KPb9CTkpawE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=l7tihUKHhDw:KPb9CTkpawE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=l7tihUKHhDw:KPb9CTkpawE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=l7tihUKHhDw:KPb9CTkpawE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=l7tihUKHhDw:KPb9CTkpawE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=l7tihUKHhDw:KPb9CTkpawE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=l7tihUKHhDw:KPb9CTkpawE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=l7tihUKHhDw:KPb9CTkpawE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/l7tihUKHhDw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/07/05/separating-ui-from-implementation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/07/05/separating-ui-from-implementation/</feedburner:origLink></item>
		<item>
		<title>Determine your visitor’s location based on IP address</title>
		<link>http://feedproxy.google.com/~r/unitstep/~3/MZjdEQFsDGA/</link>
		<comments>http://unitstep.net/blog/2009/06/29/determine-your-visitors-location-based-on-ip-address/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 02:37:17 +0000</pubDate>
		<dc:creator>Peter Chng</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[maps]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[location]]></category>
		<category><![CDATA[lookup ip-geolocation]]></category>

		<guid isPermaLink="false">http://unitstep.net/?p=935</guid>
		<description><![CDATA[If you&#8217;re running a website that provides a service, it&#8217;s likely that it would be beneficial to know a user&#8217;s location (or have a rough idea) so that the content could be tailored to their specific geographic area. But how do you get their location, without having to ask them? By using their IP address, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running a website that provides a service, it&#8217;s likely that it would be beneficial to know a user&#8217;s location (or have a rough idea) so that the content could be tailored to their specific geographic area.  But how do you get their location, without having to ask them? By using their IP address, it&#8217;s possibly to determine their general area with fairly good accuracy. In this tutorial, I&#8217;ll explain how to do that using the free <a href="http://ipinfodb.com/ip_database.php">IP address geolocation database</a> from <a href="http://ipinfodb.com/">IPInfoDB</a>.</p>
<h2>Motivation and Usage</h2>
<p>There are numerous reasons for using the user&#8217;s location to improve the quality of a service.  For example, the restaurant guide and review site, <a href="http://www.restaurantica.com/">Restaurantica</a>, automatically makes a guess as to your location and populates the &#8220;Search&#8221; field so that you are one click away from finding information tailored to your geographic area.  </p>
<p>This determination is based on the user&#8217;s IP address.  Usually, the lookup is done based on a static set of mappings from IP addresses to geographical locations, like cities.  In fact, this is exactly what the <a href="http://ipinfodb.com/ip_database.php">IP address geolocation database</a> (that we&#8217;ll use) does.  It has the advantage of being easy to understand but unfortunately the accuracy can degrade over time, as IP addresses are usually not hardwired to specific locations.  For example, most DSL users are subject to DHCP, so the same IP address may be re-used across different cities. (The IP address database from IPInfoDB is updated periodically to help reduce this inaccuracy)</p>
<p>Thus, you should not rely on the information provided to be 100% accurate; it should only be used as a suggestion.  This is why <a href="http://www.restaurantica.com/">Restaurantica</a> only <em>populates</em> the search field with your estimated location, rather than giving you the results for that location right away; if it was wrong, the results for a different location would certainly be confusing to a user.  This gives the user a chance to correct any inaccurate lookups.</p>
<h2>Using the IP Address geolocation database</h2>
<p>The first step is to <a href="http://ipinfodb.com/ip_database.php">download the database</a> and import it into your local database; for this example I&#8217;ll use MySQL.  Note that the site also offers an <a href="http://ipinfodb.com/ip_location_api.php">IP location Lookup API</a>, which has the advantage of not requiring a local database but may be subject to usage limits; if you&#8217;ll be getting a lot of traffic you&#8217;ll be better off using the local database.</p>
<h3>Import the contents into MySQL</h3>
<p>I downloaded the <a href="http://mirrors.portafixe.com/ipinfodb/ip_database/current/ipinfodb_one_table_full.sql.bz2">Complete (City) database as one table in SQL format</a>.  Extracting the file from the archive, you&#8217;ll see that it&#8217;s well over 300 MB in size. If you&#8217;re fond of using <a href="http://www.phpmyadmin.net/home_page/index.php">phpMyAdmin</a>, you unfortunately won&#8217;t be able to import such a large file using that tool, so we&#8217;ll have to rely on the command line to import the contents.  Go to your <code>mysql/bin</code> folder and enter the following command, assuming you extracted the SQL file to the same location:</p>
<pre><code>mysql -u root -p [name of database] &lt; ipinfodb_one_table_full.sql</code></pre>
<p><strong>Running this command will take some time, as it won&#8217;t be fast having to import such a huge table</strong>.  Take a break and come back in a few minutes. <img src='http://unitstep.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (You may want to create a new database to hold just this table, do that before running this command)  After that&#8217;s done, you should be able to see the contents in phpMyAdmin, like below:</p>
<p class="image">
<a href="http://unitstep.net/wordpress/wp-content/uploads/2009/06/ip-geolocation-1.jpg"><img src="http://unitstep.net/wordpress/wp-content/uploads/2009/06/ip-geolocation-1-300x84.jpg" alt="ip-geolocation-1" title="ip-geolocation-1" width="300" height="84" class="alignnone size-medium wp-image-945" /></a>
</p>
<h3>Using the database</h3>
<p>Querying the database is straightforward, and the IP Info DB website has plenty of examples <a href="http://ipinfodb.com/ip_database.php">at the bottom of the download page</a>.  Basically, once you have the user&#8217;s IP, you can use a query like this to find the most likely city it originated from:</p>
<pre><code>SELECT *
FROM `ip_group_city`
WHERE `ip_start` &lt;= INET_ATON([ip address as a string])
ORDER BY ip_start DESC
LIMIT 1;</code></pre>
<p>The INET_ATON function converts a string that is the dotted-quad octet form of an IP address (the form you&#8217;re most used to seeing) into a 32-bit unsigned integer.  This integer is then used to locate the record that most likely corresponds to the geographical location.  The database is structured such that row with the highest <code>ip_start</code> value not greater than the given IP address is deemed to be the most likely location.</p>
<p>An example:</p>
<pre><code>SELECT * FROM `ip_group_city` WHERE `ip_start` &lt;= INET_ATON('69.156.150.155') ORDER BY ip_start DESC limit 1;</code></pre>
<p>(This returns the city of Toronto, Ontario, Canada) If you want to get a list of likely locations, just increase the LIMIT argument to something like 10, and this will return 10 locations that are likely close to where the IP address is located.  <strong>Note that there may be duplicates in this list</strong>.</p>
<h2>A simple example</h2>
<p>Here&#8217;s a simple <acronym class="uttInitialism" title="PHP: Hypertext Preprocessor">PHP</acronym> script that takes the user&#8217;s IP address and displays their most likely location on a map using the <a href="http://code.google.com/apis/maps/documentation/staticmaps/">Google Static Maps API</a>.</p>
<pre><code>&lt;?php
$ipGeolocationDatabaseName = 'ip_geolocation';

$link = mysql_connect('localhost', 'root', '');
$ipAddress = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);

echo $ipAddress;

mysql_select_db($ipGeolocationDatabaseName, $link);

$query = "SELECT * FROM `ip_group_city` " .
         "WHERE `ip_start` &lt;= INET_ATON( '$ipAddress' ) " .
         "ORDER BY ip_start DESC " .
         "LIMIT 1";
$resultLocation = mysql_query($query);

$numRows = mysql_num_rows($resultLocation);

if (0 == $numRows)
{
  echo "No likely locations found.";
}

while ($row = mysql_fetch_array($resultLocation))
{
  echo "&lt;pre&gt;";
  print_r($row);
  echo "&lt;/pre&gt;";

  $lat = urlencode($row['latitude']);
  $lng = urlencode($row['longitude']);
  if (!empty($lat) &amp;&amp; !empty($lng))
  {
    // NOTE: Replace the `key` parameter with your own, obtained from:
    // http://code.google.com/apis/maps/signup.html
    // (The one in use is only good for URLs on `localhost`)
    $queryString = "center=$lat,$lng";
    $queryString .= "&amp;zoom=10";
    $queryString .= "&amp;size=300x300";
    $queryString .= "&amp;markers=$lat,$lng,blue";
    $queryString .= "&amp;key=ABQIAAAAicCf6MqoHlR-MsfivtVWPRT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTNmqRdvnM9orG9QdyALHoUZfmFuQ";
    $queryString .= "&amp;sensor=false";

    echo '&lt;img src="http://maps.google.com/staticmap?' . htmlentities($queryString) . '" alt="location" /&gt;';
  }
}
?&gt;</code></pre>
<p>Here&#8217;s what it display for my IP address:</p>
<p class="image">
<a href="http://unitstep.net/wordpress/wp-content/uploads/2009/06/ip-geolocation-2.jpg"><img src="http://unitstep.net/wordpress/wp-content/uploads/2009/06/ip-geolocation-2.jpg" alt="ip-geolocation-2" title="ip-geolocation-2" width="300" height="300" class="alignnone size-full wp-image-956" /></a>
</p>
<p>As you can see, it&#8217;s not always accurate, but it&#8217;s a good start to enhancing your website to offer localized services and features.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://unitstep.net">unitstep.net</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact <strong><a href="mailto:webmaster@unitstep.net">webmaster@unitstep.net</a></strong> for more information.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/unitstep?a=MZjdEQFsDGA:tN9YVGKtnoI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/unitstep?i=MZjdEQFsDGA:tN9YVGKtnoI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=MZjdEQFsDGA:tN9YVGKtnoI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/unitstep?i=MZjdEQFsDGA:tN9YVGKtnoI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=MZjdEQFsDGA:tN9YVGKtnoI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/unitstep?i=MZjdEQFsDGA:tN9YVGKtnoI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=MZjdEQFsDGA:tN9YVGKtnoI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/unitstep?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/unitstep?a=MZjdEQFsDGA:tN9YVGKtnoI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/unitstep?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/unitstep/~4/MZjdEQFsDGA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://unitstep.net/blog/2009/06/29/determine-your-visitors-location-based-on-ip-address/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://unitstep.net/blog/2009/06/29/determine-your-visitors-location-based-on-ip-address/</feedburner:origLink></item>
	</channel>
</rss>
