<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Matthias Günther</title>
  <link href="/atom.xml" rel="self" />
  <link href="/"/>
  <updated>2013-05-07T19:18:13+02:00</updated>
  <id>.html/</id>
  <author>
    <name>Matthias Günther</name>
    <email>matthias.guenther@wikimatze.de</email>
  </author>
  <rights>Copyright (c) 2013 Matthias Günther</rights>
  
    <entry>
      <title>My Talk at Ruby Midwest 2013</title>
      <link href="/my-talk-at-ruby-midwest-2013.html"/>
      <updated>2013-05-02T00:00:00+02:00</updated>
      <id>/my-talk-at-ruby-midwest-2013.html</id>
      <content type="html">&lt;p&gt;Here is a picture that explains everything I experienced at this conference:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8265/8630304575_202b9ee6dc_c.jpg&quot; title=&quot;Me and some of the speakers.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8265/8630304575_202b9ee6dc_b.jpg&quot; class=&quot;center&quot; alt=&quot;Me and some of the speakers.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I received  &lt;em&gt;love, motivation, fun, feeling that I&amp;rsquo;m doing right, passion, energy, and new ideas&lt;/em&gt;. But most importantly
I made &lt;strong&gt;new friends&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The topic of my talk: &lt;strong&gt;&amp;ldquo;We all love Open Source work and Pomodoro will help you to hack on your beloved babies in a
time-boxed way to get more done in less time.&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;Slides&lt;/h2&gt;

&lt;br&gt;


&lt;script src=&quot;http://speakerdeck.com/embed/9e6577708e71013090591231391735e3.js&quot;&gt;&lt;/script&gt;


&lt;p&gt;You can find the slides on &lt;a href=&quot;https://speakerdeck.com/wikimatze/more-time-for-open-source-work-with-the-help-of-the-pomodoro-technique&quot;&gt;speakerdeck&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Video&lt;/h2&gt;

&lt;br&gt;


&lt;iframe width=&quot;640&quot; height=&quot;360&quot; src=&quot;http://www.youtube.com/embed/249osnsUXtE&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;p&gt;You can find this video on &lt;a href=&quot;http://www.confreaks.com/videos/2380-rmw2013-more-time-for-open-source-work-with-the-help-of-the-pomodoro-technique&quot;&gt;confreaks&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Impressions&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8258/8630529711_e174eeeca1_b.jpg&quot; title=&quot;Downtown Kansas City.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8258/8630529711_e174eeeca1_c.jpg&quot; class=&quot;center&quot; alt=&quot;Downtown Kansas City.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8536/8630526389_133cd8c2b2_b.jpg&quot; title=&quot;@kobier from confreaks recording the videos.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8536/8630526389_133cd8c2b2_c.jpg&quot; class=&quot;center&quot; alt=&quot;@kobier from confreaks recording the videos.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8529/8631401824_eb3f31e26f_b.jpg&quot; title=&quot;Interesting discussions at a roof in the heart of Kansas City.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8529/8631401824_eb3f31e26f_c.jpg&quot; class=&quot;center&quot; alt=&quot;Interesting discussions at a roof in the heart of Kansas City.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8248/8630335663_57915e4f39_b.jpg&quot; title=&quot;Ruby Midwest organzisers, Steve Klabnik, Ashe Dryden, and me having lunch.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8248/8630335663_57915e4f39_c.jpg&quot; class=&quot;center&quot; alt=&quot;Ruby Midwest organzisers, Steve Klabnik, Ashe Dryden, and me having lunch.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8519/8630306649_e428baf48e_b.jpg&quot; title=&quot;Some of the Ruby Midwest speakers.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8519/8630306649_e428baf48e_c.jpg&quot; class=&quot;center&quot; alt=&quot;Some of the Ruby Midwest speakers.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8393/8631444608_e793edf348_b.jpg&quot; title=&quot;Reward for a speaker - the BBQ sauce is so delicious.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8393/8631444608_e793edf348_c.jpg&quot; class=&quot;center&quot; alt=&quot;Reward for a speaker - the BBQ sauce is so delicious.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More pictures can be found under &lt;a href=&quot;http://www.flickr.com/photos/wikimatze/sets/72157633195207226/&quot;&gt;flickr Ruby Midwest 2013&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Software: &lt;a href=&quot;https://github.com/bartaz/impress.js/&quot;&gt;impress.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Typface:

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fontsquirrel.com/fonts/FFF-Tusj&quot;&gt;FFFTusj&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.fontsquirrel.com/fonts/lobster-two&quot;&gt;Lobster Two&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://bitbucket.org/wikimatze/presentations/commits/all/tip/pomodoro-for-open-source-works&quot;&gt;Bitbucket&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Speaking at Ruby Midwest 2013</title>
      <link href="/speaking-at-ruby-midwest-2013.html"/>
      <updated>2013-02-12T00:00:00+01:00</updated>
      <id>/speaking-at-ruby-midwest-2013.html</id>
      <content type="html">&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8225/8457381969_a4ecae5eff_z.jpg&quot; title=&quot;Ruby Midwest 2013&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8225/8457381969_a4ecae5eff.jpg&quot; class=&quot;center&quot; alt=&quot;Ruby Midwest 2013&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I received notification that my talk proposal for &lt;a href=&quot;http://www.rubymidwest.com/&quot;&gt;Ruby Midwest 2013&lt;/a&gt; has been accepted.
My talk &lt;strong&gt;&amp;ldquo;More time for Open Source work with the help of the Pomodoro Technique&amp;rdquo;&lt;/strong&gt; will show you how you can do more
Open Source work besides your day job and other liabilities. I&amp;rsquo;m very excited, as this will be my first time giving a
talk at a conference.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.rubymidwest.com/&quot;&gt;Ruby Midwest 2013&lt;/a&gt; will be held in &lt;a href=&quot;http://www.kansascity.com/&quot;&gt;Kansas City&lt;/a&gt;, 5th and 6th
of April. &lt;a href=&quot;http://www.twitter.com/mfeathers&quot;&gt;Michael Feather&lt;/a&gt; and &lt;a href=&quot;http://www.twitter.com/JEG2&quot;&gt;James Edward Grey II&lt;/a&gt; are giving keynotes and I will receive the opportunity to meet them.
 If you attent the conference as well, let us get in touch.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Getting started with RSpec Puppet</title>
      <link href="/getting-started-with-rspec-puppet.html"/>
      <updated>2012-09-27T00:00:00+02:00</updated>
      <id>/getting-started-with-rspec-puppet.html</id>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;You never improve if you can't change at all.&lt;/p&gt;
  &lt;strong&gt;Tom DeMarco&lt;/strong&gt;
&lt;/blockquote&gt;


&lt;p&gt;Writing your service configuration with Puppet can be easy. But when it comes to debugging, it can be very difficult to
edit things and to find certain errors. This article presents your the basic of setting up your environment for testing
Puppet modules in a BDD way.&lt;/p&gt;

&lt;h2&gt;The tools&lt;/h2&gt;

&lt;p&gt;The &lt;a href=&quot;https://rubygems.org/gems/rspec-puppet/&quot;&gt;rspec-puppet gem&lt;/a&gt; is the
&lt;a href=&quot;http://docs.rubygems.org/read/chapter/1#page22&quot;&gt;Gem&lt;/a&gt; setup to get started. It install the &lt;code&gt;rspec-puppet-init&lt;/code&gt; command
which automatically sets up the basic settings for testing. As a text tool we want to use
&lt;a href=&quot;http://rubygems.org/gems/puppet-lint/&quot;&gt;puppet-lint&lt;/a&gt;: This tool checks your Puppet manifests against the Puppet Labs
style guide and alert you to any discrepancies =&gt; you have now your constant feedback loop when writing code.&lt;/p&gt;

&lt;p&gt;Run the following commands to install the gem:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gem install rspec-puppet
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gem install puppet-lint
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can use &lt;code&gt;puppet-lint&lt;/code&gt; in your terminal to check a puppet manifest.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;puppet-lint &amp;lt;path-to-your-manifest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s assume, we have the following puppet file:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;::&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;package&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If we run &lt;code&gt;puppet-lint&lt;/code&gt; on it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;puppet-lint manifests/init.pp
ERROR: two-space soft tabs not used on line 10
WARNING: unquoted resource title on line 10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Setting up the environment&lt;/h2&gt;

&lt;p&gt;The next step is to clone the &lt;em&gt;puppet boilerplate&lt;/em&gt; repository. It&amp;rsquo;s perfekt for creating a initial skeletton for a new
module .  After we get the code, we run a script which guides you through the process of creating a new module:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone git://github.com/bitkollektiv/puppet-boilerplate-modules.git
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./puppet-boilerplate-modules/newmodule.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Answer the questions in this dialog, that means select the module name, the template for it (&lt;em&gt;0: application-001&lt;/em&gt; is
perfect for the beginning), the location, and the author. When your are done with this, go into the directory of your
new module and perform the following cleanup commands:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rm COPYING CREDITS Modulefile NOTICE README
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rm -rf files/ templates/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The cleanup is necessary to get you focused on the basics of testing (of course documentation, README, and so on are
important but not when you are going to learn something new). Now, your file structure should look like the following.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;`-- manifests
    |-- init.pp
    |-- package.pp
    `-- params.pp
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This structure follows the &lt;strong&gt;package, config, and service&lt;/strong&gt; (okay, we have &lt;code&gt;params.pp&lt;/code&gt; instead of &lt;code&gt;service.pp&lt;/code&gt; but this
not bad because the module we create in this example isn&amp;rsquo;t a service) pattern as mentioned by R.I.Pienaar &lt;a href=&quot;http://www.devco.net/archives/2009/09/28/simple_puppet_module_structure.php&quot;&gt;blog
post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The last step is to run &lt;code&gt;rspec-puppet-init&lt;/code&gt; in the directory of your module and it will create all the files for
testing.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rspec-puppet-init
 + spec/
 + spec/classes/
 + spec/defines/
 + spec/functions/
 + spec/hosts/
 + spec/fixtures/
 + spec/fixtures/manifests/
 + spec/fixtures/modules/
 + spec/fixtures/modules/git/
 + spec/fixtures/manifests/site.pp
 + spec/fixtures/modules/git/manifests
 + spec/spec_helper.rb
 + Rakefile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And the file structure should be the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;|-- manifests
|   |-- init.pp
|   |-- package.pp
|   `-- params.pp
|-- Rakefile
`-- spec
    |-- classes
    |-- defines
    |-- fixtures
    |   |-- manifests
    |   |   `-- site.pp
    |   `-- modules
    |       `-- git
    |           `-- manifests -&amp;gt; ../../../../manifests
    |-- functions
    |-- hosts
    `-- spec_helper.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The symlinks in the &lt;code&gt;spec/&lt;/code&gt; directory are linking the manifests folder into your spec folder, so that they are in the
runpath of your specs when you run &lt;code&gt;rspec&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Testing, testing, and testing&lt;/h2&gt;

&lt;p&gt;First, we want to test that the class &lt;code&gt;git::package&lt;/code&gt; is created in &lt;code&gt;manifests/init.pp&lt;/code&gt; manifests. All we need to do is
to create a spec named &lt;code&gt;init_spec.rb&lt;/code&gt; in the &lt;code&gt;spec/classes&lt;/code&gt; directory. To make it testable, we need to define a scope
for our &lt;code&gt;init.pp&lt;/code&gt; manifest&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;git::package&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s do the test for it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/init_spec.pp&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;git::init&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git::packagee&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now it&amp;rsquo;s time to run our test: (&lt;strong&gt;Remember to run &lt;code&gt;rake spec&lt;/code&gt; always from the root directory of your module)&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &amp;lt;your-module-path&amp;gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/init_spec.rb

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::packagee&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::init
     Failure/Error: it &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; should create_class&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git::packagee&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)}&lt;/span&gt;
       expected that the catalogue would contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::packagee&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/init_spec.rb:4:in `block (2 levels) in &amp;lt;top (required)&amp;gt;&amp;#39;&lt;/span&gt;

Finished in 0.05637 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/classes/init_spec.rb:4 &lt;span class=&quot;c&quot;&gt;# git::init&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8291/7804199724_37c12fbbc0_b.jpg&quot; title=&quot;Prevention of bad code with tests.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/8291/7804199724_37c12fbbc0_z.jpg&quot; class=&quot;center&quot; alt=&quot;Prevention of bad code with tests.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Prevention of bad code with tests.&lt;/div&gt;


&lt;p&gt;Duh, it&amp;rsquo;s red, what should we do? The catalogue does not contain a class &lt;code&gt;git::packagee&lt;/code&gt;. Gosh, it&amp;rsquo;s just a typo in our
&lt;code&gt;init_spec.rb&lt;/code&gt; file. Let&amp;rsquo;s fix this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/init_spec.pp&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;git::init&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;create_class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git::package&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And run our tests again:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/init_spec.rb

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Finished in 0.03963 seconds
1 example, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It&amp;rsquo;s green and running &amp;ndash; perfect.&lt;/p&gt;

&lt;h2&gt;Testing the creation of a package with a type&lt;/h2&gt;

&lt;p&gt;Since we are now sure, that the &lt;code&gt;package&lt;/code&gt; manifests is integrated, it&amp;rsquo;s time to write a test, that we have the
&lt;code&gt;git-core&lt;/code&gt; package in our package manifests. Let&amp;rsquo;s write &lt;code&gt;spec/classes/install_spec.rb&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/package_spec.pp&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;git::package&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;install git-core&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contain_package&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git-core&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;contains_&amp;lt;resource&amp;gt;&lt;/code&gt; &lt;em&gt;matcher&lt;/em&gt; will test if the manifest contains a particular puppet resource.&lt;/p&gt;

