<?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>Seb&#039;s weblog &#187; Computers</title>
	<atom:link href="http://dthg.net/blog/index.php/archives/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://dthg.net/blog</link>
	<description>Just another selfish blog...</description>
	<lastBuildDate>Sun, 22 Jan 2012 15:56:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Living on the edge</title>
		<link>http://dthg.net/blog/index.php/archives/2012/01/12/living-on-the-edge/</link>
		<comments>http://dthg.net/blog/index.php/archives/2012/01/12/living-on-the-edge/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 09:22:43 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=556</guid>
		<description><![CDATA[So, since eating one&#8217;s own dog food is probably the best way to test the usability of an application, I have published a new version of my bus schedule viewer webapp Bus de Rennes en Ligne. It looks brand new but it really is the same as it was before (I hope). So, why the [...]]]></description>
			<content:encoded><![CDATA[	<p>So, since eating one&#8217;s own dog food is probably the best way to test the usability of an application, I have published a new version of my bus schedule viewer webapp <a href="http://maps.dthg.net">Bus de Rennes en Ligne</a>. It looks brand new but it really is the same as it was before (I hope). So, why the change ? Because I&#8217;m getting ready to (hopefully) even more grand changes in the future. And because it allowed me to rewrite part of it, both interface-wise, but also regarding its guts and use more tools.</p>

	<p>So, in the following, I will give my impressions of Sass, CoffeeScript and Hogan.js.<br />
<span id="more-556"></span></p>

	<h3><a href="http://sass-lang.com/">Sass</a></h3>

	<p>As its name implies, this <span class="caps">CSS</span> extension is <span class="caps">AWESOME</span> and makes <span class="caps">CSS</span> easier to write and read, and I haven&#8217;t even used yet half the features (it&#8217;s not like I required those).</p>

	<p>It eases the writing of a hierarchy of rules and eliminates the redundancy of the rules when applying styles to deep elements. Obviously, mixins and variables allow to keep most repetition of things like colors or fonts down to the minimum.</p>

	<p>One can compare the <a href="https://github.com/stanguy/Star-GTFS/blob/master/app/assets/stylesheets/home.css.scss">new improved stylesheet</a> compared to the <a href="https://github.com/stanguy/Star-GTFS/blob/08a6a8702e7af606e932b47a6af3c45618045eb9/app/assets/stylesheets/application.css">old version</a>.</p>

	<h3><a href="http://coffeescript.org/">CoffeeScript</a></h3>

	<p>Using CoffeeScript is really a matter of taste. It enhances the Javascript experience, but it has some quirks, especially with a ruby environment in mind. For example, for a method call, if you have parameters you can omit parentheses (<em>à la</em> ruby), but without any you need them since it would otherwise think you&#8217;re using the function reference (<em>à la</em> javascript). And some shortcuts are not available (an empty jQuery object is not a false value). But having proper class support and automatic variable scope management is helpful.</p>

	<h3><a href="http://twitter.github.com/hogan.js/">Hogan.js</a></h3>

	<p>I had one big chunk of my javascript code which was building a <span class="caps">HTML</span> component from <span class="caps">JSON</span> data and I found it sometimes a bit hard to edit and modify. I had recently seen mention of a <a href="http://engineering.linkedin.com/frontend/leaving-jsps-dust-moving-linkedin-dustjs-client-side-templates">templating framework used by LinkedIn, dust.js</a> and I noted this in a corner of my mind. More recently I stumbled on Twitter&#8217;s Hogan.js templating engine. And what&#8217;s more, I also found a asset integration for rails. So I jumped in. And the result is pleasing enough to use.</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2012/01/12/living-on-the-edge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dear google reader staff (2)</title>
		<link>http://dthg.net/blog/index.php/archives/2011/12/20/dear-google-reader-staff-2/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/12/20/dear-google-reader-staff-2/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 21:29:15 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=548</guid>
		<description><![CDATA[Now that you have fixed this color issue, could you please fix the focus-on-controls misbehavior ? That would be nice, thanks!]]></description>
			<content:encoded><![CDATA[	<p>Now that you have fixed this color issue, could you please fix the focus-on-controls misbehavior ? That would be nice, thanks!</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/12/20/dear-google-reader-staff-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear google reader staff</title>
		<link>http://dthg.net/blog/index.php/archives/2011/11/29/dear-google-reader-staff/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/11/29/dear-google-reader-staff/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 09:03:13 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=546</guid>
		<description><![CDATA[Using the color yellow for the title of the current open article is a no-go. &#8216;kthxbye.]]></description>
			<content:encoded><![CDATA[	<p>Using the color yellow for the title of the current open article is a no-go. &#8216;kthxbye.</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/11/29/dear-google-reader-staff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 3.1 assets</title>
		<link>http://dthg.net/blog/index.php/archives/2011/11/29/rails-3-1-assets/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/11/29/rails-3-1-assets/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 23:32:10 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=544</guid>
		<description><![CDATA[I&#8217;m generating Javascript from some CoffeeScript that has been &#8220;generated&#8221; by some ERB, because that&#8217;s the only way to get the path to assets. .js.coffee.erb ? What is wrong with you, people ?]]></description>
			<content:encoded><![CDATA[	<p>I&#8217;m generating Javascript from some CoffeeScript that has been &#8220;generated&#8221; by some <span class="caps">ERB</span>, because that&#8217;s the only way to get the path to assets. .js.coffee.erb ? What is wrong with you, people ?</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/11/29/rails-3-1-assets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading excel files in ruby: FAIL.</title>
		<link>http://dthg.net/blog/index.php/archives/2011/05/30/reading-excel-files-in-ruby-fail/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/05/30/reading-excel-files-in-ruby-fail/#comments</comments>
		<pubDate>Mon, 30 May 2011 11:51:26 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=537</guid>
		<description><![CDATA[So, I was given a set of Excel files that I need to transform in some way or the other. Given the target use, I want to write the script that will handle this in Ruby, but it fails in so many ways: Parseexcel: Not sure if it is still maintained. Reads data sort of [...]]]></description>
			<content:encoded><![CDATA[	<p>So, I was given a set of Excel files that I need to transform in some way or the other. Given the target use, I want to write the script that will handle this in Ruby, but it fails in so many ways:</p>

	<ul>
		<li>Parseexcel: Not sure if it is still maintained. Reads data sort of ok while looping rows with an iterator but not in random-access mode;</li>
		<li>Roo: More pain than anything just to get is installed. Didn&#8217;t even bothered to try to make it work to access the data;</li>
	</ul>
	<ul>
		<li>Jruby-poi: Apparently, the formulas that I need are not correctly (if at all) handled by this one.</li>
	</ul>

	<p>Ok, thanks everyone, I think I&#8217;ll go back to <span class="caps">CSV</span> parsing.</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/05/30/reading-excel-files-in-ruby-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Rennes OpenData API</title>
		<link>http://dthg.net/blog/index.php/archives/2011/04/28/using-the-rennes-opendata-api/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/04/28/using-the-rennes-opendata-api/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 10:07:44 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=534</guid>
		<description><![CDATA[A few months ago, I made a small javascript page that allowed people to test the API provided by Rennes Métropole in their OpenData initiative. It only allowed using their API regarding the &#8220;Vivre à Rennes&#8221; data set and was mostly helpful if you had a firebug/web inspector kind of tool in your browser to [...]]]></description>
			<content:encoded><![CDATA[	<p>A few months ago, I made a small javascript page that allowed people to test the <span class="caps">API</span> provided by Rennes Métropole in their OpenData initiative. It only allowed using their <span class="caps">API</span> regarding the &#8220;Vivre à Rennes&#8221; data set and was mostly helpful if you had a firebug/web inspector kind of tool in your browser to maybe check the URLs generated and the raw results.</p>

	<p>I rewrote entirely the javascript and display to look (and somehow act) like <a href="https://code.google.com/apis/explorer/">Google&#8217;s <span class="caps">API</span> explorer</a>, with the main difference with the previous version being the ability to switch between APIs (for example, the bikes/alerts <span class="caps">API</span>) and versions. It also display the <em>raw</em> response (currently only <span class="caps">JSON</span>) (and the <span class="caps">HTTP</span> result code, but it&#8217;s not like it would help much anyway, heh!).</p>

	<p>But it is still work in progress: the listed <span class="caps">API</span> are not complete, it does not handle parameters of parameters (but only a single level of parameters, which can be confusing at times), it would be nice to have a user-friendly key storage mechanism and the overall display could be better.</p>

	<p><a href="http://dthg.net/rennes-opendata/">Rennes OpenData <span class="caps">API</span> explorer</a></p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/04/28/using-the-rennes-opendata-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>deleting a file on S3 using Fog</title>
		<link>http://dthg.net/blog/index.php/archives/2011/04/11/deleting-a-file-on-s3-using-fog/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/04/11/deleting-a-file-on-s3-using-fog/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 11:05:21 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=527</guid>
		<description><![CDATA[Because I could not find a proper example of such a simple task, I&#8217;m writing a small reminder. So, using Amazon web services to store files (S3), you have a file there that you want to delete programmatically in Ruby. A solution is to use fog which is a library to handle various tasks in [...]]]></description>
			<content:encoded><![CDATA[	<p>Because I could not find a proper example of such a simple task, I&#8217;m writing a small reminder. So, using Amazon web services to store files (S3), you have a file there that you want to delete programmatically in Ruby. A solution is to use <a href="https://github.com/geemus/fog">fog</a> which is a library to handle various tasks in the cloud with different providers. </p>

	<p>First, you need to create a connection to the web services, by passing credentials to the constructor:</p>

	<p><pre class="brush: ruby; title: ; notranslate">
storage = Fog::Storage.new( :provider =&gt; 'AWS',
                        :aws_access_key_id =&gt; your_key_id, 
                        :aws_secret_access_key =&gt; your_secret_key,
                        :region =&gt; your_region )
</pre></p>

	<p>The region is not mandatory but may help performances (and keeping warnings away).<br />
Once you&#8217;re connected, you need to get the directories stored in your bucket:<br />
<pre class="brush: ruby; title: ; notranslate">
directory = storage.directories.get( your_bucket )
</pre></p>

	<p>If the bucket does not exist of for some other reason the directory might be <code>nil</code>, so obviously you have to check for that. Now, you have to get a reference to the file in the directories and then you will be able to destroy it:<br />
<pre class="brush: ruby; title: ; notranslate">
remote_file = directory.files.get( your_path )
remote_file.destroy
</pre></p>

	<p>Be aware that the path must not include a leading slash (as one could get by splitting a S3 <span class="caps">URL</span> and using the path component).</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/04/11/deleting-a-file-on-s3-using-fog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The cat is out of the bag</title>
		<link>http://dthg.net/blog/index.php/archives/2011/01/05/the-cat-is-out-of-the-bag/</link>
		<comments>http://dthg.net/blog/index.php/archives/2011/01/05/the-cat-is-out-of-the-bag/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:36:20 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=490</guid>
		<description><![CDATA[It has been a bit more than three years, working on it on and off, that I started thinking about having the ability to consult the local bus schedule from a mobile device (at the time, a J2ME mobile). Starting from there, I worked a bit with google maps, scrapping web sites and so on. [...]]]></description>
			<content:encoded><![CDATA[	<p>It has been a bit more than three years, working on it on and off, that I started thinking about having the ability to consult the local bus schedule from a mobile device (at the time, a J2ME mobile). Starting from there, I worked a bit with google maps, scrapping web sites and so on. About a bit more than a year ago, I had a small working webapp allowing to edit and display bus stop positions. But last year, the city of Rennes (where I live) decided to publish all kind of data in an open way. First it was the bike leasing program, but by Fall, it was <span class="caps">GIS</span> and associative life data and&#8230; bus data. </p>

	<p>In <a href="https://github.com/stanguy/Star-GTFS/commit/9f031b760e4ea90ba7b05d094d86da77d370c643">early december</a>, I decide to scrap my existing webapp to use those official data. I had soon a new working web app that I was able to share with others as <a href="http://maps.dthg.net">Carte et horaires des bus de Rennes</a>. It did a few enhancements and features that look and feel nice, but I was still not reaching my three year old goal. So, instead of J2ME I settled on ObjC and I targeted my iPod Touch as device of choice, with the additional difficulty that not being a mobile phone, I could not rely on an Internet access.</p>

	<p>By mid-december, I had a small application reading a SQLite database and displaying the name of lines, that I wrote while traveling by train. On the 28th, I had a semi-working application that I could <a href="http://www.youtube.com/watch?v=nzzKZEHUfc4">hint in a youtube video</a>, and one day later, I stole the grid display from another bus schedule application <a href="http://www.openmbta.org/">OpenMBTA</a> and I was submitting my application on Apple&#8217;s appstore (&#8220;Release early, release often&#8230;&#8221;) and it was published Yesterday as <a href="http://itunes.apple.com/fr/app/bus-de-rennes-en-poche/id412512682?mt=8">Bus de Rennes en poche</a>. Look, Ma&#8217;, I&#8217;m an iPhone developer! Sure, it is just a really basic version, but I&#8217;ll soon release an enhanced version, and so on.</p>

	<p>Of course, both the <a href="http://github.com/stanguy/Star-GTFS/">web</a> and <a href="http://github.com/stanguy/SimpleDeathStar/">iPhone</a> application are Open Source. </p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2011/01/05/the-cat-is-out-of-the-bag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git at Breizhjug</title>
		<link>http://dthg.net/blog/index.php/archives/2010/11/22/git-at-breizhjug/</link>
		<comments>http://dthg.net/blog/index.php/archives/2010/11/22/git-at-breizhjug/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 20:43:53 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=477</guid>
		<description><![CDATA[Earlier tonight, I went to a conference about Git given at the local JUG and I have to say that I do not fully agree with this presentation. One of the point was that the Build Manager role is over and that people having this kind of job should start to look for something different [...]]]></description>
			<content:encoded><![CDATA[	<p>Earlier tonight, I went to a conference about Git given at the local <a href="http://en.wikipedia.org/wiki/Java_User_Group"><span class="caps">JUG</span></a> and I have to say that I do not fully agree with this presentation. One of the point was that the <em>Build Manager</em> role is over and that people having this kind of job should start to look for something different and all power to the developers. Maybe I have a different understanding of what a <em>Build Manager</em> is entitled to. To me, it is the management of branches, releases, build process and the overall good wealth of a software repository. And in my opinion, unlike what was said, I think Git is a great push and revival of the <em>Build Manager</em> and Integration role. Notwithstanding the fact that the usage pattern he described, a central repository with almost no branching, is, I think, very un-git-y.</p>

	<p>Think about it. What is the main example of Git usage? The Linux kernel. What is the role of Linus Torvalds? Build Manager. He doesn&#8217;t code a line (almost) but just get patches from others to integrate them in the official tree. What is the other main usage of Git? <a href="http://github.com">Github</a>: You can create (or fork) a project, have people develop features and create pull requests that you integrate if you wish to, picking whatever suits you.</p>

	<p>Git (and other <span class="caps">DCVS</span> probably) is the best Build/Integration Manager tool: Developers can work however they want on their own repository and be empowered by fast versioning tools while a central role can coordinate and pick whatever features are available, in order to have the best resulting software (and eliminating the risk of a developer committing and pushing everything (for backup reasons) to the master server on a friday night, including unfinished and/or broken features).</p>

	<p>Having a central repository where everybody pushes features without any control is just a bastardized (un) distributed revision control. </p>

	<p>Compared to my real life usage of <span class="caps">SVN</span> in an enterprisey usage, the main selling point of Git (and probably other <span class="caps">DCVS</span>) is the ability to have local branches at a nearly zero cost (for either creation or switching), not only for a feature-branching workflow but simply to have at hand the various points of the life of a software (development version, latest/current release, maintenance releases&#8230;).<br />
<span id="more-477"></span><br />
Add to that his stance regarding the DevOps movement and against system administrators, and people knowing me will understand why I hardly agree with him.</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2010/11/22/git-at-breizhjug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing views with RSpec 2 and Rails 3</title>
		<link>http://dthg.net/blog/index.php/archives/2010/11/14/testing-views-with-rspec-2-and-rails-3/</link>
		<comments>http://dthg.net/blog/index.php/archives/2010/11/14/testing-views-with-rspec-2-and-rails-3/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 22:10:18 +0000</pubDate>
		<dc:creator>Sebastien Tanguy</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dthg.net/blog/?p=474</guid>
		<description><![CDATA[I have been using RSpec 2 with Ruby on Rails 3 recently and I had a bit of a hard time understanding how to test views with it since it changed a bit between versions (as opposed to model/controller testing) and the older ways are still the one most documented, so I thought I would [...]]]></description>
			<content:encoded><![CDATA[	<p>I have been using RSpec 2 with Ruby on Rails 3 recently and I had a bit of a hard time understanding how to test views with it since it changed a bit between versions (as opposed to model/controller testing) and the older ways are still the one most documented, so I thought I would write down a small self reminder.</p>

	<p>First, care has to be taken of what code generators may produce. It is especially important if using controllers in modules. To test views with RSpec 2, the top most <code>describe</code> must use the path of the file. Unfortunately, some generators with modules will generate a rspec path of <code>module_controller/view.html.erb</code> instead of the correct <code>module/controller/view.html.erb</code>. </p>

	<p>Before rendering a view, one can set the values it uses by using <code>assign</code> as either a function call or a hash. The rendering itself is done by simply calling <code>render</code> and the tests of the view can be applied, not on a <code>response</code> object as it is the case for the controller (or as it was the case I think with RSpec 1?) but on <code>rendered</code>. There, the main matcher to use is <code>have_selector</code> which takes a xpath expression and can use a block to do further testing on an inner <span class="caps">DOM</span> node.</p>

	<p><pre class="brush: ruby; title: ; notranslate">
it &quot;should have some tag&quot; do
  render
  rendered.should have_selector( &quot;a[class='foobar']&quot; ) do |node|
    node.first.text.should == &quot;quux&quot;
  end
end
</pre></p>

	<p>But XPath is not really the most friendly syntax and using blocks can become tiresome. There are shortcuts for testing the text content and one can in fact use <span class="caps">CSS</span> expressions as a selector:</p>

	<p><pre class="brush: ruby; title: ; notranslate">
it &quot;should have some tag&quot; do
  render
  rendered.should have_selector( &quot;a.foobar&quot;, :content =&gt; &quot;quux&quot; )
end
</pre></p>

	<p>And one can obviously use more complex <span class="caps">CSS</span> expression (<code>div.foobar #quux a</code>).</p>]]></content:encoded>
			<wfw:commentRss>http://dthg.net/blog/index.php/archives/2010/11/14/testing-views-with-rspec-2-and-rails-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

