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

<channel>
	<title>SAPessi &#187; My Works</title>
	<atom:link href="http://sapessi.com/category/my-works/feed/" rel="self" type="application/rss+xml" />
	<link>http://sapessi.com</link>
	<description>Perfection of means and confusion of aims...</description>
	<lastBuildDate>Fri, 02 Mar 2012 09:26:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Interviewing tips</title>
		<link>http://sapessi.com/2010/08/interviewing-tips/</link>
		<comments>http://sapessi.com/2010/08/interviewing-tips/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 19:26:50 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[General Babbling]]></category>
		<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Job]]></category>
		<category><![CDATA[Position]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=385</guid>
		<description><![CDATA[Over the past couple of weeks I&#8217;ve been interviewing candidates for a Java developer position. I can&#8217;t find words to describe my feelings now so I&#8217;ll recycle something a friend of mine, who&#8217;s also hiring, said: It&#8217;s next to impossible to hire anyone useful now. My complaint with most of the applicants is that they [...]<!-- Easy AdSense V2.82 -->
<!-- Post[count: 2] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8456780651289352";
/* 468x60, created 11/24/09 */
google_ad_slot = "7140896000";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.82 -->

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Over the past couple of weeks I&#8217;ve been interviewing candidates for a Java developer position.<br />
I can&#8217;t find words to describe my feelings now so I&#8217;ll recycle something a friend of mine, who&#8217;s also hiring, said:</p>
<blockquote><p>It&#8217;s next to impossible to hire anyone useful now.</p></blockquote>
<p><img class="alignright size-medium wp-image-387" title="cv" src="http://sapessi.com/wp-content/uploads/2010/08/cv-300x252.jpg" alt="" width="300" height="252" /></p>
<p>My complaint with most of the applicants is that they behave &#8211; there&#8217;s no other way to say this &#8211; machines.</p>
<p>I did what I did because I was told to it. Never really thought about it.</p>
<p>This infuriates me beyond belief.</p>
<p>So here a few tips for your (and my) next interview:</p>
<ol>
<li><strong>Don&#8217;t make up stuff on your CV. </strong>Sounds obvious but you&#8217;ll be surprised by how many people list technologies they have barely used on their CV and when asked about it don&#8217;t have a clue. You have no idea how bad this looks. (The red bullshitter light starts flashing in my head instantly)</li>
<li><strong>Show that you have passion for what you do. </strong>Being a Sun certified Java developer is all well and good but when I ask you what you have been looking into recently, or if you&#8217;ve worked on something on your own make sure to have an answer; or, if you don&#8217;t, make sure you have a good excuse.</li>
<li><strong>If you have 1000 years of experience with something I expect you to have some thoughts about it. </strong>Once again, Sun certified Java developer, if I ask you where do you see java going in the next 5 years have an answer! There must be something you think needs improving in Java or that you&#8217;d do differently. I&#8217;ll go wherever Sun takes me is just not an acceptable answer.</li>
<li><strong>Have an opinion! </strong>For God&#8217;s sake have one. I&#8217;ll even settle for half an opinion. If not about a technology you have used for 10 years at least about the coffee I just bought you during the interview. There&#8217;s no point in talking for an hour with somebody who has nothing to tell me other than &#8220;I&#8217;ll do everything you want, I always did.&#8221;</li>
<li><strong>Know what the company you have applied for does! </strong>This sounds stupid but I have called people after 1 week of their application and after 10 minutes with them over the phone I found out that they have no idea what the company they applied at was doing. That&#8217;s an instant goodbye!</li>
<li><strong>Fill the gaps in your CV, and proof-read it before sending it out for goodness sake. </strong>It&#8217;s fine that you have taken one year off to travel the world. If your CV does not list anything for the whole of 2009 I&#8217;m going to ask you about it. Give me a sincere instant answer and there&#8217;ll be no problem. Give me random excuses and it&#8217;s goodbye. As for proof-reading I had somebody applying who had listed &#8220;quick apprehension&#8221; as a skill. I&#8217;m not into hiring failed super-heroes. (I assume they ment quick comprehension)</li>
<li><strong>Apply for jobs you are genuinely interested in. </strong>You are not likely to get a job if your interviewer notices you don&#8217;t give a toss about what you do and who you do it for, and it shows. So Unless you are applying for a position as a nut-packer make sure you&#8217;re going for a job you&#8217;d actually enjoy doing and are interested in.</li>
</ol>
<p>Needless to say my search continues.</p>
<p>After reviewing more than 60 CVs I have almost completely given up on websites such as <a href="http://monster.co.uk" target="_blank">Monster</a> and <a href="http://cwjobs.co.uk" target="_blank">CWJobs</a> and I&#8217;m going to go entirely through connections now.</p>
<!-- Easy AdSense V2.82 -->
<!-- Post[count: 3] -->
<div class="ezAdsense adsense adsense-leadout" style="text-align:center;margin:12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8456780651289352";
/* 468x60, created 11/24/09 */
google_ad_slot = "7140896000";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<!-- Easy AdSense V2.82 -->

<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;submitHeadline=Interviewing+tips&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;title=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;title=Interviewing+tips" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;title=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;bm_description=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;T=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;title=Interviewing+tips" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;title=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Interviewing+tips+@+http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2010%2F08%2Finterviewing-tips%2F&amp;t=Interviewing+tips" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2010/08/interviewing-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decode a GPolyline in Objective-C</title>
		<link>http://sapessi.com/2010/06/decode-a-gpolyline-in-objective-c/</link>
		<comments>http://sapessi.com/2010/06/decode-a-gpolyline-in-objective-c/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 12:54:03 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Encoded]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GPolyline]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=378</guid>
		<description><![CDATA[The new version of MapKit in iOS 4 supports polylines, finally. MKPolyline to be precise. I have been working with the Google Maps API for a while and now I&#8217;m learning Objective-C and writing an iPhone app ro Route.ly Since the best way to send around the net the data to draw a polyline on [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The new version of MapKit in iOS 4 supports <a href="http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GPolyline" target="_blank">polylines</a>, finally. MKPolyline to be precise.</p>
<p>I have been working with the Google Maps API for a while and now I&#8217;m learning Objective-C and writing an iPhone app ro <a href="http://route.ly" target="_blank">Route.ly</a></p>
<p>Since the best way to send around the net the data to draw a polyline on a map is in <a href="http://code.google.com/apis/maps/documentation/utilities/polylinealgorithm.html" target="_blank">encoded format</a> I decided to write a small Objective-C function to decode the encoded string. Since I couldn&#8217;t find this anywhere on the net I decided to publish the code here.</p>
<p>You&#8217;ll notice that at the beginning of the function I replace &#8220;\\\\&#8221; with &#8220;\\&#8221;. This is because I use the encoded data both in web pages with javascript and my iPhone app. In javascript &#8220;\\&#8221; would be considered an escape and would therefore break my array of points. This is not the case in Objective-C so I switch back to the normal &#8220;\\&#8221;.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span class="kw5">NSMutableArray</span></a> <span class="sy0">*</span><span class="br0">&#41;</span> decodePolyline<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>encodedPoints <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> escapedEncodedPoints <span class="sy0">=</span> <span class="br0">&#91;</span>encodedPoints stringByReplacingOccurrencesOfString<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;<span class="es0">\\</span><span class="es0">\\</span>&quot;</span> withString<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;<span class="es0">\\</span>&quot;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> len <span class="sy0">=</span> <span class="br0">&#91;</span>escapedEncodedPoints length<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span class="kw5">NSMutableArray</span></a> waypoints <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span class="kw5">NSMutableArray</span></a> alloc<span class="br0">&#93;</span> init<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> index <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> lat <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> lng <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>index &lt; len<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">char</span> b;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> shift <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> result <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">do</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b <span class="sy0">=</span> <span class="br0">&#91;</span>escapedEncodedPoints characterAtIndex<span class="sy0">:</span>index<span class="sy0">++</span><span class="br0">&#93;</span> <span class="sy0">-</span> <span class="nu0">63</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result |<span class="sy0">=</span> <span class="br0">&#40;</span>b <span class="sy0">&amp;</span> 0x1f<span class="br0">&#41;</span> &lt;&lt; shift;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shift <span class="sy0">+=</span> <span class="nu0">5</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">while</span> <span class="br0">&#40;</span>b &gt;<span class="sy0">=</span> 0&#215;20<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> dlat <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>result <span class="sy0">&amp;</span> 1<span class="br0">&#41;</span> ? ~<span class="br0">&#40;</span>result &gt;&gt; 1<span class="br0">&#41;</span> <span class="sy0">:</span> <span class="br0">&#40;</span>result &gt;&gt; 1<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lat <span class="sy0">+=</span> dlat;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shift <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result <span class="sy0">=</span> <span class="nu0">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">do</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b <span class="sy0">=</span> <span class="br0">&#91;</span>escapedEncodedPoints characterAtIndex<span class="sy0">:</span>index<span class="sy0">++</span><span class="br0">&#93;</span> <span class="sy0">-</span> <span class="nu0">63</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result |<span class="sy0">=</span> <span class="br0">&#40;</span>b <span class="sy0">&amp;</span> 0x1f<span class="br0">&#41;</span> &lt;&lt; shift;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shift <span class="sy0">+=</span> <span class="nu0">5</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">while</span> <span class="br0">&#40;</span>b &gt;<span class="sy0">=</span> 0&#215;20<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> dlng <span class="sy0">=</span> <span class="br0">&#40;</span><span class="br0">&#40;</span>result <span class="sy0">&amp;</span> 1<span class="br0">&#41;</span> ? ~<span class="br0">&#40;</span>result &gt;&gt; 1<span class="br0">&#41;</span> <span class="sy0">:</span> <span class="br0">&#40;</span>result &gt;&gt; 1<span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lng <span class="sy0">+=</span> dlng;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> finalLat <span class="sy0">=</span> lat <span class="sy0">*</span> 1e<span class="sy0">-</span>5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> finalLong <span class="sy0">=</span> lng <span class="sy0">*</span> 1e<span class="sy0">-</span>5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Waypoint <span class="sy0">*</span>newPoint <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>Waypoint alloc<span class="br0">&#93;</span> init<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newPoint.lat <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> alloc<span class="br0">&#93;</span> initWithFormat<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;%f&quot;</span>, finalLat<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newPoint.lng <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> alloc<span class="br0">&#93;</span> initWithFormat<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;%f&quot;</span>, finalLong<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>waypoints addObject<span class="sy0">:</span>newPoint<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>newPoint release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> waypoints;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Waypoints is a simple model class I&#8217;ve written with two NSString properties: lat and lng.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;submitHeadline=Decode+a+GPolyline+in+Objective-C&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;title=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;title=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;title=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;bm_description=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;T=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;title=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;title=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Decode+a+GPolyline+in+Objective-C+@+http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2010%2F06%2Fdecode-a-gpolyline-in-objective-c%2F&amp;t=Decode+a+GPolyline+in+Objective-C" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2010/06/decode-a-gpolyline-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Route.ly &#8211; Discover and share the best driving routes</title>
		<link>http://sapessi.com/2010/05/route-ly-discover-and-share-the-best-driving-routes/</link>
		<comments>http://sapessi.com/2010/05/route-ly-discover-and-share-the-best-driving-routes/#comments</comments>
		<pubDate>Sun, 30 May 2010 11:06:37 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[biker]]></category>
		<category><![CDATA[driving]]></category>
		<category><![CDATA[motorbike]]></category>
		<category><![CDATA[petrolhead]]></category>
		<category><![CDATA[road]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[routely]]></category>
		<category><![CDATA[Startup]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=373</guid>
		<description><![CDATA[It all started a couple of months ago. I am a keen biker and on one of the rare sunny weekends the weather god bestows upon England I decided to take my motorbike out for a spin. The problem is, I&#8217;m not English. I didn&#8217;t grow up here so I know very few routes outside [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://route.ly"><img class="alignright size-full wp-image-374" title="Route.ly" src="http://sapessi.com/wp-content/uploads/2010/05/3.jpg" alt="Route.ly - Discover and share the best driving routes around the globe" width="200" height="200" /></a>It all started a couple of months ago. I am a keen biker and on one of the rare sunny weekends the weather god bestows upon England I decided to take my motorbike out for a spin.</p>
<p>The problem is, I&#8217;m not English. I didn&#8217;t grow up here so I know very few routes outside of London. I didn&#8217;t have a specific destination and wasn&#8217;t looking for culture. All I wanted was a spectacular windy road with breathtaking views to enjoy myself doing what I like most. Driving.</p>
<p>I quickly fired up a browser and asked Google whether they knew of some good driving roads around me. Needless to say I couldn&#8217;t find anything except for some blog post detailing how the writer had a blast that day with their friends.</p>
<p>When I arrived home that evening I decided to build a website to do just that &#8211; <a title="Route.ly - Discover and share the best driving routes around the globe" href="http://route.ly" target="_blank">Discover and share the best driving routes around the globe</a> &#8211; and now, after a couple of months of work, <a title="Route.ly - Discover and share the best driving routes around the globe" href="http://route.ly" target="_blank">Route.ly</a> is here.</p>
<p>No more disappointingly random day trips for me, or any other biker in unknown surroundings all over the world!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;submitHeadline=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;title=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;title=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;title=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;bm_description=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;T=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;title=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;title=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes+@+http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2010%2F05%2Froute-ly-discover-and-share-the-best-driving-routes%2F&amp;t=Route.ly+%26%238211%3B+Discover+and+share+the+best+driving+routes" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2010/05/route-ly-discover-and-share-the-best-driving-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Draggable directions with Google Maps APIs</title>
		<link>http://sapessi.com/2010/03/draggable-directions-with-google-maps-apis/</link>
		<comments>http://sapessi.com/2010/03/draggable-directions-with-google-maps-apis/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 11:51:20 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Directions]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=358</guid>
		<description><![CDATA[I love calculating driving directions on Google Maps and then drag the blue line marking my directions to change the route. Everything is updated automatically on the page and the directions are re-calculated to go through the new point I defined. I&#8217;ve been playing around with the Google Maps APIs recently and imagine my disappointment [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I love calculating driving directions on Google Maps and then drag the blue line marking my directions to change the route. Everything is updated automatically on the page and the directions are re-calculated to go through the new point I defined.</p>
<p>I&#8217;ve been playing around with the <a href="http://code.google.com/apis/maps/" target="_blank">Google Maps APIs</a> recently and imagine my disappointment when I found out that Google does not allow directions calculated through the APIs to be dragged around.</p>
<p>Not put off by this I decided to try and replicate the directions-dragging myself. How hard can it be?<br />
As it turns out. Very, at least if you want to make it look as smooth as Google&#8217;s own solution.</p>
<p>When generating directions Google Maps adds a <a href="http://code.google.com/apis/maps/documentation/reference.html#GPolyline" target="_blank">GPolyline</a> element overlay to your map. You can set the returned line to be editable but this makes an awful lot of vertices appear on it, which makes reading your directions quite hard. Even so, once you dragged one of this vertices around you are not editing the route but just changing the shape of the line.</p>
<p>Mine is not a complete solution and I&#8217;m interested in feedback and ideas on how to improve it.</p>
<p>First off calculate your directions:</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">map <span class="sy0">=</span> <span class="kw2">new</span> google.<span class="me1">maps</span>.<span class="me1">Map2</span><span class="br0">&#40;</span>document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&#8216;map_canvas&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> wayPoints <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
wayPoints.<span class="me1">push</span><span class="br0">&#40;</span>startPoint.<span class="me1">getLatLng</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
wayPoints.<span class="me1">push</span><span class="br0">&#40;</span>endPoint.<span class="me1">getLatLng</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="kw2">var</span> myDir <span class="sy0">=</span> <span class="kw2">new</span> google.<span class="me1">maps</span>.<span class="me1">Directions</span><span class="br0">&#40;</span>map<span class="br0">&#41;</span><br />
myDir.<span class="me1">loadFromWaypoints</span><span class="br0">&#40;</span>wayPoints<span class="sy0">,</span> <span class="br0">&#123;</span> travelMode<span class="sy0">:</span> G_TRAVEL_MODE_DRIVING <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>This will calculate your driving directions and plot a GPolyline on your map. The line is easily accessible in the GDirections object once the directions are calculated. To intercept this I have decided to use the <strong>addoverlay</strong> event on the GMap object. This event is triggered every time something is plotted over the map (says on the tin).</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">google.<span class="me1">maps</span>.<span class="me1">Event</span>.<span class="me1">addListener</span><span class="br0">&#40;</span>myDir<span class="sy0">,</span> <span class="st0">&quot;addoverlay&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw2">var</span> dirLine <span class="sy0">=</span> myDir.<span class="me1">getPolyline</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// Get the polyline from the directions object</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>At this point we can ask the APIs to make the GPolyline editable. This will make the vertices appear on the line and make then draggable. As I said before this only changes the shape of the line and doesn&#8217;t actually affect your directions object. Luckily the GPolyline comes with a nifty event called <strong>lineupdated</strong>.<br />
This is triggered once the user has finished dragging a vertex. By intercepting this we can look through the vertices and know what&#8217;s been changed on the line and where the vertex has been moved to.<br />
In order to do this we must also know the previous position of the vertices (latitude and longitude) to be able to compare the old and the new &#8220;edited&#8221; line.<br />
Another challenge is the fact that the <a href="http://code.google.com/apis/maps/documentation/reference.html#GDirections" target="_blank">GDirections</a> object can accept only so many waypoints (25 if I&#8217;m not wrong). Which means we&#8217;ll have to add only the vertex that has changed to the directions and not all of them.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="co1">// In the addoverlay event also save the original vertices of the line</span><br />
<span class="kw2">var</span> origLine <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&amp;</span>lt<span class="sy0">;</span> dirLine.<span class="me1">getVertexCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
origLine.<span class="me1">push</span><span class="br0">&#40;</span>dirLine.<span class="me1">getVertex</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="co1">// DONE saving vertices</span></p>
<p><span class="co1">// Now intercept the lineupdated event and add the new waypoints</span><br />
google.<span class="me1">maps</span>.<span class="me1">Event</span>.<span class="me1">addListener</span><span class="br0">&#40;</span>dirLine<span class="sy0">,</span> <span class="st0">&quot;lineupdated&quot;</span><span class="sy0">,</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
routePoints <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
<span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&amp;</span>lt<span class="sy0">;</span> dirLine.<span class="me1">getVertexCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
<span class="kw2">var</span> savedPoint <span class="sy0">=</span> origLine<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="sy0">;</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span>savedPoint <span class="sy0">||</span> <span class="br0">&#40;</span>savedPoint.<span class="me1">lat</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">!=</span> dirLine.<span class="me1">getVertex</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">lat</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&amp;</span>amp<span class="sy0">;&amp;</span>amp<span class="sy0">;</span> savedPoint.<span class="me1">lng</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">!=</span> dirLine.<span class="me1">getVertex</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">lng</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
routePoints.<span class="me1">push</span><span class="br0">&#40;</span>dirLine.<span class="me1">getVertex</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="co1">// Now we remove the previous directions and recalculate the route</span><br />
map.<span class="me1">removeOverlay</span><span class="br0">&#40;</span>dirLine<span class="br0">&#41;</span><br />
calcRoute<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>This works quite well but does not look as smooth as Google&#8217;s solution.<br />
The problem is that while you are dragging a vertex only that bit of the GPolyline moves and the rest stays in its original position. which makes the shape of your directions quite awkward while you are dragging. Unforunately the GPolyline does not come with a &#8220;startdragging&#8221; event, otherwise we could just recalculate the route every few seconds while the vertex is being dragged.</p>
<p>This is not the most elegant of solutions but it does the job.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;submitHeadline=Draggable+directions+with+Google+Maps+APIs&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;title=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;title=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;title=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;bm_description=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;T=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;title=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;title=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Draggable+directions+with+Google+Maps+APIs+@+http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2010%2F03%2Fdraggable-directions-with-google-maps-apis%2F&amp;t=Draggable+directions+with+Google+Maps+APIs" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2010/03/draggable-directions-with-google-maps-apis/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SVG graphics with JavaScript</title>
		<link>http://sapessi.com/2009/11/svg-graphics-with-javascript/</link>
		<comments>http://sapessi.com/2009/11/svg-graphics-with-javascript/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 13:47:03 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[Charts]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RaphaelJS]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[TweetSentiment]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=327</guid>
		<description><![CDATA[When I started developing TweetSentiment I decided that the interface should have as little text as possible. Most of the information I was interested in could be displayed graphically, with a chart. So I looked at all the options available for chart generation. Backend code to generate a static image (JFreeChart or PHP) Flash object [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>When I started developing <a href="http://tweetsentiment.info" target="_blank">TweetSentiment</a> I decided that the interface should have as little text as possible. Most of the information I was interested in could be displayed graphically, with a chart.</p>
<p>So I looked at all the options available for chart generation.</p>
<ol>
<li>Backend code to generate a static image (<a href="http://www.jfree.org/jfreechart/" target="_blank">JFreeChart</a> or PHP)</li>
<li>Flash object to draw a chart retrieving the data from a URL</li>
<li>Draw charts in JavaScript directly on the client&#8217;s browser</li>
</ol>
<p>I&#8217;m not a huge fan of option one. Primarily because TweetSentiment is hosted on a tiny linux box which would not be able to handle the load for the traffic the site gets, also because it&#8217;s a static image &#8211; it&#8217;s just not very funky &#8211; no interaction possible.</p>
<p>Option two would certainly create spectacular looking charts but I have almost no experience with flash and I wasn&#8217;t about to start learning a new language/technology. Plus I&#8217;m not into browser plugins if I can avoid them.</p>
<p>JavaScript is a language I&#8217;m familiar with and I remember seeing some cool-looking charts generated with <a href="http://www.dojotoolkit.org/" target="_blank">Dojo</a>. Unfortunately for TweetSentiment I have used jquery since the most important thing for me there was DOM manipulation (and jquery is just better for that).<br />
I then started shopping around for <a href="http://jquery.com/" target="_blank">jQuery</a> plugins to generate charts. There are a few around but none of them impressed me. They just weren&#8217;t as good looking as I&#8217;d hoped nor they were interactive.</p>
<p>By coincidence I stumbled on <a href="http://raphaeljs.com/" target="_blank">RaphaelJS</a>. A JavaScript library to draw <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" target="_blank">Scalable Vector Graphics</a> directly from JavaScript based on jQuery. I tested the samples on the website with a few browsers and I was happy to discover it worked just fine with all of them.</p>
<blockquote>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;"><strong>Scalable Vector Graphics</strong> (<strong>SVG</strong>) is a family of specifications of an <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="XML" href="/wiki/XML">XML</a>-based <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="File format" href="/wiki/File_format">file format</a> for describing two-dimensional <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="Vector graphics" href="/wiki/Vector_graphics">vector graphics</a>, both static and dynamic (i.e. interactive or <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="SVG animation" href="/wiki/SVG_animation">animated</a>).</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">The SVG specification is an <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="Open standard" href="/wiki/Open_standard">open standard</a> that has been under development by the <a style="text-decoration: none; color: #002bb8; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial;" title="World Wide Web Consortium" href="/wiki/World_Wide_Web_Consortium">World Wide Web Consortium</a> (W3C) since 1999.</p>
</blockquote>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">I also discovered that there is a <a href="http://g.raphaeljs.com/" target="_blank">charting library built on top of RaphaelJS</a>, which is exactly what I was looking for. However, being a geek, I decided to go ahead and try to develop something on my own. You know, just for kicks.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">As I delved deeper into RaphaelJS I found the library to be incredibly powerful. It&#8217;s a shame that the <a href="http://raphaeljs.com/reference.html" target="_blank">documentation provided on the website</a> lets it down a bit.<br />
The most powerful bit is the ability to extend objects and attach new functions to them. Something scarcely mentioned in the available documentation.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">For example if you need to use curved lines (paths as SVG calls them) you can just defined a default function you can then call from your code simply by adding it to the <strong>el </strong>&#8220;object&#8221; in RaphaelJS</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">Raphael.<span class="me1">el</span>.<span class="me1">curveTo</span> <span class="sy0">=</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw2">var</span> args <span class="sy0">=</span> Array.<span class="me1">prototype</span>.<span class="me1">splice</span>.<span class="me1">call</span><span class="br0">&#40;</span>arguments<span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> arguments.<span class="me1">length</span><span class="br0">&#41;</span><span class="sy0">,</span><br />
&nbsp; d <span class="sy0">=</span> <span class="br0">&#91;</span><span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="st0">&quot;s&quot;</span><span class="sy0">,</span> <span class="nu0">0</span><span class="sy0">,</span> <span class="st0">&quot;c&quot;</span><span class="br0">&#93;</span><span class="br0">&#91;</span>args.<span class="me1">length</span><span class="br0">&#93;</span> <span class="sy0">||</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">this</span>.<span class="me1">isAbsolute</span> <span class="sy0">&amp;</span>amp<span class="sy0">;&amp;</span>amp<span class="sy0">;</span> <span class="br0">&#40;</span>d <span class="sy0">=</span> d.<span class="me1">toUpperCase</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">this</span>._last <span class="sy0">=</span> <span class="br0">&#123;</span>x<span class="sy0">:</span> args<span class="br0">&#91;</span>args.<span class="me1">length</span> <span class="sy0">-</span> 2<span class="br0">&#93;</span><span class="sy0">,</span> y<span class="sy0">:</span> args<span class="br0">&#91;</span>args.<span class="me1">length</span> <span class="sy0">-</span> 1<span class="br0">&#93;</span><span class="br0">&#125;</span><span class="sy0">;</span><br />
&nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="br0">&#123;</span>path<span class="sy0">:</span> <span class="kw1">this</span>.<span class="me1">attrs</span>.<span class="me1">path</span> <span class="sy0">+</span> d <span class="sy0">+</span> args<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="sy0">;</span></div>
</div>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">Another very useful function I found in one of their samples is the <strong>andClose() </strong>This is used to close a polygon you have started drawing with paths. No matter where you got to it will reconnect to the initial point.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">Raphael.<span class="me1">el</span>.<span class="me1">andClose</span> <span class="sy0">=</span> <span class="kw2">function</span> <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">attr</span><span class="br0">&#40;</span><span class="br0">&#123;</span>path<span class="sy0">:</span> <span class="kw1">this</span>.<span class="me1">attrs</span>.<span class="me1">path</span> <span class="sy0">+</span> <span class="st0">&quot;z&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span><span class="sy0">;</span></div>
</div>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">This can then be used this way using <a href="http://ejohn.org/blog/ultra-chaining-with-jquery/" target="_blank">chaining</a>.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;">RaphaelJSElement.<span class="me1">lineTo</span><span class="br0">&#40;</span>x<span class="sy0">,</span> opts.<span class="me1">height</span> <span class="sy0">-</span> bottomgutter<span class="br0">&#41;</span>.<span class="me1">andClose</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em;">I&#8217;m still developing the chart library I used in TweetSentiment and I&#8217;m planning to publish it here with some documentation under MIT licence.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;submitHeadline=SVG+graphics+with+JavaScript&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;title=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;title=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;title=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;bm_description=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;T=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;title=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;title=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+SVG+graphics+with+JavaScript+@+http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fsvg-graphics-with-javascript%2F&amp;t=SVG+graphics+with+JavaScript" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2009/11/svg-graphics-with-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TweetSentiment &#8211; Twitter activity VS market activity</title>
		<link>http://sapessi.com/2009/11/tweetsentiment-twitter-activity-vs-market-activity/</link>
		<comments>http://sapessi.com/2009/11/tweetsentiment-twitter-activity-vs-market-activity/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 18:30:47 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Finance]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Market]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[StockTwits]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=307</guid>
		<description><![CDATA[Perhaps I&#8217;m bored. Maybe I&#8217;m just too single. Anyway. A couple of days ago I was looking at StockTwits again and saw a considerable amount of activity. There and then I decided that it would have been pretty cool to check whether there was any correlation between the activity about a stock on Twitter and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Perhaps I&#8217;m bored. Maybe I&#8217;m just too single.<br />
Anyway. A couple of days ago I was looking at <a href="http://stocktwits.com/" target="_blank">StockTwits</a> again and saw a considerable amount of activity. There and then I decided that it would have been pretty cool to check whether there was any correlation between the activity about a stock on Twitter and the actual trading volume on the market.</p>
<p>I set off to build a small system to do just that. A couple of <a href="http://groovy.codehaus.org/" target="_blank">groovy scripts</a> to collect the data and save it plus some JavaScript and HTML to display it.</p>
<p>So here I am a couple of days later talking about <a href="http://tweetsentiment.info" target="_blank">TweetSentiment</a>.</p>
<p>Collecting the data I needed was pretty trivial thanks to the fact that StockTwits asks all its members to tweet the symbols they are trading preceded by a dollar sign ($).<br />
My first task was to build a list of securities I was interested in. I decided to go to <a href="http://www.covestor.com" target="_blank">Covestor.com</a> and pick the most traded securities list.  Once that list was ready all I had to do was call the <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method:-search" target="_blank">Twitter Search APIs</a> for each stock and store the results.<br />
Groovy made these tasks incredibly simple.</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;">def output <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurl+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URL</span></a><span class="br0">&#40;</span><span class="st0">&quot;http://search.twitter.com/search.atom?q=${&quot;</span>\$<span class="st0">&quot;+curSecurity.symbol}&amp;amp;rpp=100&quot;</span><span class="br0">&#41;</span>.<span class="me1">getText</span><span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p>def parsedXml <span class="sy0">=</span> <span class="kw1">new</span> XmlParser<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">parseText</span><span class="br0">&#40;</span>output<span class="br0">&#41;</span></p>
<p>parsedXml.<span class="me1">entry</span>.<span class="me1">each</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> curEntry <span class="sy0">-&amp;</span>gt<span class="sy0">;</span><br />
&#8230;</div>
</div>
<p>I&#8217;m not doing much with the tweets. At the moment I just count them and look for &#8220;buy&#8221; and &#8220;sell&#8221;. I&#8217;m looking into smarter ways of analysing the text and look for positive/negative opinions. If you have any suggestion on this please do leave a comment.</p>
<p>Next in my TODO list was getting some market data. For that I&#8217;m using Yahoo finance asking for previous closing price and average volume for each security. Once again, piece of cake with Groovy. Same thing as before just different URL.<br />
Yahoo finance actually has quite a simple interface to let you grab the data. Check out this page on <a href="http://cliffngan.net/a/13" target="_blank">Cliff&#8217;s Notes</a>.</p>
<p>Now I had all the data I needed. Only thing left was to build some sort of interface to look at it. I wanted to display all of the data on a chart to be able to make sense of it as quickly as possible.<br />
My server (i.e. the machine running this blog) with its puny power could have never handled the traffic I get while generating charts. Therefore what I decided to do is to export all the data in text files (JSON format) and do all of the chart generation with JavaScript.</p>
<p>I browsed the web for a bit looking for charting components for <a href="http://jquery.com/" target="_blank">jQuery</a>. Couldn&#8217;t find anything I was happy with. Not functionality-wise but aesthetically. Or maybe I just felt like playing around with JS for some time &#8211; unfortunately as it often happens with JS I spent the best part of the last 2 days working on it.</p>
<p>I decided to use a library called <a href="http://raphaeljs.com/index.html" target="_blank">Raphaël</a>. This library makes working with vector graphics incredibly simple and the results just look amazing. I know that they are in the process of building a <a href="http://g.raphaeljs.com/" target="_blank">charting library on top of it</a> however&#8230; well I have no excuse now other than I wanted to work with JS.</p>
<p>What I did is build a very simple jQuery component called SAPchart. It only draws line charts but it&#8217;s quite simple and I think the results look pretty good.</p>
<p>You can download the <a href="http://sapessi.com/tweetsentiment/js/SAPchart.js" target="_blank">source here</a>. It requires jQuery, <a href="http://raphaeljs.com/index.html" target="_blank">Raphaël</a>, and <a href="http://sapessi.com/tweetsentiment/js/raphael.path.methods.js" target="_blank">raphael path methods</a>.</p>
<div class="codesnip-container" >
<div class="javascript codesnip" style="font-family:monospace;"><span class="co1">// Constructor. Possible options are:</span><br />
<span class="co1">// showGrid: true</span><br />
<span class="co1">// width: 800</span><br />
<span class="co1">// height: 250</span><br />
<span class="co1">// legendWidth: 200</span><br />
<span class="co1">// showLabels: true</span><br />
<span class="co1">// showDots: true</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">SAPchart</span><span class="br0">&#40;</span><span class="br0">&#123;</span>legendWidth<span class="sy0">:</span> 800<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="co1">// Give the library a list of labels for the x axis</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">setLabels</span><span class="br0">&#40;</span>theLabels<span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="co1">// Add to the chart as many series as you want &#8211; provided the length of the series is</span><br />
<span class="co1">// the same of the labels (quite unsophisticated but serves its purpose)</span><br />
<span class="co1">// array of values, unique id of the series, legend name, additional options)</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">addSeries</span><span class="br0">&#40;</span>theTweets<span class="sy0">,</span> <span class="st0">&quot;tweet&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Twitter Activity&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">&quot;color&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span>.6<span class="sy0">,</span> 1<span class="sy0">,</span> .75<span class="br0">&#93;</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">addSeries</span><span class="br0">&#40;</span>theVolumes<span class="sy0">,</span> <span class="st0">&quot;volume&quot;</span><span class="sy0">,</span> <span class="st0">&quot;Average Daily Volume&quot;</span><span class="sy0">,</span> <span class="br0">&#123;</span> <span class="st0">&quot;color&quot;</span><span class="sy0">:</span> <span class="br0">&#91;</span>.2<span class="sy0">,</span> 1<span class="sy0">,</span> .75<span class="br0">&#93;</span> <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></p>
<p><span class="co1">// Draws the chart in your html element</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">draw</span><span class="br0">&#40;</span><span class="br0">&#41;</span></p>
<p><span class="co1">// This will return an HTML table containing the legend of all the series you specified</span><br />
<span class="co1">// the boolean parameter tells me whether you want your legend to be horizontal (default vertical)</span><br />
$<span class="br0">&#40;</span><span class="st0">&quot;#holder&quot;</span><span class="br0">&#41;</span>.<span class="me1">getLegend</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span>.<span class="me1">appendTo</span><span class="br0">&#40;</span>$<span class="br0">&#40;</span><span class="st0">&quot;#legend&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</div>
<p>I&#8217;m now wondering whether I should keep working on it and improve it.</p>
<p>Anyway <a href="http://sapessi.com/tweetsentiment/" target="_blank">TweetSentiment is now available here</a>. I&#8217;m planning to keep it running and collecting data for a while. I&#8217;d say you need at least 3/4 months worth of data before you can make any useful observations.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;submitHeadline=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;title=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;title=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;title=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;bm_description=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;T=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;title=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;title=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity+@+http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Ftweetsentiment-twitter-activity-vs-market-activity%2F&amp;t=TweetSentiment+%26%238211%3B+Twitter+activity+VS+market+activity" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2009/11/tweetsentiment-twitter-activity-vs-market-activity/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MVC frameworks users FAIL</title>
		<link>http://sapessi.com/2009/11/mvc-frameworks-users-fail/</link>
		<comments>http://sapessi.com/2009/11/mvc-frameworks-users-fail/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 12:23:16 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Loose Coupling]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Struts]]></category>

		<guid isPermaLink="false">http://sapessi.com/?p=283</guid>
		<description><![CDATA[I have been interviewing quite a few people recently for a position as Java developer. Every single CV came with either a Struts or Spring mention. If not both. Oh yes, I have even discussed systems where both frameworks were used at the same time. Of course it&#8217;s your system, you are free to use [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I have been interviewing quite a few people recently for a position as Java developer.<br />
Every single CV came with either a <a href="http://struts.apache.org/" target="_blank">Struts</a> or <a href="http://www.springsource.org" target="_blank">Spring</a> mention. If not both. Oh yes, I have even discussed systems where both frameworks were used at the same time.</p>
<p>Of course it&#8217;s your system, you are free to use whichever technology you prefer. However, you must also be able to explain why you picked that particular framework. And &#8220;It wasn&#8217;t me who picked it&#8221; is not a good answer. If you had a better idea why didn&#8217;t you question the decision?</p>
<p>Perhaps my problem is not exactly with MVC frameworks but with the people out there who use them without thinking things through. These are the sort of people who go around telling you that they used both Spring and Struts because it&#8217;s an &#8220;Architectural pattern&#8221;. The truth is that they haven&#8217;t thought about their architecture at all. They just thought that by using an MVC framework the problem would solve itself.</p>
<p>Yesterday I was reading a post by <a href="http://continuations.com/post/227973186/one-truth-about-technology-architecture-loose-coupling" target="_blank">Albert Wenger at Union Square Ventures about Loose Coupling</a>. I&#8217;m not going to repeat here what Albert already explained quite thoroughly. I will just say I agree with everything he said. Especially with this paragraph:</p>
<blockquote><p>So how does loose coupling enable scaling and innovation?  Scaling bottlenecks tend to move around as a site or service grows.  With loose coupling it is often possible to isolate a bottleneck and prevent it from slowing down everything else.<br />
&#8230;<br />
This also points to how loose coupling enables innovation.  Different teams can more easily be in charge of their own part and make changes to it more quickly.  Entirely new parts can be added more easily too (a great example here is Facebook adding chat).</p></blockquote>
<p>MVC frameworks themselves do not prevent loose coupling as an architectural decision. The problem is that most of the people who use them are the sort of over-engeneering maniacs who try to build the perfect system in one big blob of code, and inescapably, fail.<br />
So here&#8217;s my point. Using an MVC should not be considered an architectural decision. Architecture is at a much higher level.</p>
<p>Most architecture design nowadays show systems split horizontally.</p>
<p><img class="aligncenter size-full wp-image-284" title="TWING MVC structure" src="http://sapessi.com/wp-content/uploads/2009/11/TWING_MVC_structure_0.preview.png" alt="TWING MVC structure" width="300" height="153" /></p>
<p>This may allow your application to support higher load, but doesn&#8217;t give you the ability to isolate bottlenecks in your application. I believe what we&#8217;ll see in the future is architecture diagrams that are split vertically with every single component (or task your app has to perform) being completely independent from the rest, and feel free to use the MVC of your choice in each component. Just make sure you know why you decided to use it.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;submitHeadline=MVC+frameworks+users+FAIL&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;title=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;title=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;title=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;bm_description=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;T=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;title=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;title=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+MVC+frameworks+users+FAIL+@+http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2009%2F11%2Fmvc-frameworks-users-fail%2F&amp;t=MVC+frameworks+users+FAIL" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2009/11/mvc-frameworks-users-fail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MOvember continues</title>
		<link>http://sapessi.com/2007/11/movember-continues/</link>
		<comments>http://sapessi.com/2007/11/movember-continues/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 17:19:56 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[My Works]]></category>
		<category><![CDATA[Pleas]]></category>
		<category><![CDATA[Cancer]]></category>
		<category><![CDATA[Charity]]></category>
		<category><![CDATA[Donation]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Movember]]></category>
		<category><![CDATA[November]]></category>
		<category><![CDATA[Prostate]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Sponsor]]></category>
		<category><![CDATA[UK]]></category>

		<guid isPermaLink="false">http://thebigdeal.wordpress.com/2007/11/23/movember-continues/</guid>
		<description><![CDATA[Hi All, During Movember (the month formerly known as November) I&#8217;ll be growin a Mo (slang for Moustache). That&#8217;s right I&#8217;m bringing the Mo back to raise funds for The Prostate Cancer Charity because I&#8217;m passionate about men&#8217;s health and the fight against prostate cancer. Why&#8230; Prostate cancer is now the most common cancer diagnosed [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hi All,</p>
<p>During <span class="nfakPe">Movember</span> (the month formerly known as November) I&#8217;ll be growin a Mo (slang for Moustache). That&#8217;s right I&#8217;m bringing the Mo back to raise funds for The Prostate Cancer Charity because I&#8217;m passionate about men&#8217;s health and the fight against prostate cancer. Why&#8230;</p>
<ul>
<li><em>Prostate cancer is now the most common cancer diagnosed in men in the U.K. with at least one man dying every hour from the disease.<br />
</em></li>
<li><em>Every year about 35,000 men in the U.K. are diagnosed with prostate cancer and about 10,000 men die from the disease. </em></li>
<li><em>One man in 11 will be diagnosed with prostate cancer in their lifetime in the U.K.</em></li>
</ul>
<p>To sponsor my Mo (moustache) and fight against prostate cancer please go to <a href="http://www.movember.com/uk/donate/?action=sponsorlink&amp;rego=120922" target="_blank">http://www.<span class="nfakPe">movember</span>.com/uk/donate</a>, enter my registration number which is <strong>120922</strong> and your credit card details. Or you can sponsor me by cheque made payable to &#8220;The Prostate Cancer Charity&#8221; clearly marking the donation as being for my Registration Number: <strong>120922</strong>. Please mail cheques to: The Prostate Cancer Charity, ATT: <span class="nfakPe">Movember</span>, First Floor, Cambridge House, 100 Cambridge Grove, Hammersmith, London W6 0LE.</p>
<p>All donations are made directly to The Prostate Cancer Charity which will use the money to fund high quality research into the causes, treatment and impact of prostate cancer and to provide support and information to men and their families.</p>
<p><span class="nfakPe">Movember</span> culminates at the end of the month at the Gala Partés. These glamorous and groomed events will see Tom Selleck and Borat look-a-likes battle it out for their chance to take home the prestigious Man of <span class="nfakPe">Movember</span> title.  If you would like to be part of this great night you&#8217;ll need to purchase a <a href="http://www.movember.com//uk/galatickets/index.php" target="_blank">Gala Parté ticket</a>.<br />
Thanks for your support</p>
<p>Stefano</p>
<p><a href="http://www.movember.com/uk/donate/donate-details.php?action=showrego&amp;rego=120922&amp;country=uk"></a></p>
<p style="text-align:center;"><a href="http://www.movember.com/uk/donate/donate-details.php?action=showrego&amp;rego=120922&amp;country=uk"><img src="http://static-live.movember.com/assets/images/members/widgets/widget_black_final.png" alt="Movember - Sponsor Me" /></a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;submitHeadline=MOvember+continues&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;title=MOvember+continues" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;title=MOvember+continues" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;title=MOvember+continues" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;bm_description=MOvember+continues" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;T=MOvember+continues" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;title=MOvember+continues" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;title=MOvember+continues" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+MOvember+continues+@+http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fmovember-continues%2F&amp;t=MOvember+continues" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2007/11/movember-continues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NFS and Eclipse on Leopard</title>
		<link>http://sapessi.com/2007/11/nfs-and-eclipse-on-leopard/</link>
		<comments>http://sapessi.com/2007/11/nfs-and-eclipse-on-leopard/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 13:45:25 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[General Babbling]]></category>
		<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://thebigdeal.wordpress.com/2007/11/13/nfs-and-eclipse-on-leopard/</guid>
		<description><![CDATA[After updating to Mac OS X Leopard I started experiencing some annoying lags and delays with my NFS mounts. What happened was that Eclipse kept crashing whenever I tried to open a file from a project folder mounted with NFS. After a quick search on Google I realized that I wasn&#8217;t going to get any [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After updating to Mac OS X <a href="http://www.apple.com/macosx/" title="Leopard Page" target="_blank">Leopard</a> I started experiencing some annoying lags and delays with my <a href="http://nfs.sourceforge.net" title="NFS Home page" target="_blank">NFS</a> mounts.<br />
What happened was that <a href="http://www.eclipse.org" title="Eclipse Home page" target="_blank">Eclipse</a> kept crashing whenever I tried to open a file from a project folder mounted with NFS. After a quick search on Google I realized that I wasn&#8217;t going to get <a href="http://lists.apple.com/archives/java-dev/2006/Nov/msg00219.html" title="Apple lists" target="_blank">any help on this one</a>.</p>
<p>When I updated my laptop we also moved our development environment to a new server so up until now I wasn&#8217;t entirely sure whether to blame Leopard&#8217;s NFS client or the new server&#8217;s configuration.</p>
<p>After comparing the configuration of our old and new server, which turned out to be exactly the same, I started frowning at my laptop.<br />
Leopard&#8217;s NFS client is not entirely to blame though, Eclipse IDE is equally at fault.</p>
<p>The crashes looked suspicious and definitely weren&#8217;t caused by Java since Eclipse seemed to work great with purely local projects.<br />
First thing we have to consider is that NFS handles file locking in a fairly chaotic way. This, especially with Eclipse trying to access all the files inside a project folder, might cause your mount to be extremely unstable, so much so that the entire Eclipse IDE crashes waiting for the network mount to react.</p>
<blockquote><p><em>NFS and   file locking is a peculiar issue, e.g. the Linux 2.4 NFS client   pretends to lock files but actually doesn&#8217;t, Linux 2.6 does it right,   but the implementation has some nasty side effects: locks are held   using .nfsXXX files that pollute the directories and prevent   operations on it you could do on a local fs.</em></p></blockquote>
<p>Eclipse&#8217;s problem is clearly that the network is not responding quickly enough and I could think only of 2 possible solutions. Which in the end solved my problem.</p>
<p><strong>1. Increase the maximum number of read/write operations your NFS client can perform</strong></p>
<p>This can be achieved either with the command <em>nfsiod -n &lt;number of threads&gt;</em> (deprecated in Leopard, don&#8217;t know about earlier versions of MacOS X) or by modifying NFS&#8217; configuration file in /etc/nfs.conf adding the following line &#8211; <em>nfs.client.nfsiod_thread_max=&lt;max number of threads&gt;</em>.<br />
If I remember correctly the nfsiod parameter should be set to 4 by default and even a small increase (8) should do the trick. Be careful not to play too much with this parameter or you&#8217;ll end up with an overloaded NFS client crashing you local network.</p>
<blockquote><p><em>  Going from 4 to 8 nfsiod threads resulted in write speeds going from 700k/sec to over 3.2mb/sec! </em></p></blockquote>
<p>For additional information check the <a href="http://nfs.sourceforge.net/nfs-howto/ar01s05.html" title="NFS Performance Hot-To" target="_blank">NFS Performance HOW-TO</a>.</p>
<p><strong>2. Configure your mounts either from fstab or from the command line to use local lock-files</strong></p>
<p>The option we&#8217;re looking for is <em>locallocks</em>. The main drawback here is that your server is not going to be aware of which files you are editing so I wouldn&#8217;t recommend going this way if you&#8217;re working on an heavily trafficked/edited share.<br />
To use this option in a mount command just run <em>sudo mount_nfs -o locallocks servername:folder localfolder</em>.</p>
<p>Either one of these solutions should do the trick. I have used both on my laptop since I&#8217;m the only one working on the NFS share in question and it worked like magic.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;submitHeadline=NFS+and+Eclipse+on+Leopard&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;title=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;title=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;title=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;bm_description=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;T=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;title=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;title=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+NFS+and+Eclipse+on+Leopard+@+http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fnfs-and-eclipse-on-leopard%2F&amp;t=NFS+and+Eclipse+on+Leopard" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2007/11/nfs-and-eclipse-on-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is JavaScript the enemy?</title>
		<link>http://sapessi.com/2007/11/is-javascript-the-enemy/</link>
		<comments>http://sapessi.com/2007/11/is-javascript-the-enemy/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 17:29:41 +0000</pubDate>
		<dc:creator>Stefano Buliani</dc:creator>
				<category><![CDATA[General Babbling]]></category>
		<category><![CDATA[My Works]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WWW]]></category>

		<guid isPermaLink="false">http://thebigdeal.wordpress.com/2007/11/09/is-javascript-the-enemy/</guid>
		<description><![CDATA[I have just spent an entire week writing JavaScript code. Am i feeling suicidal? Not really, at least not just yet. I know exactly how frustrating JavaScript can be, especially when you&#8217;re dynamically rewriting big chunks of you pages&#8217; HTML code. This problem is particularly evident now that your code needs to be tested thoroughly [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;source=sapessi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I have just spent an entire week writing JavaScript code. Am i feeling suicidal? Not really, at least not just yet.</p>
<p>I know exactly how frustrating JavaScript can be, especially when you&#8217;re dynamically rewriting big chunks of you pages&#8217; HTML code.<br />
This problem is particularly evident now that your code needs to be tested thoroughly with N different browser, who, obviously, behave in N completely different ways.</p>
<p>Using a framework like <a href="http://www.prototypejs.org/" title="Prototype home page" target="_blank">Prototype</a> can make your life considerably easier here, especially if you use it the right way. Because if you&#8217;re not you&#8217;ll be left with just a somewhat shorter version of <em>document.getElementById</em> without any actual benefit. You&#8217;ll still have to write tons of lines of code.</p>
<p>I  have found just this morning a couple of articles linked on <a href="http://ajaxian.com/archives/how-well-do-you-know-prototype" title="Ajaxian article" target="_blank">Ajaxian</a> discussing Prototype programming best practices. They solved most of my problems.</p>
<ul>
<li><a href="http://thinkweb2.com/projects/prototype-checklist/" title="Prototype checklist 1" target="_blank">Prototype checklist</a></li>
<li><a href="http://thinkweb2.com/projects/prototype/?p=3" title="Prototype checklist 2" target="_blank">Prototype checklist 2</a></li>
</ul>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;submitHeadline=Is+JavaScript+the+enemy%3F&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;title=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;title=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;title=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;bm_description=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;T=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;title=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;title=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Is+JavaScript+the+enemy%3F+@+http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsapessi.com%2F2007%2F11%2Fis-javascript-the-enemy%2F&amp;t=Is+JavaScript+the+enemy%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sapessi.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://sapessi.com/2007/11/is-javascript-the-enemy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