&lt;p&gt;And run the tests again with &lt;code&gt;rake spec&lt;/code&gt; form the root directory of your module:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::package install git-core
     Failure/Error: it &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; should contain_package&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git-core&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       expected that the catalogue would contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/package_spec.rb:6:in `block (3 levels) in &amp;lt;top (required)&amp;gt;&amp;#39;&lt;/span&gt;

Finished in 0.19843 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/classes/package_spec.rb:6 &lt;span class=&quot;c&quot;&gt;# git::package install git-core&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s edit &lt;code&gt;manifests/package.pp&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/package.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;git-core&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And run the tests again:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Finished in 0.19894 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Next we want to add the &lt;strong&gt;ensure&lt;/strong&gt; attribute to the get the latest version of the &lt;code&gt;git-core package&lt;/code&gt;. Let&amp;rsquo;s write a
failing test first:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# spec/classes/package_spec.pp&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;spec_helper&amp;#39;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;describe&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;git::package&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;context&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;install git-core&amp;#39;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;it&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;should&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contain_package&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;git-core&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
         &lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;with_ensure&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;latest&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;with_*&lt;/code&gt; and &lt;code&gt;without_*&lt;/code&gt; &lt;em&gt;matcher&lt;/em&gt; can test the presence or absence of the parameter of resources. Run our tests, to
see they are failing:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; with &lt;span class=&quot;nv&quot;&gt;ensure&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;latest&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;FAILED - 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Failures:

  1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; git::package install git-core
     Failure/Error: .with_ensure&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;latest&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
       expected that the catalogue would contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; with ensure &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;latest&amp;quot;&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; but it is &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;nil&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt; in the catalogue
     &lt;span class=&quot;c&quot;&gt;# ./spec/classes/package_spec.rb:7:in `block (3 levels) in &amp;lt;top (required)&amp;gt;&amp;#39;&lt;/span&gt;

Finished in 0.19862 seconds
2 examples, 1 failure

Failed examples:

rspec ./spec/classes/package_spec.rb:6 &lt;span class=&quot;c&quot;&gt;# git::package install git-core&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Time to fix it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/package.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;package&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;git-core&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;ensure&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;latest&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If we run now our tests again, it should work:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; with &lt;span class=&quot;nv&quot;&gt;ensure&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;latest&amp;quot;&lt;/span&gt;

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Finished in 0.20456 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you have problems with understanding the syntax of RSpec, just checkout the
&lt;a href=&quot;http://pragprog.com/book/achbd/the-rspec-book&quot;&gt;&amp;ldquo;The RSpec Book&amp;rdquo;&lt;/a&gt; by David Chelimsky.&lt;/p&gt;

&lt;h2&gt;Refactor&lt;/h2&gt;

&lt;p&gt;Since we now have green tests, we can play with the code. Let&amp;rsquo;s make &lt;code&gt;manifests.init.pp&lt;/code&gt; nicer:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# manifests/init.pp&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:init&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# don&amp;#39;t like the class declaration syntax: class { &amp;#39;git::package&amp;#39;: }&lt;/span&gt;
  &lt;span class=&quot;kp&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:package&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# much better&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Run the test:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rake spec
/home/helex/.rbenv/versions/1.9.2-p320/bin/ruby -S rspec spec/classes/package_spec.rb spec/classes/init_spec.rb

git::package
  install git-core
    should contain Package&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git-core&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; with &lt;span class=&quot;nv&quot;&gt;ensure&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;latest&amp;quot;&lt;/span&gt;

git::init
  should contain Class&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;git::package&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

Finished in 0.20158 seconds
2 examples, 0 failures
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Your catalogue is still valid. Have beer because you have written your first tests for puppet and refactored your first
manifest.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Testing is important &amp;ndash; even or especially with the environment settings for your systems. It take some time to get used
to it and you will find it in the beginning very cumbersome to write the code double. But when you are writing 4000
lines of code long manifest you will be happy to have structure, and confidence in your code with ya lovely tests.&lt;/p&gt;

&lt;p&gt;Testing is good and saves your ass, especially the but of your company!&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://rspec-puppet.com/&quot;&gt;rspec-puppet page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://puppet-lint.com/&quot;&gt;puppet-lint page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bombasticmonkey.com/&quot;&gt;Tim Sharp &amp;ndash; author of rspec-puppet and puppet-lint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://docs.puppetlabs.com/puppet_core_types_cheatsheet.pdf&quot;&gt;Puppet core type cheatsheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Checking your HDD</title>
      <link href="/checking-your-hdd.html"/>
      <updated>2012-07-12T00:00:00+02:00</updated>
      <id>/checking-your-hdd.html</id>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Do one thing and do it well.&lt;/p&gt;
  &lt;strong&gt;Unix Philosophy&lt;/strong&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;em&gt;This article describes a tool for testing your HDD on a daily basis and how can you fill it completely with zeros or
