<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Il connettivo</title>
	<atom:link href="http://ilconnettivo.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ilconnettivo.wordpress.com</link>
	<description>Discoveries and reminders</description>
	<lastBuildDate>Sat, 24 Dec 2011 22:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ilconnettivo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Il connettivo</title>
		<link>http://ilconnettivo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ilconnettivo.wordpress.com/osd.xml" title="Il connettivo" />
	<atom:link rel='hub' href='http://ilconnettivo.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Geokit and Rails3: ArgumentError and undefined method merge_conditions</title>
		<link>http://ilconnettivo.wordpress.com/2011/10/18/geokit-and-rails3-argumenterror-and-undefined-method-merge_conditions/</link>
		<comments>http://ilconnettivo.wordpress.com/2011/10/18/geokit-and-rails3-argumenterror-and-undefined-method-merge_conditions/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 22:16:32 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=96</guid>
		<description><![CDATA[I had to use Geokit in a Rails 3 application and I run into a number of problems. I was using the geokit gem so I got the undefined method merge_conditions error as soon as I used a geokit extension into a ActiveRecord method. That&#8217;s true, merge_conditions has been removed from ActiveRecord::Base version 2.3.9 and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=96&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had to use Geokit in a Rails 3 application and I run into a number of problems.</p>
<p>I was using the geokit gem so I got the <em>undefined method merge_conditions</em> error as soon as I used a geokit extension into a ActiveRecord method. That&#8217;s true, merge_conditions has been removed from ActiveRecord::Base version 2.3.9 and geokit hasn&#8217;t been updated to work around that. Somebody monkey patched merge_conditions back into it (see <a href="http://stackoverflow.com/questions/6409398/undefined-method-merge-conditions-for-geokit-rails" target="_blank">this post</a> on stackoverflow) but that&#8217;s not the right way to go with Rails 3.</p>
<p>Luckily there is a <a href="https://github.com/jlecour/geokit-rails3" target="_blank">new version</a> of the gem for Rails 3, a fork from the original gem. I tried to use it in the way I would have used the old one but I had <em>ArgumentError</em> instead of <em>undefined method merge_conditions</em>. Not a big improvement but after googling around and some trial and error I found a solution. This is the recipe:</p>
<p>Add <em>gem &#8220;geokit-rails3&#8243;</em> into the Gemfile. Do a <em>bundle install</em>.</p>
<p>Use geokit like this</p>
<pre>def index
  bounds = Geokit::Bounds.new(
             Geokit::LatLng.new(params[:swlat],
                                params[:swlng]),
             Geokit::LatLng.new(params[:nelat],
                                params[:nelng]))
  @points = MyModel.geo_scope(:bounds =&gt; bounds)
end</pre>
<p>The combination of <em>Geokit::Bounds.new</em>, <em>Geokit::LatLng.new</em> and <em>MyModel.geo_scope</em> was the solution. Passing the params directly to geo_scope didn&#8217;t work.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=96&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2011/10/18/geokit-and-rails3-argumenterror-and-undefined-method-merge_conditions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby on Rails, why foreign keys matter</title>
		<link>http://ilconnettivo.wordpress.com/2011/08/12/ruby-on-rails-why-foreign-keys-matter/</link>
		<comments>http://ilconnettivo.wordpress.com/2011/08/12/ruby-on-rails-why-foreign-keys-matter/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 13:13:33 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=89</guid>
		<description><![CDATA[Foreign keys don&#8217;t belong to the Rails way but I keep adding them to any Rails project I work in. Sometimes it&#8217;s not easy to convince the other developers that they are useful but I&#8217;ve run into an nice example yesterday, right on the first day we added foreign keys to a project. It&#8217;s a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=89&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Foreign keys don&#8217;t belong to <em>the Rails way</em> but I keep adding them to any Rails project I work in. Sometimes it&#8217;s not easy to convince the other developers that they are useful but I&#8217;ve run into an nice example yesterday, right on the first day we added foreign keys to a project.</p>
<p>It&#8217;s a project we inherited from another development team. We had two models in a N:N relationship (has_and_belongs_to_many) and a join table. We&#8217;re still learning what the code does and how it is organized so we didn&#8217;t realized that the join table has an ActiveRecord model too. Actually that&#8217;s unusual but it is also the way to go to have attributes on the relationship (Rails calls it a <em>join model</em>). Let&#8217;s say those models are Post, Author and the join table is authors_posts.</p>
<p>So, without paying attention to the real meaning of that table we grepped <em>_id</em> in the migration files and semi-automatically created a migration that added the foreign keys to all the tables. We had to inspect some tables to be sure of what we we&#8217;re doing but we didn&#8217;t pay attention to authors_posts. By the way, did I mention we are under time pressure and the previous developers didn&#8217;t properly cover the code with tests? Ok, you get the picture.</p>
<p>So, we&#8217;ve got our foreign keys. The few tests we have pass and the application keeps running. Good. That was the morning. A developer deleted a Post object  in the afternoon and got an error: the database complained that deleting a record from posts would break a foreign key in authors_posts. Strange&#8230; We started to look carefully at the code and realized that they used the authors_posts table (actually, it was named in the wrong order, posts_authors, that should have told us something was wrong) to <em>manually </em>store the association without letting ActiveRecord do it. They had <em>has_many :authors_posts</em> in the two models.</p>
<p>We spent time to fix that through all the code and the database (attribute names&#8230;). If it were not for the foreign keys:</p>
<ol>
<li>the database would be soon full of author_posts records about deleted authors and posts (remember those are not the two models we&#8217;re using)</li>
<li>we would eventually find the bug in some more painful way, with more pressure to fix it, more code to fix, more data to change</li>
</ol>
<p>Summing up, foreign keys are a kind of firewall in front of the data: you don&#8217;t run your network without a firewall, you don&#8217;t run your database without foreign keys. They catch all the bugs that escape your tests and the flaws in your design.</p>
<p>&nbsp;</p>
<p>PS: to delete a object in that kind of association follow the instructions in <a href="http://neyric.com/2007/07/08/how-to-delete-a-many-to-many-association-with-rails/">this post</a>. In short: <em>post.authors.clear</em> (which deletes the association) and <em>post.delete</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=89&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2011/08/12/ruby-on-rails-why-foreign-keys-matter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>No output from rake spec</title>
		<link>http://ilconnettivo.wordpress.com/2011/06/18/no-output-from-rake-spec/</link>
		<comments>http://ilconnettivo.wordpress.com/2011/06/18/no-output-from-rake-spec/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 14:36:35 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=84</guid>
		<description><![CDATA[I created a new Rails project, wrote some tests with rspec, run rake spec and got no output, only a single &#8220;** Invoke spec (first_time, not_needed)&#8221; line. After a lot of googling and after learning a lot of things that nevertheless didn&#8217;t solve the problem I finally found this thread with the solution: add gem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=84&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I created a new Rails project, wrote some tests with rspec, run rake spec and got no output, only a single &#8220;** Invoke spec (first_time, not_needed)&#8221; line.</p>
<p>After a lot of googling and after learning a lot of things that nevertheless didn&#8217;t solve the problem I finally found <a href="http://groups.google.com/group/rspec/browse_thread/thread/cc69a649268e6202">this thread</a> with the solution: add gem &#8220;rspec-rails&#8221; to the development group in the Gemfile.</p>
<p>I don&#8217;t why I should need the rspec gem in the development environment when rake spec runs in the test one (add &#8220;puts Rails.env&#8221; in one of your spec files and see) but that&#8217;s it. I tried to outsmart the framework and lost half an hour. I hope this will help somebody to google the solution faster!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=84&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2011/06/18/no-output-from-rake-spec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>Janrain Engage for iPhone: &#8220;Data not found&#8221; and one time tokens</title>
		<link>http://ilconnettivo.wordpress.com/2011/03/29/janrain-engage-for-iphone-data-not-found-and-one-time-tokens/</link>
		<comments>http://ilconnettivo.wordpress.com/2011/03/29/janrain-engage-for-iphone-data-not-found-and-one-time-tokens/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 13:22:03 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=77</guid>
		<description><![CDATA[Janrain Engage (formerly RPXnow) is a library for the web and for iPhone apps that lets people login into a site or app using one of their existing online accounts (facebook, google, twitter, oath, etc). We are developing an iPhone app to access a web service from mobile (can&#8217;t link it yet, sorry) and we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=77&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.janrain.com/products/engage" target="_blank">Janrain Engage</a> (formerly RPXnow) is a library for the web and for iPhone apps that lets people login into a site or app using one of their existing online accounts (facebook, google, twitter, oath, etc).</p>
<p>We are developing an iPhone app to access a web service from mobile (can&#8217;t link it yet, sorry) and we run into a problem: we always got a &#8220;Data not found&#8221; error from the Engage server no matter what we did. We checked the code of the app and of the server again and again, read the documentation, looked into the forums and got stuck over there for way too long.</p>
<p>Finally we run into <a href="http://getsatisfaction.com/janrain_iphone/topics/token_url_not_getting_called" target="_blank">this</a>:</p>
<blockquote><p>My problem is resolved just by changing<br />
One-time use auth_info tokens	 to       Disabled<br />
in Setting page in the dashboard.<br />
I&#8217;m not sure what it&#8217;s for, but at least the problem goes away.</p></blockquote>
<p>That was illuminating. We changed &#8220;One-time use auth_info tokens&#8221; to       &#8220;Disabled&#8221; in the Engage dashboard and the problem was solved for us too.</p>
<p>We contacted Engage and they acknowledged that our new setup is correct and told us that</p>
<blockquote><p>Tokens that are not &#8220;one-time use&#8221; are still short lived (10 mins)</p></blockquote>
<p>That means that there should not be big security problems. Engage said they &#8220;are in the process of updating the documentation&#8221;, so hopefully other developers will be spared from all these troubles soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=77&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2011/03/29/janrain-engage-for-iphone-data-not-found-and-one-time-tokens/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>VirtualBox 4: NAT + Bridged Networking</title>
		<link>http://ilconnettivo.wordpress.com/2011/02/20/virtualbox-4-nat-bridged-networking/</link>
		<comments>http://ilconnettivo.wordpress.com/2011/02/20/virtualbox-4-nat-bridged-networking/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 17:20:54 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=69</guid>
		<description><![CDATA[VirtualBox networking gives us several options. NAT is interesting because it protects our guest systems from the Internet but it&#8217;s annoying we need to setup port forwarding to access the guests from the host (I have servers on some guests). Bridged Networking solves that problem easily, but the guests are exposed (not acceptable) and it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=69&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>VirtualBox networking gives us several options. NAT is interesting because it protects our guest systems from the Internet but it&#8217;s annoying we need to setup port forwarding to access the guests from the host (I have servers on some guests). Bridged Networking solves that problem easily, but the guests are exposed (not acceptable) and it seems that the communication between guest and hosts is routed outside the machine: in my case the bytes go to the switch my ISP installed in my home and that&#8217;s does only 10 Mb/s. I can probably setup some manual routing to solve that problem but if I have to tinker with routing then I can get something better: the combination of both NAT and Bridged Networking.</p>
<p>My setup is:</p>
<ul>
<li>Host system: Ubuntu 10.10 with VirtualBox 4.0.4.</li>
<li>Guest systems: two headless Debian 4 and Debian 6 servers, three Windows XP clients to run tests with IE6, IE7 and IE8 (all the other browsers run directly on Ubuntu with the exception of Safari.)</li>
</ul>
<p>The desired network configuration is:</p>
<ul>
<li>The host eth0 interface must be the only access to the Internet</li>
<li>A virtual interface inside the host system should NAT the guest systems</li>
<li>The guest systems should be able to access the Internet using the internal NAT</li>
<li>The guest systems should be able to communicate with the host system using the virtual interface</li>
<li>The guest systems should be able to communicate with each other using the virtual interface</li>
</ul>
<pre>Internet &lt;--- eth0 ---&gt; HOST &lt;--- virt/if (NAT) ---+---&gt; guest 1 (server)
                   (server &amp; client)               |
                                                   +---&gt; guest 2 (server)
                                                   |
                                                   +---&gt; guest 3 (client)
                                                   |
                                                   +---&gt; ...</pre>
<p>With this configuration I can attach application servers to the address of the virtual interface and make them available to all the guest systems for testing, as well as to any application I run on the host system. I also want to access application servers on the guests so I&#8217;m going to use static addresses because I don&#8217;t want to setup a dynamic DNS for the internal network.</p>
<p>VirtualBox gives us a virtual interface called vboxnet0 which starts with the 198.162.56.1 IP address. I take advantage of that.</p>
<p>The problems to solve are</p>
<ul>
<li>Start vboxnet0 at boot time, because that address must be always available even if no guest OS is running.</li>
<li>Setup the NAT.</li>
<li>Assign addresses to the guest systems.</li>
</ul>
<p>The procedure is based on <a title="https://help.ubuntu.com/community/Internet/ConnectionSharing" href="https://help.ubuntu.com/community/Internet/ConnectionSharing" target="_blank">https://help.ubuntu.com/community/Internet/ConnectionSharing</a> but there are some differences.<br />
The most important one is that connection sharing must not be enabled with the procedure shown there because it will change the address of your eth0 after a reboot and you won&#8217;t be able to access the Internet.</p>
<p><strong>Configure the host</strong></p>
<p>First, we bring up the virtual interface</p>
<pre>sudo ifconfig vboxnet0 192.168.56.1</pre>
<p>Then we configure NAT.</p>
<pre>sudo iptables -A FORWARD -o eth0 -i vboxnet0 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE</pre>
<p style="padding-left:30px;"><strong>Update:</strong> You lose the configurations on the vboxnet0 device if to update VirtualBox to a newer release you need to remove the old one . You have two options: 1) reboot and get them back from the configuration file I&#8217;ll make you generate in the next steps of the procedure or 2) just repeat the two steps above. I tested option 2 with the upgrade from 4.0 to 4.1.</p>
<p>We want to make those changes permanent.</p>
<pre>sudo iptables-save | sudo tee /etc/iptables.sav
sudo vi /etc/rc.local</pre>
<p>We add these lines</p>
<pre>iptables-restore &lt; /etc/iptables.sav
ifconfig vboxnet0 192.168.56.1</pre>
<p>and we enable IP forwarding</p>
<pre>sudo sh -c "echo 1 &gt; /proc/sys/net/ipv4/ip_forward"
sudo vi /etc/sysctl.conf</pre>
<p>with these lines</p>
<pre># Internet connection sharing for VirtualBox VMs
# https://help.ubuntu.com/community/Internet/ConnectionSharing
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1</pre>
<p style="padding-left:30px;"><strong>Update:</strong> VirtualBox still works with that configuration after updating to Ubuntu 11.04 so you can safely chose to <em>keep</em> that file when the update process asks you whether to keep it or overwrite it with the standard one. By the way, it seems that IP forwarding is done with <em>net.ipv4.ip_forward=1</em> in 11.04 but I didn&#8217;t tried it out.</p>
<p>We can restart the networking or reboot (it&#8217;s fast).</p>
<p>netstat -r should give something like this now:</p>
<pre>Kernel IP routing table
Destination     Gateway              Genmask         Flags   MSS Window  irtt Iface
your.host.ip.addr *                  255.255.255.192 U         0 0          0 eth0
192.168.56.0      *                  255.255.255.0   U         0 0          0 vboxnet0
link-local        *                  255.255.0.0     U         0 0          0 eth0
default           your.gw.ip.addr    0.0.0.0         UG        0 0          0 eth0</pre>
<p><strong>Configure the guests</strong></p>
<p>Start VirtualBox. Change the network of every guest OS to be <em>Host Only Adapter, vboxnet0</em></p>
<p>Startup every VM in turn and change it&#8217;s network configuration.</p>
<p><em>DEBIAN</em></p>
<p>The configuration on the two Debian servers is a little complicated because they&#8217;re headless and everything must be done by command line.</p>
<pre>sudo vi /etc/dhcp/dhclient.conf</pre>
<p>Uncomment</p>
<pre>prepend domain-name-servers comma_separated_list_of_DNS_ip_addresses;</pre>
<p>Restart networking. That will update /etc/resolv.conf</p>
<pre>sudo vi /etc/network/interfaces</pre>
<p>Add a static address for eth0.</p>
<pre>allow-hotplug eth0
iface eth0 inet static
address 192.168.56.x # x is any free address in the 192.161.56 network
netmask 255.255.255.0
gateway 192.168.56.1
up route add -net 192.168.56.0 netmask 255.255.255.0 gw 192.168.56.1
down route del -net 192.168.56.0 netmask 255.255.255.0 gw 192.168.56.1</pre>
<p>Restart the networking or reboot.<br />
You should be able to ping 192.168.56.1 and access the Internet. Check it with<br />
telnet www.google.com 80<br />
From the host system you should be able to ping and ssh this server.</p>
<p><em>WINDOWS XP</em></p>
<p>The configuration on the three Windows clients is easier, about as easy as on Ubuntu</p>
<p>Click Start, Control Panel, Network Connections.<br />
Right click on the connection, Properties.<br />
Select Internet Protocol (TCP/IP), click Properties.<br />
Select Use the following IP address and enter<br />
IP address: 192.168.56.x (x = an address you didn&#8217;t use yet)<br />
Subnet mask: 255.255.255.0<br />
Default gateway: 192.168.56.1<br />
Preferred DNS server and Alternate DNS server: the addresses of the DNS of your provider.<br />
Click OK and again OK.</p>
<p>You should be able to ping 192.168.56.1 and access the Internet. Start up a browser and check it.<br />
From the host system you should be able to ping this machine.</p>
<p><strong>Epilog</strong></p>
<p>I can start my application servers on the host system and bind them to 192.168.56.1 even if VirtualBox is not started (remember to update the addresses in their configurations, probably from 127.0.0.1 to 192.168.56.1).<br />
I can access the Internet from my guest systems, which is handy for downloading updates, but the Internet cannot access them thank to the internal NAT. Too bad VirtualBox doesn&#8217;t give us this setup out of the box. The closest option is Bridged Network but the guest systems are exposed on the Internet.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=69&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2011/02/20/virtualbox-4-nat-bridged-networking/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>First Impact with the Syntax of the Erlang Language</title>
		<link>http://ilconnettivo.wordpress.com/2010/12/18/first-impact-with-the-syntax-of-the-erlang-language/</link>
		<comments>http://ilconnettivo.wordpress.com/2010/12/18/first-impact-with-the-syntax-of-the-erlang-language/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 10:41:09 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=60</guid>
		<description><![CDATA[This is a report of my first impact with the syntax of the Erlang language. I&#8217;m familiar with C, shell, Perl, Java, JavaScript and Ruby. I&#8217;m also a strong believer that languages are made for people and not for computers. They must be easy to read and to write. They must not be cluttered with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=60&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a report of my first impact with the syntax of the Erlang language.</p>
<p>I&#8217;m familiar with C, shell, Perl, Java, JavaScript and Ruby. I&#8217;m also a strong believer that languages are made for people and not for computers. They must be easy to read and to write. They must not be cluttered with signs: the noise to signal ratio must be low. Luckily this is where modern languages are heading to as they&#8217;re getting rid of braces and compilers and interpreters are using the available CPU power to understand where statement end without forcing us to tell it them with ; characters.</p>
<p>This is a &#8220;first impact&#8221; report, so I&#8217;m sure that there are lots of things I didn&#8217;t understand and I might be very wrong on some points. Nevertheless, there is only one chance of making a good first impression and I think that languages should strive for making a good one by adopting the kind of syntax that developers are demonstrating to like.</p>
<p>Here we go!</p>
<ul>
<li>All variable names in Erlang must start with an uppercase letter. It looks very old style. It tastes of BASIC interpreters of the &#8217;80s. I understand that variables are actually constants (they are &#8220;single assignment variables&#8221;) and atoms (much like Ruby&#8217;s symbols) start with a lowercase but it&#8217;s unsatisfactory.</li>
</ul>
<ul>
<li>The _ anonymous variable is good. It looks like a hack but writing this code in Perl is a waste of time</li>
</ul>
<pre style="padding-left:30px;">($skip1, $var, $skip2) = split(/ /)</pre>
<p style="padding-left:30px;">and Ruby&#8217;s</p>
<pre style="padding-left:30px;">var = str.split(/ /)[1]</pre>
<p style="padding-left:30px;">is less descriptive than Erlang&#8217;s</p>
<pre style="padding-left:30px;">(_, Var, _) = split</pre>
<ul>
<li>Ending each statement with . looks redundant. Why can&#8217;t one design a parser that understands when a statement ends? Ruby demonstrates that&#8217;s possible. Furthermore using a . is a bad choice because expressions like R = 5. (an integer) and R = 5.0. (a float) look very strange with the same character doing two different things (ok, Ruby suffers from the same problem with   5.0.to_i). It could be habit but ; is a more sensible choice for an expression terminator.</li>
</ul>
<ul>
<li>Atoms are good for the very same reason Ruby&#8217;s symbols are good. No more having to assign values to the constants which we only care about for their name. That&#8217;s the job of the compiler.</li>
</ul>
<ul>
<li>Nested tuples look like JSON, which is good. The example</li>
</ul>
<pre style="padding-left:30px;">1&gt; F = {firstName, joe}.
{firstName,joe}
2&gt; L = {lastName, armstrong}.
{lastName,armstrong}
3&gt; P = {person, F, L}.</pre>
<p style="padding-left:30px;">yields</p>
<pre style="padding-left:30px;">{person,{firstName,joe},{lastName,armstrong}}</pre>
<p style="padding-left:30px;">which is strikingly similar to</p>
<pre style="padding-left:30px;">{person: {firstName: joe , lastName: armstrong }}</pre>
<p style="padding-left:30px;">By the way</p>
<pre style="padding-left:30px;">{_,{_,Name},_} = {person,{firstName,joe},{lastName,armstrong}}</pre>
<p style="padding-left:30px;">extracts joe from the tuple.</p>
<ul>
<li>Strings as array of integers are OK as this is what they really are but the shorthand $a for the integer which represents the character a looks like a hack. How do you apply that to arbitrary characters regardless of their encoding?</li>
</ul>
<ul>
<li>The &#8211; character as in -module or -export is ridiculous. I understand the reason # for C&#8217;s #define and #include (the preprocessor) but no modern language should do that.</li>
</ul>
<ul>
<li>Having to declare the number of arguments of a function as in -export([factorial/1)] is also ridiculous. OK, there might be other functions with the same name and different number of arguments in the same module but I&#8217;m doing the job of the compiler and this is very wrong. There must be very good reasons for this choice, but this is not the way to design languages nowadays. We&#8217;ve got enough CPU and enough practice to let us write simpler code. This code</li>
</ul>
<pre style="padding-left:30px;">-module(math2).
-export([double/1]).
double(X) -&gt;
  times(X, 2).
times(X, N) -&gt;
 X * N.</pre>
<p style="padding-left:30px;">should have been</p>
<pre style="padding-left:30px;">module math
export double(X) -&gt;
  times(X, 2)
times(X, N) -&gt;
  X * N</pre>
<p style="padding-left:30px;">No -, no useless () and [], no .</p>
<ul>
<li>The -&gt;  sign is an improvement over mainstream languages. They use things like these to define methods and functions</li>
</ul>
<pre style="padding-left:30px;">function times(x, n) { ... } // JavaScript
function times($x, $n) { ... } // PHP
int times(int n, int x) { ... } // C
def times(x, n) do ... end # Ruby
public int times(int x, int n) { ... } // Java
sub times { my $x = shift; my $n = shift; ... } # Perl
times () { x = $1; n = $2; ... } # bash</pre>
<p style="padding-left:30px;">which are all more verbose than Erlang. However -&gt; could be improved. Practice demostrated that two characters combinations are worse than single characters. PHPs -&gt; is painful compared to other languages&#8217; . and Ruby is switching to JavaScript&#8217;s : from its own =&gt; sign for defining key, value pairs in hash tables.</p>
<ul>
<li>Pattern matching with atoms is good. It can be used to implement object orientation in a different and maybe more descriptive way, as in</li>
</ul>
<pre style="padding-left:30px;">area({square, Side}) -&gt;
  Side * Side;
area({rectangle, X, Y}) -&gt;
  X * Y;

1&gt; area({square, 5}).
25</pre>
<ul>
<li>Message passing to processes is extremely good. The echo demo program</li>
</ul>
<pre style="padding-left:30px;">-module(echo).
-export([start/0, loop/0]).
start() -&gt;
  spawn(echo, loop, []).
loop() -&gt;
  receive
    {From, Message} -&gt;
      From ! Message,
      loop()
    end.</pre>
<p style="padding-left:30px;">is very small and clear: From is a process, Message is the message and From ! Message sends message to the from process just after receive {From, Message} has received it from the caller process (From), which is something like this.</p>
<pre style="padding-left:30px;">import(echo).
P = echo:start().
P ! "hi there!".</pre>
<p style="padding-left:30px;">Very easy to do.</p>
<p>That was the end of my first hand on session with Erlang. It was based on the example in the freely available excerpts of Concurrent Programming in Erlang and Programming Erlang.<br />
My first impression is that the language has some very good points but lacks some polish. To be fair, Erlang first appeared in 1986, a time when developers where used to all those signs we&#8217;re looking at as clutter now. It probably looked like a terse language back then.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=60&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2010/12/18/first-impact-with-the-syntax-of-the-erlang-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>On holiday with a PC and the Internet</title>
		<link>http://ilconnettivo.wordpress.com/2010/09/25/on-holiday-with-a-pc-and-the-internet/</link>
		<comments>http://ilconnettivo.wordpress.com/2010/09/25/on-holiday-with-a-pc-and-the-internet/#comments</comments>
		<pubDate>Sat, 25 Sep 2010 09:26:55 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=58</guid>
		<description><![CDATA[I&#8217;ve spent one month on vacation in Australia and I had my netbook with me, a SSD-based eeepc 901 with eeebuntu 3. I planned to use it to check my mail, upload pictures and travel notes for my friends to see and occasionally do some urgent work for my customers (it turned out that I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=58&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent one month <a href="http://paolomontrasio.com/australia-2010/" target="_blank">on vacation in Australia</a> and I had my netbook with me, a SSD-based eeepc 901 with eeebuntu 3. I planned to use it to check my mail, upload pictures and travel notes for my friends to see and occasionally do some urgent work for my customers (it turned out that I had to). I didn&#8217;t think about bringing my main machine with me (a notebook) because it&#8217;s more than twice as large, three times as heavy and the battery time can&#8217;t even be compared: it&#8217;s 7 hours for the eeepc vs 2 hours for the notebook (when its battery was new, it&#8217;s much worse now).</p>
<p>I learned some lessons in this month on the move and I want to share them. Most of them are about keeping your data safe. That means you can keep using your pc for all the time you&#8217;re away from home, which is important: if you don&#8217;t you&#8217;ll regret that extra weight in your luggage and the things you won&#8217;t be able to do.</p>
<ol>
<li>Have a backup of all programs and data you need on a server on the Internet. If something goes very wrong you can download them and start over. I lost a program I only had on a USB stick and couldn&#8217;t reach my pc and my backup disks at home to get it again ;-)</li>
<li>Keep a local copy your mail because you&#8217;ll have to spend some time offline. Furthermore if you have local copies you won&#8217;t be forced to go online when it&#8217;s inconvenient or expensive to do it. I&#8217;m using Thunderbird and downloading every message, even from the gmail accounts I have to use for part of my work.</li>
<li>Backup everything on USB sticks or to the Internet. I was rsyncing my mail to the flash drive and pushing code to git remote repositories. I had too many photos for uploading them over the average Australian Internet connection but I had three copies of them on SD cards, the pc&#8217;s SSD and the sticks.</li>
<li>USB keys get corrupted sometimes and can&#8217;t be read anymore. You&#8217;re in trouble if you have something only there. Bring two sticks, maybe 8 GB or more. I had one and had to reformat it.</li>
<li>Internet connections can be very slow and very expensive so don&#8217;t count only on the Internet to sync and backup data. Luckily I didn&#8217;t but read more about this below.</li>
<li>Don&#8217;t plan to rely on 3G unless you know it&#8217;s available everywhere you&#8217;re planning to go. If it is, check the local data plans before you leave and buy a local data SIM card. I didn&#8217;t but I saw many people using them.</li>
<li>Encrypt your file systems just in case your pc gets stolen or lost.</li>
<li>The firewalls of some hotels let through only very few ports, sometimes only port 80. If the ssh port is open you can setup a ssh tunnel to smtp and pop servers (you need your own server on the Internet). It&#8217;s a bit painful but you can keep use your mail client. If it doesn&#8217;t, you need to use webmail until you get into a friendlier place or, if you planned in advance, you have a server on the Internet accepting ssh connections on port 80 and you tunnel over that.</li>
</ol>
<p>Internet connections and phones deserve some more thoughts.</p>
<p>In my experience Internet was slow everywhere in Polinesia (tested in 2006) but they only have  satellite links. Internet was slow everywhere in Mongolia but in the capital (2008).  Australia fares better than them but worse than anywhere in Mexico  (2005). That must be excused because bits have to go along cables under  the ocean to reach every destination outside the country. Very remote  areas such as Cape Tribulation might have incredibly slow connections  reminding me of 56k modems. Those connections tend to be very expensive, maybe even more than 1 AUD per 10 minutes. Large cities have cheap connections which sometimes approached 1 Mb/s of real bandwidth. Not much actually but very fast compared to what you can get used to. Must locations in Australia have Internet access with <a href="http://globalgossip.com/" target="_blank">Global Gossip</a>. If WIFI is slow where you&#8217;re staying find out if they have a local shop and go there.</p>
<p>Always buy a local SIM card for your phone if you can. This is not possible in every country of the world but I got mine shipped from Australia to my home after making a <a href="https://www.vipbackpackers.com/" target="_blank">VIP Backpackers</a> card. I redirected my Skype account to it using call forwarding (you must pay for that but their rates are cheap) so customers and friends could talk to me without paying anything. I also created a Skype online number with my home town area code so people not using Skype could call me at their usual rate (you pay for that too).</p>
<p>When going to Australia keep in mind that phones often don&#8217;t work outside cities, even on the highways. The country is as large as Europe or the USA and there are not many people living there (20 millions) so a complete coverage it&#8217;s not economically feasible. Combining my experience with what people told me,Telstra has the best coverage followed by Optus. Vodafone has a small network (apparently merged with the one of 3) and it&#8217;s worth using it only if you&#8217;re staying in large cities. There are some virtual operators so check which network they use.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=58&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2010/09/25/on-holiday-with-a-pc-and-the-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>CMYK jpegs and Paperclip (Ruby on Rails)</title>
		<link>http://ilconnettivo.wordpress.com/2010/04/17/cmyk-jpegs-and-paperclip-ruby-on-rails/</link>
		<comments>http://ilconnettivo.wordpress.com/2010/04/17/cmyk-jpegs-and-paperclip-ruby-on-rails/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 13:33:35 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=54</guid>
		<description><![CDATA[I just discovered that not all jpegs are made equal. There are jpegs that use the RGB colorspace and others that use the CMYK colorspace. RGB is more common and Internet Explorer can&#8217;t handle the CMYK ones: it displays the icon of a broken/unloaded image instead. Another reason to hope it soon fades away but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=54&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just discovered that not all jpegs are made equal. There are jpegs that use the RGB colorspace and others that use the CMYK colorspace. RGB is more common and Internet Explorer can&#8217;t handle the CMYK ones: it displays the icon of a broken/unloaded image instead. Another reason to hope it soon fades away but many people still use it.</p>
<p>The solution? If you&#8217;re a content producer: create RGB jpegs. If you let people upload pictures on your site: convert pictures to RGB. This is how I did it in my latest Ruby on  Rails application which uses Paperclip to handle uploads.</p>
<p>Put this code into lib/paperclip_processors/colorspace.rb (edit: that was for Paperclip 2.3.1.1, check the comments for how to fix than in newer versions)</p>
<p><pre class="brush: ruby;">
module Paperclip
  class Colorspace &lt; Thumbnail
    def transformation_command
      &quot; -colorspace RGB &quot; + super
    end
  end
end
</pre></p>
<p>Add this line to your model, as an argument of has_attached_file</p>
<p><pre class="brush: ruby;">
:processors =&gt; [:colorspace],
</pre></p>
<p>That&#8217;s it. For a discussion about CMYK images and Internet Explorer <a href="http://www.computer-aid.com.au/blog/2009/10/10/internet-explorer-wont-display-certain-images/">read this</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=54&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2010/04/17/cmyk-jpegs-and-paperclip-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>Interviewed</title>
		<link>http://ilconnettivo.wordpress.com/2010/03/29/interviewed/</link>
		<comments>http://ilconnettivo.wordpress.com/2010/03/29/interviewed/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 06:49:10 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=51</guid>
		<description><![CDATA[I&#8217;ve been quoted in an article (click here for a google translation to English) on rfid.thebizloft.com. My two quotes were about using a wiki to create project documentation with customers and technology providers and a couple of projects I&#8217;ve been working on. That&#8217;s my first time in the news :-)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=51&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been quoted in <a href="http://rfid.thebizloft.com/content/enterprise-20-strategie-multicanalit%C3%A0">an article</a> (<a href="http://translate.google.com/translate?js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;layout=1&amp;eotf=1&amp;u=http%3A%2F%2Frfid.thebizloft.com%2Fcontent%2Fenterprise-20-strategie-multicanalit%25C3%25A0&amp;sl=it&amp;tl=en">click here</a> for a google translation to English) on <a href="http://rfid.thebizloft.com/content/enterprise-20-strategie-multicanalit%C3%A0">rfid.thebizloft.com</a>. My two quotes were about using a wiki to create project documentation with customers and technology providers and a couple of projects I&#8217;ve been working on. That&#8217;s my first time in the news :-)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=51&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2010/03/29/interviewed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
		<item>
		<title>gettext puzzle: unknown type of %string, Solved</title>
		<link>http://ilconnettivo.wordpress.com/2009/07/17/gettext-puzzle-unknown-type-of-string-solved/</link>
		<comments>http://ilconnettivo.wordpress.com/2009/07/17/gettext-puzzle-unknown-type-of-string-solved/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 09:29:03 +0000</pubDate>
		<dc:creator>Paolo Montrasio</dc:creator>
				<category><![CDATA[Technology and Software]]></category>
		<category><![CDATA[gettext ruby on rails rake]]></category>

		<guid isPermaLink="false">http://ilconnettivo.wordpress.com/?p=48</guid>
		<description><![CDATA[I was running a routine rake updatepo for a Rails application of mine when suddenly I got a unknown type of %string error. The Ruby parsing routines used by gettext weren&#8217;t able to understand something that the Ruby interpreter has no problem understanding. There were no hints of the offending lines so finding what to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=48&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was running a routine <tt>rake updatepo</tt> for a Rails application of mine when suddenly I got a <tt>unknown type of %string error</tt>. The Ruby parsing routines used by gettext weren&#8217;t able to understand something that the Ruby interpreter has no problem understanding. There were no hints of the offending lines so finding what to fix in my code was a little troublesome.</p>
<p>A little digging in the error trace got me to the method <tt>identify_quotation</tt> in the file <tt>/usr/lib/ruby/1.8/irb/ruby-lex.rb</tt></p>
<p>I added these lines before <tt>RubyLex.fail SyntaxError, "unknown type of %string"</tt></p>
<pre>puts "Error parsing Ruby source."
puts "Here are the 200 characters following the error point.\n"
200.times do
  putc getc
end
puts ""</pre>
<p>Running rake again let me see the code immediately following the point where the parser failed. As it turned out the problem was the %m format argument of the calls to strtime embedded inside <tt>%()</tt> or in multi line strings. Rephrasing those strings let <tt>rake updatepo</tt> succeed.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ilconnettivo.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ilconnettivo.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ilconnettivo.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ilconnettivo.wordpress.com&amp;blog=437684&amp;post=48&amp;subd=ilconnettivo&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ilconnettivo.wordpress.com/2009/07/17/gettext-puzzle-unknown-type-of-string-solved/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7de465f222e6a9c7fe658e370d0bfe05?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">IlConnettivo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
