<?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>Pedro Assunção &#187; software development</title>
	<atom:link href="http://pedroassuncao.com/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://pedroassuncao.com</link>
	<description>Thoughts on technology, skydiving, life, the universe, you know, whatever comes to mind.</description>
	<lastBuildDate>Sat, 28 Aug 2010 19:18:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Spring : inject proxy instead of proxied object</title>
		<link>http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/</link>
		<comments>http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:13:39 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=974</guid>
		<description><![CDATA[<p>Today i found a neat trick.</p> <p>Typically when you inject an AnnotationSessionFactoryBean into one of your classes you end up with a SessionFactory on the other side. This is because Spring is doing its magic inside, proxying stuff so you end up with an easy way to instantiate hibernate (...)<br/ >[<a href="http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/08/java-http-proxy-servlet-with-spring/' rel='bookmark' title='Permanent Link: Java HTTP proxy servlet (with Spring)'>Java HTTP proxy servlet (with Spring)</a></li>
<li><a href='http://pedroassuncao.com/2010/02/pair-programming/' rel='bookmark' title='Permanent Link: Pair programming'>Pair programming</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today i found a neat trick.</p>
<p>Typically when you inject an AnnotationSessionFactoryBean into one of your classes you end up with a SessionFactory on the other side. This is because Spring is doing its magic inside, proxying stuff so you end up with an easy way to instantiate hibernate sessions. The problem is that i wanted to be able to access the actual AnnotationSessionFactoryBean, so i could run the createDatabaseSchema method on it (retrieve the connection properties would be another use case).</p>
<p>So how do you inject the proxy, instead of the proxied object? You prefix the bean ref with the &#8220;&amp;&#8221; sign, like so:</p>
<pre>&lt;property name="sessionFactory" ref="&amp;sessionFactory"/&gt;</pre>
<p>If you want to do it inside, for instance, anything that extends AbstractTransactionalJUnit4SpringContextTests, you can do it like this:</p>
<pre>sessionFactoryBean = (AnnotationSessionFactoryBean) super.applicationContext.getBean("&amp;sessionFactory");</pre>
<p>Hope it helps somebody <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;t=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Spring+%3A+inject+proxy+instead+of+proxied+object+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;title=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;title=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;t=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;title=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/&amp;t=Spring+%3A+inject+proxy+instead+of+proxied+object" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/08/java-http-proxy-servlet-with-spring/' rel='bookmark' title='Permanent Link: Java HTTP proxy servlet (with Spring)'>Java HTTP proxy servlet (with Spring)</a></li>
<li><a href='http://pedroassuncao.com/2010/02/pair-programming/' rel='bookmark' title='Permanent Link: Pair programming'>Pair programming</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2010/04/spring-inject-proxy-instead-of-proxied-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sproutcore on OSX snow leopard</title>
		<link>http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/</link>
		<comments>http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 09:13:08 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=908</guid>
		<description><![CDATA[<p>It recently came to my attention the existence of this heavily-client-based web framework to develop desktop-like applications called Sproutcore and is backed up by Apple (there is another cool alternative called Capuccino). Basically it relies on Javascript to create nice desktop-like applications, but on the web.</p> <p>Ever since i (...)<br/ >[<a href="http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/01/recover-isync-after-removing-it-from-osx/' rel='bookmark' title='Permanent Link: Recover iSync after removing it from OSX'>Recover iSync after removing it from OSX</a></li>
<li><a href='http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/' rel='bookmark' title='Permanent Link: Websockets tutorial/example with pywebsocket'>Websockets tutorial/example with pywebsocket</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It recently came to my attention the existence of this heavily-client-based web framework to develop desktop-like applications called <a href="http://sproutcore.com/">Sproutcore</a> and is backed up by Apple (there is another cool alternative called <a href="http://cappuccino.org">Capuccino</a>). Basically it relies on Javascript to create nice desktop-like applications, but on the web.</p>
<p>Ever since i heard about node.js i have been curious to try out one of these things. My ideas on it will come later but, for now, here are the required steps to make Sproutcore work well on OSX snow leopard. And i say work well because if you rely on the vanilla Ruby 1.8.7 that comes with snow leopard you will have a very crappy experience with Sproutcore; It will take approximately 35 seconds to reload any webpage every time you make a code change. And that will make you not want to use it at all.</p>
<p>Fortunately a lot of people have been kind enough to explain me, on twitter, how to make it faster.</p>
<p>But let&#8217;s start from the beginning:</p>
<p><strong>1. Install Sproutcore using GEM, like so:</strong></p>
<pre>sudo gem install sproutcore</pre>
<address>Note: I don&#8217;t remember if gem comes installed with snow leopard. If not, you can always google it <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </address>
<p><strong>2. Follow the </strong><a href="http://www.sproutcore.com/get-started/"><strong>rest of the steps</strong></a><strong> to setup your first application</strong></p>
<p>By now you should have realized that (if you are using OSX snow leopard) the damn thing is freaking slow. So&#8230;</p>
<p><strong>3. &#8230;download and compile the <a href="http://www.ruby-lang.org/en/downloads/">Ruby 1.9 source</a> code for OSX</strong></p>
<pre>tar xzvf ruby-1.9.1-p376.tar.gz
cd ruby-1.9.1-p376
./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install</pre>
<address>Note: The actual version could be different, as stuff evolves over time <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </address>
<p><strong>4. Update the symbolic link on your system to point to the new ruby installation</strong></p>
<pre>sudo rm /usr/bin/ruby
sudo ln -s /usr/local/bin/ruby /usr/bin/ruby</pre>
<p><strong>5. Make sure the correct Ruby version is in use</strong></p>
<pre>ruby --version</pre>
<p>Should return something like this:</p>
<pre>ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.3.0]</pre>
<p><strong>6. Install thin. This server is faster than the one that comes with Sproutcore</strong></p>
<pre>sudo gem install thin</pre>
<p><strong>7. All done. Give it a try again</strong></p>
<p>If you try to refresh the page of a Sproutcore example now you will notice the speed difference, like night to day. Have fun coding client-side desktop web applications <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m planning to also take a look at <a href="http://cappuccino.org">Capuccino</a>, another similar framework, but created in Objective-J &#8211; a derivative of Objective-C for javascript. Looks interesting and it might get me into iPhone development at last <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;t=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Sproutcore+on+OSX+snow+leopard+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;title=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;title=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;t=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;title=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/&amp;t=Sproutcore+on+OSX+snow+leopard" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/01/recover-isync-after-removing-it-from-osx/' rel='bookmark' title='Permanent Link: Recover iSync after removing it from OSX'>Recover iSync after removing it from OSX</a></li>
<li><a href='http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/' rel='bookmark' title='Permanent Link: Websockets tutorial/example with pywebsocket'>Websockets tutorial/example with pywebsocket</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2010/04/sproutcore-on-osx-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Software does not evolve; software degenerates</title>
		<link>http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/</link>
		<comments>http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:28:37 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[complaints]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[observations]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=900</guid>
		<description><![CDATA[<p>Today at lunch i felt taken by this concept once again. A long time ago it came to me that software, au contraire of living beings, does not evolve; the best description for it, in my not-so-humble opinion, is of a big tower of LEGOs building blocks: You start (...)<br/ >[<a href="http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/remote-software-developers/' rel='bookmark' title='Permanent Link: Remote software developers'>Remote software developers</a></li>
<li><a href='http://pedroassuncao.com/2008/07/internet-heaven-according-to-marcus/' rel='bookmark' title='Permanent Link: Internet heaven, according to Marcus'>Internet heaven, according to Marcus</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today at lunch i felt taken by this concept once again. A long time ago it came to me that software, au contraire of living beings, does not evolve; the best description for it, in my not-so-humble opinion, is of a big tower of LEGOs building blocks: You start stacking them up and, when a certain amount of time passes, you end up with something that is no longer very stable at the base. It degenerates and &#8211; in time &#8211; you have to kill it.</p>
<p>Every good developer knows this simple fact: requirements change. They do, there is no point in denying it. And continuing to build on top of a base that was thought for one thing and now needs to do another one is just plain crazy, inevitably. The problem here is that, i believe, non-technical people still think that software is a living thing that keeps evolving and that, no matter what you come up with next, there will always be a way to make it do &#8220;just that one more thing that we need&#8221;.</p>
<p>So my question is: What is the best way to convince non-technical people that software needs to be killed or heavily re-factored from times to times in order for things to be maintainable and faster to build upon? I can&#8217;t help thinking about &#8220;Bruce Almighty&#8221;s quote when i ask myself the same question: &#8220;(BRUCE) So how do you make people love you without affecting free will? (GOD) Welcome to my world, son. If you come up with an answer to that one you let me know!&#8221;.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;t=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Software+does+not+evolve%3B+software+degenerates+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;title=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;title=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;t=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;title=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/&amp;t=Software+does+not+evolve%3B+software+degenerates" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/remote-software-developers/' rel='bookmark' title='Permanent Link: Remote software developers'>Remote software developers</a></li>
<li><a href='http://pedroassuncao.com/2008/07/internet-heaven-according-to-marcus/' rel='bookmark' title='Permanent Link: Internet heaven, according to Marcus'>Internet heaven, according to Marcus</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2010/03/software-does-not-evolve-software-degenerates/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Bomb This Country</title>
		<link>http://pedroassuncao.com/2010/02/bomb-this-country/</link>
		<comments>http://pedroassuncao.com/2010/02/bomb-this-country/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 08:08:15 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://diffract.me/2010/02/bomb-this-country/</guid>
		<description><![CDATA[ After an awesome Japanese dinner with my good friend Luizzz , we came to the conclusion that the website that was missing was one where you could bomb any country in the world. ... So over the course of about 8 hours - the next day - we came up with bombthiscountry.com , a meaningless website where you can bomb any country in the world (yes, China, Tibet is a country).  (...)<br/ >[<a href="http://pedroassuncao.com/2010/02/bomb-this-country/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/google-unveils-nexus-one-phone-europe-fail-though/' rel='bookmark' title='Permanent Link: Google unveils Nexus One phone. Europe fail, though.'>Google unveils Nexus One phone. Europe fail, though.</a></li>
<li><a href='http://pedroassuncao.com/2009/12/reddit-developers-please-fix-this/' rel='bookmark' title='Permanent Link: Reddit developers, please fix this'>Reddit developers, please fix this</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After an awesome Japanese dinner with my good friend <a href="http://twitter.com/luizsoarez">Luizzz</a>, we came to the conclusion that the website that was missing was one where you could bomb any country in the world. The motivation for this was part statistical curiosity and part plain bastardness (did i just make up another word?).</p>
<p>So over the course of about 8 hours &#8211; the next day &#8211; we came up with <a href="http://bombthiscountry.com">bombthiscountry.com</a>, a meaningless website where you can bomb any country in the world (yes, China, Tibet is a country). If you <a href="http://twitter.com/bombthiscountry">follow it on twitter</a> you get daily statistics on the most bombed countries in the world.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;t=Bomb+This+Country" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Bomb+This+Country+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;title=Bomb+This+Country" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;title=Bomb+This+Country" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;t=Bomb+This+Country" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;title=Bomb+This+Country" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2010/02/bomb-this-country/&amp;t=Bomb+This+Country" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/google-unveils-nexus-one-phone-europe-fail-though/' rel='bookmark' title='Permanent Link: Google unveils Nexus One phone. Europe fail, though.'>Google unveils Nexus One phone. Europe fail, though.</a></li>
<li><a href='http://pedroassuncao.com/2009/12/reddit-developers-please-fix-this/' rel='bookmark' title='Permanent Link: Reddit developers, please fix this'>Reddit developers, please fix this</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2010/02/bomb-this-country/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pair programming</title>
		<link>http://pedroassuncao.com/2010/02/pair-programming/</link>
		<comments>http://pedroassuncao.com/2010/02/pair-programming/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 08:42:57 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=722</guid>
		<description><![CDATA[<p>I recently came across an article entitled &#8220;Pair programming works&#8220;. To be honest, the first thing that crossed my mind was that this would be a cartoon mocking the concept.</p> <p>Fortunately, i was wrong as the article gives very compelling arguments on why &#8220;Pair programming&#8221; has a lot of (...)<br/ >[<a href="http://pedroassuncao.com/2010/02/pair-programming/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/07/wordpress-publish_post-is-also-triggered-on-subsequent-post-editions/' rel='bookmark' title='Permanent Link: WordPress: &#8216;publish_post&#8217; is also triggered on subsequent post editions'>WordPress: &#8216;publish_post&#8217; is also triggered on subsequent post editions</a></li>
<li><a href='http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/' rel='bookmark' title='Permanent Link: New programming language (GO) and new mobile OS (Bada)'>New programming language (GO) and new mobile OS (Bada)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently came across an article entitled &#8220;<a href="http://www.infoq.com/news/2010/01/how-pair-programming-works">Pair programming works</a>&#8220;. To be honest, the first thing that crossed my mind was that this would be a cartoon mocking the concept.</p>
<p>Fortunately, i was wrong as the article gives very compelling arguments on why &#8220;Pair programming&#8221; has a lot of benefits, both to the employer as well as the employees that are involved. Some of them include:</p>
<ul>
<li><strong>People talk while pair programming</strong>. And that really helps when you get stuck in some problem. It&#8217;s basically that effect you get when you describe your problem to another person and suddenly the solution hits you. By talking, you get out of it faster.</li>
<li><strong>You notice more details</strong>. Two pairs of eyes are better than one and, since people usually think differently, two people will be able to pick up different types of details, which will make them much more effective at writing quality code than just one person.</li>
<li><strong>Helps you understand who in your team is an expert on which areas</strong>. And as you go along pair programming with others you too will find out in which areas you are best.</li>
</ul>
<p>If you have the time, give it a reading.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2010/02/pair-programming/&amp;t=Pair+programming" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Pair+programming+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2010/02/pair-programming/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2010/02/pair-programming/&amp;title=Pair+programming" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2010/02/pair-programming/&amp;title=Pair+programming" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2010/02/pair-programming/&amp;t=Pair+programming" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2010/02/pair-programming/&amp;title=Pair+programming" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2010/02/pair-programming/&amp;t=Pair+programming" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/07/wordpress-publish_post-is-also-triggered-on-subsequent-post-editions/' rel='bookmark' title='Permanent Link: WordPress: &#8216;publish_post&#8217; is also triggered on subsequent post editions'>WordPress: &#8216;publish_post&#8217; is also triggered on subsequent post editions</a></li>
<li><a href='http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/' rel='bookmark' title='Permanent Link: New programming language (GO) and new mobile OS (Bada)'>New programming language (GO) and new mobile OS (Bada)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2010/02/pair-programming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Websockets tutorial/example with pywebsocket</title>
		<link>http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/</link>
		<comments>http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 12:37:24 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[code snipplets]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=634</guid>
		<description><![CDATA[<p>As everyone already knows, Google Chrome now supports websockets. In essence, this allows you to keep a connection open with a webserver indefinitely (analogous to typical sockets) and send data bi-directionally. Unfortunately Chrome is the only browser currently supporting this, but I&#8217;m pretty sure this will change.</p> <p>So I (...)<br/ >[<a href="http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/my-small-pywebsocket-tutorial/' rel='bookmark' title='Permanent Link: My small pywebsocket tutorial &#8230;'>My small pywebsocket tutorial &#8230;</a></li>
<li><a href='http://pedroassuncao.com/2009/10/fabric-for-remote-deployment/' rel='bookmark' title='Permanent Link: Fabric for remote deployment'>Fabric for remote deployment</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As everyone already knows, <a href="http://www.google.com/chrome">Google Chrome</a> now supports <a href="http://dev.w3.org/html5/websockets/#websocket">websockets</a>. In essence, this allows you to keep a connection open with a webserver indefinitely (analogous to typical sockets) and send data bi-directionally. Unfortunately Chrome is the only browser currently supporting this, but I&#8217;m pretty sure this will change.</p>
<p>So I decided to give this a try and experiment a bit with it. This is my step by step process on getting a web page opening a websocket to a server and receiving the server&#8217;s date and time every second. It is based on an <a href="http://armstrongonsoftware.blogspot.com/2009/12/comet-is-dead-long-live-websockets.html">article by Joe Armstrong</a>, though he uses <a href="http://ftp.sunet.se/pub/lang/erlang/">Erlang</a> for the server, while I decided to follow the easy road and use <a href="http://code.google.com/p/pywebsocket/">Google&#8217;s pywebsocket</a> &#8211; an apache module (uses mod_python) that allows you to create handlers for websocket connections in a easy-to-use fashion. The code also contains a way to start a standalone server (i.e. not requiring apache) for testing purposes.</p>
<p>So here are the steps I took to get this working:</p>
<h4>1. Create a web page</h4>
<p>This is the code I borrowed from Joe, though slightly modified to fit my purposes (it requires <a href="http://jquery.com/">jquery</a>, by the way):</p>
<pre>&lt;html&gt;

&lt;head&gt;

&lt;script src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;
&lt;script&gt;

$(document).ready(function(){

var ws;

if ("WebSocket" in window) {
debug("Horray you have web sockets. Trying to connect...");
ws = new WebSocket("ws://localhost:9998/echo");

ws.onopen = function() {
// Web Socket is connected. You can send data by send() method.
debug("connected...");
ws.send("hello from the browser");
ws.send("more from browser");
};

run = function() {
var val=$("#i1").val(); // read the entry
$("#i1").val("");       // and clear it
ws.send(val);           // tell erlang
return true;            // must do this
};

ws.onmessage = function (evt)
{
//alert(evt.data);
var data = evt.data;
var i = data.indexOf("!");
var tag = data.slice(0,i);
var val = data.slice(i+1);
$("#" + tag).html(val);
};

ws.onclose = function()
{
debug(" socket closed");
};
} else {
alert("You have no web sockets");
};

function debug(str){
$("#debug").append("&lt;p&gt;" +  str);
};

});
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;h1&gt;Interaction experiment&lt;/h1&gt;

&lt;h2&gt;Debug&lt;/h2&gt;
&lt;div id="debug"&gt;&lt;/div&gt;

&lt;fieldset&gt;
&lt;legend&gt;Clock&lt;/legend&gt;
&lt;div id="clock"&gt;I am a clock&lt;/div&gt;
&lt;/fieldset&gt;

&lt;/body&gt;

&lt;/html&gt;</pre>
<h4>2. Download and install pywebsocket</h4>
<p>Checkout the code with</p>
<pre><span>svn checkout http</span><span>:</span><span>//pywebsocket.googlecode.com/svn/trunk/ pywebsocket-read-only
</span></pre>
<p>Then do <strong>python setup.py build</strong> and <strong>sudo python setup.py install</strong> inside the <strong>src</strong> folder. This will install it into your python environment.</p>
<h4>3. Being lazy, means we will change an example handler</h4>
<p>The way pywebsocket works is delegating the connections to something they call handlers. In the <strong><span>pywebsocket-read-only/src/example</span></strong><span> folder you will find a file named <strong>echo_wsh.py</strong>. They have this convention where handlers are named <strong>&lt;entry_point&gt;_wsh.py</strong>. This means that when you later call (from your web page) the url <strong>http://localhost:9998/echo</strong> the server will delegate the processing of that connection to that file.</span></p>
<p><span>I modified that file to something like this:</span></p>
<pre># Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from mod_pywebsocket import msgutil
from datetime import datetime
import time

_GOODBYE_MESSAGE = 'Goodbye'

def web_socket_do_extra_handshake(request):
 print 'Connected.'
 pass  # Always accept.

def web_socket_transfer_data(request):
 while True:
 time.sleep(1)
 date = datetime.now()
 #try:
 #    line = msgutil.receive_message(request)
 #except Exception, e:
 #    print 'Foi com os porcos'
 #    raise e
 #print 'Got something: %s' % line
 #msgutil.send_message(request, line)
 msgutil.send_message(request, 'clock!%s' % date)
 #if line == _GOODBYE_MESSAGE:
 #    return</pre>
<p>So basically whenever a new connection is made to this entry point, a call to <strong>web_socket_do_extra_handshake</strong> is made. After that, <strong>web_socket_transfer_data</strong> is called and it&#8217;s your responsibility to create the loop that receives messages and handles the flow (as you can see in the commented lines). I don&#8217;t care about that right now, since I only want to push the date and time to the client every second.</p>
<h4>3. Start the standalone server</h4>
<p>Go to the <strong><span>pywebsocket-read-only/src/mod_pywebsocket</span></strong> folder and run the following command:</p>
<pre>sudo python standalone.py -p 9998 -w ../example/</pre>
<p>This will start the server in port 9998 and use the handlers directory specified by the -w option. That is where our echo_wsh.py lives.</p>
<h4>4. Test it <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </h4>
<p>So now open your browser (remember, only chrome supports websockets currently) and open the html file your created in the beginning. Voilá, server&#8217;s date and time every second in the clock div.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;t=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Websockets+tutorial%2Fexample+with+pywebsocket+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;title=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;title=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;t=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;title=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/&amp;t=Websockets+tutorial%2Fexample+with+pywebsocket" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2010/01/my-small-pywebsocket-tutorial/' rel='bookmark' title='Permanent Link: My small pywebsocket tutorial &#8230;'>My small pywebsocket tutorial &#8230;</a></li>
<li><a href='http://pedroassuncao.com/2009/10/fabric-for-remote-deployment/' rel='bookmark' title='Permanent Link: Fabric for remote deployment'>Fabric for remote deployment</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2009/12/websockets-tutorialexample-with-pywebsocket/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>VLC for OSX developers needed</title>
		<link>http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/</link>
		<comments>http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 08:23:30 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[cries for help]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=632</guid>
		<description><![CDATA[<p>According to a post on their forums, there are currently 0 (zero) developers working on the OSX version of the popular video player VLC.</p> <p>If you know someone with Cocoa skills that wants a good challenge, pass the message on.</p> <p>Please do, I don&#8217;t want to lose my favorite (...)<br/ >[<a href="http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/12/reddit-developers-please-fix-this/' rel='bookmark' title='Permanent Link: Reddit developers, please fix this'>Reddit developers, please fix this</a></li>
<li><a href='http://pedroassuncao.com/2010/02/twitter-weekly-updates-for-2010-02-12/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-12'>Twitter Weekly Updates for 2010-02-12</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>According to a <a href="http://forum.videolan.org/viewtopic.php?f=12&amp;t=59905#p228791">post on their forums</a>, there are currently 0 (zero) developers working on the OSX version of the popular video player VLC.</p>
<p>If you know someone with Cocoa skills that wants a good challenge, pass the message on.</p>
<p>Please do, I don&#8217;t want to lose my favorite video player of all times <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;t=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=VLC+for+OSX+developers+needed+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;title=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;title=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;t=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;title=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/&amp;t=VLC+for+OSX+developers+needed" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/12/reddit-developers-please-fix-this/' rel='bookmark' title='Permanent Link: Reddit developers, please fix this'>Reddit developers, please fix this</a></li>
<li><a href='http://pedroassuncao.com/2010/02/twitter-weekly-updates-for-2010-02-12/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-12'>Twitter Weekly Updates for 2010-02-12</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2009/12/vlc-for-osx-developers-needed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Organizing texts</title>
		<link>http://pedroassuncao.com/2009/12/organizing-texts/</link>
		<comments>http://pedroassuncao.com/2009/12/organizing-texts/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 15:35:07 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=623</guid>
		<description><![CDATA[<p>I recently took another look at all the different texts I wrote in the past and came to the conclusion that I really need a central place to handle all of that.</p> <p>Due to the fact that I don&#8217;t feel like maintaining the Java desktop application I created for (...)<br/ >[<a href="http://pedroassuncao.com/2009/12/organizing-texts/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/09/another-day-of-jumping-out-of-airplanes-d/' rel='bookmark' title='Permanent Link: Another day of jumping out of airplanes :D'>Another day of jumping out of airplanes :D</a></li>
<li><a href='http://pedroassuncao.com/2008/09/the-dogmas-of-unit-testing/' rel='bookmark' title='Permanent Link: The dogmas of unit testing'>The dogmas of unit testing</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently took another look at all the different texts I wrote in the past and came to the conclusion that I really need a central place to handle all of that.</p>
<p>Due to the fact that I don&#8217;t feel like maintaining the <a class="zem_slink" title="Java (programming language)" rel="homepage" href="http://java.sun.com">Java</a> desktop application I created for that effect, I decided to put my <a class="zem_slink" title="Django (web framework)" rel="homepage" href="http://www.djangoproject.com">Django</a> skills to good use once again and create something web based.</p>
<p>And since it&#8217;s web based, I guess there will be no harm in opening it up for other people to store their own writing, if they so wish <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>http://diffract.me:8082/</p>
<p>Peace</p>
<p>UPDATE: As suggested by <a href="http://twitter.com/shannonlucas">@shannonlucas</a>, just added a test account for everyone who wants to try it without signing up: (user <strong>test</strong>, password <strong>test</strong>)</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/a046e7ed-b5b5-4e7f-b8cc-072cc35de3cf/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=a046e7ed-b5b5-4e7f-b8cc-072cc35de3cf" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2009/12/organizing-texts/&amp;t=Organizing+texts" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Organizing+texts+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2009/12/organizing-texts/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2009/12/organizing-texts/&amp;title=Organizing+texts" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2009/12/organizing-texts/&amp;title=Organizing+texts" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2009/12/organizing-texts/&amp;t=Organizing+texts" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2009/12/organizing-texts/&amp;title=Organizing+texts" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2009/12/organizing-texts/&amp;t=Organizing+texts" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/09/another-day-of-jumping-out-of-airplanes-d/' rel='bookmark' title='Permanent Link: Another day of jumping out of airplanes :D'>Another day of jumping out of airplanes :D</a></li>
<li><a href='http://pedroassuncao.com/2008/09/the-dogmas-of-unit-testing/' rel='bookmark' title='Permanent Link: The dogmas of unit testing'>The dogmas of unit testing</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2009/12/organizing-texts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android location provider mock</title>
		<link>http://pedroassuncao.com/2009/11/android-location-provider-mock/</link>
		<comments>http://pedroassuncao.com/2009/11/android-location-provider-mock/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 15:50:42 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[code snipplets]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=578</guid>
		<description><![CDATA[<p>So, yeah, I resumed playing around with android, this time version 2.0.</p> <p>I&#8217;m really tempted to buy the new Motorola Milestone that should come out in Europe sometime between&#8230; now&#8230; and early next year, so I wanna be ready to create all the crazy stuff I have in mind (...)<br/ >[<a href="http://pedroassuncao.com/2009/11/android-location-provider-mock/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2009/01/double-clicktap-detection-on-androids-mapview/' rel='bookmark' title='Permanent Link: Double click/tap detection on android&#8217;s MapView'>Double click/tap detection on android&#8217;s MapView</a></li>
<li><a href='http://pedroassuncao.com/2009/07/ssh-login-without-password-authorized_keys/' rel='bookmark' title='Permanent Link: SSH login without password (authorized_keys)'>SSH login without password (authorized_keys)</a></li>
<li><a href='http://pedroassuncao.com/video/' rel='bookmark' title='Permanent Link: Video'>Video</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So, yeah, I resumed playing around with android, this time version 2.0.</p>
<p>I&#8217;m really tempted to buy the new <a href="http://developer.motorola.com/products/milestone/">Motorola Milestone</a> that should come out in Europe sometime between&#8230; now&#8230; and early next year, so I wanna be ready to create all the crazy stuff I have in mind for it <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One of the things I noticed was that it&#8217;s not that straightforward to provide sample GPS data. Somehow the emulator&#8217;s GPX and KMZ functionality is not working fine for me and, even if it was, I don&#8217;t want to load the file everytime (i.e. I&#8217;m lazy).</p>
<p>So, after some googling around, here&#8217;s my solution to read points from a file and feed them 1 per second to the location manager, so I can finally work with them in my app:</p>
<p>My main activity implements <strong>LocationListener</strong>, so it can be passed to the <strong>LocationManager</strong> to receive GPS events. Here&#8217;s what I do when creating my activity:</p>
<pre>public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		((TextView) this.findViewById(R.id.textView)).setText("Something else");

		// LocationManager locationManager = (LocationManager)
		// getSystemService(Context.LOCATION_SERVICE);
		// locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
		// 0, 0, this);

		LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

		String mocLocationProvider = LocationManager.GPS_PROVIDER;
		locationManager.addTestProvider(mocLocationProvider, false, false,
				false, false, true, true, true, 0, 5);
		locationManager.setTestProviderEnabled(mocLocationProvider, true);
		locationManager.requestLocationUpdates(mocLocationProvider, 0, 0, this);

		try {

			List data = new ArrayList();
			InputStream is = getAssets().open("data.txt");
			BufferedReader reader = new BufferedReader(new InputStreamReader(is));
			String line = null;
			while ((line = reader.readLine()) != null) {

				data.add(line);
			}
			Log.e(LOG_TAG, data.size() + " lines");

			new MockLocationProvider(locationManager, mocLocationProvider, data).start();

		} catch (IOException e) {

			e.printStackTrace();
		}
	}</pre>
<p>This will basically setup the test location provider and read the points into a list. Then I feed that stuff to my mock location provider (just a normal thread) that will read them 1 per second and trigger the new location back to this activity. Here&#8217;s the code for <strong>MockLocationProvider</strong>:</p>
<pre>public class MockLocationProvider extends Thread {

    private List data;

    private LocationManager locationManager;

    private String mocLocationProvider;

    private String LOG_TAG = "faren";

    public MockLocationProvider(LocationManager locationManager,
            String mocLocationProvider, List data) throws IOException {

        this.locationManager = locationManager;
        this.mocLocationProvider = mocLocationProvider;
        this.data = data;
    }

    @Override
    public void run() {

        for (String str : data) {

            try {

                Thread.sleep(1000);

            } catch (InterruptedException e) {

                e.printStackTrace();
            }

            // Set one position
            String[] parts = str.split(",");
            Double latitude = Double.valueOf(parts[0]);
            Double longitude = Double.valueOf(parts[1]);
            Double altitude = Double.valueOf(parts[2]);
            Location location = new Location(mocLocationProvider);
            location.setLatitude(latitude);
            location.setLongitude(longitude);
            location.setAltitude(altitude);

            Log.e(LOG_TAG, location.toString());

            // set the time in the location. If the time on this location
            // matches the time on the one in the previous set call, it will be
            // ignored
            location.setTime(System.currentTimeMillis());

            locationManager.setTestProviderLocation(mocLocationProvider,
                    location);
        }
    }
}</pre>
<p>Notice the <em><strong>location.setTime()</strong></em> call. Read the comment why it is necessary. Took me forever to find this one in google <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Peace and great Androiding <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;t=Android+location+provider+mock" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Android+location+provider+mock+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;title=Android+location+provider+mock" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;title=Android+location+provider+mock" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;t=Android+location+provider+mock" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;title=Android+location+provider+mock" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2009/11/android-location-provider-mock/&amp;t=Android+location+provider+mock" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2009/01/double-clicktap-detection-on-androids-mapview/' rel='bookmark' title='Permanent Link: Double click/tap detection on android&#8217;s MapView'>Double click/tap detection on android&#8217;s MapView</a></li>
<li><a href='http://pedroassuncao.com/2009/07/ssh-login-without-password-authorized_keys/' rel='bookmark' title='Permanent Link: SSH login without password (authorized_keys)'>SSH login without password (authorized_keys)</a></li>
<li><a href='http://pedroassuncao.com/video/' rel='bookmark' title='Permanent Link: Video'>Video</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2009/11/android-location-provider-mock/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>New programming language (GO) and new mobile OS (Bada)</title>
		<link>http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/</link>
		<comments>http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 08:14:14 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=559</guid>
		<description><![CDATA[<p>Wow, these have been a couple of crazy days: First Samsung announced a new operating system for mobile devices called Bada &#8211; that will compete directly with Google&#8217;s Android &#8211; and the next day Google announces the creation of a new programming language, supposedly a cross between Python and (...)<br/ >[<a href="http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/">continue reading</a>]


Related posts:<ol><li><a href='http://pedroassuncao.com/2010/02/pair-programming/' rel='bookmark' title='Permanent Link: Pair programming'>Pair programming</a></li>
<li><a href='http://pedroassuncao.com/2010/01/google-unveils-nexus-one-phone-europe-fail-though/' rel='bookmark' title='Permanent Link: Google unveils Nexus One phone. Europe fail, though.'>Google unveils Nexus One phone. Europe fail, though.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Wow, these have been a couple of crazy days: First <a href="http://www.electronista.com/articles/09/11/09/samsung.bada.to.rival.android.linux/">Samsung announced a new operating system</a> for mobile devices called <strong><a href="http://www.bada.com">Bada</a></strong> &#8211; that will compete directly with Google&#8217;s <a href="http://www.android.com/">Android</a> &#8211; and the next day Google announces the creation of a <a href="http://www.readwriteweb.com/archives/google_go_open_source_language.php">new programming language</a>, supposedly a cross between Python and C++, called <strong>Go</strong>.</p>
<p>It looks like today every company is trying to spread like a freaking octopus in every possible direction. Does this contradict the <a href="http://paulgraham.com/13sentences.html">usual startup talks</a> about focusing in a specific niche and being really good at it, or is it just that &#8211; as companies grow &#8211; the niche is no longer enough to buy ferraris for every manager? <img src='http://pedroassuncao.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-bg-caring-old">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;t=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29+-+&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;title=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;title=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-hackernews">
			<a href="http://news.ycombinator.com/submitlink?u=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;t=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Submit this to Hacker News">Submit this to Hacker News</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;title=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-myspace">
			<a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/&amp;t=New+programming+language+%28GO%29+and+new+mobile+OS+%28Bada%29" rel="nofollow" class="external" title="Post this to MySpace">Post this to MySpace</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>



<p>Related posts:<ol><li><a href='http://pedroassuncao.com/2010/02/pair-programming/' rel='bookmark' title='Permanent Link: Pair programming'>Pair programming</a></li>
<li><a href='http://pedroassuncao.com/2010/01/google-unveils-nexus-one-phone-europe-fail-though/' rel='bookmark' title='Permanent Link: Google unveils Nexus One phone. Europe fail, though.'>Google unveils Nexus One phone. Europe fail, though.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://pedroassuncao.com/2009/11/new-programming-language-go-and-new-mobile-os-bada/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