random numbers to check it for broken sectors.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I was spending a whole day installing and configuring 4 different operating systems on my new Desktop PC &amp;ndash; didn&amp;rsquo;t
virtualize my Windows because I wanted to use it for gaming (especially &lt;a href=&quot;http://fallout.bethsoft.com/&quot;&gt;Fallout 3&lt;/a&gt;).
After four weeks the disasters happened: My hard disk drive was broken. Before spending a whole installing your new
systems, it is worth spending a day to check your new HDD (&lt;em&gt;Hard Disk Drive&lt;/em&gt;).&lt;/p&gt;

&lt;h2&gt;Symptoms of a breaking HDD&lt;/h2&gt;

&lt;p&gt;If you encounter any of the following things you can be sure that your HDD will break soon:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;working with Blue Screens and occasionally system fall downs&lt;/li&gt;
&lt;li&gt;problems with installing new OS &amp;ndash; even on Knoppix&lt;/li&gt;
&lt;li&gt;overwriting the harddisk completely&lt;/li&gt;
&lt;li&gt;blinking LED even if you are not working &amp;ndash; is a sign that the HDD disk is writing the content into still valid sectors&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Checking your new HDD with smartools&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Smartmontools&quot;&gt;Smartmontools&lt;/a&gt; is an analysis tool for Linux/Unix systems which allows you
to check your hard disk &amp;ndash; even on your regular usage. The program consists of two parts: &lt;code&gt;smartctl&lt;/code&gt; (checking and
evaluating HDD parameters) and &lt;code&gt;smartd&lt;/code&gt; (is daemon to check your HDD on a regularly state).&lt;/p&gt;

&lt;p&gt;Install the tool with the following command:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo apt-get install smartmontools
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Using smartctl for HDD diagnosing&lt;/h2&gt;

&lt;p&gt;To get an overview of your new HDD please perform:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo smartctl -H /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Important of the output is the parameter &lt;strong&gt;&amp;ldquo;passed&amp;rdquo;&lt;/strong&gt;, it tells you that the test is over:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;smartctl 5.41 2011-06-09 r3365 &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;i686-linux-3.2.0-23-generic&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;build&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
Copyright &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;C&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

&lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; START OF INFORMATION &lt;span class=&quot;nv&quot;&gt;SECTION&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt;
Device Model:     ST500DM002-1BD142
Serial Number:    Z2ARNP4C
LU WWN Device Id: 5 000c50 04079c23c
Firmware Version: KC45
User Capacity:    500,107,862,016 bytes &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;500 GB&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
Sector Sizes:     512 bytes logical, 4096 bytes physical
Device is:        Not in smartctl database &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;details use: -P showall&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
ATA Version is:   8
ATA Standard is:  ATA-8-ACS revision 4
Local Time is:    Thu Jul 12 06:54:59 2012 CEST
SMART support is: Available - device has SMART capability.
SMART support is: &lt;span class=&quot;nv&quot;&gt;Enabled&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; START OF READ SMART DATA &lt;span class=&quot;nv&quot;&gt;SECTION&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt;
SMART overall-health self-assessment &lt;span class=&quot;nb&quot;&gt;test &lt;/span&gt;result: PASSED

General SMART Values:
Offline data collection status:  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x82&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Offline data collection activity
          was completed without error.
          Auto Offline Data Collection: Enabled.
Self-test execution status:      &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;   0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; The previous self-test routine completed
          without error or no self-test has ever
          been run.
Total &lt;span class=&quot;nb&quot;&gt;time &lt;/span&gt;to &lt;span class=&quot;nb&quot;&gt;complete &lt;/span&gt;Offline
data collection:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;  600&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; seconds.
Offline data collection
capabilities:        &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x7b&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; SMART execute Offline immediate.
          Auto Offline data collection on/off support.
          Suspend Offline collection upon new
          command.
          Offline surface scan supported.
          Self-test supported.
          Conveyance Self-test supported.
          Selective Self-test supported.
SMART capabilities:            &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x0003&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Saves SMART data before entering
          power-saving mode.
          Supports SMART auto save timer.
Error logging capability:        &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x01&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Error logging supported.
          General Purpose Logging supported.
Short self-test routine
recommended polling &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;   1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; minutes.
Extended self-test routine
recommended polling &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;  81&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; minutes.
Conveyance self-test routine
recommended polling &lt;span class=&quot;nb&quot;&gt;time&lt;/span&gt;:    &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;   2&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; minutes.
SCT capabilities:          &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x303f&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; SCT Status supported.
          SCT Error Recovery Control supported.
          SCT Feature Control supported.
          SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   107   099   006    Pre-fail  Always       -       12627760
  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       76
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   064   060   030    Pre-fail  Always       -       2705616
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       84
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       74
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   061   049   045    Old_age   Always       -       39 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Min/Max 22/39&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
194 Temperature_Celsius     0x0022   039   051   000    Old_age   Always       -       39 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0 21 0 0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
195 Hardware_ECC_Recovered  0x001a   045   039   000    Old_age   Always       -       12627760
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       110127256436820
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       3616779477
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       1189576021

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;hours&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;  LBA_of_first_error
&lt;span class=&quot;c&quot;&gt;# 1  Conveyance offline  Completed without error       00%         2         -&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 2  Extended offline    Aborted by host               90%         2         -&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 3  Conveyance offline  Completed without error       00%         2         -&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 4  Short offline       Completed without error       00%         1         -&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 5  Extended offline    Aborted by host               40%         1         -&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# 6  Short offline       Aborted by host               80%         1         -&lt;/span&gt;

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;0x0&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;:
  After scanning selected spans, &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;NOT &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt;-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can perform longer tests of your harddisk with:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo smartctl -t long /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Depending on the size of your HDD, it takes some time. For checking a whole 500 GB the program runs about 80 minutes.&lt;/p&gt;

&lt;p&gt;It is even possible to check if your HDD has damage incurred during transporting the drive with the &lt;code&gt;conveyance&lt;/code&gt; option:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo smartctl -t conveyance /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Performing long time diagnostic with smartd&lt;/h2&gt;

&lt;p&gt;The first step is to give the daemon the permission to run checks in the background:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim /etc/default/smartmontools
&amp;gt; &lt;span class=&quot;nv&quot;&gt;start_smartd&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Find the line with and uncomment it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# uncomment to start smartd on system startup¬&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#start_smartd=yes¬&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The configuration file for the daemon can be found under &lt;code&gt;/etc/smartd.conf&lt;/code&gt;. Here only one line is sufficient to check
all HDDs:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;DEVICESCAN -m root@&amp;lt;your-os-name&amp;gt; -M &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; /usr/share/smartmontools/smartd-runner
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s get through each line step-by-step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DEVICESCAN&lt;/code&gt;: will scan all HDDs in the range between &lt;code&gt;/dev/hd[a-I] .. /dev/sd[a-z]&lt;/code&gt;, which support SMART&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-m matthias.guenther@wikimatze.de&lt;/code&gt;: in case of an error, an email will be sent to this address&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M&lt;/code&gt;: the frequency of emails departure

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-M exec&lt;/code&gt;: don&amp;rsquo;t send testmails&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M test&lt;/code&gt;: send a testmail (when using this option, you must leave out the &lt;code&gt;/usr/share/smartmontools/smartd-runner&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-M daily&lt;/code&gt;: send daily reports&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Now it&amp;rsquo;s time to test our configuration:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;smartd -q onecheck
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can check your internal mails with &lt;code&gt;$ sudo mail&lt;/code&gt; (you need install &lt;a href=&quot;http://www.postfix.org/&quot;&gt;Postfix&lt;/a&gt; on your OS)
and rebooting the daemon:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;/etc/init.d/smartmontools restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you want to have a graphical client for this tool, you need to run:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo apt-get install gsmartcontrol
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You need then to start the program in sudo mode to detect all HDDs &lt;code&gt;sudo gsmartcontrol&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Checking the whole space on your HDD&lt;/h2&gt;

&lt;p&gt;You know these tiny small &lt;code&gt;dd&lt;/code&gt; commands? No, it&amp;rsquo;s time to learn and understand them. They are very handy to fill your
your whole HDD with lovely zeros and ones.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; stands for &lt;strong&gt;data definition&lt;/strong&gt;. It has direct access on the harddisk and can read boot sectors &amp;ndash; it is even used to
create iso files of CDs.&lt;/p&gt;

&lt;h3&gt;Writing zeros or random numbers&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Take from the &lt;strong&gt;input file&lt;/strong&gt; (&lt;code&gt;if&lt;/code&gt;) the zeros (&lt;code&gt;/dev/zero&lt;/code&gt;) and write them on the &lt;strong&gt;output file&lt;/strong&gt; (&lt;code&gt;of&lt;/code&gt;) &lt;code&gt;/dev/sda&lt;/code&gt;. If
the command has written the whole hard disk, it will end.&lt;/p&gt;

&lt;h3&gt;Speeding up the process with faster writing&lt;/h3&gt;

&lt;p&gt;Normally, each block of the hard disk has the size of 512 KB. To set the blocksize on 1 MB (1024 KB), we can speed up
the writing speed with the factor two. We can achieve do this with the &lt;code&gt;bs&lt;/code&gt; option.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h3&gt;Jump over errors&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;dd&lt;/code&gt; will end, if it detects a broken sector. With the &lt;code&gt;conv=noerror&lt;/code&gt; option, &lt;code&gt;dd&lt;/code&gt; will write till the HDD is full even
over broken sectors:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/zero &lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;noerror &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Other useful parameters are &lt;code&gt;notrunc&lt;/code&gt; (write the output file completely) or &lt;code&gt;sync&lt;/code&gt; (write with the full length).&lt;/p&gt;

&lt;h3&gt;Running the dd command with status display&lt;/h3&gt;

&lt;p&gt;We can use the &lt;a href=&quot;http://manpages.ubuntu.com/manpages/dapper/man1/pv.1.html&quot;&gt;pv&lt;/a&gt; command to monitor the progress of data
through a pipe. First we need to install it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo apt-get install pv
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;To get an overview about how many MB or GB have already be written, use the following command:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;dd &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/random &lt;span class=&quot;nv&quot;&gt;conv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;notrunc,sync &lt;span class=&quot;nv&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1024 | pv &amp;gt; /dev/sda
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;A broken HDD is a bad thing, but if you know the symptoms it saves you a lot of time because you you know that you have
to buy new hardware. Always have backup on an external HDD so that you can easily replace you data.&lt;/p&gt;

&lt;p&gt;It is good to run a couple of tests before you start implementing your whole system.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sourceforge.net/apps/trac/smartmontools/wiki&quot;&gt;smartmontools project page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://help.ubuntu.com/community/Smartmontools&quot;&gt;smartmontools help on Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Creation of a ruby gem</title>
      <link href="/creation-of-a-ruby-gem.html"/>
      <updated>2012-06-07T00:00:00+02:00</updated>
      <id>/creation-of-a-ruby-gem.html</id>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;Everything should be made as simple as possible, but not simple.&lt;/p&gt;
  &lt;strong&gt;Albert Einstein&lt;/strong&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;em&gt;This article describes the crafting of a Ruby gem and decipher the mysterious GemSpec file.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The situation: For &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt; I wanted to get an overview of how many pages, links, when the last
build was, how many images I used in my blog, and when I lastly updated my
&lt;a href=&quot;https://bitbucket.org/wikimatze/&quot;&gt;bitbucket repositories&lt;/a&gt;. But before we dive deep into the creation, I will explain
what a gem is and how you get started with writing your own gem. Don&amp;rsquo;t be afraid if you are writing a gem that already
exists, your goal is to learn how to write a gem (and of course trying out new things).&lt;/p&gt;

&lt;h2&gt;Ruby Gem&lt;/h2&gt;

&lt;p&gt;A ruby gem is a self contained Ruby application which is packed as software. It can be downloaded and then used in other
programs.  Gems extends the core Ruby language through functions that are commonly used and may be of usage by other
programmers. Many gems provides command line operations and help to automate tasks. Not all gems needs to contain a
binary, like my &lt;a href=&quot;https://github.com/matthias-guenther/sweetie&quot;&gt;sweetie gem&lt;/a&gt;. You can just through in the functionality
provided by the gem to use it for your own programs.&lt;/p&gt;

&lt;h2&gt;Basic structure of a Gem&lt;/h2&gt;

&lt;p&gt;Below is a typical structure of gem:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.
├── README.md
├── Rakefile
├── lib
│   ├── sweetie
│   │   ├── bitbucket.rb
│   │   ├── conversion.rb
│   │   └── helper.rb
│   │   ...
│   └── sweetie.rb
│   ...
├── spec
│   ├── sweetie_bitbucket_spec.rb
│   └── sweetie_conversion_spec.rb
│   ...
└── sweetie.gemspec
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A typical gem consists of the main class file (like &lt;em&gt;sweetie.rb&lt;/em&gt;). This file contains other ruby-files (normally a list
of &lt;em&gt;require&lt;/em&gt; statements). The &lt;em&gt;README.md&lt;/em&gt; briefly explains what the gem does, how to install it, explains the license,
and should include small use cases for the gem (please checkout the
&lt;a href=&quot;https://github.com/matthias-guenther/sweetie/blob/master/README.md&quot;&gt;README&lt;/a&gt; of the sweetie gem to see what I mean). The
&lt;em&gt;sweetie.gemspec&lt;/em&gt; file contains meta-information like who invented the gem, declare runtime environment dependencies,
and so on.  Additionally a gem should have test-files, so that other people can contribute to the Gem without damaging
the main functionality.&lt;/p&gt;

&lt;h2&gt;Gemfile structure&lt;/h2&gt;

&lt;p&gt;First of all we create a &lt;em&gt;Gemfile&lt;/em&gt; which defines important informations for the &lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt;
website. The site shows the author, the sources, the homepage, and some statistics (e.g. how often the gem was
installed) &amp;ndash; and by the way, it&amp;rsquo;s a nice place to sniff in the code of other hackers.&lt;/p&gt;

&lt;p&gt;Here is an example &lt;code&gt;sweetie.gemspec&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;vg&quot;&gt;$:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;expand_path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;../lib&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sweetie/version&amp;#39;&lt;/span&gt;

&lt;span class=&quot;ss&quot;&gt;Gem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:Specification&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sweetie&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Sweetie&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:VERSION&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;date&lt;/span&gt;             &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;2012-06-05&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;authors&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;Matthias Guenther&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;email&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;matthias.guenther@wikimatze.de&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;homepage&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;https://github.com/matthias-guenther/sweetie&amp;#39;&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;summary&lt;/span&gt;          &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%q{Be short and precice!}&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;description&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;%q{Here you can write more and describe detailed features!}&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;files&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`git ls-files`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;test_files&lt;/span&gt;       &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`git ls-files -- {test,spec,features}/*`&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require_paths&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;lib&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extra_rdoc_files&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;README.md&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;nokogiri&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;gt;= 1.4.6&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_runtime_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;json&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;gt;= 1.6.1&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rake&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rspec&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;add_development_dependency&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;yard&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s explain the stuff which aren&amp;rsquo;t obvious:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$:.push&lt;/code&gt;: magic line that ensures &amp;ldquo;../lib&amp;rdquo; is in the load path&lt;/li&gt;
&lt;li&gt;&lt;code&gt;require 'sweetie/version'&lt;/code&gt;: we need this line, because the module &lt;code&gt;sweetie/version.rb&lt;/code&gt; contains the version number of
the gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.files&lt;/code&gt;: uses a clever git command which lists all files under version-control &amp;ndash; these files are directly included
in the gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.test_files&lt;/code&gt;: again, a clever git listing command with ruby&amp;rsquo;s &lt;code&gt;split()&lt;/code&gt; method &amp;ndash; files that are used for testing the
gem (the line supports &lt;a href=&quot;https://github.com/test-unit/test-unit&quot;&gt;TestUnit&lt;/a&gt;,
&lt;a href=&quot;https://github.com/seattlerb/minitest&quot;&gt;MiniTest&lt;/a&gt;, &lt;a href=&quot;https://github.com/notahat/machinist&quot;&gt;Machinist&lt;/a&gt;,
&lt;a href=&quot;https://github.com/rspec/rspec&quot;&gt;RSpec&lt;/a&gt;, &lt;a href=&quot;http://cukes.info/&quot;&gt;Cucumber&lt;/a&gt;, and others&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.require_paths&lt;/code&gt;: these paths will be added to &lt;em&gt;$LOAD_PATH&lt;/em&gt; when the gem is activated&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.summary&lt;/code&gt;: short summary of the gem&amp;rsquo;s description =&gt; will be displayed when running &lt;code&gt;gem list -d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.description&lt;/code&gt;: A long description of this gem =&gt; it goes more into detail than &lt;code&gt;s.summary&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.extra_rdoc_files&lt;/code&gt;: here you can add files which can be used for the &lt;a href=&quot;http://rubydoc.info&quot;&gt;RubyDoc&lt;/a&gt; site &amp;ndash; here the
.gemspec &lt;em&gt;README.md&lt;/em&gt; is the &amp;ldquo;main homepage&amp;rdquo; of the generated documentation&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.add_runtime_dependency&lt;/code&gt;: additional gems that will be installed when using this gem&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s.add_development_dependency&lt;/code&gt;: additional gems needed when hacking on the gem (e.g.
&lt;a href=&quot;http://en.wikipedia.org/wiki/Rake_%28software%29&quot;&gt;Rake&lt;/a&gt; is used for building and deploying the gem)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Building and Installing the Gem&lt;/h2&gt;

&lt;p&gt;Once you have created some code (it doesn&amp;rsquo;t matter how small the code is, except it must be valid and tested ruby code),
you can (and should) build it on your local machine before making it public:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;build&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gemspec&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Successfully&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;built&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;RubyGem&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;Version&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;
  &lt;span class=&quot;ss&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now you can install the gem &lt;em&gt;local&lt;/em&gt; with the following command:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And test the installation with:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;irb&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;sweetie&amp;#39;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It&amp;rsquo;s working and you can experiment with the script locally.&lt;/p&gt;

&lt;h2&gt;Publishing your gem&lt;/h2&gt;

&lt;p&gt;The time has come to make your gem public &amp;ndash; so that they can other hackers help. First, you need to register on
&lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt;. After that you can push the gem there with one simple command:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;push&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Pushing&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;RubyGems&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;org&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Successfully&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;registered&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;gem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you want to check if your gem is online, the console is your friend:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;r&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;sweetie&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This will print all the gems which fit to the specified gem.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is very easy to write an gem for ruby. Start small, create a repository on &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt; get
something similar to &lt;em&gt;hello world&lt;/em&gt; running, test your code with , and create a briefly documentation
(read &lt;a href=&quot;http://zachholman.com/posts/documentation/&quot;&gt;zach holman documentation talk&lt;/a&gt; to see why) about what the gem does,
and give small examples. After this test your gem, deploy it on &lt;a href=&quot;http://rubygems.org/&quot;&gt;rubygems.org&lt;/a&gt; and spread the word
about your accomplished on &lt;a href=&quot;http://www.twitter.com/&quot;&gt;twitter&lt;/a&gt; &amp;ndash; time to drink a beer!&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://guides.rubygems.org/make-your-own-gem/&quot;&gt;Great article on rubygems.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rakeroutes.com/blog/lets-write-a-gem-part-one/&quot;&gt;Writing a ruby gem part one&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rakeroutes.com/blog/lets-write-a-gem-part-two/&quot;&gt;Writing a ruby gem part two&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://guides.rubygems.org/specification-reference/&quot;&gt;Gemspec specification&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Searching Haml files with ack</title>
      <link href="/searching-haml-files-with-ack.html"/>
      <updated>2012-05-14T00:00:00+02:00</updated>
      <id>/searching-haml-files-with-ack.html</id>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how you can configure your ack settings to search for additionals files.
UPATE: &lt;a href=&quot;http://petdance.com/&quot;&gt;Andy Lester&lt;/a&gt;, the author of ack, give me feedback about this article.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Recently I was working on a Rails project and was using Vim with the &lt;code&gt;:Ack &amp;lt;pattern&amp;gt;&lt;/code&gt; command to search after a certain
typed string &amp;ldquo;Übreschrift&amp;rdquo; and would like to replace it with the correct version &amp;ldquo;Überschrift&amp;rdquo;. I typed into the console
&lt;code&gt;:Ack Übreschrift&lt;/code&gt; and I couldn&amp;rsquo;t find a single match. What went wrong?&lt;/p&gt;

&lt;h2&gt;Questions to answer&lt;/h2&gt;

&lt;p&gt;Why couldn&amp;rsquo;t I find the file with that content? Was I in the wrong directory? No:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$pwd
-&amp;gt; $HOME/git-repositories/brokenlifts
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Did I used the wrong pattern? No, I searched after the right word &amp;ldquo;Übreschrift&amp;rdquo;. Did I used the wrong command?  No, I
tried &lt;code&gt;ack-grep&lt;/code&gt; in the terminal to search for other common words like &lt;em&gt;test&lt;/em&gt; or &lt;em&gt;string&lt;/em&gt; and could only find results in
&lt;em&gt;.rb, &lt;/em&gt;.js files but not in &lt;code&gt;*.html.haml&lt;/code&gt; files. Tada, found the mistake, &lt;code&gt;ack&lt;/code&gt; is per default not configured to include
these very special file types. If your press &lt;code&gt;ack -f&lt;/code&gt; (thanks &lt;a href=&quot;http://petdance.com/&quot;&gt;Andy Lester&lt;/a&gt; for this note) you
will get the output of all files ack will go through &amp;ndash; and this command didn&amp;rsquo;t displayed &lt;code&gt;*.html.haml&lt;/code&gt; files.&lt;/p&gt;

&lt;h2&gt;Solve problems .ackrc&lt;/h2&gt;

&lt;p&gt;I created the &lt;code&gt;$HOME/.ackrc&lt;/code&gt; and added the entries to include these special filename:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;--type-add
&lt;span class=&quot;nv&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.html.haml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now my search worked and I got hits in &lt;code&gt;*.html.haml&lt;/code&gt; files for searching the term &amp;ldquo;Übreschrift&amp;rdquo;.&lt;/p&gt;

&lt;h2&gt;Further refinements&lt;/h2&gt;

&lt;p&gt;Since I&amp;rsquo;m working with Rails there are other file types like &lt;code&gt;sass, erb, less, scss, ..&lt;/code&gt; I would like to include into
the search:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;--type-add
&lt;span class=&quot;nv&quot;&gt;html&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.html.erb,.html.haml,.haml
--type-add
&lt;span class=&quot;nv&quot;&gt;css&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.sass,.less,.scss
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;And there might be directories I don&amp;rsquo;t want to have in my search path. Let&amp;rsquo;s ignore them and speed up our search:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;--type-set
&lt;span class=&quot;nv&quot;&gt;ignorables&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.log,.tmp,.pdf
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vendor
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;log
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tmp
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;doc
--ignore-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;coverage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you would like to see the specified files for your grep environment search, just use &lt;code&gt;ack --help types&lt;/code&gt; &amp;ndash; this will
print all information you need. Here is an example:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ack --help &lt;span class=&quot;nv&quot;&gt;types&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt;
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;actionscript .as .mxml
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;ada          .ada .adb .ads
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;asm          .asm .s
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;batch        .bat .cmd
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;binary       Binary files, as defined by Perl&lt;span class=&quot;s1&quot;&gt;&amp;#39;s -B op (default: off)&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]cc           .c .h .xs&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]cfmx         .cfc .cfm .cfml&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]cpp          .cpp .cc .cxx .m .hpp .hh .h .hxx&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]csharp       .cs&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]css          .css .sass .less .scss&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]elisp        .el&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]erlang       .erl .hrl&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]fortran      .f .f77 .f90 .f95 .f03 .for .ftn .fpp&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]haskell      .hs .lhs&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]hh           .h&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]html         .htm .html .shtml .xhtml .html.erb .html.haml .haml&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]ignorables   .log .tmp .pdf&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]java         .java .properties&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]js           .js&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]jsp          .jsp .jspx .jhtm .jhtml&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]lisp         .lisp .lsp&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]lua          .lua&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]make         Makefiles&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]mason        .mas .mhtml .mpl .mtxt&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]objc         .m .h&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]objcpp       .mm .h&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]ocaml        .ml .mli&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]parrot       .pir .pasm .pmc .ops .pod .pg .tg&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]perl         .pl .pm .pod .t&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]php          .php .phpt .php3 .php4 .php5 .phtml&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]plone        .pt .cpt .metadata .cpy .py&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]python       .py&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]rake         Rakefiles&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]ruby         .rb .rhtml .rjs .rxml .erb .rake&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]scala        .scala&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]scheme       .scm .ss&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]shell        .sh .bash .csh .tcsh .ksh .zsh&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]skipped      Files, but not directories, normally skipped by ack (default: off)&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]smalltalk    .st&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]sql          .sql .ctl&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]tcl          .tcl .itcl .itk&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]tex          .tex .cls .sty&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  --[no]text         Text files, as defined by Perl&amp;#39;&lt;/span&gt;s -T op &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;default: off&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;tt           .tt .tt2 .ttml
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;vb           .bas .cls .frm .ctl .vb .resx
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;vim          .vim
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;xml          .xml .dtd .xslt .ent
  --&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;no&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;yaml         .yaml .yml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://betterthangrep.com/&quot;&gt;ack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Installing PostgreSQL gem under Ubuntu and Mac</title>
      <link href="/installing-postgresql-gem-under-ubuntu-and-mac.html"/>
      <updated>2012-02-26T00:00:00+01:00</updated>
      <id>/installing-postgresql-gem-under-ubuntu-and-mac.html</id>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how to install the postgresql gem (called &amp;lsquo;pg&amp;rsquo;) under your local machine.  The installation
process is not trivial because you need to install the right packages: For Ubuntu/Linux you only need to install the
right packages and for Mac you need to specify the correct path.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I checked out a new rails app called &lt;a href=&quot;http://www.rhok.org/node/20654&quot;&gt;Broken lifts&lt;/a&gt;. Broken lifts in public
transportation are annoying and limit the mobility of people in wheelchairs. The app provides status information from
different operators on one page and shows how well they are performing.&lt;/p&gt;

&lt;p&gt;Ones I checked out the project I have detected that it uses &lt;a href=&quot;http://www.rhok.org/node/20654&quot;&gt;PostgreSQL&lt;/a&gt; as their
database driver.  So far I have never worked with it and I run into a couple of problems to get it running.&lt;/p&gt;

&lt;h2&gt;The problem&lt;/h2&gt;

&lt;p&gt;A small &lt;code&gt;$gem install pg&lt;/code&gt; brought me the following error message:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gem install pg
Building native extensions.  This could take a &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;...
/Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /Users/helex/bin in PATH, mode 040777
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /Users/helex/.rbenv/versions/1.9.2-p290/bin/ruby extconf.rb
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/pg_config
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;libpq-fe.h... no
Can&lt;span class=&quot;s1&quot;&gt;&amp;#39;t find the &amp;#39;&lt;/span&gt;libpq-fe.h header
&lt;span class=&quot;se&quot;&gt;\*\*\*&lt;/span&gt; extconf.rb failed &lt;span class=&quot;se&quot;&gt;\*\*\*&lt;/span&gt;
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;opt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
  --with-opt-lib
  --without-opt-lib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;opt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib
  --with-make-prog
  --without-make-prog
  --srcdir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;.
  --curdir
  --ruby&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/Users/helex/.rbenv/versions/1.9.2-p290/bin/ruby
  --with-pg
  --without-pg
  --with-pg-dir
  --without-pg-dir
  --with-pg-include
  --without-pg-include&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/include
  --with-pg-lib
  --without-pg-lib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;-dir&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;/lib
  --with-pg-config
  --without-pg-config
  --with-pg_config
  --without-pg_config


Gem files will remain installed in /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2 &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;inspection.
Results logged to /Users/helex/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/pg-0.13.2/ext/gem_make.out
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;What relevant about the mess up there is the following part:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/pg_config
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;libpq-fe.h... no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Ruby can&amp;rsquo;t find the relevant setting of the PostgreSQL installation. Let&amp;rsquo;s change this!&lt;/p&gt;

&lt;h2&gt;Solution for Mac&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;install PostgreSQL library as described on the &lt;a href=&quot;http://www.postgresql.org/download/macosx/&quot;&gt;PostgreSQL page&lt;/a&gt; (opening
the &lt;code&gt;*.dmg&lt;/code&gt; file will install a bunch of stuff, so don&amp;rsquo;t be afraid of the amount of steps you have to perform)&lt;/li&gt;
&lt;li&gt;check if you can find the installation open it under &lt;code&gt;/Library/PostgreSQL/x.y&lt;/code&gt; &amp;ndash; where x.y stands for the version you
installed&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Say you want to install the PostgreSQL manually with a &lt;code&gt;gem install&lt;/code&gt; &amp;ndash; you have to perform the following command&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo &lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:/Library/PostgreSQL/9.1/bin gem install pg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you want to install it with &lt;a href=&quot;http://gembundler.com/&quot;&gt;Bundle&lt;/a&gt;, run the following command&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo &lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;:/Library/PostgreSQL/9.1/bin bundle install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Please change the &lt;strong&gt;9.1&lt;/strong&gt; with the version you have installed. Thats it!&lt;/p&gt;

&lt;h2&gt;Solution for Ubuntu/Linux&lt;/h2&gt;

&lt;p&gt;It is easier because you only have to install the right packages:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;sudo apt-get install postgresql
sudo apt-get install libpq-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now &lt;code&gt;gem install pg&lt;/code&gt; should work.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It can be a really pain if you want to install gems and don&amp;rsquo;t have the right dependencies on your machine but if you
initially invest some time on the problem, you have your enlightenment.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Compiling Vim from source for Ubuntu and Mac with ruby and python support</title>
      <link href="/compiling-vim-from-source-for-ubuntu-and-mac-with-rbenv.html"/>
      <updated>2012-02-19T00:00:00+01:00</updated>
      <id>/compiling-vim-from-source-for-ubuntu-and-mac-with-rbenv.html</id>
      <content type="html">&lt;p&gt;&lt;em&gt;This article describes how to build &lt;a href=&quot;http://www.vim.org/&quot;&gt;Vim&lt;/a&gt; (vim and gvim) from the source and compile it against a
predefined version of &lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;ruby&lt;/a&gt; installed with
&lt;a href=&quot;https://github.com/sstephenson/rbenv/&quot;&gt;rbenv&lt;/a&gt;. In the first chapter I&amp;rsquo;m describing how to build it from source for
Ubuntu. The second part describes how to build for &lt;a href=&quot;https://github.com/b4winckler/macvim/&quot;&gt;MacVim&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;By installing Vim with ruby support from the sources, it is build against the system wide installation of ruby.  If you
already installed Vim and/or ruby with &lt;code&gt;sudo apt-get install vim&lt;/code&gt; (or &lt;code&gt;sudo apt-get install ruby&lt;/code&gt;) or with &lt;code&gt;brew install
vim&lt;/code&gt; (e.g.  &lt;code&gt;brew install ruby&lt;/code&gt;) if you are using OS X, remove it completely from your system to install the latest
version of Vim.&lt;/p&gt;

&lt;h2&gt;Install rbenv&lt;/h2&gt;

&lt;p&gt;I&amp;rsquo;m installing &lt;em&gt;rbenv&lt;/em&gt; on different machines so I created the following script (named &lt;em&gt;rbenv_install.sh&lt;/em&gt;) to install
&lt;strong&gt;ruby 1.9.2-p320&lt;/strong&gt;:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;
sudo rm -rf .rbenv
git clone git://github.com/sstephenson/rbenv.git .rbenv
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;export PATH=&amp;quot;$HOME/.rbenv/bin:$PATH&amp;quot;&amp;#39;&lt;/span&gt; &amp;gt;&amp;gt; ~/.bash_profile

&lt;span class=&quot;c&quot;&gt;# install steps for rbenv-install command&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
sudo rm -rf ruby-build
git clone git://github.com/sstephenson/ruby-build.git
&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;ruby-build
sudo bash install.sh

&lt;span class=&quot;c&quot;&gt;# updating the current shell&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SHELL&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/.bash_profile

rbenv-install 1.9.2-p290
rbenv rehash
&lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$SHELL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After this try the following:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rbenv global 1.9.2-p320
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;rbenv &lt;span class=&quot;nb&quot;&gt;local &lt;/span&gt;1.9.2-p320
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ruby -v
&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&amp;gt; ruby 1.9.2p320 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2012-04-20 revision 35421&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;i686-linux&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The crowd applauds.&lt;/p&gt;

&lt;h2&gt;Get the latest version of Python&lt;/h2&gt;

&lt;p&gt;This will be put in the &lt;code&gt;$HOME/lib&lt;/code&gt; folder:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;mkdir &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/lib
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;tar xjvf Python-2.7.3.tar.bz2
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;Python-2.7.3
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/lib
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; make install
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make inclinstall &lt;span class=&quot;c&quot;&gt;# install headers, otherwise Vim won&amp;#39;t have Python support&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;hash&lt;/span&gt; -r
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Get the latest version of Vim&lt;/h2&gt;

&lt;p&gt;Visit &lt;a href=&quot;http://www.vim.org/download.php/&quot;&gt;vim.org&lt;/a&gt; and select the right download for your operation system (mainly Unix).
If you are using a Unix system yo can get the latest Vim from &lt;a href=&quot;ftp://ftp.vim.org/pub/vim/unix/&quot;&gt;here&lt;/a&gt;, download and
unzip it:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;tar -xjvf vim-7.3.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can also get the latest Vim version from the git repository with the following command:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone https://github.com/b4winckler/vim
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;vim
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git tag -l
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git checkout v7-3-548
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Compiling Vim and Gvim&lt;/h2&gt;

&lt;p&gt;To install Gvim on Ubuntu we need to install additional packages on our machine. The following snippets describe the
packages for Ubuntu:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo apt-get install libncurses-dev libgnome2-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 libx11-dev libxpm-dev libxt-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Since we are now having the Vim sources under &lt;code&gt;$HOME/Downloads/vim&lt;/code&gt; it&amp;rsquo;s time to start the compilation. First we need to
configure our compilation:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Downloads/vim
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --enable-gui&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;no &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --without-x &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --disable-nls &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --with-tlib&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;ncurses &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --enable-multibyte &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --enable-rubyinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --enable-pythoninterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --with-python-config-dir&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/lib/python2.7/config/ &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --with-mac-arch&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;x86_64 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --with-features&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;huge &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    --enable-gui&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;gnome2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s get over the heavy stuff:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--prefix=/usr/local&lt;/code&gt; &amp;ndash; place of the binaries of the installed Vim installation (check the &lt;code&gt;/usr/local/bin&lt;/code&gt;) &amp;ndash; there
will be the executable binaries&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--enable-rubyinterp&lt;/code&gt; &amp;ndash; says you want to build Vim with the default ruby installation (in our case
&lt;code&gt;/home/mg/.rbenv/shims/ruby&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--enable-gui=gnome2&lt;/code&gt; &amp;ndash; building Vim with Gvim support (if you don&amp;rsquo;t want Gvim than you can leave this line out)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;After configuring the compilation check if the console response contains the following terms:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;checking --with-ruby-command argument... defaulting to ruby
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;ruby... &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;cached&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; /home/mg/.rbenv/shims/ruby
checking Ruby version... OK
checking Ruby header files... /home/mg/.rbenv/versions/1.9.2-p320/include/ruby-1.9.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If you can&amp;rsquo;t see the lovely &lt;strong&gt;Ok&lt;/strong&gt;, your Vim compilation will probably not have ruby support. After that we can build
the configuration, install, and clean everything up:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; ~/Downloads/vim
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo make install
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sudo make clean
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Check the installation&lt;/h2&gt;

&lt;p&gt;Open a new session or perform &lt;code&gt;exec $SHELL&lt;/code&gt; to reboot your Shell. You will see the fresh installed version of Vim:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;which vim
/usr/local/bin/vim

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;which gvim
/usr/local/bin/gvim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Next check is to get the correct &amp;mdash;version of &lt;code&gt;vim&lt;/code&gt; and &lt;code&gt;gvim&lt;/code&gt; with the following commands:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim --version | ack ruby
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;vim --version | ack python
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gvim --version | ack ruby
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;gvim --version | ack python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;If both commands return &lt;strong&gt;+ruby&lt;/strong&gt; and &lt;strong&gt;+python&lt;/strong&gt;, you are fine, and got the achievement &lt;em&gt;&amp;ldquo;I installed vim form source
with ruby support on my own&amp;rdquo;&lt;/em&gt;. You should now be able to run the
&lt;a href=&quot;https://github.com/matthias-guenther/hammer.vim&quot;&gt;Hammer.vim&lt;/a&gt; plugin &amp;ndash; install it, start it with &lt;code&gt;:Hammer&lt;/code&gt;, install the
missing gems and if you are able to run &lt;code&gt;:Hammer&lt;/code&gt; without any missing dependencies, you have setup everything correct.&lt;/p&gt;

&lt;h2&gt;Installing MacVim from source&lt;/h2&gt;

&lt;p&gt;The ways are nearly the same as mentioned above: Install rbenv as mentioned in the steps before.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$HOME&lt;/span&gt;/Download
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git clone git://github.com/b4winckler/macvim.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Next step is to &lt;strong&gt;configure&lt;/strong&gt; MacVim for OSX:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;macvim/src
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./configure --prefix&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/local &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --with-features&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;huge &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-rubyinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-pythoninterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-perlinterp &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
              --enable-cscope
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;After configuring the compilation check the console response after the following terms:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;checking --with-ruby-command argument... defaulting to ruby
checking &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;ruby... /Users/helex/.rbenv/shims/ruby
checking Ruby version... OK
checking Ruby header files... /Users/helex/.rbenv/versions/1.9.2-p320/include/ruby-1.9.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;When this is finished, it is time &lt;code&gt;build&lt;/code&gt; MacVim with make:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;make
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Next step is to run the MacVim installation:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;open MacVim/build/Release/MacVim.app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The window should open MacVim. Run the following command in the MacVim quickfix window:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;:ruby puts &lt;span class=&quot;s2&quot;&gt;&amp;quot;MacVim&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;In the next step, you can drop the &lt;strong&gt;MacVim.app&lt;/strong&gt; icon in your Application folder and you are done.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It was a pain to gather the information for building vim by source with rbenv. Duration of finding that was: ~ &lt;strong&gt;6 h&lt;/strong&gt;.
I&amp;rsquo;m not sure if all of this works on &lt;a href=&quot;https://rvm.beginrescueend.com/&quot;&gt;RVM&lt;/a&gt; &amp;ndash; I just need additional feedback from
people using it. Happy &lt;em&gt;&amp;ldquo;Vim-ing&amp;rdquo;&lt;/em&gt;!&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://vim.wikia.com/wiki/Building_Vim&quot;&gt;Building Vim&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://arjanvandergaag.nl/blog/compiling-vim-with-ruby-support.html&quot;&gt;Vim with ruby support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/b4winckler/macvim/wiki/Building&quot;&gt;Building MacVim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>SMART principle</title>
      <link href="/smart-principle.html"/>
      <updated>2012-01-12T00:00:00+01:00</updated>
      <id>/smart-principle.html</id>
      <content type="html">&lt;p&gt;&lt;em&gt;This post is about the SMART principle that helps you to start and keep rolling projects. I outlined how I use SMART
for my eBook project.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I recently read the book &lt;a href=&quot;http://pragprog.com/the-pragmatic-programmer&quot;&gt;Pragmatic Programmer&lt;/a&gt;, in which &lt;a href=&quot;http://en.wikipedia.org/wiki/Dave_Thomas_programmer&quot;&gt;Dave
Thomas&lt;/a&gt; explained the &lt;em&gt;SMART&lt;/em&gt; principle. SMART is an acronym and
each character of the principle has the following meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;S&lt;/strong&gt; (&lt;em&gt;specific goal&lt;/em&gt;) &amp;ndash; what is the goal of the new project you want to start&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;M&lt;/strong&gt; (&lt;em&gt;measurable&lt;/em&gt;) &amp;ndash; list all the features you need to accomplish to start the project&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A&lt;/strong&gt; (&lt;em&gt;action&lt;/em&gt;) &amp;ndash; when will you start&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt; (&lt;em&gt;realistic&lt;/em&gt;) &amp;ndash; is the project small enough to finish it in the specified time frame
demanded time frame&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;T&lt;/strong&gt; (&lt;em&gt;time&lt;/em&gt;) &amp;ndash; in the beginning of July 2012 everything should be fine&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Putting theory into practice&lt;/h2&gt;

&lt;p&gt;Late in 2011, I started a new and personally ambitious project: Writing an eBook about the great web framework
&lt;a href=&quot;http://www.padrinorb.com/&quot; title=&quot;Padrino&quot;&gt;Padrino&lt;/a&gt;. In a first step, I created a rough road map, about what I wanted to
write and which topics should be covered. After writing the intro section and pushing the resources to
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot; title=&quot;github&quot;&gt;github&lt;/a&gt; I did something very crazy and mentioned
&lt;strong&gt;@padrinorb&lt;/strong&gt; in one of my tweets and this was it &amp;mdash; the authors of the framework motivated me with with writing the
book. They retweeted every small progress I made with the project and through that I got further pull requests and even
a bunch of interested followers who are watching the project.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://img.skitch.com/20111105-d9cjedpatps5wch3g5bbi6u1km.jpg&quot; class=&quot;center&quot; alt=&quot;Beginning of something great&quot;/&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Beginning of something great&lt;/div&gt;


&lt;p&gt;Let&amp;rsquo;s see how I can formulate the Book project with SMART:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;S&lt;/strong&gt; (&lt;em&gt;specific goal&lt;/em&gt;) &amp;ndash; I want to learn how to write a eBook easily about Padrino web framework&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;M&lt;/strong&gt; (&lt;em&gt;measurable&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;create a roadmap about the topics of the book&lt;/li&gt;
&lt;li&gt;find a method to write book in one format and export the as pdf, epub, mobi, and HTML format&lt;/li&gt;
&lt;li&gt;get really involved in Open source community and communicate with them&lt;/li&gt;
&lt;li&gt;find an audience and get help from other people&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A&lt;/strong&gt; (&lt;em&gt;action&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;start as soon as possible&lt;/li&gt;
&lt;li&gt;try to write everyday one chapter of the book&lt;/li&gt;
&lt;li&gt;tweet about the progress I made everyday&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt; (&lt;em&gt;realistic&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;it is a big project (never have written a book before) but continuously delivery will motivate me during this long
period&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;T&lt;/strong&gt; (&lt;em&gt;time&lt;/em&gt;)

&lt;ul&gt;
&lt;li&gt;till February 2012 everything should be finished&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I set up the frame of SMART goals and developed a rough plan &amp;ndash; that&amp;rsquo;s all you need to let come your dreams true.&lt;/p&gt;

&lt;p&gt;The SMART principle was first mentioned in 1981 as an issue of Management Review by George T. Doran.&lt;/p&gt;

&lt;h2&gt;Cost for SMART&lt;/h2&gt;

&lt;p&gt;To be honest, writing of my Padrino eBook project consumes a lot of my free time so I in the near future I will publish
only a few new entries on this blog. I have many ideas and topics I want to cover, but first I will finish this book to
deepen my writing experience. I&amp;rsquo;m glad to hear your opinion (or contribution) to the
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book&quot;&gt;book&lt;/a&gt; &amp;ndash; I will put every contributer on the special thanks
&lt;a href=&quot;https://github.com/matthias-guenther/padrino-book/blob/master/README.md&quot;&gt;list&lt;/a&gt; of the book.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;SMART is great if you want to start in small steps to begin with something completely new, learn much about it, and
report (for example, I&amp;rsquo;m using the twitter Hashtag &lt;strong&gt;#dailywriting&lt;/strong&gt;) about the progress you made.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://sebastianguenther.org/&quot; title=&quot;Sebastian Guenther&quot;&gt;&lt;strong&gt;Sebastian Guenther&lt;/strong&gt;&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Global Coderetreat 2011 in Berlin</title>
      <link href="/global-code-retreat-2011.html"/>
      <updated>2011-12-04T00:00:00+01:00</updated>
      <id>/global-code-retreat-2011.html</id>
      <content type="html">&lt;p&gt;I attended the &lt;a href=&quot;http://coderetreat.org/&quot;&gt;&lt;strong&gt;Global Coderetreat&lt;/strong&gt;&lt;/a&gt; event initialized by
&lt;a href=&quot;http://coreyhaines.com/&quot;&gt;Corey Haines&lt;/a&gt;. The general purpose of this event was to get a bunch of
hackers together to implement &lt;a href=&quot;http://en.wikipedia.org/wiki/Conway's_Game_of_Life&quot;&gt;Conway&amp;rsquo;s Game of Life&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7029/6452198253_ca6e01b7f4_b.jpg&quot; title=&quot;Coderetreat@Immobilienscout - Photo was taken from http://www.flickr.com/photos/60906583@N08/6452198253/&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7029/6452198253_ca6e01b7f4_z.jpg&quot; class=&quot;center&quot; alt=&quot;Coderetreat@Immobilienscout - Photo was taken from http://www.flickr.com/photos/60906583@N08/6452198253/&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Setting up goals&lt;/h2&gt;

&lt;p&gt;As &lt;strong&gt;J. B. Rainsberger&lt;/strong&gt; mentioned in his
&lt;a href=&quot;http://www.jbrains.ca/permalink/the-four-elements-of-simple-design&quot;&gt;article&lt;/a&gt; four elements of
simple design, it is best to setup goals for your retreat to get most out of it. Here is a list of
what I achieved in each session:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Being a mentor of TDD: I taught &lt;a href=&quot;https://github.com/dedan&quot;&gt;dedan&lt;/a&gt; how to use TDD, why TDD helps you to think about
your design.&lt;/li&gt;
&lt;li&gt;Being a mentor of BDD: Showing a fellow Rubyist how to do BDD.&lt;/li&gt;
&lt;li&gt;Doing something completely stupid: I played &lt;em&gt;evil coder&lt;/em&gt; and &lt;em&gt;ping-pong pairing&lt;/em&gt; with
&lt;a href=&quot;http://twitter.com/#!/tilosoenke&quot;&gt;@tilosoenke&lt;/a&gt; &amp;ndash; we couldn&amp;rsquo;t communicate with words, only with code, one writing
tests and other the implementation of the tests.&lt;/li&gt;
&lt;li&gt;Discuss about names: We said together and discussed about right names for methods, variables, and classes. We
concluded that good names saves you scary comments in your code.&lt;/li&gt;
&lt;li&gt;Explain Ruby to a Java-Programmer.&lt;/li&gt;
&lt;li&gt;Being mentored about Lisp: We solved the whole &amp;lsquo;Game of Live&amp;rsquo; in common
&lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_(programming_language&quot;&gt;Lisp&lt;/a&gt;) , while
&lt;a href=&quot;http://twitter.com/#!/hanshuebner&quot;&gt;@HansHuebener&lt;/a&gt; explained me the strength and beauty Common Lisp.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It was great to get so many people with so many different skills and mindsets together, exchange experience and
encouraging others to try something new. I will definitely have a closer look on Lisp to enhance my Ruby programming
style.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://sebastianguenther.org/&quot; title=&quot;Sebastian Guenther&quot;&gt;&lt;strong&gt;Sebastian Guenther&lt;/strong&gt;&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Benefits of Scala</title>
      <link href="/benefits-of-scala.html"/>
      <updated>2011-10-29T00:00:00+02:00</updated>
      <id>/benefits-of-scala.html</id>
      <content type="html">&lt;p&gt;When a new programming language is created, it came from a desire of one person or a group of to do it better than their
forerunner. It&amp;rsquo;s an evolutionary process that humans are trying to improve themselves if something doesn&amp;rsquo;t as they want
it to.  Sometimes it&amp;rsquo;s only a small piece of improvement which creates an absolutely new feeling about something. By
designing a new programming language you have a great pool of existing languages: LISP (1958), Smalltalk (1970), C++
(1979), Python (1991) and Ruby (1995). Today it is often told not to waste your time on building up an new language from
the scratch. It&amp;rsquo;s time-consuming and why should you invent the wheel a second time? I think this is just normal. If you
spend some time reading about the languages mentioned above, you will see that older language have still a great
influence on new ones. Today, it is common to use DSLs (they are used extensively in Rails) to create new languages. Not
everything happened in the past was bad and sometimes if you stick your head into some old forgotten technology you may
find some diamonds.&lt;/p&gt;

&lt;p&gt;This was the main idea of Odersky when he created Scala. It is the first language which is a real hybrid language and
combines the invigorations of OOP and FP.&lt;/p&gt;

&lt;h2&gt;Main facts about Scala&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scala is ideal for today’s scalable, distributed, component-based applications that support concurrency and
distribution.&lt;/li&gt;
&lt;li&gt;Scala is &lt;em&gt;statically typed&lt;/em&gt; that means that the type of some variable is immutable during the whole execution of the
program.&lt;/li&gt;
&lt;li&gt;There is modular &lt;em&gt;mixin-composition for classes&lt;/em&gt; &amp;ndash; some hack to enable multiple inheritance in Scala, which solves the
diamond problem through linearity of the inheritance hierarchy via &lt;em&gt;traits&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Support of so functions may have other functions as arguments which enables using anonymous functions.&lt;/li&gt;
&lt;li&gt;Lower risk to use Scala in an existing Java Application because Scala works &lt;em&gt;seamless&lt;/em&gt; with existing Java Code.&lt;/li&gt;
&lt;li&gt;high level type system with &lt;em&gt;variance annotations&lt;/em&gt;, &lt;em&gt;compound types, lower and upper bounds for types&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;usage of &lt;em&gt;inner and anonymous classes&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;implicit conversions&lt;/em&gt; &amp;ndash; that means a function take one type as an argument and returns to another type (like
converting an Integer into String)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Scala is a very rich language which combines many features of different languages. It&amp;rsquo;s great if you have to make
different sections of your code cleaner, faster and conciser. See
&lt;a href=&quot;http://www.scala-lang.org/node/6436&quot;&gt;Scala at Linkedin&lt;/a&gt; to know what I mean.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;em&gt;Hanna Schütt&lt;/em&gt; and &lt;a href=&quot;http://sebastian-gerth.eu&quot; title=&quot;Sebastian Gerth&quot;&gt;Sebastian Gerth&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Lisp_%28programming_language%29&quot;&gt;LISP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Smalltalk&quot;&gt;Smalltalk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cplusplus.com&quot;&gt;C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.python.org/&quot;&gt;Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain-specific_language&quot;&gt;DSLs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Diamond_problem&quot;&gt;diamond problem&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Mail Client in Java</title>
      <link href="/mail-client-in-java.html"/>
      <updated>2011-10-22T00:00:00+02:00</updated>
      <id>/mail-client-in-java.html</id>
      <content type="html">&lt;blockquote&gt;
 &lt;p&gt;Most people spend more time and energy going around problems than trying to solve them.&lt;/p&gt;
 &lt;strong&gt;Henry Ford&lt;/strong&gt;
&lt;/blockquote&gt;


&lt;p&gt;During the summer term 2007 we had the task to create a &lt;a href=&quot;http://www.mozilla.org/en-US/thunderbird&quot;&gt;Thunderbird&lt;/a&gt; like
mail client &lt;a href=&quot;http://www.java.com/de/download/manual.jsp&quot;&gt;Java&lt;/a&gt;.  The GUI should be created either with
&lt;a href=&quot;http://java.sun.com/docs/books/tutorial/uiswing/&quot;&gt;Swing&lt;/a&gt; or
&lt;a href=&quot;http://java.sun.com/javase/6/docs/technotes/guides/awt/&quot;&gt;AWT&lt;/a&gt;. Beside the graphical implementation, we had to check and
study the functionality of &lt;a href=&quot;http://en.wikipedia.org/wiki/Post_Office_Protocol&quot;&gt;POP3&lt;/a&gt; and
&lt;a href=&quot;http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol&quot;&gt;SMTP&lt;/a&gt;. Only the correct numbers in this protocols are
important because they stands for each transactions if it was a success or a failure.  A first attempt this
functionality was done with plain old &lt;em&gt;sockets&lt;/em&gt; to get a feeling how POP3 and SMTP works.&lt;/p&gt;

&lt;p&gt;After we a running function the basic functions of the mail client, we had to implement some extra-functions like
attachments (mime parts in an email) or the handling of emails with drag-and-drop. I implemented this big project with
the help of &lt;a href=&quot;http://netbeans.org/&quot;&gt;NetBeans&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Images&lt;/h2&gt;

&lt;p&gt;By means of the following images I will describe the basic layout of my email client.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;&quot; title=&quot;title&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;small_image&quot; class=&quot;center&quot; alt=&quot;title&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7228/7257429146_a8e69185f7_b.jpg&quot; title=&quot;The basic surface when the program starts.  If you press on the upper task bar a drag-and-drop menu will open.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7228/7257429146_a8e69185f7_z.jpg&quot; class=&quot;center&quot; alt=&quot;The basic surface when the program starts.  If you press on the upper task bar a drag-and-drop menu will open.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;The basic surface when the program starts. If you press on the upper task bar a drag-and-drop menu will open.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7071/7257429010_90c8c37b00_z.jpg&quot; title=&quot;In this window you can add data of a new account.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7071/7257429010_90c8c37b00.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_2.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;In this window you can add data of a new account.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8022/7257428772_387fce2670_b.jpg&quot; title=&quot;Get the mail of an already existing account.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8022/7257428772_387fce2670.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_3.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Get the mail of an already existing account.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7243/7257428880_ebf4f8e24c_z.jpg&quot; title=&quot;The window where to write a new email.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7243/7257428880_ebf4f8e24c.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_4.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;The window where to write a new email.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7088/7257428050_f021ac4ffc.jpg&quot; title=&quot;Drag-and-Drop window to manage emails.&quot; class=&quot;fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7088/7257428050_f021ac4ffc_n.jpg&quot; class=&quot;center&quot; alt=&quot;mail_client_5.jpg&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Drag-and-Drop window to manage emails.&lt;/div&gt;


&lt;h2&gt;Installation for Netbeans&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;get the &lt;a href=&quot;https://github.com/matthias-guenther/mailclient&quot;&gt;sources from github&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;extract the &lt;em&gt;javamail-1.4.zip&lt;/em&gt; =&gt; this package contains a Java library for handling emails&lt;/li&gt;
&lt;li&gt;create a new project under NetBeans and copy all files of the &lt;em&gt;Mail Client&lt;/em&gt; directory in the &lt;em&gt;src&lt;/em&gt; directory of you
NetBeans project&lt;/li&gt;
&lt;li&gt;then you have to insert the &lt;em&gt;mail.jar&lt;/em&gt; file in your project in the following way:

&lt;ul&gt;
&lt;li&gt;click right on Libraries in the near of the view of your NetBeans project and chose &lt;em&gt;Add JAR&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;navigate to &lt;em&gt;javamail-1.4&lt;/em&gt; folder and select the &lt;em&gt;mail.jar&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;when you now select the files &lt;em&gt;GUIMailsend.java&lt;/em&gt; and &lt;em&gt;GUIMailsget.java&lt;/em&gt; should not show any errors&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;now you have to adopt the paths in the file &lt;em&gt;GUIMain.java&lt;/em&gt; &lt;code&gt;(static File f, String dir, FileReader file)&lt;/code&gt; and
&lt;em&gt;GUITree&lt;/em&gt; &lt;code&gt;(File driveC, File source, File ziel)&lt;/code&gt; to your NetBeans project folder through absolute paths =&gt; I know
it&amp;rsquo;s cumbersome but due to this date I couldn&amp;rsquo;t do any other&lt;/li&gt;
&lt;li&gt;set the &lt;em&gt;GuiMain.java&lt;/em&gt; as the main file in your project and start the program&lt;/li&gt;
&lt;li&gt;the standard account is &lt;em&gt;MG kontoinfos.kondat&lt;/em&gt; which contains the necessary data to access my spam account (you can
guess how to change the data)&lt;/li&gt;
&lt;li&gt;the directory &lt;em&gt;Inbox MG&lt;/em&gt; saves all read mails of the user MG, further accounts have to be created each in an own
directory&lt;/li&gt;
&lt;li&gt;&lt;em&gt;MailApi.java&lt;/em&gt; is not necessary for the mail client, this will just be used to check the correctness of the POP3
settings via the terminal&lt;/li&gt;
&lt;li&gt;main cause of error messages:

&lt;ul&gt;
&lt;li&gt;wrong paths to your project&lt;/li&gt;
&lt;li&gt;POP3 and SMTP&lt;/li&gt;
&lt;li&gt;&lt;em&gt;mail.jar&lt;/em&gt; is not included correct in the project, but this will be shown in NetBeans&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This project was my first big piece of software and I used all my gathered knowledge about Java. The classes are not
bug-free, manually tested, has a size over 1000 LOCs, has absolute paths, and the function are sometimes very big. In
the end it was just hacking down the software without using certain patterns or careful development with clean code. I
tested my code with &lt;code&gt;System.out.println&lt;/code&gt; and I lost so much time with this stupid testing. One good thing I did: I
created comments and was able to get the program running even after two year.&lt;/p&gt;

&lt;p&gt;Nowadays programming methodologies like &lt;a href=&quot;http://en.wikipedia.org/wiki/Agile_software_development&quot;&gt;Agile&lt;/a&gt;,
Rapid-Prototyping or Model-Driven development together with the framework Rails let you develop my application with much
more less effort and is more maintainable by driving the Test-Driven way, so you can refactor your code and don&amp;rsquo;t need
to manual test part of your basis.&lt;/p&gt;

&lt;p&gt;This project shows that it is possible to develop modular software in Java but in even greater projects it is easy to
get lost in the lost in Java code if you don&amp;rsquo;t rely on a framework.  It is even difficult to setup the project in
different IDE &amp;ndash; today you can use &lt;a href=&quot;http://vagrantup.com/&quot;&gt;Vagrant&lt;/a&gt; to create an environment which can be deployed easily
as Virtual images on different platforms.&lt;/p&gt;
</content>
    </entry>
  
    <entry>
      <title>Benefits of reading a book - and use it right after that</title>
      <link href="/benefits-of-reading-a-book-and-use-it-right-after-that.html"/>
      <updated>2011-10-15T00:00:00+02:00</updated>
      <id>/benefits-of-reading-a-book-and-use-it-right-after-that.html</id>
      <content type="html">&lt;blockquote&gt;
  &lt;p&gt;We are what we repeatedly do. Excellence, then, is not an act, but a habit.&lt;/p&gt;
    &lt;strong&gt;Aristotle&lt;/strong&gt;
&lt;/blockquote&gt;


&lt;p&gt;It&amp;rsquo;s a typical situation which every person knows: You look on your workspace and have a bunch of new books there. You
ordered them because some great guys lay their hands in the fire that you need this wisdom.  Of course you have to do a
stressful job and don&amp;rsquo;t have time to read all the things but you still must learn new things in order to develop new
skills. What should you do? I just started reading as much as I can.&lt;/p&gt;

&lt;h2&gt;What you should do during the process of reading&lt;/h2&gt;

&lt;p&gt;Don&amp;rsquo;t just read the book and put it away, read trough the table of contents, mark the parts which are interesting for
you and draw a mind map. If you have questions which should be answered by the book, it&amp;rsquo;s good because then you will
read the book with much more focus on them.&lt;/p&gt;

&lt;p&gt;Don&amp;rsquo;t just think of reading the book like in school: Cram for a test about it, get a good grade and then just forget
everything.  This isn&amp;rsquo;t good and a waste of time. Don&amp;rsquo;t say you don&amp;rsquo;t have time, just think of allocating your time
effective. For me it&amp;rsquo;s the best, just to use the new knowledge out of the book. This is the best way to get the most out
of it. What you&amp;rsquo;re right using is just as good as cooking a new meal right after reading the recipe of it. You just
inherit the procedure you recently learned with your own mind, own feelings, own observations and add your own style
(think of your own ingredients in your favorite meal).&lt;/p&gt;

&lt;h2&gt;Benefits of note taking&lt;/h2&gt;

&lt;p&gt;Years after reading the book you will maybe come in the situation where you need some of the knowledge you just have
read of this certain book you read it a lot of years ago. You know the title of the book but can&amp;rsquo;t remember anything.
Before I explain the advantage of taking notes during reading a book, I suggest you my different methods for taking
notes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;a pencil and a sheet of paper (which I personal prefer)&lt;/li&gt;
&lt;li&gt;Netbook/iPad/cellphone (there you can directly take your notes)&lt;/li&gt;
&lt;li&gt;you can use post-it or stick it to mark important passages&lt;/li&gt;
&lt;li&gt;speaking notes of certain passages which you find very interesting&lt;/li&gt;
&lt;li&gt;read an eBook with your kindle, iPhone or some other devices in
which you can take custom-notes about something&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The disadvantages of 1, 2 and 3 are carry the notes respectively the book with you (think you are on your trip to
America and don&amp;rsquo;t want to fill your hole luggage with tons of books or do you want to travel without your favorite
Simpsons trousers).&lt;/p&gt;

&lt;p&gt;Method 4 is just a reminder of important passages. If such a file is very long you have problems in searching the needed
sections &amp;ndash; you have to play forward and back and this is boring. Don&amp;rsquo;t forget the amount of space which you need to
store it. The advantage is, that you can easily take notes and train your language when your tongue is on air.&lt;/p&gt;

&lt;p&gt;The usage of a specialized device for eBook-reading is a great opportunity. You can have many books on on your device,
set bookmarks and can take notes. I think writing notes without a keyboard may have a worse usability &amp;ndash; maybe with the
iPad 2 its more easier. Of course, if you are used to this technology and you are are good then just use it. You can
make it public or lock it with a certain password. But why hidden your knowledge so that no other one can see it? Let
other benefit by your conclusions and wisdom.&lt;/p&gt;

&lt;p&gt;Personally for me the best method is to write my impressions of a read book on a sheet of paper and transform with my PC
later. A further step may be publishing your notes to your website &amp;ndash; so you have the possibility to access your thoughts
just via an Internet connection. I&amp;rsquo;m using a desktop-wiki &lt;a href=&quot;http://zim-wiki.org&quot;&gt;zim&lt;/a&gt; and wrote a bunch of handy scripts,
which transform the text directly in format of my web page.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;If I had known early I would have started with this methods during my education at school. But better later then never.
If I travel for a longer period and have a book with me, it has still some sheets of papers in it, so that I have space
to take notes.  A pencil is for me standard equipment.  So I can put every place where I read a book my thought about it
on paper. If the book is finished and I have a little bit time left, I will transform it into my Netbook and then have
my thoughts with me.&lt;/p&gt;

&lt;p&gt;So remember: In the beginning it&amp;rsquo;s just unusual to make several breaks during reading a book, which breaks your normal
flow of reading. But during these breaks you can reorder your thoughts about certain things and get new insights. I
suggest to publish it online and then see what will happen with it.&lt;/p&gt;

&lt;p&gt;Thanks to &lt;em&gt;Hanna Schütt&lt;/em&gt; and &lt;a href=&quot;http://sebastian-gerth.eu&quot; title=&quot;Sebastian Gerth&quot;&gt;Sebastian Gerth&lt;/a&gt; for reading an earlier draft of this post.&lt;/p&gt;

&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Personal_wiki#Free_software&quot;&gt;desktop-wiki&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/IPad&quot;&gt;IPad&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.thesimpsons.com/&quot;&gt;Simpsons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/dp/B0015T963C/?tag=gocous-20&amp;amp;hvadid=5266389317&amp;amp;ref=pd_sl_7caym1p0x_e&quot;&gt;kindle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Why learning a new programming language</title>
      <link href="/why-learning-a-new-programming-language.html"/>
      <updated>2011-10-08T00:00:00+02:00</updated>
      <id>/why-learning-a-new-programming-language.html</id>
      <content type="html">&lt;p&gt;&amp;ldquo;Why should you start learning a new programming language&amp;rdquo; was the questions I asked me in the 2011?  Nowadays we are
all to busy to try new things, to expand our horizon. After reading the Pragmatic solving problems In the following
chapter I will explain you, how I learned programming languages.&lt;/p&gt;

&lt;h2&gt;In the beginning there was Turbo Pascal&lt;/h2&gt;

&lt;p&gt;The first language I learned was Turbo Pascal. Everything (not only the programs) looked like a great &amp;ldquo;geek nerving god
tool&amp;rdquo;. I quite don&amp;rsquo;t understand what I was doing with Turbo Pascal as my computer science teacher told me to make some
simple calculation the perimeter for triangular and other geometric object. It was great to declare your variables and
then put them into a function and print line the outcome.  Here are some code snippets:&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/matthias-guenther/435584.js&quot;&gt;&lt;/script&gt;


&lt;p&gt;Turbo Pascal was my first procedural language and later during my studies I learned in a lecture about compiler
construction that this language was developed 1970 by Niklaus Wirth (whom I admire for building such easy and effective
techniques like the recursive descendant, but thats another tale). If you want to have this retro feeling just check
out Ubuntu resources (or other things if you want to stay up).&lt;/p&gt;

&lt;p&gt;The following images show the &amp;ldquo;IDE&amp;rdquo;. It has few options with fancy looking buttons and no options-overload.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7240/7257427894_93694bded3_b.jpg&quot; title=&quot;Nice blue environment.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7240/7257427894_93694bded3_z.jpg&quot; class=&quot;center&quot; alt=&quot;Nice blue environment.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Nice blue environment.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm9.staticflickr.com/8021/7257429850_2711abddc9_b.jpg&quot; title=&quot;A successful compilation.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8021/7257429850_2711abddc9_z.jpg&quot; class=&quot;center&quot; alt=&quot;A successful compilation.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;A successful compilation.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7235/7257429384_7bc10a9f10_b.jpg&quot; title=&quot;Syntax highlighting looks like in a old hacker movie.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7235/7257429384_7bc10a9f10_z.jpg&quot; class=&quot;center&quot; alt=&quot;Syntax highlighting looks like in a old hacker movie.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Syntax highlighting looks like in a old hacker movie.&lt;/div&gt;


&lt;p&gt;&lt;a href=&quot;http://farm8.staticflickr.com/7225/7257429250_448c1fbef6_b.jpg&quot; title=&quot;Output in a console.&quot; class=&quot;blog fancybox&quot;&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7225/7257429250_448c1fbef6_z.jpg&quot; class=&quot;center&quot; alt=&quot;Output in a console.&quot;/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;caption&quot;&gt;Output in a console.&lt;/div&gt;


&lt;p&gt;In secondary school we had written some programs in Delphi (original it had the name Object Pascal).  The new things was
that even the girls had little fun in writing programs in it (&lt;em&gt;some&lt;/em&gt; nice &amp;ldquo;Hello Kitty&amp;rdquo; in with pink color, but they
actually love it). We learned how to write functions and to create some appealing graphics. After that I lost my
interests in programming because the age of &lt;strong&gt;warhammer&lt;/strong&gt; or &lt;strong&gt;video games&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;Then Java came &amp;hellip;&lt;/h2&gt;

&lt;p&gt;When I started my studies of computer science I knew I had still no programming experience and during my first year I
had to learn Java. It was quite good and quite bad if you ask my. The good things about it was that I had to learn an
exhausting new methodologies: OOP, Interfaces, Recursion, Inheritance, Encapsulation, Polymorphism and many other
concept. I was lost, I just wanted to learn how to write simple programs and no one could tell me, why I have to write
this &lt;em&gt;public static void main (String args[])&lt;/em&gt; to start my program. My fellow students told my that I was an absolute
newbie (they were actually right).&lt;/p&gt;

&lt;p&gt;Chad Fowler wrote in his book &lt;strong&gt;The Passionate Programmer&lt;/strong&gt;: &amp;ldquo;Always be the worst guy in every band you&amp;rsquo;re in.&amp;rdquo; I
actually was it and in now time I made great progresses. But some aspects of Java hit my but: It was so long to express
simple things, so much overhead with static, private and so on. To what I mean have a look on the following code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Socke&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;farbe&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gewicht&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;istTrocken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;trockne&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;istTrocken&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;wasche&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;istTrocken&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;kt&quot;&gt;boolean&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;istTrocken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;istTrocken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;NewClass&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Socke&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Socke&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;farbe&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;schwarz&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;gewicht&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;565&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;trockne&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stinki&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;istTrocken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Ok, you may say: &amp;ldquo;It&amp;rsquo;s quite readably&amp;rdquo; but wait until you have written, about several kilo of LOCs and want to maintain
or refactor it. I thought that I could understand my &amp;ldquo;well&amp;rdquo; written mail client but well afterwards you know it better.&lt;/p&gt;

&lt;p&gt;For another term I looked on C++. It was good to see how pointer (or &lt;em&gt;references&lt;/em&gt;) are working, how you must allocate
your memory (Java has it&amp;rsquo;s ) and generics (or &lt;em&gt;templates&lt;/em&gt;) for your data structures. I nearly learned something new, C++
is like Java, it&amp;rsquo;s OOP and you can program procedural if you like to. Have a look on some code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cpp&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/*&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;* 2.1&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;* Author: Matthias Guenther&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;* function: repeated shortening of breaches with a ggT&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;* use the Euklid-Algo to compute the ggT&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;*/&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;iostream&amp;gt;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_breach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;Please input the parameters to solve the breach: a/b&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;[Input] Parameter a: &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;[Input] Parameter b: &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// look at the ggT&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;This is not allowed&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compute_ggT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shortening_factor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;The breach is:&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; Continue?&amp;quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; [Input &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;q&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; to leave the programm or &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; to &amp;quot;&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;&amp;quot;continue]&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;cout&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt; &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;q&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;q&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;shortening_breach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Enlightenment with Ruby&lt;/h2&gt;

&lt;p&gt;Normally I&amp;rsquo;m not the guy how runs after every hype but I haven&amp;rsquo;t found so far my beloved programming language. Why not
risk a look. And then there was this &amp;lsquo;Whosh&amp;rsquo; (think DC Comics). You could program in different styles, could design
your own languages (called DSL) and this nifty framework Ruby on Rails (RoR) with Test-Driven Development (TDD),
Behavior Driven Development (BDD), Continuous Integration (CI) and many more things. These things sound a like a
mystery for me, but just get started and see how &amp;ldquo;easy&amp;rdquo; you can use it with RoR. It hits my head.&lt;/p&gt;

&lt;p&gt;It was a very hard steady learning curve but it was more pleasantly then just go to the candy shop and get what you want
for nothing. You have to invest much time. But look for yourself on ruby &amp;ndash; it looks like a natural language. Just look
at a script I wrote to tag MP3:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;mp3info&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# setting the basedirectory&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;base_directory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;check/&amp;quot;&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# run through all directories and get the mp3&lt;/span&gt;
&lt;span class=&quot;no&quot;&gt;Dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;base_directory&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;**/*.mp3&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# get the directory&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;arr_directory&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;.mp3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# empty string which will be merged to a string and which is needed for file renaming as a path&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;arr_directory&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;part&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;part&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gsub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;//&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# open the mp3 to read the id3 infos&lt;/span&gt;
  &lt;span class=&quot;no&quot;&gt;Mp3Info&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# delete genre&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TCON&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Game&amp;quot;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;# check, if the track title exists&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
      &lt;span class=&quot;c1&quot;&gt;# mp3 with an underscore are translated in / so we must catch this&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;track_string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gsub&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track_string&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
      &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Please set the track-tag for &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ... NOT converted&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# save mp3 tag&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;track&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;# rename files&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kp&quot;&gt;nil&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Dir&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pwd&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;directory_of_album&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tracknum&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; - &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;.mp3&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;File&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rename&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mp3_newname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; ... converted [&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mp3_track&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tag&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;album&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;]&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Automating tasks&lt;/h2&gt;

&lt;p&gt;I resisted very long to learn the bash, but there were so many tasks over the years which I didn&amp;rsquo;t do because t gives me
the heebie-jeebies to do the same thing over and over again. After one weekend studying the open book &amp;ldquo;The Linux Command
Line&amp;rdquo; by William E. Shotts I caught fire.  For a long time I messed my desktop up with tons of images with ugly names,
so I wrote a script to change this.&lt;/p&gt;

&lt;p&gt;I have a bunch of images with ugly name, so I wrote a script to change this.  Each command has it&amp;rsquo;s purpose you have to
learn its syntax. Here is some sample code (pretty neat):&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;sh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;ls | wc -l&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0

&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;i in *.jpg; &lt;span class=&quot;k&quot;&gt;do &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$[$z&lt;/span&gt;+1&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;; mv &lt;span class=&quot;s2&quot;&gt;&amp;quot;$i&amp;quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;##*.jpg&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$z&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\_&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1&lt;/span&gt;.jpg; &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt; ; &lt;span class=&quot;k&quot;&gt;done&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# replace watermark_ (prefix)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;It&amp;rsquo;s like Lego, you have these and that, plug it together to create something new. For my diploma thesis I create a
Rakefile (the modern version of make written completely in ruby):&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Create a directory for the compiled classes&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_class_directory&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;mkdir -p classes&amp;#39;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;# overwrite the directory if it exist&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;compile the plugin and put the files in the directory&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_plugin&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fsc -d classes Plugin.scala&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;copy the plugin descriptor&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:copy_plugin_descriptor&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cp scalac-plugin.xml classes&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;create the jar file&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_jar_file&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;cd classes; jar cf ../divbyzero.jar .&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;create environment&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:create_class_directory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_plugin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:copy_plugin_descriptor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_jar_file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;done with creating the jar file ...&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;compile the traits&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:compile_traits&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fsc -d classes TraitProgrammingHelper.scala&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fsc -d classes TraitUpdaterHelper.scala&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fsc -d classes TraitArithmeticRulesHelper.scala&amp;#39;&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fsc -d classes TraitBasicRulesHelper.scala&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;create environment with traits&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment_complete&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:compile_traits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:create_environment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;run example file&amp;quot;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:test&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:create_environment_complete&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;scalac -Xplugin:divbyzero.jar Example.scala&amp;#39;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Head Scratching With Scala&lt;/h2&gt;

&lt;p&gt;I learned this language for my diploma-thesis, otherwise I still wouldn&amp;rsquo;t put a thumb on FP. So far I must say that it
was a good decision to learn an functional language. Scala showed me how to use &lt;em&gt;chained function&lt;/em&gt;, &lt;em&gt;anonymous
functions&lt;/em&gt;, &lt;em&gt;currying&lt;/em&gt;, type bounds and many more constructs. In the beginning my head howls like a steam-tank, there
was so much new terrain for me that I need several breaks to get used to it. After many hours of happy cramming I got
surprisingly insights in doing OOP better. That was is, what the Pragmatic Programmers were preaching. To get new
insight in a technology you have to regard it&amp;rsquo;s counterpart. Don&amp;rsquo;t hesitate to do something you would never do, you gain
experience and more confidence in your profession.&lt;/p&gt;

&lt;p&gt;Here is some of Scala code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;scala&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Reference&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;_&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IntegerReference&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Reference&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;Int&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Reference contains the half of &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;This was my first essay. I tried to cover the things which whom I&amp;rsquo;m actually dealing. I presented my wide route from my
programming experience so that you can see, how the things evolved for me. I always get my hands dirty and try to roll
up my sleeves to get a touch about the newest technology.  I think through adventuring you become each day a little bit
better then yesterday.&lt;/p&gt;

&lt;h2&gt;Further Reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://andy.pragprog.com/&quot;&gt;Andy Hunt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Behavior_driven_development&quot;&gt;Behavior Driven Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.capify.org&quot;&gt;Capistrano&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://chadfowler.com/&quot;&gt;Chad Fowler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Continuous_integration&quot;&gt;Continuous Integration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.dccomics.com&quot;&gt;DC comics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain-specific_language&quot;&gt;DSL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pragdave.pragprog.com&quot;&gt;Dave Thomas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29&quot;&gt;Encapsulation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/FP_%28programming_language%29&quot;&gt;FP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sanrioeurope.com/&quot;&gt;Hello Kitty&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Integrated_development_environment&quot;&gt;IDE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Inheritance_%28object-oriented_programming%29&quot;&gt;Inheritance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Interface_%28computer_science%29&quot;&gt;Interfaces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.java.com/en/&quot;&gt;Java&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.lego.com&quot;&gt;Lego&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.inf.ethz.ch/personal/wirth&quot;&gt;Niklaus Wirth&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Object-oriented_programming&quot;&gt;OOP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Object_Pascal&quot;&gt;Object Pascak&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Subtype_polymorphism&quot;&gt;Polymorphism&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://pragprog.com/titles/tpp/the-pragmatic-programmer&quot;&gt;Pragmatic Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Recursion#Recursion_in_computer_science&quot;&gt;Recursion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rubyonrails.org/screencasts&quot;&gt;Ruby on Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.scala-lang.org/&quot;&gt;Scala&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Test-driven_development&quot;&gt;Text-Driven Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gd.tuwien.ac.at/linuxcommand.org/tlcl.php&quot;&gt;The Linux commandline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pragprog.com/titles/cfcar2/the-passionate-programmer&quot;&gt;The Passionate Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Generic_programming#Templates_in_C.2B.2B&quot;&gt;generic&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pointer_%28computing%29&quot;&gt;pointer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rake.rubyforge.org/&quot;&gt;rake&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Recursive_descent_parser&quot;&gt;recursive descendant&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ubuntu.com&quot;&gt;ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Video_game&quot;&gt;video games&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.games-workshop.com&quot;&gt;warhammer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Method alias in ruby</title>
      <link href="/method-alias-in-ruby.html"/>
      <updated>2011-10-01T00:00:00+02:00</updated>
      <id>/method-alias-in-ruby.html</id>
      <content type="html">&lt;p&gt;In ruby you can create aliases for a method and variable name. This can be helpful if you want to override the behavior
of some method without changing the origin implementation of it.  &lt;code&gt;alias_method&lt;/code&gt; take a &lt;code&gt;new_name&lt;/code&gt; as a copy name of the
&lt;em&gt;old_name&lt;/em&gt; and it has the following syntax.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;alias_attribute&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;old_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;A small example:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Davi&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;capital&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Karaz-a-Karak&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:orig_capital&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:capital&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;capital&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Karaz-a-Karak rebuild&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;orig_capital&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;davi&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Davi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;davi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;capital&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# output&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;quot;Karaz-a-Karak rebuild&amp;quot;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;quot;Karaz-a-Karak&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;What is the difference between &lt;code&gt;alias&lt;/code&gt; and &lt;code&gt;alias_method&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;alias&lt;/code&gt; is more general than &lt;code&gt;alias_method&lt;/code&gt; and can be used to create an alias for global variable, regular expression
backreference (like $&amp;amp;) or an existing method. Class variables, local variables, instance variables and constants may
not be aliased.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;khemri_city&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Nehekhara&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;alias&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:orig_khemri_city&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:khemri_city&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;khemri_city&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Nehekhara new&amp;quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;khemri_city&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# output&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;quot;Nehekhara&amp;quot;&lt;/span&gt;
&lt;span class=&quot;s2&quot;&gt;&amp;quot;Nehekhara new&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;code&gt;alias_method&lt;/code&gt; must return must be called on a method. So &lt;code&gt;alias&lt;/code&gt; is more general than
&lt;code&gt;alias_method&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;It is possible with &lt;em&gt;alias_method&lt;/em&gt; to reopen a class, override a method call and you can still use the original call. In
order to maintain backward compatibility &lt;code&gt;alias_method&lt;/code&gt; are used in plugins, extensions, deprecating variables.
&lt;code&gt;Alias_method&lt;/code&gt; can be used in Rails to define action with duplicated content and remove duplicated code.&lt;/p&gt;

&lt;p&gt;Here the duplicated variant:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UsersController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;find&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;search&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The DRY variant:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UsersController&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ApplicationController&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;home&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;list&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:home&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;alias_method&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:search&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:home&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;h2&gt;Further reading&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ruby-doc.org/core/classes/Module.html#M000447&quot;&gt;alias_method&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://ruby.about.com/od/rubyfeatures/a/aliasing.html&quot;&gt;alias&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
    </entry>
  
    <entry>
      <title>Why I use Jekyll for blogging</title>
      <link href="/why-i-use-jekyll-for-blogging.html"/>
      <updated>2011-07-03T00:00:00+02:00</updated>
      <id>/why-i-use-jekyll-for-blogging.html</id>
      <content type="html">&lt;p&gt;For several years I wante to write and tried many different platforms like &lt;a href=&quot;http://wordpress.org/&quot;&gt;wordpress&lt;/a&gt;
&lt;a href=&quot;http://www.blogger.com&quot;&gt;blogger&lt;/a&gt;, or &lt;a href=&quot;http://www.tumblr.com/&quot;&gt;tumblr&lt;/a&gt;. The main problem which kept me away from writing
was just the fact, that every time I want to write I just had to do it in a new environment and not in my favorite
editor &lt;a href=&quot;http://www.vim.org/&quot;&gt;vim&lt;/a&gt;. Every system gives me the freedom to extend it in several ways but in the end it
didn&amp;rsquo;t provide me the freedom to change every tiny piece I want.  With &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;jekyll&lt;/a&gt; I can use my
favorite text editor and it really &amp;ldquo;&lt;strong&gt;turned me into a text monster&lt;/strong&gt;&amp;rdquo;. This description sounds like a holy grail, but
let me explain its abilities in the following sections.&lt;/p&gt;

&lt;h2&gt;What Jekyll is&lt;/h2&gt;

&lt;p&gt;Jekyll is a static site generator written in &lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;ruby&lt;/a&gt;. It generates static html pages. The
page is presented through several templates and then fires the whole site, were articles are written in a text markup
language like &lt;a href=&quot;http://redcloth.org/textile&quot;&gt;Textile&lt;/a&gt; or &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot;&gt;Markdown&lt;/a&gt; through
the &lt;a href=&quot;http://www.liquidmarkup.org/&quot;&gt;liquid converters&lt;/a&gt; to generate fully generated compiled website.  Don&amp;rsquo;t think that it
will be so easy for you to do it. First of all you have to learn either Textile or Markdown.  I chose textile for
writing my posts because I use Markdown to create the README files for my github account.&lt;/p&gt;

&lt;h2&gt;Setting up the environment&lt;/h2&gt;

&lt;p&gt;You need to have a valid ruby and &lt;a href=&quot;http://rubygems.org/&quot;&gt;ruby gems&lt;/a&gt; installation on your machine. A simple &lt;code&gt;gem install
jekyll&lt;/code&gt; will install the following gems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/TwP/directory_watcher&quot;&gt;directory_watcher&lt;/a&gt;: gives a list of files which change in some intervals&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Shopify/liquid&quot;&gt;liquid&lt;/a&gt;: rendering templates in a safe manner&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/ahoward/open4&quot;&gt;open4&lt;/a&gt;: creates a child process to handle &lt;code&gt;pid&lt;/code&gt;, &lt;code&gt;stdout&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot;&gt;maruku&lt;/a&gt;: (Markdown interpreter&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://rubygems.org/gems/classifier&quot;&gt;classifier&lt;/a&gt;: is a Bayes implementation and can be used semantic indexing like to
display related post &amp;ndash; this mechanism is used in machine learning)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;To get nice syntax highlighting for your code you have to install &lt;a href=&quot;http://pygments.org/&quot;&gt;pygments&lt;/a&gt; via
&lt;code&gt;sudo apt-get install python-pygments&lt;/code&gt; on Ubuntu/Debian. On the &amp;ldquo;install page(install link for
&lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/install&quot;&gt;jekyll install&lt;/a&gt; you can get more information about how to setup Jekyll.&lt;/p&gt;

&lt;h2&gt;The directories and styles&lt;/h2&gt;

&lt;p&gt;Here is the basic layout of a typical Jekyll project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_includes&lt;/code&gt;: Small snippets which can be used in every place of the page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_layouts&lt;/code&gt;: You can define layouts for post entries and the general default layout. Posts can have the special &lt;strong&gt;Yaml
Front Matter&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_posts&lt;/code&gt;: Contains all posts in your specified markup language&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_config.yml&lt;/code&gt;: Is a file to store configuration data like the styling of the URLs, or some global variables. It is
also possible to define own variables which can be used as global things on other pages.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Other files can just put on the root directory like an &lt;code&gt;atom.xml&lt;/code&gt; file (for RSS feed) or &lt;code&gt;404.html&lt;/code&gt; page. For example my
&lt;code&gt;post.html&lt;/code&gt; has the following layout:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;---
layout: layout
---
&lt;span class=&quot;nt&quot;&gt;&amp;lt;article&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;role=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;section&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;author&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    Posted by &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://twitter.com/wikimatze&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;newwindow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt; on &lt;span class=&quot;nt&quot;&gt;&amp;lt;time&amp;gt;&lt;/span&gt;Jul 03, 2011 &lt;span class=&quot;nt&quot;&gt;&amp;lt;/time&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
  
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;section&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;about-author&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Discussion and Tweets&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;about-author-image&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://twitter.com/wikimatze&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://en.gravatar.com/userimage/10525092/791987da4ba0ca49f1b8cc42bc7d4efb.png&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;About the author:&lt;span class=&quot;nt&quot;&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt; My name is Matthias Günther.
    This blog collects my thoughts about different topics as are my interests. I&amp;#39;m currently writing
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://www.padrinorb.com/&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Padrino book&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;, running &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://www.vimberlin.de&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;vimberlin&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;, and being
    a &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://railsgirlsberlin.de/&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;railsgirls-berlin&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; coach.

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;right&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://twitter.com/share&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;twitter-share-button&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-count=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;none&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-via=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;wikimatze&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Tweet&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://platform.twitter.com/widgets.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://twitter.com/wikimatze&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;twitter-follow-button&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;data-show-count=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Follow wikimatze&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://platform.twitter.com/widgets.js&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;


    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The lines between &lt;code&gt;---&lt;/code&gt; mark a special &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter&quot;&gt;Yaml Front Matter&lt;/a&gt;
This block is treated as a special block in Jekyll and can contain different components. The `` stands for
the content of a post entry.&lt;/p&gt;

&lt;h2&gt;Creating a layout&lt;/h2&gt;

&lt;p&gt;Here is the main template for my blog.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot;&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;    &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xml:lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;en&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;lang=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;en-us&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;content-type&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/html; charset=utf-8&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Why I use Jekyll for blogging&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;author&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;description&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Writings, talks and pictures by . Günther works at MyHammer, loves painting Warhammer figures, and enjoys making cakes.&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;alternate&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;application/rss+xml&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;viewport&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;width=device-width, maximum-scale=1.0&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;robots&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;noodp, nodyr&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/css/stylesheets/base.css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;media=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;screen, projection&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/css/stylesheets/syntax.css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/css/stylesheets/print.css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;media=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;print&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;shortcut icon&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://farm8.staticflickr.com/7078/7284507972_a7aa341781_t.jpg&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;image/x-icon&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;canonical&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/why-i-use-jekyll-for-blogging.html&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;alternate&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Blog of &amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;application/atom+xml&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;site&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;round&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/why-i-use-jekyll-for-blogging.html#top&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;header&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;page-header&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;role=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;banner&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;sitetitle&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/index.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;wikimatze&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;nav&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;navigation&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/about.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;about&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/projects.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;projects&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/contact.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;contact&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/follow.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;follow&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/blog.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;blog&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/talks.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;talks&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
          &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/books.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;books&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;ribbon&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;https://github.com/matthias-guenther&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;me&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;target=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;_blank&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Fork me on Github&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;seperator&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;clearer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Why I use Jekyll for blogging&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  
    

    &lt;span class=&quot;nt&quot;&gt;&amp;lt;footer&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;page-footer&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;role=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;contentinfo&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;copy;&lt;/span&gt;2012 
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;bull;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;nofollow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/why-i-use-jekyll-for-blogging.html#top&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;top&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;bull;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;nofollow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;RSS&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;bull;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;nofollow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/imprint.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;imprint&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;bull;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;nofollow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/colophon.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;colophon&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;ni&quot;&gt;&amp;amp;bull;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;a&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;nofollow&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/donate.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;surprise me&lt;span class=&quot;nt&quot;&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;span&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;last-build&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;last build: 5-7-2013&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Add fancyBox --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/js/fancybox/jquery.fancybox.css?v=2.0.6&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;media=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;screen&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/js/fancybox/jquery.fancybox.pack.js?v=2.0.6&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

  &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- Optionaly add button and/or thumbnail helpers --&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/js/fancybox/helpers/jquery.fancybox-buttons.css?v=2.0.6&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;media=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;screen&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;/js/fancybox/helpers/jquery.fancybox-buttons.js?v=2.0.6&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ready&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.fancybox&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fancybox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;wrapCSS&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;fancybox-custom&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
          &lt;span class=&quot;nx&quot;&gt;closeClick&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;

          &lt;span class=&quot;nx&quot;&gt;helpers&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
              &lt;span class=&quot;nx&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;inside&amp;#39;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;overlay&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
              &lt;span class=&quot;nx&quot;&gt;css&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;s1&quot;&gt;&amp;#39;background-color&amp;#39;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;#eee&amp;#39;&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
          &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
   &lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I&amp;rsquo;m using the meta-language &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; to create my CSS. There is one problem with Sass: You have to
compile it every time you made a change. Fortunately, there is the &lt;a href=&quot;http://compass-style.org/&quot;&gt;compass&lt;/a&gt; which always
compiles my sass file when I change it. When I build my page I started with &lt;code&gt;compass watch css/ &amp;amp;&lt;/code&gt; a command to automate
Sass building. This is very handy when changing the layout.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Just look on &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/Sites&quot;&gt;other pages&lt;/a&gt; what is possible with Jekyll. You can learn
many new things by looking at other Jekyll blogs and copy what you need. I love to write a little bit and after I
finished an article just perform &lt;code&gt;rake deploy&lt;/code&gt; to upload my blog.&lt;/p&gt;
</content>
    </entry>
  
</feed>
