all repos — h3rald @ 4fa231fe644b664425d0c6f11f000902b4b3408d

The sources of https://h3rald.com

Added contents.
h3rald h3rald@h3rald.com
Sat, 05 Aug 2017 13:35:05 +0200
commit

4fa231fe644b664425d0c6f11f000902b4b3408d

parent

c37ffc546087434e3c1af95d8e109d66ac55a9b3

163 files changed, 10323 insertions(+), 6 deletions(-)

jump to
A contents/403.html

@@ -0,0 +1,5 @@

+----- +title: Forbidden +content-type: page +----- +<p>There&#8217;s obviously nothing to see here. Go <a href="">home</a>!</p>
A contents/404.html

@@ -0,0 +1,5 @@

+----- +title: Page Not Found +content-type: page +----- +<p>The page you&#8217;re looking for cannot be found. Try searching the <a href="/archives/">archives</a>, maybe you&#8217;ll have better luck!</p>
A contents/500.html

@@ -0,0 +1,5 @@

+----- +title: Internal Server Error +content-type: page +----- +<p>Something went wrong. Try to go back <a href="/">home</a> and if things improve. If not, send a <a href="/">tweet</a> to <em>@h3rald</em> and I&#8217;ll try to sort it out.</p>
A contents/about.html

@@ -0,0 +1,18 @@

+----- +title: About +content-type: page +----- +<p>H3RALD.com was created in 2004 by Fabio Cevasco, a system architect, technical writer, programmer and IT enthusiast. It features over a hundred <a href="/archives/">articles</a> covering a wide range of topics, from programming to writing, productivity and traveling.</p> +<p>As of version 8, H3RALD.com is a completely static web site, except for a few <span class="caps">AJAX</span> calls. All the files are generated automatically thanks to the <a href="http://nanoc.stoneship.org/">nanoc</a> publishing system, an ingenious creation of <a href="http://www.stoneship.org/">Denis Defreyne</a>. Nanoc can be used to easily create static web sites using Ruby, as explained in <a href="http://www.h3rald.com/articles/take-back-your-site-with-nanoc/">this article</a>.</p> +<p>The following ruby libraries (gems) are used to compile this web site:</p> +<ul> + <li><a href="https://rubygems.org/gems/nanoc">nanoc</a>, to generate the entire web site</li> + <li><a href="https://rubygems.org/gems/extlib">Extlib</a>, in some custom Rake tasks</li> + <li><a href="https://rubygems.org/gems/bb-ruby">BB-Ruby</a>, for BBCode support</li> + <li><a href="https://rubygems.org/gems/builder/">Builder</a>, to create <span class="caps">RSS</span> and <span class="caps">ATOM</span> feeds</li> + <li><a href="https://rubygems.org/gems/less/">Less</a>, for the <span class="caps">SASS</span> filter</li> + <li><a href="https://rubygems.org/gems/therubyracer">The Ruby Racer</a>, to execute Javascript code (needed by Less)</li> + <li><a href="https://rubygems.org/gems/redcloth/">RedCloth</a>, for Textile support</li> + <li><a href="https://rubygems.org/gems/rdiscount">RDiscount</a>, for Markdown support</li> + <li><a href="https://rubygems.org/gems/glyph">Glyph</a>, for Glyph support</li> +</ul>
A contents/articles/10-programming-languages.html

@@ -0,0 +1,205 @@

+----- +title: 10 programming languages worth checking out +content-type: article +subtitle: A quick comparison of 10 non-mainstream programming languages +popular: true +timestamp: 1229868075 +tags: programming +----- +<blockquote> +<p>&mdash; This article has been translated into <a href="http://science.webhostinggeeks.com/10-programskih-jezika">Serbo-Croatian</a> by <cite><a href="http://webhostinggeeks.com/">Web Geeks</a></cite> &mdash;</p> +</blockquote> +<p>If you program for fun or profit, chances are that you know C, C++, Java, <span class="caps">PHP</span>, Perl, Python or Ruby. These programming languages are all widely known, and, to a different degree, used in commercial applications. At least some of them can safely be considered <em>mainstream</em>, even if that word has become so overused and misused that has almost lost its original meaning, if it ever had one.</p> +<p>If you are earning your living by coding, it&#8217;s often one of these languages that pays the bills. Nevertheless, true hackers frequently meander in other directions, exploring and discovering different paradigms and methodologies, sometimes to the most <a href="http://esolangs.org/wiki/Main_Page">esoteric</a> extremes.</p> +<blockquote> +<p>&#8220;The most obvious common &#8216;personality&#8217; characteristics of hackers are high intelligence, consuming curiosity, and facility with intellectual abstractions. Also, most hackers are &#8216;neophiles&#8217;, stimulated by and appreciative of novelty (especially intellectual novelty). Most are also relatively individualistic and anti-conformist.&#8221;</p> +</blockquote> +<p style="padding-left:4em;">&ndash; Eric S. Raymond, <cite><a href="http://catb.org/jargon/html/personality.html">The Jargon File</a></cite></p> +<p>Even if you&#8217;re particularly devoted to one of the languages mentioned above, it is normal to be curious about what else is out there. As the end of the year approaches, I find myself thinking about learning &ndash; or at least become acquainted with &ndash; some less known, more experimental, programming languages.<br /> +I was originally planning on learning another programming language as a New Year&#8217;s Resolution, which is quite common among programmers. The most difficult task turned out to be <em>choosing</em> a particular language: there are so many out there which makes it very hard to decide.</p> +<p>This article deals with ten possible candidates, and it&#8217;s far from being an exhaustive list. The programming languages described henceforth are very different from each other, but they all have one thing in common: they all stimulate my curiosity in their own, very different ways.</p> +<h3 id="haskell">Haskell</h3> +<p>I tried to learn Haskell in the past. Quietly, I started diving into the multitude of articles, tutorials, overviews and even books about this fascinating academic language which claims to achieve functional purity though remaining extremely useful, practical and efficient. Sadly, I&#8217;m still not able to fully grasp some of its most crucial concepts, such as <a href="http://en.wikibooks.org/wiki/Programming:Haskell_monads">monads</a>, but this still doesn&#8217;t put me off <em>wishing</em> to learn the language.</p> +<p>If you&#8217;ve never enountered Haskell before, I find <a href="http://www.willamette.edu/~fruehr/haskell/evolution.html">The Evolution of a Haskell Programmer</a> an amusing and informative read. Although aiming to be humorous in a way, it serves a very important didascalic purpose: it is one of the most complete collections of the different paradigms and programming approaches Haskell allows.</p> +<p>Besides its very elegant, pragmatic and almost-magical syntax, what really intrigues me about this language is what it offers, in terms of features:</p> +<ul> + <li>9 different <a href="http://www.haskell.org/haskellwiki/Implementations">implementations</a> (multiple compilers <em>and</em> interpreters)</li> + <li>Countless <a href="http://haskell.org/ghc/docs/latest/html/libraries/">standard libraries</a> <a href="http://hackage.haskell.org/packages/archive/pkg-list.html">packages</a> which can be used to solve <em>any</em> programming challenge</li> + <li>Abundant <a href="http://www.haskell.org/haskellwiki/Books_and_tutorials">learning material</a></li> + <li><a href="http://www.haskell.org/haskellwiki/Why_Haskell_matters#The_speed_of_Haskell">Speed</a> that rivals C and C++</li> + <li>Very mature cross-platform compatibility</li> +</ul> +<p>The catch? It is likely to be very different from any other language you might have encountered before, and that&#8217;s probably the reason why some people find it difficult to learn and master. That being said, if you are looking for a challenging (but very rewarding, I believe) New Year&#8217;s Resolution, you should definitely go for this.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://www.haskell.org/">Official Haskell Wiki</a></li> + <li><a href="http://en.wikibooks.org/wiki/Haskell">Haskell Wikibook</a></li> + <li><a href="http://book.realworldhaskell.org/read/index.html">Real World Haskell</a></li> + <li><a href="http://cdsmith.wordpress.com/2007/07/29/37-reasons-to-love-haskell-playing-off-the-ruby-article/">37 Reasons to Love Haskell</a></li> + <li><a href="http://antoniocangiano.com/2007/03/13/haskell-eye-for-the-ruby-guy/">Haskell for the Ruby Guy</a></li> + <li><a href="http://www.techworld.com.au/article/261007/-z_programming_languages_haskell">A-Z of Programming Languages: Haskell</a></li> + <li><a href="http://learnyouahaskell.com/">Learn you a Haskell for Great Good!</a></li> + <li><a href="http://cgi.cse.unsw.edu.au/~dons/blog/2008/05/16">Haskell Hacking</a></li> +</ul> +<h3>Erlang</h3> +<p><a href="http://erlang.org/">Erlang</a> is a concurrent programming language originally developed by Ericsson for their real-time applications. It goes without saying that with these premise, Erlang seems the most natural answer to all concurrency problems you may encounter in your life as a programmer.<br /> +Developing with concurrency in mind feels natural and easy in Erlang, and the performance of Erlang-powered systems can be unmatched.</p> +<p>Quite a few interesting applications have been developed in this language, such as:</p> +<ul> + <li><a href="http://couchdb.apache.org/">CouchDB</a>, a popular distributed, document-oriented database</li> + <li><a href="http://yaws.hyber.org/">Yaws</a>, a high-performance web server</li> + <li>even <a href="http://www.facebook.com/note.php?note_id=14218138919&amp;id=9445547199">Facebook Chat</a></li> +</ul> +<p>The price Erlang adepts have to pay, as Damien Katz (CouchDB creator and Erlang enthusiast) <a href="http://damienkatz.net/2008/03/what_sucks_abou.html">points out</a>, is:</p> +<ul> + <li>Awkward syntax, inspired by Prolog</li> + <li>Weird if expressions</li> + <li>Difficult string operations</li> + <li>No classes or namespaces</li> +</ul> +<p>&#8230;this list could go on. Damien&#8217;s article is an interesting read, enough to put anyone off learning the language if read superficially. On the other hand, it provides an invaluable resource for newcomers who wish to be prepared before taking on the challenge of learning Erlang to build their next scalable, concurrent and industry-proof application.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://www.erlang.org/">Official Erlang Web Site</a></li> + <li><a href="http://www.onlamp.com/pub/a/onlamp/2007/09/13/introduction-to-erlang.html">An Introduction to Erlang</a></li> + <li><a href="http://www.defmacro.org/ramblings/concurrency.html">Erlang Style Concurrency</a></li> + <li><a href="http://www.planeterlang.org/">PlanetErlang</a></li> + <li><a href="http://www.erlang-projects.org/">Erlang Projects</a></li> +</ul> +<h3 id="io">Io</h3> +<p><a href="http://iolanguage.com/">Io</a> is a relatively new programming language by Steve Dekorte which recently surfaced from Google&#8217;s oblivion (if you tried googling for it a few months ago, you couldn&#8217;t event find its home page) thanks to a short vut stimulating <a href="http://hackety.org/2008/01/05/ioHasAVeryCleanMirror.html">article</a> by <a href="http://whytheluckystiff.net/">_why</a>. It doesn&#8217;t have the best name for a programming language, that&#8217;s for sure, but it&#8217;s definitely a breath of fresh air in terms of the way it works.</p> +<p>Its unusual, minimalist and yet elegant and powerful syntax reminds of Smalltalk, but the language goes far beyond that. Io is an object-oriented, prototype-based, message-based and fully-reflective programming language. This means that you use messages like in Smalltalk, you create objects like in Javascript and every bit of your code can be inspected and passed around as you see fit.</p> +<p>If you think Ruby allows fancy (and potentially dirty) tricks like metaprogramming and monkey-patching, Io takes this to a whole different level, imposing virtually no limitation to the programmer. What&#8217;s truly amazing is that its grammar and syntax are so minimal that you can learn them in literally 10 minutes. After that, you can start experimenting, first with its extremely small core and then with its extension libraries and bindings.</p> +<p>Io has indeed a lot of potential. Granted, it&#8217;s still young and under development, but also already quite efficient and suitable for real-world tasks demanding high speed and concurrency. It is implemented in C, but Ola Bini started to design a similar language called <a href="http://kenai.com/projects/ioke/">Ioke</a> for the Java Virtual Machine.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://iolanguage.com/">Official Io Web Site</a></li> + <li><a href="http://github.com/stevedekorte/io/tree/master">Io Repository on Github</a></li> + <li><a href="http://tech.groups.yahoo.com/group/iolanguage/">Io user group</a></li> + <li><a href="http://hackety.org/2008/01/05/ioHasAVeryCleanMirror.html">Io has a very clean mirror</a></li> + <li><a href="http://iota.flowsnake.org/">Io Notes</a></li> + <li><a href="http://wiki.type-z.org/index.php/Io/IoLanguage">Io Language Notes</a></li> + <li><a href="http://ozone.wordpress.com/2006/03/15/blame-it-on-io/">Blame it on Io! A slow-paced introduction to the Io language</a></li> + <li><a href="http://en.wikibooks.org/wiki/Programming:Io">Io Wikibook</a></li> +</ul> +<h3 id="plt-scheme"><span class="caps">PLT</span> Scheme</h3> +<p>I stumbled upon the <a href="http://plt-scheme.org/"><span class="caps">PLT</span> Scheme web site</a> while browsing for different Lisp flavors about a year ago. At the time, I was determined to learn the rudiments of Lisp and I started reading a few articles and books on this old and yet still popular language.<br /> +Although I was originally put off by certain Common Lisp literature, which dismissed Scheme as an almost-heretic attempt to revitalize an venerable language, I soon found out that Scheme &ndash; and <span class="caps">PLT</span> Scheme in particular &ndash; is definitely worthy of attention and interest.</p> +<p>Being a technical writer, I immediately became fond of the <a href="http://docs.plt-scheme.org/guide/"><span class="caps">PLT</span> Scheme Guide</a>, one of the clearest and most well-organized examples of documentation available for a programming language I&#8217;ve ever come across.<br /> +The manual is exquisitely crafted as a Getting Started Manual and a Reference Book at the same time, though remaining pleasant to read sequentially: a rare trait in technical documentation. Best of all, it&#8217;s free: you simply have no real excuse not to read it.</p> +<p>Besides its excellent documentation, <span class="caps">PLT</span> Scheme feels like a fresh and modern implementation of one of the two most important dialects of Lisp. It&#8217;s cross-platform, it has an extensive <a href="http://planet.plt-scheme.org/">collection of packages</a> and a very active community behind it. <br /> +After my first attempt to learn Haskell, I felt compelled to try out <span class="caps">PLT</span> Scheme and it immediately felt much easier and more user friendly to learn, partly because of <a href="http://download.plt-scheme.org/drscheme/">DrScheme</a> a dedicated <span class="caps">IDE</span>/learning tool optimized to get you started and feel comfortable with the language.<br /> +Caveats? None, unless you have an adversion for parenthesis, that is.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://plt-scheme.org/">Official <span class="caps">PLT</span> Scheme Web Site</a></li> + <li><a href="http://docs.plt-scheme.org/guide/index.html"><span class="caps">PLT</span> Scheme Guide</a></li> + <li><a href="http://planet.plt-scheme.org/">PLaneT</a></li> + <li><a href="http://docs.plt-scheme.org/quick/">Quick: An Introduction to <span class="caps">PLT</span> Scheme with Pictures</a></li> + <li><a href="http://docs.plt-scheme.org/more/">More: Systems Programming with <span class="caps">PLT</span> Scheme</a></li> +</ul> +<h3 id="clojure">Clojure</h3> +<p><a href="http://clojure.org/">Clojure</a> is the most recent and notable attempt to bring Lisp back to life and ready to face the challenges posed to IT systems by the new century: concurrency and scalability. Because it runs on the Java Virtual Machine, you also get Java interoperability for free, in a more Lispy flavour. Although I&#8217;m a bit reluctant to deal with anything related to Java nowadays, Clojure&#8217;s approach makes it more appealing.</p> +<p>Unlike other Lisps (and Schemes) you may have encountered before, Clojure comes with some interesting additions:</p> +<ul> + <li><a href="http://clojure.org/multimethods">Multimethods</a></li> + <li><a href="http://clojure.org/agents">Agents asynchronous actions</a></li> + <li>Some interestings <a href="http://clojure.org/special_forms">special forms</a></li> + <li>Many pre-built <a href="http://clojure.org/data_structures">data structures</a>, like Vectors, Maps, Sets, Collections, &#8230;</li> +</ul> +<p>Despite all this, Rich Hickey became increasingly popular both in the Lisp and Java world for creating such an interesting and well-designed language. Unlike with many new (and old) programming languages, I have yet to find a single blog post or article which is seriously criticizing Clojure in any way.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://clojure.org">Official Clojure Web Site</a></li> + <li><a href="http://groups.google.com/group/clojure">Clojure User Group</a></li> + <li><a href="http://www.infoq.com/presentations/hickey-clojure">Clojure presentation on InfoQ</a></li> + <li><a href="http://netzhansa.blogspot.com/2008/10/trying-clojure.html">Trying Clojure</a></li> + <li><a href="http://groups.google.com/group/clojure/msg/f038decc18c7da37">My first look at Clojure</a></li> + <li><a href="http://enclojure.net/Index.html">Enclojure</a></li> +</ul> +<h3 id="squeak">Squeak</h3> +<p><a href="http://www.squeak.org/">Squeak</a> has become one of the most popular Smalltalk implementations available. It has been used in some very interesting projects:</p> +<ul> + <li><a href="http://wiki.laptop.org/go/Smalltalk_Development_on_XO">EToys</a>, a kids-oriented but powerful development environment built in Squeak, was included as part of the educational sofware suite of the <a href="http://www.laptop.org"><span class="caps">OLPC</span></a>.</li> + <li><a href="http://www.seaside.st/">Seaside</a> is a modern and very productive web framework running on Squeak.</li> + <li><a href="http://www.croquetproject.org/index.php/Main_Page">Croquet</a> is a development solution to build complex, multi-user virtual worlds.</li> +</ul> +<p>If you ask <a href="http://www.stonehenge.com/merlyn/">Randal Schwartz</a>, he&#8217;ll explain you <a href="http://www.infoq.com/articles/smalltalk-comeback-schwartz">why</a> Squeak and Smalltalk are at least worth a look. Personally, while I&#8217;m attracted by Smalltalk&#8217;s unique approach to programming and its friendly syntax, I am still a bit overwhelmed by the way it works. <br /> +Squeak, and Smalltalk in general, runs inside (literally) a virtual machine written in Squeak itself. This means that:</p> +<ul> + <li>You write your code inside Squeak</li> + <li>You debug, inspect and interact your code inside squeak</li> + <li>You run your code inside Squeak</li> + <li>You can install Squeak on virtually any platform, including mobile phones, fairly easily</li> +</ul> +<p>Everything lives inside Squeak. It&#8217;s very weird to picture this without actually trying it, so I suggest you <a href="http://www.squeak.org/Download/">download it</a> and give it a try: it will definitely be an unusual but intriguing experience.</p> +<p>Smalltalk takes programming to a whole different level, which is simply unimaginable for other languages. In return, it asks you to fully embrace the Smalltalk way of doing things, according to which external text editors, external version control systems and other common tools familiar to traditional programmers simply loose their purpose.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://www.squeak.org/">Official Squeak Web Site</a></li> + <li><a href="http://squeakbyexample.org/">Squeak by Example</a></li> + <li><a href="http://www.squeakland.org/">SqueakLand</a></li> + <li><a href="http://www.infoq.com/articles/smalltalk-comeback-schwartz">Ruby&#8217;s Roots: Smalltalk Comeback and Randal Schwartz on Smalltalk</a></li> + <li><a href="http://twit.tv/floss29"><span class="caps">FLOSS</span> Weekly 29: Dan Ingalls</a></li> +</ul> +<h3 id="ocaml">OCaml</h3> +<p>Like Smalltalk, <a href="http://caml.inria.fr/">OCaml</a> has been getting more attention recently than in the past. Sure, not everyone is planning to learn is these days, but after reading <a href="http://enfranchisedmind.com/blog/2008/04/14/useful-things-about-static-typing/">this article</a> I admit I was eager to give it a proper try.</p> +<p>Despite being statically typed, OCaml offers some of the features which are common in dynamically typed languages like Ruby, such as duck typing, the possibility of creating Domain-Specific Languages and even extending the language syntax with custom operators and constructs.</p> +<p>Additionally, the <a href="http://batteries.forge.ocamlcore.org/">OCaml Batteries Included</a> project was created as an attempt to bundle a standard set of commonly-used library together with the language core. Even if this project is still in alpha stage, it definitely <a href="http://dutherenverseauborddelatable.wordpress.com/2008/11/07/a-taste-of-ocaml-batteries-included/">looks promising</a>.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://caml.inria.fr/">Official Caml Web Site</a></li> + <li><a href="http://www.ocaml-tutorial.org/">Objective Caml Tutorial</a></li> + <li><a href="http://www.csc.villanova.edu/~dmatusze/resources/ocaml/ocaml.html">A Concise Introduction to Objective Caml</a></li> + <li><a href="http://wiki.cocan.org/">The OCaml Alliance Network</a></li> + <li><a href="http://ocamlnews.blogspot.com/">OCaml News</a></li> + <li><a href="http://batteries.forge.ocamlcore.org/">OCaml Batteries Included</a></li> +</ul> +<h3>Factor</h3> +<p><a href="http://factorcode.org/">Factor</a> is to Forth what <a href="http://clojure.org">Clojure</a> is to Common Lisp: a reincarnation of an ancient language in a more modern and practical form. In the specific case, although it borrows from Lisp and Self as well, Factor retains the main characteristics of its ancestor: it&#8217;s stack-based, concatenative and has postfix notation.<br /> +While this is enough to put some people off, if you digg deeper you&#8217;ll discover that Factor offers all the most important features available in contemporary programming languages: garbage collection, dynamic typing, an object system, &#8230; they&#8217;re just presented in a very different way:</p> +<blockquote> +<p>&#8220;Learning Factor is tough. One reason for this is that Factor is very different from other programming languages. Programmers today are used to imperative programming languages where data is stored and passed around in named variables (or function calls, which name their variables). Factor is the opposite of this. A lot of code tends to be written in a functional style, and even more jarringly, variables are rare, only referenced in a small fraction of words. Nobody intends to change any of this; it&#8217;s a feature, not a bug!&#8221;</p> +</blockquote> +<p style="padding-left:3em;">&ndash; Daniel Ehrenberg, <cite><a href="http://useless-factor.blogspot.com/2008/01/learning-factor.html">Learning Factor</a></cite></p> +<p>Like Haskell, Factor demands a completely different programming approach to what you may be used to, but once you get past that, it can be as useful as any other language, if not more. The <a href="http://docs.factorcode.org/content/article-furnace.html">Furnace</a> web framework, which powers the <a href="http://concatenative.org/">Concatenative</a> wiki, is entirely built in Factor and runs on top of a Factor web server.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://factorcode.org/">Official Factor Web Site</a></li> + <li><a href="http://concatenative.org/wiki/view/Factor">Factor on the Concatenative Wiki</a></li> + <li><a href="http://docs.factorcode.org/">Factor Documentation</a></li> + <li><a href="http://learnfactor.org/">Learn Factor</a></li> + <li><a href="http://planet.factorcode.org/">Planet Factor</a></li> +</ul> +<h3 id="lua">Lua</h3> +<p><a href="http://www.lua.org/">Lua</a> (&#8220;Moon&#8221; in Portuguese), is a lightweight and fast scripting language which can be easily embedded in other systems. Compared to the other languages mentioned in this article, it is definitely the less alien of the lot: if you know a tiny bit of C or Java, you&#8217;ll be able to understand (and possibly write) 80% of Lua code without reading a single line of its documentation.</p> +<p>Despite its simplicity, Lua is considered a multi-paradigm language supporting imperative, functional and even object-oriented approaches. More specifically, Lua&#8217;s <em>tables</em> provide a simple but powerful way to create arrays, hashes and even classes (or better, prototypes). Simple (and multiple) inheritance is achieved through <em>metatables</em>, which allow calls to undefined functions to be <em>transferred</em> to parent tables.</p> +<p>Lua programs are not interpreted in the traditional way: they are compiled to bytecode and then executed in the Lua Virtual Machine. As a result, Lua code tends to be executed much faster than other interpreted languages, so fast that &#8220;as fast as Lua&#8221; has become a proverbial expression.<br /> +Lua found its niche in embedded applications and games development, basically everywhere there&#8217;s the need to provide a fast scripting language which is also very easy to learn and extend with C or other languages.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://www.lua.org/">Official Lua Web Site</a></li> + <li><a href="http://www.lua.org/manual/">Lua Manual</a></li> + <li><a href="http://lua-users.org/">Lua-users</a></li> + <li><a href="http://icculus.org/~theoddone33/lua/">Learning Lua</a></li> + <li><a href="http://lua.gts-stolberg.de/en/index.php?uml=1">Lua for Beginners</a></li> +</ul> +<h3 id="scala">Scala</h3> +<p>You may not be happy to see <a href="http://www.scala-lang.org/">Scala</a> in this list instead of other very valid and equally powerful languages for the Java Virtual Machine such as <a href="http://groovy.codehaus.org/">Groovy</a>. While there was no doubt on whether Clojure should have been included or not, I was a bit hesitant to include Scala. In the end, I chose to do so simply because Scala fits better in this list than other languages: as you should have noticed by now, I am somehow more inclined to learn functional languages as opposed to their object-oriented counterparts.</p> +<p>Scala is both object oriented and functional. It offers the best of both worlds: classes, traits and mixins which may be familiar to <span class="caps">OOP</span> lovers but also anonymous functions, currying and pattern matching which may please Haskell enthusiasts. Additionally, it&#8217;s also compatible with Java: so if you use Java for work, trying out Scala for pleasure is definitely the most logical next step, especially if you want to experiment with functional programming in the meantime.</p> +<p>Compared to learning a fully-functional (no pun intended) language like Haskell, Clojure or <span class="caps">PLT</span> Scheme, learning Scala is definitely easier and will feel less alien.</p> +<h4>To get you started&#8230;</h4> +<ul> + <li><a href="http://www.scala-lang.org/">Official Scala Web Site</a></li> + <li><a href="http://blogs.zdnet.com/Burnette/?p=690">The Case for Scala</a></li> + <li><a href="http://scala.sygneca.com/">Scala Wiki</a></li> + <li><a href="http://grok-code.com/75/learning-scala-with-project-euler/">Learning Scala with Project Euler</a></li> + <li><a href="http://www.codecommit.com/blog/scala/roundup-scala-for-java-refugees">Roundup: Scala for Java Refugees</a></li> +</ul> +<h3>Epilogue</h3> +<p>There are so many interesting programming language out there that it&#8217;s very hard to keep track of all of them. I hope this list can aid you in the right direction, whichever it may be. <br /> +Some people may debate over the very essence of this article: why <em>choosing</em> a programming language? Why spending time and energy in a task which may lead to a lot of confusion in your mind and lead you nowhere? What&#8217;s the purpose of learning something which may feel totally alien to you?</p> +<p>A programming language is ultimately just a tool to get your job done. If you have to write an end-user, desktop <span class="caps">GUI</span> application which will always run on Windows and which needs to inteface with Microsoft technologies, you&#8217;ll choose C# over Haskell, there&#8217;s no doubt about that. Especially if 500 developers in your company already develop in C# and you don&#8217;t, as a matter of fact, have a saying on the matter.</p> +<p>But what if you <em>could</em> choose? What if you wanted to develop your own geeky command line application to automate a particular task for yourself, and not because someone else tells you to do so? Would you be willing to experiment with something totally different and potentially difficult just for the sake of learning new things?</p> +<p>If the answer is yes, then you should take a look at this list again. Not now, maybe not this month or this year, but when you feel the time is right, and give one of these languages a shot. It may not end well (so far I attempted to learn Haskell twice, with no luck), but I promise you it will be worthwhile, in the long run. <br /> +If you already mastered some of these languages already, or even all of them, be assured that they&#8217;re plenty out there ready to be discovered and open your mind even more. Or, if you prefer, there are a lot of minds out there which may need guidance in learning and discovery. Help them. Write articles, tutorials, books, educate and evangelize: ultimately, that will be your greatest reward.</p>
A contents/articles/10-reasons-to-learn-ruby.html

@@ -0,0 +1,107 @@

+----- +title: 10 Reasons to Learn Ruby +content-type: article +subtitle: Ten possible reasons to learn the Ruby Programming Language +popular: true +timestamp: 1188988800 +tags: ruby +----- +<h3>Preamble</h3> +<p>I discovered Ruby fairly recently, through the excellent Ruby on Rails framework<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup>. Although I don&#8217;t consider myself a Ruby expert by any means, I read the PickAxe<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup>, I&#8217;ve coded a few utilities for my personal use in Ruby and I&#8217;m currently developing with Rails during my free time.</p> +<p>Ruby is currently my programming language of choice; I started off with Turbo Pascal in high school, discovered C and C++ at university, did my thesis in Java and learned <span class="caps">PHP</span> from scratch because I wanted to learn how to make websites quickly and easily. I guess I feel compelled to code sometimes, more as a form of entertainment than anything else. Rather dissatisfied with what I tried language-wise, I was determined to start learning either Python or Ruby. I chose the latter because I didn&#8217;t want incorrect indentation to break my code<sup class="footnote" id="fnr3"><a href="#fn3">3</a></sup>, and here I am, heaping praise upon it.</p> +<p>There are plenty<sup class="footnote" id="fnr4"><a href="#fn4">4</a></sup> of introductions, tutorials, articles and essays of different sorts which aim to guide the novice and advise the guru on how to get the most out of Ruby. This article, however, is not one of them.</p> +<p>It&#8217;s more of a modest, humble, and incomplete list of a few reasons which may (or may not) entice you to use Ruby or at least play with it a bit. A word of caution: if you are using another programming language for work or whatever, don&#8217;t complain to me if you don&#8217;t want to use it anymore &#8211; that&#8217;s exactly what happened to me, but luckily, it didn&#8217;t matter. Ruby is a very beautiful and elegant language, but like all things of this sort, it may well poison your mind and corrupt your soul&#8230;</p> +<p>You have been warned.<br /> +h3. Why learn Ruby?</p> +<h4>#1 &#8211; You get all the treats without the tricks</h4> +<p>Ruby borrows from all the best programming languages out there, from smalltalk to Java, Perl to Python<sup class="footnote" id="fnr5"><a href="#fn5">5</a></sup>. Basically, here&#8217;s the features and functionalities Ruby gives you which you may have seen elsewhere:</p> +<ul> + <li><em>Exceptions:</em> Believe it or not, exceptions are one of the most important things to master when developing any kind of application. PHP4 programmers probably won&#8217;t know anything about them and they&#8217;ll tell you to just print stuff on the screen or use their &#8220;extremely advanced&#8221; class for error handling. Please, ignore them. Fortunately for all of us, Ruby comes with try/catch (or better, begin/rescue) blocks and a series of predefined, extensible Exceptions to handle errors properly.</li> + <li><em>Namespaces:</em> Ruby modules make excellent and easy-to-use namespaces, for the joy of Java and C++ enthusiasts.</li> + <li><em>Built-in Regular Expressions:</em> For all the Perl monkeys, you can put something between slashes and it will become a regular expression, ready to be matched with a =~ operator.</li> + <li><em>Overloadable operators:</em> Ruby lets you define operators like +, -, etc., for any of your classes.</li> + <li><em>Packages:</em> Called &#8220;gems&#8221;, they really are solid and precious indeed&#8230;and they work! Packages support dependencies, and they can be either cross-platform or platform-dependent.</li> + <li><em>Interactive Shell:</em> the Interactive Ruby Shell can be used to test Ruby code instantly, similar to the Python console.</li> + <li><em>Unit Testing</em>: The <code>Test::Unit</code> module makes things so easy that you really don&#8217;t have any excuse not to test your code.</li> +</ul> +<h4>#2 &#8211; You&#8217;ll love the little things</h4> +<p>Ruby is elegant. Why&#8217;s that? Because it doesn&#8217;t focus on making code <em>concise</em> so much as <em>readable and usable</em>. Here are some tips to help you out:</p> +<ul> + <li>You can use both <em>if</em> and <em>unless</em> in condition statements. Of course you can just use <em>if</em> and negate the condition, but <em>unless</em> can be less error-prone at times. Furthermore, you can use both operators as conditional modifiers, after a statement rather than before: <em>order.new unless order.exists</em>.</li> + <li>You can use question marks and exclamation marks at the end of your methods. Although no convention is enforced, ? is added if the method should return true or false, while ! is used to clarify that the method does something forcefully, like destroying a database record, chopping off the last character of a string, etc.</li> + <li>You can use the <em>alias</em> directives to create an alias for a method already defined. In this way you can have an <em>exist</em> and an <em>exists</em> method at no additional cost or repetition.</li> + <li>You can use the <em>attr_reader</em>, <em>attr_writer</em> or <em>attr_accessor</em> directives to automatically generate getter and setter methods for specified class members.</li> + <li>Some naming conventions are enforced for your own sanity: constants, classes and modules are capitalized, methods and members must start with a lowercase letter; global variables are prepended by a $, instance variables by <code>@</code> and class variables by <code>@@</code>; etc.</li> + <li>Parentheses are optional in method calls. You can therefore write <em>File.open(&#8220;/home/h3rald/test.txt&#8221;)</em> or simply <em>File.open &#8220;/home/h3rald/test.txt&#8221;</em>, which is particularly handy with methods that don&#8217;t take parameters.</li> +</ul> +<h4>#3 &#8211; You won&#8217;t ever use a semicolon again</h4> +<p>You want to add another instruction? Just go on the next line. Hit <return> and you&#8217;re done. In Ruby, like in Python, newlines matter and you don&#8217;t have to remember to end your instructions with a semicolon. Unfortunately this means that you won&#8217;t be able to write your whole program in a single line of code, like the C++ folks&#8230; that&#8217;s too bad, isn&#8217;t it?</p> +<p><strong><span class="caps">UPDATE</span>:</strong> Indeed you <span class="caps">CAN</span> use semicolons as line delimiters in Ruby as well, the point, however, is that you don&#8217;t have to.</p> +<h4>#4 &#8211; Everything is an object, as it should be</h4> +<p>When I studied Java they taught me that everything is an object.</p> +<p><em>- &#8220;So 14 and 374346.678 are objects then?&#8221;</em><br /> +<em>- &#8220;No, silly, they are numbers!&#8221;</em></p> +<p>In Ruby, numbers, strings, Boolean values <em>et al</em> are objects. Really. This means you&#8217;ll write things like:</p> +<div class='ruby'><pre><code>"YOU SHOULDN'T ALWAYS USE CAPITALS".downcase #=&gt; outputs "you shouldn't always use capitals" +-12.abs #=&gt; outputs 12</code></pre></div><p>instead of something like:</p> +<div class='ruby'><pre><code># PHP Code + +strtolower("YOU SHOULDN'T ALWAYS USE CAPITALS"); +abs(-12);</code></pre></div><p>You save time, you save brackets, and it just makes more sense.</p> +<h4>#5 &#8211; Everything has a value</h4> +<p>Or &#8220;you&#8217;ll hardly ever use return to return values&#8221;. In a nutshell, all Ruby instructions return a value, even variable assignments, so you don&#8217;t really need to use the &#8220;return&#8221; keyword at the end of a method; the value of the last assignment or <em>any</em> other expression will always be returned.</p> +<h4>#6 &#8211; You can alter your environment in any way you like</h4> +<p>The first time I saw this, it really freaked me out. Imagine a typical programming situation: you start using a system class or a class written by someone else and you notice that you&#8217;d like to have an additional method. At this point you have a few ways to handle this in ordinary programming languages:<br /> +s</p> +<ul> + <li>You modify the developer&#8217;s source code, if you have access to it. This is normally not a good idea, and you shouldn&#8217;t do it.</li> + <li>You derive a new class from the original one, and you implement the new method there. This is a good idea, but it could be overkill for just one method, and you may have to update some of your other code accordingly.</li> + <li>You give up, and you just create the method outside the class, somewhere else. This can be done, but it is not very elegant and goes against Object Oriented Programming.</li> +</ul> +<p>In Ruby, you can simply add the method to the original class, without having to hack the original source code, and even for system classes! You want to have a method to automatically convert a measurement from meters to feet? You can simply extend the Numeric class as follows:</p> +<div class='ruby'><pre><code>class Numeric + def feet + self*3.2808399 + end +end</code></pre></div><p>From now on, all your numbers will have a <em>feet</em> method, which can be used just like any other method that was originally defined for the class:</p> +<div class='ruby'><pre><code>5.feet #=&gt; Returns 16.4041995</code></pre></div><p>Basically, Ruby classes are never closed and can be modified at any time from anywhere. Use with care, of course.</p> +<h4>#7 You won&#8217;t get unicorns from birds and horses, but you&#8217;ll still get donkeys if you want</h4> +<p>I distinctly remember my C++ professor at university using animals to illustrate key object-oriented concepts like classes and inheritance. Weird things came in when she tried to explain multiple inheritance to inherit a class Pegasus from a class Bird and a class Horse. It had methods like &#8220;fly&#8221; and &#8220;neigh&#8221;&#8230; crazy stuff, anyhow, Ruby does not offer multiple inheritance. <br /> +This seems to be the trend, after all, and of course it&#8217;s up to tastes. I don&#8217;t quite fancy multiple inheritances, as they may lead to unpredictable things. Nevertheless, it is possible to create &#8220;mix-ins&#8221; using Ruby modules, so that members and methods defined in a module will be added to a particular class if the module is included in it.</p> +<h4>#8 You don&#8217;t really need <span class="caps">XML</span></h4> +<p><span class="caps">XML</span> is a nice, general-purpose markup language which can be processed by every programming language and used everywhere. Unfortunately, it can also be quite verbose to write, very difficult to parse, and let&#8217;s be honest, it&#8217;s not really readable at first glance in many cases, unlike the following code snippet:</p> +<div class='yaml'><pre><code>regexp: !ruby/regexp /a-zA-Z/ +number: 4.7 +string: a string</code></pre></div><p>This is definitely easier and more readable than <span class="caps">XML</span>, isn&#8217;t it? Welcome to <span class="caps">YAML</span>, Ruby&#8217;s favorite markup (but not really<sup class="footnote" id="fnr6"><a href="#fn6">6</a></sup>) language, which can be used to represent any Ruby object in a simple, clear and yet complete way. <br /> +Ruby <em>can</em> parse <span class="caps">XML</span>, but YAML&#8217;s simplicity convinced a lot of developers to use it as an alternative to <span class="caps">XML</span> for configuration files, for example (Rails does this).<br /> +The code snipped presented before was obtained by executing the following line of Ruby code:</p> +<div class='ruby'><pre><code>{"string" =&gt; "a string", "number" =&gt; 4.7, "regexp" =&gt; /a-zA-Z/}.to_yaml</code></pre></div><p>The <em>to_yaml</em> method is defined for the Object class, which is the father of all of the other classes, and thus it is available in all Ruby objects. This means that you can convert anything into <span class="caps">YAML</span> <em>and</em> re-convert anything back into Ruby objects, with total transparency for the developer. So much for parsing, huh?</p> +<h4>#9 Lambda is much more than a Greek letter</h4> +<p>Ruby borrows some magic from Lisp and Perl with Proc objects and blocks. Procs are _&quot;blocks of code that have been bound to a set of local variables. Once bound, the code may be called in different contexts and still access those variables.&quot; _<sup class="footnote" id="fnr7"><a href="#fn7">7</a></sup> Consider the following:</p> +<div class='ruby'><pre><code>def gen_times(factor) + return Proc.new {|n| n*factor } + end + + times3 = gen_times(3) + times5 = gen_times(5) + + times3.call(12) #=&gt; 36 + times5.call(5) #=&gt; 25 + times3.call(times5.call(4)) #=&gt; 60</code></pre></div><p>I could have used the <em>lambda</em> method instead of <em>Proc.new</em> and gotten the same result. This should ring a bell for people who know Perl and Python (or Lisp)<sup class="footnote" id="fnr8"><a href="#fn8">8</a></sup>. You can do the same thing in <span class="caps">PHP</span> as well, but most people don&#8217;t really use the function.<sup class="footnote" id="fnr9"><a href="#fn9">9</a></sup></p> +<p>Additionally, Ruby makes extensive use of blocks, sort of &#8220;unborn Procs&#8221;<sup class="footnote" id="fnr10"><a href="#fn10">10</a></sup>, for example, to iterate the contents of an object and execute some code, like the <em>each</em> method available for the Array class:</p> +<div class='ruby'><pre><code>[1, 2, 4, 6, 8].each {|c| puts c*2} #=&gt; outputs each element multiplied by 2 in a new line.</code></pre></div><p>Should the code in the block exceed one line, you&#8217;re advised (but not required) to include the block within <em>do &#8230; end</em> instead of using braces. Ruby folks don&#8217;t like braces much, really.</p> +<h4>#10 &#8211; You can go on Rails</h4> +<p>Last but not least, you can always use Ruby on Rails for developing web applications. Deployment may not be as easy as it is with <span class="caps">PHP</span>, but Rails was built in Ruby because Ruby has features no other language can offer.</p> +<h3>Conclusion</h3> +<p>Time&#8217;s up. You&#8217;ve probably made up your mind about Ruby already, and you are either playing with it already, or you&#8217;re totally ignoring it. However, the next time you&#8217;re frustrated because your code looks ugly and you think you could have done the same thing with half the code you got, don&#8217;t blame me!</p> +<h3>Notes</h3> +<p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> <a href="http://www.rubyonrails.org">Ruby on Rails</a>, <span class="caps">MVC</span> Web Development Framework.</p> +<p class="footnote" id="fn2"><a href="#fnr2"><sup>2</sup></a> <a href="http://pragprog.com/book/ruby/programming-ruby/" title="2nd Ed.">Programming Ruby</a>, by Dave Thomas &amp; others, Pragmatic Programmers, 2004</p> +<p class="footnote" id="fn3"><a href="#fnr3"><sup>3</sup></a> Not entirely correct, but sort of. For more information on Python&#8217;s indentation rules and myths, read <a href="http://www.secnetix.de/~olli/Python/block_indentation.hawk">Python: Myths about Indentation</a>.</p> +<p class="footnote" id="fn4"><a href="#fnr4"><sup>4</sup></a> For a list of Ruby tutorials, refer to the <a href="http://www.ruby-lang.org/en/documentation/">Documentation</a> section of the Official Ruby Website.</p> +<p class="footnote" id="fn5"><a href="#fnr5"><sup>5</sup></a> For more information on Ruby, and in particular on the similarities and differences with other languages, refer to <a href="http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/">Ruby from Other Languages</a>.</p> +<p class="footnote" id="fn6"><a href="#fnr6"><sup>6</sup></a> <span class="caps">YAML</span> is Not a Markup Language.</p> +<p class="footnote" id="fn7"><a href="#fnr7"><sup>7</sup></a> Definition and example taken from the official Ruby documentation for class <a href="http://www.ruby-doc.org/core/classes/Proc.html">Proc</a>.</p> +<p class="footnote" id="fn8"><a href="#fnr8"><sup>8</sup></a> For some example on lambda functions in Python, see <a href="http://www.secnetix.de/~olli/Python/lambda_functions.hawk">Python: Lambda Functions</a>.</p> +<p class="footnote" id="fn9"><a href="#fnr9"><sup>9</sup></a> For examples of &#8220;lambda functions&#8221; in <span class="caps">PHP</span> using create_function(), see <a href="http://www.webmasterworld.com/forum88/7414.htm">this</a>.</p> +<p class="footnote" id="fn10"><a href="#fnr10"><sup>10</sup></a> For more detailed information on Ruby&#8217;s Procs, blocks etc. refer to <a href="http://eli.thegreenplace.net/2006/04/18/understanding-ruby-blocks-procs-and-methods">Understanding Ruby blocks, Procs and methods</a>.</p>
A contents/articles/10-reasons-why-i-didnt-update-my-blog.html

@@ -0,0 +1,65 @@

+----- +title: 10 reasons why I didn't update my blog +content-type: article +timestamp: 1213234200 +tags: internet|rant|personal|writing +----- +<p><em>&#8220;It has been a while since my last post, sorry about that&#8221;</em><br /> +I read this sentence (or something along those lines) on many blogs on the Internet, including mine. As a matter of fact, I actually didn&#8217;t write a meaningful post on my blog for a long time and no, probably this is not going to change that either.</p> +<p>Yesterday I started thinking <strong>why</strong> this happens, not only to me but to a lot of other non-professional bloggers. A professional blogger &emdash; for what I can tell &emdash; is someone like Michael Arrington or Gina Trapani: someone who has the luck (or course) to be able to just blog for a living.</p> +<p>I don&#8217;t blog for a living: my site is self-sustaining via a few very unobtrusive ads, just that. I have a full time job, and I blog in my spare time about my interests, without even trying to make &#8220;proper&#8221; money from my site. There&#8217;s nothing wrong with it: I believe there are some other people in my condition, and that&#8217;s quite normal.</p> +<p>That being said, let&#8217;s examine the ten most common reasons why I (and you too, maybe) end up not updating my blog, <em>even when I have time to do so</em>.h3. Someone already blogged about it</p> +<p>This is very irritating. I am obsessed with original content. I want to write about something other people <em>never</em> (or hardly ever) wrote about. As a consequence, I often find myself googling the same topic I&#8217;m planning my blog post on, and I <em>obviously</em> often get quite a few results, too!</p> +<p>I actually wanted to title this very post &#8220;The Blogger&#8217;s Block&#8221;, but I immediately thought of putting that very title into Google, just to see if someone else already blogged about it. Sure they did! Not original at all, tough luck. <br /> +It also happened a few weeks ago: I wanted to write about the current state of tech news sites and Antonio Cangiano comes up with a similar <a href="http://antoniocangiano.com/2008/05/29/random-thoughts-on-social-sites/">post</a>. Very interesting indeed, but quite annoying as well!</p> +<p>OK scrap that, think about something else&#8230;</p> +<p>This can potentially go on for days, and the only solution is of course trying not to worry about it, and just write the damn thing (that&#8217;s what I did to write this post).</p> +<h3>I didn&#8217;t research enough on the subject</h3> +<p>This happens tipically with reviews, round-ups, etc. Things I actually enjoy writing, but which may be easily subject to (harsh) criticism unless ou do them right. <br /> +I wanted to write a review of the new Treo 750 I bought. I&#8217;ve been using for a while, I learnt a few interesting hacks etc. etc. Unfortunately the 3G iPhone came out, so everyone is all hyped up about it. Too bad that I, being Italian and living in Italy, I never actually touched the damn thing!<br /> +What has that got to do with my Treo 750? Well, it would be nice to write a review of a Windows Mobile 6 phone comparing to the upcoming Apple wonder, wouldn&#8217;t it?</p> +<p>The solution to this would be trying to limit the scope of your post: screw Apple, let&#8217;s just focus on my Treo 750 and on the amazing amount of programming languages I can use on it!</p> +<h3>After researching for X days, I realized it was all a waste of time</h3> +<p>This happens with big articles. I once thought about writing a comprehensive article about all the possible ways to deploy a Ruby on Rails web site. Cool, isn&#8217;t it? I started researching about all the most esoteric lightweight web servers, about JRuby, Glassfish, IronRuby, &#8230; A lot of things. And new solutions kept coming up, and with them more and more posts, and then even entire books on the subjects.</p> +<p>Very frustrating. I abandoned the whole thing, because there was simply no reason to go on researching: it was all a waste of time.</p> +<p>How to fix this? Again, reduce the scope of your article so that you are able to reduce the time you spend researching about it. Or maybe try to get paid to write it, so that even if there&#8217;s plenty of articles about the same subject, at least you have a concrete purpose to write yours.</p> +<p>Erhm, yes, by the way, keep an eye on <a href="http://www.sitepoint.com">SitePoint</a> in the next few days/weeks, OK?</p> +<h3>I only write when I&#8217;m inspired, and now I&#8217;m not</h3> +<p>Very, very common. I normally think about a very cool article to write in the evening, or early in the morning, or whenever I don&#8217;t have access to a computer or the Internet. <br /> +Of course I don&#8217;t forget about it, but by the time I have a chance to actually write it, I really don&#8217;t fancy doing so. Oh, the irony! <br /> +It happened today, actually, during my lunch break: I was supposed to write this post but I didn&#8217;t feel like it. I lost my inspiration and all my artistic verve, so no, it can&#8217;t be done. Tough luck, wait until next time.</p> +<p>How did I solve this? Well, I started writing the post in my coffee break: there was no way to finish it in time, of course, but at least I started it.<br /> +I also saved it to my <span class="caps">PDA</span> and continued writing it when I had a chance. Eventually, I managed to finish it during my lunch break, the next day.</p> +<p>Try to write <em>whenever you are inspired</em>. If you are not inspired in your lunch break, do some work in your lunch break and then write when, in an hour or so, probably, you feel like writing again.</p> +<h3>This won&#8217;t make Digg&#8217;s front page</h3> +<p>Digg, Reddit, DZone, you name it. They are all excellent free tools for promoting your content. Don&#8217;t tell me you never wrote a post <em>for the sake of making the front page</em> of one of those sites. I did, I confess.<br /> +I didn&#8217;t make Digg&#8217;s front page in a while, and I&#8217;m probably never going to make it again. The reason? When it comes to promoting the right content in a fair way Digg <strong>sucks</strong>. As a consequence, 80% of the articles which appear on Digg <strong>suck</strong>. I&#8217;m sure you&#8217;ll be able to forgive my French when I say that <strong>Digg utterly sucks</strong>.</p> +<p>No matter how clever your story may be, unless you&#8217;re backed up by a swarm or an active community willing to Digg your story, you simply aren&#8217;t going to make it. When is the last time a proper programming article made it to Digg? I don&#8217;t remember, probably way before I unsubscribed to the Digg&#8217;s Technology feed, about a year or so ago.</p> +<p>Just write for the sake of writing. Don&#8217;t even submit your story to Digg (unless you&#8217;re writing about the iPhone, of course, then you may have a chance): post it to a less-known site, maybe, or to Reddit, instead. You won&#8217;t get as much traffic, granted, but you also won&#8217;t get tons of idiots writing pointless crap on your site and you won&#8217;t risk a server crash. If it&#8217;s destiny, then some good soul will post it to Digg, but nobody will digg it. That&#8217;s just life, I&#8217;m afraid.</p> +<h3>It has been too long since my last post: the next one will have to make up for it</h3> +<p>This happens when you start feeling guilty because you didn&#8217;t post in a long time.</p> +<p><em>&#8220;My next post is going to be superb, long, interesting and everyone will start flocking back to my blog!&#8221;</em></p> +<p>Wrong. First of all because statistically people just don&#8217;t &#8220;flock back&#8221; because you bestowed them of one interesting post (you have to keep up, too), and second because by doing so your mind will automatically discard all those bits of things you wanted to write about, but you never did because you&#8217;re waiting for that special <em>next post</em> which will be <em>so much better</em> and will bring your blob back to <del>spam</del> life.</p> +<p>It happened, it happened&#8230; again, all you have to do is just post all the tidbits you need, while you&#8217;re preparing your big shot: your blog will remain &#8220;fresh&#8221; and more people will enjoy your interesting posts, whenever they&#8217;ll come.</p> +<h3>Nobody gives a damn, anyway</h3> +<p>I didn&#8217;t want to upset my younger audience by using a nasty f-word in the title, but that&#8217;s exactly how it feels like it, sometimes.<br /> +I went to Rome last week, did you know? I twittered about it, you <strong>ought</strong> to know! And of course you&#8217;ll all be waiting for the usual 10-page-long article on my awesome vacation. Like when I <a href="http://www.h3rald.com/articles/incomplete-guide-to-london">went to London</a>, remember?<br /> +No, sadly not everyone may be interested in this crap. So I probably won&#8217;t post about it: who cares? When you start thinking like this, you may stop posting for weeks: not everyone may be interested in everything you post, and I believe that&#8217;s normal.<br /> +Especially for a blog like mine, which is deliberately open to all my interests: programming, technology, travelling, etc. That&#8217;s why most blogs try to be themed: they write about a particular subject, even a single programming project, and they (try to) do it well. The trade-off is that a themed blog may run out of posts amazingly quickly, if you&#8217;re not carefula and if you&#8217;re not 100% devoted to your blog&#8217;s theme. <br /> +A themed blog will build up a faithful audience, like when I was writing almost exclusively about CakePHP: a lot of <span class="caps">PHP</span> programmers where flocking here daily. Then things <a href="http://www.h3rald.com/blog/42">went wrong</a> and I really couldn&#8217;t be bothered to write about the same crap. Which leads us to the next topic&#8230;</p> +<h3>If I write about this, a large chunk of my audience is going to be upset</h3> +<p>This applies especially to themed blogs: if you&#8217;re a well-known Firefox addict, you can&#8217;t suddenly start writing about <a href="http://www.h3rald.com/articles/firefox-lovers-guide-to-opera">Opera</a>, praising its speed and the features it offers out-of-the box!<br /> +If you take a side, you&#8217;d better stick to it, if you want your audience to stick to you: the ten people who happen to read this blog are probably quite shocked by the amount of times I &#8220;changed side&#8221;: from CakePHP and <span class="caps">PHP</span> to Rails and Ruby, from Firefox to Opera (well, wait until my next SitePoint article comes out, at least&#8230;). Probably they are not the same people who read this blog a year or so ago.</p> +<p>In the end, it&#8217;s entirely up to you: if you are prone to radically change our opinion (and this happen in technology, much more than in politics), which involves changing the whole theme of your blog, maybe you should consider not having a themed blog at all. <br /> +And if you don&#8217;t feel 100% sure you want a themed blog, you definitely shouldn&#8217;t go for a themed domain name, or you may end up abandoning it afterwards. And when that happens, unless you&#8217;re writing damn cool posts like <a href="http://redhanded.hobix.com/">Why</a>, it&#8217;s going to hurt your audience. On the other hand, if you&#8217;re sure you&#8217;ll get ten times more visitors, go for it.<br /> +No, h3rald.com stays&#8230; I may end up raving about Safari at some point within the next ten years though, don&#8217;t be upset!</p> +<h3>I&#8217;m not an expert on the subject, so I shouldn&#8217;t blog about it</h3> +<p>This is a common problem I have when I try to write about something I don&#8217;t know extensively enough. When I started to learn Ruby, I was eager to start writing about it: it seemed just too cool to be true!<br /> +I thought about writing a longish post on learning Ruby from scratch, but then I realized it wouldn&#8217;t have been a great idea: I was just starting to learn a new language, I didn&#8217;t know all the nitty-gritty and writing about it to teach others was going to be a bit presumptuous, maybe!<br /> +Instead, I opted for a lighted <a href="http://www.h3rald.com/articles/10-reasons-to-learn-ruby">10 reasons to learn Ruby</a> article, clearly stating in the first paragraph that I was just a noob getting excited about his new toy. It worked, actually: people seemed to enjoy it, and I was partially excused for the few mistakes I made here and there.<br /> +You don&#8217;t have to be an expert to blog about something: you just have to be totally honest about what you know, and what you don&#8217;t know.</p> +<h3>There are a lot of professional bloggers out there, and I&#8217;m not one of them</h3> +<p>Finally, this can be summarized in two words: inferiority complex. &#8220;Proper&#8221; blogs fire out 10+ posts <em>per day</em>, and I don&#8217;t even write ten points in <em>a month</em>! Again, those a professional bloggers: they live for blogging (and make an awful lot of money out of it), and they most likely have someone else blogging for them, too! <br /> +Think of TechCrunch or LifeHacker, for example: they have a small legion of talented writers working for them &emdash; even if Michael Harrington does rant about Twitter about three times a week himself, though.<br /> +At the end of the day, what matters is the <em>quality</em> of your posts. Not the length minf, the Quality. I personally think that non-professionals (I said &#8220;non-professionals&#8221;, not &#8220;amateurs&#8221;!) are <em>allowed</em> to write about once a week, if they can provide good content, that is.</p> +<p>But you still do have to write <em>at least</em> once a week (OK, let&#8217;s make it ten days), otherwise either you&#8217;re justified (you genuinely don&#8217;t have time) or you may be a victim of one of these common fears. Watch out, and happy blogging!</p>
A contents/articles/10.html

@@ -0,0 +1,55 @@

+----- +title: Italian General Elections - 2006 +content-type: article +timestamp: 1144560780 +tags: italy|politics +----- +<p style="float:right;"><img src="http://www.berluscastop.it/v_imag/sodom1.gif" alt="" /></p> +<p>Another five years have passed and here we go again: General Elections time!<br /> +Today and tomorrow Italy <del>must</del> should vote for a new government, and the choice is <em>again</em> between two main contenders to the Prime Minister&#8217;s <del>throne</del> chair:</p> +<p>- <a href="http://news.bbc.co.uk/1/hi/world/europe/299254.stm">Romano Prodi</a><br /> +- <a href="http://news.bbc.co.uk/1/hi/world/europe/3034600.stm">Silvio Berlusconi</a></p> +<p>Just today I was reading an interesting article titled <a href="http://service.spiegel.de/cache/international/spiegel/0,1518,409538,00.html"><em>&#8216;The End of Silvio&#8217;s Show?&#8217;</em></a> in which the author examines the possibility that Berlusconi&#8217;s five years of subtle pseudo-dictatorship may end in favour the former president of European Commission Romano Prodi.</p> +<p><em>Who are they?</em></p> +<p><strong>Silvio Berlusconi</strong><br /> +<img src="http://www.consapevolezza.it/notizie/gen-mar-2002/imgs/berlusconi_corna_5.jpg" alt="" /></p> +<p>I can&#8217;t imagine someone asking this question, at least I can&#8217;t think of anyone who doesn&#8217;t know Silvio Berlusconi as the icon of the latest <em>national oddity</em>. <br /> +Forthose who need their memory refreshed, here&#8217;s a small collection of links featuring him:</p> +<ul> + <li><a href="http://news.bbc.co.uk/1/hi/world/europe/3034600.stm"><span class="caps">BBC</span> <span class="caps">NEWS</span> Profile</a></li> + <li><a href="http://en.wikipedia.org/wiki/Silvio_Berlusconi">Wikipedia Page</a> about him</li> + <li><a href="http://www.economist.com/displaystory.cfm?story_id=587107">An Italian Story</a> &#8211; An article written in 2001 published by the Economist, <em>before</em> he was elected Prime Minister</li> + <li><a href="http://www.economist.com/displaystory.cfm?story_id=593654">Fit to run Italy?</a> &#8211; Another article by the Economists explaining why Berlusconi should <em>not</em> lead the Italian Government</li> + <li><a href="http://grabbyeducational.blogspot.com/">Meglio coglioni che mafiosi</a> &#8211; Italian blog against Berlusconi (warning: profanity).</li> + <li><a href="http://www.geocities.com/basta2006/">Basta 2006 &#8211; Geocities</a> &#8211; a comprehensive directory of websites dedicated to Berlusconi, a really good resource.</li> +</ul> +<p>There are millions more. In particular, I&#8217;d like to add one more: <a href="http://www.consapevolezza.it/notizie/gen-mar-2002/impero_berlusconi.asp">The Empire of Silvio Berlusconi</a>, which features an image taken from an Italian magazine listing (roughly) everything owned (the image is dated 2002) by our current (for now) Prime Minister, such as:</p> +<ul> + <li>Mediaset Television (100%) &#8211; which includes three national channels</li> + <li>Medusa Film (100%) &#8211; Movie productions</li> + <li>Milan A.C. (99%) &#8211; Football team</li> + <li>Edilnord (63%) &#8211; Real Estate</li> + <li>Blockbuster (51%) &#8211; Video retal shops</li> + <li>Mondadori Spa (48%) &#8211; Biggest Italian editorial company</li> + <li>Mediolanum (35.5%) &#8211; Financial sociaty &#8211; banks, insurances etc.</li> +</ul> +<p>Nice, isn&#8217;t it? Of course he had to give those societies to some trusted administrators before becoming Prime Minister&#8230; but let&#8217;s not talk about this&#8230;</p> +<p><strong>Romano Prodi</strong><br /> +<img src="http://upload.wikimedia.org/wikipedia/en/thumb/0/04/Prodi.jpg/200px-Prodi.jpg" alt="" /></p> +<p>Perhaps not as well known abroad as Silvio, but was recently the President of the European Commission for a while. Here are some (more serious) links about him:</p> +<ul> + <li><a href="http://europa.eu.int/comm/archives/commission_1999_2004/prodi/index_en.htm">European Commission Archives</a></li> + <li><a href="http://www.eitb24.com/portal/eitb24/noticia/en/international-news/centre-left-candidate--profile-of-romano-prodi-?itemId=D23503&amp;cl=%2Feitb24%2Finternacional&amp;idioma=en">eitb24&#8217;s profile of Romano Prodi</a></li> + <li><a href="http://www.answers.com/topic/romano-prodi">Answers.com on Romano Prodi</a></li> + <li><a href="http://topics.nytimes.com/top/reference/timestopics/people/p/romano_prodi/index.html?inline=nyt-per">New York Times archives about Romano Prodi</a></li> +</ul> +<p>Known as &#8220;The Professor&#8221; for his education&#8230;</p> +<blockquote> +<p><em>&#8220;He graduated in economics at Milan&#8217;s Catholic University in 1961 and did postgraduate studies at the London School of Economics. He also spent a year as visiting professor at Harvard in 1974&#8221;</em><br /> +<em>(<a href="http://news.bbc.co.uk/1/hi/world/europe/299254.stm">Prodi&#8217;s <span class="caps">BBC</span> profile</a>)</em></p> +</blockquote> +<p>&#8230;Romano Prodi is the candidate proposed by the current Italian opposition, grouping roughly all the center-left parties. He&#8217;s the one who pushed Italy &#8211; as President of the European Commission &#8211; to accept the Euro as new currency, back in the day, and also the one who was blamed for than after a few months when the <em>Euro effect</em> occurred: prices went higher and didn&#8217;t seem to be an <em>exact conversion</em> from Lire to Euro. He was chubby enough (&#8220;mortadella&#8221; is one of his most recurring nicknames) to be quickly appointed as scapegoat for the unpleasant situation.</p> +<p style="float:left;"><img src="http://www.dsmirandola.it/sg/img/berlusconi_corna.jpg" alt="" /></p> +<p>Besides that, if someone asks me what&#8217;s the difference between the two candidates, I&#8217;ll answer: one is a politician and devoted all his life to Politics, while the other partly devoted only the last 10-years-or-so to politics because it seemed to be <em>a cool and worthwhile investment</em>&#8230;</p> +<p><em><strong>Who am going to vote?</strong></em></p> +<p>Well, one thing is sure: I don&#8217;t want Silvio to win again, I don&#8217;t want Italy to be publicly ridicolized abroad all the time that muppet opens his mouth or simply does something <em>he</em> thinks is funny&#8230;</p>
A contents/articles/11-07-2009.html

@@ -0,0 +1,217 @@

+----- +title: 11th of July 2009 +content-type: article +timestamp: 1248605640 +tags: wedding +----- +<ul> + <li><a href="#prologue">Prologue</a></li> + <li><a href="#party">The wedding party</a></li> + <li><a href="#stag">The stag night</a></li> + <li><a href="#preparations">The preparations</a></li> + <li><a href="#ceremony">The ceremony</a></li> + <li><a href="#reception">The reception</a></li> + <li><a href="#honeymoon">The honeymoon</a></li> + <li><a href="#photos">Photos</a></li> + <li><a href="#trivia">Trivia</a></li> + <li><a href="#quotes">Famous quotes</a></li> +</ul> +<h3 id="prologue">Prologue</h3> +<p>Roxanne and I arrived in Ireland on the 3rd of July, just over a week before the wedding day. We thought a week would have been more than enough to finish organizing our big day, and we were right: we spent a few days enjoying our holiday with relatives and going around to meet the photographer, the florist and all the others.</p> +<p>Slowly guests started arriving into the country from Italy, England, Romania etc. For some reason, everyone chose a different day to get to Killenaule, so we had people turning up right until the very day before.</p> +<p>In a similar fashion, I was waiting for my waistcoat to arrive until the last minute: it turns out that the guy I bought it from decided to send it through normal post about 10 days before &#8212; &#8220;They normally arrive in less than two weeks&#8221;, he wrote to me in his last email.</p> +<p>I ended up having to drive to Clonmel the afternoon before the wedding with half the wedding party in my car looking for a waistcoat. I eventually managed to rent one (with matching shirt and cravat) for <em>just</em> 40 Euro.</p> +<h3 id="party">The wedding party</h3> +<p>The following table lists all the members of the wedding party, for your own reference.</p> +<table> + <tr> + <th>Name </th> + <th>Role </th> + </tr> + <tr> + <td> Fabio Cevasco </td> + <td> Groom </td> + </tr> + <tr> + <td> Roxanne O&#8217;Mahoney </td> + <td> Bride </td> + </tr> + <tr> + <td> Matteo Lagomarsino </td> + <td> Best man </td> + </tr> + <tr> + <td> Simona Angheluta </td> + <td> Maid of Honor </td> + </tr> + <tr> + <td> Roberto Pischedda </td> + <td> Head Usher </td> + </tr> + <tr> + <td> Delia Angheluta </td> + <td> Bridesmaid </td> + </tr> + <tr> + <td> Zacharry O&#8217;Mahoney </td> + <td> Usher </td> + </tr> + <tr> + <td> Caspar O&#8217;Mahoney </td> + <td> Usher </td> + </tr> +</table> +<h3 id="stag">The stag night</h3> +<p>In Italy, England, US and in many other countries a &#8220;stag night&#8221; may end up in many different ways: dinner with friends, strip club, wild practical jokes to the groom, and so on. In Ireland, it generally means one thing: <em>drink</em>. It occasionally ends up badly (there are rumors a poor fellow who was thrown out in a river and got married with a broken nose), but generally everything turns out just fine: have a few pints, sing and dance, and have a couple of eggs in the morning. That normally does the trick &#8212; if you&#8217;re an Irishman.</p> +<p>I was well aware of my in-laws drinking habits, so I decided to take uncle Felix&#8217;s offer: &#8220;I&#8217;ll have a taxi ready for you whenever you want to sneak out of the pub, and make sure you do&#8221; &#8212; he said.</p> +<p>The evening started with a few pints at Laffansbridge, an old country pub in the middle of nowhere, probably one of the best places for a pint of Guinnes in the whole Tipperary. The little smart guy who runs it has one simple rule: at midnight the light goes off and no more drinks are served, so all 16 of us got into a minibus by then, heading for the next pub.</p> +<p><em>Quinn&#8217;s</em> is the family pub, in the sense that it is owned by Felix Quinn Jr, son of Felix Quinn Sr, brother of Anastasia Quinn, mother of James O&#8217;Mahoney, father of Roxanne O&#8217;Mahoney, my wife (families are still very large and very close, in Ireland). Being the family pub, <em>Quinn&#8217;s</em> doesn&#8217;t close at midnight; in fact, it often doesn&#8217;t close at all for family and friends (i.e. the entire village of Killenaule).<br /> +As soon as we got in, Claire (wife of Felix, son of Felix, etc. etc.) greeted us with a full round of pints, and then another, and yet another&#8230;</p> +<p>Around the third round someone asked me if I could sing a song &#8212; a request I politely but firmly declined due to my total ignorance in Irish folk songs and my total inability to utter sounds in even the slightest musical way. Luckily, someone else volunteered and sang a beautiful ballad, perfectly in-tune, with no music backing at all: Irish people are amazingly musical when sober, imagine when drunk!</p> +<p>When people started getting into <em>their</em> fourth round (note the pronoun), I decided to try out an old trick to keep myself sober: I drank less than half a pint, and then pretended to drink the rest, leaving always something in my glass. In that way &ndash; I thought &ndash; I could pretend I didn&#8217;t need yet another pint. Unfortunately the pub owner spotted me straight away and said &#8220;That pint is stale&#8230; here, have another one, on the house!&#8221;. At that point I decided it was better for me &amp; the rest of the Italians to quietly sneak out.</p> +<p>I was at home (uncle Martin&#8217;s house) and in bed at about 1:30 AM. I almost didn&#8217;t sleep at all that night, as expected, so I wasn&#8217;t too bothered when the rest of the drinking comrades came back, singing and shouting at 4:30 am. Simona [the Maid of Honor and girlfriend of my brother-in-law Zac], on the other hand, wasn&#8217;t too amused when Zac turned up after drinking the (Irish) Nightly Guideline Drink Amount: approx. 10-11 pints of Guinness &#8212; those he could count, that is.</p> +<h3 id="preparations">The preparations</h3> +<p>This part of the day is best reported in chronological tabular form:</p> +<table> + <tr> + <th>Time </th> + <th>Event </th> + </tr> + <tr> + <td> 7:35 </td> + <td> The groom <del>wakes up</del> decides to stop pretending to sleep. </td> + </tr> + <tr> + <td> 8:00 </td> + <td> The bridesmaids are up and about, ready to go to the hairdresser </td> + </tr> + <tr> + <td> 9:00 </td> + <td> Uncle Martin and the rest of the gang slowly regain consciousness. The groom spends about half an hour trying to explain uncle Martin that he&#8217;s his only hope to collect and bring back the flowers for the church (_&quot;Ahhhh you want <em>me</em> to do it&#8230; you could have said so since the beginning!&quot;_). </td> + </tr> + <tr> + <td> 9:45 </td> + <td> The groom takes the bridesmaids into town, to the hairdresser </td> + </tr> + <tr> + <td> 10:00 </td> + <td> The groom attempts to gather his groomsmen for the first time </td> + </tr> + <tr> + <td> 10:15 </td> + <td> The groom starts having a chat with the best man and the head usher. The other ushers are <em>somewhere around</em>. </td> + </tr> + <tr> + <td> 10:30 </td> + <td> The groom realizes that one of the ushers (Zac) has the most terrible hangover on Earth and the other (Caspar) slept solidly from 3 am (while still in the pub) until now </td> + </tr> + <tr> + <td> 11:00 </td> + <td> The groom attempts to gather his groomsmen for the second time, this time telling them it&#8217;s time to get ready (he&#8217;s not taken seriously) </td> + </tr> + <tr> + <td> 11:30 </td> + <td> The groom attempts to gather his groomsmen for the third and final time, now everyone is starting to try out their suits </td> + </tr> + <tr> + <td> 11:45 </td> + <td> For some weird reason auntie Noelle decides to call the groom and tell him that the florist is not accepting checks, after 5 minuts of absolute panic, she says we&#8217;re going to get the flowers anyway and there&#8217;s nothing to worry about. </td> + </tr> + <tr> + <td> 12:00 </td> + <td> All groomsman are dressed. It starts raining. </td> + </tr> + <tr> + <td> 12:30 </td> + <td> Zac decides he needs some fresh air and takes a walk outside in his morning suit, regardless of the heavy rain and the groom&#8217;s prayers </td> + </tr> + <tr> + <td> 13:10 </td> + <td> The groomsmen go to the church. </td> + </tr> + <tr> + <td> 14:00 </td> + <td> Guests start arriving </td> + </tr> + <tr> + <td> 14:20 </td> + <td> The brides arrives and the ceremony starts. </td> + </tr> +</table> +<h3 id="ceremony">The ceremony</h3> +<p>The wedding ceremony was very suggestive, almost magic. As soon as I looked at Roxanne in her wedding dress all worries faded away, and we both enjoyed the wedding rite. I must say I also don&#8217;t remember much of the whole ceremony, but I&#8217;m told it&#8217;s a common thing to happen.</p> +<p>As the ceremony started, we sat down without looking at the audience, so I didn&#8217;t feel paranoid and enjoyed listening to the priest&#8217;s speech, the readings and the songs. Canon Liam Ryan embodies the typical Irish priest: about 70-year-old, tall, extremely talkative, cheerful and very charismatic. He shocked us all during the reharsal telling us what we&#8217;d have had to do the day after, and it felt like a lot of work. The groomsmen and the bridesmaids were terrified: <em>&#8220;So I have to help you sit down, move the chair&#8230; like that&#8230; then&#8230; go back&#8230; no, wait, what was that again?&#8221;</em>. Matteo and Roberto couldn&#8217;t believe the whole choreography involved in the event: it&#8217;s nothing like that in Italy, but they were glad they were part of it in the end.</p> +<p>It all happened exactly like Father Ryan predicted, he even guessed almost all the few mistakes we made: &#8220;You have to walk slowly in front of the bride&#8221; &ndash; he said to Delia, the bridesmain &ndash; &#8220;and if you <em>think</em> you&#8217;re going slow while you&#8217;re doing it, you&#8217;re probably going <em>way too fast</em>&#8221;. But nobody noticed, really, and nobody cared: they were all too excited to mind that, and everyone&#8217;s eyes were on Roxanne, anyway. She was really, really gorgeous and her dress was fabulous. It felt unreal, at times: we both felt we were in one of those movies&#8230;</p> +<p>The most peculiar thing about the whole ceremony was perhaps the different languages involved: English, Italian, Gaelic and Latin. I doubt there was a single person among us who could understand the entirety of the mass, but it was very evocatory. The whole mass was predominantly in English, with the following exceptions:</p> +<ul> + <li>The First Reading was in Latin (my mum read it superbly &#8212; she&#8217;s a Latin teacher!)</li> + <li>The Second Reading was in Italian</li> + <li><em>Our Father</em> was sung in Gaelic</li> +</ul> +<p>By our own common decision, we didn&#8217;t ask for a professional video of the ceremony, only <a href="#photos">photos</a>. Nevertheless, my uncle captured most of the ceremony (and the most embarassing bits of the dancing after the <a href="#reception">reception</a>) using my dad&#8217;s video camera.</p> +<h3 id="reception">The reception</h3> +<p>When the ceremony ended it was still raining heavily, so after an endless amount of pictures taken we went straight into our Rolls. Technically, that was not <em>our</em> Rolls of course: we rented it from a local car hirer, and it was worth every penny. A lot of people get married in a VW Beatle or in a Mercedes at most, but Roxanne and I really love old cars, so when we saw <a href="http://www.alleventslimos.com/Wedding/rolls_silver_cloud.html">Ruby</a>, a red 1961 Silver Cloud II, we just had to get it. Champagne and chauffeur included, of course.</p> +<p>The chauffeur was a very jolly and chatty fellow from Waterford, and drove that beauty of a car for a very long time. Unfortunately though his sat nav decided to stop working and he wasn&#8217;t really <em>local</em>, so erhm&#8230;, well, let&#8217;s just say we were really lucky that at least <em>the bride</em>knew her way around. We made it safe and sound to Raheen House in no time: so fast that everyone else arrived about 10-15 minutes afterwards.</p> +<p><a href="http://www.raheenhouse.ie/">Raheen House</a> is a very charming <span class="caps">XIX</span> century Georgian House. One of those places you normally see only in movies: tapestries on the walls, old armchairs, stuffed heads over the doors (an african buffalo, a huge deer, an antelope, and some more)&#8230; you get the picture. Unfortunately it can only accomodate 120 people, so it isn&#8217;t a very popular location for wedding receptions in Ireland, because the number of people invited at Irish weddings ranges from 150 to 300. We were about 60 in total, nevertheless the dining hall looked quite full and lively, with 7 big tables covering all the room.</p> +<p>As soon as we got there, my best man was informed by the staff that he <em>had to</em> introduce the bride and groom. <em>&#8220;What? No, wait! What do I say&#8230; how&#8230; what? Fabio, come back!&#8221;</em> he freaked out, but as soon as I wrote down the two lines he was supposed to say in English everything was OK. Not only did he introduce us properly, he also made a <em>terrific</em> speech: he obviously gave it a lot of thought and it sounded just perfect.</p> +<p>After he spoke, it was my dad&#8217;s turn. Now, my dad speaks perfect French but never got a chance to learn and practice English (yet), so not only he had to write down his entire speech, he also had to annotate the pronunciation of <em>every</em> word. He managed fine though. It felt a little bit long, but he said really wonderful and touching words about Roxanne and I, our respective families, and countries. I&#8217;ll publish it soon on the Internet, for posterity&#8217;s sake.</p> +<p>The last three speeches were Jim&#8217;s (the father of the bride), who did great as always, without reading anything, right on the spot. And so did Roxanne and I: we basically just said a few words thanking all the guests for coming, and half of them for helping us with the wedding as well. Every speech (except mine and Roxanne&#8217;s) was characterized by subtle and very discreet exhortations to produce progeny (<em>&#8220;get on with it!&#8221;</em>), but other than that they were fine.</p> +<p>After all the traditional obligations, we finally started our dinner. The food was delicious and extremely tasty: Raheen House is renown for that, as we were told, but we honestly weren&#8217;t 100% sure until we started trying it. And there was also <em>plenty</em> of it, so everyone felt really satisfied towards the end of the meal. So satisfied that we decided to postpone the cake till later (see below) and indulge with wine instead.</p> +<p>Wine, right. They were going to charge us 20€ per bottle for some weird Chilean or Australian stuff. Silly and almost offending, especially considering that my family has been producing wine for family and friend&#8217;s use for at least three generations! This was my dad&#8217;s primary concern until we left for Ireland: &#8220;You sort the restaurant out, because I&#8217;m going to bring some bottles, no matter what&#8221;. He shipped over <em>96</em> special bottles of our 2005, 2006, 2007 and 2008 vintages. Ninety-six. We used about 25 of them for the meal and the rest of the evening, then we gave one to almost every guest, three to the staff of the restaurant, a few more to other hotel and B&amp;B owners, six to each uncle of the bride, etc. etc. None came back to Italy, that&#8217;s for sure.</p> +<p>Right after the meal the band came in, and we got ready to dance. Roxanne and I had to start with our First Dance, of course, then everyone else slowly joined in. The group was playing a mixture of traditional Irish music, ballads and rock &#8216;n&#8217; roll: they were amazing, and especially the Italian&#8217;s were really impressed.</p> +<p>Not as impressed as when they noticed uncle Martin dancing. I&#8217;ve never seen <em>anyone</em> in my life dancing so vigorously and wildly in my life. He has his own special technique that cannot be described with words. I&#8217;ll try to post a video of him soon. He really felt the rythm and never missed a step. Like a whirlwind he dragged everyone in, dancing with him: first his daughters and sons, then his brothers, the he thought he&#8217;d take my auntie for a spin, then the bride (well, mostly her dress), then even me! I don&#8217;t remember much, I think I was in the air at one point, and then all over the place&#8230;</p> +<p>Everyone of course joined in and started drinking and dancing for the whole evening. When the band performed the last two songs, I just remember a <em>huge</em> circle of nearly all the guests holding hands dancing around Roxanne and I, then coming closer, then far, then closer again. It was definitely the wildest night in our whole life.</p> +<h3 id="honeymoon">The honeymoon</h3> +<p>The day after we slowly recovered. We didn&#8217;t sleep much, but we managed to get up and have breakfast with some of the guests at the hotel, before they started heading back. Then we decided to go shopping in town: it was basically Roxanne and I, plus her brothers, her parents, and my parents. Not much of a honeymoon, as my mum pointed out, but we didn&#8217;t mind.</p> +<p>After spending the following day saying goodbye and thanks to all the relatives, we finally headed to Co. Galway, in Connemara. We booked three nights in the fabulous <a href="http://www.abbeyglen.ie/">Abbeyglen Castle</a>, highly recommended. Our superior room had a fireplace, a four-poster bed and jacuzzi bath: the bare essentials for a honeymoon really. Roxanne and I really enjoyed those three days, finally alone in the most breathtaking and romantic area of Ireland. Three days weren&#8217;t enough, really, but we&#8217;ll eventually go back there hopefully: maybe Sir Paul Hughes, proprietor of the castle, will still remember <em>&#8220;the bride and groom&#8221;</em>, as he kept calling us throughout our brief, but very pleasant stay.</p> +<p>Exactly as auntie Noelle said, everything was over in a blink: the ceremony, the reception, the honeymoon&#8230; everything went back to normal, eventually. It took a while to get used to our normal life: we had to go on a shopping spree before we went back to work&#8230; let&#8217;s say the money we got as present from most of the guest was well spent in a 42&quot; <span class="caps">LCD</span> HD TV, surround sound system, etc. etc.</p> +<p>&#8230;And we still have our other half of the honeymoon, too! Probably Miami Beach and Bahamas, next November.</p> +<h3 id="photos">Photos</h3> +<p>Our wedding photos were taken by <a href="http://www.patmccoole.ie/">Pat McCoole</a>, who did a truly amazing job portraying the magic of our special day.</p> +<p><embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="600" height="400" flashvars="host=picasaweb.google.com&hl=en_US&feat=flashalbum&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Fh3rald%2Falbumid%2F5359762418204291649%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></p> +<h3 id="trivia">Trivia</h3> +<ul> + <li>On the wedding day, it rained non-stop from 12 am to 7 pm.</li> + <li>The groom drove for a total of 1758.7 Km in 14 days.</li> + <li>On his stag night, the groom only drank 2.5 pints of Guinness (almost everyone else had 10, on average).</li> + <li>The night before the wedding, the groom slept only from 5:30 to 7:30.</li> + <li>Only the middle tier of the wedding cake was eaten on the wedding day. The top tier was eaten during the following days by relatives and the bottom tier was shipped to Italy, together with the Bride&#8217;s dress.</li> + <li>The father of the bride decided to change into more comfortable clothes right after the ceremony. He borrowed a waistoat and a jacket for the speech.</li> + <li>Uncle Martin danced with a lot of people after the meal, including the bride, her father, and the groom.</li> + <li>When he arrived at the church, the groom immediately realized he left the mass booklets and the confetti in the back of his car, at home. They were eventually brought to the church by a cousin of the bride just a few minutes before she arrived.</li> + <li>At the very start of the ceremony, the groom told the priest to tell the best man to get a mass booklet so that he and the bride can follow the mass properly. After 30 seconds of lip-reading and signalling, the best man understood and fetched one of the infamous booklets.</li> + <li>The bride forgot her change of clothes in uncle John&#8217;s car, who had to drive in early in the morning or she would have had her breakfast in her wedding dress.</li> +</ul> +<h3 id="quotes">Famous quotes</h3> +<blockquote> +<p>&#8220;This journey feels like going to Lourdes: you come back and your life changed forever.&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8212; The best man, when he arrived in Killenaule.</p> +</blockquote> +<blockquote> +<p>&#8220;Is there a garage around?&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; Auntie Isa while waving a car mirror, when she arrived in Killenaule</p> +</blockquote> +<blockquote> +<p>&#8220;Do I really have to do a speech? Are you sure?&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; The best man, when he met the groom in Ireland.</p> +</blockquote> +<blockquote> +<p>&#8220;My preciousssss!&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; The best man, when he was given the rings in custody.</p> +</blockquote> +<blockquote> +<p>&#8220;She&#8217;s the most calm and organized bride in history.&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; Auntie Noelle, about the bride on the wedding day.</p> +</blockquote> +<blockquote> +<p>&#8220;You could tell he was panicking on the phone&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; Auntie Noelle, about the groom on the wedding day.</p> +</blockquote> +<blockquote> +<p>&#8220;Potatoes, potatoes, potatoes&#8230;&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; The father of the bride to the groom, during the traditional handshake of the wedding rehearsal.</p> +</blockquote> +<blockquote> +<p>&#8220;Potatoes, potatoes, potatoes&#8230;&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; The groom to the father of the bride, during the traditional handshake of the wedding ceremony.</p> +</blockquote> +<blockquote> +<p><strong>Best man:</strong> &#8220;[&#8230;] this is the first time for me to speak in public, in front of an <em>English</em> audience [&#8230;]&#8221;<br /> +<strong>Audience:</strong> &#8220;Irish! <span class="caps">IRISH</span>!!!&#8221;<br /> +<strong>Best man:</strong> &#8220;&#8230;oh, right, Irish! Sorry&#8230;&#8221;<br /></p> +</blockquote> +<blockquote> +<p>&#8220;I need another shirt!&#8221;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212; Uncle Martin, after about 2 hours of continuous dancing with almost all the guests.</p> +</blockquote>
A contents/articles/11.html

@@ -0,0 +1,34 @@

+----- +title: Meet some Cake(PHP) bakers! +content-type: article +timestamp: 1144767780 +tags: cakephp +----- +<p>I should write more. I noticed that I since I decided to take a break from <a href="http:www.zzine.org">zZine Magazine</a> I more or less stopped writing &#8211; and started <em>baking</em> again with <a href="http://www.cakephp.org/">CakePHP</a>. As a result I finally recoded this website and <em>refreshed</em> a little bit my almost-rusty baking skills.</p> +<p style="float:left;"><img src="/img/pictures/cakephp.png" alt="" /></p> +<p>Why not taking advantage of this and write more about CakePHP then? After all, my last <a href="/articles/view/cakephp/">article</a> turned out well enough and some people even bookmarked it online on del.icio.us and ma.gnolia&#8230; Now it&#8217;s a bit out of date, I must admit: it was based on a pre-beta release of the framework, and we&#8217;re (more or less) stable now. <br /> +A lot of things changed in the Bakers Community since then! At the time the <a href="http://wiki.cakephp.org/">wiki</a> barely started and there was no <a href="http://manual.cakephp.org/">manual</a> whatsoever, only my long and perhaps <em>slightly</em> boring article describing Cake&#8217;s functionalities. Now there things are much better for newcomers: they have a continuously growing community to rely upon, both on the Google user group and on <span class="caps">IRC</span> (#cakephp on FreeNode counted 63 members today, while back in the day 20 was a big number). There are also a few people who started blogging and starting websites about CakePHP: while I was the first to write an article about Cake I was <em>the last</em> so far to start a blog :/ Oh well, nobody&#8217;s perfect!</p> +<p>The first site I came across &#8211; although not a blog really &#8211; is Graham Bird&#8217;s <a href="http://grahambird.co.uk/cake/">Cake for Beginners</a>. When someone asks me some basic questions about CakePHP I send him there because first of all they&#8217;ll find a short <span class="caps">FAQ</span> about the framework, i.e. something everybody should know before even start thinking about learning Cake. Similarly, the guy has a <a href="http://grahambird.co.uk/cake/glossary/">Glossary</a> in progress to help those souls who feel lost in Cake&#8217;s terminology. If you don&#8217;t consider yourself a total beginner anymore, the <a href="http://grahambird.co.uk/cake/tutorials/">Tutorials</a> section can be a very interesting read: I wanted to add some <span class="caps">AJAX</span> bits to my site, but the documentation about this seemed pretty scarce, so I headed to the <a href="http://grahambird.co.uk/cake/tutorials/ajax.php">Ajax Task List</a> tutorial and it really helped.</p> +<p>On the blogs front, on the other hand, <a href="http://cakebaker.42dh.com/">Cake Baker</a> seems to be the most active: I&#8217;m starting to check this one often (OK, I&#8217;d better subscribe to the <span class="caps">RSS</span> feeds, perhaps) because it seems to be <span class="caps">THE</span> best place to get the latest news about everything concerning CakePHP: The author seems to post quite frequently (there&#8217;s always a new post every 1-3 days maximum) includes short code snippets when necessary and report news when there&#8217;s anything to report.</p> +<p><a href="http://sentino.wordpress.com/">Sentino</a> is also an interesting place to learn new things about CakePHP: the only problem is that the author seems to post less frequently&#8230; the blog seems to have some sort of &#8220;milestone&#8221; schedule, publishing something when there&#8217;s something big enough to justify a post. If you want to subscribe to a less frequent blog with only the essentials about Cake, this is a good choice.</p> +<p><a href="http://rossoft.wordpress.com/">RosSoft</a> unlike the others mentioned up to now has a much more technical approach: no news about Cake or anything, just some <span class="caps">REALLY</span> useful real-world example of Cake helpers, components etc. etc., with <span class="caps">FULL</span> source code to cut and paste. Really handy if you need something specific, truly excellent for beginners to have a look at how Cake classes should be written. <br /> +Among the most interesting fully working snippets:<br /> +<a href="http://rossoft.wordpress.com/2006/03/29/ip-to-country-component-geo-location/">IP-to-country component</a> <br /> +<a href="http://rossoft.wordpress.com/2006/03/27/poor-mans-cron-component/">Poor man&#8217;s cron component</a><br /> +<a href="http://rossoft.wordpress.com/2006/03/16/image-auth-component/">Image Auth &#8211; <span class="caps">CAPTCHA</span> component</a></p> +<p style="float:right;"><img src="http://xcite-online.de/spliceit/themes/SpliceIt/logo.png" alt="" /></p> +<p><a href="http://www.thinkingphp.org/">ThinkingPHP</a> is another &#8220;technical&#8221; Cake blog, with interesting code snippets and thoughts about our favourite <span class="caps">PHP</span> framework. For those who don&#8217;t know or don&#8217;t remember him (yes, like me&#8230;), he&#8217;s the author of <a href="http://xcite-online.de/spliceit/">SpliceIt!</a>&#8230; what?</p> +<blockquote> +<p>SpliceIt!&#8217;s mission is to provide a clean and light-weight code base for people who want to create complex webapps faster then ever. The things we want to provide are:<br /> + &#8211; User/Right Managment<br /> + &#8211; Theming Support<br /> + &#8211; i18n<br /> + &#8211; Url Aliasing<br /> + &#8211; and most notabily: Modularization of often used Code Segments</p> +</blockquote> +<p>i.e. something I should have checked before recoding this website. I&#8217;ll definitely keep this in mind for the next release of h3rald.com.</p> +<p style="float:left;"><img src="http://rdos.rd11.com/img/rd11/rdlogo.gif" alt="" /></p> +<p><a href="http://rd11.com/posts">Posts@ rd11</a> a.k.a. gwoo [and seth]&#8216;s blog. Moment of silence. Gwoo is CakePHP&#8217;s project manager (respect+) and one of the lead developers of CakePHP and he also actually uses Cake for his website and blog instead of WordPress :)<br /> +What can I write about him. It&#8217;s difficult. I&#8217;ll avoid all possible pseudo-religious comparisons but when I say that <em>he created CakePHP</em> I think I say it all. The code he used for his blog is part of a collection of open-source, Cake-powered tools all prefixed with rd- or Cake, available on <a href="https://cakeforge.org/projects/rdos">CakeForge</a>. I personally think that looking at his sample applications can be one of the best way to learn how to bake <em>properly</em>, and yes, I <strong>did</strong> check them out before coding this site for the second time. Demos are <a href="http://rdos.rd11.com/">online</a>.</p> +<p>That&#8217;s it. These are perhaps the most well-known bakers and/or Cake bloggers on the planet. There are certainly others, maybe even in other languages, but now I&#8217;d better stop writing now, because this is a rather long blog post. Sorry. I&#8217;m new to blogging and I just can&#8217;t help myself: especially with Cake, I need to write lenghty texts!<br /> +More to come&#8230;</p>
A contents/articles/12.html

@@ -0,0 +1,66 @@

+----- +title: Choosing the right IT job +content-type: article +timestamp: 1144928828 +tags: personal +----- +<p>The time has come. The times when I used to meander around reading stuff on the Net and writing about whatever I wanted are over. Incidentally, the world may end, <em>your</em> laptop could explode and I could knock at your door in a few minutes asking for money, imagine that!</p> +<p>Nothing of the above, alright, bad joke, but sooner or later the time to <em>start doing something</em> comes, at some point you ought to start making some real money. It&#8217;s time to settle down, my fiance&eacute; are eager to get our own independence, move to our new house (which we&#8217;re still doing up) etc. etc. Fair enough. I spent the last five months wasting my time looking for a job, a <em>proper</em> job having something to do with <acronym title="Information Technology"><span class="caps">IT</span></acronym> and finally something seems to be possible.</p> +<p><em>Either nothing or everything</em> &#8211; I may even say that: now I have to face a difficult choice between two job proposals that seem both fairly interesting. <br /> +<em>&#8220;Go wherever you can get more bucks, you nutter!&#8221;</em> &#8211; Well, there&#8217;s more to it.<br /> +Let&#8217;s examine now the two similar but yet different realities I have to choose from. Maybe you&#8217;ll never be in my situation, but I hope this can help at least those who experienced or could experience something similar someday.</p> +<p><em><strong>Working under Uncle Bill&#8217;s wing</strong></em><br /> +<img src="/img/pictures/genova.jpg" alt="" /> Not Microsoft. No, not directly at any rate. I&#8217;ve recently been contacted by a well known multi-national company which does almost anything ranging from computers, phones, electrical stuff to huge self-aware robots designed to conquer new worlds&#8230; Not quite, but let&#8217;s just say that this image contributes to give an idea of a Corporate-type reality.</p> +<p><em>Preliminaries</em><br /> +I happen to be an Italian whose English skills go a bit beyond the <em>&#8220;Hello, me Italian and like to do friendship with you&#8221;</em>, I applied in the above (un)mentioned company as <em>Software Tester</em> and got contacted twenty days afterwards about a possible position as <em>Technical Writer</em>. It makes perfect sense. Well, at any rate I was pleased and I went to the pre-selection which was something like a pre-<span class="caps">GCSE</span> English test with a bunch of &#8220;technical&#8221; questions (&#8220;What does <span class="caps">HTTP</span> mean?&#8221;&#8230;).<br /> +Thanks to our Merciful God I passed it (and thus avoided endless teasing by my British fiance&eacute;), and they wanted to have a proper interview with me today.<br /> +I went there and came back a few hours ago, and I think it wasn&#8217;t too bad, let&#8217;s say I may stand good chances but as normally happens in such companies in the end it was just something like <em>Thank you for coming, we&#8217;ll call you by the end of April</em>. Although I mentioned that I recently had some other job offer obviously they couldn&#8217;t give a damn: as any other big company, they need to interview all the possible candidates to be sure they pick the right one, and that&#8217;s fair enough.</p> +<p><em>The job</em><br /> +In the remote eventuality they decide to take me on board, I&#8217;d be part of a Documentation Team in charge of writing technical documents, manuals and silly jokes &#8211; perhaps &#8211; about some semi-classified huge internal semi-intelligent corporate framework. <br /> +Now, although some people may already start to feel bored even at thinking about a job like that, I think this role would fit me perfectly. I love writing. I love researching. I love crating documentations, howtos, reports and any other boring (for other people) stuff! And they want me to write in English, not in Italian, which is &#8211; it may sound weird &#8211; a true relief for me. <br /> +At the interview I had a chance to talk about my <a href="/articles/">articles</a> and they seemed interested in this activity of mine&#8230; I even mentioned my <a href="/articles/view/cakephp/">CakePHP article</a> and they say they&#8217;re gonna check it out. Oh well, this site&#8217;s stats are always one Firefox tab away from my current main browsing tab, so you can bet I&#8217;ll be tracking that.</p> +<p><em>The contract and the salary</em><br /> +<em>Classified</em>. They didn&#8217;t say anything, as usual, but presumably it should be a permanent (or semi-permanent) contract with all the contributions, health insurance, taxes etc. paid. And free cookies. Yum!<br /> +Salary&#8230; well, it shouldn&#8217;t be too bad, anyway.</p> +<p><em>PROs</em></p> +<ul> + <li>I&#8217;ll be doing something I really enjoy: writing in English</li> + <li>Steady job, steady contract, more security</li> + <li>Corporare Environment</li> + <li>I can show off with my friends who are still studying pointless stuff and tell them I&#8217;m working for <company name removed></li> +</ul> +<p><em>CONs</em></p> +<ul> + <li>There&#8217;s a risk I&#8217;ll lose my individuality</li> + <li>The salary could be lower than expected &#8211; at least initially</li> + <li>They&#8217;ll get back to me at the end of this month, and I have to give an answer to someone else before that</li> + <li>My friends and fiance&eacute; will probably hassle me to give them free goodies they think I&#8217;ll get from the company</li> +</ul> +<p><em><strong>Working in a &#8216;cool place&#8217;, and fly high</strong></em> <br /> +<img src="/img/pictures/lambruschini.jpg" alt="" /> Nope, sorry, the <a href="http://www.cakefoundation.org/">Cake Software Foundation</a> unfortunately is not hiring. The alternative is a small company in my city, Genoa, which recently merged with a slightly bigger company based in Milan, which <em>might</em> merge with a big national company involved in producing some successful (here in Italy and even abroad, a little bit) TV programs. Network involved are Italy&#8217;s national channels, good ol&#8217; pal Berlusconi&#8217;s channels, Sky Italy and (drums) <span class="caps">MTV</span>.<br /> +Cool, innit? What do they do? Well, interaction between mobile phones and TV through software and networks. Polls, <span class="caps">SMS</span> chat services, <span class="caps">WAP</span> application downloads, &#8220;take matey out of Big Brother&#8217;s house&#8221;, <span class="caps">SMS</span>/<span class="caps">MMS</span> blind dates related to some well known TV programs, tele-voting at Sanremo Festival etc. etc.</p> +<p><em>Preliminaries</em> <br /> +Their first interview was the most unusual I&#8217;ve ever had, and I <a href="/blog/view/9/">already wrote</a> about it: they even asked me to solve a riddle. Then they wanted to meet me again and showed me how they work in two different areas (see next section). They are really chilled out, friendly, they seem alright, even the main boss who deals with the company&#8217;s financial side, which is always a plus. <br /> +By the way, they already offered me the job, and I&#8217;ll have to give an answer next Tuesday &#8211; that&#8217;s the bad part.</p> +<p><em>The Job</em><br /> +The Lead Developer of the company apparently seemed satisfied enough with my knowledge and Java skills. A first possibility for mewould be working for them as full-time Java Developer. Coding. Wake up, go to work, Code for eight hours, go home, sleep/other things, wake up, go to work&#8230;<br /> +It would be a good experience, and other people would choose this immediately over anything else. Coding what? Parsing algorythms for the <span class="caps">SMS</span> we receive, data manipulation, storage, re-formatting etc. etc.<br /> +The other possibility which they suggested after noticing my ability to write and research would be 2nd Level Help Desk. Get dozens of technical emails every day, file reports, notify developers when something goes wrong, propose solutions, implement solutions, monitor the systems and even execute queries on the production server on the fly, in real time (eeek!). <br /> +This could sound boring/annoying/scary but since I&#8217;m a freak I think it&#8217;s an interesting prospective. Perhaps not as qualifying as being a Java Developer, perhaps not.</p> +<p><em>The contract and the salary</em><br /> +1200-1250 (or more) &euro;/month, after tax. Which in my country is considered a more-than-reasonable pay, especially for a first job. Differnt form of contract, from consultant-with-<span class="caps">VAT</span> to renewable yearly projects, which is probably what I&#8217;d go for. Contributions/taxes paid, kind of, holidays and other vacancies included, kind of.</p> +<p><em>PROs</em></p> +<ul> + <li>Perhaps better salary</li> + <li>I know exactly what they offer, they told me their offer in detail</li> + <li>Chilled out environment</li> + <li>Perhaps I can sneak and read my desperate friends&#8217; <span class="caps">SMS</span> when they try to pull birds</li> +</ul> +<p><em>CONs</em></p> +<ul> + <li>Less steady contract, less security</li> + <li>I&#8217;ll hardly ever use my English skills, perhaps</li> + <li>They <span class="caps">NEED</span> a yes or no by next tuesday</li> + <li>My friends will probably hassle me to spy on other people&#8217;s <span class="caps">SMS</span> traffic and/or make them win TV contests</li> +</ul> +<p>Here&#8217;s where I stand. I can&#8217;t complain, alright, but I must choose and act carefully. I&#8217;ll sleep on it.</p>
A contents/articles/13.html

@@ -0,0 +1,13 @@

+----- +title: Baking a new CakeArticle +content-type: article +timestamp: 1144938060 +tags: cakephp|writing +----- +<p>Too right. Enough being a lazy writer, it&#8217;s time to seriously produce something. I could sit here and pretend that long blog posts can make up for the lack of new articles, but I&#8217;d like to write something <em>proper</em> and new. Judging by the latest stats people come here hoping to find either a blog <em>entirely</em> devoted to CakePHP or some CakePHP related content. Well, actually they can <a href="/tags/CakePHP/">find</a> quite a bit, but I&#8217;d like to be able to sport more Cake-related articles, bookmarks, and posts. My main problem is that I could add ten bookmarks about Cake right away, but the <em>latest addition</em> showed on the front page would feature only bookmarks, which would be bad (yes, I do worry about silly things). At the moment this blog is the second easiest way to provide fresh content frequently enough to encourage visitors to come back, but articles could be even better.</p> +<p style="float:left;"><img src="/img/pictures/baking_bear.png" alt="" /></p> +<p>Without further ado, I hereby announce that <em>I am working on some new articles on CakePHP</em>, at least one. I&#8217;d like to write something technical about CakePHP&#8217;s advanced features, because that&#8217;s where the current documentation is lacking, at the moment: associations, caching, some advanced components&#8230; they are topics which seem to interest those bakers who already baked their first cake and are now looking for some more icing.</p> +<p>Interested? Good! Sadly, that&#8217;s not what I&#8217;m going to write now, at least not the first article I&#8217;ll be releasing. Please stop calling me names, there&#8217;s no need to say that I&#8217;m just a lazy coward who doesn&#8217;t want to get his hands dirty and write some tough stuff. And stop pulling those sad faces! Think about&#8230; new bakers. There are new people learning about Cake and I know there are, I just discovered <a href="http://www.480x.com/2006/04/12/eureka/">one</a> yesterday almost by chance: he seems to be really enthusiastic about Cake, judging by his <a href="http://www.480x.com/2006/04/13/eureka-part-deux/">latest post</a> (OK, nevermind the pic).<br /> +Those people are mostly more-or-less experienced <span class="caps">PHP</span> programmers who want to find an answer to all their development problems and annoyance. Well, my good friends, the answer lies in Cake. Cake can save us all and bestow powerful blessings of Good <span class="caps">PHP</span> Design and Well-structured Programming upon our messy spaghetti code!</p> +<p>I almost considered writing a humorous article about Cake, but luckily I changed my mind. My old <a href="/articles/view/cakephp/">CakePHP article</a> is already a few months old and was written when Cake was in pre-beta. I feel it&#8217;s time for a more up-to-date howto and introduction to our framework, something maybe not as lenghty but easily readable by almost anyone interested in starting to learn about Cake.</p> +<p>Baking lessons. Yes, that&#8217;s it. I&#8217;m currently writing an article divided in ten lessons which could potentially turn casual cowboy coders into (apprentice) bakers. That could be easy for those already enlightened by <acronym title="Object Oriented Programming"><span class="caps">OOP</span></acronym> and <acronym title="Model-View-Controller"><span class="caps">MVC</span></acronym>, and perhaps more difficult for others: at any rate, I&#8217;ll try my best.</p>
A contents/articles/14.html

@@ -0,0 +1,40 @@

+----- +title: CakePHP hybrids +content-type: article +timestamp: 1145001300 +tags: cakephp|webdevelopment|php +----- +<p>When I first talked to gwoo, CakePHP&#8217;s project manager, I asked him if Cake had any potential <em>limitations</em>. I asked him &#8211; I was kidding actually &#8211; wether it would be possible to build an application like Gmail using the framework and he &#8211; very seriously &#8211; simply said <em>&#8220;yes, why not?&#8221;</em>. <br /> +I repeat myself when I say that CakePHP leaves plenty of freedom to developers within the bounds of its <span class="caps">MVC</span> structure: once you grasp the basic logic behind it, your possibilities are endless. I don&#8217;t want to act as a Ruby on Rails fanatic and boast that <em>you can do anything with CakePHP</em> and things like that, but I can certainly say that CakePHP can be <em>extended</em> and <em>integrated</em> with other collections of scripts, frameworks and projects. With limitations, of course: you probably don&#8217;t want to force an integration between CakePHP and another <span class="caps">MVC</span>/Event Driven/Whatever framework, simply because it would be rather pointless and potential conflicts may occur.</p> +<p>What I keep finding online is other open source projects adopting CakePHP as <em>backend</em> and <em>structure</em>. I&#8217;m sure there are many examples which could be mentioned here, but I chose two in particular: one has been around for a few months and the other is just born.</p> +<p style="float:left;"><img src="/img/pictures/amfphp.jpg" alt="" /></p> +<p><a href="http://amfphp.org/"><span class="caps">AMFPHP</span></a> is quite an interesting project:</p> +<blockquote> +<p>&#8220;[it] is an open-source Flash Remoting gateway. It&#8217;s fast, reliable, 100% free and open-source. Flash Remoting is a technology built into the Flash player core that enables sending data between the server and the client seemlessly.&#8221;</p> +</blockquote> +<p>In other words, it makes lifes much easier for developers who&#8217;d like to integrate their flash animations and script more tightly into their <span class="caps">PHP</span> application. If you are curious to see some results, head off to <span class="caps">AMFPHP</span> <a href="http://amfphp.org/showcase.html">showcase</a>.<br /> +Cool, but what has this project to do with CakePHP? Well, gwoo recently created <a href="http://cakeforge.org/projects/cakeamfphp/">CakeAMFPHP</a>, a CakeForge project which just yesterday reached its <a href="http://rd11.com/posts/view/21">0.4.0 release</a>, and it&#8217;s fully compatible with <span class="caps">AMFPHP</span> 1.2.3 and CakePHP 0.10 final.<br /> +Here&#8217;s an excerpt taken from CakeAMFPHP <span class="caps">README</span>.txt file:</p> +<blockquote> +<p>&#8220;[&#8230;] <br /> +1) get CakePHP 0.10 final (http://cakephp.org)<br /> +2) get amfphp 1.2.3 (http://amfphp.org)<br /> +3) get the <span class="caps">UFO</span> js http://www.bobbyvandersluis.com/ufo/<br /> +4) put amfphp into /app/vendors<br /> +5) put cakeamfphp into vendors<br /> +6) put the cake_gateway.php in /app/webroot<br /> +7) put the cakeamfphp.php in /app/views/helpers<br /> +8) put CakeMySqlAdpater.php in /app/vendors/amfphp-core/adapters<br /> +9) Voila: NetServices.setDefaultGatewayUrl( &#8216;http://localhost/cake_install/cake_gateway.php&#8217;);<br /> +Access the service browser through<br /> +http://localhost/cake_install/vendors/cakeamfphp/cakebrowser/&#8221;</p> +</blockquote> +<p>The installation doesn&#8217;t seem too painful at all. And &#8211; guess what &#8211; gwoo recently updated a very informative tutorial showing how to create a simple &#8211; but still impressive &#8211; bullettin board with CakeAMFPHP.</p> +<p><em>&#8220;Cool, but I never liked flash, what about <span class="caps">AJAX</span>?&#8221;</em></p> +<p style="float:left;"><img src="/img/pictures/qooxdoo.gif" alt="" /></p> +<p>CakePHP has a nice <span class="caps">AJAX</span> helper to be used in conjunction with <a href="http://prototype.conio.net/">prototype</a>, but there are truly a lot of libraries, mini-frameworks, pre-built applications to create interactive desktop-like user interfaces. Some people may already know <a href="http://qooxdoo.oss.schlund.de/">qooxdoo</a>,</p> +<blockquote> +<p>&#8220;[&#8230;] an advanced open-source JavaScript-based <span class="caps">GUI</span> toolkit. qooxdoo continues where simple <span class="caps">HTML</span> is not enough. This way qooxdoo can help you implement your <span class="caps">AJAX</span>-enhanced web 2.0 application &#8211; easier than ever before.&#8221;</p> +</blockquote> +<p>In a recent <a href="http://groups.google.com/group/cake-php/browse_thread/thread/ba219c64cd794764/1d77973293514618?lnk=raot">discussion</a> on CakePHP user group someone suggested the possibility to integrate qooxdoo with CakePHP. Apparently qooxdoo people were <a href="http://www.nabble.com/Re%3A-qooxdoo-PHP-framework-project-p3799302.html">evaluating</a> various <span class="caps">MVC</span> frameworks, and Cake was obviously listed together with two other Rails clones for <span class="caps">PHP</span>. The good news is that <a href="http://cakeforge.org/users/a100rk/">100rk</a> just started a new project called <a href="http://cakeforge.org/projects/cqx"><span class="caps">CQX</span></a>, which &#8211; although still in pre-alpha a development demo is already available, and it <em>shows off</em> most of qooxdoo&#8217;s features&#8230; <a href="http://cqx.100rk.org/trunk/">Take a look</a></p> +<p>Best of luck to 100rk and his brand new project, I really hope to see more of it soon!</p>
A contents/articles/15.html

@@ -0,0 +1,66 @@

+----- +title: I18n +content-type: article +timestamp: 1145106900 +tags: cakephp|webdevelopment +----- +<p><em>&#8220;CakePHP will officially support Internationalization (i18n) from version 2.0&#8221;</em>. That is to say: not right now. That doesn&#8217;t mean we have to wait, no chance! I&#8217;m Italian and there are plenty of bakers speaking a language other than English who might want to develop a multi-lingual website.</p> +<p>I did, <a href="http://v60.h3rald.com/">once</a>, and the final result wasn&#8217;t too bad in the end: every page of the site (except the articles) could be translated into Italian. Before examining my solution (which is far from optimal) I&#8217;d like to mention an excellent CakePHP package which allows basic (mostly statuc) i18n.<br /> +It looks like I missed an important baker in my recent <a href="/blog/view/11">blog post</a>: <a href="http://www.noswad.me.uk/">Andy Dawson</a>, creator &#8211; among other things &#8211; of the <a href="http://cakeforge.org/snippet/detail.php?type=package&amp;id=2">Locale Package</a>, available at CakeForge. His solution actually came out after H3RALD.com v60 was already developed so I didn&#8217;t use it for my own site.<br /> +At a first glance Andy&#8217;s solution truly solves basic l18n problems in an elegant way: the most important code snippet is the <a href="http://cakeforge.org/snippet/download.php?type=snippet&amp;id=74">Locale Component</a> which provides the following functionalities:</p> +<ul> + <li>automatic language detection based on browser&#8217;s UserAgent string</li> + <li>loading of locale files</li> + <li>setting of customizeable (translated) messages</li> +</ul> +<p>The getString() method provided in the locale component is actually used through the double underscore function, which is already defined (but not yet implemented) in the standard CakePHP file <code>cake/basics.php</code> (yes, this is a small core hack). Andy&#8217;s double underscore function can take five parameters:</p> +<pre><code>function __($msgId, $MessageArgs=NULL, $capitalize=1, $punctuate=0,$Code=NULL) +{ + require_once(COMPONENTS.'locale.php'); + $Locale = LocaleComponent::getInstance(); + return $Locale-&gt;getString( $msgId, $MessageArgs, $capitalize, $punctuate, $Code ); +}</code></pre> +<p>These parameters are:</p> +<ul> + <li>a &#8220;message id&#8221; or the message itself</li> + <li>some parameters which can be passed to the message</li> + <li>the message&#8217;s capitalization: + <ul> + <li>0 = no change</li> + <li>1 = first letter of first word</li> + <li>2 = fist character of all words</li> + </ul></li> + <li>the message&#8217;s punctuation: + <ul> + <li>0 = &quot;&quot;</li> + <li>1 = .</li> + <li>2 = !</li> + <li>3 = ?</li> + </ul></li> + <li>the language code, if you need to override your page&#8217;s language</li> +</ul> +<p>This is a convenient method which can be used everywhere, both in your controllers and in your views, to translate simple pre-stored messages. Where are those messages stored? In various locale files which must be placed in <code>app/controllers/components/messages/</code> and look like this:</p> +<pre><code> $messages = Array ( + 'LocaleSetTo'=&gt;"Site locale set to UK English", + 'LocaleChangeTo'=&gt;"Change site locale to UK English", + // Time related messages + 'ago' =&gt; "%s ago", + 'ages' =&gt; "a long time ago (%s)", +)</code></pre> +<p>The locale package also comes with a <em>Language Controller</em> you can use to handle language changes, and a useful rewrite of the <em>Time Helper_. Andy recently updated his <a href="http://wiki.cakephp.org/tutorials:i18n">i18n tutorial</a> available on CakePHP Wiki, a very interesting read on how to quickly add i18n support to yout first Cake blog (yes, the one described in the <a href="http://wiki.cakephp.org/tutorials:blog_tutorial">Blog Tutorial</a>_-</em>1).</p> +<p>So far so good. The Locale Package provide some basic multi-lingual support in an efficient way, and I&#8217;d certainly use it if I decide to (re-)develop a multi-lingual site, but unfortunately this does not fully solve the problem.<br /> +If you want <strong>full</strong> i18n, for sure you&#8217;d like to have all the contents of your website translated, which is &#8211; normally &#8211; dynamic and maybe stored in a database. That was the case of my old website: all the pages are dynamic, not static, so I had to think about something else. <br /> +Since I only had plans to develop a <em>dual</em> language site, I opted for a very lazy (but yet effective) solution: each table &#8211; more or less &#8211; had &#8220;duplicate&#8221; fields, something like this:</p> +<ul> + <li>id</li> + <li>title_en</li> + <li>title_it</li> + <li>text_en</li> + <li>text_it</li> + <li>created</li> + <li>modified</li> +</ul> +<p>I basically defined a global $lang variable set to &#8220;en&#8221; by default and then I accessed the record&#8217;s fields (for example in views) like this:</p> +<p><code>echo $data['Project']['text_'.$lang]</code></p> +<p>Ugly, perhaps, but did the job. The good (or bad) thing about this technique was that I could modify the contents of a project, for example, regardless of the current language: in my add/edit view, I chose to generate <em>all</em> the fields of a table and therefore modify all the fields of a project without switching to the other language.</p> +<p>How will Cake support locales? Will we have &#8220;localized&#8221; database tables (and models?) Only time will tell&#8230;</p>
A contents/articles/16.html

@@ -0,0 +1,19 @@

+----- +title: Databases supported by CakePHP +content-type: article +timestamp: 1145251800 +tags: cakephp|webdevelopment|databases +----- +<p>One of the most recurring questions on CakePHP User Group is probably <em>&#8220;Does Cake support X database?&#8221;</em>. Sure, most of us tend to use just MySQL for our websites and applications, but in certain situations some more <em>exotic</em> database support makes the difference. A partial answer to the question above could be <em>&#8220;Yes, probably, at least partially&#8221;</em>: CakePHP offers support for some database &#8220;natively&#8221; (i.e. Cake folks made some <em>ad hoc</em> database drivers), others through either <a href="http://adodb.sourceforge.net/">ADOdb</a> or <a href="http://pear.php.net/package/DB"><span class="caps">PEAR</span>::DB</a>.</p> +<p>CakePHP seems to use a <em>multiple level</em> database abstraction: in other words, popular abstraction layers like ADOdb or <span class="caps">PEAR</span>::DB have been wrapped in a &#8220;driver&#8221; which basically extends the DboSource class (which is the most high level database abstraction). Some people don&#8217;t like the idea, because this means that the could be some performance issues, for one, and also that inevitably not <em>all</em> features offered by either ADOdb or <span class="caps">PEAR</span>::DB are used. In my very, very, very modest opinion (I&#8217;m not an expert on this matter), this solution focus on achieving good database compatibility leaving the doors open for further tinkering, if needed.</p> +<p style="float:left;"><img src="/img/pictures/postgres.png" alt="" /></p> +<p>Having said this, yes, the possibilities are good that your favorite database is supported by CakePHP, more or less. Of course, as repeatedly pointed out by some CakePHP core developers, Cake dev team didn&#8217;t and is not going to test <em>every</em> database with Cake, using either of the two abstraction layers, but users are more than welcome to do so.</p> +<p>Let&#8217;s now have a look at what is <em>known to work</em> with Cake:</p> +<p><strong>MySQL</strong> works fine, and is currently recommended as <em>preferred</em> database solution. What about <strong>MySQLi</strong>? Well, thanks to mappleJoe there&#8217;s a (PHP5 only!) <a href="http://cakephp.org/pastes/show/770e73e77e4d7a3d32c2f3de3f175512">driver</a> ready to be used.</p> +*PostgreSQL*&#8217;s support is continuously improving. Something may work, something may not: the good news is that the folks who are using it are <a href="http://groups.google.com/group/cake-php/browse_thread/thread/85a29ab6ec6826a0/8eecea26ba53e1fd?q=postgres&amp;rnum=1#8eecea26ba53e1fd">sharing their thoughts</a> with the rest of us. +<p style="float:right;"><img src="/img/pictures/sqlite.gif" alt="" /></p> +<p><strong>SQLite</strong> is supported natively, or so it seems&#8230; what about the newest SQLite3? Yes, probably: there&#8217;s a quick <a href="http://www.thompsonlife.net/index.php?section=9">howto</a> on ThompsonLife.net to make it work through the dbo_pear driver.</p> +<p><strong>Access</strong> works through the ADOdb driver, as reported in CakePHP <a href="http://wiki.cakephp.org/docs:databases">wiki</a> (thanks ivanp).</p> +<p><a href="http://www.filemaker.com/">FileMaker</a> is getting there: things aren&#8217;t that easy, but bdb is doing <a href="http://groups.google.com/group/cake-php/browse_thread/thread/572d8dd2ba4cbdf7/dca851c795247c0b?q=database&amp;rnum=2#dca851c795247c0b">all his best</a> to make it work, good luck!</p> +<p>Neil Fincham was also trying to develop a custom driver to support <a href="http://www.pervasive.com/">Pervasive</a> through a <a href="http://www.unixodbc.org/">unixODBC</a> driver. Best of luck!</p> +<p>For other databases, check ADOdb&#8217;s <a href="http://phplens.com/adodb/supported.databases.html">list of supported databases</a> and use the <code>dbo-adodb</code> driver, or use <span class="caps">PEAR</span>::DB (for fbsql, ibase, informix, msql, mssql, mysql, mysqli, oci8, odbc, pgsql,sqlite and sybase) using the <code>dbo-pear</code> driver.</p>
A contents/articles/17.html

@@ -0,0 +1,16 @@

+----- +title: New CakePHP Manual (with associations!) +content-type: article +timestamp: 1145342820 +tags: cakephp +----- +<p>Gustavo Carreno just <a href="http://groups.google.com/group/cake-php/browse_thread/thread/4e13231cc383b9bb/6414184c1058fadb#6414184c1058fadb">announced</a> a new release of the <a href="http://cakeforge.org/frs/?group_id=53&amp;release_id=82">CakePHP Offline Manual</a>. Personally I was extremely happy to download this new release because it finally contains documentation and howtos related to CakePHP&#8217;s Model Associations, which is perhaps one of the most used <em>advanced</em> CakePHP features.<br /> +So I&#8217;ll have no excuses not to learn how to use them, great&#8230;</p> +<p>The manual is available in the following formats:</p> +<ul> + <li>Windows compressed <span class="caps">HTML</span> (.chm)</li> + <li><span class="caps">PDF</span></li> + <li><span class="caps">HTML</span> (multiple pages or single page)</li> +</ul> +<p>Furthermore, the CakePHP <span class="caps">API</span> is also available for download in .chm format, thanks to Mladen Mihajlovic.</p> +<p>Well done guys. Really useful for people like me who are on dialup sometimes :)</p>
A contents/articles/18.html

@@ -0,0 +1,69 @@

+----- +title: Textiling +content-type: article +timestamp: 1145605143 +tags: writing +----- +<p>Once upon a time I used <a href="http://en.wikipedia.org/wiki/BBCode">BBcode</a>. <a href="/bookmarks/view/cyberarmy">CyberArmy</a> and all its affiliated sites adopted it as <em>de-facto</em> standard for forums and articles, so consequently more or less all my articles are bbcoded. <br /> +I could copy and paste the <em>BBcodeHelper</em> I coded for this site, and it could be quite an interesting read for some people&#8230; well, tough luck: today I&#8217;d like to talk about <a href="/bookmarks/view/textile-reference/">Textile</a> instead, which now I consider <em>the answer</em> to all text formatting problems.</p> +<p>If what I wrote up to here doesn&#8217;t make sense to you, I&#8217;m rambling about the apparent necessity and the undeniable need of web developers, content managers, and writers to use something else other than <span class="caps">HTML</span> for adding style and formatting text. What&#8217;s wrong with <span class="caps">HTML</span>? Nothing, it&#8217;s just too &#8220;tiresome&#8221; to use: you have to remember to close all tags, break lines, use the <code>&lt;strong&gt;</code> tag every time you want <strong>bold text</strong>, etc. etc.<br /> +Some people even freak out when you tell them that they have to use <span class="caps">HTML</span> in their text: &#8220;it&#8217;s just <em>waaaaaay too difficult</em> to learn and use&#8221; &#8230;things like that.</p> +<p>Whether you are scared to learn <span class="caps">HTML</span>, you don&#8217;t want to, or you know it but you&#8217;re too lazy to seriously thinking about manually use a markup language to write your article, I can say that you&#8217;ll definitely become addicted to Textile. What? <em>&#8220;<acronym title="What You See is What You Get"><span class="caps">WYSIWYG</span></acronym> <span class="caps">HTML</span> editors?&#8221;</em> &#8211; C&#8217;mon, let&#8217;s at least <em>try</em> to be serious :)<br /> +Why BBcode doesn&#8217;t help enough? Well, simply because I don&#8217;t see why <code>[i]this[/i]</code> is easier than <code>&lt;i&gt;this&lt;/i&gt;</code>: unless you have a particular phobia for angular brackets, it seems quite similar to me!</p> +<p>What about <code>_this_</code> instead? You use only two additional characters instead of seven. <span class="caps">SEVEN</span>. If I only want italcized text I honestly can&#8217;t imagine myself using more than two extra characters. It&#8217;s natural. It&#8217;s human.</p> +<p style="float:left;"><img src="/img/pictures/pear2.gif" alt="" /></p> +Precisely. Textile is a <em>&#8220;Humane web text generator&#8482;&#8221;</em>, it&#8217;s simple, elegant and produces standard compliant <span class="caps">XHTML</span> code. <a href="http://www.textism.com/about/">Dean Allen</a> should be worshipped by entire generations of web developers for inventing something so easy to use and so <em>elegant</em> at the same time. Maybe not worshipped, but for sure respected. +<p>I won&#8217;t copy and paste the extremely useful <a href="http://cakeforge.org/projects/textilehelper/">TextileHelper</a> for CakePHP either, simply because it&#8217;s 4085 lines long and it would be pointless: you can just get it and use it.</p> +<p>I&#8217;ll just include some examples of textile formatting&#8230;</p> +<table> + <tr> + <td> <strong>Textile Code</strong> </td> + <td> <strong>Result</strong> </td> + </tr> + <tr> + <td> <code>*text*</code> </td> + <td> <strong>bold</strong> text </td> + </tr> + <tr> + <td> <code>_text_</code> </td> + <td> <em>italicized</em> text </td> + </tr> + <tr> + <td> <code>@text@</code> </td> + <td> <code>fixed width</code> text</td> + </tr> + <tr> + <td> <code>"text":url</code> </td> + <td> <a href="/">linked</a> text </td> + </tr> + <tr> + <td> <code>!path/to/image!</code> </td> + <td> image </td> + </tr> +</table> +<p>These are just some trivial examples. With textile you can also format text blocks, add custom <span class="caps">CSS</span> code and even float images or text! Tables? Sure, how do you think I created the table above?</p> +<pre><code> +| *Textile Code* | *Result* | +| @*text*@ | *bold* text | +| @_text_@ | _italicized_ text | +| &lt;code&gt;@text@&lt;code&gt;| @fixed width@ text| +| @"text":url@ | "linked":/ text | +| @!path/to/image!@ | image | +</code></pre> +<p>The simplest and most intuitive way possible!</p> +<p>Regardless, Textile is not perfect and may have some quirks, at least the CakePHP helper: the_undefined pointed out in a <a href="http://www.thinkingphp.org/2006/03/22/textile-a-personal-love-of-mine/">blog post</a> that external links are opened in the same window, so he provided a patch to the textile helper to handle this situation.<br /> +I also noticed that sometimes empty <code>style=""</code> and <code>class=""</code> attributed are generated, which don&#8217;t do any particular harm, but they are not needed either&#8230; so here&#8217;s a quick fix to improve your Textile experience in CakePHP: You can use this function ideally in your customized textile helper, <code>$data</code> should be the return value of TextileHelper&#8217;s <code>process()</code> method.</p> +<pre><code> +function _fixTextile($data) +{ + $patterns = array( '//', + '/style=""/', + '/class=""/', + '/ &gt;/'); + $replaces = array($this-&gt;base, + '', + '', + '&gt;'); + return preg_replace($patterns, $replaces, $data); +} +</code></pre>
A contents/articles/20.html

@@ -0,0 +1,55 @@

+----- +title: In memory of Vittorio Cevasco (1916-2006) +content-type: article +timestamp: 1146022560 +tags: personal +----- +<p>Yesterday my grandpa passed away, due to an aggravation of his health condition, breathing problems and various other complications. He died in hospital, on Liberation Day, the Italian national holiday celebrating the liberation of our country from the nazi-fascist regime by the Allied troops and partisans on April 25th 1945. He died exactly 61 years after that day.</p> +<p>I&#8217;d like to remember my grandpa today, because he most certainly deserves it, as he was a really extraordinary person.</p> +<p><em>&#8220;Yes, I&#8217;m sure he was, isn&#8217;t everybody extraordinary in some way?&#8221;</em></p> +<p>Definitely: everybody is special, and people tend to say that especially when someone passes away. In my grandpa&#8217;s case, actually I can say that in a slightly more absolute sense: his life was truly uncommon and very active.</p> +<p><strong>A very active life</strong></p> +<p style="float:left;"><img src="/img/pictures/grandpa.jpg" alt="" /></p> +<p>Vittorio Cevasco, my grandfather, was certainly the most active member of my family. We&#8217;re talking about a man who was still able to drive a car up to last September (he was nearly 90 years old), and used to drive 500 Km on the motorway and mountain roads every year to go on vacation: he went to the same place, Mals Vinschgau, near the Italian-Austrian-Swiss border for over fifty years. He never had particular troubles to walk, and just in the past months started using a walking stick&#8230; before that he used to walk around the city by himself everyday, in his endless meanderings. He always had something to do: visit friends, go to public offices, go to our house in the countryside &#8211; he still used to cultivate the land with potatoes, tomatoes and basil as a hobby until a few months ago &#8211; and so on: he was really a busy man.<br /> +I can certainly say that I never though he was really old until after his wife, my grandma, died, about a year ago. Since then he really aged, and quickly, as she probably was one of the main reasons of his existance.</p> +<p>When he was &#8220;young&#8221; (i.e. less than 80) he used to <em>compete</em> with the lift in his flat running down the stairs. Everyone else was taking the lift, but he always chose to go on foot down the stairs, to keep in exercise. His other exercise was cultivating our land in Sessarego, near Bogliasco (Genoa, Italy), as a hobby more than anything, providing us with fresh <em>biological</em> products like that extraordinary basil essential to make our very tasty local <a href="http://www.pesto.net/eng/index.php">pesto sauce</a>.<br /> +He always tried to convince me to do some work there, and he actually taught me various tips and secrets which will hopefully be useful in near future. Sadly, when he was alive I wasn&#8217;t too keen on the idea of cultivating and maintain our land from time to time&#8230; but I kind of changed my mind recently, and I know he realized that just a few days before he died.</p> +<p>After <span class="caps">WWII</span> he did various things, he even was erhm&#8230; somehow active in <em>certain international import/export activities</em> of watches from Switzerland to Italy &#8211; quite a common thing back in the day, especially considering that the border was at just a few hours drive.<br /> +Later on he became an estate agent, working for a local office and then helping out some friends running their activity. In 2001 he hit his own personal record selling a fancy villa worth one billion of the old Italian Lire &#8211; which convert to approx. 500,000 Euro, but at the time it was much bigger money than that. With the commission generated by that sale he bought a brand new Ford Fiesta: he was 85 years old.</p> +<p>But no, these are not the most extraordinary episodes of his life of course. He could fly &#8211; literally.</p> +<p>He was one of the first man in Italy and the the first in Genoa area to get a flying license, back in 1934. A news which made the local papers at the time, and we still have that article somewhere. He wanted to become a civil pilot, but he never did: the Country needed him to protect our sky, when Italy joined the War in 1941.</p> +<p><strong>The Aviator</strong></p> +<p style="float:left;"><img src="/img/pictures/sessarego.jpg" alt="" /></p> +<p>My grandpa lived the early years of his youth in the village of Sessarego, where my great-grandfather bought an old house, after taking part in <a href="http://www.italian-american.com/garib-it.htm&#39;s">Giuseppe Garibaldi</a> expedition at Marsala (1860) fighting for the Italian independence (he&#8217;s listed among <a href="http://www.italian-american.com/garibal.htm">the ones</a> who actually landed there).<br /> +There his parents used to have a few cows and produce milk, and one of his tasks was milking delivery&#8230; no scooters or cars, at the time, of course, and certainly not for a teenager like him: he often had to carry the milk barrels up and down the hill <em>on foot</em>, and I&#8217;m talking about 1-2 Km with at least 30-40 kilos on your shoulders!</p> +<p>But my grandpa&#8217;s plans were much different: he wanted to fly away, and high &#8211; literally. You can imagine the face of my grand-grandfather when he expressed his wish to become a pilot! Nobody ever did that, in the area, and becoming a pilot was, at the time, like becoming an astronaut in the seventies.<br /> +The price of the license was really high at the time, 1,200 Lire. That would be like at least 30,000 Euro now, especially considering that his parents weren&#8217;t exactly rich. In the very end, my father supported him and provided as much money as he could afford: 1000 Lire.<br /> +But he still needed 200 Lire, so after hassling the flying instructors he signed an agreement stating that if they anticipated him the money he&#8217;d have paid them back once he started working: it was clear in fact that he&#8217;d have became a military pilot, as the Regime needed people for their brand new aircrafts, and the was felt imminent.<br /> +He paid them back, eventually, after passing both the civil and military tests. He became a sergeant for the <em>Regia Aviazione</em> (Royal Airforce), with a salary of 20 Lire/month, ten of which went to the flying school, for many months, but he was still earning some very decent money.</p> +<p>One of the most peculiar things about my grandpa was his memory: he was always able to tell you the story of his life, all the events, with the same details and <em>all the exact dates</em>, on every occasion. Even when we took him to the hospital, a few weeks ago, when we asked the nurse if he was self-conscious she said: <em>&#8220;Yes&#8230; well, he was talking a few hours ago, but I don&#8217;t know if he was raving or what&#8230; he said he was a pilot, and that he used to fly at 350Km/h&#8230;&#8221;</em></p> +<p style="float:right;"><img src="/img/pictures/r2002-main.jpg" alt="" /></p> +<p>Damn right. His old <a href="http://www.comandosupremo.com/Re2002.html">Re 2002</a> was able to fly at 350 Km/h if pushed, at a standard altitude of 35,000 m, while carrying a 500Kg bomb. It was <em>his</em> plane, and he never forgot that, even a few days before he passed away. He&#8217;d tell you all the stats, the mechanics, the technical details and all the tricks to perform acrobatic maneuvers if you asked him&#8230; Not that actually anybody ever did, because <em>every</em> time something reminded him of that, even slightly, he&#8217;d start talking about the old days when he was commanding his squad patrolling the Italian borders.</p> +<p>Last year, after my grandma died and he didn&#8217;t feel like driving 500Km to go to the mountains (for the first time in his life), I had to drive his <em>Fiesta</em> myself in my first long driving journey. At first I wasn&#8217;t too sure I&#8217;d have enjoyed the drive, partly because of the long distance and partly because I was going to be alone with my grandpa for about six hours, and I was afraid of not be able to find enough topics of conversation&#8230;</p> +<p>That fear went away almost instantly right a few minutes after we started the journey.<br /> +When we got on the motorway, I started complaining that my dad was going slightly over the limit with his brand new Peugeot 307: <em>&#8220;Look, he&#8217;s already going at 140km/h and we just started the journey!&#8221;</em></p> +<p><em>&#8220;Cent&ucirc;c&auml;ranta chilumetri l&#8217;&ucirc;a&#8230; &ucirc; m&euml; aeruplannu p&ucirc;eiv&auml; f&acirc; &iuml; trex&euml;ntusinc&ucirc;anta c&ucirc;mme ninte!&#8221;</em><br /> +[140 kilometers per hour&#8230; my plane could easily do 350!]</p> +<p>He normally used to speak in <em>zeneise</em> (&#8220;Genovese&#8221;), Genoa&#8217;s dialect, mixed with some Italian <em>if he really had to</em>. That was it: if you started talking about speed, technology, engines, history or any other topic which was <em>slightly</em> related to his plane, the war, the regime etc. he always started off talking about his past and his plane, ignoring everything else. <br /> +My grandma used to get kinda annoyed about it&#8230; on every occasion, if he had a chance, he&#8217;d start talking about <em>that particular day in 193x/4x</em> and so on: we all knew that, and actually I enjoyed listening to his stories, mostly because they were genuine and authentic relics of an old and glorious past. I think in his mind he wanted us all to remember him in that way, to always keep in mind that he was a pilot and how he enjoyed it, even when he went in jail for it, even when his plane was taken down&#8230;</p> +<p style="float:left;"><img src="/img/pictures/Re2002.jpg" alt="" /></p> +<p>On that day right after he was assigned to a new base, they asked him to perform some exercises in the air, loops and all sort of acrobatics: <em>&#8220;&euml; s&ouml;lite c&ouml;se che s&euml; d&ucirc;vi&euml;iva f&auml; in t&#8217;&euml; l&#8217;avi&auml;si&ucirc;n&#8221;</em> [the usual things you had to do in the airforce].<br /> +He was just starting practicing the Re 2002 at the time, but he quickly found out that it was <em>extremely</em> maneuvrable, at least to the standards of the time: the equivalent of a top range today&#8217;s fighter.<br /> +He started off with some usual things, performing various twists in the air, loops, etc. etc. until he had to end his exhibition with a dive from an altitude of 10,000m down at maximum speed to a limit of 1500m&#8230; On that particular day a colonel from another base and some other high-ranking officer were down on the ground near the aircraft to enjoy the show, and check that everything was performed correctly. My grandpa was aware of that, so he decided to perform a great show especially for them that day: he went up to 10,000m, and then dove down accelerating, helped by gravity&#8230; he went down and down, faster and faster, people down on the ground were staring at him waiting for him to pull up the plane, but nothing, he still went down and down so that quickly the small crowd of captains and colonels got scared and run away in every direction: <em>&#8220;He&#8217;ll crash, he&#8217;ll crash!&#8221;</em> <br /> +He did not crash, not that day&#8230; he went down up to slightly less than 100m and <em>then</em> pulled up the plane: ar real wonderful <em>extreme</em> performance. Now imagine this beast of a plane coming down at 300Km/h and accelerating, making a terrible noise typical of the engines of the time and then <em>pull up suddenly</em> right above your head: one more second and he wouldn&#8217;t have been able to tell that story.<br /> +He was called by the commander of the base who told him: <em>&#8220;Cevasco, you&#8217;re hell of a skilled pilot, but now I have to put you in jail for a day for not obeying your orders of staying above 1500m&#8221;</em> &#8211; That, I reckon, was one of the best days of my grandpa&#8217;s life.</p> +<p>He was never captured, but his plane was taken down by an English <em>Spitfire</em> in the South of Italy. The war was nearly finished, and there were just those little air fights from time to time. He really risked a lot that day, and managed to attempt an emergency &#8220;landing&#8221; completely destroying his plane along as part of his jaw, which was alright after a few months. <br /> +Since then he never flew again, and managed to escape to be re-called in duty. But he did like flying back with his memories to those glorious days.</p> +<p>A few years ago my dad showed him Microsoft&#8217;s <em>&#8220;Flight Simulator 98&#8221;</em>, and some other flying games. He was amazed at the graphic, but not so satisfied with the whole <em>simulation</em> thing: not even close to reality, too damn easy.</p> +<p><em>&#8220;C&auml;u m&euml;, te v&ucirc;eive vedde t&iuml;e a f&auml; v&ucirc;l&aacute; &ucirc; m&euml; aeruplannu&#8221;</em><br /> +[My dear, I&#8217;d have liked to see you trying to fly <em>my</em> plane]</p> +<p>&#8230;and that was it: the beginning of another journey back in time.</p> +<p>He always had a very practical view of life and especially of technology. He wouldn&#8217;t take you seriously and would not be interested in knowing about programming and the Internet, unless it could produce some concrete result:</p> +<p><em>&#8220;Ti che ti st&ucirc;ddi da insegn&euml; e che ti st&euml; sempre davanti a-&ucirc; cumputer, nun te puri&euml;sci truv&auml; &ucirc;n sistemm&auml; de an&auml; in t&#8217;&euml; a banca e piggi&euml; qualche mili&ucirc;n the Euro?&#8221;</em><br /> +[You that you&#8217;re studying to become an engineer and that spend so long in front of the computer, couldn&#8217;t you find a way to get into a bank and get out some million of Euro?]</p> +<p>He&#8217;d have loved me to become a [rich] hacker, probably&#8230; But the last time I saw him, last Friday, he seemed happy enough to hear that I was just about to start working.</p> +<p>He realized that I finally found a good job after my studies, and then my dad told him Roxanne and I would have moved to the countryside, in Sessarego&#8230; He made a big effort to move the muscles of his mouth in a large smile: he was happy.</p>
A contents/articles/21.html

@@ -0,0 +1,108 @@

+----- +title: Birthday present? Web space, please... +content-type: article +timestamp: 1146142020 +tags: website|review +----- +<p>Today is my birthday! <a href="/blog/view/20/">Not too happy</a>, but still my birthday after all. What presents did I get from my relatives and friends? Well, various things, but I told my parents and uncles I actually needed some web space&#8230; <em>&#8220;What? Didn&#8217;t you have the hosting sorted out?&#8221;</em><br /> +Well, I had, up to a few days ago when my friends and hosting provider, DeWayne Lehman, decided to close down his <a href="http://www.block-house.com">company</a>. The reason being, to cut a long story short, that he can&#8217;t keep up with competition: he doesn&#8217;t have enough customers, and he can&#8217;t afford server upgrades, while other companies are literally giving space away.<br /> +That was a pity, not only because Block House used to host various non-profit orgs and initiatives, but also because the guy who run it was an excellent admin, always offering excellent support.</p> +<p>Anyhow, in the end I&#8217;ll have to transfer all five of my sites to a new host, so here we go again: <em>what&#8217;s the best hosting company?</em><br /> +Obviously it depends a lot on what you&#8217;re looking for, and here&#8217;s what I need:</p> +<ul> + <li>At least 4GB of space</li> + <li>At least 30GB/month bandwidth</li> + <li><span class="caps">PHP</span> of course, but also other languages like Perl, Python and Ruby (+ Rails support)</li> + <li>MySQL databases&#8230; at least 10-20</li> + <li>Be able to host 5-6 sites minimum</li> + <li>Subdomains allowed (10 in total?)</li> + <li><span class="caps">FTP</span> <em>and <span class="caps">SSH</span></em> access</li> + <li>Subversion, if possible</li> +</ul> +<p>All this for less than 10$/month, ideally 5$, on shared hosting. I already made my choice and if you&#8217;re reading this post it means everything worked fine, but anyway, let&#8217;s have a look at what the market can offer for my needs. I only went for US-based hosts: Italian hosts are terrible and US hosts are normally more reliable and cheaper.</p> +<p style="float:left;"><img src="/img/pictures/dreamhost.gif" alt="" /></p> +<p>The first hosting company I was tempted by was <a href="http://www.dreamhost.com">DreamHost</a>. They can literally sell you anything but their mother, at stupidly cheap rates for what you get (apparently):</p> +<ul> + <li>20GB of space</li> + <li>1TB (!) bandwidth</li> + <li>PHP4, PHP5 Perl, Python and Ruby + RoR support</li> + <li>Unlimited databases</li> + <li>Unlimited hosted domains</li> + <li>Unlimited hosted subdomains</li> + <li><span class="caps">FTP</span> and <span class="caps">SSH</span> access</li> + <li>Subversion and <span class="caps">CVS</span></li> + <li>&#8230;and more</li> +</ul> +<p>For 7.95 if you pay two years in advance. And the first time you can get up to 97$ off by using one of the thousands referrer&#8217;s coupons available on the net. OK, where&#8217;s the catch? Well, there&#8217;s a <a href="http://futurosity.com/231/why-dreamhost-sucks">bad review</a> about them which points out that their reliability is not too great, for example, and that the seem to be rather dodgy in general. &#8220;They are overselling, they&#8217;ll soon enforce <span class="caps">CPU</span> restrictions&#8221; etc. etc. <br /> +<em>&#8230;let&#8217;s move along</em></p> +<p style="float:right;"><img src="/img/pictures/rails.gif" alt="" /></p> +<p>I might try out Ruby on Rails someday, so perhaps I thought it would be wise to choose a host supporting it, for a change. The first Rails friendly I thought about was <a href="http://www.railsplayground.org">RailsPlayground</a>, which started off as <span class="caps">FREE</span> Rails host and then ended up offering interesting commercial hosting plans. They are not bad, and I&#8217;d have probably gone with them if I had only one site to manage: for 60$ a year you get:</p> +<ul> + <li>3GB of space</li> + <li>30GB bandwidth</li> + <li>PHP4, PHP5 Perl, Python and Ruby + RoR support</li> + <li>Unlimited databases</li> + <li>Unlimited add-on domains</li> + <li>Unlimited hosted subdomains</li> + <li><span class="caps">FTP</span> and <span class="caps">SSH</span> access</li> + <li>Subversion and <span class="caps">CVS</span></li> + <li>&#8230;and more</li> +</ul> +<p>Well, the only reason why I didn&#8217;t go with them was that I did slightly more space, only that. The plan for 5GB of space costs 11$/month, which was too expensive for my liking.</p> +<p style="float:left;"><img src="/img/pictures/textdrive.gif" alt="" /></p> +<p>Since we&#8217;re talking about Rails, why not <a href="http://www.textdrive.com">Textdrive</a>? Founded by 200 IT professional, hosts high quality sites, it&#8217;s the official Rails host&#8230; An &#8220;elite&#8221; solution, here&#8217;s what you get:</p> +<ul> + <li>Use Apache and Lighttpd web servers side-by-side</li> + <li>Host PHP4 and PHP5 web pages and applications</li> + <li>Host a weblog using Textpattern, Wordpress, MovableType, Typo, etc</li> + <li>Host Ruby and Ruby on Rails applications (including <span class="caps">FCGI</span> and hundreds of gems)</li> + <li>Host Perl applications (including 100&#8217;s of Perl modules)</li> + <li>Host Python applications like Django</li> + <li>Manage your code base with version control (Subversion, <span class="caps">SVK</span>, Darcs, Monotone &amp; Arch)</li> + <li>Share iCal files over WebDAV</li> + <li>Mount a WebDAV drive on your desktop (like iDisk)</li> + <li>Easily create free subdomains with wildcard <span class="caps">DNS</span></li> + <li>Store your Basecamp file uploads over <span class="caps">SFTP</span></li> + <li>Access your account via <span class="caps">SFTP</span> and <span class="caps">SSH</span></li> + <li>Add domains, unlimited <span class="caps">IMAP</span> and <span class="caps">POP</span> mail boxes and mail aliases through a control panel</li> + <li>Check your email through Webmail</li> + <li>Host Mailman mailing lists complete with archives</li> + <li>Use MySQL (default), PostgreSQL, SQLite and Berkeley databases</li> +</ul> +<p>Plans start at 12$/month for 1GB of space and one website&#8230; The 3GB one is 40$/month, for 20 sites in total. Too bad it&#8217;s too expensive for me as they are truly the top for shared hosting &#8211; I think.</p> +<p><a href="http://www.hostgator.com/">Host Gator</a>, which seems to be one of the most frequently recommended at SitePoint.com forums, is not bad either. They have a &#8220;hatchling&#8221; plan for 3,5GB at 6.95, which wasn&#8217;t bad, but it only allows one domain to be hosted. The &#8220;Baby&#8221; plan allows unlimited domains and is 9.95$/month, which is kinda dear. You get:</p> +<ul> + <li>5GB of space</li> + <li>75GB bandwidth</li> + <li>PHP4, PHP5 Perl and Python</li> + <li>Unlimited databases</li> + <li>Unlimited add-on domains</li> + <li>Unlimited hosted subdomains</li> + <li><span class="caps">FTP</span> access</li> + <li>&#8230;and more</li> +</ul> +<p>No <span class="caps">SSH</span>, no <span class="caps">SVN</span> and no Rails: out.</p> +<p><a href="http://www.site5.com/">Site5</a> is also one of SitePoint&#8217;s favourite, but still has limitations on the number of sites. I would have got the SuperHosting <span class="caps">XTREME</span>, for 7,77$/month:</p> +<ul> + <li>11GB of space</li> + <li>400GB bandwidth</li> + <li>PHP4, PHP5 Perl, Python, Ruby + RoR support</li> + <li>Unlimited databases</li> + <li>5 domains hosted</li> + <li>Unlimited hosted subdomains</li> + <li><span class="caps">FTP</span> and <span class="caps">SSH</span> access</li> + <li>&#8230;and more</li> +</ul> +Not bad, a little bit too much for only 5 sites&#8230; I needed 6, too bad :/ +<div style="float:right; padding:3px;"><script src="http://www.bluehost.com/src/js/h3rald/CODE2/488x160/1.jpg"></script> </div> <p>This site is currently hosted on <a href="http://www.bluehost.com">BlueHost</a>, a hosting company established in 1996, which seems to be reliable enough (not many complaints on the net) and seems serious enough. They don&#8217;t offer subversion and WebDAV for &#8220;security reasons&#8221; and in order to get a shell account you have to send them a copy of an ID card. Annoying? Well, perhaps for some: this made me understand that they don&#8217;t allow just anybody to get <span class="caps">SSH</span> access unconditionally, and I didn&#8217;t mind. I sent them a scansion of my ID card and I got a friendly support email after a few minutes, confirming that it was activated. Here&#8217;s what I got:</p> +<ul> + <li>15GB of space</li> + <li>400GB bandwidth</li> + <li>PHP4, PHP5 Perl, Python, Ruby + RoR support</li> + <li>20 MySQL databases + 10 PostgreSQL databases</li> + <li>6 domains hosted in one account (easier for me!)</li> + <li>20 subdomains + 20 parked domains</li> + <li><span class="caps">FTP</span> and <span class="caps">SSH</span> access</li> + <li>&#8230;and more</li> +</ul> +<p>For 6,65$/month, 2 years pre-payment. One of the good things is that they are not fussy about giving the money back if you cancel. Anyhow&#8230; let&#8217;s hope for the best, so far, so good.</p>
A contents/articles/22.html

@@ -0,0 +1,108 @@

+----- +title: Ten minutes on Rails (while eating Cake) +content-type: article +timestamp: 1146317340 +tags: cakephp|rails|webdevelopment +----- +<p>Today I decided to do something different, something I&#8217;ve been dying to do since before coming across CakePHP: give Rails a <em>proper</em> try. Like many other <span class="caps">PHP</span> developers out there, when <a href="http://www.rubyonrails.org">Ruby on Rails</a> came out I felt damn jealous and terribly tempted to learn Ruby <em>only</em> to start using such an amazing web development framework. At the time I actually even started reading various tutorials about it, and I was literally amazed at how RoR revolutioned the way of developing web applications.</p> +<p style="float:left;"><img src="/img/pictures/rails.gif" alt="" /></p> +<p>One of the main problems which made me &#8211; sadly &#8211; abandon Rails was Ruby itself: personally I&#8217;ve never seen a programming language with a cleaner and more elegant syntax, but also &#8211; at least at the time &#8211; there weren&#8217;t many hosts supporting it. LuckilyI found CakePHP quickly after that&#8230;<br /> +Now however, more and more hosting companies boast full Rails support, and so when recently I <a href="/blog/view/21/">had to move</a> to a new host, I made sure it was Rails-friendly, <em>just in case I wanted to give Rails another try, someday</em>.<br /> +Oh well, the temptation was so strong that today, only a two days after switching to my new host, I felt I <em>had</em> to try it, I <em>had</em> to taste something different than the usual Cake.</p> +<p>I decided to (re-)read and follow the <a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html">OnLamp tutorial</a> about RoR, step by step, once again. I quickly typed <code>rails cookbook</code> from my shell and voil&aacute;, rails silently creates the skeleton of my application:</p> +<p><span class="caps">README</span><br /> +Rakefile<br /> +app/<br /> +components/<br /> +config/<br /> +db/<br /> +doc/<br /> +favicon.ico<br /> +index.html<br /> +lib/<br /> +log/<br /> +public/<br /> +script/<br /> +structure.txt<br /> +test/<br /> +tmp/<br /> +vendor/</p> +<p>That&#8217;s familiar: it&#8217;s very similar to what CakePHP&#8217;s directory structure used to look like. Now Cake <em>evolved</em> and adopted its own schema, which &#8211; I must say &#8211; seems more functional than RoR&#8217;s, at least at a first glance:</p> +<ul> + <li>app/ + <ul> + <li>config/</li> + <li>controllers/</li> + <li>models/</li> + <li>plugins/</li> + <li>tmp/</li> + <li>vendors/</li> + <li>views/</li> + <li>webroot/</li> + </ul></li> + <li>cake/ + <ul> + <li>config/</li> + <li>docs/</li> + <li>libs/</li> + </ul></li> + <li>vendors/</li> +</ul> +<p style="float:right;"><img src="/img/pictures/cakephp.png" alt="" /></p> +<p>Cake felt the necessity to divide what you can mess with (<code>app/</code>, <code>vendors/</code>) from what you&#8217;d better not touch (<code>cake/</code>). Rails just left everything on the same level.</p> +<p>After creating my database and the necessary tables I have to edit <code>config/database.yml</code>, which corresponds to Cake&#8217;s <code>app/config/database.php</code>. Then things start to become a bit different from Cake, as Rails offers some very handy built in scripts which can be used to automatically create your application&#8217;s files, i.e. executing <code>ruby script/generate controller Recipe</code> creates the controller and other bits:</p> +<pre><code>exists app/controllers/ +exists app/helpers/ +create app/views/recipe +exists test/functional/ +create app/controllers/recipe_controller.rb +create test/functional/recipe_controller_test.rb +create app/helpers/recipe_helper.rb</code></pre> +<p>And so on. Anyhow&#8230; I followed the tutorial and yes, it was a nice read. CakePHP borrowed a lot from Rails but not everything. Inevitably Ruby&#8217;s syntax is less verbose and looks very very clean:</p> +<p>&lt;% highlight :ruby do %&gt;<br /> +class RecipeController &lt; ApplicationController<br /> + scaffold :recipe</p> +<p>def list<br /> + @recipes = Recipe.find_all<br /> + end</p> +<p>def edit<br /> + <code>recipe = Recipe.find(</code>params[&#8220;id&#8221;])<br /> + @categories = Category.find_all<br /> + end<br /> +end<br /> +&lt;% end %&gt;</p> +<p>While CakePHP&#8217;s, simply because it uses <span class="caps">PHP</span> and not Ruby, looks less pretty:</p> +<p>&lt;% highlight :php do %&gt;<br /> +class RecipesController extends AppController<br /> +{<br /> + var $scaffold;</p> +<p>function list()<br /> + {<br /> + $this&#8594;set(&#8216;recipes&#8217;, $this&#8594;Recipe&#8594;findAll());<br /> + }</p> +<p>function edit($id)<br /> + {<br /> + $this&#8594;set(&#8216;recipe&#8217;, $this&#8594;Recipe&#8594;find(&#8220;id = $id&#8221;));<br /> + $this&#8594;set(&#8216;categories&#8217;, $this&#8594;Category&#8594;findAll());<br /> + }</p> +<p>}<br /> +&lt;% end %&gt;</p> +<p>CakePHP Development Team did a great job translating some of Rails functionalities into <span class="caps">PHP</span>, and the while CakePHP&#8217;s syntax is <strong>much</strong> cleaner if compared to PHP&#8217;s standard spaghetti-code approach, Ruby just looks much more clear, sorry. <em>Imagine a world without funny unnecessary brackets, pointless semicolons and where everything just looks better</em>: that&#8217;s Ruby.</p> +<p>Sigh. Now I do understand why Rails was built in Ruby and not in <span class="caps">PHP</span>: simply because a PHP&#8217;s Rails would have been outscored by its &#8220;Ruby port&#8221;!</p> +<p>One thing I liked about Rails which has not been ported in Cake (yet) is a somehow smarter way of scaffolding. While the Ruby code above actually works, the CakePHP&#8217;s edit method doesn&#8217;t, or better, it does but not as expected: when you remove <code>var $scaffold</code> the scaffold is just plain gone, and you have to code everything yourself, while in Ruby you can leave the scaffold and then develop methods one by one, and still be able to use scaffolded methods if you didn&#8217;t define the custom ones.</p> +<p>The other thing I noticed about RoR is that it definitely handles errors better! This is probably another language issue. I basically forgot to set a category for the recipes, and when executing my custom list of recipes I got a very, very well structured error page showing something like:</p> +<p>&lt;% highlight :ruby do %&gt;<br /> +NoMethodError in Recipe#index</p> +<p>Showing app/views/recipe/index.rhtml where line #18 raised:</p> +<p>You have a nil object when you didn&#8217;t expect it!<br /> +The error occured while evaluating nil.name</p> +<p>Extracted source (around line #18):</p> +<p>15: &lt;% @recipes.each do |recipe| <span>&gt;<br /> +16: <tr><br /> +17: <td>&lt;</span>= link_to recipe.title, :action =&gt; &#8220;show&#8221;, :id =&gt; recipe.id <span>&gt;</td><br /> +18: <td>&lt;</span>= recipe.category.name <span>&gt;</td><br /> +19: <td>&lt;</span>= recipe.date <span>&gt;</td><br /> +20: </tr><br /> +21: &lt;</span> end <span>&gt;<br /> +&lt;</span> end %&gt;</p> +<p>I took a screenshot of the page, because it was too nice: <a href="/img/pictures/rails_error.jpg">check it out</a>. This error page really tells you what&#8217;s wrong, and even prints the lines of code around the error! It also lets the developer check the full backtrace and every sort of information&#8230; Can we have this in CakePHP please? I actually started to develop something like this, but seemed quite hard to do in <span class="caps">PHP</span>.</p>
A contents/articles/23.html

@@ -0,0 +1,67 @@

+----- +title: A look at Symfony +content-type: article +timestamp: 1146483766 +tags: frameworks|php|cakephp +----- +<p>CakePHP is <span class="caps">THE</span> perfect <span class="caps">PHP</span> framework, so <em>we</em> don&#8217;t need anything else. Oh well, no. I personally love CakePHP, but I do believe other <span class="caps">PHP</span> frameworks can be interesting and maybe even useful, so today I thought I&#8217;d have a look at the <a href="/bookmarks/view/simfony/">Simfony Project</a>. This framework seems to be mentioned here and there on the Net in many different ways, someone said it can do wonders, some said it&#8217;s more advanced, others said something like <em>&#8220;qcodo sucks.. cake stinks.. symfony rocks!!!!!&#8221;</em>, so it <span class="caps">OUGHT</span> TO be pretty cool, definitely.</p> +<p style="float:left;"><img src="/img/pictures/symfony.gif" alt="" /> <em>Know thy enemy</em> someone said (OK, bad joke), so let&#8217;s have a look at this interesting alternative to CakePHP. <em>No dude, not another <span class="caps">MVC</span>-like, pseudo-Rails, <span class="caps">AJAX</span>-worshipping framework!</em> Yes, another one. Actually Symfony is more than that: while people <em>can</em> say CakePHP is similar to RoR for some features and for the strong <span class="caps">MVC</span> architecture, Symfony chose another road. Yes, <span class="caps">MVC</span> is still there, but the first thing I noticed after reading their <a href="http://www.symfony-project.com/tutorial/my_first_project.html">beginners&#8217; tutorial</a> was that one of the things which Symfony seems to use quite regularly (and Cake doesn&#8217;t)is code generators. Things like executing <code>symfony propel-build-sql</code> or even <code>symfony propel-generate-crud frontend post Post</code> from command line to generate your code automagically, which CakePHP &#8211; except for our little <em>bake</em> script &#8211; doesn&#8217;t use. <br /> +<em>See? Simfony is <span class="caps">MUCH</span> better and <span class="caps">MUCH</span> more advanced than Cake!</em> No, hang on a minute&#8230; I just listed one thing which Symfony has more than Cake, is there any more? Yes, there is, for now: i18n &#8211; internationalization. Symfony comes with native multi-lingual support and Cake doesn&#8217;t &#8211; yet &#8211; although there are rumors that i18n for Cake 2.0 is <em>almost done</em>. This is not speculation, re-read the sentence: First off I&#8217;m referring to Cake <em>2.0</em> (which means it will take a while) and also I read it in the <a href="https://trac.cakephp.org/wiki/Proposals/2.0ToDoList">Cake 2.0 ToDo List</a>.</p> +<p>One of the most recurring and yet pointless critiques to CakePHP from Symfony enthusiasts is that the sites developed with CakePHP look terrible. I perfectly agree, look at <a href="http://www.h3rald.com/">this</a> and tell me if the developer is not a complete and hopeless idiot when it comes to design and look &#8216;n&#8217; feel!<br /> +I do agree that some CakePHP sites (mine, mainly) don&#8217;t look too good, and probably the Cake Software Foundation should pay me to put it offline. I also agree that the Symfony website looks nice and is more pleasant to the eye than CakePHP&#8217;s, but I do hope that the old &#8220;design contest&#8221; doesn&#8217;t get forgotten&#8230;</p> +<p style="float:right;"><img src="/img/pictures/askeet.gif" alt="" /> The Symfony team also did something truly remarkable: a comprehensive tutorial, an advent calendar, some great free source code to download and a fully functional Web 2.0-compliant online application <em>all in one</em>. I&#8217;m referring to <a href="/bookmarks/view/askeet/">Askeet</a>, a Symfony-powered website which has been built from scratch using the framework and its development is well documented in <a href="http://www.symfony-project.com/askeet">twenty-four tutorials</a>. In one move these guys made an interesting website, some useful documentation and self promotion&#8230; what can I say: for next Christmas we&#8217;d better chain PHPnut, gwoo, nate &amp; the others to their chairs, close them in a small room and force them to code something like that in twenty-four days.<br /> +If I were to mention something which Symfony did well I&#8217;d certainly say the <a href="http://www.symfony-project.com/content/documentation.html">documentation</a>. Screencasts, tutorials, advent calendars, a book, a wiki, <span class="caps">API</span> etc. etc. All done, and all good, I must admit that. The good news is that CakePHP is slowly catching up, and now the <a href="http://manual.cakephp.org">manual</a> looks pretty decent.</p> +<p>OK, enough flattering and let&#8217;s talk about something I didn&#8217;t like about Symfony. I downloaded the thing and it turns out it&#8217;s 1.2MB in size, <em>a hell of a framework!</em> After extracting the beast I had a look inside and found three directories: <code>data</code>, <code>lib</code> and <code>bin</code>. Not bad. I opened <code>bin</code> and found the three magic symfony scripts, alright; I opened <code>data</code> and found nine directories, I opened <code>lib</code> (the real deal) and found 25 directories! These guys maybe never heard of something called <em>&#8220;an organized directory structure&#8221;</em>, or perhaps I&#8217;m just too used to Cake&#8217;s logic and essentiality.<br /> +Browsing around I found something like 247 .dat files defining country names and currencies in all the languages of the world, script.aculo.us and prototype libraries, javascript calendars and other wonders&#8230; Weeeeheee! <br /> +The good thing is that Symfony seems to include pretty much everything you&#8217;d ever need, the bad thing is that <em>personally</em> I will never use any of the thirteen Chinese-related .dat files in th i18n directory. This philosophy is exactly the opposite to Cake: at first i got pissed off when I noticed that CakePHP doesn&#8217;t include prototype by default, but then I realized that if they started include <em>everything</em> you <em>might</em> need <em>someday</em> we&#8217;d end up like&#8230; like Symfony, with 1.2MB of stuff 500KB of which &#8211; at least &#8211; will most likely not be of any use for the average developers.</p> +<p>The other dangerous consequence of including more and more stuff is the so called <em>widget-temptation</em>: If you include script.aculo.us you <span class="caps">MUST</span> show off and offer some weird toy someone <em>may</em> use&#8230; well, Symfony seems to go in that direction, and someone compared it to component-driven frameworks like eZ Publish rather than more general-purposes projects. I&#8217;m sure the <a href="http://www.symfony-project.com/content/book/page/generator.html">admin generator</a> can be damn handy, but what happens if I&#8217;m a terribly annoying guy who&#8217;d like to tweak it and change it so that it fits <em>my</em> needs? In Cake&#8230; well, there&#8217;s nothing &#8220;official&#8221; included in the core, and when you find a third-party helper or component you feel you can take a look and poke around, extend it, or change it totally. It&#8217;s all up to the developers and their needs: personally think that widgets are useful, but some times people like a bit more flexibility.</p> +<p>So the overall impression of Symfony is that &#8211; regardless its arguable, self-proclaimed, <em>enterprise-ready</em> status &#8211; it is rather complex, with a steep(er) learning scheme which doesn&#8217;t justify the extra features.</p> +<p>From the <a href="http://www.symfony-project.com/tutorial/my_first_project.html">My first Symfony project</a> tutorial:</p> +<blockquote> +<p>So, the weblog will handle posts, and you will enable comments on them. Edit the file sf_sandbox/config/schema.xml and paste the following configuration:<br /> +<small><br /> +<pre><code> +&lt;?xml version="1.0" encoding="UTF-8"?&gt; +&lt;database name="propel" defaultIdMethod="native" noxsd="true"&gt; + &lt;table name="weblog_post" phpName="Post"&gt; + &lt;column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" /&gt; + &lt;column name="title" type="varchar" size="255" /&gt; + &lt;column name="excerpt" type="longvarchar" /&gt; + &lt;column name="body" type="longvarchar" /&gt; + &lt;column name="created_at" type="timestamp" /&gt;</p> +</blockquote> +</table> + +<table name="weblog_comment" phpName="Comment"> +<column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" /> +<column name="post_id" type="integer" required="true" /> +<foreign-key foreignTable="weblog_post"> +<reference local="post_id" foreign="id"/> +</foreign-key> +<column name="author" type="varchar" size="255" /> +<column name="email" type="varchar" size="255" /> +<column name="body" type="longvarchar" /> +<column name="created_at" type="timestamp" /> +</table> +</database> +<p></code></pre><br /> +</small><br /> +This code is longer to read than to explain: It describes two tables Post and Comment.</p> +<p>NO! Sorry, no. This is <span class="caps">NOT</span> simple. It is logic, clear and makes perfect sense, it&#8217;s not that I&#8217;m retarded and I can&#8217;t write or read <span class="caps">XML</span> files, it&#8217;s just unnecessary. You create this and then call the slave-script to create the model and the corresponding database table&#8230; This is exactly the <em>enterprise</em> way of doing things CakePHP made me forget. <em>Convention over configuration</em>. Not hundreds of configuration files.</p> +<p>But there&#8217;s more: you can even configure your views with some simple <code>.yml</code> (!) file:<br /> +<pre><code> +default: + http_metas: + content-type: text/html; charset=utf-8 + metas: + title: The best weblog ever + robots: index, follow + description: symfony project + keywords: symfony, project + language: en +</code></pre></p> +<p>Sure, it&#8217;s good. It helps, and it&#8217;s certainly useful, but I&#8217;d rather code a custom component to do the same thing with a few arrays. Again, this is arguable.<br /> +Validation is done through .yml files, and you can configure your administrator backend through a .yml file too! Cake has .ini-based <span class="caps">ACL</span>, and that&#8217;s about it: if I don&#8217;t want to use them I don&#8217;t use them. <br /> +Clearly you probably don&#8217;t have to edit all settings in the configuration files, but I just don&#8217;t like the approach, personally.</p> +<p>Oddly enough, Symfony&#8217;s slogan seems to be &#8220;professional web tools for lazy folks&#8221;&#8230;</p> +<p>It all depends on what you need. For <em>my</em> needs I chose CakePHP, and <a href="https://trac.cakephp.org/wiki/Cake/About">here&#8217;s why</a>.</p>
A contents/articles/24.html

@@ -0,0 +1,49 @@

+----- +title: CakePHP 1.0 released +content-type: article +timestamp: 1146625560 +tags: cakephp|webdevelopment +----- +<p>As <a href="http://digg.com/programming/CakePHP_1.0_has_been_released">Digg</a>_ points out, the first <em>stable</em> version of CakePHP was released, yesterday. I should have posted yesterday about it, and no, I didn&#8217;t forget: I was just busy downloading the new version, have a look at the new site, talk to people etc.</p> +<p>Anyhow, it&#8217;s ready, just baked and smells damn good. Go get it if you didn&#8217;t already, it&#8217;s available at <a href="http://cakeforge.org/frs/?group_id=23">the usual place</a>, even this time you won&#8217;t be disappointed. CakePHP now reached the 1.0 milestone, in a way which reminds me a lot about Mozilla Firefox: a lot of people were already using it <em>before</em> it went stable officially!</p> +<p style="float:left;"><img src="/img/pictures/CakePHP_1.0.png" alt="" /></p> +<p>The CakePHP Team has been humble enough not to declare their product <em>stable</em> before the time. I personally considered CakePHP stable <em>enough</em> since RC2&#8230; and considering that this site and many others have been built on alpha, beta and RC version, I think people can get an idea of Cake&#8217;s reliability.<br /> +Nothing (too) new came out the oven this time: CakePHP 1.0 is mainly a bugfix release, with all the features we&#8217;ve learnt to love. It&#8217;s just <em>better_: a lot of things have been fixed, model associations work better, etc. etc. You can read the <a href="http://cakeforge.org/frs/shownotes.php?group_id=23&amp;release">changelog/announcement</a></em>id=85 or have a look below for a quick summary of the new features and most interesting fixes:</p> +<pre><code> +Revision: [2420] +Added fix for Ticket #320. +Fixed Model::save() so it will only allow a model to save itself. +Fixed Model::save() when saving a HABTM association + +Revision: [2437] +Adding fix for Model::findNeighbours(). +Was returning all associations and fields. Now recursive +is set to 0 and only returns the prev and next keys array + +Revision: [2456] +"Enables use of Controller::$data in addition to Controller::$params['data']" + +Revision: [2490] +Fixing a bug that occurs when connecting to two different +databases on the same server, and enabling cross-database +model associations + +Revision: [2491] +Adding Microsoft SQL Server driver [EXPERIMENTAL] + +Revision: [2577] +Adding $alias property to enable future Oracle support + +Revision: [2625] +Bringing all DB drivers up to date + +Revision: [2653] +Adding check for custom error class in app/. +Added check for AppController::appError(); will be called if this method +is in AppController. +</code></pre> +<p style="float:right;"><img src="/img/pictures/cakesite.png" alt="" /></p> +<p>If you&#8217;re not too excited about this new release, maybe you should have a look at <a href="http://www.cakephp.org">www.cakephp.org</a>. Different? Damn right it is: it looks like someone listened to our prayers for a new website design. The merciful soul is <a href="http://www.nolimit-studio.com/">Armando Sosa</a>, the winner of CakePHP&#8217;s design contest. He&#8217;s a latin-american web designer who had the <span class="caps">GREAT</span> idea of thinking about an <em>innovative</em> design for the Cake site&#8230; Actually my dad didn&#8217;t think that way: <em>&#8220;That&#8217;s not new, that way of advertising was all over the place when I was a kid!&#8221;</em> And he&#8217;s right, Armando thought that a fifties-like template would have been perfect for Cake. Forget all the smooth, roundy-and-chubby, toons-like &#8220;official&#8221; Web 2.0 designs (beta), the new Cake site needs to stand out of the crowd&#8230;</p> +<p style="float:left;"><img src="/img/pictures/fonz.jpg" alt="" /></p> +<p><br /><br /> +<em>Heyyy! Well done guys&#8230;</em></p>
A contents/articles/25.html

@@ -0,0 +1,22 @@

+----- +title: Digg Effect - the day after +content-type: article +timestamp: 1146794340 +tags: web20|webdevelopment|internet +----- +<p>&#8230;So it turns out that my <a href="http://www.h3rald.com/articles/view/rails-inspired-php-frameworks/">last article</a> appeared on <a href="http://www.digg.com">Digg</a> homepage. <br /> +This was quite a pleasant surprise: I didn&#8217;t expect that an article submitted to <em>my own site</em> could make it that far! I thought you&#8217;d need a relatively well-known website, mafia&#8217;s support, some divine intervention and a terrific amount of luck, but it seems that sometimes an interesting article about an interesting subject can be enough. I&#8217;ll probably write a more detailed report of what happened soon, in another article rather than a blog post, but for now I just wanted to post a short summary here.</p> +<p>Two days ago I decided to write a roundup of the six Rails-inspired <span class="caps">PHP</span> frameworks, CakePHP, Symfony, <span class="caps">PHP</span> on Trax, Code Igniter, Biscuit and Pipeline. The reason for this was that I couldn&#8217;t find anything comparing all of them and such comparison could have been useful for some new <em>bakers_. OK, I confess, when I started writing the article I thought I&#8217;d submit it to Digg and see what happens: I saw that another <a href="http://www.phpit.net/article/ten-different-php-frameworks/">roundup</a> made it to the first page and people were quoting it everywhere on the net. It&#8217;s a nice article, but &#8211; in my humble opinion &#8211; not too exhaustive. <br /> +Then I read a comment by someone to the <a href="http://digg.com/programming/CakePHP_1.0_has_been_released">digg</a></em> of the latest Cake release stating:</p> +<blockquote> +<p>Yes, they are similar &#8211; both were inspired by Rails, but Cake has gone further to differentiate themselves. Here&#8217;s a decent (but not great) overview of some frameworks: http://www.phpit.net/article/ten-different-php-frameworks/</p> +</blockquote> +<p>At that point, I thought that another round up, perhaps more Cake-centric, was in order. The other reason was that in one of my recent <a href="http://www.h3rald.com/blog/view/23/">blog posts</a> I tried to compare CakePHP and Symfony, but obviously my emotions got in the way and in the end I noticed I was kinda <em>attacking</em> Symfony. That was a blog post though, and that&#8217;s half-allowed, but I felt that I should have written a slightly more objective <em>article</em> mentioning also all the other competitors.</p> +<p>Anyhow, right when I went to submit my article to Digg, it turns out that another guy wrote <a href="http://digg.com/programming/5_Next_Generation_PHP_Frameworks">a similar round up</a>, which made it to Digg&#8217;s homepage. That was an annoying cohincidence, but in the end things didn&#8217;t go too bad: his roundup was more generic, while mine was more specific and detailed.</p> +<p style="float:left;"><img src="/img/pictures/dugg_detail.png" alt="" /></p> +<p>After submitting my article the reaction wasn&#8217;t instantaneous&#8230; 5, 7, 10, 13 diggs in the first two hours. Then shortly I made it to 30 and when the 40th visitor dugg it my article was moved to the first page!<br /> +I immediately noticed it when I refreshed my stats page: a minute before my girlfriend was here telling me &#8220;oh look, over 400 visitors&#8230; not too bad&#8221;. Then I refreshed the page and it said <em>539</em>, I refreshed again and said 600-something&#8230; eeep&#8230; Digg effect!</p> +<p>A special praise goes to my new hosting company, <a href="http://www.bluehost.com/track/h3rald/CODE5">BlueHost</a>: the server didn&#8217;t go down and it managed the extra traffic fine! A good test for CakePHP as well, since I built this site with it.</p> +<p>So here I am&#8230; over 5000 visitors read my article, about 600 people dugg it, nearly 40 people commented it on digg.com and 20 directly on my site. And &#8211; except for the usual <em>Rails-is-better-than-anything-else</em> comments &#8211; they were generally positive. Over 250 people bookmarked on del.icio.us and many blogs mentioned it in many different countries.</p> +<p>Money? Didn&#8217;t make much with adsense at all: programmers <em>don&#8217;t</em> click on ads!<br /> +Bandwidth? About 1GB was gone in the first five hours, now is obviously slowing down: oh well, I still have another 398GB available till the end of the month :P</p>
A contents/articles/26.html

@@ -0,0 +1,107 @@

+----- +title: bake.php - Easy baking for lazy folks +content-type: article +timestamp: 1146922980 +tags: cakephp|frameworks +----- +<p>When I first tried Ruby on Rails I was literally amazed by the <em>generator</em> script. Yes, I was young and inexperienced then (six/seven months ago), but you must admit that getting a controller, a model, all the basic views generated automatically by</p> +<p><code>rails script/generator scaffold Posts</code></p> +<p>is not a bad thing. Especially if the same script allows you to create model, views and controller separately and other things. <a href="http://www.symfony-project.com/">Symfony</a> and <span class="caps">PHP</span> on Trax already tried to port this functionalities, with mixed results. What about Cake? Oh well, yes, we do have something like that&#8230; something rather different, but still something: the <code>bake.php</code> script.<br /> +This cute little thing is located in the <code>cake/scripts/</code> folder and can be used &#8211; hear, hear &#8211; from command line. You can run Ruby and Perl scripts, so yes, you can actually run <span class="caps">PHP</span> from command line, although it&#8217;s not its primary purpose.</p> +<p><img src="/img/pictures/bake.jpg" alt="" /></p> +<p>Cool then, let&#8217;s open a *nix shell, Windows command prompt, etc. etc., go into the <code>cake/scripts/</code> folder and run:</p> +<p><code>php bake.php</code></p> +<p>Assuming that the php executable is in your <em><span class="caps">PATH</span></em> environment variable &#8211; if not, either you add it or you&#8217;ll have to type something like:</p> +<p><code>D:SERVERphpphp.exe bake.php</code></p> +<p>depending on where your php executable is. You&#8217;ll be be greeted by a &#8220;<span class="caps">CAKEPHP</span> <span class="caps">BAKE</span>&#8221; text, and then you&#8217;ll be asked a few questions. One thing to realize before proceeding any further: bake.php is <em>not</em> a generator, not in the traditional &#8220;Rails&#8221; sense, anyway. It&#8217;s rather a handy but more verbose dialogue-based configuration script &#8211; which will also generate <em>something</em> eventually if you provide all the necessary details.<br /> +A different approach, which may be good or bad according to your taste: personally I think we should also have something faster to use, like a Rails generator, and I opened a <a href="https://trac.cakephp.org/ticket/768">ticket</a> about it, but let&#8217;s see what bake.php can do, for now.</p> +<p>The answer is&#8230; nearly anything. It annoying enough to please, but if you follow its directions it can do a prettu decent job in the end, it&#8217;s far from being sentient, but let&#8217;s say it&#8217;s smart enough for a script. First of all if you try it out on a fresh Cake install it will notice that you haven&#8217;t configured your database yet, so it will ask for a hostname, username, password, database name etc. etc. and generate your <code>app/config/database.php</code> for you, not a bad start.</p> +<p>Once that&#8217;s done &#8211; and it won&#8217;t go on unless you configure a (MySQL only?) database &#8211; you can proceed with the rest. You can start creating either a controller, model or view; I tried a <code>Posts</code> controller, for example. The script then asks quite a few questions:</p> +<ul> + <li>The controller&#8217;s name</li> + <li>Whether it will use other models besides posts</li> + <li>Whether you want to include any helper</li> + <li>Whether you want to include any component</li> + <li>Whether you want to generate the base <span class="caps">CRUD</span> methods</li> +</ul> +<p>Then finally it generates the damn thing. The result is good enough:</p> +<p><small><br /> +<pre><code> +&lt;?php +class PostsController extends AppController +{ + //var $scaffold; + var $name = 'Posts';</p> +<p>function index()<br /> + {<br /> + $this&#8594;set(&#8216;data&#8217;, $this&#8594;Post&#8594;findAll());<br /> + }</p> +<p>function add()<br /> + {<br /> + if(empty($this&#8594;params[&#8216;data&#8217;]))<br /> + {<br /> + $this&#8594;render();<br /> + }<br /> + else<br /> + {<br /> + if($this&#8594;Post&#8594;save($this&#8594;params[&#8216;data&#8217;]))<br /> + {<br /> + $this&#8594;flash(&#8216;Post saved.&#8217;, &#8216;/posts/index&#8217;);<br /> + }<br /> + else<br /> + {<br /> + $this&#8594;render();<br /> + }<br /> + }<br /> + }</p> +<p>function edit($id)<br /> + {<br /> + if(empty($this&#8594;params[&#8216;data&#8217;]))<br /> + {<br /> + $this&#8594;set(&#8216;data&#8217;, $this&#8594;Post&#8594;find(&#8216;Post.id = &#8217; . $id));<br /> + }<br /> + else<br /> + {<br /> + if($this&#8594;Post&#8594;save($this&#8594;params[&#8217;data&#8217;]))<br /> + {<br /> + $this&#8594;flash(&#8216;Post saved.&#8217;, &#8216;/posts/index&#8217;);<br /> + }<br /> + else<br /> + {<br /> + $this&#8594;set(&#8216;data&#8217;, $this&#8594;params[&#8216;data&#8217;]);<br /> + $this&#8594;validateErrors($this&#8594;Post);<br /> + $this&#8594;render();<br /> + }<br /> + }<br /> + }</p> +<p>function view($id)<br /> + {<br /> + $this&#8594;set(&#8216;data&#8217;, $this&#8594;Post&#8594;find(&#8217;Post.id = &#8217; . $id));<br /> + }</p> +<p>function delete($id)<br /> + {<br /> + $this&#8594;Post&#8594;del($id);<br /> + $this&#8594;redirect(&#8216;/posts/index&#8217;);<br /> + }</p> +<p>function postList()<br /> + {<br /> + $vars = $this&#8594;Post&#8594;findAll();<br /> + foreach($vars as $var)<br /> + {<br /> + $list[$var[&#8216;Post&#8217;][&#8216;id&#8217;]] = $var[&#8216;Post&#8217;][&#8216;name&#8217;];<br /> + }</p> +<p>return $list;<br /> + }<br /> +}<br /> +?&gt;<br /> +</code></pre><br /> +</small></p> +<p>It&#8217;s more or less the same with models and views: it will still ask a lot of questions and in the end generate the thing. <br /> +This behaviour is more advanced than a standard generator, you can include helpers and components already, if you want, but do you <em>really</em> want that? For models it even asks if you want to include particular associations and validation rules! Personally, I&#8217;d rather a generator script which generates something <em>immediately</em> and accepts maybe some parameters to further customization, like:</p> +<p><code>php bake.php scaffold Posts</code><br /> +<code>php bake.php controller Posts</code><br /> +<code>php bake.php model Posts</code><br /> +<code>php bake.php model Posts</code><br /> +<code>php bake.php controller Posts helper +Html -Time,Javascript</code><br /> +<code>php bake.php model Posts assoc +hasMany comments,tags</code></p> +<p>Bah&#8230; just some random thoughts. How about custom-made generators (<a href="http://wiki.rubyonrails.org/rails/pages/AvailableGenerators">Rails-inspired</a>)?</p>
A contents/articles/27.html

@@ -0,0 +1,49 @@

+----- +title: rdBaker - Bake your CakePHP application online +content-type: article +timestamp: 1147081800 +tags: cakephp +----- +<p>Right after my <a href="/blog/view/26">last blog post</a> I decided to log on #cakephp on irc.freenode.org as usual, and gwoo pops in and says &#8220;h3raLd, you didn&#8217;t review rdBaker yet!&#8221;<br /> +That&#8217;s right, I didn&#8217;t yet, so I may as well do it today.</p> +<p>I remember hearing about rdBaker months ago, waaay before CakePHP 1.0, way before the RCs, I remember someone mentioning it on CakePHP user group in right after the bake.php script was created. <em>&#8220;How about having an online baking utility?&#8221;</em> &#8211; and that&#8217;s precisely what rdBaker is, a more <span class="caps">PHP</span>-ish version of bake.php, which runs like any other <span class="caps">PHP</span> scripts: in your browser.</p> +<p>This cute little thing is obviously available for free on <a href="http://cakeforge.org/frs/?group_id=13&amp;release_id=74">CakeForge</a> and is part of <a href="http://www.rd11.com">gwoo</a> &#8217;s <a href="http://cakeforge.org/projects/rdos/">rdOpenSource</a> project which includes various other Cake-powered applications.<br /> +I personally recommend new (and old) bakers to download them and play with them, try to understand how they were coded, because they can really teach you <em>a lot</em> on how to code a CakePHP application or website properly.</p> +<p>So anyway, get your copy of rdBaker, unzip it and have a look at the <code>README.txt</code> file for the installation instructions:</p> +<quote> +<p>1. Place rdBaker in the root along side /cake_install/app.<br /> +2. chmod /cake_install/rdBaker/tmp to 0777<br /> +3. launch http://localhost/cake_install/rdBaker/</p> +</quote> +<p>Not too hard, innit?</p> +<p><img src="/img/pictures/rdbaker.jpg" alt="" /></p> +<p>Good. So you try accessing something like <code>http://localhost/php/test/cakephp/cake_test/rdBaker/</code> (that&#8217;s on my own local <span class="caps">WAMP</span> server) and you&#8217;ll get a nice page asking you to &#8220;supply your ingredients&#8221; via a simple form. <br /> +Unlike its command line cousin, rdBaker doesn&#8217;t require you to fill in <em>all</em> the fields, but just the full path to the save directory (which is normally already filled in) and of course the name of the model (Post, User, Comment).<br /> +Then you can select the type of output and choose whether you want to generate an empty controller, a scaffolded one or the <em>full</em> option including all the most common <acronym title="Create, Retrieve, Update, Delete"><span class="caps">CRUD</span></acronym> methods.<br /> +Finally &#8211; if you like &#8211; you can enter any association or valitation rules for your model, then press the <em>Bake it!</em> button and voil&aacute;, in you&#8217;ll find three directories (controllers, models and views) in your save directory containing all the <acronym title="Model View Controller"><span class="caps">MVC</span></acronym> entities you need regarding a particular model:</p> +<pre><code> + rdBaker Result Array +( + [0] =&gt; notes_controller.php created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpcontrollers + [1] =&gt; note.php created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpmodels + [2] =&gt; index.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes + [3] =&gt; add.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes + [4] =&gt; edit.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes + [5] =&gt; view.thtml created and written. Look in D:SERVERwwwphptestcakephpcake_testtmpviews/notes +) +</code></pre> +<p>But there&#8217;s more! By checking the appropriate checkbox, you can get all the stuff packed in a zip file!</p> +<p>Not bad at all, and fast as well.</p> +<p>Now the bad things&#8230;<br /> +The script works fine, but there&#8217;s something which could be improved, perhaps:</p> +<ul> + <li>If you choose to put everything in a zip file, the file will be named &#8220;baked_by_rdBaker.zip&#8221; &#8211; not a big deal, but maybe it could be personalized according to the model name entered.</li> + <li>Regardless you want to add validation rules to your model or not, you&#8217;ll <em>always</em> find some validation rules for a <em>title</em> and <em>body</em> field. I checked and they are hardcoded in the template file (rdBaker/views/helpers/templates/full/model.txt):<br /> +<pre><code> + var $validate = array( + 'title'=&gt;VALID_NOT_EMPTY, + 'body'=&gt;VALID_NOT_EMPTY); +</code></pre></li> + <li>In the baked index.thtml view, there will always be a column named &#8220;Title&#8221;. This, again, is hardcoded in the template.</li> +</ul> +<p>Other than these things, everything seems to work fine. A really nice script!</p>
A contents/articles/29.html

@@ -0,0 +1,11 @@

+----- +title: Writing more articles... +content-type: article +timestamp: 1147580760 +tags: website|writing +----- +<p>Yes, I know, I&#8217;ve been slaking a little bit, and haven&#8217;t posted on my blog in a while. Well, I actually <em>didn&#8217;t</em> slack at all in these days getting ready to start my job, looking for a damn fitted kitchen for my house and&#8230; writing more articles.</p> +<p>Nothing special, and nothing too technical, to be honest, but equally interesting. First of all I updated my <a href="/articles/view/ie-lovers-guide-to-firefox/">An IE Lover&#8217;s Guide to Firefox</a> a little bit and people at SpreadFirefox.com and <a href="http://www.firefoxfacts.com/">FirefoxFacts</a> liked it. Glad to hear that, unfortunately some guy who wrote about <a href="http://mywebpages.comcast.net/SupportCD/FirefoxMyths.html">Firefox Myths</a> wasn&#8217;t too impressed, but at any rate he read it anyway.</p> +<p>OK, this wasn&#8217;t a new article at all, but <a href="/articles/view/the-internet-philosopher/">this one</a> is fresh, at least. It&#8217;s about a Swedish guy who decided to emigrate to India pursuing an ideal: writing for his own opinions and ideas. And he gets paid for that too! After reading more about him on his <a href="/bookmarks/view/ropix">website</a> I decided to write something about him. An interesting and rather unusual read. Pity that some sections of his homepage are in Swedish only.</p> +<p>Finally, yesterday I felt inspired and decided to write <a href="/articles/view/social-bookmarking-services">another roundup</a> featuring ten popular social bookmarking websites. Trying all those services was fun, with a few exceptions of course. The bad news is that there are already various reviews about social bookmarking sites and thus the Digg folk doesn&#8217;t seem to be particularly interested in <a href="http://digg.com/software/Ten_popular_social_bookmarking_services_reviewed">reading another one</a>, but hey! After all I can&#8217;t expect of getting dugg for every roundup I write, can&#8217;t I?</p> +<p>That&#8217;s about it. And what about the CakePHP article I promised <a href="/blog/view/13/">long ago</a> to CakePHP beginners? It&#8217;s done, written and ready to be published! Unfortunately the magazine I submitted it to is taking quite a bit to review it and &#8211; most important &#8211; to tell me whether they&#8217;ll publish it or not. Let&#8217;s hope for the best.</p>
A contents/articles/31.html

@@ -0,0 +1,83 @@

+----- +title: Watch out: CakePHP screencasts +content-type: article +timestamp: 1148132820 +tags: cakephp|tutorial +----- +<p>Tutorials are great, articles are helpful, manuals are essential and the <span class="caps">API</span> is your best friend, but there&#8217;s still something missing there&#8230; Unfortunately podcasts are not yet available, but the CakePHP team is proud to announce the creation of two <a href="http://cakephp.org/pages/screencasts">screencasts</a> in an effort to help new bakers familiarizing with CakePHP&#8217;s concepts. <br /> +This is old news now, the screencasts section came together with the <a href="/blog/view/24">site overhaul</a> but I only got a chance to take a look at them (one of them only, to be totally honest) recently, and so here&#8217;s a spoil&#8230; erhm, a <em>detailed</em> description of John Anderson&#8217;s screencast about the <a href="http://manual.cakephp.org/chapter/18">Blog Tutorial</a>.</p> +<p style="float:left;"><img src="/img/pictures/CakePHP_1.0.png" alt="" /></p> +<p>There&#8217;s something I&#8217;ll never do: a screencast. Recording every mouse movement, every word or piece of code typed in half an hour? No way! And what happens if I mistype something? People will keep pointing out the fact that I was starting to type <code>&lt;/h2&gt;</code> to close a <code>&lt;/h1&gt;</code> tag, or that I waited an eternity like five full seconds before deciding what to do. I guess I&#8217;m quite paranoid&#8230; John did it, and he did it well. Using just bash, vim and Safari he was able to record an excellent 30-minutes screencast featuring the blog tutorial. <br /> +Before people start complaining that the blog tutorial should be completed in fifteen minutes, keep in mind that John&#8217;s screencast is meant to show everything clearly to new users, via a trial and error approach if necessary.</p> +<p>Here&#8217;s what happens in the screencast, nothing new if your read the blog tutorial, but still interesting, especially if you&#8217;re new to Cake. Unfortunately there&#8217;s no audio, but the video talks by itself and John will occasionally write some comments here and there.</p> +<p><em><strong>0:01 &#8211; 5:00</strong></em></p> +<ul> + <li><span class="caps">SVN</span> checkout to get the latest CakePHP version</li> + <li>make app/tmp writeable</li> + <li>execute queries (table posts)</li> + <li>insert some test posts</li> + <li>create database config file: modify 3 lines of database.php</li> + <li>CakePHP is now able to connect to database</li> + <li>create app/models/post.php model</li> + <li>create posts_controller.php [John uses Vim as preferred <span class="caps">PHP</span> editor]</li> + <li>try to access /posts/, error: missing method index()</li> + <li>create function index() in postscontroller.php able to fetch posts</li> + <li>refresh, missing index view</li> + <li>create index.thtml displaying the raw posts array</li> +</ul> +<p><em><strong>5:01 &#8211; 10:00</strong></em></p> +<ul> + <li>index.thtml: display posts with table and foreach iteration</li> + <li>add hyperlink in index.thtml to view posts</li> + <li>access /posts/view/1 &#8594; missing method view()</li> + <li>add view() method in postscontroller.php</li> + <li>create view.thtml to display</li> + <li>Raw view post with pre tags and print_r()</li> +</ul> +<p><em><strong>10:01 &#8211; 15:00</strong></em></p> +<ul> + <li>display post properly with <code>&lt;p&gt;</code> tags</li> + <li>add link in index.thtml to add a post</li> + <li>missing method &#8594; add()</li> + <li>add add() in controller</li> + <li>missing view [trial and error, trial and error&#8230;]</li> + <li>create add.thtml, using the Html Helper to create input tags easily</li> +</ul> +<p><em><strong>15:01 &#8211; 20:00</strong></em></p> +<ul> + <li>add.thtml (continued)</li> + <li>testing add form</li> + <li>view added post</li> + <li>start adding another (for validation purposes) [stop before submitting]</li> + <li>modify post.php model, valid_not_empty for title and body</li> + <li>modify view to trigger validation <code>$html-&gt;tagErrorMsg()</code></li> + <li>test: no body, message displayed</li> + <li>test: no title, message displayed</li> + <li>add another post, everything works</li> + <li>[pause: five seconds]</li> + <li>back to the controller, create delete() function</li> +</ul> +<p><em><strong>20:01 &#8211; 25:00</strong></em></p> +<ul> + <li>delete function (continued)</li> + <li>add &#8220;Actions&#8221; table column in index.thtml, with link delete post</li> + <li>delete two posts</li> + <li>take a breath</li> + <li>add link in index.thtml to edit post</li> + <li>refresh page, mouse over edit links&#8230;</li> + <li>back to controller, add edit function [we learnt abour CakePHP errors alright]</li> +</ul> +<p><em><strong>25:01 &#8211; 27:38</strong></em></p> +<ul> + <li>pause, 5 sec [should I write edit.thtml from scratch]</li> + <li>copy add.thtml as edit.thtml</li> + <li>change just the title and form action</li> + <li>[pause: 3 sec]</li> + <li>test edit link</li> + <li>edit a post</li> + <li>move around, switch views</li> + <li>edit config/routes.php</li> + <li>set default route to posts/index</li> + <li>refresh &#8211; all done!</li> +</ul> +<p>That&#8217;s it. All in a 40MB .mov file. Download it from <a href="http://www.archive.org/download/CakePHP_BlogTutorialJohn/BlogTutorial.mov">here</a>.</p>
A contents/articles/32.html

@@ -0,0 +1,24 @@

+----- +title: Writing Tools +content-type: article +timestamp: 1148561820 +tags: writing|tools +----- +<p>Since in these days (and even more in near future) I&#8217;m really writing a lot I thought it would be good to share my thoughts on some writing programs and tools I started using for writing these blog posts, articles, and more.</p> +<p>I&#8217;m going to examine a few applications which I find useful for different tasks, since I recently came to the conclusion that I cannot use the same editor for everything I write: some magazines require a .doc document, others want just plain text, my site uses the truly excellent <a href="http://http://www.textism.com/">textile</a> markup, zZine Magazine used BBcode, other site use their own &#8220;proprietary&#8221; styles and so on. One could just give up and use Notepad &#8211; or better, <a href="http://notepad-plus.sourceforge.net/uk/site.htm">Notepad++</a> &#8211; for everything, while someone else like me might opt for various applications according to the task.</p> +<p>One of the few essential requirements for a <em>writer</em> is some spell checking functionality. Sad but true, this is enough to leave the most popular multi-purpose programming editor out: programmers don&#8217;t need a spell checker, a highlighter for their favourite language is more than enough. <br /> +I will not mention all the applications I tried to find the Perfect Editor, and I&#8217;ll just focus on the programs I ended up using in the end. Some may be well known, others may not, anyway, here we go.</p> +<p style="float:left;"><img src="/img/pictures/wp/bill.jpg" alt="" /></p> +<p><a href="http://www.microsoft.com/office/preview/default.mspx">Word 2007 Beta 2</a> &#8211; Yes, I know that OpenOffice is free and OO Writer works great, but perhaps at work you&#8217;ll be asked to use MS Word. Some editors may require that as well, and their templates may not be correctly rendered by OpenOffice, so in the end you&#8217;ll still have to use Redmond&#8217;s most popular Word Processor &#8211; <em>if you have it</em>. If you got it with your laptop (I didn&#8217;t) or your auntie gave you 300$ to buy it you&#8217;re all set, but if you don&#8217;t? <br /> +Oh well, yes, OpenOffice is the right choice perhaps, but at least until February 2007 uncle Bill lets you try the bleeding (quite literally) edge of all the commercial word processors: Word 2007 beta 2. You can download the whole Office Suite (and more) for free, <a href="http://www.microsoft.com/office/preview/beta/overview.mspx">run</a>. I did it yesterday and well, it&#8217;s nice to try this brand-new piece of eye candy. the interface is completely new, you won&#8217;t find the usual drop down menu but with some imagination you&#8217;ll manage to save/create/open a new document by clicking on the big roundy Office logo on the top left corner. More user friendly? Perhaps, once you get used to it. It <span class="caps">STILL</span> doesn&#8217;t have a tabbed interface, so you <span class="caps">STILL</span> have to clutter your taskbar if you want to keep more than one document open. <br /> +At any rate, it does the job, exactly in the same way as it did in the previous versions. <br /> +I use it if people ask me to, and for writing stuff which doesn&#8217;t need to be formatted with a particular markup or style but rather look nice and have pictures embedded.</p> +<p style="float:right;"><img src="/img/pictures/wp/writely.gif" alt="" /></p> +<p><a href="/bookmarks/view/writely/">Writely</a> &#8211; Now this is much more fun. A <em>online</em>, <span class="caps">AJAX</span>-powered word processor recently acquired by Google. IT&#8217;s currently in closed beta, but I was lucky enough to get an account before they closed registrations and I can invite people to use it.<br /> +It&#8217;s nice. It&#8217;s nice if you have to work with MS Word documents or create <span class="caps">PDF</span> files, and it supports the most essential features offered by desktop word processors, plus some more, really convenient functionalities. <br /> +It can import MS Word documents pretty well and also any kind of text file, so that you can edit it online anytime and anywhere. You can star, tag, archive, edit and delete your documents in a really easy way and &#8211; which is one of its killer features &#8211; you can grant access to certain documents to collaborators for editing or viewing. Other word processors out there offer similar features, but Writely is by far the nicest to use and perhaps even the more advanced. I recently wrote a couple of articles about CakePHP (coming soon-ish to some online magazines near you) and then gave access to gwoo and PhpNut for editing, so that they could check the code snippets, in particular: it was a success. Magazine editors were happy and impressed as well.<br /> +Another really wonderful feature is <em>version support</em>. I discovered this recently: when you edit a document and save it, Writely automatically creates a new version of it, storing the old ones as well, so that you can even compare them to highlight differences if you wish: a great feature to keep track of the editing process and know exactly who edited which. When I noticed it that was it, Writely has become my online <em>repository</em> for my articles and writings.</p> +<p style="float:left;"><img src="/img/pictures/wp/cream.png" alt="" /></p> +<p><a href="/bookmarks/view/cream-editor">Cream</a> &#8211; I discovered this a while ago, and it&#8217;s perhaps the most multi-purpose editor out there. It&#8217;s built on top of Vim (respect+) but it has a friendlier interface by default, and that&#8217;s exactly what I&#8217;m using right now for typing this post. The reasons are simple: it supports <span class="caps">ANY</span> kind of file format and any character encoding. There&#8217;s an highlighter for everything, including BBcode and textile, and of course you can make your own. It also includes spell checking on-the-fly which is missing in many simple editors. <br /> +Whenever I have to write something which requires some particular formatting or markup I use Cream, it does the job pretty well, and whenever I feel brave I can always switch to &#8220;expert&#8221; view and challenge my vi skills ;)</p> +<p>That&#8217;s pretty much what I use for writing articles, posts, and other documents&#8230; I tried other alternatives like RoughDraft or similar programs but I&#8217;m now really happy with these three applications. Commercial &#8220;writer&#8217;s programs&#8221;? There are some out there, but who wants to spend 40$ or more for something which offer less than MS Word when you can use OpenOffice and Writely for free?</p>
A contents/articles/33.html

@@ -0,0 +1,104 @@

+----- +title: Information Mapping +content-type: article +timestamp: 1149221400 +tags: productivity|writing +----- +<p>As I thought, my job also represents a great opportunity to learn new things. I don&#8217;t mean only new technical stuff, but also a great deal of tips, best practices and methods to efficiently write documentation material in proper English. Some theory about <a href="http://www.infomap.com/">Information Mapping</a> was by far the most interesting topic I learnt about this week.</p> +<h3>What is Information Mapping?</h3> +<p><strong>Definition<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></strong> <br /> +<blockquote>The Information Mapping method is a research-based approach to the analysis, organization, and visual presentation of information.</blockquote></p> +<p><strong>Information Mapping is media independent</strong><br /> +<blockquote>The method is both subject matter and media independent; that is, it can be applied to the subject matter of any industry, and it can be presented on paper, on a computer screen, verbally, or in a multimedia presentation. </blockquote></p> +<p><strong>Key Concepts</strong><br /> +<blockquote>Information Mapping is an integrated set of easy-to-learn principles, techniques, and standards. It enables authors to break complex information into its most basic elements and then present those elements optimally for readers. The result is a set of precisely defined information modules that are consistent from author to author and document to document.</blockquote></p> +<p><strong>Purpose</strong><br /> +<blockquote><br /> +The method helps writers analyze, organize, and present information with clarity focus and impact. Information That Works. The goal of the analysis component is to determine the</p> +<ul> + <li>purpose</li> + <li>audience needs, and</li> + <li>information types.</li> +</ul> +<p>The goal of the organization is to create an overall structure for the information, based on the results of your analysis. Finally, the goal of the presentation component is to format the information to make it clear and accessible to your audience.</p> +</blockquote> +<p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> Contents were taken from <a href="http://www.infomap.com/index.cfm/TheMethod/">InfoMap.com</a> and were re-formatted and re-organized into an information map.</p> +<h3>Key Concepts</h3> +<p><strong>Introduction</strong><br /> +<blockquote>The Information Mapping method relies on some important principles according to which information should be organized. This method also defines new units of information to replace paragraphs, sections and chapters and tries to divide information into a few main set types, each with its own rules and structures.</blockquote></p> +<p><strong>Principles</strong><br /> +<blockquote></p> +<table> + <tr> + <td> <strong>Name</strong> </td> + <td> <strong>Explanation</strong> </td> + </tr> + <tr> + <td> Chuncking </td> + <td> Writers should group information into small, manageable units. </td> + </tr> + <tr> + <td> Relevance </td> + <td> Writers should make sure that al information in a chunck relates to one main point (function or purpose). </td> + </tr> + <tr> + <td> Labeling </td> + <td> Writers should provide a label for every unit of information. </td> + </tr> + <tr> + <td> Consistency </td> + <td> Writers should use similar labels, word, formats for similar subject matters. </td> + </tr> + <tr> + <td> Integrated Graphics </td> + <td> The use of tables, images, diagrams and lists is encouraged. </td> + </tr> + <tr> + <td> Accessible Detail </td> + <td> Documents should provide sufficient details where necessary, to make the information more accessible for the readers. </td> + </tr> + <tr> + <td> Hierarchy </td> + <td> Small, relevant units of information should be organized into a hierarchy. </td> + </tr> +</table> +</blockquote> +<p><strong>Information Types</strong><br /> +<blockquote></p> +<table> + <tr> + <td> <strong>Name</strong> </td> + <td> <strong>Definition</strong> </td> + </tr> + <tr> + <td> Procedure </td> + <td> Set of steps to obtain a specified outcome </td> + </tr> + <tr> + <td> Process </td> + <td> A series of changes through the time for some purpose </td> + </tr> + <tr> + <td> Structure </td> + <td> Something which can be defined into multiple parts </td> + </tr> + <tr> + <td> Concept </td> + <td> Group of physical objects, conditions, relations, &#8230; </td> + </tr> + <tr> + <td> Principle </td> + <td> Statement of what should be done, assumptions </td> + </tr> + <tr> + <td> Fact </td> + <td> Statement presented with no supporting evidence </td> + </tr> + <tr> + <td> Classification </td> + <td> The sorting of a group of specimen into classes </td> + </tr> +</table> +</blockquote> +<p><strong>Conclusion</strong><br /> +<blockquote>Although it may initially seem too schematic, Information Mapping is a valid method to organize and present information to those readers who just need &#8220;facts&#8221; without any unnecessary distraction. This method it is used with some modifications in many technical manuals and documentation written by many companies.</blockquote></p>
A contents/articles/34.html

@@ -0,0 +1,64 @@

+----- +title: Akelos Framework: too good to be true? +content-type: article +timestamp: 1149931560 +tags: frameworks|php|webdevelopment|review +----- +<p>Someone recently added a comment to my article about <a href="/articles/rails-inspired-php-frameworks/">Rails-inspired <span class="caps">PHP</span> frameworks</a> pointing out that I forgot another Rails-like framework, in my round-up. He obviously posted a link to this rather mysterious Rails port in <span class="caps">PHP</span> and spam or not, I&#8217;d like to thank this guy for letting me know of the existance of <a href="/bookmarks/view/akelos-framework">Akelos</a>, a new <span class="caps">PHP</span> framework which seems simply too good to be true.</p> +<p style="float:left;"><img src="/img/pictures/frameworks/akelos_framework.png" alt="" /></p> +<p>Let me just spend a few words more before writing more about it though. First off, it&#8217;s not available yet. OR at least it doesn&#8217;t seem to be: the author is planning to release his work to the Open Source community but&#8230; well, he&#8217;s a bit concerned about the current &#8220;<span class="caps">PHP</span> Framework War&#8221;: he wouldn&#8217;t like to end up like <a href="http://subway.python-hosting.com/">Subway</a> or just be slagged off by those merciless reviewers who enjoy write round-ups and comparisons about frameworks. <a href="http://www.bermi.org/page/about_me">Bermi Ferrer</a> is &#8220;just&#8221; a talented <span class="caps">PHP</span> developer who decided to create his own framework and he really enjoyed doing so, nothing more, nothing less.</p> +<p><em>&#8220;I considered other <span class="caps">PHP</span> ports of Ruby on Rails, but we could not find all we needed on them. One feature that I needed on the core was internationalization and Unicode support, so I decided to roll my own framework trying to keep most of the original rails interface so most of its documentation could work for it.&#8221;</em></p> +<p>Where did I hear that? Nothing new: it&#8217;s always the same story of frameworks not being as we want them to be etc., it&#8217;s human. And yes, it&#8217;s <em><strong>another</strong></em> attempt to port Ruby on Rails to <span class="caps">PHP</span>, and a damn good one &#8212; or so it seems.</p> +<p><small>Before proceeding any further, I&#8217;d like to write a short warning for a few people who may or may not want to pop in and start commenting about the Rails-is-better-than-any-<span class="caps">PHP</span>-clone issue: <strong>If I see a single comment slagging off this framework (or any other) only because it&#8217;s a port of Rails to <span class="caps">PHP</span>, it will be deleted, may it be David Heinemeier Hansson himself</strong>. Stop it, no seriously, I think it will be counter productive for Rails in the end: I really like RoR and I love the way it works, and yes, I think Ruby is definitely the best language to do that sort of things, <span class="caps">EVERYBODY</span> <span class="caps">KNOWS</span> <span class="caps">THAT</span>. Please, please, save us poor <span class="caps">PHP</span> developers the usual preaching.</small></p> +<p style="float:right;"><img src="/img/pictures/frameworks/bermi_ferrer.png" alt="" /></p> +<p>Right, back to Akelos now. Curious as I am I immediately checked out the official page and all i found was a pretty long list of features which made me dribble, literally&#8230; ooops!</p> +<p>Let&#8217;s just quote the most juicy ones, shall we?</p> +<p>Active Record [&#8220;Model&#8221;]</p> +<ul> + <li>Associations</li> + <li>Callbacks</li> + <li><strong>Transactions</strong></li> + <li><strong>Finders</strong> [ <code>$Project-&gt;findFirstBy('language AND start_year:greater', 'PHP', '2004');</code> ]</li> + <li>Versioning</li> + <li>&#8230;</li> +</ul> +<p>Action Controller [&#8220;Controller&#8221;]</p> +<ul> + <li>Filters</li> + <li>Pagination</li> + <li>Mime Type</li> + <li>Mime Response</li> + <li><strong>Code Generation</strong></li> + <li>Response handler</li> + <li>&#8230;</li> +</ul> +<p>Action View [&#8220;View&#8221;]</p> +<ul> + <li><strong>Templates (using Sintags)</strong></li> + <li>Web 2.0 javascript using prototype and script.aculo.us</li> + <li>Helpers</li> + <li>Partials</li> + <li><strong>Template Compilers</strong></li> + <li>&#8230;</li> +</ul> +<p>And then more Akelos-only goodies:</p> +<ul> + <li><strong>Multilingual Models and Views</strong></li> + <li><strong>Locale alias integrated on <span class="caps">URLS</span> (example.com/spanish will load the es_ES locale)</strong></li> + <li>Database migrations using DB Designer files</li> + <li><strong>Pure <span class="caps">PHP</span> support for Unicode (no extensions required)</strong></li> + <li><strong>Unit Tested source code</strong></li> + <li>Code Generators</li> + <li>Built in <span class="caps">XHTML</span> validator</li> + <li>Automated locale management</li> + <li><strong>Clean separation from <span class="caps">HTML</span> and Javascript using <span class="caps">CSS</span> event selectors.</strong></li> + <li>Ajax file uploads</li> + <li><strong><span class="caps">AFLAX</span> integration</strong></li> + <li>Dojo Rich Text Editor</li> + <li>Format converters</li> + <li>File handling using <span class="caps">SFTP</span> for shared host running Apache as user nobody (as most CPanel server do)</li> + <li><strong>Distributed sessions using databases</strong></li> +</ul> +<p>Impressed? I was, honest. And I&#8217;m talking as a CakePHP fanatic here, and I must say that if this framework can really offer all this <em>and</em> &#8212; and this is what really matters &#8212; is also as simple as Cake to learn and well performing&#8230; well, this is definitely going to be quite a promising player in the &#8220;<span class="caps">PHP</span> Framework War&#8221; (but is not a real war, is it?), although the author is quite worried about that:</p> +<p><em>&#8220;I&#8217;m also concerned about the <span class="caps">PHP</span> Framework war, I don&#8217;t want to play that game. Building this Framework was a great experience, it works great for me and it has helped me to become a better programmer so I don&#8217;t want to spend my time discussing about if this is better or not than other solutions. That&#8217;s the reason I&#8217;ll first look for great developers interested in the Framework to help me releasing it.&#8221;</em></p> +<p>Really, this will be an interesting project to check out, once it goes open source, and yes, I really wish Bermi all the best. Good luck, <a href="http://www.bermi.org/projects/akelos_framework">Akelos Framework</a>.</p>
A contents/articles/36.html

@@ -0,0 +1,20 @@

+----- +title: ITALIA - CAMPIONE DEL MONDO! +content-type: article +timestamp: 1152688740 +tags: italy +----- +<p><em><strong>Italy has won the World Cup!</strong></em></p> +<p>It doesn&#8217;t matter if Zidane first scored on a totally unfair penalty kick at the 7th minute and then, totally out of his mind, headbutted Materazzi&#8230; WE <span class="caps">WON</span>, <span class="caps">AND</span> WE <span class="caps">KICKED</span> <span class="caps">THEIR</span> <span class="caps">ASS</span>, end of story :)</p> +<div align="center"> +<p><img src="/img/italy/worldcup.jpg" alt="" /> </div></p> +<blockquote> +<p style="float:left;"><img src="/img/italy/grosso.jpg" alt="" /></p> +<p>&#8220;Italy beat France 5-3 in a penalty shoot-out to win the World Cup after an absorbing 1-1 draw in Berlin.</p> +<p style="float:right;"><img src="/img/italy/italy1.jpg" alt="" /></p> +<p>Fabio Grosso scored the winning goal after France&#8217;s David Trezeguet missed.</p> +<p>Playing his last game before retiring, Zinedine Zidane&#8217;s career ended in disgrace after he was sent off for crazily headbutting Marco Materazzi.</p> +<p>Zidane had put France ahead early on with a coolly-taken chipped penalty, before Materazzi levelled with a header from an Andrea Pirlo corner.<br /> +The result caps an incredible period for Italian football, with the domestic game embroiled in a corruption scandal similar to 1982 when they last won the World Cup. &quot;</p> +</blockquote> +<p><a href="http://news.bbc.co.uk/sport2/hi/football/world_cup_2006/4991652.stm">Read More</a></p>
A contents/articles/37.html

@@ -0,0 +1,26 @@

+----- +title: Some updates +content-type: article +timestamp: 1153789620 +tags: website|cakephp +----- +<p>Quite a bit of time passed since the last blog post, and I&#8217;m actually sorry about that, but as I thought, I don&#8217;t have as much free time as I used to be. Work is work, after all!<br /> +This post will be multipurpose as actually I bluid up a few things to write about in the last few days&#8230; erhm, ok, <em>weeks</em>.</p> +<h3>New Website Design</h3> +<p>Something different eh? Yep, definitely! Some time ago I started a small project called <a href="/projects/view/h3rald-redesign">h3raLd.com Re-design</a> hoping that some <span class="caps">GFX</span> guru could provide a new template for this website, and actually in the end I decided to accept the work of <em><strong>Bartus F. Teipel</strong></em> a Brazilian CakePHP enthusiast.<br /> +Bartus is obviously (<span class="caps">MUCH</span>) more talented than me when it comes to design, and I was amazed at the quality of the template he provided, in a really short time. <br /> +Unfortunately he didn&#8217;t yet provide a link to his main website/portfolio, but for now all I can show you is his website for party pics, <a href="http://www.circuscircus.com.br/">CircusCircus</a>.</p> +<p>The new template sports a more contemporary Web2.0-ish look which I like a lot, and Bartus used libraries like <a href="http://prototype.conio.net/">prototype</a>, <a href="http://moofx.mad4milk.net/">moo.fx</a> and <a href="http://www.html.it/articoli/niftycube/index.html">Nifty Corners Cube</a> for the <span class="caps">AJAX</span> effects and functionalities. <br /> +A really outstanding work, thanks Bartus!</p> +<h3>The CakePHP Herald project has been completed</h3> +<p>With my <a href="http://www.h3rald.com/articles/view/cakephp-first-bite/">latest article</a> about CakePHP published on SitePoint, the <a href="/projects/view/cakephp-herald/">CakePHP Herald</a> project was completed.<br /> +I must say that I really enjoyed writing all those articles about CakePHP, and the only thing I regret is not to have written anything (yet) about some more advanced topic about CakePHP. This was mostly due to &#8211; again &#8211; lack of time to focus on advanced topic and produce some quality examples.</p> +<p>However, judging by the positive feedback I received about the articles, I am really happy of the final result: even more people discovered the power of CakePHP and became <em>bakers</em>. Happy baking to all of you!</p> +<p><em>So&#8230; no more articles about Cake?</em> Maybe not for a while, I think I&#8217;ll be rather busy in the following months. Curious? Read on :-)</p> +<h3>My biggest and most important project</h3> +<p>I actually got really pissed off with Larry, Garret &amp; the other Master Bakers because of what they wrote on the <a href="http://cakeforge.org/forum/forum.php?forum_id=244">announcement</a> for the latest CakePHP release:</p> +<blockquote> +<p>&#8220;[&#8230;]In other news, some new articles were published on Sitepoint <sup class="footnote" id="fnr3"><a href="#fn3">3</a></sup> and in the International <span class="caps">PHP</span> magazine <sup class="footnote" id="fnr4"><a href="#fn4">4</a></sup>. Fabio Cevasco <sup class="footnote" id="fnr5"><a href="#fn5">5</a></sup> is the man behind these articles. Together with Fabio, we will be writing a book that will be published [&#8230;]&#8221;</p> +</blockquote> +<p>After all this time I spent <em>trying desperately not to say a word about it</em> they came out and heralded it out of nowhere. Sigh&#8230; they ruined the surprise effect! Oh well, it&#8217;s too late now, isn&#8217;t it?</p> +<p>So yes, when I say that I&#8217;m spending at least 60% of my time (at work and at home) writing I really mean it. The rest? Well, I do have a lovely girlfriend after all!!!</p>
A contents/articles/38.html

@@ -0,0 +1,84 @@

+----- +title: Akelos is real, after all... +content-type: article +timestamp: 1154475180 +tags: frameworks|php|webdevelopment|review +----- +<p>Bermi Ferrer kept his promise, and even if a few were skeptic on the <a href="/blog/view/34/">pre-announced</a> features of his upcoming Akelos framework, last week he sent me a &#8220;development preview&#8221; and a few days ago he opened the development <span class="caps">SVN</span> repository to the public:</p> +<p><a href="svn://akelos.org/trunk" target="_blank">svn://akelos.org/trunk</a></p> +<p>Go, get it: it&#8217;s worthwhile (see below).</p> +<p>&#8220;[&#8230;] The Akelos Framework is an open-source port of Ruby on Rails to the <span class="caps">PHP</span> programming language.<br /> +The main goal of the Akelos Framework is to help programmers to build multilingual database-backed web applications according to the Model-View-Control pattern. It lets you write less code by favoring conventions over configuration.&#8221;</p> +<p>At the Akelos Framework Features page you can find detailed information about what has been already implemented into the framework.</p> +</blockquote> +<p>I think it says it all, well almost. Some people will undoubtedly be disgusted by yet-another-hopeless-Rails-clone: <em>not again!</em> I hear them crying&#8230;</p> +<p>Well, yeah, I think this &#8211; to be honest &#8211; should be the last attempt someone makes to port Rails to <span class="caps">PHP</span> or at least port <em>some features and the overall philosophy</em>, like <a href="/bookmarks/view/cakephp">CakePHP</a> did: there are honestly too many for one single language. Look at Python, <a href="http://www.djangoproject.com/">Django</a> seems to be the only &#8220;Rails-inspired&#8221; framework available and everyone is happy with it, while as a general rule <span class="caps">PHP</span> folks are never happy with what they already got.</p> +<p>Bermi is undoubtedly one of them, and that&#8217;s the reason he decided to code his very own Rails-inspired framework for <span class="caps">PHP</span>, which is, to date, the most remarkable of the ones I left out (it wasn&#8217;t available at the time) in my <a href="/articles/rails-inspired-php-frameworks/">article</a>.</p> +<h3>Confirmed Features &amp; Contents</h3> +<p>So well, although I didn&#8217;t really have a proper chance to play with Akelos I can certainly herald some of its &#8211; verified, this time &#8211; features.</p> +<p>For one, it&#8217;s huge. Take Cake, add <em>every excellent, useful third party library or class you can possibly thing of</em> and you&#8217;ll get Akelos. No kidding. The unzipped source of the whole framework is a massive 16MB, 8.5 of which constitute the <code>vendors</code> folder. What&#8217;s in it? Well, all this:</p> +<ul> + <li>ADOdb</li> + <li>Domit</li> + <li><span class="caps">FPDF</span></li> + <li>Excel (reader library)</li> + <li>Hyper Estraier full-text search system</li> + <li>Inutio <span class="caps">XML</span>-<span class="caps">RPC</span> Library</li> + <li><em>Many</em> <span class="caps">PEAR</span> packages</li> + <li>PHPCodeAnalyzer</li> + <li>PHPmailer</li> + <li>SimpleTest</li> + <li>A Simple <span class="caps">PHP</span> <span class="caps">YAML</span> Class</li> + <li>Textile</li> +</ul> +<p>Then, similarly, all the state-of-the-art Javascript/<span class="caps">AJAX</span> hyper-hyped libraries are included:</p> +<ul> + <li><span class="caps">AFLAX</span></li> + <li>Behaviour</li> + <li>Builder</li> + <li>various Scriptaculous packages</li> + <li>Prototype</li> + <li>FileUploader (by the author, using prototype)</li> + <li>Window</li> + <li>EventSelectors</li> +</ul> +<p style="float:left;"><img src="/img/pictures/frameworks/akelos_framework_logo.gif" alt="" /></p> +<p>Good, well, kind of: that&#8217;s just what <em>others</em> did, but it&#8217;s worth noting that it&#8217;s all there and &#8211; apparently &#8211; integrated with the framework, hopefully not too tightly. But people are fussy, and do not get excited easily anymore, long gone are the early days of Rails, when the whole Internet shake at hearing about <em>code generators</em>&#8230; Aye, there are in Akelos as well, of course!</p> +<p>Coming to the more juicy stuff, <em>lo&#8217; and behold, ye contents of /lib folder (with comments):</em></p> +<ul> + <li>AkActionController (controller)</li> + <li>AkActionView (view)</li> + <li>AkActionWebservice (Web services)</li> + <li>AkActiveRecord (model)</li> + <li>AkAdodbCache (content caching)</li> + <li>AkCharset (utf8 support, includes <em>all</em> mappings)</li> + <li>AkConfig (load config settings)</li> + <li>AkConverters (conversions!) + <ul> + <li>DBDesigner &gt; AkelosDatabaseDesign</li> + <li>Excel &gt; Array (bi-dimensional)</li> + <li>Excel &gt; <span class="caps">CSV</span></li> + <li><span class="caps">HTML</span> &gt; <span class="caps">RTF</span></li> + <li><span class="caps">HTML</span> &gt; Text</li> + <li>Word &gt; Unicode</li> + <li><span class="caps">PDF</span> &gt; Text</li> + <li>Xdoc &gt; Text</li> + </ul></li> + <li>AkHeaders (<span class="caps">HTTP</span> headers, redirections)</li> + <li>AkImages (Image operations, resizing)</li> + <li>AkLocalize (Localization, countries and timezones)</li> + <li>AkInflector</li> + <li>AkLogger</li> + <li>AkFtp</li> + <li>AkInstaller</li> + <li>AkRouter</li> + <li>AkZip</li> + <li>&#8230;</li> +</ul> +<p>Well, it&#8217;s all there, at any rate. The best way to know if it all works, and <em>how</em> it works, is simply to try it out: <a href="http://www.akelos.org/">www.akelos.org</a>.</p> +<h3>Remarks</h3> +<p>As I said earlier, Akelos looks like <em>CakePHP on steroids</em>: agreed, the Cake philosophy of &#8220;no we-may-use-it code in the trunk&#8221; has been <em>completely</em> (and intentionally) ignored, but this is our chance to peek at what CakePHP could have become if such philosophy didn&#8217;t become a lifestyle for the Cake Dev Team. <br /> +Akelos code is Rails-inspired, so yes, it&#8217;s <em>very</em> similar to Cake, although with some rough edges and some re-used parts, but it&#8217;s the work of <span class="caps">ONE</span> person with no community support (yet), don&#8217;t forget. Remarkable.</p> +<p>And he needs co-developers, by the looks of it, so there you are then: there&#8217;s <em>your</em> chance!</p> +<p>My personal opinion about it? Well, I think Akelos can learn from CakePHP and vice-versa: a merge? Well, at least it would reduce the number of Rails-inspired framework for <span class="caps">PHP</span> and <em>possibly</em> meet the needs of more people: those who want just the essentials, as a framework, and those who like to be <em>virtually almighty</em> and be able to do anything, <em>if they wanted to</em>.</p> +<p>Two flavours of the same framework? <em>CakePHP</em> and <em>cAkePHP</em> (note the case)? Bah, let&#8217;s stop raving now, shall we?</p>
A contents/articles/39.html

@@ -0,0 +1,22 @@

+----- +title: Why I like Netvibes +content-type: article +timestamp: 1158551460 +tags: web20|ajax|review +----- +<p>The so-called &#8220;<span class="caps">AJAX</span> Start Pages&#8221; are not a new concept anymore, and like for almost any other offspring of Web 2.0 there is more than one to chose from. Hence the increasing number of comparative reviews on the Web nowadays (Yes, I&#8217;m guilty of that too). I soon learnt that for any &#8220;good and useful thing&#8221; on the web there are at least <em>n</em> clones: consider for example social bookmarking, community-powered news sites, php frameworks&#8230;<br /> +And no, you can&#8217;t use the word clone because it has a strong negative connotation nowadays so let&#8217;s just say that whenever someone comes up with a new idea, others examine it, process it and in a few weeks (days?) some <em>very, very similar application</em> comes out, and it&#8217;s <em>better</em> than the previous one. <br /> +Now, I don&#8217;t know exactly whether <a href="http://www.netvibes.com/">NetVibes</a> was one of the first <span class="caps">AJAX</span> Start Pages created or not, but at any rate &#8211; in my very, very, very humble opinion, is the most advanced and the most usable of <a href="http://www.techcrunch.com/2005/12/07/ajax-desktops-wont-stop/">the lot</a>, and an essential tool for lazy folks like me who want to keep up-to-date with what&#8217;s going on without having to visit dozen of websites everyday.</p> +<p style="float:left;"><img src="/img/pictures/netvibes.jpg" alt="" /></p> +<p>I can see people jumping up and down shouting &#8220;Pageflakes is better&#8221;, &#8220;Protopage kicks a$$&#8221; etc. etc. Well, yes, probably, as you like: different people like different things, and when it comes to <span class="caps">AJAX</span> Start Pages there&#8217;s really a lot to choose from: 3spots has an excellent (and complete, I believe) <a href="http://3spots.blogspot.com/2006/03/ajax-or-flash-startpages-or-homepages.html">list</a> of all the start pages currently available on the Net, so yes, you can try them out yourself and make out your mind :)</p> +<p>I made up my mind long ago after experimenting a few of those. Why Netvibes? OK, let&#8217;s see:</p> +<ol> + <li><strong>Fast to load</strong>: Netvibes is fast. Relatively fast, of course, for sure is not as fast as a plain, old-style html page, but I think it&#8217;s perhaps one of the fastest <span class="caps">AJAX</span> start pages ever created. As they <a href="http://blog.netvibes.com/?2006/08/17/75-the-future-of-netvibes">pointed out</a>, with a 15 million investment performance can only get better&#8230;</li> + <li><strong>Tabbed pages</strong>: After tabbed browsing, tabs within a single page seem to gain popularity. Netvibes allows you to create more than one page to prevent cluttering and general chaos: you can create a tab for CakePHP feeds, one for some cute <span class="caps">AJAX</span> widgets you&#8217;ll never use, another for al that Web 2.0 rubbish you&#8217;ll never read &#8212; that&#8217;s what I do at least.</li> + <li><strong>Smart Google Module</strong>: Finally Netvibes has a <em>proper</em> Google search module, which enable users to search with Google and view results <em>on Netvibes</em> instead of opening up a browser tab.</li> + <li><strong><span class="caps">RSS</span> done right</strong>: Their <span class="caps">RSS</span> reader is nice: by clicking on a feed title it opens up a <em>virtual window</em> inside the page with the whole story and a menu with links to the other stories included in the feed. This is the most convenient way to read whole articles like TechCrunch&#8217;s ones without leaving the page (and without loading the heavy TechCrunch UI).</li> + <li><strong>Public <span class="caps">API</span> for modules</strong>: For those who &#8211; unlike me &#8211; has some proper free time and would like to develop their own module, the <a href="http://eco.netvibes.com/developers/">Netvibes Mini Module <span class="caps">API</span></a> is public&#8230;</li> + <li><strong>Ecosystem</strong> : Netvibes <a href="http://eco.netvibes.com/">Ecosystem</a> includes hundreds of modules and podcasts and thousands of feeds and tabs which can be integrated into any Netvibes page with a single click. Some of my favourites: <a href="http://eco.netvibes.com/modules/3492/xe.com-currency-converter">XE</a> Currency Converter, <a href="http://eco.netvibes.com/modules/3709/quick-translator">Quick Translator</a>, <a href="http://eco.netvibes.com/modules/6776/google-map">Google Map</a> <a href="http://eco.netvibes.com/modules/91/daily-cartoons">Daily Cartoons</a> and <a href="http://eco.netvibes.com/modules/6/bitty-browser">Bitty Browser</a>. <br /> +CakePHP feeds? <a href="http://eco.netvibes.com/?type=all&amp;q=cakephp">Loads</a>!</li> +</ol> +<p>Enough?</p>
A contents/articles/40.html

@@ -0,0 +1,22 @@

+----- +title: Introducing "CakePHP Recipes" +content-type: article +timestamp: 1162441500 +tags: cakephp|writing +----- +<p>Despite all my efforts to keep the whole thing quiet for the time being, a few days ago I entered the words &#8220;CakePHP Recipes&#8221; in Google and discovered &#8211; to my astonishment &#8211; that my new book about the CakePHP framework is already for (pre)sale in many popular online bookstores.</p> +<p>Up to now I never made any formal announcement myself (although the Cake Software Foundation already did, months ago), nor gave out any juicy details about it, but maybe now the time has come to post something more about it. Yes, I am indeed writing a book about the CakePHP framework, and yes, you can already buy it but no, you can&#8217;t phisically get it simply because it&#8217;s still in progress (miracles of the modern publishing industry!).</p> +<p style="float:left;"><img src="/img/cakephp-recipes/cover.jpg" alt="" /></p> +<p>I&#8217;d like to point out that I&#8217;m not the <em>only</em> author of the book: all the code examples and snippets included in the book is provided by the Cake Software Foundation staff, in the person of Larry E. Masters and Garrett J. Woodworth mainly, who will also act as technical editors and first reviewers of the book, together with other trusthworthy CakePHP core developers.<br /> +It is our intent to produce an enjoyable and yet very useful book which will hopefully help CakePHP enthusiasts to use the framework in real-world situations: the book will not focus on theory but on practice, by providing a lot of interesting &#8220;recipes&#8221; on how to implement a particular functionality in a CakePHP web application.</p> +<p>Why should you get it? Here are some reasons:</p> +<ul> + <li>It is a book written <em>by</em> programmers <em>for</em> programmers</li> + <li>All the code included in the book has been created and tested by the creators of the framework</li> + <li>Part of all the revenues generated by the book (including royalties) will go to the Cake Software Foundation, and hopefully contribute to improve our already excellent framework.</li> +</ul> +<p>Very special thanks to <a href="http://www.peachpit.com/">Peachpit Press</a> for giving me and the Cake Software Foundation this chance to</p> +<p>More to come&#8230;</p> +<blockquote> +<p><strong><span class="caps">UPDATE</span></strong>: This book <a href="http://www.h3rald.com/blog/42">has been canceled</a> and therefore will <span class="caps">NEVER</span> be available in bookshops or online stores.</p> +</blockquote>
A contents/articles/41.html

@@ -0,0 +1,8 @@

+----- +title: Comments temporarily disabled +content-type: article +timestamp: 1168149180 +tags: website +----- +<p>As a few of you might have noticed, I decided to disable comments on all the sections of this site, as a temporary measure against spam.</p> +<p>Hopefully I&#8217;ll try implementing something more effective and less drastic soon, but meanwhile this seems the quickest way to get rid of approx 600-800 spam comments per week.</p>
A contents/articles/42.html

@@ -0,0 +1,13 @@

+----- +title: Too many cooks spoil the Cake book +content-type: article +timestamp: 1173231900 +tags: cakephp|writing +----- +<p>I am sorry to announce that my upcoming book, CakePHP Recipes, will not be published anymore. As a matter of fact, it wasn&#8217;t finished because some of the people involved failed to comply with the terms of their contract in delivering material which was suitable for publication.</p> +<p>To quote an email I received from my publisher a few days ago,</p> +<p><em>&#8220;[&#8230;] The Cake Software Foundation has informed us they are withdrawing from the CakePHP Recipes project, and returning the advances they&#8217;ve received. This means we can no longer count on them for support, nor can we package the book as an official title.</em></p> +<p><em>After careful consideration, we have determined that this renders the book no longer viable for us. So, regrettably we must cancel your contract as well. Please understand that we have no quarrel with your performance; you have been responsive and communicative for the entire time. [&#8230;]&quot;</em></p> +<p>This is a huge disappointment to me, in particular because I am not responsible for the cancellation. It was going to be my very first book to be published, and due to someone else&#8217;s misjudgement and lack of motivation it will never be available to the readers.<br /> +I do not want to put the blame the whole Cake Software Foundation for this: nearly every person involved in the project did his best in reviewing parts of the book or offering me support. Regrettably this wasn&#8217;t enough: unfortunately it seems that someone didn&#8217;t like the idea of me writing the book and kept doubting not only my coding skills but also my ability as a writer all along.</p> +<p>It is sad to see how certain individuals fail to understand the importance of marketing and public relations not only when working on a team project but also in ordinary life, but it is truly disappointing to see how the thoughts and opinions of a single individual affect the work of a whole team.</p>
A contents/articles/43.html

@@ -0,0 +1,18 @@

+----- +title: Time for a diet... +content-type: article +timestamp: 1173437940 +tags: cakephp|rant|writing +----- +<p>My fianc&eacute;e keeps telling me that too many cakes are not good for me, and I never listen: I always liked cakes! I <strong>did</strong> like the CakePHP&#8482;<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> framework too, once, and I <strong>did</strong> write <a href="http://www.h3rald.com/projects/view/cakephp-herald">some articles</a> about it in the past, and I believe at least a bunch of Bakers found them useful, especially at the time.<br /> +I do believe the Cake&#8482; Software Foundation<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup> quite liked having their framework featured on popular websites like php|architect and SitePoint, and I believe that I contributed &#8211; to some extent &#8211; to make it one of the most popular frameworks available for the <span class="caps">PHP</span> programming language.</p> +<p>Unfortunately though someone decided that two of such articles and my personal website were no longer worth a mention on CakePHP official website frontpage. To me, this makes sense since the two CakePHP-related series which are being published by <span class="caps">IBM</span> are much more up-to-date than my articles, and thus deserve such a mention instead.</p> +<p>Oddly enough, I took a screenshot of the CakePHP website just yesterday <em>&#8220;by chance&#8221;</em> and my articles were still there:</p> +<p><img src="http://www.h3rald.com/img/pictures/cake-promo/cakephp-08032007.png" alt="" /></p> +<p>&#8230;while this morning they weren&#8217;t anymore:</p> +<p><img src="http://www.h3rald.com/img/pictures/cake-promo/cakephp-09032007.png" alt="" /></p> +<p>Of course I can&#8217;t provide any proof that I took the screenshot yesterday, and of course I don&#8217;t have any proof of the fact that someone in <span class="caps">CSF</span> may have thought that due to my recent <a href="http://www.h3rald.com/blog/view/42/">bad behavior</a> my articles didn&#8217;t deserve to be publicized anymore. I am confident that the Cake Software Foundation always does its best in keeping its site up-to-date, and I am glad that yesterday&#8217;s accident reminded them that there were far better articles which needed to be featured on their site. At least I <em>finally</em> did something good for the community!</p> +<p>Sarcasm apart, I feel I owe an apology for blowing this whole thing out of proportions: I disclosed embarassing details about our past project which &#8211; for the sake of the framework &#8211; should have never been made public, perhaps.<br /> +I want all of you to know that I still think that CakePHP is the best <span class="caps">PHP</span> framework ever made and I genuinely think that Larry E. Master did outstanding work in all this time, along with the rest of <span class="caps">CSF</span> members and contributors. Best of luck for your future editorial and development projects.</p> +<p>Since now my contributions are no longer &#8220;officially recognized&#8221;, I think I&#8217;d better to move on devoting my attention to something else.</p> +<p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> &#8220;CakePHP&#8221; and &#8220;Cake&#8221; <em>seems</em> to be registered trademarks of the Cake Software Foundation Inc. I&#8217;m not sure if I&#8217;m allowed to use them in this blog &#8212; If anyone has any problem with it, please let me know.</p>
A contents/articles/8.html

@@ -0,0 +1,9 @@

+----- +title: New site operative +content-type: article +timestamp: 1144335420 +tags: website|webdevelopment|cakephp +----- +<p>Yes, it works. Perhaps it&#8217;s a tiny bit slower than expected but the new h3raLd.com seems to work.<br /> +I&#8217;ll probably find some new exciting bugs to fix in the next few hours, as usual &#8211; that will be annoying but perfectly normal.</p> +<p><del>The good thing is that the new template seems to load faster, mostly due to the fact that I hardly used images</del> &lt;- [not true, te new site appears to be slower, maybe not due to the images], at any rate, let&#8217;s see how it goes. I can imagine I&#8217;ll have to implement some sort of caching system for the tagging system in particular, but fortunately <a href="http://www.cakephp.org/">CakePHP</a> apparently comes with a built-in caching mechanism for views, models etc. etc. although the documentation available seems to be <a href="http://groups.google.com/group/cake-php/browse_thread/thread/f0f96751bb61bc7b/bcb43c97e91923c7?q=caching&amp;rnum=1#bcb43c97e91923c7">scarce</a> at the moment, and I&#8217;ve been to lazy to investigate any further.</p>
A contents/articles/9.html

@@ -0,0 +1,15 @@

+----- +title: Riddle me this... and you'll get the job! +content-type: article +timestamp: 1144419238 +tags: personal +----- +<p>Today I had my <em>n^th^</em> job interview. Yes, I&#8217;m getting used to them by now, and it&#8217;s becoming quite entertaining: if they <em>paid</em> me for just take interviews I&#8217;d do that for all my life quite happily! <br /> +But since that&#8217;s not going to happen I&#8217;d better get a move on and find a so called <em>real job</em>. Actually this time it wasn&#8217;t the usual complete waste of time and this company <em>nearly</em> made me a proper offer: they&#8217;re gonna see me again next week, so let&#8217;s hope for the best.</p> +<p>The interview was one of the best ever, no doubts. They were friendly enough, they seemed to like me enough and they were even entertaining enough&#8230; one thing which actually <em>never</em> happened to me before: they asked me to solve a sort of pseudo-IQ-test(an annoying semi-pointless riddle, in other words), and here&#8217;s a rough translation from Italian, the comments within square brackets are mine:</p> +<blockquote> +<p><em>You&#8217;re alone in a pitch black room [&#8230;nice intro, eh?] and the only thing you have are two fuses of different length and a lighter [thank God for that, now it&#8217;s all much better]. You know that both the fuses can burn in exactly one hour each, although there&#8217;s no proportional law which bonds the lenght of the fuses to the time necessary to burn them; how can you measure 45 minutes, exactly?</em></p> +</blockquote> +<p>I solved that, eventually, and I got the job! Weheee!</p> +<p>No, more or less, but not quite&#8230; I&#8217;m gonna see them again, and evaluate their offer along with the other(s).</p> +<p>The solution of the riddle? NO <span class="caps">CHANCE</span>! Go and figure it out, it&#8217;s not hard.</p>
A contents/articles/a-look-at-drupal.html

@@ -0,0 +1,7 @@

+----- +title: A look at Drupal +content-type: article +timestamp: 1137048164 +tags: php|webdevelopment|review +----- +<em><strong>Important Notice:</strong> This article is about changes occurring to zZine Magazine's site[1]. At the time of writing, <a href="http://www.zzine.org">www.zzine.org</a> uses the old site, and not the Drupal-based one presented in this article, which is currently under construction[18].</em><br /><br />"Why can't we log who edits the articles?"<br />"Can we send newsletters?"<br />"We should really have a members' area..."<br /><br />zZine.org[1] is a scratch-built site, coded from the ground up to offer zZine journalists, editors and readers all the functionalities and features they wanted. I'm not totally against sites being coded from scratch, but what happens if something needs to be fixed, or new functionalities have to be implemented and you realize that the code cannot be extended or patched easily?<br /><br /><strong>Case Study: zZine Magazine</strong><br /><br />zZine Magazine is an online magazine which publishes not only IT-related and other articles on a weekly basis, but also monthly publications containing CyberArmy[2] digests, special columns, and featured articles. A team of journalists, researchers, editors, publishers and outside contributors has access to the zZine site to write, submit, and edit articles, manage publications and perform various other tasks through a password-protected administration area. This is common to approximately 75% of the websites on the Internet: they have a front-end to present content to the general public and a semi-hidden administration backend which is normally more difficult and tedious to code. That's why someone started developing <em>Content Management Systems</em>[3]: ready-made, fully-featured administrative back-ends for creating and managing almost any kind of website, from blogs to eCommerce portals.<br /><br />Could a CMS be used for zZine Magazine? Probably - zZine doesn't need any innovative or advanced features, just a bunch of commonly-used functionalities like:<br /><ul><br /> <li>Add, delete, edit and publish articles</li><br /> <li>Customizable user permissions, ideally role-based </li>(writer, editor, publisher, etc.)<br /> <li>Creating and managing monthly publications</li><br /> <li>Editor's tests</li><br /> <li>User signups, notifications, etc.</li><br /> <li>RSS feed generation</li><br /> <li>Sending newsletters to subscribers</li><br /> <li>Logging user actions</li><br /></ul><br />Some members of my team raised some concerns regarding the usage of a CMS, which were mostly based on our past experience with just a particular product and not CMSes in general. Everybody agreed that if we were to go back to a CMS, we <em>had</em> to choose the <em>best</em> this time: something flexible, easy to use, fast, search-engine friendly, and extensible. I spent some time researching CMSes, because while I knew that there's no such thing as the best CMS, there was certainly a CMS that was best for our needs.<br /><br /><br /><strong>Making the right choice</strong><br /><br />In the past, I had played around with Xoops[4] when I first thought about creating websites, and I used Mambo[5] for some other sites. I admit that I never actually spent time creating complex Mambo components and modules, but I must say that in the end I felt somehow tied to third-party modules and unable to understand how they really worked: Mambo seemed to give developers too much freedom, and had neither a solid API nor conventions to follow, at least when I used it.<br /><br />So I decided to have a look around again, starting from the two most important sites people should look at when choosing the most suitable CMS for their work. <br />The first site is CMS Matrix[6] which - as the name implies - provides a really handy <em>matrix</em>, or chart, to compare the various features offered by nearly all CMS available, both proprietary and open-source.<br /><br />I remember choosing Mambo last time I used the matrix simply because it appeared to be one of the most feature-rich. This is actually something <em>not</em> to do when choosing a CMS: always concentrate on what your site needs rather than what the CMS is able to offer. Otherwise, you run the risk of having too much to work with.<br /><br />The other important website to visit when choosing a Content Management System is OpenSourceCMS[7], which basically allows you to try a demo of every open source CMS online. This is perhaps more useful, but also much more time-consuming: it's better to narrow down the list of possible CMSes after checking CMS Matrix and then try each one rather than just picking one at random.<br /><br />At this point, an experienced CyberArmy staff member[8] suggested Drupal[9]. I asked her why, and she simply said that it seemed to be the best choice according to zZine's needs, as it basically offered all the features we were looking for, either natively or through modules. She also admitted to be biased, as she's actually <em>part of Drupal's documentation team</em> and involved with Drupal development[10].<br /><br />Before making any kind of commitment, I checked out Drupal's website to see how they organized things, and I was quite impressed. I immediately noticed the Handbooks section[11], which contains all the official Drupal documentation and it seemed pretty much complete. No "under construction", "please write content here" or "we're a new project, help us write the documentation" notes, just a load of good-quality documentation, including a fully documented and <em>stable</em> API![12] <br /><br />This surprised me, because some projects I came across, even really good ones, lacked a proper documentation section. I think this is a common problem with new open source projects, and Drupal for this reason gave me the impression to be quite mature and useable already. After visiting the very clear and organized Downloads Section[13], I downloaded the CMS and a few modules and installed it on my laptop.<br /><br /><br /><strong>Installation</strong><br /><br />Drupal needs three things to run:<br /><ul><br /> <li>A web server - Apache is fine, and ISS is reported to be working</li><br /> <li>PHP - Either version 4 or 5, Drupal started supporting PHP5 since 4.6.0 release</li><br /> <li>A PHP-compatible database - MySQL or PostgreSQL is recommended</li><br /></ul><br />I used a WAMP[14] installation to test Drupal. First of all, I created a MySQL database, granting ALL privileges to the database user accessing the Drupal database. When I uploaded the site to the remote server, later on, I had some problems because the LOCK TABLES privilege wasn't granted by the host. Drupal requires this, so I had to contact my host to solve the problem. I then imported the database scheme located in the <em>database</em> directory under the installation directory and modified the configuration settings (sites/default/settings.php) to allow Drupal to access the database. Installation complete.<br /><br />Drupal was now up and running with the default configuration settings, with a minimum of fuss. For all the details concerning the installation process, consult the exhaustive documentation.[15] I didn't read it when I installed it, but it can really be useful in some situations.<br /><br /> There are actually two non-critical things to consider if you're planning to use Drupal for a medium-sized project: the first involves changing a few settings on php.ini, in particular increasing the amount of memory allocated to PHP from 8MB to 16MB, especially if you're planning to use either a lot of simple modules or a few complex ones, and the second is setting up your crontab to execute <em>http://www.yoursite.com/cron.php</em> every hour or so. This is required by some semi-essential modules like the site-wide search, but a common alternative (if you don't want to setup the <em>cron</em> task manually) is the poorman's <em>cron</em> module[15], which I used myself and found to be workable. <br /><br /><br /><strong>Keeping your site under control</strong><br /><br />Perhaps one of the best things Drupal has to offer is a rock-solid general-purpose administrative backend. The first thing I found in the backend which really impressed me (and that also I never found in another CMS) is the ability to create <em>custom</em> role-based user accounts and access permissions for <em>everything</em>: every module can be configured so that, for example, not all people can see its output and just a few can administer and modify it.<br /><br />For zZine, I created four types of accounts:<br /><ul><br /> [*]<em>Administrator</em> - Able to access everything and change every setting of the site<br /> [*]<em>Publisher</em> - Able to write, edit and publish every kind of content on the site, but not able to administer user accounts, permissions and similar administrator-only tasks.<br /> [*]<em>Editor</em> - Able to write and edit anything on the site, but not to publish it.<br /> [*]<em>Writer</em> - Able to write articles, blogs and similar content, but in some cases not allowed to edit it.<br /></ul><br />These were precisely the account types I was looking for in a CMS. Granted, other products offer them by default, but having pre-defined account types is one thing, and being able to customize them completely is another.<br /><br />User accounts are great, but sometimes it's good to know what the users of your sites are doing as well. On our old site we had user accounts for editors and administrators, and even if only a few people had access we had no way to determine who edited an article or who published something unless that person told us. Drupal comes with a radical solution to this: Almost every action is automatically logged by the <em>watchdog</em> core module. Every website error, every page not found, and every PHP or MySQL error is logged, as well as every content submission or modification. Page accesses, meanwhile, can be logged through the statistics module. <br /><br />Themes & Templates<br /><br />"We shouldn't use a CMS: I don't want zZine to have the overly used *nuke-style look." I've heard this too many times. Sometimes people associate the word "CMS" with "lack of original design", and that's not true by any means, especially for Drupal. Of course, there are plenty of ready made themes[16] which can be freely used or modified for any Drupal-based site. <br /><br />I must confess that when I first saw the themes section I feared that Drupal "themes" used their own template engine, like some CMSes do nowadays, but I was wrong: currently Drupal supports some template engines[17] but also pure PHP-based ones. Theme engines do their job wonderfully and can offer some interesting features, but templates written natively in PHP tend to perform better, simply because there's no extra parsing or additional overhead involved.<br /><br />I decided to have a look at a standard PHP theme. Basically, it's nothing more than a PHP-enriched xHTML file and its corresponding stylesheet. There are a few functions which must be used to perform particular tasks, like showing the main navigation links, but nothing too hard to understand. It's also <em>very</em> customizable. In fact, we're already working on a custom zZine theme, which doesn't seem any harder than coding a standard xHTML template. As design should always be the last thing to worry about, I decided to use a temporary template I created by slightly modifying an existing one.[18]<br /><br /><br /><strong>To switch or not to switch?</strong><br /><br />When creating a new site for an organization which already has one, there's something very important to consider: <em>what happens to the old data</em>?<br />Assuming the old site was dynamic and using a database of some sort, there are three possibilities:<br /><ul><br /> <li>Don't bother doing anything: any data on the old site will not be transferred to the new one.</li><br /> <li>Make the old website available somewhere else as an </li><em>archive</em> of old documents.<br /> <li>Import all the data from the old site to the new one. </li><br /></ul><br />Obviously we went straight for the third one, which is the most difficult to implement, but it was necessary: there were over 1000 articles on the old site-<br /><br />Of course, in reality, I didn't even mention the possibility of using Drupal until I figured out a way to import the old data into the new database structure. Never praise features or convince people to switch unless you're 100% sure you can handle the situation. Luckily for me, it turned out that everything could be imported easily enough.<br /><br />The first difference I found between Drupal and zZine was that we didn't really have proper user accounts. Every article had an author, but it was stored as a field in the article's record, and that was all. Drupal, on the other hand, supports (and perhaps requires) user accounts - everything present on the site must be written or edited by an existing user.<br /><br />The solution I cam eup with was rather drastic: I created about 120 user accounts, retrieving usernames from the articles and inserting them through a custom PHP script into Drupal's user table. Of course, those users never registered on the new site[18], so I didn't personalize the accounts at all: I simply put a notice on the first page asking everyone who contributed to zZine before to contact me in some way to enable their account with a valid email address.<br /><br />After this initial difficulty, importing articles was relatively easy. Pretty much every type of content in Drupal is, in its simplest form, a <em>node</em>. Nodes have a title, which is a teaser generated automatically from the body text, and an author (the node table in the database has more fields, but these are the key ones for us). Essentially, Drupal's two default models for writing <em>stories</em> and <em>pages</em> write data to this table only. The most important thing to understand about Drupal is that almost every module used to create <em>something</em> on the site - an article, a blog entry, even songs - will use the node table, and add everything else on other tables. This makes the whole system much easier to administer: every node can potentially be extended <em>in any way</em> by third party modules! <br /><br />What about categories? Well, Drupal has become famous for its taxonomy module: whereas most CMSes only support, or in fact <em>impose</em>, a one- or two-level hierarchy for categories, Drupal's taxonomy module supports the creation of as many different terms to describe data as you can think of. Each piece of content (categorization can be applied to <em>any</em> node, and since almost everything is a node-) can belong to none or <em>n</em> different categories, which can be nested in a <em>n</em>-level hierarchy. Since the zZine articles were already divided into categories, I imported all of them directly into Drupal. On the old zZine site, every article could have at most one category, which is fine, but it's good to know that we can now configure the system to support a more advanced categorizing system.<br /><br />After importing the articles, the last important thing to transfer to the new site were the zZine Publications. Publications are what we call the article collections that we release as an issue every month. I could have created a new module for this, and it wouldn't have been that hard, but there was already an excellent module for that. This was pure luck, but the <em>epublish</em>[19] module seemed like it was tailored specifically for our needs.<br /><br /><br /><strong>Drupal API and Modules</strong><br /><br />We were lucky enough to be able to use existing modules for the main functionalities of our site, but in some cases you might not be able to find <em>exactly</em> what you're looking for.<br /> <br />In our case, even if we could have used the <em>story</em> module, which is part of the default installation, for zZine articles (stories have a body, a teaser, a title and an author, exactly like our articles) we decided not to. I wanted our editors and writers to know what to use when submitting articles, and the name "stories" sounds a bit too ambiguous for my liking. So, I decided to have a look at the standard story module to see how modules work, and create something similar.<br /><br /><em>Note: I'm curious by nature and I didn't read anything in the Drupal API[12], or about developing custom modules; I looked at the story module without any prior knowledge of Drupal's conventions.</em><br /><br />All I found in the story module was a bunch of functions like:<br /><code><br />/**<br /> * Implementation of hook_node_name().<br /> */<br />function story_node_name($node) {<br /> return t('story');<br />}<br /></code><br /><br /> which seemed to be enough to tell the Drupal core what to do. I was used to Mambo components, where developers have more liberty to do what they want, including outputting HTML code anywhere. Drupal is nothing like that; on the contrary, it has its own structure and coding conventions that developers have to follow when creating custom modules. Even if a simple function like the one above is fully commented, it has to have a standard indentation (two spaces) and an obviously standardized name. I noticed that all the functions similar to this one started with "<em>story_</em>", so I created a new file named <em>zzarticle.module</em>, copied and pasted the story module code into it, and changed every function accordingly, like this:<br /><code><br />/**<br /> * Implementation of hook_node_name().<br /> */<br />function zzarticle_node_name($node) {<br /> return t('zZine Article');<br />} <br /></code><br />Trivial enough, and it worked fine! I put my shamefully copied module in the /modules directory and I was able to create "zZine Articles" (which were nothing but stories with a different name).<br /><br />At this point I decided to have a proper look at the API, and read about hooks:<br /><br /><fieldset><blockquote><em>"Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.<br /> To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and call that hook in all enabled modules that implement it. [-]"</em></blockquote></fieldset><br />A <em>hook</em> was used for the previously mentioned function, and this was diligently commented:<br /><br /><code><br />/**<br /> * Implementation of hook_node_name().<br /> */<br /></code><br /><br />This made me understand how Drupal is actually geared towards developers and at the same time suitable for non-technical users. Wait a minute, what if someone is not familiar with PHP and still needs custom modules and features? Is there any way to extend Drupal without having to physically code new things? Yes, there is, and two modules come to mind:<br /><ul><br /><br /> [*]<em>Webform</em> - allows the creation of any kind of web form. Users can customize field types, values, labels and messages. The module also provides ways to process forms by either saving data to the database or emailing it, which we can use for things like the Editor's Test and surveys.<br /> [*]<em>Flexynode</em> - This module is simple and powerful - it allows users to create their own content types without coding a single line. In my example, I cloned the story module to create the zZine Article content type. This is easy to do, and functional, but what happens if someone wants to include an additional field to the article submission form? I can probably do this using hooks, but if I was lazy I could do the same thing with the <em>flexynode</em> module. I actually used this module for our podcast section[20], and it did an excellent job.<br /></ul><br /><br /><strong>Conclusions</strong><br /><br />For now I must say I'm very happy with what Drupal has to offer, and if there's something we need for the site, we can code it ourselves and then integrate it into Drupal. <br />One of the major strengths of this CMS is definitely its developer-friendliness: while other CMSes mainly focus on users at the price of limiting extensibility and trapping developers into predefined modules, Drupal even encourages developers to integrate their code into the existing structure, opening virtually unlimited possibilities. Granted, it may seem difficult to understand at first, some people I talked to told me that 'Drupal is too complex' or has a rather steep learning curve, but I just think everything becomes clearer after reading parts of the vast documentation section: this is the only price to pay, and believe me, it is definitely worthwhile.<br /><br /> <br /><strong>Notes</strong><br /><small><br />[1] zZine Magazine: <a href="http://www.zzine.org">http://www.zzine.org</a><br />[2] CyberArmy Community: <a href="http://www.cyberarmy.net">http://www.cyberarmy.net</a><br />[3] Content Management System, Wikipedia page: <a href="http://en.wikipedia.org/wiki/Content_management_system">http://en.wikipedia.org/wiki/Content_management_system</a><br />[4] Xoops - Official Page <a href="http://www.xoops.org/">http://www.xoops.org/</a><br />[5] Mambo - Official Page: <a href="http://www.mamboserver.com">http://www.mamboserver.com</a><br />[6]CMS Matrix: <a href="http://cmsmatrix.org/">http://cmsmatrix.org/</a><br />[7] Open Source CMS: <a href="http://opensourcecms.com/">http://opensourcecms.com/</a><br />[8] Snarkles's CyberArmy Profile: <a href="http://www.cyberarmy.net/~snarkles">http://www.cyberarmy.net/~snarkles</a><br />[9] Drupal - Official Page: <a href="http://www.drupal.org">http://www.drupal.org</a><br />[10]Webchick's Drupal Profile: <a href="http://drupal.org/user/24967">http://drupal.org/user/24967</a><br />[11] Drupal - Handbooks: <a href="http://www.drupal.org/handbooks/">http://www.drupal.org/handbooks/</a><br />[12] Drupal API: <a href="http://drupaldocs.org/api/head">http://drupaldocs.org/api/head</a><br />[13] Drupal Downloads: <a href="http://www.drupal.org/project/">http://www.drupal.org/project/</a><br />[14] WAMP Server Package: <a href="http://www.wampserver.com">http://www.wampserver.com</a><br />[15] Drupal - Installing and Upgrading documentation: <a href="http://drupal.org/node/258">http://drupal.org/node/258</a><br />[16] Drupal - Themes: <a href="http://drupal.org/project/Themes">http://drupal.org/project/Themes</a><br />[17] Drupal - Theme Engines: <a href="http://drupal.org/node/509">http://drupal.org/node/509</a><br />[18] zZine Beta site: <a href="http://beta.zzine.org">http://beta.zzine.org</a><br />[19] Drupal - ePublish module: <a href="http://drupal.org/project/epublish">http://drupal.org/project/epublish</a><br />[20] zZine Podcasts: <a href="http://beta.zzine.org/podcasts">http://beta.zzine.org/podcasts</a><br /></small><br />
A contents/articles/academic.html

@@ -0,0 +1,111 @@

+----- +title: Thoughts about the Italian Academic Education +content-type: article +timestamp: 1120768200 +tags: italy|personal|rant +pdf: true +----- + + <section class="section"> +<p>I found this article today, buried in my mailbox. I wrote it just over five years ago, the evening after failing the last, insignificant exam necessary to get my degree in IT Engineering.</p> +<p>I eventually passed the damn thing, got my B.Sc., and found a great job right afterwards, while all my former fellow students were still studying pointless crap. Maybe some of them are still studying pointless crap right now, and they&#8217;re still living with their parents.</p> +<p>I was very lucky. If I didn&#8217;t fail that exam perhaps I would have kept studying for my master&#8217;s degree for years, and maybe today I wouldn&#8217;t even have a job, or be married!</p> +<p>I decided to re-publish this article because it&#8217;s part of what I am, and I&#8217;m not ashamed of it. I corrected a few of the most obvious spelling and grammar mistakes, but I didn&#8217;t edit it or censor it otherwise.</p> +<p>It may be a senseless rant, but my opinion of the Italian Education System is still the same: If I&#8217;ll have a child who wants to study anything technical someday, I&#8217;ll tell him/her to get the hell out of Italy and go abroad to study in a <em>real</em> university.</p> +<p style="padding-left:15em;"><strong>Fabio Cevasco</strong> &#8212; <em>Saturday, July 31st 2010</em></p> +<section class="section"> +<header><h1 id="h_1" class="toc">The Pre-computer Age</h1></header> +<p>Who am I? I&#8217;m just an Italian student taking the last exams to obtain my B.Sc. in IT Engineering. Obviously I&#8217;m quite interested in Information Technology and everything concerning computers or the Internet, and &#8211; believe it or not &#8211; this probably came from my parents&#8217; original dislike of computers themselves.</p> +<p>in Italy, unlike in most of the other capitalistic countries of the world, kids tends to listen to their parents until they reach their &#8220;full maturity&#8221;, i.e. 25 years of age at least (by the way, I&#8217;m 22), so, to cut a long story short, I was allowed to have a computer at home when I was 16 years old. I couldn&#8217;t believe it when the technician brought it at home: sure I&#8217;d seen a computer before in my life, but that was mine, and I could use it to do something amazing, as I dreamt many times.</p> +<p>The point is, from another point of view, that I felt behind already compared to my friends who were already boasting their records at various computer games. Fools.<br /> +On another note, I was a bit different from other Italian kids: I always liked writing and reading in English since I was 6, because I found the language to be quite amazing or even magic for the way it sounded, as I used to say to my friends. Friends &#8211; the Italian ones, that is &#8211; who never really understood me totally, and in particular my<br /> +passion for the Anglo-Saxon cultures: for them, writing and reading in English were just boring and difficult things you had to do at school, while I enjoyed reading The Tempest by Shakespeare when my English teacher didn&#8217;t even teach me the past tense, yet. A fool?</p> +<p>My passion for the English language was soon noticed by my parents, who let me go to England a few times, to college: basically a fashonable way for english schools and travel agencies to rob honest families, promising them that their kids would have learnt a new language enjoying themselves. Result: the kids enjoyed their holiday a lot, but basically always spoke Italian to each other (and even to English people over there) and the families were happy when they came back because after spending so much money they must have learnt something&#8230;</p> + +</section> +<section class="section"> +<header><h1 id="h_2" class="toc">Using the Computer and the Internet</h1></header> +<p>Back to that amazing and weird magic box called computer: I immediately enjoyed experimenting new stuff, playing with Windows (for me the word &#8220;Linux&#8221; at the time would have sounded not too different from some names of medicines my grandparents were taking), and even playing games, why not, but in English of course, because I never<br /> +really liked Italian translations (yes, we even dub video games!).<br /> +I remember my biggest fear was not being able to catch up with my friends who had a computer for years: I was so obsessed with that that I often stayed on the PC more than the 2-3 hours allowed by my parents, when they were away. Some time later, and relatively recently, I discovered that I catched up relatively soon, without even noticing it.</p> +<p>I&#8217;ve been allowed to access the Internet when I turned 18, because my parents were scared it could be just another bad thing, and still I found myself behind if compared to my friends, who&#8217;ve been surfing the web long before.</p> +<p>Only now I notice that perhaps my parents made me discover new things about PCs which my friends never bother learning, even now that they&#8217;re graduating. I remember my mum calling me for a silly pseudo-scientific divulgative program where they were describing this new, totally free operating system different from Windows who was supposed to work much better. &#8220;It said the name before&#8230; it&#8217;s Luxi&#8230; lixi&#8230; lunis&#8230;&#8221; &#8211; Linux.</p> +<p>When I had access to the Internet my life really changed. I do believe that unlike my friends I used the Internet for its very purpose: sharing knowledge, or, in my case, just learning. I also made a vow to myself: to surf <span class="caps">ONLY</span> (unless I had to) English/International websites; a vow which I&#8217;m keeping still nowadays, which seemed utterly illogic<br /> +to my friends and Italians in general.</p> +<p>Immediately a whole new universe opened to my eyes: I quickly learnt how to keep up-to-date on the recent events regarding computers, I learnt some rudiments of Internet and Hacking Culture (thanks <span class="caps">ESR</span> for all your papers) and the Open Source movement, and linux, etc. and I noticed two things:</p> +<ul> + <li>I was definetely catching up with my friends&#8217; &#8220;knowledge&#8221; in computing</li> + <li>I would have <span class="caps">NEVER</span> ever managed to learn even 1/10 of all you need to know about computers: the same as in life, and I was happy with it.</li> +</ul> + +</section> +<section class="section"> +<header><h1 id="h_3" class="toc">The Pre-academic Period</h1></header> +<p>In the meantime I was studying in a Liceo Scientifico, a kind of scientific high school where basically they make you study all sort of subjects (from geography, to maths to phylosopy, to Latin) mainly focusing &#8211; they say &#8211; on Science-related disciplines. For those who don&#8217;t know, in Italy you don&#8217;t get to choose what you want to study: in<br /> +High School and University they let you choose basically a type of school, but subjects and courses cannot be changed, apart from a few exceptions.<br /> +I &#8220;chose&#8221; a particular type of scientific school (&#8230;the exception!) where basically I agreed to study an additional subject &#8211; Computer Science &#8211; in addition to all the rest, for a total of more than 30 hours per week. I studied a lot then, because my parents taught me that Culture was important, and that &#8220;if you&#8217;re ignorant you can&#8217;t do anything nowadays&#8221;. No, my parents weren&#8217;t ignorant themselves, my dad is a Mechanical Engineer and my mum a Latin/History/Italian professor &#8230;and yes, that helped my forma mentis a lot.</p> +<p>I studied a wide range of subjects, including something totally irrelevant with my favourite ones: English and Computing (note: I say &#8220;Computing&#8221;, not Maths), and I did quite well in the end, graduating from High School with a mark of 100/100. While I was studying Latin, Phylosophy and alikes I was thinking that at least at University I&#8217;d have studied something really more specific.<br /> +Until the end I was undecided on which faculty to choose, whether IT Engineering or Foreign Languages. I was very fond of English and languages in general, but I primarly liked computers, so I thought that if I studied IT Engineering I&#8217;d have learnt more about computers and my already half-decent knowledge of the English language would<br /> +have helped me in my studies (&#8220;Now they <span class="caps">REQUIRE</span> a good knowledge of English, at university&#8221;) and in my future, when I&#8217;d have started working. <span class="caps">FOOL</span>.</p> + +</section> +<section class="section"> +<header><h1 id="h_4" class="toc">Alice in Wonderland</h1></header> +<p>That was it, I remember exactly when I went to sign my pre-enrollment papers: IT Engineering. I was so happy to have made it! Now finally I would have studied what I was meant to.</p> +<p>On a side note, I was never too good at Maths, I don&#8217;t know why. I just didn&#8217;t like it because it felt too theorethical for me, and not as useful as I thought,<br /> +especially for programming. In High School I was taught a bit of the Pascal 3 programming language, and that turned out to be perhaps one of the most useful things I&#8217;ve ever studied.</p> +<p>The first disappointment came from the courses that they setup for the first year: two <span class="caps">BIG</span> Maths-oriented exams in particular, and Chemistry(!). What Chemistry has to do with Computer Science remained a mystery to me, people claimed that we might be asked in the future to do some programs to help studying the structure of matter and doing<br /> +chemical analysis&#8230; yes, and following the same logic I should have been studying the structure of languages, because AI programs and translators would certainly become key applications in the future.</p> +<p>Oddly enough, they made us just study Chemistry.</p> +<p>&#8220;But next year will be better&#8221; &#8212; I was thinking, after getting fairly poor results in the Maths exams &#8212; &#8220;next year we&#8217;ll study something more exciting&#8221;.</p> +<p>Economics.</p> +<p>They made us study Economics because they think that it&#8217;s useful to know something about finance and salaries, especially when you start working. That makes sense, to an extent, of course, and it was kind of interesting even. But still I didn&#8217;t study anything really useful.</p> +<p>This is a little lie, actually, because we actually had two programming exams (out of 17) in which they taught us a bit of C++, and <span class="caps">THAT</span> was interesting, and I even managed to get 30/30 out of the last one: I liked it.</p> +<p>I actually remember when the teacher came in, and insisted for us to use a unix emulator (Cygwin) to compile our C++ programs: people thought that &#8220;emulators&#8221; were used for running games released for a gaming console on the PC, and what the hell was unix? It looks like &#8211; they said &#8211; a bad copy of <span class="caps">DOS</span> with more difficult commands. (No comment)</p> +<p>I lived my years at University (three, counting this one which will be the last one) feeling superior to my friends for knowing more about computers but at the same time inferior to them when it came to exams: I didn&#8217;t really like most of the subjects, especially some rather abstract mathematical models which <span class="caps">COULD</span> BE useful, but &#8211; let&#8217;s<br /> +say it all &#8211; most people outside Italy don&#8217;t really give a sh&#8230;illing about. What&#8217;s the point in learning the demonstration of Cauchy theorem? Just use it maybe, and it would have a sense&#8230; No, they wanted you to study the demonstration and tell them about it, without missing a passage, which normally &#8211; for 2/3 of people at least &#8211; meant<br /> +&#8220;learn it by heart&#8221;.</p> +<p>Also, unlike in other countries, professors are more similar to Gods than clever people, apart from a few exceptions. Every professor decides how the students have to take the exams, some of them opt for having some <em>compitini</em> (little tests) during the semester and then the average mark on all of them (normally two or three) represents the<br /> +exam&#8217;s final mark: that&#8217;s the best, probably, but it could also mean that people can cheat trying to copy from their collegues, etc.</p> +<p>Normal, get on, it&#8217;s Italy!</p> +<p>Some professors might allow you to use the notes you took during classes, but that&#8217;s often considered a bad thing because people can potentially copy from one another (&#8220;What&#8217;s that piece of paper, is it your friend&#8217;s?&#8221; &#8211; &#8220;No, it&#8217;s part of my notes&#8221;), and they often do. On the other hand, if a professor doesn&#8217;t allow notes to be used, students<br /> +normally do their best to sneak and use them anyway.</p> +<p>This is Italy, after all, the place where everything can be sorted out if you&#8217;re cunning enough.</p> +<p>But why do some people cheat? Oh well, simply because either you devote 3 full years of your life to studying pointless crap and forgetting that you&#8217;re wasting the best years of your existence, or you have to do something to pass 10 exams a year. Because we <span class="caps">REALLY</span> do take 10 exams a year.</p> +<p>My girlfriend (who&#8217;s English and living in Italy, by the way) told me that her brother wanted to study Computing at University but switched to Politics &amp; Journalism because they wanted him to learn Java on the very first year. I&#8217;ve never been taught Java &#8212; I had to learn it all by myself for my final thesis (see below) &#8212; but instead I learnt a ton of demonstrations of theorems and mathematical models. Great, isn&#8217;t it?</p> +<p><em>&#8220;But you knew you were going to take those exams, because they are publicly available before enrolling&#8221;.</em></p> +<p>That&#8217;s true and it makes sense, and I probably should have chosen Computer Science instead of IT Engineering if only it was considered equally important. In Italy if you study Engineering you can (after taking yet another exam) become an Engineer, which &#8212; unlike other countries &#8212; is not a competent person who knows how to fix stuff and can solve problems. Rather, he&#8217;s someone who got an important academic title who is treated like a demi-god because he knows (or should know) what&#8217;s a differential system and how can be solved but &#8212; sometimes &#8212; doesn&#8217;t know how to use it.</p> +<p>But he&#8217;s an Engineer, and he can find work when others can&#8217;t.</p> +<p>To explain this concept to non-Italian, I can summarize all this with the following:</p> +<p>In Italy Academic (Skool) Titles rulez &#8211; You ain&#8217;t got none? You ain&#8217;t nothin&#8217; coz I got one and I own you.</p> +<p>And that&#8217;s that. In Italy knowledge is dead. (This is an exaggeration, but please try to get my point).</p> +<p>If you need to be competent in something, when you&#8217;re working you&#8217;ll have to do a practical course (even paying for it yourself) if some &#8220;knowledge&#8221; is needed. If there&#8217;s no risk that things can blow up, you can remain ignorant.</p> + +</section> +<section class="section"> +<header><h1 id="h_5" class="toc">The Vanishing Cheshire Cat</h1></header> +<p>Up to today I could leave with it, I knew that abroad the situation was hopefully different, but I started to cope with the fact that I would have got my B. Sc. and in addition I knew more stuff than some of the others who got the degree at the same time. A few months ago I had just a few exams left and I started going to the lab for my thesis project, with a friend of mine.</p> +<p>At that point &#8212; oddly enough &#8212; I was told to develop an application in Java, using some libraries, and actually make something fully functional and (somewhat) useful. I couldn&#8217;t believe it! I was happy on one side, and angry on the other, because <span class="caps">NOBODY</span> ever taught us about Java or about creating an useful application.</p> +<p>The Ph.D. Student who was appointed to help us with the project told us: &#8220;That&#8217;s the way it works, it&#8217;s normal that you don&#8217;t know Java, but you know a bit of C++, and now it&#8217;s time to research&#8221;. That was again very shocking: it was the first time that someone ever told me something like this, and in the end we agreed on the project.</p> +<p>Despite the fact we had to implement some new features and test them relatively at the last minute, we succeeded in developing the program. In particular, I actually played an important part being the one who actually researched something on Java already, and knew more about programming.</p> +<p>Oddly enough, my collegue would have graduated with a higher mark than me, even if he originally thought that &#8220;<span class="caps">SSH</span>&#8221; was nothing but a sound used to shut people up and that <span class="caps">HTML</span> was a proprietary standard introduced by Microsoft having something to do with web pages. If you&#8217;re reading all this mate, don&#8217;t get angry at me: I have nothing against you, I just hate the System, as usual.</p> +<p>He still probabally thinks that POP3 is something like the name of a band and that a shell can be found only at the sea. Mate, it&#8217;s not your fault, don&#8217;t blame me if I say this, blame the System!</p> +<p>I mean, I don&#8217;t consider myself an expert, but at least I&#8217;m better than that. I met students, at uni, who haven&#8217;t the faintest idea of what a sever was. And that&#8217;s pretty sad, if you ask me.</p> +<p>Let&#8217;s now come to the end of this apparently endless flow of thoughts: I still had an exam to pass in order to get the degree. Such exam counts 3/180 of the whole stuff we had to study in these three years (it is literally quantified like this on paper), and it&#8217;s about Digital Controls. Cool, you may think, but it actually means <span class="caps">MORE</span> mathematical models to solve complex(?) situations, more theorems and other crap, even if &#8212; I admit &#8212; I had to take exams worse than this one.</p> +<p>I admit I constantly underestimated the exam and took it various times without passing it: &#8220;it&#8217;s so small, I&#8217;ll have to pass it eventually&#8221;.</p> +<p>This was just the way of thinking they made us adopt, nothing more, nothing less.</p> +<p>I was quite busy testing my program and writing the thesis in this period, although we were literally told not to worry too much about it: &#8220;just google a bit on the net, copy and paste, and change some words if you feel guilty&#8230;&#8221;</p> +<p>To the guy who told me to do so: it&#8217;s just an example that is bad to read, but it&#8217;s true, you can&#8217;t deny it. I don&#8217;t blame you, because you&#8217;ve really taught me a lot about working on &#8220;proper&#8221; projects (and this is <span class="caps">NOT</span> sarcastic, really), I blame the System.</p> +<p>In the meantime I spent days running around here and there trying to sort out all the bureaucracy necessary to have all the papers ready for my degree, and I also talked to the professor who commissioned the project: he&#8217;s by far the most helpful and altruistic professor I&#8217;ve ever met, and obviously offered his complete availability for helping<br /> +us for the preparation of the degree.</p> +<p>I just needed to pass my last exam. It was the last one, not as complex as others I took, and this time I studied more than the previous times&#8230;</p> +<p>I didn&#8217;t pass it.</p> +<p>I don&#8217;t blame the professor, because probably he&#8217;s the only one who&#8217;s normal in the whole lot: he&#8217;s like me, I think, because I suspect he&#8217;s aware that abroad students don&#8217;t cheat and professors are not &#8220;flexible&#8221; on marks. I got 12/30, and I didn&#8217;t pass, that was it, I didn&#8217;t know his subject enough and he didn&#8217;t feel he had to help me to get the degree at all. And he&#8217;s right. I can&#8217;t blame him, but I DO blame such a &#8220;flexible&#8221; system which in the end is totally absurd. I learnt the hard way that I shouldn&#8217;t have &#8220;trusted&#8221; the Italian Way, because it has flaws.</p> +<p>Oddly enough, people who can&#8217;t even connect a network cable get their B.Sc., and all I get after spending months learning useful things and developing is just a load of B.S.</p> +<p>I learnt my lesson and I&#8217;ll probably re-take the exam, pass it, and maybe get the degree: my collegue and friend just emailed me telling me that I <span class="caps">HAVE</span> to help him doing the missing chapters of the thesis because he can&#8217;t write them, he&#8217;s not good at writing stuff, and doesn&#8217;t know what to write either. He&#8217;ll get his B.Sc. on September 23rd, provided that I actually decide to help him.</p> +<p>I hope people who read this can understand my frustration apart from blaming me for being &#8220;lazy&#8221; when it came to exams and expecting help when technically I didn&#8217;t deserve it. I probably won&#8217;t win the nobel prize or get rich like those two american students who own the most profitable Internet business ever conceivable. I&#8217;m not as special, and I don&#8217;t deserve anything special, and I never dreamt about it.</p> +<p>All I dreamt was being able to learn, and do something useful. It looks like it will remain just a dream, here in Italy.</p> + +</section> + +</section>
A contents/articles/akelos-interview.html

@@ -0,0 +1,63 @@

+----- +title: An Interview with the creator of the Akelos Framework +content-type: article +timestamp: 1184814120 +tags: php|rails|cakephp|frameworks +----- +<p>I <a href="http://www.h3rald.com/blog/34">already</a> <a href="http://www.h3rald.com/blog/38">covered</a> the Akelos <span class="caps">PHP</span> framework in the past, but for those who don&#8217;t know it, Akelos seems to be one of the few <a href="http://www.h3rald.com/articles/rails-inspired-php-frameworks">Rails-inspired <span class="caps">PHP</span> frameworks</a> still worth mentioning, besides CakePHP and Symphony of course.</p> +<p>I recently has a look at their recently-relaunched <a href="http://www.akelos.org/">community website</a> and I noticed this phrase:</p> +<blockquote> +<p>&#8220;Being port of Ruby on Rails to <span class="caps">PHP</span> Akelos is also optimized for programmer happiness and sustainable productivity&#8221;</p> +</blockquote> +<p>Bermi Ferrer, Akelos creator, openly admits the framework is a port of Ruby on Rails to <span class="caps">PHP</span>, an attempt to help <em>&#8220;Ruby on Rails developers who need to code in <span class="caps">PHP</span>&#8221;</em>, among others. Of course Akelos is not Rails, simply because Ruby is (thank God for that!) not <span class="caps">PHP</span>, however I decided to find out more, and I asked Bermi a few questions, which he promptly answered.<h4><em>There are a lot of frameworks for <span class="caps">PHP</span>, perhaps too many: why did you decide to create Akelos rather than using one of the existing ones?</em></h4></p> +<p>I started coding <a href="http://www.akelos.org/">Akelos</a> back in 2004 for our internal developments. At that time I only found very few frameworks out there like <a href="http://www.mojavi.org/">Mojavi</a> and <a href="http://ez.no/">eZ Publish</a>. These frameworks were not my ideal of an <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile development</a> environment, so I decided to brew my own solution.</p> +<p>After reading <a href="http://www.martinfowler.com/books.html">Patterns of Enterprise Application Architecture</a> it was clear to me the kind of framework I wanted <a href="http://www.akelos.org/">Akelos</a> to become, so I started to implement some of the design patterns from the book into Akelos.</p> +<p>During the summer of 2005 I had a look into other <span class="caps">PHP</span> frameworks like <a href="http://www.cakephp.org/">CakePHP</a>, <a href="http://phpontrax.com/"><span class="caps">PHP</span> on Trax</a>, and <a href="http://www.bennolan.com/biscuit/">Biscuit</a> but none of them was more complete or easier to use than what Akelos was already at that time.</p> +<p>Then I used <a href="http://www.rubyonrails.org/">Rails</a> for one small personal project and immediately found that <a href="http://www.akelos.org/">Akelos</a> interfaces, conventions and philosophy were close to the Rails approach. <a href="http://api.rubyonrails.org/files/vendor/rails/activerecord/README.html">Rails ActiveRecord</a> implementation was impressive, better than mine and much much better than other existing <span class="caps">PHP</span> implementations, so I first ported the ActiveRecord code using <a href="http://adodb.sourceforge.net/"><span class="caps">PHP</span> AdoDB</a> as the database abstraction layer.</p> +<p>After that point, whenever I had a problem to solve while coding my customers applications I turned to Rails and they usually had the most elegant solution available. So I did like the idea of digging into Rails code to learn more Ruby and bringing Rails magic to the <span class="caps">PHP</span> world. It also helped the fact that Rails inline documentation is excellent so it could be easily adapted for Akelos.</p> +<h4><em>What&#8217;s new since last time I posted about Akelos?</em></h4> +<p>The biggest change is the direction that the project has taken. Until now we have not dedicated time to promote Akelos, we just used it for our internal projects and we have been adding features as needed without a fixed roadmap or advocacy.</p> +<p>Now this has changed. More and more developers are using Akelos and contributing functionalities they miss from Rails. After some serious contribution proposals and many developers telling us how much they like Akelos, we decided to take the time to build a nice community site which includes <a href="http://forum.akelos.org/">forums</a>, a <a href="http://wiki.akelos.org/">wiki</a>, a new <a href="http://www.akelos.org/docs/tutorials/booklink">tutorial</a> and <a href="http://www.akelos.org/screencasts">a screen-cast</a>.</p> +<p>There are also some improvements like:</p> +<ul> +<li>Sintags, now accepts ruby-like calls to helper methods from the views.</li> +<li>Action Webservice, a component for creating and consuming Web Services easily.</li> +<li>Action Mailer, which allows you to receive and send (directly or in delayed mode) emails from within your application. (this is almost ready to ship)</li> +<li>Acts as tree behavior for Models.</li> +<li>Many performance improvements.</li> +<li>Many small contributions and bug fixes.</li> +<li>Code base reduced from 16MB to 9MB.</li> +</ul> +<h4><em>From the new site, it seems that Akelos is &#8211; or aims to be &#8211; a port of Rails for <span class="caps">PHP</span>. Is that true? Do you aim to target Rails developers as possible users of the framework in situations in which &#8220;they have no choice&#8221; but to use <span class="caps">PHP</span> instead of Ruby?</em></h4> +<p>Akelos has ported many Ruby on Rails components keeping their interfaces and functionality whenever it was feasible to port the Ruby code to <span class="caps">PHP</span>. It might be considered a port in the sense of functionality, but there are some Rails strengths that rely on the Ruby language and that are impossible to port to <span class="caps">PHP</span>. However, Ruby developers will find that Akelos is the <span class="caps">PHP</span> framework with is the closest to Rails.</p> +<p>On the other hand, many <span class="caps">PHP</span> developers have moved to Ruby because <span class="caps">PHP</span> lacked a hyper-productive and fun-to-use framework like Rails for building complex applications. That is no longer the case, and those who excel at <span class="caps">PHP</span> can start being productive from day one by using Akelos. In this way, Akelos target users are those who already know <span class="caps">PHP</span> and need to build complex applications that can run on almost any cheap shared hosting using a solid foundation based on good coding practices and widely accepted conventions.</p> +<h4><em>What Rails features are missing in Akelos?</em></h4> +<p>A standalone webserver like WebBrick, <span class="caps">RJS</span>, has and belongs to many through associations, string/number/date extensions and Active Resource.</p> +<p>Ruby-powered features like modules, runtime class overriding and blocks will never be available in Akelos.</p> +<p>Scaffolds in Akelos work by generating code, I found quite useless to enable $scaffold = true; and have magic functionality that you can&#8217;t modify, so I decided not to invest my time on that one.</p> +<h4><em>I noticed quite a few generators available for Akelos, do they work as a Rails developer may expect them to work?</em></h4> +<p>The ones that are available do pretty much the same as in RoR.</p> +<h4><em>How does Akelos compare to other similar <span class="caps">PHP</span> frameworks like, say, CakePHP? What features does Akelos offer which Cake doesn&#8217;t offer and vice-versa?</em></h4> +<p>I&#8217;m not aware of Cake&#8217;s functionalities. At the time I started porting Rails my feelings about CakePHP were that they missed the simplicity point in favor of architectural discussions that lead to confusing code, but that was long ago.</p> +<p>Akelos (and Rails) do not implement <span class="caps">ACL</span> like Cake does, as that is a business logic component that varies too much from one case to other, it has no place inside the framework.</p> +<p>Akelos is built with internationalization in its core. You can even internationalize your Models by prefixing the column name with the locale.</p> +<p>I think that Cake only has an act_as_tree behavior on models while Akelos has Tree, Nested Set, and List. Akelos also implements handy features from Rails like <a href="http://en.wikipedia.org/wiki/Optimistic_concurrency_control">optimistic locking</a>, <a href="http://www.martinfowler.com/eaaCatalog/lazyLoad.html">lazy loading</a>, <a href="http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html">table inheritance</a>, counters, automatic transactions, really powerful validations, calculations&#8230;, and I think most of these advanced features are still missing on Cake, but maybe I&#8217;m wrong.</p> +<h4><em>Did you include unit tests for all the framework classes?</em></h4> +<p>The main components are fully unit tested, and no new code or patch gets into the trunk without unit tests.</p> +<h4><em>Did you or someone do any performance test or benchmarks on Akelos already?</em></h4> +<p>During the last month a lot of code was refactored to improve performance with the help of <a href="http://xdebug.org/">Xdebug</a>, <a href="http://kcachegrind.sourceforge.net/">Kcachegrind</a> and <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab</a>. We significantly improved the performance in one of our most complex intranet applications, a <a href="http://www.basecamphq.com/">basecamp</a>-like system.</p> +<p>Akelos also implements caching at many levels, so it&#8217;s very easy to increase performance as we did with a new <span class="caps">CMS</span> that can handle +200 requests per second using <a href="http://www.apache.org/">Apache</a> in a cheap shared server environment.</p> +<h4><em>Why should a <span class="caps">PHP</span> developer choose Akelos over another <span class="caps">PHP</span> framework?</em></h4> +<p><a href="http://www.akelos.org/docs/tutorials/booklink#mvc">Akelos <span class="caps">MVC</span> implementation</a> and <a href="http://www.akelos.org/docs/tutorials/booklink#workflow">workflow</a> are really easy to understand.</p> +<p>In Akelos all the methods and interfaces are thoroughly selected, so whenever you need to do something you just need to type what you think. Default options are selected with care so you don&#8217;t need to set any configuration unless you want to modify the default behavior.</p> +<p>Coding multilingual applications, building complex relationships within models, distributing databases changes within your development team, building Ajax interfaces, unit testing your code and many other common tasks for <span class="caps">PHP</span> developers are really simple to accomplish when using Akelos.</p> +<p>Akelos is designed to work on PHP4 and PHP5 and it comes with an easy web installer you can adapt for your application. It has functions for working with files and directories in common situations when the web server runs as a different user.</p> +<p>And one of the main reasons for choosing Akelos is that it makes coding fun and lets you focus on solving user problems rather than wasting your time in repetitive technical annoyances. When coding with other developers the <em>convention over configuration philosophy</em> helps everybody to understand exactly how everything works and where to find things.</p> +<h4><em>Is there any website using Akelos already?</em></h4> +<p>The <a href="http://www.thechemicalbrothers.com/">Chemical Brothers</a> new website which has been developed by <a href="http://www.3ev.com/">3rd Eye Vision (3ev)</a> is using Akelos. </p> +<p>The <a href="http://www.akelos.org/">Akelos.org</a> site is running a <span class="caps">CMS</span> named Editam which we will release as Open Source in a near future.</p> +<p>Some small websites like <a href="http://www.fundaciocaixacarlet.com/">Fundacio Caixa Carlet</a> and many intranet/extranet sites that we&#8217;ve been coding during the last 2 years.</p> +<h4><em>What are your future plans for Akelos? Anything new on the way?</em></h4> +<p>A new manual, and a better <span class="caps">API</span> interface are the main priorities right now.</p> +<p>Continuing bringing Rails functionality as needed.</p> +<p>Releasing our sister project Editam <span class="caps">CMS</span> which will help developers who need to add functionality on the top of a <span class="caps">CMS</span> using a solid <span class="caps">MVC</span> framework like Akelos.</p>
A contents/articles/apache2-upgrade.html

@@ -0,0 +1,25 @@

+----- +title: Beware of sudden upgrades! +content-type: article +timestamp: 1198132860 +tags: website|rails +----- +<p>Yesterday I got a rather annoying early Christmas present: when visiting my site, I noticed that the raw source code of my dispatch.fcgi file (yes, I&#8217;m on shared hosting with FastCGI, for now) was displayed &#8220;as it is&#8221; instead of being interpreted.</p> +<p>After the initial moment of anger and stress (I immediately realized it was BlueHost&#8217;s fault, not mine), I opened two tickets and went to bed, hoping to see everything solved in the morning.</p> +<p>Unluckily it wasn&#8217;t the case, so I posted on BlueHost forum trying to be as polite as possible complaining because the issue wasn&#8217;t being dealt with. It turns out that for such issues you&#8217;re supposed to use the &#8220;Live Chat&#8221; feature instead of the tickets, so that&#8217;s what I did.</p> +<p>After a quick chat with &#8220;Christian&#8221;, it turns out that BlueHost decided to perform a server upgrade &#8220;silently&#8221; upgrading to Apache2, PHP5, MySQL4.1, etc. etc.<br /> +Cool, pity that nobody told me that!</p> +<p>I was expecting some sort of <span class="caps">PHP</span> upgrade (not that I care like that), which was supposed to happen according to the last BlueHost newsletter:</p> +<blockquote> +<p><em>&#8220;To alleviate any issues in the future with certain scripts that only run on one<br /> +version of <span class="caps">PHP</span> we have developed the ability to run PHP4 and PHP5 on the same server<br /> +simultaneously. This will be rolled out to all users in the next couple of weeks. Some<br /> +servers already have this ability while most will see it in the next two weeks.&#8221;</em></p> +</blockquote> +<p>But&#8230; hang on? Does it say anything about migrating to Apache2? I don&#8217;t think so! What&#8217;s worse, is that quite a few things changed with Apache2, in particular the way FastCGI handlers are declared:</p> +<div class='text'><pre><code># Apache 1.3: +AddHandler fastcgi-script .fcgi + +# Apache 2: +AddHandler fcgid-script .fcgi</code></pre></div><p>See? Different. This is due to the fact that <a href="http://wiki.rubyonrails.org/rails/pages/Debian+mod_fastcgi+Notes"><code>mod_fcgid</code> is used instead of <code>mod_fastcgi</code> on Apache 2</a>.</p> +<p>The fix was easy, of course, and now my site is up and running again (and actually running faster)&#8230; but, I wonder, why the hell wasn&#8217;t I informed? Is it acceptable? It sounds like I might end up on a <span class="caps">VPS</span> sooner than expected, unless BlueHost doesn&#8217;t roll out some new exciting feature soon, as I think it might&#8230;</p>
A contents/articles/back-from-holiday.html

@@ -0,0 +1,10 @@

+----- +title: Back from holiday +content-type: article +timestamp: 1188442740 +tags: personal|website|writing +----- +<p>I&#8217;m back. I was so eager to go on holiday that I didn&#8217;t even bother writing a post about it, too bad. I actually when on holiday for a week but I thought I&#8217;d take three weeks off from my blog duties in favor of laziness and relax, but unfortunately my laptop decided to go wrong as well, so I didn&#8217;t actually manage to relax that much.</p> +<p>Now everything is fine. I still have to send in my laptop for assistance but it&#8217;s usable at least, and I finally found the time (and the money) to buy a desktop PC. I always wanted to build my own, actually, but in the end I decided to opt for a pre-made Fujitsu Siemens, mainly for economic reasons and time constraints. I won&#8217;t publish the specs, but it&#8217;s alright for me and my fianc&eacute;e.</p> +<p>So what now? Well&#8230; the usual: more posts will soon be added to the <a href="/tags/simplyonrails">Simply On Rails</a> series, a Ruby-related article is on the way (it will be edited by the excellent <a href="http://www.cyberarmy.net">CyberArmy</a> Publication Editing Staff this time), I may venture in a site upgrade whenever they decide to release version 4.2 of Typo which is supposed to be imminent and I&#8217;ll eventually complete another pet project of mine, but that will take more time&#8230;</p> +<p>Stay tuned.</p>
A contents/articles/best-practices-tech-writers-editors-review.md

@@ -0,0 +1,85 @@

+----- +title: Book Review: Best Practices for Technical Writers and Editors +content-type: article +subtitle: Simply all the books your Documentation Team needs +timestamp: 1366519425 +tags: books|review|techcomm +----- + +I've been working in Technical Communications for nearly seven years now, first and foremost Technical Writer and more recently as Documentation Manager. In other words, my work revolves around manuals and online helps, authoring tools and guidelines, documentation standards and… you get the picture. + +And yet, although I write articles and develop [documentation tools](/gliph/) in my free time as well, I rarely write about my job on this site. But when I was offered the opportunity to read and review [Best Practices for Technical Writers and Editors](http://www.informit.com/store/best-practices-for-technical-writers-and-editors-video-9780132929660), I just couldn't resist. + + +### Contents + +*Best Practices for Technical Writers and Editors* is a bundle comprised of three must-read ebooks, specifically aimed at Technical Communications professionals: + +* [IBM Style Guide, The: Conventions for Writers and Editors](http://www.informit.com/store/ibm-style-guide-conventions-for-writers-and-editors-9780132101301) +* [Developing Quality Technical Information: A Handbook for Writers and Editors, 2nd Edition](http://www.informit.com/store/developing-quality-technical-information-a-handbook-9780131477490) +* [DITA Best Practices, Video Enhanced Edition: A Roadmap for Writing, Editing, and Architecting in DITA](http://www.informit.com/store/dita-best-practices-video-enhanced-edition-a-roadmap-9780132929646) + + +#### IBM Style Guide + +Every Documentation department needs a style guide. Even though different organization normally have different set of rules, conventions, guidelines and *house styles*, Documentation Managers often resort to a third-party guide, and the IBM's is definitely one of the most popular choices. + +Within my company, the manager that came before me chose the Microsoft Style Guide: the main reason being that our division develops a set of products that run on Microsoft systems and follow Microsoft guidelines when it comes to designing interfaces. + +The Microsoft Style Guide is great, but if you chose the DITA route it may not be the best choice, because it simply doesn't mention it at all (at least the edition we have). If your organization adopted the [DITA](http://dita.xml.org/) standard, the IBM Style Guide is probably the best choice: IBM has practically created the standard, and this book includes frequent references to it (which are actual links to the other two books within this bundle most of the time, anyway). + +Even though I wouldn't start revolution in my company by adopting the IBM Style Guide right now, I would still recommend it to anyone who needs a new style guide: it is very clear and concise, easy to consult, and it even includes some chapters on how to structure content and how to write for different audiences, topics which are covered more in-depth in *Developing Quality Technical Information*. + + +#### Developing Quality Technical Information + +If you need a book to teach someone how to write technical documents, this is your Bible. I absolutely love this book (we have the first edition at work), and it is a must-read for all new and experienced writers. + +*Developing Quality Technical Information* covers three main aspects of technical authoring, each made up of three distinct characteristics which constitute _quality_ technical information: + +* Easy to use + * Task orientation + * Accuracy + * Completeness +* Easy to understand + * Clarity + * Concreteness + * Style +* Easy to find + * Organization + * Retrievability + * Visual effectiveness + +If you can master all of these, your documentation will be spotless. Each aspect is described in detail, with a plethora of examples. Every section of the book contains an one or more exerpts of fictituous documentation which goes through one or more rewrites to satisfy the requirements for a particular aspect. + +But by far the most useful feature of this book is the checklists at the end of every chapterm andI highly recommend printing them out and keeping them at end, at all times: Technical Writers can use them as reference while writing, whilr Editors and Managers can use them to evaluate/grade technical documents. + + +#### DITA Best Practices + +The primary goal of this book, as the title says, is to provide some *best practices* on writing using the DITA standard. However, do not fear: it does not assume any prior DITA knowledge and will walk you through the basic of topic-based authoring (and the threee main topic types: concept, task, and reference) then moving on to architecting content using DITAMAPS, content reuse, linking and conditional processing. + +This book will teach you all you need to know about DITA to write good documentation using the proper tags at the right time. Even if you (think that you) already know DITA, you'll definitely learn something new, like how to use the how to use the *toc*, *print*, and *printonly* elements as an alternative to conditional processing, or what to put in a *shortdesc* element. + +It does not go too in-depth when it comes to tools &ndash; that would be beyond the scope of the book &ndash; although it does mention [Information Architecture Workbench](http://www14.software.ibm.com/webapp/download/preconfig.jsp?id=2009-09-02+13:57:13.308214R&S_TACT=&S_CMP=) (open source, Eclipse-based) for modeling content via ditamaps and [XMetal](http://xmetal.com/) is always featured in all the code sample screenshots. + +### Format + +This ebook is available in EPUB format, and is optimized for the iPad. This shouldn't stop you from downloading it if you own a Kindle, it just means that you'll have to spend a few minutes converting it to AKV using [Calibre](http://calibre-ebook.com/). + +What you do loose when you convert the book bundle to another format is the videos that come with *DITA Best Practices* &ndash; which you wouldn't be able to play anyway. At that point, you may as well save a few bucks and get the [standard edition](http://www.informit.com/store/best-practices-for-technical-writers-and-editors-collection-9780132929653) instead, which doesn't include the videos. + + +### Conclusion + +If you have just been hired as Documentation Manager and you need three essential books that will govern how your team writes ad structures documentation following one of the leading XML documentation standards, this bundle is definitely for you (and for your writers and editors). + +Also, the fact that these three books are not merely glued together in one but contain handy cross references to each other is definitely a good thing &ndash; if you need *all three* books, that is. + +In my case, my company adopted the Microsoft Style Guide long ago, and our documentation has been written following *their* best practices and *their* stylistic conventions. Surely consulting another style guide doesn't hurt, but it may potentially generate some confusion especially with neophite writers. Furthermore, if your company does not plan to adopt DITA or uses another standard like [DocBook](http://www.docbook.org/), you won't really need *DITA Best Practices* either… + +In short, this is a great bundle if you really need all the three books, but if only need one or two, it obviously makes more sense to just get what you need separately. + + + +
A contents/articles/boolean-search.html

@@ -0,0 +1,7 @@

+----- +title: Understanding Boolean Search +content-type: article +timestamp: 1134215836 +tags: internet|google +----- +These days, it is necessary to use a search engines to find the information you want. When the World Wide Web was smaller, search engines weren't an essential websurfing tool, but once the Web started growing exponentially, and hosting literally billions of documents and files, even normal searches aren't enough to find important information, especially when it is not readily available. So, I'm going to show you a more powerful way to search.<strong>Learning how to search</strong><br /><br />Imagine yourself in the shoes of someone who has never used the Internet before. That's pretty rare nowadays, but it does happen. Take my dad, for example, who recently asked me something like "Where can I find a map of the Internet?". I explained that there wasn't any such thing because the Web is too dynamic to be mappable, and that's why we use search engines.<br /><br />I introduced him to Google [1], and he has since started to use search engines regularly. He didn't have much luck on his first few tries, but eventually he learned how to search properly.<br /><br />Searching the web is easy (just type in a word and hit enter), but finding stuff can be tricky, especially if you don't know enough about a subject to narrow your search down. Most people (including myself) tend to find what they're looking for only after multiple searches: we start with a general item, check the results, and restrict the next search based on what we learned from the previous one. While this is generally successful, every once in a while you will find yourself oging in circles.<br /><br />Let's look at a sample situation: I want to learn Ruby on Rails [2] and I want a free host to try it out. So, I go on Google and type something like: <br /><br /><em>ruby on rails free hosting</em><br /><br />I immediately find various blog entries referring to a project that aims to offer free hosting to try out the Ruby-based framework "Rails Playground". [3] It seems to be the perfect solution - they offer, completely free, enough space to try out Rails. It's a pity they recently decided to close new account registration, so now the whole thing is useless.<br /><br />Variants of the search query mentioned above bring up stuff related to Rails Playground. The project became so well-known that almost every Rails-related blog mentioned it at some point as the only place offering free hosting supporting Rails. Since it is useless now, is there a way to prevent Google (or other search engines) from displaying Rails Playground related results? Yes!<br /><br />You would need something like this: <br /><br /><em>rails free hosting -playground -railsplayground</em><br /><br />In this new query I excluded the words "playground" and "railsplayground" using a minus sign before them so I would find other results that didn't refer to the project. In the end, I didn't actually find any other free hosting that supported rails, but I did find the following: <br /><br />- a company which offers free rails hosting for testing purposes (until they officially launch their service) <br />- a guy who offered some space on his private server for testing rails (no longer available) <br /><br />Although I didn't find anything equivalent to Rails Playground, I didn't waste time either going in circles or scrolling through tons of pages trying to find something else. Actually, most people know how to exclude (or include) words in Google searches but they rarely do it. Furthermorte, most people don't know that there are many more search functions available on almost all the popular search engines. These functions, like the minus sign, are called Boolean operators.<br /><br /><br /><strong>A few words about Boolean algebra: </strong><br /><br />Boolean searches get their name from George Bool[4], the inventor of Boolean algebra[5], which is a particular algebraic structure involving three fundamental operators: AND, OR and NOT. If you attended any math class or course you should be already familiar with it. If not, here is a short summary of some of the concepts I will discuss in upcoming sections.<br /><br />Using Boolean searches (rather than Boolean algebra), the expressions A, B, C, etc. can be considered words, and "A &lt;Boolean operator B" can be considered search queries.<br /><br />- A AND B: pages must contain both words A and B.<br />- A OR B: pages must contain either the word A or the word B<br />- NOT A: pages must not contain the word A<br /><br />Trivial. Now let's see some more examples:<br /><br />- (A OR B) AND (NOT C): here I used brackets to create nesting, which causes expressions within brackets to be carried out before the rest, so the query means: "search for pages containing either A or B but which do not contain C".<br /><br />- (A OR (C AND D)) AND (NOT (F OR G)): similar but more complex than the previous: "search for pages containing either A or both C and D. Additionally, only F or G can be present, or neither of them".<br /><br />In some applications, like electrical circuits, NOR, NAND and XOR operators are also used to express Not OR, Not AND and eXclusive OR. As for search engines, only some of them support the XOR operator. A XOR B means that pages can contain either A but not B or B but not B.<br /><br /><br /><strong>Boolean search and Google</strong><br /><br />After reading this you might want to try typing Boolean expressions like "(food AND for) AND (cats OR DOGS) AND (NOT birds)" into a search engine, but that won't work. A Boolean expression typed "as is" rarely works on a search engine (it isn't supported because it's considered to be not user friendly enough). Google in particular adopted a more intuitive way[6] of performing Boolean searches. <br /><br />For starters, you almost always perform a Boolean search when searching something on Google simply because they decided (like most major search engines have) to automatically include the AND operator unless OR is specified.<br /><br />Searching the phrase "food for dogs" actually corresponds to "food AND for AND dogs" (using the proper Boolean expression). Presumably, this was done to prevent the search engine from delivering too many (and usually inconsistent) results. The other possibility (the default in MySQL's FULLTEXT boolean search[7]) would be to use the OR operator by default. Thus, searching for "food for dogs" might deliver results about food for cats, other pets, or even food in general. <br /><br />To improve the precision of their searches, Google also implements automatic exclusion for common words (like "for" in the example below). However, on occasion, a common word needs to be included in a search. To be fair,usually you will find what you are looking for, even with common words excluded. Nevertheless, to force Google to include a word, just add a plus symbol before it, like "+for".<br /><br />Similarly, a minus in front of a word (rails free hosting -playground -railsplayground) forces Google to exclude a word from the search query: in other words, the minus sign is Google's version of the Boolean NOT operator.<br />In order to transform the Boolean expression that I used at the start of this chapter - (food AND for) AND (cats OR DOGS) AND (NOT birds) - into a proper query accepted by Google, I have to write: "food for" "cats OR dogs" -birds. The OR operator <em>must</em> be specified, and anything in parentheses roughly corresponds to quotation marks because Google searches for the exact phrase enclosed in the quotation marks (also evaluating an OR operator, if present).<br /><br />The biggest limitation of Google when it comes to Boolean searches is the lack of support for nested expressions. Something like (food AND (NOT for)) AND (cats OR dogs) AND (NOT birds) cannot be translated into something like <em>"food -for" "cats OR dogs" -birds</em> because Google will not evaluate the "-" operator if it is enclosed in quotation marks. Something more complex like:<br /><br /><em>((food AND for) AND (cats OR DOGS) AND (NOT birds)) OR ((stuff AND for) AND (goats OR horses) AND (NOT (cows OR bulls)))</em><br /><br />cannot be translated into a Google-friendly query. Normal people probably won't ever do that complicated a search, but you never know...<br /><br /><br /><strong>All the other search engines, strategies and conclusions</strong><br /><br />There are various articles (see [8][9][10]) about how Boolean search has been implemented in various major search engines and AltaVista[11], AlltheWeb[12] and MSN Search[13] seem to support Boolean search features better than Google. All of them support the standard Boolean operators, as well as the "+" and "-" symbols, but apparently only MSN Search[13] seems to support full Boolean search queries with nesting: I actually managed to execute my previous complex example: <br /><br /><em>((food AND for) AND (cats OR DOGS) AND (NOT birds)) OR ((stuff AND for) AND (goats OR horses) AND (NOT (cows OR bulls)))</em><br /><br />and I got some decent results. The only (understandable) exception is that I had to specify +for to have the word "for" included.<br /><br />Although Boolean search is useful, it is not the only way to get relevant results as quickly as possible. Additional thinking is required to prepare a query properly. In everyday life, you won't really use heavily nested queries, simply because other methods are more effective. If you're interested in learning how to search I'd recommend a very informative article available at Waikato University[14].<br /><br />I found out that a mix between making multiple search attempts and using basic Boolean queries (word exclusion in particular) can deliver pertinent results fairly readily. Suppose you've heard something regarding a person named Halley who contributes to an IT-related community and that someone mentioned the word "kernel" when talking about him, and you remember that it wasn't referring to Linux. You could come up with something like: <br /><br />Halley kernel -Linux<br /><br />Et voila': Halley's CyberArmy Profile[15] appears as the first search result in Google! If you typed just <em>Halley</em> you wouldn't have found the right one right away; you would probably get more information about the Halley's Comet or the astronomer Sir Edmund Halley. If you typed <em>kernel Halley</em> you'd have found something about Kernel Halley on zZine first and then on CyberArmy lower down in the search results.<br /><br />Boolean search can be useful, but it must not be abused. Google's decision to implement only partial Boolean support without standard Boolean operation was probably the best choice to achieve both pertinent results and user-friendliness. <br /><br /><strong>Notes and further resources</strong><br />[1] Google Inc.: <a href="http://www.google.com/">http://www.google.com/</a><br />[2] Ruby on Rails framework: <a href="http://www.rubyonrails.org/">http://www.rubyonrails.org/</a><br />[3] Ruby Playground: <a href="http://www.railsplayground.com/">http://www.railsplayground.com/</a><br />[4] George Bool, Wikipedia Page: <a href="http://en.wikipedia.org/wiki/George_Boole">http://en.wikipedia.org/wiki/George_Boole</a><br />[5] Boolean Algebra, Wikipedia Page: <a href="http://en.wikipedia.org/wiki/Boolean_algebra">http://en.wikipedia.org/wiki/Boolean_algebra</a><br />[6] Google Help on Advanced Search: <a href="http://www.google.com/help/refinesearch.html">http://www.google.com/help/refinesearch.html</a><br />[7] MySQL FULLTEXT boolean search: <a href="http://dev.mysql.com/doc/mysql/en/fulltext-boolean.html">http://dev.mysql.com/doc/mysql/en/fulltext-boolean.html</a><br />[8] Search engines that implement boolean search (outdated): <a href="http://searchenginewatch.com/facts/article.php/2155991">http://searchenginewatch.com/facts/article.php/2155991</a><br />[9] Boolean Searching on the Internet: <a href="http://library.albany.edu/internet/boolean.html">http://library.albany.edu/internet/boolean.html</a><br />[10] How to choose a search engine or directory: <a href="http://library.albany.edu/internet/choose.html#logic">http://library.albany.edu/internet/choose.html#logic</a><br />[11] AltaVista Special Search Terms: <a href="http://www.altavista.com/help/search/syntax">http://www.altavista.com/help/search/syntax</a><br />[12] AlltheWeb Query Language: <a href="http://alltheweb.com/help/faqs/query_language#2">http://alltheweb.com/help/faqs/query_language#2</a><br />[13] MSN Search: <a href="http://search.msn.com/">http://search.msn.com/</a><br />[14] "The Assignment Process: Search Strategies": <a href="http://www.waikato.ac.nz/library/learning/g_strategies.shtml">http://www.waikato.ac.nz/library/learning/g_strategies.shtml</a><br />[15] Halley's CyberArmy Profile: <a href="http://www.cyberarmy.net/~Halley/">http://www.cyberarmy.net/~Halley/</a><br />
A contents/articles/cakephp-first-bite.html

@@ -0,0 +1,7 @@

+----- +title: The CakePHP Framework: Your First Bite +content-type: article +timestamp: 1152842580 +tags: cakephp|tutorial|review +----- +<p>According to a recent study, <span class="caps">PHP</span> is one of the most popular programming languages in the world. In spite of this, <span class="caps">PHP</span> is often criticized for its inconsistent naming conventions, its lack of important features as compared to other languages (like namespaces) and its inherent disorganization. Furthermore, <span class="caps">PHP</span> is very easy to learn, and this has often led to the common misconception that most <span class="caps">PHP</span> developers are inexperienced and that their code is therefore prone to security vulnerabilities and exploits.<a href="http://www.sitepoint.com/article/application-development-cakephp">Read the full article</a> on <a href="http://www.sitepoint.com/">SitePoint.com</a></p>
A contents/articles/cakephp-overview.html

@@ -0,0 +1,8 @@

+----- +title: An overview of the CakePHP framework +content-type: article +timestamp: 1148997020 +tags: cakephp|review|tutorial +----- +<p><em>&#8220;There are many frameworks available for the <span class="caps">PHP</span> programming language nowadays, and especially a lot of <span class="caps">RAD</span> (Rapid Application Development) frameworks which aim to make web development faster, less tedious and more organized. CakePHP was one of the first frameworks to port the <span class="caps">RAD</span> philosophy &#8211; which became so popular after Ruby on Rails &#8211; to the <span class="caps">PHP</span> programming language. CakePHP v1.0 is now one of the most popular and intuitive solutions for <span class="caps">PHP</span> programming, let&#8217;s discover why&#8230;&#8221;</em></p> +<p><a href="http://hades.phparch.com/ceres/public/article/index.php/art::cakephp::overview">Read the full article</a> on <a href="http://hades.phparch.com/artemis/main/">php|architect article repository</a></p>
A contents/articles/cakephp.html

@@ -0,0 +1,7 @@

+----- +title: CakePHP - A 'tasty' solution for PHP programming +content-type: article +timestamp: 1134057819 +tags: cakephp|review|frameworks|webdevelopment +----- +Web developers can either love or hate PHP, and one of the criticisms of this easy-to-use programming language which is repeated over and over on IRC, forums and blogs is that "PHP is disorganized".<br />Is this really true? If so, is there any possible way to write a PHP application in a logical and clean way? Read on...Every web developer has certainly heard of PHP. Some people like it and consider it a powerful and easy-to-use way to create complex websites or web applications, while others are convinced that it is merely a bad copy of Perl. Opinions are certainly mixed on the matter.<br /><br />One thing to keep in mind when reading criticisms of PHP is its origins, as therein lies the crux of the matter. PHP was created as a form interpreter, initially offering only a <em>very limited</em> range of functionality. Its main purpose was to make life easier for web developers who wanted to do simple tasks, like manipulating form data.<br /><br />People liked the concept - PHP was free and it quickly became popular among developers. More functionality was added and continues to be added with each new release, and PHP is now one of the most popular and powerful programming languages available for web development.It is relatively easy to learn, compared to Perl, ASP, or JSP, and it can be used for almost anything[1].<br /><br />The sheer simplicity of the language was most likely the cause of the enormous amount of exploits discovered through the years which earned PHP the label "<em>too dangerous to use in 'proper' applications</em>". The danger, however, lies not in the language itself, but rather in the <em>way</em> developers make use of the language: PHP's simplicity makes writing bad or exploitable code extremely easy. Furthermore, PHP's ability to be placed within any HTML page with the greatest of ease tempted developers to write ever-increasing amounts of 'spaghetti code', which by its very nature is neither organized nor clean code, and certainly does not help a developer learn how to write organized or clean code.<br /><br />These problems, however, can be solved. There are many ways to go about doing this, but the easiest, most effective way is to create a framework[2]. <br /><br /><br /><strong>Bringing Order to Chaos</strong><br /><br />After learning some PHP myself, I remember noticing that my applications were growing in a disorganized and uncontrollable manner. Things tended to be added at the last minute, and bugs were fixed and patched 'on the fly' wherever they occurred. PHP lacked the structure that is present in most other programming languages. I remember reading the word <em>framework</em> for the first time not too long ago while I was downloading a Windows Update of the .NET framework[3]. That inspired me to start searching the Internet for a 'PHP framework'. That led me to an interesting blog entry[4] where a solution was proposed - a solution to <em>bring order to chaos</em>:<br /><br /><fieldset><blockquote><br />[...] The answer is simple: create our own class library, some kind of framework, the PHP framework. The similar in many ways to that one which is already well known to Java or .NET programmers. We could set the standards, structure and main guidelines. [...]<br /></blockquote></fieldset><br /><br />That blog post made me think about developing my own framework, until I noticed that there were many projects already in progress, and some in fact completed; the end result being a fully functional PHP framework. I read a lot about some of them[5], and abandoned the idea of developing my own, because as a good developer, I believe I should never re-invent the wheel. So I kept looking. I found Pear[6], although that's more a repository of PHP classes with a common standard than a framework, while I was looking for THE solution to developing many types of applications, not merely how to do one thing in particular.<br /><br />I came across a very promising project named Prado[7], which won the latest Zend contest, and was considered the best PHP5 application of the year. It is a masterpiece of coding and PHP5 usage, so I tried to learn it. I even developed a website with it.<br /><br />Prado lets the developer design the application without imposing any ready-made components, but I found its event-driven[8] approach neither easy to learn nor suitable for everyday web applications. I did not like the idea of having to code a reaction to every event (like a click on a button or different phases of page rendering): that is the approach that ASP takes, and at least in that respect, Prado seems to be inspired by the .NET framework. Event-driven programming is suitable for GUI development and desktop-based interfaces, but not for web applications.<br /><br />After trying Prado, I was still unsatisfied, so I once again began my search for a solution to improve my programming. My meanderings took me to Ruby on Rails[9], one of the most recent examples of technology hype on the Net. At the same time,to a certain extent, it is also a successful tool. <br /><br /><br /><strong>The Rails Phenomenon</strong><br /><br /><fieldset><blockquote><br />"Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups."<br /></blockquote></fieldset><br /><br />That sounded like what I was looking for, and I started reading more about it in the vast and varied help sections[10] available both on and off of the official site. The Rails team did an outstanding job promoting and marketing the framework, and also in providing comprehensive textual documentation (and even video tutorials) to help both beginners as well as experienced programmers get started with it.<br /><br />Briefly, Rails uses Ruby's object oriented programming, in conjunction with the MVC pattern and various automated scripts (generators), to help developers program their applications quickly and in a solid and organized way. However, as that is neither clear nor convincing, let's spend a few moments on the MVC Pattern[11], which will also be useful to understanding the following sections.<br /><br />MVC stands for <strong>M</strong>odel <strong>V</strong>iew <strong>C</strong>ontroller: these three words enclose - and this is just a personal opinion - all the wisdom and philosophy of web development, describing - once again, in my opinion - the three most logical parts a web application <em>should</em> be divided into to achieve code robustness, order and power, all at the same time. Let's look at what each of the component parts mean in detail:<br /><br /><ul><br /><li>Model: The model represents the very essence of the </li><em>information</em> and <em>content</em> of a web application. Imagine this as an object able to gather the information and content of your webpages from a particular resource, such as a database. The model is the only entity able to access resources.<br /><li>View: The view is an attempt to separate the most unstable part of an application: the user front-end. A view is only responsible for presenting the information that the Model gathered. A view does nothing but format the output, and can be compared to a template or report. In all MVC frameworks for web applications, only view files contain </li>(X)HTML code, and mostly only that. They can therefore be changed <em>at any time</em> without having to touch a single line of the business logic of your application.<br /><li>Controller: The controller is the 'brain' of the application. Consider it to be the only part of your program that can 'think' and manage the other parts. Controller files are the only ones able to </li><em>order</em> the Model to gather information and then pass the information obtained to the view for display. <br /></ul> <br /><br />Although the MVC seems to make things more complicated, that is part of the objective. Since one of the advantages (and weaknesses) of PHP was its simplicity, the MVC adds complexity to bring more order and logic to the design process. The three entities are separated for just that reason, and trying to put them together can result in potential disasters, since it causes the whole pattern to fail.<br /><br />Coming back to Rails, I was quite impressed by the features it offered, but there was a small problem: the Ruby programming language itself. I experienced some difficulties in setting up the environment properly, and I also discovered that most standard hosting companies do not offer Ruby hosting plans as standard. Hosting issues aside, I would have had to learn Ruby in order to master Rails, and I really did not have the time for that: I had to develop a website quickly and easily, preferably with languages I already knew.<br /><br />After deciding to abandon Rails (for the moment, anyway), I was amazed by the number of projects in other programming languages that try to emulate the famous Ruby framework, to the point of being considered <em>clones</em> or ports of it to another language. To my knowledge, the <em>Rails disease</em> contaminated the following programming languages:<br /><br /><ul><br /><li>PHP</li>[12]<br /><li>Python</li>[13]<br /><li>Java </li>[14]<br /><li>Perl </li>[15]<br /></ul><br /><br />I said <em>disease</em> because Rails developers think that Ruby on Rails was made in Ruby for a reason, namely that Ruby offered some unique features that were not available in other languages. I will not delve into that topic here; more information is available[16] for those who are interested. However, suffice it to say that there are some Rails ports in PHP that were immediately attacked because of the fact or legend that the creator of Rails originally wanted to develop his framework in PHP and then switched to Ruby. Let's examine one of those PHP frameworks in detail.<br /><br /><br /><strong>CakePHP: Just Another Rails Clone?</strong><br /><br />I chose to learn CakePHP (or "Cake")[17] mainly because it offered more features than the other two PHP alternatives. It also seemed to be a more original and actively developed project. In particular, I'd like to quote one of CakePHP's developers, from when he introduced the framework in a comment to a blog post[16]: <br /><br /><fieldset><blockquote><br />"While it's difficult to copy Rails in PHP, it's quite possible to write an equivalent system. I like the terseness of Ruby code, but I need the structure that Rails provides, how it makes me organize my code into something sustainable. That's why I'm ripping off Rails in Cake."<br /></blockquote></fieldset><br /><br />Cake's developers (bakers?) are developing their own framework which uses many principles of Ruby on Rails, revisited and re-proposed in an extremely flexible and easy to use PHP tool, rather than simply trying to port Rails to PHP. I also liked the fact that they bothered to choose an original name for their project, unlike others: there are too many "<insert language here>-on-Rails" frameworks, and while the whole "Rails" thing is innovative and catchy the first time, it loses its appeal quickly when people use the word everywhere just because it is "fashionable".<br /><br />Quoting from CakePHP's website:<br /><br /><fieldset><blockquote><br />"Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility." <br /></blockquote></fieldset><br /><br />That sounds like the Holy Grail for PHP developers, and I must admit I'm quite impressed myself after using it on various little projects, but is it really all true? What are Cake's features? Are there any limitations?<br /><br /><br /><strong>The Ingredients</strong><br /><br />So what is Cake? In the previous sections, I introduced some general concepts and ideas common to Ruby on Rails and CakePHP, but nothing in particular was said about the structure of the framework itself. Let's now turn to that and discuss it in some detail, particularly as it pertains to Cake.<br /><br />The first thing to understand about Cake (and Rails as well) is that one of their aims was to avoid editing long and complex configuration files in order to run the environment. The approach in this sense is to use <em>conventions</em> over <em>configuration</em>. This may sound terribly restrictive, but in reality it proved to make things much simpler. After all, I said I wanted to use a framework because I needed a solid structure to base my applications on, not that I needed to be able to create and personalize my own structure and system. Cake uses some simple rules in order to run properly, and the easiest way to explain them is through Cake's directory structure, which represents the skeleton of every CakePHP application.<br /><br />/<br />---app/<br />------config/<br />------controllers/<br />---------components/<br />------models/<br />------plugins/<br />------views/<br />---------elements/<br />---------errors/<br />---------helpers/<br />---------layouts/<br />---------pages/<br />------webroot/<br />---------css/<br />---------files/<br />---------img/<br />---------js/<br />---cake/<br />------config/<br />---------inflections/<br />------docs/<br />------libs/<br />---------controller/<br />---------generator/<br />---------model/<br />---------view/<br />------scripts/<br />---tmp/<br />------cache/<br />------distro/<br />------logs/<br />------tests/<br />---vendors/<br /><br />I expanded only the first three levels of the tree, although there are more levels in the <em>/cake/</em> directory. They won't be considered here simply because the <em>/cake/</em> directory contains CakePHP's internal libraries, which normally will not be modified when developing an application. The <em>/tmp/</em> directory also will not be elaborated upon either, because it is only used to store temporary files. However, the <em>/vendor/</em> directory should contain third party scripts and libraries that you may want to use in your application, but they are not normally integrated with Cake's framework. 95% of your application will reside within the <em>/app/</em> directory, which we therefore need to examine in greater detail.<br /><br /><span style="text-decoration:underline;"><em>/config/</em></span><br />When I said that Cake strives to use conventions over configuration, I really meant it. This directory does not contain thousands of configuration files, only five very small ones. They represent the only items which <em>might</em> need to be configured. <br /><br /><ul><br /><li>acl.ini.php: This file must be edited only if you plan to use Cake's default ACL </li>(access control list) system for your application. It sets permissions for the application, so it should be used to list every group, user, and their respective rights. This can be useful for small sites with a few well known users, but for anything else, you should develop your own ACL or authentication system that relies on a database. <br /><li>core.php: This file can be edited to change some default options, such as the level of the error messages and notices that the application will output. This comes in very handy while developing an application.</li><br /><li>database.php.default: This should be renamed to database.php and edited if you plan to use any databases with Cake. The settings are fairly straightforward, and include the type of database used </li>(mysql, postrgres, sqlite, or any other supported by the AdoDB library[18]), username, password and database name.<br /><li>paths.php: Unless you are very particular, you should leave this file alone. It tells Cake where to look for CSS files, images, controllers, etc. If you are planning to adopt Cake's directory structure - which is the most logical option - you can ignore this.</li><br /><li>routes.php: Following Rails' example, CakePHP features a "routing system" for user-friendly URLs. By default, your URLs will look like this: </li><em>http://sitename/controller-name/action-name/eventual/action/parameters</em>, which is a really nice way to organize a site, but you may want to change something if you have particular requirements. <br /></ul><br /><br /><br /><span style="text-decoration:underline;"><em>Controllers</em></span><br />As mentioned previously, a controller represents the "brain" of the MVC pattern, the part which controls what the other parts are doing. Imagine a controller like a section of your site: its name will be present on the address bar, and each of these sections will have a file named <something>_controller.php, and will also contain a class named SomethingController that extends the AppController class. This class will have some methods that correspond to some standard actions like <em>index</em> (the default action called when you access the <a href="http://sitename/controller/">http://sitename/controller/</a> page) or other user-defined ones like <em>add</em> or <em>list</em> or <em>admin</em>, depending on the application. As a general rule, you want to add any 'business logic' you want to implement in your application in controllers - for example, calculations or a database query that produces a result. <em>Then</em> once all the mess is done, the result (usually an array or a variable) is passed to the view (see <em>views</em> below). <br /> <br />If this is starting to sound too technical for you, I recommend reading a tutorial[19] available on the CakePHP website about creating a simple blog application. The tutorial will explain most of Cake's basics, including how to pass a variable from a Controller to the corresponding view <em>($this-set('variableNameInView', $variable))</em> and other useful things.<br /><br />Recently <em>Components</em> have been added to CakePHP, and quoting from the corresponding wiki page[20]:<br /><fieldset><blockquote><br />"Components are the preferred way to provide additional functionality to your controller. To make a component available you would add var $component = array('myComponent') inside of your controller's definition, add your file to the /app/controllers/components, name your class MyComponent, and create your methods."<br /></blockquote></fieldset><br /><br /><br /><span style="text-decoration:underline;"><em>Models</em></span><br />A model is an object able to access the database. In Cake's terms, that is any class extending the AppModel class. That class is directly under the <em>/cake/</em> directory (along with the previously mentioned AppController class), and can be moved to the <em>/app/</em> directory and modified if you want to add some particular site-wide behavior to it which will be inherited by all models extending it.<br /><br />In even simpler terms, you need to create a Model class for every table you're planning to use in your database. A convention in Cake says that database table names should be plural and that the corresponding model should be singular. If you use a table named 'mice', your model should be named 'mouse': Cake is smart enough to understand irregular plurals through an <em>Inflector</em> class.<br /><br />Creating a model class for basic use is trivial:<br /><br /><br />class Post extends AppModel<br />{<br /> var $name = 'Post';<br />}<br /><br /><br />Then you'll be able to access the model (and therefore the database) from a controller via simple instructions like $this->Post->findAll(). This instruction will query the database and return all records within the Posts table in your database. You can also perform more complex operations, and also specify SQL queries to execute, if you need to, but remeber that models can only be accessed through controllers! If you need some information stored in your database to be displayed on a view, execute the query from the controller and pass it to the view as per the MVC pattern. It can prevent you from cluttering views with business logic and thereby making code updates much harder.<br /><br /><br /><span style="text-decoration:underline;"><em>Views</em></span><br />Views are used to present information gathered with a model and a controller to the public. They are mostly HTML pages with some PHP tags in them, prints of variables and maybe some <em>foreach</em> loops. Nothing more than that should be used in a view!<br /><br />Views must be placed in this directory and obey the following conventions:<br /><br />1. They must be named after a controller's action to allow the controller to refer to a particular view automatically. The same view can be used by multiple controllers, but it must be either set manually or through a layout (see below).<br />2. Views referring to an action of a particular controller must be placed under a subfolder named after the controller.<br />3. All views must have a .thtml extension.<br /><br />Any site-wide view, like the site's template, must be placed under the <em>layouts</em> subfolder. In particular, the default.thtml file in the folder represents the global template for your application: page titles and specific pages (views) will be invoked automatically by using $title_for_layout and $content_for_layout respectively.<br /><br />Similarly to what was said about components, <em>helpers</em> can be used to extend views functionalities[20]:<br /><br /><fieldset><blockquote><br />"Helpers are all about the view. You know about the helpers in Cake, but you need a little bit more. You want to have your own methods to display formatted info. To achieve this, you need to add var $helpers = array('myHelper').<br /><br />Now, throw your myhelper.php file into the /app/views/helpers/, create the class MyHelper, and $myHelper is available in the view." <br /></blockquote></fieldset> <br /><br />Cake comes with some very useful default helpers to create links and HTML tags, import JavaScript, create forms, and use AJAX code easily. Unlike most other frameworks, Cake neither has nor uses a third party template engine (like Smarty[21]) for views, but helpers can be used to achieve similar results more quickly than an engine can.<br /><br /><br /><span style="text-decoration:underline;"><em>Plugins</em></span><br /><br />Plugins are user-developed enhancements for Cake. Unlike the files placed under the <em>vendor</em> directory, a plugin is an application specifically made to be used within the CakePHP environment. At the moment this feature is still under development.<br /><br /><span style="text-decoration:underline;"><em>Webroot</em></span><br /><br />If you read carefully what I wrote above about routes, you might be wondering if <em>every</em> page must have a controller and a view in order to be displayed properly. What about images, JavaScript and CSS files? The answer is this directory: everything you place here will not be seen as part of the MVC-based environment; CSS files can be stored in the <em>/css</em> folder, Javascript under <em>/js</em>, and so on. Additionally, some helpers can provide a easier way to access or display images, scripts, CSS, etc.<br /><br /><br /><span style="text-decoration:underline;"><em>Other Features</em></span><br />Cake offers even more than this; the latest releases have introduced a few more Rails-inspired features:<br /><br /><ul><br /><li>Scaffolding: Do you want to test your application without spending time writing all the CRUD </li>(Create, Read, Update, Delete) code? That's where the concept of scaffolding comes in: by setting a few variables in the right places[22], Cake will generate basic mechanisms to add, edit, list, and delete records in your database, along with all the associated view files. You won't have to code a single form, as everything will be generated automatically by the framework according to SQL field types.<br /><li>Bake: Another Rails-inspired feature revisited in PHP. Rails uses a set of scripts and in particular the </li><em>rake</em> utility to instantaneously create the foundation for a Rails application with scaffolds already in place. CakePHP offers the same functionality through the <em>bake</em> utility, which is currently available as either a batch file or a PHP script.<br /><li>ACL: As previously mentioned, Cake comes with a ready-made Access Control List </li>(ACL) system, which can be extended and used to restrict particular areas of a Cake application to certain users or user groups.<br /><li>Compatibility: CakePHP is fully compatible with both PHP and PHP5.</li><br /></ul><br /><br /><br /><strong>Meet the Bakers</strong><br /><br />After reading all these things about CakePHP and its framework, you may have some questions, or be curious about some aspect of the project. PHPNut and gwoo, two of CakePHP's creators and lead developers, offered to answer some questions exclusively for zZine readers. This interview took place on Oct. 26th, 2005, in #dev-cakephp on irc.freenode.org.<br /><br /><em><span style="text-decoration:underline;">h3rald</span>:</em> Thanks to both of you for allowing me to interview you about your project, CakePHP. Where did the name come from, anyway?<br /><br /><em>PHPnut:</em> The original project was started by Michal Tatarynowicz aka Pies (hence the name), and when I saw his release, last March, I decided to contact him. I told him that the company I own supports projects like Cake, and also that I was in the process of developing something along the same lines. <br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Is Cake released under the GPL? How many developers are helping out?<br /><br /><em>gwoo:</em> Cake is released under the MIT license, and the development team is composed of me and PHPnut, plus four other contributors. Then there's the Documentation Team, currently 3-5 people. Documentation has to follow the releases, so it usually lags behind a bit: we made so many modifications in the recent release that the Doc Team has a lot to catch up on, but it's getting there.<br /><br /><em>PHPnut:</em> With this release you will see that the docs are going to be much better. The code is very stable now, and hopefully very little changes on that.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Some people, at first glance, may think that Cake is a PHP port of Ruby on Rails. How true is that? What are the differences and similarities between these two frameworks?<br /><br /><em>PHPnut:</em> Cake started as a port, but has evolved into something more: we discussed using the concepts that RoR offered and including them in a framework for users of PHP. I have used PHP for a number of years, and I am comfortable with it; this is where my passion is, and I think people who use Cake have those same passions as we developers do.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> I read once that Rails was developed in Ruby because only Ruby can offer certain functionalities and features...<br /><br /><em>gwoo:</em> I would disagree, and I think that is proven in what we have done: sure RoR has a built in server and some other nice things, but PHP is everywhere.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Some developers, especially Perl programmers, tend to consider PHP an "inferior" language sometimes. What do you think of that?<br /><br /><em>PHPnut:</em> My name says what I think about them all.<br /><br /><em>gwoo:</em> PHP is a web programming language; that's what it was designed for, and that's what it does best: It all boils down to what you are comfortable with.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Did you try any other PHP frameworks, MVC-based (Mojavi, for example), or event-driven, like Prado? What do you think about them? In what ways can Cake be better or worse?<br /><br /><em>gwoo:</em> They are all so complex, in my opinion, and I tried nearly all of them. Cake breaks apart the MVC and handle the CRUD in a logical way, and Cake syntax is super easy to learn.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Ruby on Rails has been ported to various languages, including Java and Python. There are three PHP frameworks inspired by the famous Ruby project: Biscuit, PHP on Tracks and CakePHP. What do you think of that? Any chance of a merge? Did you have a look at them?<br /><br /><em>gwoo:</em> You forgot Symfony[27], a PHP5-only port: I tried it but it seems much harder to learn than Cake.<br /><br /><em>PHPnut:</em> I could be wrong, but I think these other projects are behind us in ease of use, in what the framework is capable of doing, and in features, not to mention community support.<br /><br /><em>gwoo:</em> I tried all of the PHP ports of Ruby on Rails and none of them has the features, the community,or a lexicon as good as Cake's.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Why don't you consider CakePHP a port? In what way is it evolving from Rails?<br /><br /><em>PHPnut:</em> Rails and CakePHP share a lot: MVC pattern, Active Record pattern...but we're not strictly following Rails, and we're able to think by ourselves. Recently we changed the directory structure, and in my opinion our is more functional than the Ruby on Rails one.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> What can Cake be used for? What kind of projects? Are there any limitations?<br /><br /><em>gwoo:</em> Personally I think that Cake is the most extensible framework out there for PHP: with components, helpers and vendor access you can do anything you want!<br /><br /><em>PHPnut:</em> We are limited only by what a web server (generally Apache, but IIS seems to work as well) and a database can do. We may be limited by PHP itself, but we twist that in our own little sick ways sometimes.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Any thought about AJAX? I saw some nice demos made with Cake. What do you think of this new trend in web development? Some people consider it the future, while others are concerned about compatibility, and still others are relatively indifferent to it. What about you?<br /><br /><em>gwoo:</em> AJAX can be very useful in creating an application, but should not be overused. People have become very comfortable with how the Web works:i f you start doing tons of drag and drop and no refreshes, users will feel lost in how to operate the site.<br /><br /><em><span style="text-decoration:underline;">h3raLd</span>:</em> Thank you very much for your time, both of you. Is there anything you'd like to add to this interview? Something you'd like to say to users interested in trying out Cake?<br /><br /><em>PHPnut:</em> Come and enjoy: we are here to help...<br /><br /><em>gwoo:</em> ...And plan to be here for a very long time!<br /><br /><br /><strong>Let's cook...</strong><br /><br />One of the most positive things about CakePHP is that even though it is a fairly new project (most of the code is 100% useable already,but they still consider the projectto be in the 'alpha' stage), it's maintained by many dedicated developers and PHP enthusiasts. I was amazed to see how the whole documentation evolves and is quite literally updatedon a daily basis. <br />Anybody can contribute to the framework or simply test it and share their experiences.<br /><br /><span style="text-decoration:underline;"><em>CakePHP Wiki</em></span><br /><br />Anybody can register an account for free and contribute tutorials and documentation to the new CakePHP Wiki[23]. This is currently the most up-to-date source for documentation files and tutorials.<br /><br /><span style="text-decoration:underline;"><em>CakePHP User Group</em></span><br /><br />If you need assistance or you want to contact the Cake developers or other Cake users, you can post a message on their Google User Group[24]: people will reply with useful comments, usually on the same day, and the developers <em>do</em> listen to user suggestions.<br /><br /><span style="text-decoration:underline;"><em>CakePHP IRC Channel</em></span><br /><br />If you want to offer (or receive) real-time assistance, feel free to join #cakephp on FreeNode (irc.freenode.org). I went there disguised as a total newbie (it wasn't much of a stretch) and they helped me a lot, explaining basic concepts of the framework and pointing me to the right documentation files.<br /><br /><span style="text-decoration:underline;"><em>CakePHP Development</em></span><br /><br />Experienced PHP developers are more than welcome to contribute to the project. People may be accepted to the core development team if they have sufficient knowledge and spare time, or alternatively,components or code can be submitted through the newly created CakeForge[24]. <br /><br /><br /><strong>...Or Just Eat</strong> <small><em> by Marc Abramowitz</em></small><br /><br />If you don't feel ready to contribute and you'd like to try out the framework first, it can be downloaded directly from the CakePHP site[25] as either a <em>release</em> or a <em>nightly</em> build: the zip file is less than 300KB.<br /><br />I wanted to include a <em>success story</em> written by Marc Abramowitz, an experienced PHP programmer who decided to adopt CakePHP as a framework to use in a production environment: he persuaded his colleagues to use it and they all seem happy with it. He writes:<br /><br /><em>For the past few years, I've done quite a bit of work in PHP, working on production code that runs on a very high traffic web site. PHP has served us well, as it is easy to write and read, quite efficient, and easy to integrate with existing C++ code as the site grew.<br /><br />Lately, there has been a lot of buzz in the web development community about Ruby on Rails. Like many others, I took some interest in Ruby on Rails because I was intrigued by the apparent power and elegance of Ruby and because I wondered if a Model/View/Controller (MVC) framework like Rails would help enforce a more consistent code structure that would make the code easier to understand and maintain. Additionally, I wondered if an MVC framework would enable very rapid prototyping.<br /><br />Some people are very wary of frameworks that impose structure, as they like to have the freedom to do things however they want. However, there is a tradeoff between structure and flexibility. If you're working on a small team or a relatively small project, then you may not find structure to be very helpful; you may even find that it gets in your way. <br /><br />However, as teams and projects get larger, structure becomes more and more valuable, as it enforces consistent patterns of how to do things and rather than being something that limits, it in fact liberates, because it abstracts away the small details and allows us to therefore concentrate on the larger problem. Think of the lines that are painted on our roadways - although they add structure, we don't find them to be limiting. On the contrary, they help us to drive without worrying about crashing into each other at every moment - they free us from being concerned with small details so that we can concentrate on getting where we're going.<br /><br />Rapid prototyping appeals to me, because I find it helps me to better present my ideas for new apps and features. A mockup can only go so far - there is no substitute for a working prototype. When clients get their hands on a functional prototype, they get a better idea of what is possible and it forces them to clarify their requirements for the product. This results in a better dialogue between the developer and the client, which leads to better upfront decisions, more stable requirements, less stress, and a better product.<br /><br />So, Rails appealed to me not only because of the potentially valuable structure that it could add, but also because it could enable rapid prototyping. However, I knew that there was no chance of Rails being used for production code in my organization, because we run some very high traffic web sites that require the utmost in efficiency. We are also by and large a PHP shop.<br /><br />However, when my manager approached me and asked me to develop a database-backed internal tool, I thought of Rails again. I then considered the fact that I would probably someday have to hand this app off to someone else, and that someone would probably know PHP but not Ruby. Heck, even I had several years of experience with PHP (including writing some PHP extensions) but I had only done a little bit of reading about Ruby, and I also had no practical experience with it.<br /><br />Furthermore, with PHP I had access to a large number of PHP extensions that wrapped various internal libraries. So PHP was the natural choice. Ideally, I wanted to use PHP with a Rails-like MVC framework that would facilitate rapid development, and this is what led me to CakePHP.<br /><br />I began by downloading CakePHP 0.9.2 and following the sample tutorial that walks you through creating a simple blog application (note that at the time of this writing, the current version of Cake is now 0.10.0.1076, so some of the details of using Cake have changed). I was pleased to find that the process was quite similar to the process for Rails. One difference that I noted was that Rails tutorials always emphasize using scripts to generate models, controller, and scaffolds, whereas the Cake tutorial walked me through explicitly writing out all the code. I noticed that the Cake download came with a script called "bake" which looked like something that could potentially do some of the code generation, but since it wasn't mentioned in the tutorial, I chose not to use it.<br /><br />The process of creating a first application using the tutorial was quite easy. Here are the steps in brief (consult the tutorial for more details):<br /><br />1. Create the database table. Cake requires tables to have some extra<br />fields:<br /> - id, an auto_increment primary key<br /> - created, a datetime<br /> - updated, a datetime<br />2. Configure Cake to access the database by editing the config/database.php file<br />3. Create a model class which extends AppModel (a Cake provided class)<br />4. Create a controller class which extends AppController (a Cake provided class) and write one or more controller methods<br />5. Create a view which is a PHP file with a .thtml extension and is meant to be mostly HTML with very little embedded PHP - typically just echoing of variables and some simple control structures like <em>foreach</em>.<br />Cake also provides some simple convenience methods that write out certain HTML constructs for you.<br /><br />That's it! That alone is enough to create a basic but functional application. The tutorial goes on to show you how to add additional functionality to the blogging app. After that there's a shorter, more advanced tutorial that shows you how to add a few more things to the blogging app.<br /><br />Once I had gotten comfortable with Cake by following the tutorial, I proceeded to write my own application. Getting started was easy - I followed the same steps as in the tutorial to create my first table, model, controller, and views, then my second table, model, controller, and views. Then my app got a bit more complicated. I needed to have many-to-many relations and more elaborate queries than the default ones that Cake provides. I began to worry that Cake would break down here. I had heard people grumble that MVC frameworks like Rails and Cake were great for little toy apps that only do CRUD (Create, Read, Update, Delete), but that they couldn't handle complex queries using joins and the like. I poked around in the Cake source code and was pleased to find that there were nice lower level methods that allowed me to bypass the Cake defaults and do whatever custom queries I liked. For example, I wrote something like this in one of my models:<br /><br />function index(){<br /> return $this-findBySql(<br /> "SELECT id, title, AVG(rating) avg_rating, MIN(rating) min_rating, MAX(rating) max_rating, COUNT(rating) num_ratings " .<br /> "FROM ideas LEFT JOIN ratings ON ideas.id =<br />ratings.skill_id " .<br /> "GROUP BY id " .<br /> "ORDER BY title");<br /> }<br /><br /><br />So what I have is a model that does <em>not</em> have a one-to-one mapping with a single table. It actually retrieves data from more than one table.<br /><br />Over time, I picked up a few more Cake concepts. For example, at some point we decided that every page of the app would have a similar look and feel with a particular masthead and logo, and all the pages in one section of the site would show tabs for all of the various views with the currently selected tab highlighted. At first, I just used the same code at the top of each of my views to display the masthead, logo, and tabs. This, of course, became a pain when I needed to change the layout, since I needed to make the same change in several different views.<br /><br />Then one day I realized that Cake had a concept of layouts, which are high level templates in <em>app/views/layouts</em> that define the basic structure of pages. The individual views are just content that gets embedded in these high level layout templates. So I took the common masthead and logo, put it in my default layout, and removed it from the individual views. Now when I wanted to change the look of the masthead, I only had to do it in one place. For the tabs, I discovered the concept of elements. I placed the code for my tabs in <em>apps/views/elements/tabs.thtml</em>. Then the tabs could be displayed in any template using:<br /><br /><?php echo $this-renderElement('tabs') ?<br /><br />Rather than stick the above statement in all of the many pages that were supposed to display tabs, I created a new layout in <em>apps/views/layouts/tabbed.thtml</em> (which uses renderElement to render the tabs). Then I used<br /><br />$this-layout = "tabbed"<br /><br />in the controller to tell it to use the tabbed layout rather than the default (non-tabbed) layout.<br /><br />After a couple of days of work on this application, it was time to demo it to the VP, who was very impressed with what I was able to accomplish in such a short period of time. It was brought up that before I took on the project they had asked some other folks how long it would take them to build it in Java and they had said that it would take on the order of months what I had built in a couple of days. Morals of the story:<br /><br />1. Cake is very lightweight and productive<br />2. Cake might be very beneficial to your career<br /><br />Eventually, I was assigned to another project and my manager wanted me to transition my Cake project to another engineer, who was experienced with PHP but not with Cake. I sat down with the new engineer and in about 20 or 30 minutes of explanation and walking him through the code,<br />he felt ready to code. Not only did he feel that he knew enough to start working with the application, I could tell from the smile on his face that he was very impressed by the power and succinctness of Cake, which was the same reaction that I initially had. After a couple of days, I checked back with him and he had made a remarkable amount of progress on the application - there were a ton of new pages and features.<br /><br />So you see, Cake is a very productive environment. For a very small investment in the initial learning curve, you can get a significant increase in productivity.<br /></em><br /><br /><strong>...And the icing?</strong><br /><br />So that's what CakePHP is about. The project may only have just entered alpha stage, but the code is already very stable and useable, as PHPnut, gwoo and Marc said. So what's going to be included in the beta and stable releases? I researched a bit and asked the developers, and here's how Cake will probably evolve in the following months:<br /><br /><ul><br /><li>Cake's built-in </li><strong>data-validation</strong> capabilities will be extended. A validator class - which already exists, by the way - will be extended to include more data types and expressions to be validated before being stored in a database. <br /><li>A new default </li><strong>ACL system</strong> will be included and will support database access and .ini files as well. <br /><li>The </li><strong>AJAX</strong> helper class and AJAX support will be enhanced, featuring unobtrusive JavaScript and ALA behavior[28].<br /><li>Multiple applications with the same core files. In the future developers will be able to create their own Cake application which could be placed in the app/plugins directory and be seamlessly integrated and auto-linked to other Cake applications.</li><br /></ul> <br /><br />After learning all this about Cake and after trying it out myself, I really think that I have found the solution to all of my PHP web development problems. CakePHP can really help PHP developers a lot if properly used and understood. Still not convinced? Just try it out then, will you?[17]<br /><br /><br /><strong>Notes and Related Resources</strong><br /><br />Special thanks to:<br /><br /><ul><br /><li>Larry E. Masters aka PhpNut and Garrett J. Woodworth </li><strong>gwoo</strong> for providing all the answers to my questions and contributing to create such a wonderful tool for the PHP community.<br /><li>Marc Abramowitz for sharing his experiences with the CakePHP framework and providing the content for the '...let's eat' section.</li><br /></ul><br /><br /><small><br />[1] PHP functions reference, <a href="http://www.php.net/manual/en/funcref.php">http://www.php.net/manual/en/funcref.php</a><br />[2] Framework, Wikipedia Page - <a href="http://en.wikipedia.org/wiki/Framework">http://en.wikipedia.org/wiki/Framework</a><br />[3] .NET framework overview - <a href="http://msdn.microsoft.com/netframework/technologyinfo/default.aspx">http://msdn.microsoft.com/netframework/technologyinfo/default.aspx</a><br />[4] "PHP Framework", delorian's blog, PHP Community - <a href="http://www.phpcommunity.org/node/100">http://www.phpcommunity.org/node/100</a><br />[5]Some popular PHP frameworks: Mojavi (<a href="http://www.mojavi.org/">http://www.mojavi.org/</a>), phpMVC (<a href="http://www.phpmvc.net/">http://www.phpmvc.net/</a>), BlueShoes (<a href="http://www.blueshoes.org/">http://www.blueshoes.org/</a>), Seagull (<a href="http://seagull.phpkitchen.com/">http://seagull.phpkitchen.com/</a>).<br />[6] PEAR - <a href="http://pear.php.net/">http://pear.php.net/</a><br />[7] Prado - PHP Rapid Application Development Object-Oriented, <a href="http://www.xisc.com/">http://www.xisc.com/</a><br />[8] Event Driven Programming, Wikipedia Page - <a href="http://en.wikipedia.org/w/index.php?title=Event_driven_programming">http://en.wikipedia.org/w/index.php?title=Event_driven_programming</a><br />[9] Ruby on Rails, Official Page - <a href="http://www.rubyonrails.org/">http://www.rubyonrails.org/</a><br />[10] Ruby on Rails, Doumentation - <a href="http://documentation.rubyonrails.com/">http://documentation.rubyonrails.com/</a><br />[11] Model View Controller, Wikipedia Page - <a href="http://en.wikipedia.org/w/index.php?title=Model-View-Controller">http://en.wikipedia.org/w/index.php?title=Model-View-Controller</a><br />[12] PHP frameworks inspired by Rails: <a href="http://phpontrax.com/">http://phpontrax.com/</a>, <a href="http://flinn.activeintra.net/biscuit/">http://flinn.activeintra.net/biscuit/</a>, <a href="http://www.cakephp.org/">http://www.cakephp.org/</a><br />[13]Python frameworks inspired by Rails: <a href="http://fanery.sourceforge.net/">http://fanery.sourceforge.net/</a>, <a href="http://fanery.sourceforge.net/">http://fanery.sourceforge.net/</a>, <a href="http://subway.python-hosting.com/">http://subway.python-hosting.com/</a><br />[14]Java framework inspired by Rails: <a href="https://trails.dev.java.net/">https://trails.dev.java.net/</a><br />[15]Perl frameworks inspired by Rails:<br /><a href="http://search.cpan.org/dist/Catalyst/lib/Catalyst/Manual/Intro.pod">http://search.cpan.org/dist/Catalyst/lib/Catalyst/Manual/Intro.pod</a>, <a href="http://perlonrails.org/index.php/Main_Page">http://perlonrails.org/index.php/Main_Page</a> <br />[16] "Rails Clones: Blood suckers or useful drones?", RedHanded - <a href="http://redhanded.hobix.com/cult/railsClonesBloodsuckersOrUsefulDrones.html">http://redhanded.hobix.com/cult/railsClonesBloodsuckersOrUsefulDrones.html</a><br />[17] CakePHP - Rails-inpired PHP framework, <a href="http://www.cakephp.org/">http://www.cakephp.org/</a><br />[18] AdoDB, PHP Database Abstraction Layer - <a href="http://adodb.sourceforge.net/">http://adodb.sourceforge.net/</a><br />[19] CakePHP blog tutorial - <a href="http://wiki.cakephp.org/tutorials:blog_tutorial_-_1">http://wiki.cakephp.org/tutorials:blog_tutorial_-_1</a><br />[20] Extending CakePHP - <a href="http://wiki.cakephp.org/tutorials:extending_cake">http://wiki.cakephp.org/tutorials:extending_cake</a><br />[21] Smarty, PHP Template Engine - <a href="http://smarty.php.net/">http://smarty.php.net/</a><br />[22] Scaffolding a Blog, CakePHP Wiki - <a href="http://wiki.cakephp.org/tutorials:scaffolding_a_blog">http://wiki.cakephp.org/tutorials:scaffolding_a_blog</a><br />[23] CakePHP Wiki - <a href="http://wiki.cakephp.org/">http://wiki.cakephp.org/</a><br />[24] CakePHP Google User Group - <a href="http://groups.google.com/group/cake-php">http://groups.google.com/group/cake-php</a><br />[25] CakeForge - <a href="http://cakeforge.org/">http://cakeforge.org/</a><br />[26] CakePHP Downloads Page - <a href="http://cakephp.org/downloads/">http://cakephp.org/downloads/</a><br />[27] Simfony, PHP5 framework - <a href="http://www.symfony-project.com/">http://www.symfony-project.com/</a><br />[28] ALA behavior - <a href="http://bennolan.com/behaviour/">http://bennolan.com/behaviour/</a><br /></small><br />
A contents/articles/choosing-the-right-blogging-platform.md

@@ -0,0 +1,298 @@

+----- +title: Choosing the Right Blogging Platform +content-type: article +subtitle: Or why I am still going to use Nanoc for the foreseeable future +timestamp: 1398607426 +tags: writing|internet|webdevelopment +----- + Every so often I wonder whether I should ditch my current blogging platform and try something new and shiny that just came out. Luckily, normally I come back to the same conclusion: I don't need to change anything, I just need to find the time and the will to write about something. + + This time is no different, but I thought I'd write a roundup of platforms, services, and tools that you can use for blogging or managing your personal sites. Note that this roundup is by no means exhaustive (like most roundups) -- it's just a quick overview of the pros and cons of a few systems that I've been researching on lately. Maybe it will be useful to someone. + +### TL;DR + + * Don't care about having "your own platform" but just want to get published somewhere? &rarr; [Medium][medium] + * Do you want a full-fledged blog and the possibility to extend it? &rarr; [WordPress][wp] + * Do you want to blog with markdown and Dropbox? &rarr; [Scrivaner][wp] + * Do you want something simple and hassle-free but also suitably geeky and hackable? + * ...in Ruby? &rarr; [Nanoc][nanoc] (but I am very partial to Nanoc, so probably I guess [Middleman][middleman] is awesome too) + * ...in Python? &rarr; [Pelican][pelican] + * ...in NodeJS? &rarr; [Metalsmith][metalsmith] + +### Evaluation Criteria + +Here's the list of features I am typically looking for in a blogging platform: + + * It must be sufficiently mature and stable, OR extremely simple to use and hack + * It must not lock me in forever. Hosted is OK, as long as I don't feel my content is trapped in any way. The platform must at least provide a way to export content, and preferably a way to import fairly heterogenous content into it. + * I like experimenting with multiple markup languages (that's just me I guess) -- so support for multiple types of content sources (Markdown, Textile, plain HTML, etc.) is a plus. + * It must be extensible in some way, and allow me to change the look and feel + * A nice and shiny web editor and an IOs app is a plus, although not mandatory + + +### Blogging Engines and Services + +These are third-party sites offering a (free) way to create an manage your own blog, complete with comments, draft management, and all the bells and whistles (well, most of). All of them offer a *hosted* option, and a few of them give users the possibility to download the software and run it on your own server. + + +#### [WordPress][wp] + +WordPress is the de-facto blogging platform. It is the blogging plaform a lot of people end up with because at the end of the day it does the job pretty well. It is also the blogging platform a lot of people are trying to replace with something else because they find it too bloated, heavyweight or complex. + +If you want a solid blogging platform, go for it -- you can have your blog hosted via [WordPress.com](https://wordpress.com/) or download it from [WordPress.org][wp] and run it on your own service. + +Pros &amp; Cons: + + * &#x2714; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2718; Does not require server-side code to work + * &#x2718; Does not require a database to work + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2714; Provides an WYSIWYG editor and an administration area + * &#x2714; Supports one or more IOs/Android apps for authoring content + +#### [Tumblr][tumblr] + +If you want something more lightweight than WordPress and you don't care about having your content hosted on someone else's platform, Tumblr could be a good fit for you. Unlike similar platforms, it allows you to completely customize the look and feel of your site (if you are sufficiently proficient with HTML and CSS, obviously), but of course it cannot be used for something other than blogging... or you cannot extend it in any way. + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a -- hosted] + * &#x2714; Does not require a database to work [n/a -- hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2714; Supports one or more IOs/Android apps for authoring content + +#### [Medium][medium] + +One of the most popular *next generation* blogging platform. Medium aims empower and encourage authors to write high-quality content and publish it on... well, yes, Medium.com. Unlike all the other services and software mentioned in this article, this is the only one that does not offer (and apparently has no plans to offer) the possibility to claim your own space via a custom domain or simiular. + +I was *extremely tempted* to try out Medium (and I did in fact, but very briefly) because of its lean and powerful web editor and because of the sense of consistency that it conveys, but I decided to stay away, at least for now. [Marco Arment][marco-platform] summarizes the problem with Medium very well: + +> Treat places like Medium the way you’d treat writing for someone else’s magazine, for free. It serves the same purpose: your writing gets to appear in a semi-upscale setting and you might temporarily get more readers than you would elsewhere, but you’re giving up ownership and a lot of control to get that. + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2718; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a -- hosted] + * &#x2714; Does not require a database to work [n/a -- hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content [but they are planning to add support for authoring to their existing app] + +#### [Svbtle][svbtle] + +Svbtle started as a blogging platform restricted to a restricted circle of *elite* bloggers. Medium didn't exist back then, so maybe some of you looked at those Svbtle blogs with a little bit of envy at the time. + +The good news is that Svbtle is now open for all, and even *you* can now be part of the game. While this was a good move on many fronts, it makes this platform less of a special thing: the magic is over. That being said, I seriously considered switching to Svbtle (or at least creating a new Svbtle blog) especially because -- unlike Medium -- it allows and encourages users to use their own domain, while still not allowing custom look and feel... but it makes sense for that they're trying to do. + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a -- hosted] + * &#x2714; Does not require a database to work [n/a -- hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content [No app, but their mobile site works pretty well] + +#### [Ghost][ghost] + +The much-touted, midly-overhyped, [NodeJS][nodejs]-powered WordPress killer. Although not quite finished yet (release 0.4 at the time of writing) Ghost is a very promising next-generation blogging platform. + +In this period I am experimenting a lot with NodeJS, so this looked appealing... but in the end I didn't want to go down the route of having to host a non-static site for H3RALD.com. + +Pros &amp; Cons: + + * &#x2714; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2718; Does not require server-side code to work + * &#x2718; Does not require a database to work + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content + +### Blogging Tools Powered by Other Services + +These are lightweight blogging services that *piggy-back* other services like [Dropbox][dropbox] or [Evernote][evernote]. Typically more limited in functionality, these services are however worth a shot if you want a simple way to blog and you already use one of the required services. Keep in mind that if you choose this route you're committing to not one, but TWO different third-party services for your blogging needs. + +#### [Calepin][calepin] (Dropbox) + +If I remember correctly this one was the very first Dropbox-powered blogging platform. The idea is simple: use [Dropbox][dropbox] to store your content, and publish it using a separate service (which must have sufficient privileges to access the necessary dropbox files). + +Although Calepin's creator originally [announced](https://twitter.com/calepinapp/statuses/192336999720550401) the shutdown of the service back in 2012 ([open sourcing](https://github.com/jokull/calepin) the original source code -- thanks!), Calepin seems to be alive and well now. + +All you need to do is write your blog posts in markdown within a specific folder of your Dropbox, and Calepin will do the rest. Compared to its main competitors (see below), Calepin is very minimalist by nature (you cannot customize the look and feel of your site, for example) but it still has its own appeal, mainly because it is extremely simple to use (as in *no configuration whatsoever*). + +Pros &amp; Cons: + + * &#x2714; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2718; Does not require server-side code to work [if you choose to host your own] + * &#x2714; Does not require a database to work + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2718; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content [Although you can use any Dropbox-enabled markdown editor app with it] + +#### [Skrivr][skrivr] (Dropbox) + +Similar to Calepin, but adds a bit more features (and a bit more complexity to the process), namely support for custom themes, with its own templating engine. Currently invite only (but I got an invite after a while). + +Personally, I feel that this service is somewhat in the middle between Calepin and Scriptogram (see below) -- If I had to choose, I'd go for one of the other two. + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a: Hosted] + * &#x2714; Does not require a database to work [n/a: Hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2714; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content [Although you can use any Dropbox-enabled markdown editor app with it] + +#### [Scriptogram][scriptogram] (Dropbox) + +The high-end platform within this category. Like Skrivr, Scriptogram offers support for more customizations for your Dropbox-powered blog, but it looks a bit more polished and user-friendly. + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a: Hosted] + * &#x2714; Does not require a database to work [n/a: Hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2714; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content [Although you can use any Dropbox-enabled markdown editor app with it] + +#### [Postachio][postachio] (Evernote) + +Unlike the previosly-mentioned services, Postachio does not relies on Dropbox as its data source, but it uses [Evernote][evernote] instead. Pretty neat, and similar to Scriptogram or Skrivr feature-wise (theme support, templates with custom tags, etc.). The main drawback? You need an Evernote account to use it -- and if I was going to use Evernote for blogging as well, I'd definitely choose to upgrade to a premium account. + +Not happening for now, but good if you live in an Evernote-centric ecosystem already (maybe you use Evernote as your main todo list as well, besides using it for all your note-taking needs). + +Pros &amp; Cons: + + * &#x2718; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work [n/a: Hosted] + * &#x2714; Does not require a database to work [n/a: Hosted] + * &#x2718; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2714; Can be easily customized without using addons or themes + * &#x2718; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2714; Supports one or more IOs/Android apps for authoring content [the Evernote app...] + +### Static Site Generators + +Static site generators allows you to manage a blog or web site relatively effortlessly while not relying on a third-party service. This blog is [powered by][h3rald-nanoc] one of them: [nanoc][nanoc]. + +The basic idea behind every static site generator is simple: manage all your content in flat-files (normally using a lightweight markup language like markdown) and then use a script (in Ruby, Python, NodeJS, or many others...) to *compile them* into a static web site, relying on third-party services for all the interactive bits, if any (most notably comments, via [Disqus][disqus]). + +According to [StaticSiteGenerators.net][ssg], there are 240 of them, so obviously I'm not going to cover them all here -- I'll limit the roundup to the most popular ones and/or those I am experienced with. + +To save myself some copying and pasting, the Pros &amp; Cons of *all* the static site generators (using the same list that I have been using to compare other services) is the following: + + * &#x2714; Can be installed on your own server + * &#x2714; Can be used with your own domain + * &#x2714; Does not require server-side code to work + * &#x2714; Does not require a database to work + * &#x2714; Provides support for multiple lightweight markup languages (Markdown, Textiles, etc.) + * &#x2714; Can be easily customized without using addons or themes + * &#x2714; Supports interoperability with other platforms (import/export/convert content to other formats) + * &#x2718; Supports one or more IOs/Android apps for authoring content + + +#### [Jekyll][jekyll] + +Apparently, Jekyll is *the most popular* static site generator by... number of stars on its Github repo. Which isn't really fair because Jekyll powers Github pages and has been heavily marketed by its creators and supporters as the easiest way to set yourself free from Wordpress or a similar *heavyweight* blogging platform. + +Truth is, it is if you plan to use Github Pages as well -- if not, you may as well use one of the others that offer much more customization (assuming that you need more customization, that is). If you like it but you want something more suitable for a blog, you may want to check out Octopress instead. + +#### [Octopress][octopress] + +Although the Octopress site has not been updated since... 2011 (!), the Github repo shows recent activity and the project seems still very popular. It is basically Jekyll on steroids, with a lot of blogging-related goodies. + +#### [Nanoc][nanoc] + +Nanoc is the static site generator that still powers this web site. Overall, I am still very happy with it because it can do everything I need (and because I already have a working site running on it of course!). I already wrote about it in the past, and while nanoc (and my site) evolved a lot meanwhile, most of the [original article][h3rald-nanoc] remains valid today. + +#### [Middleman][middleman] + +I admit I didn't try this one yet, but judging from the number of people that starred it on Github this is the most popular static site generator written in Ruby (after Jekyll and Octopress). It seems to be feature-packed (including native support for i18n) and well worth a look. + +#### [Pelican][pelican] + +The Python counterpart of Jekyll. Never tried it personally, but it seems solid and a valid choice if you are a Pythonista. Oddly enough, it also powers the [Calepin.co][calepin] web site (and by reflection all Calepin-powered blogs in existance). + +#### [DocPad][docpad] + +If you are already familiar with [NodeJS][nodejs] and you want to use something *extremely powerful and versatile* as your static site generator, Docpad is the answer. It provides all the features of other static site generators, but it comes with a hige amount of [plugins](http://docpad.org/docs/plugins) to do pretty much anything and more, including executing scripts/templates in other programming languages. Obviously it just runs external problems to accomplish this, but still, this could be appealing to some folks (and piss off others). + +Drawbacks? Well, it Looks somewhat complex. + +#### [Metalsmith][metalsmith] + +If DocPad is powerful and complex, Metalsmith is still powerful but *incredibly* simple. Its [core](https://github.com/segmentio/metalsmith/blob/master/lib/index.js) is less than 200 lines of codes (OK, not including all the third-party libraries it requires, like many other NodeJS modules, anyway), and everything else is a plugin. + +One of the catchphrases of the project is actually *everything is a plugin*, and they mean it: all Metalsmith does is providing a way to pipe a set of source files through plugins to produce a set of output files. I've been using it for some other projects for a while and making plugins is very simple, and the existing ones can be easily combined to obtain a static-site geerator. + +### Conclusions + +For the time being, I decided not to switch to another platform and stick to Nanoc. Why? Because it *just works*. Anyhow, I did seriously consider a lot of the blogging platform I covered in this roundup. + +In particular, I've been tempted to at least start using **Medium** regularly, mainly because of its fantastic post editor, and because of the high-quality content network it is becoming. But again, writing for medium would be like writing for a magazine for free: the fact that you cannot use a custom domain or effectively build your own identity was enough to put me off. + +**Svbtle** is slightly better on the customization front (at least it allows custom domains) but didn't convince me. I may use it for a *secondary* blog though. + +For what concerns **Dropbox-powered services**... the idea is really cool, but I don't feel comfortable in depending on *two* third-party services for my blog. + +...Then there's static site generators. I came to the conclusion that they are by far the most flexible option for small/medium sized personal web site. At this stage, I could probably have switched to something different, maybe powered by NodeJS (I am using Ruby less and less nowadays) like **Metalsmith**... but why bother? I'd have had to port a lot of the customizations I implemented in Ruby to Javascript with no particular benefit, at least not in the short term anyway. + +What do *you* think? What blogging platform are you using, and why? + + +[marco-platform]: http://www.marco.org/2013/08/05/be-your-own-platform +[postachio]:http://postach.io/ +[evernote]:http://evernote.com/ +[posthaven]:https://posthaven.com/ +[blogger]:https://www.blogger.com/ +[skrivr]:http://skrivr.com/ +[jekyll]:http://jekyllrb.com/ +[calepin]:http://calepin.co/ +[search]:https://www.google.com/search?hl=en&q=blogging+platforms +[ghost]:https://ghost.org +[metalsmith]:http://www.metalsmith.io +[docpad]:http://docpad.org +[nanoc]:http://nanoc.ws +[octopress]:http://octopress.org +[ssg]:http://staticsitegenerators.net +[pelican]:http://blog.getpelican.com +[wp]:https://wordpress.org +[tumblr]:https://www.tumblr.com +[gulp]:http://gulpjs.com +[grunt]:http://gruntjs.com +[svbtle]:https://svbtle.com +[posterous]:http://help.posterous.com +[typepad]:http://www.typepad.com +[squarespace]:http://www.squarespace.com +[skrivr]:http://skrivr.com/ +[scriptogram]: http://scriptogr.am/ +[medium]:https://medium.com/ +[nodejs]:http://nodejs.org +[dropbox]:http://dropbox.com/ +[middleman]:http://middlemanapp.com/ +[pelican]:http://blog.getpelican.com/ +[disqus]:http://disqus.com/ +[h3rald-nanoc]:/articles/take-back-your-site-with-nanoc/ +
A contents/articles/concatenative-020.html

@@ -0,0 +1,31 @@

+----- +title: Concatenative 0.2.0 released +content-type: article +timestamp: 1240126920 +tags: ruby|concatenative +----- +<p>Version 0.2.0. of the <a href="/concatenative">Concatenative</a> <span class="caps">DSL</span> has been <a href="http://rubyforge.org/frs/?group_id=8068&amp;release_id=33575">released</a>.</p> +<p>Here are some highlights from the changelog:</p> +<ul> + <li>Implemented new combinators: + <ul> + <li>binrec</li> + <li>split</li> + <li>twodip</li> + <li>threedip</li> + </ul></li> + <li>Performance improvements: + <ul> + <li>Stack is never copied.</li> + <li>No symbol/string conversion when processing words.</li> + </ul></li> + <li>Pseudo-namespace support (e.g. :kernel/:while and :math/:factorial)</li> + <li>~ and &lt;= operators to unquote and define words, respectively.</li> + <li>No more uppercase words!</li> +</ul> +<p>Oddly enough, I realized that it is possible to defined methods named after reserved words like &#8220;while&#8221; or &#8220;if&#8221;, so now all the concatenative words (combinators) in <code>kernel.rb</code> are now defined <em>without</em> a leading undersore. Similarly, there&#8217;s no real need to use <span class="caps">UPPERCASE</span> symbols, so as a result, method lookup is significantly faster and will use less resources.</p> +<p>Here&#8217;s how the lookup works. Say you have the following program:</p> +<div class='ruby'><pre><code>[[1,2,3], [4.5.6], :concat]</code></pre></div><p>If <code>:concat</code> has been defined by the user (<code>:concat &lt;= [...]</code>), that definition will be used, otherwise the <code>Concatenative::Kernel</code> combinator <code>concat</code> will be called. If you want to use the corresponding Ruby method, all you have to do is specifying the arity explicitly using the <code>|</code> operator.</p> +<p>To remove any ambiguity, it is now possible to specify the <em>namespace</em> of a word explicitly, e.g. :kernel/:concat or :ruby/concat. The <code>/</code> operator simply concatenates the two symbols together (<code>:"kernel/concat"</code>) and sets the namespace (<code>:kernel</code>) and name (<code>:concat</code>) of the new symbol. <code>:kernel</code> and <code>:ruby</code> are not meant to be used when defining new words, but you can use anything else you like, for example :math/:factorial or :local/:a, etc.</p> +<p>As I pointed out in the <a href="/articles/concatenative-programming-in-ruby">first article</a> about concatenative, even with the new performance improvement a concatenative program still runs slower than a standard Ruby program, but at least now you won&#8217;t run out of stack space (the <em>Ruby</em> stack, in this case) too soon.</p> +<p>If you have any issues to report, feature requests, etc., feel free to use <a href="http://github.com/h3rald/concatenative/issues">GitHub</a> to do so.</p>
A contents/articles/concatenative-programming-in-ruby.html

@@ -0,0 +1,116 @@

+----- +title: Concatenative programming in Ruby +content-type: article +timestamp: 1238221440 +tags: ruby|concatenative|programming +----- +<p>A while ago, I sat down examining a few <a href="http://www.h3rald.com/articles/10-programming-languages">alternative programming languages</a> I might decide to learn someday. Each of those languages has its own peculiarities, and I didn&#8217;t choose them randomly, I chose them based on their popularity, power, paradigm and how actively they are developed.</p> +<p>I included <a href="http://factorcode.org/">Factor</a> as the only representative for <em>concatenative programming</em>, an interesting way to write programs, but seldom used in &#8220;recent&#8221; languages (except for Factor and a few others).</p> +<h3>The Joy of concatenative programming</h3> +<p>If you have absolutely no clue on what I&#8217;m talking about, you should consider looking at the home page for the <a href="http://www.latrobe.edu.au/philosophy/phimvt/joy.html">Joy Programming Language</a>, or maybe just the <a href="http://www.latrobe.edu.au/philosophy/phimvt/joy/j00ovr.html">overview</a>: it should be enough to tikle your curiosity.</p> +<p>Joy is often considered the <em>canonical</em> concatenative programming language: a basic &mdash;but working&mdash; implementation of a simple programming language to illustrate the fundamentals of concatenative programming. Joy looks like this:</p> +<p><code>2 3 + dup *</code></p> +<p>This simple programs computes the sum of 2 and 3, pushes it on the stack, duplicates it (using the <code>dup</code> combinator) and then multiplies the two values, obtaining 25 as a result.</p> +<p>Let&#8217;s slow down a second. Here&#8217;s what happens, exactly:</p> +<table> + <tr> + <th>Element entered </th> + <th>Stack contents</th> + </tr> + <tr> + <td> 2 </td> + <td> <sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> </td> + </tr> + <tr> + <td> 3 </td> + <td> [2 3] </td> + </tr> + <tr> + <td> + </td> + <td> <sup class="footnote" id="fnr5"><a href="#fn5">5</a></sup> </td> + </tr> + <tr> + <td> dup </td> + <td> [5 5] </td> + </tr> + <tr> + <td> * </td> + <td> <sup class="footnote" id="fnr25"><a href="#fn25">25</a></sup> </td> + </tr> +</table> +<p>Got it? Let&#8217;s take it one step further. When you enter <code>dup</code> and then <code>*</code>, you are effectively computing the square of a number, so we can define the function <code>square</code> simply as:</p> +<p><code>square == dup *</code></p> +<p>In Ruby, this would be:</p> +<div class='ruby'><pre><code>def square(x) + x*x +end</code></pre></div><p>What&#8217;s unusual here? &mdash; Simple, there are no <em>variables</em> involved. Joy doesn&#8217;t need any explicit variable or <em>formal parameters</em> of any sort.</p> +<p>There&#8217;s more. Take the following code:</p> +<p><code>[1 2 3 4] [dup *] map</code></p> +<p>The <code>map</code> combinator expects a list and a <em>quoted program</em> (the same one used to compute the square) and produces a new list containing the result of that program applied to each element of the original list. Basically the equivalent of:</p> +<div class='ruby'><pre><code>[1,2,3,4].map { |e| e*e }</code></pre></div><p>Do you notice anything different? &mdash; Yes, Joy doesn&#8217;t need blocks or lambdas either, it uses <em>quoted programs</em> instead, which are nothing but slightly fancier lists (or arrays, as you like).</p> +<p>Let&#8217;s recap then, Joy doesn&#8217;t need of:</p> +<ul> + <li>lambda functions or blocks (quotation does the trick)</li> + <li>explicit parameters (everything you need is on the stack)</li> + <li>variable assignments (same as above)</li> + <li>explicit recursion (provided you can use combinators like linrec, primrec, binrec, etc.)</li> +</ul> +<p>I would consider this one of the best examples of <em>programming minimalism</em>: an incredibly simple syntax, a very small set of rules, but a good deal of power.</p> +<h3>Ruby objects on the stack</h3> +<p>After reading about Joy, I realized that implementing something similar in Ruby would be an interesting mini-project (let&#8217;s say a week of lunch breaks) to understand more about concatenative programming. It would also be pointless, too: a stack-based programming language implemented on top of one of the most high-level programming languages you can find isn&#8217;t going to be fast, is it? Nevertheless, it would still be interesting.</p> +<p>Ruby offers everything you need to build a Joy-like <span class="caps">DSL</span>:</p> +<ul> + <li>You can use arrays as &#8230;arrays, but also as quoted programs, and to model the stack itself.</li> + <li>You can use integers, strings, etc. as themselves</li> + <li>You can use Symbols as functions (we&#8217;ll get to this in a minute)</li> +</ul> +<p>If you think about the following expression in postfix notation:</p> +<p><code>2 2 +</code></p> +<p>We <em>could</em> translate it into infix notation (<code>2 + 2</code>), because Ruby supports it, but it&#8217;s not general enough. What you could do is this though:</p> +<div class='ruby'><pre><code>2.send(:+, 2)</code></pre></div><p>Message sending. I can see all the SmallTalk sympathizers drooling already. Well yes, In Ruby, <em>everything</em> is an object, so <em>everything</em> has a receiver and maybe some parameters. In other words, every method call can be reduced to the following syntax:</p> +<div class='ruby'><pre><code>receiver.send(method, *params)</code></pre></div><p>In this way, it is safe to assume that everything has a receiver, which could be understood as a function parameter, and may have 0 or more parameters. Take the following then:</p> +<div class='ruby'><pre><code>[2, 2, :+]</code></pre></div><p>It&#8217;s not too different from Joy, and it&#8217;s still Ruby code. All you have to do is use something to do the following:</p> +<ul> + <li>Take an array, and examine each item: + <ul> + <li>If it&#8217;s an object (non-Symbol), then push it on top of the stack.</li> + <li>If it&#8217;s a Symbol, then do something different, i.e.: + <ul> + <li>Find its receiver and its parameters and call a method.</li> + <li>Manipulate something on the stack.</li> + </ul></li> + </ul></li> +</ul> +<p>In this case, we have to find :+&#8217;s receiver and its parameter and we&#8217;re sorted.</p> +<p>Unfortunately Ruby&#8217;s <code>arity</code> method isn&#8217;t that reliable. For example: <code>"test".instance_method(:sub).arity</code> returns -1, while it should return &#8220;2&#8221; to be useful. So we have no choice but find a way to pass the method&#8217;s arity explicitly, in some cases.</p> +<p>For example like this:</p> +<div class='ruby'><pre><code>["Ciao, Fabio", /Ciao/, "Hello", :sub|2]</code></pre></div><p>If we define a | operator for the Symbol class, it&#8217;s not too bad after all. It&#8217;s heavy, but in this way we can use <em>any</em> Ruby method in postfix notation.</p> +<h3>Introducing the Concatenative Ruby <span class="caps">DSL</span></h3> +<p><a href="/concatenative">Concatenative</a> is a simple Ruby <span class="caps">DSL</span> for concatenative programming. You can write concatenative programs inside ordinary Ruby arrays and execute them by calling either <code>Array#execute</code> or <code>Kernel#concatenate</code>, like this:</p> +<div class='ruby'><pre><code>require 'concatenative' + +concatenate( + 10, + [0, :==], + [1, :+], + [:dup, 1, :-], + [:*], + :linrec + )</code></pre></div><p>This simple program calculates the factorial of 10. As you can see, no matter how unusual it may look, it is perfectly valid Ruby code and it is equivalent to the following Joy code:</p> +<p><code> +10 [0 =] [1 +] [dup 1 -] [*] linrec +</code></p> +<p>Granted, Joy looks better, but that&#8217;s the tradeoff for not writing a parser for Joy syntax, after all. <br /> +Looking at the code above, there are a few things to keep in mind when programming with Concatenative:</p> +<ul> + <li>You are using Ruby arrays, so you have to use commas, at least</li> + <li>functions, operators and combinators (let&#8217;s just call them <em>words</em>) are available as Ruby symbols</li> + <li>The arity of all Ruby infix operators has been already set to &#8220;1&#8221; by concatenative using the <code>set_arity</code> method (which simply stores the arity of a particular symbol in a constant hash)</li> + <li>You can specify explicit arities using the | operator (<code>:gsub|2</code>, or <code>:join|1</code>)</li> + <li>Unless the arity has been specified, an arity of 0 is assumed.</li> + <li>You can define your own concatenative functions using the <code>Symbol#&lt;=</code> method, which expects a quoted concatenative program.</li> +</ul> +<h3>Performance issues</h3> +<p>In its current form, Concatenative can be very slow, as show the &#8220;benchmarks&#8221; provided in the /examples folder, especially if you use recursive combinators. This is understandable because everything is implemented in pure Ruby, which is totally unsuitable for low level stuff.</p> +<p>If you are interested, you are more than welcome to submit patches and suggestions to improve Concatenative&#8217;s performance, or, if you feel brave enough, you could help me create a C extension instead: things would become much faster then.</p> +<p>At any rate, feel free to play with it. You can get the source from <a href="http://github.com/h3rald/concatenative/tree/master">GitHub</a>, you can get the gem from <a href="http://rubyforge.org/projects/concatenative/">RubyForge</a> and you can submit ticket through <a href="http://github.com/h3rald/concatenative/issues">GitHub</a> as well.</p>
A contents/articles/design-patterns-in-ruby-review.html

@@ -0,0 +1,107 @@

+----- +title: Book Review: Design Patterns in Ruby +content-type: article +timestamp: 1207885260 +tags: ruby|review|books +----- +<p>I finally got my hands on a shiny new copy of <em>Design Patterns in Ruby<sup class="footnote" id="fnr1"><a href="#fn1">1</a></sup></em>. The book itself is not brand new and it was already widely praised by many different people online, so I wanted to take a look for myself.</p> +<p>To my surprise, the book is a hardcover edition, which makes it look more professional and more durable than the average programming book<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup>. It&#8217;s also smaller and shorter than the average programming book<sup class="footnote" id="fnr2"><a href="#fn2">2</a></sup> (340 pages), which makes it much easier to carry around and less intimidating to read. It&#8217;s also <em>not</em> meant to be a reference book, so it is actually pleasant an easy to read all in one go, as you&#8217;ll soon find out.</p> +<p>What is it about? &mdash; well, design patters in the Ruby language of course. But it&#8217;s not the usual brainwash of programming theory you would expect by a typical book on patters, it has <em>plenty</em> of examples of real code. When I say <em>real code</em> I don&#8217;t mean the usual Dog/Cat/Horse/&lt;insert animal here&gt; classes or juke-box simulations which don&#8217;t work at all etc. etc., I mean actual snippets from well known Ruby applications, like RubyGems, FXRuby and, of course, Rails.<br /> +OK well, there&#8217;s an exception perhaps: Russ <em>did</em> include a few wild life simulations (ponds with frogs and similar), but it&#8217;s only for your own good, and for the sake of tradition.</p> +<p>Anyhow, let&#8217;s start from the beginning&#8230;</p> +<h3>Part I: Patters and Ruby</h3> +<p>The first part of the book serves as a general introduction to the other two parts. If you know the basics of both design patterns and Ruby, you can safely skip this as you won&#8217;t find anything of overwhelming interest here.</p> +<p>Personally I really liked <strong>Chapter 1</strong> though, &#8220;Building better Programs with Patterns&#8221;, in which Russ does a great job in summarizing the original GoF book<sup class="footnote" id="fnr3"><a href="#fn3">3</a></sup> into four points:</p> +<p style="float:right;"><img src="/files/design_patterns_in_ruby.jpg" alt="" /></p> +<ul> + <li><em>Separate our the things that change from those that stay the same.</em></li> + <li><em>Program to an interface, not an implementation.</em></li> + <li><em>Prefer composition over inheritance.</em></li> + <li><em>Delegate, delegate, delegate.</em></li> +</ul> +<p>Also, although it does not come from the Design Patterns book but from building real systems, the author adds the <span class="caps">YAGNI</span> (You Ain&#8217;t Gonna Need It) principle<sup class="footnote" id="fnr4"><a href="#fn4">4</a></sup> as a reminder to resist the temptation of implementing things which <em>may</em> be needed <em>later on</em>, even if they are not needed right now.<br /> +The chapter ends with an outline of the patterns which will be presented throughout the book: 14 out of the original 23 patterns by the Gand of Four will be discussed in Part II and 3 bonus &#8220;Ruby-only&#8221; patterns will be examined in Part <span class="caps">III</span>, as a special treat.</p> +<p><strong>Chapter 2</strong> (<em>Getting started with Ruby</em>) feels perhaps a bit out of place. As others pointed out<sup class="footnote" id="fnr5"><a href="#fn5">5</a></sup>, why does a book on advanced Ruby programming techniques include a 35-page-long introduction on the Ruby language? The answer was given by Russ himself in an interview<sup class="footnote" id="fnr6"><a href="#fn6">6</a></sup>:</p> +<blockquote> +<p>&#8220;The reason that I included the introductory chapter about Ruby in there was to make the book accessible to folks with little or no Ruby background.<br /> +Now honestly, I don’t think that you could come to my book with no background in Ruby and walk away from it an expert Ruby programmer &mdash; it’s not really that kind of introductory book.<br /> +But I do think that someone with experience in other languages could read my book and come away knowing about Ruby, understanding what all the shouting is about.&#8221;</p> +</blockquote> +<p>I admit, I skipped this chapter during my first reading because I was eager to move on to the main part of the book, but I did read it afterwards (I had to write this review after all!). It&#8217;s quite a nice introduction aimed at the average .<span class="caps">NET</span>/Java developer: Russ provides a step-by-step presentation of the main features of the language while holding the reader by hand when something weird or scary comes about:</p> +<blockquote> +<p>The slightly strange-looking syntax in this code is actually a tip-off something deep and important: In Ruby, everythng &mdash; and I mean <em>everything</em> &mdash; is an object.</p> +</blockquote> +<p>Of course Chapter 2 won&#8217;t turn you into a Ruby guru, but it definitely fulfills one of the author&#8217;s goals: bringing developers of other languages closer to Ruby, and give them a tiny taste of how Ruby can be <em>wickedly powerful</em>.</p> +<h3>Part II: Patterns in Ruby</h3> +<p>Part II constitutes the bulk of the book, describing 14 GoF patterns in 220 pages. The patterns covered are the following:</p> +<ul> + <li>Template Method</li> + <li>Strategy</li> + <li>Observer</li> + <li>Composite</li> + <li>Iterator</li> + <li>Command</li> + <li>Adapter</li> + <li>Proxy</li> + <li>Decorator</li> + <li>Singleton</li> + <li>Factory Method</li> + <li>Abstract Factory Method</li> + <li>Builder</li> + <li>Interpreter</li> +</ul> +<p>Why not covering all 23? Well, because to be honest, they are rarely used in Ruby. Furthermore, in some cases some of the ones examined in the book may feel a bit <em>unnatural</em> to the average Rubyist: how many times did you ever think about using an External Iterator when <code>each</code> is normally available as default internal iterator for any Array-like class?</p> +<p>Each chapter in this part is devoted to a particular pattern and it is organized in more or less the same way, as outlined in the following sections.</p> +<h4>Introduction and Personal Anecdotes</h4> +<p>Most chapters start with a personal anecdote involving the author: it may be a memory related to his first job at the local grocery store (Chapter 8), or about the day he decided to buy his son a bike (Chapter 14):</p> +<blockquote> +<p>&#8220;I remember the day we bought my son his first bike.&#8221; [&#8230;] I spent hours trying to pull together a minor junkiard of parts according to instructions that would have baffled the entire National Security Agency. As it turned out, picking the bike was the easy part: putting it together was the real challenge.</p> +</blockquote> +<p>This was used to introduce the Builder pattern, and how to use it to configure objects which include different logical parts.<br /> +Personally I find this technique particularly useful to introduce a particular problem from a different, more mundane prospective instead of starting off with an abstract theorethical description of the pattern itself. <br /> +The anecdote is then followed by the description of the actual programming problem for which the specific pattern will be used.</p> +<h4>Description of the Pattern and Initial Implementation</h4> +<p>An initial implementation of the pattern in Ruby will be provided more or less immediately after the introduction of each chapter, often accompanied by a simple <span class="caps">UML</span> diagram.<br /> +This implementation normally has quite a few conceptual flaws, which are then examined and corrected step-by-step the chapter to obtain a more &#8220;Ruby-friendly&#8221; solution.</p> +<h4>A More Rubyfied Version of the Pattern</h4> +<p>The final implementation of each pattern is often very different from the initial attempt, and it may contain quite a lot of Ruby-specific code. The author does an excellent job in suggesting pattern implementations which often use blocks, <code>Proc</code> objects or method redefinitions when needed, to make the code more succint and more readable at the same time, as all Ruby code should be.</p> +<p>By doing so, even people who are still learning Ruby will understand how to use some very useful Ruby idioms which can be a bit difficult to grasp otherwise.</p> +<h4>Using and Abusing &lt;Pattern&gt;</h4> +<p>Patterns are often overused and misused, and some people normally end up wondering if they should be used at all, after all. This section (present as a matter of fact in <em>every</em> chapter of part II an <span class="caps">III</span>) examines the pitfalls of the pattern and the most common mistakes developer make when applying it.<br /> +It is by far the most useful section of each chapter, and that&#8217;s what I&#8217;ll be reading and re-reading every time I&#8217;m thinking about using a particular pattern in my code. As a matter of fact, these sections make you realize that <em>every</em> pattern has its own inherent flaws and dangers, and that it is far from being a Silver Bullet. Even when you&#8217;re <em>supposed</em> to use a pattern to accomplish something, be aware that <em>something nasty</em> can happen unless you&#8217;re extra careful: this, perhaps, is the true Golden Rule conveyed throughout the whole book.</p> +<h4>&lt;Pattern&gt;s in the Wild</h4> +<p>This is another very interesting section which is included in every chapter of part II and <span class="caps">III</span>. After describing what a pattern does, how it <em>can</em> be used and how it <em>should</em> be used, you&#8217;ll finally find some interesting examples taken from real world applications.<br /> +By &#8220;real world application&#8221; I mean something like ActiveRecord<sup class="footnote" id="fnr7"><a href="#fn7">7</a></sup> (Observer, Command, Adapter, &#8230;), DRb<sup class="footnote" id="fnr8"><a href="#fn8">8</a></sup> (Proxy) or FXRuby<sup class="footnote" id="fnr9"><a href="#fn9">9</a></sup> (Composite), for example, i.e. important programs and libraries which are used in production environments.<br /> +Personally, I was really glad to find such examples in this book: it definitely helps you feeling design patterns as something more practical and useful than pure software architecture theories.</p> +<h4>Wrapping it Up</h4> +<p>&#8220;Wrapping it Up&#8221; is the title of the last section of each chapter of Part II and <span class="caps">III</span>. It&#8217;s basically a summary of the whole chapter and thus a useful way to recap the most important concepts. I found this section particularly useful when using the book as a design pattern reference, after reading it for the first time: this section provides a quick and essential overview of each pattern &#8212; and the most important DOs and DON&#8217;Ts, too.</p> +<h3>Part <span class="caps">III</span>: Patterns for Ruby</h3> +<p>By the time you get to Part <span class="caps">III</span> you&#8217;ll definitely feel that Ruby can do <em>more_. Some of the Ruby implementation of certain patterns described in the book make extensive use of blocks and Proc objects, and the @method</em>missing@ method (although potentially dangerous unless extra care is taken) gives us a more immediate way to obtain delegation, for example when creating Proxies. <br /> +Also the fact that objects can be modified at runtime by adding and removing methods &#8220;as needed&#8221; seems quite an underused feature in traditional patterns, simply because those patterns were first conceived for languages which are very different from Ruby and are perhaps less <em>liberal</em> than Ruby when it comes to dynamic features<sup class="footnote" id="fnr10"><a href="#fn10">10</a></sup>.</p> +<p>These particular Ruby features can be used (and abused, of course) to implement more Ruby-esque patterns, such as the ones included in this part of the book:</p> +<ul> + <li>Internal Domain-Specific Languages</li> + <li>Meta-Programming</li> + <li>Convention Over Configuration</li> +</ul> +<p>These are just examples, of course some may complain because the Active Record or <span class="caps">ORM</span> pattern are missing, but this is understandable as it may be considered too specific compared to the others. <br /> +Each pattern is examined in detail, and I particularly like way the <span class="caps">DSL</span> pattern was described: Chapter 16 explains how to develop a simple but effective Ruby <span class="caps">DSL</span> from scratch for creating file backups. This can be particularly useful for people who never tried creating DSLs before, but also for developers who tried, but want to improve their skills.</p> +<p>Chapter 18 (Convention Over Configuration) is sufficiently clear and detailed, perhaps even too much if you already know how Rails was developed (and all the hype which follwed).</p> +<p>On the other hand, I was a bit disappointed by Chapter 17 (Meta-Programming). Maybe it&#8217;s because I built up extremely high expectations about it while reading the rest of the book, but it just felt too short and not detailed enough for my liking. If I had to write such a chapter (which would have been actually very hard), I would have started from an excellent post by Ola Bini<sup class="footnote" id="fnr11"><a href="#fn11">11</a></sup> which introduces <em>eleven</em> meta-programming techniques, and built up content and examples from there. The only reason why &#8212; I think &#8212; Russ didn&#8217;t do it in his book was length/balance constraint: a <em>properly detailed</em> chapter about meta-programming in Ruby could easily take up over forty pages!</p> +<h3>The Verdict</h3> +<p>As I said in the beginning: this is not meant to be a complete, in-depth, reference book on everything you may want to know about design patterns in Ruby. That&#8217;s why, as a matter of fact, you can actually read this book all the way through without getting utterly bored. Russ uses an informal, yet appropriate style to turn potentially complex, theorethical computer science principles into easy-to-understand, <em>useful</em> tools which can truly improve the way you code.</p> +<p>The whole book flows very very nicely. I actually recommend reading this book in sequence, without skipping chapters, because each pattern is described in a way that is somehow linked to the following ones, so that you can understand and learn about the pros and cons of each one in a more natural and useful way.</p> +<p>OK, I would have loved to see Part <span class="caps">III</span> as long as Part II, probably, but overall I&#8217;m very, very satisfied of what the book taught me. The only problem is that it also made me suddenly realize all the naive design mistakes I&#8217;ve been making when coding in Ruby, so I&#8217;ll now feel compelled to fix at least some of them&#8230;</p> +<p>Definitely a worthwhile read, I just hope to see more books like this, or even a second edition of this one soon!</p> +<h3>Notes</h3> +<p class="footnote" id="fn1"><a href="#fnr1"><sup>1</sup></a> <a href="http://www.informit.com/store/product.aspx?isbn=0321490452">Design Patterns in Ruby</a> by Russ Olsen, Addison Wesley Professional, 2007.</p> +<p class="footnote" id="fn2"><a href="#fnr2"><sup>2</sup></a> Think of <a href="http://www.pragprog.com/titles/ruby">Programming Ruby: The Pragmatic Programmer&#8217;s Guide, 2nd Ed.</a> by Dave Thomas with Chad Fowler and Andy Hunt, Pragmatic Programmers, 2004.</p> +<p class="footnote" id="fn3"><a href="#fnr3"><sup>3</sup></a> <a href="http://www.informit.com/store/product.aspx?isbn=0201633612">Design Patterns: Elements of Reusable Object-Oriented Software</a>, by By Erich Gamma, Richard Helm, Ralph Johnson, John M. Vlissides (a.k.a. the <em>Gang of Four</em>), Addison Wesley Professional, 1994.</p> +<p class="footnote" id="fn4"><a href="#fnr4"><sup>4</sup></a> For more information on the <span class="caps">YAGNI</span> principle, visit <a href="http://www.xprogramming.com/Practices/PracNotNeed.html">You&#8217;re <span class="caps">NOT</span> gonna need it</a>, Ronald E Jeffries.</p> +<p class="footnote" id="fn5"><a href="#fnr5"><sup>5</sup></a> See <a href="http://on-ruby.blogspot.com/2007/12/design-patterns-in-ruby-review.html">Design Patterns in Ruby, a review</a>, <em>On Ruby</em>blog.</p> +<p class="footnote" id="fn6"><a href="#fnr6"><sup>6</sup></a> See <a href="http://on-ruby.blogspot.com/2008/01/russ-olsen-interview.html">Russ Olsen Interview</a>, <em>On Ruby</em>blog.</p> +<p class="footnote" id="fn7"><a href="#fnr7"><sup>7</sup></a> <a href="http://ar.rubyonrails.com/">ActiveRecord</a> is an implementation of the Object-Relational Mapping (<span class="caps">ORM</span>) pattern used by the Ruby on Rails framework.</p> +<p class="footnote" id="fn8"><a href="#fnr8"><sup>8</sup></a> Distributed Ruby, see <a href="http://chadfowler.com/ruby/drb.html">Intro to DRb</a> by Chad Fowler.</p> +<p class="footnote" id="fn9"><a href="#fnr9"><sup>9</sup></a> <a href="http://www.fxruby.org/">FXRuby</a>, a graphical toolkit written in Ruby.</p> +<p class="footnote" id="fn10"><a href="#fnr10"><sup>10</sup></a> This can be a good or bad thing depending on the way you look at it, and what you want to use the language for. The fact that Ruby is dynamically typed makes it easier to do things which are totally impossible in C++ or Java, but it also introduces a whole new set of potential dangers.</p> +<p class="footnote" id="fn11"><a href="#fnr11"><sup>11</sup></a> <a href="http://ola-bini.blogspot.com/2006/09/ruby-metaprogramming-techniques.html">Ruby Metaprogramming Techniques</a>, Ola Bini: Programming Language Synchronicity.</p>
A contents/articles/distributed-programming-with-ruby-review.html

@@ -0,0 +1,99 @@

+----- +title: Book Review: Distributed Programming with Ruby +content-type: article +subtitle: Just what you need to get started with the right tools to build large and scalable applications in Ruby +timestamp: 1277206200 +tags: review|books|ruby +pdf: true +----- + + <section class="section"> +<p>Back when I read <em><a href="http://www.pragprog.com/titles/ruby/programming-ruby">Programming Ruby</a></em> for the first time, I distinctly remember a short reference to <a href="http://ruby-doc.org/stdlib/libdoc/drb/rdoc/index.html">dRb</a>, the <strong>D</strong>istributed <strong>R</strong>u<strong>b</strong>y library included in the Standard Library.</p> +<p><em>&#8220;Cool!&#8221;</em> &#8212; I thought</p> +<p>&#8230;and that was pretty much it. The documentation for DRb was pretty much nonexistent (at the time), I didn&#8217;t need it, so I pretty much forgot about it altogether until this book came out.</p> +<p><em><a href="http://www.informit.com/store/product.aspx?isbn=0321638360">Distributed Programming with Ruby</a></em> fills a very particular niche of the Ruby programming world: <em>distributed</em> programming. Moreover, this book is somehow <em>justified</em> by the scarce documentation on the subject:</p> +<blockquote> +<p>Although these libraries [DRb and rinda] have been included with Ruby for many years now, they have received little or no attention (or documentation). This has led to a lot of <span class="caps">FUD</span> (fear, uncertainty, and doubt) about what these libraries can and cannot do, and when they are appropriate to use (if at all).</p> +</blockquote> +<p style="padding-left:4em;">&#8212; Mark Bates, <em><a href="http://www.informit.com/store/product.aspx?isbn=0321638360">Distributed Programming with Ruby</a></em></p> +<p>But there&#8217;s more. This book gives the reader a complete overview of what&#8217;s out there, in the Ruby world, to support distributed programming. This includes quite a few gems and libraries besides the ones provided in the standard library.</p> +<section class="section"> +<header><h1 id="h_1" class="toc">Overview</h1></header> +<img src="/img/pictures/distributed-programming-with-ruby.jpg" style="float:right;" /> + <p>The book is organized into four parts, each dealing with a particular set of Ruby libraries related to distributed programming.</p> +<p>The author, <a href="http://www.metabates.com/">Mark Bates</a>, does a good job maintaining a sort of continuity in the examples throughout the book: you&#8217;ll get accustomed to a <em>Logger</em> class of some kind being punctually re-implemented more or less once per chapter, using a different library.</p> +<p>Additionally, the libraries described in the book are ordered by &#8220;reverse preference&#8221; in each part of the book, so normally the libraries described later on in a part fix some of the shortcomings of the preceding ones.</p> + + + + <section class="section"> +<header><h1 id="h_2" class="toc">Part I: Standard Library</h1></header> +<p>This part is the most important of all: it gives you the very basics about Distributed Programming and it describes the &#8220;building blocks&#8221; (<a href="http://ruby-doc.org/stdlib/libdoc/drb/rdoc/index.html">DRb</a> and <a href="http://ruby-doc.org/stdlib/libdoc/rinda/rdoc/index.html">Rinda</a>) used in nearly all the other libraries described in the book. If you want you can skip some chapters in the other parts of the book, but make sure this part is crystal clear in your head before proceeding any further.</p> + +</section> + + <section class="section"> +<header><h1 id="h_3" class="toc">Part II: Third-Party Frameworks and Libraries</h1></header> +<p>If you read part I, you&#8217;re probably a bit disappointed by DRb and Rinda and the amount of code you have to write to make simple things work in a distributed environment. The good news is that there are some Ruby gems out there that can make life simpler:</p> +<ul> + <li><a href="http://seattlerb.rubyforge.org/RingyDingy/">RingyDingy</a></li> + <li><a href="http://rufy.com/starfish/doc/">Starfish</a></li> + <li><a href="http://github.com/markbates/distribunaut">Distribunaut</a></li> + <li><a href="http://github.com/mperham/politics">Politics</a></li> +</ul> + +</section> + + <section class="section"> +<header><h1 id="h_4" class="toc">Part III: Distributed Message Queues</h1></header> +<p>In this part, the author introduces more in detail the concept of distribute message queues, and also the technologies and protocols available not only in the Ruby world but elsewhere. It focuses on two libraries:</p> +<ul> + <li><a href="http://rubyforge.org/projects/starling/">Starling</a>, originally used by Twitter.</li> + <li><a href="http://github.com/tmm1/amqp"><span class="caps">AMQP</span></a>, an implementation of the <a href="http://www.amqp.org/"><span class="caps">AMQP</span></a> protocol in Ruby, that can be used in conjunction with <a href="http://www.rabbitmq.com/">RabbitMQ</a>, an Erlang-based messaging system.</li> +</ul> + +</section> + + <section class="section"> +<header><h1 id="h_5" class="toc">Part IV: Distributed Programming with Ruby on Rails</h1></header> +<p>The book ends somewhat abruptly with this last part that deals with distributed programming in the Rails world. It feels a bit like a last-minute addendum that I would have left for an appendix, nevertheless it briefly introduces <a href="http://backgroundrb.rubyforge.org/">BackgrounDRb</a> and <a href="http://github.com/tobi/delayed_job">Delayed Job</a>.</p> + +</section> + +</section> + +<section class="section"> +<header><h1 id="h_6" class="toc">Technical Analysis</h1></header> +<p>Unlike other technical books, this one can (must?) be read sequentially. Generally each chapter focuses on a library, describes how to install it and use it, and highlights its pros and cons. Typically, the &#8220;cons&#8221; are solved in the following chapter by another library, and so on&#8230;</p> +<p>The book is not meant to contain a full technical reference of each library, and it&#8217;s quite short (256 pages), so you really get the most out of it if you read it all, from start to finish. I didn&#8217;t realize there were so many different libraries in this particular niche of Ruby programming, and Mark does a good job demistifying some of them.</p> +<p>One thing that really struck me out of this book is the focus on gems. We&#8217;re not talking about <em>mainstream</em> frameworks like Rails or Merb here, but rather of some rather specialized, smaller libraries that fullfill very specific tasks. Personally, I don&#8217;t remember any other Ruby book doing this in the same way, and I was quite happy about it.</p> +<p>On the other hand, gems are a double-edged sword: while some of them are really cool and well-maintained, others may disappear tomorrow with no prior notice. I was actually very surprised to see even some of the <em>quirks</em> of these gems documented in the book:</p> +<p><strong>p91</strong>: <em>&#8220;Notice that we added client { } to the bottom of the server file. The reason for this appears to be a bug or flaw in the Starfish architecture.&#8221;</em></p> +<p>Really? Hasn&#8217;t it be fixed now? Apparently not, that&#8217;s the way it works, so no, you can&#8217;t blame the author of the book for this.</p> + + <section class="section"> +<header><h1 id="h_7" class="toc">Formatting and Readability</h1></header> +<p>As I pointed out earlier, this book is somehow meant to be read sequentially, and Mark does a good job making sure you don&#8217;t get bored. Chapters and sections are quite short and there&#8217;s a good text/code ratio: the examples are short and clear, and you don&#8217;t have to try them out yourself, because most of the time the author does it for you. It&#8217;s not infrequent for the author to tell you to run &#8220;wrong&#8221; code, but that&#8217;s a great way to show you how to do the right thing right afterwards.</p> +<p>Sidebars and boxes are used properly and they do provide actual value-added content: some information on a non-Ruby technology, some tips and tricks on how to run things smoothly, etc. On the other hand, one thing I couldn&#8217;t stand were the <em>endnotes</em>. I must say I don&#8217;t like endnotes at the best of times, but when they are pointless I just can&#8217;t suffer them. Each chapter has its own fair share of endnotes, but unfortunately most of them are just URLs to Wikipedia pages or RubyForce/GitHub projects: I would have preferred the URLs inline with the rest of the text, but that&#8217;s just me.</p> + +</section> + <section class="section"> +<header><h1 id="h_8" class="toc">Style and Contents</h1></header> +<p>Mark has a nice, informal writing style. Exactly what you expect from a programming book nowadays, even if sometimes it feels a bit too informal:</p> +<p><strong>p86</strong>: <em>&#8220;I think I understand what Eric means by all that. However, that is as deep as the documentation goes on the subject. I have not been able to test what I think he means, so I won&#8217;t make any grand promises about what the library can and cannot do in regards to expiring/renewing registrations.&#8221;</em></p> +<p>Although this is not something you&#8217;d see in a professional book everyday, it definitely helps to connect with the reader: Mark is one of us after all, even if he happens to have created quite a few <a href="http://github.com/markbates">interesting projects</a>, like the Mack framework, the Distribunaut library (which is also mentioned in his book, but in a very impartial way) and Configatron. From his book you understand that he&#8217;s neither one of those rockstar developers nor one of those famous authors who just writes books for a living: he&#8217;s a competent programmer who knows quite a bit about a particular, but relevant, niche of Ruby programming.</p> + +</section> + +</section> + +<section class="section"> +<header><h1 id="h_9" class="toc">Final Thoughts</h1></header> +<p>This is one of those books I&#8217;d like to see a second edition of. Partly because there are some relatively new gems which have been left out (<a href="http://github.com/kwi/BrB">BrB</a>, for example), partly because this is a rather hot topic at the moment, and different solutions are popping out at a rather extreme rate.</p> +<p>The decision to write about mainly about gems was bold but necessary, and I&#8217;d really like to see more authors doing that, but with extra care. From reading this book, you understand that there&#8217;s no <em>silver bullet</em> when it comes to Distributed Programming, but rather different tools to do different jobs.</p> +<p>The thing I missed the most? A proper conclusion to the book. You&#8217;re left with two chapter about Rails-specific libraries which could have easily become appendixes, and nothing else. I would have liked a sort of &#8220;summing up&#8221; end chapter (re-)highlighting the pros and cons of each library and a sort of feature matrix.</p> +<p>Nevertheless, it was well worth my time and it proved to be a very good resource to get started in writing distributed Ruby programs.</p> + +</section> + +</section>
A contents/articles/efficient-ruby-code-shortcut-review.html

@@ -0,0 +1,41 @@

+----- +title: Book Review: Writing Efficient Ruby Code +content-type: article +timestamp: 1200890820 +tags: ruby|review|books +----- +<p style="float:right;"><img src="/files/efficient_ruby_shortcut.jpeg" alt="" /></p> +<p>The second shortcut from Addison-Wesley Professional series I&#8217;m going to review is called <a href="http://www.informit.com/store/product.aspx?isbn=0321540034">Writing Efficient Ruby Code</a>. A very promising title, especially considering that this book is only 50 pages long.</p> +<p>As usual, this shortcut can be intended as a sort of programmer-friendly detailed cheatsheet: like the other ones in this series it sports a monitor-friendly landscape layout and does not go to deep into the details unless strictly necessary to understand a particular concept.</p> +<h3>The Author</h3> +<p><a href="http://railsexpress.de/blog/">Dr. Stefan Kaes</a>, the author, contributed a lot to improve Ruby on Rails&#8217; performance by refactoring portions of its core and try to &#8220;get maximum speed out of performance-critical sections of code&#8221;. This short but interesting shortcut groups together a lot of performance tweaks, tips and tricks but also some &#8220;anti-patterns&#8221; Kaes was able to identify through his career as programming teacher Ruby software consultant and key Rails contributor.</p> +<h3>The Contents</h3> +<p>Like with the previously-covered <a href="/articles/mongrel-shortcut-review">Mongrel shortcut</a>, <em>Writing Efficient Ruby Code</em> always goes straight to the point when it comes to identify problems. The first one mentioned is of course that the <em>Ruby Interpreter is Slow</em>, most people are aware of that, due to their direct experience or because this argument is normally used by non-Rubyists to argue the language&#8217;s usability in commercial projects. What you may not know is why that is so, and that&#8217;s where the first part of this book comes into play.</p> +<blockquote> +<p><em>&#8220;Ruby is a highly dynamic language: Almost all language entities are first-class citizens in that they can be created, changed, and destroyed at runtime. This comprises classes, modules, methods, constants, and class and instance variables. Only local variables are second-class citizens in Ruby: Whether a name refers to a local variable is determined at parse time.</em></p> +</blockquote> +<p>This makes Ruby extremely flexible, but also more complex. Whever you use a name to refer to an object, Ruby has to search for the object it refers to, and this costs in terms of processing time.</p> +<p>As a matter of fact, one of the most recurring tips in the book to improve code performance is the following:</p> +<p style="text-align:center;"><strong>Method calls are expensive, use variables directly when possible.</strong></p> +<p>Keep this in mind: <code>self.something</code> is <em>not</em> the same as <code>@something</code>. The end result is the same, but the first way costs more in terms of performance because Ruby has to look up the method name.<br /> +Similarly, <strong>local variables <em>should</em> be introduced as a way to &#8220;cache&#8221; the result of method calls</strong>. Often you may feel &#8220;guilty&#8221; to introduce a new variable and keep calling the same method over and over: this should definitely be avoided.</p> +<p>Other useful tips include, for example:</p> +<ul> + <li>Use syntax constructs (e.g. assignments) as expressinons. Use evaluation precedences.</li> + <li>Use interpolated strings <code>"... #{string_variable}"</code> (there&#8217;s also no performance difference if constant strings are used between <code>"</code> or <code>'</code>)</li> + <li>Use operators which update the data structure without copying it (when possible). Use <code>update</code> or <code>merge</code> to update hashes.</li> + <li>Iterating using <code>for a in A</code> is slightly faster than performing the same iteration using <code>each</code>, (it is the opposite in Ruby 1.9 though)</li> + <li>do not use <code>return</code> unless you have to</li> + <li>test in order of expected case frequency</li> + <li>Use parallel assignment (<code>a, b = 5, 6</code>) where applicable</li> + <li>If a module gets included in only one other class (or module), it’s preferable to open the class instead.</li> +</ul> +<p>I deliberately chose not to elaborate any further on the tips listed above because otherwise I&#8217;ll give a big chunk of the contents of the book itself. If you know Ruby enough, you may already know why such reccommendations make sense, but if you don&#8217;t, <em>Writing Efficient Ruby Code</em> can be a short but very interesting read.</p> +<h3>The Good</h3> +<p>For each of the 30 &#8220;coding patterns&#8221; (and consequent anti-patterns) described in the book, the author does a great job explaining the reasons of doing something in a particular way, also through examples and benchmarks, where possible.</p> +<p>Furthermore, this <em>shortcut</em> can really be useful to grasp a few difference between Ruby 1.8.5, 1.8.6 and 1.9 in terms of performance: not all the patters apply to all Ruby implementations, and when that&#8217;s the case it is clearly stated.</p> +<h3>The Bad</h3> +<p>My only complaint about the book is probably the lack of details and more &#8220;specialized&#8221; patterns. Everything (except for a few Rails-specific tips) normally apply to Ruby <em>as a whole</em>, without going deeply to analyze specific libraries or third-party gems. As a result, once you get the general idea, some of the patters may seem pretty obvious or a logic consequence of others.</p> +<p>It is also true that this is meant to be a <em>shortcut</em>, not a comprehensive analysis on code optimization techniques which can be applied to specific cases: something like this would require much more than 50 pages!</p> +<h3>The Bottom Line</h3> +<p>Read it, re-read a few bits of it to make sure you grasp the most important concepts, and keep its table of contents in front of you as a reminder when refactoring your code!</p>
A contents/articles/firefox-lovers-guide-to-opera.html

@@ -0,0 +1,198 @@

+----- +title: A Firefox Lover's Guide to Opera +content-type: article +subtitle: An in-depth review of the Opera browser, with the eyes of a Firefox enthusiast +popular: true +timestamp: 1198847940 +tags: browsers|review|opera|firefox +----- +<blockquote> +<p><strong>Note:</strong> This article can be considered a sequel for <a href="http://www.h3rald.com/articles/ie-lovers-guide-to-firefox">An IE Lover&#8217;s Guide to Firefox</a>, which described Firefox through the eyes of an Internet Explorer fan. Similarly, this article describes Opera&#8217;s features from the point of view of a user &ndash; myself &ndash; who has been using Firefox for years and is now considering another browser switch.</p> +</blockquote> +<p>I am a Firefox fan. I&#8217;ve been using Firefox since it was named &#8220;Firebird&#8221; and calling it &#8220;stable&#8221; was a big overstatement. Firefox dragged me out of Internet Explorer, and that was definitely one of its biggest achievements.</p> +<p>Because I&#8217;m addicted to trying out new tools, however, I always kept testing new browsers I discovered here and there. K-Meleon, Flock, Sleipnir&#8230; When Safari came out for Windows I immediately installed it and used it for about 2 hours, only to realize that it wasn&#8217;t &ndash; and it still isn&#8217;t &ndash; usable at all, mainly due to sporadic crashes.</p> +<p style="float:right;"><img src="/files/opera/fast.jpg" alt="" /></p> +<p>Similarly, I&#8217;ve been trying out <a href="http://www.opera.com/">Opera</a> periodically, as new releases came out, but again it didn&#8217;t seem to work for me. The biggest complaint I had was its inability to render heavily-ajaxified web sites properly. However, now it seems that the Opera Development Team made a big effort to improve the browser, and I was pleased to notice that <a href="http://www.opera.com/products/desktop/next/">Opera 9.5b</a> (&#8220;Kestrel&#8221;) doesn&#8217;t seem to have this sort of problems at all.h3. Planning the Switch</p> +<p>Firefox has extensions. Plenty of them actually. Some are useful, like the newish Del.icio.us one made by Yahoo, and also crappy ones you&#8217;ll never use unless you want to have a fancy button on one of your over-cluttered toolbars which enables you to interface more easily with X or Y web services you hardly ever use.</p> +<p>By contrast, Opera never attempted to add full-blown extension support to its venerable and yet very powerful browser. Instead, they kept building more and more features right into its core, being careful not to undermine the browser&#8217;s two proverbial qualities: <em>speed</em> and <em>stability</em>. What seemed a doomed philosophy at first turned out to be a good thingin the long run. More and more people are getting more and more worried about Firefox&#8217;s memory issues and begin to <em>wander off</em> to explore new things, exactly like I did.</p> +<p>The first step to switch from Firefox to Opera is to reduce the number of Firefox extensions to the bare minimum you need:</p> +<ul> + <li>Colorzilla</li> + <li>Web Developer</li> + <li>MeasureIt</li> + <li>Search Status</li> + <li>Gmail Manager</li> + <li>Secure Login</li> + <li>Del.icio.us</li> +</ul> +How many extensions do you <em>actually</em> use? Here&#8217;s a short analysis for the ones above: +<ul> + <li>The first three are related to Web Development only, which means that I don&#8217;t need them unless I&#8217;m doing some web-development tests during which I&#8217;m always going to have more than one browser open anyway. <strong><span class="caps">UPDATE</span>:</strong> there are a few <a href="http://widgets.opera.com/search/?order=name&amp;q=ruler">Ruler</a> widget which can be used instead of MeasureIt <em>(thanks <strong>Ameer</strong>)</em>.</li> + <li>SearchStatus gives me Alexa Rank and Google Pagerank: I think I can survive without those for a while. <strong><span class="caps">UPDATE</span>:</strong> if not, there&#8217;s always <a href="http://www.puzzleclub.ru/files/seobar/">SEObar</a> <em>(thanks <strong>Ameer</strong>)</em>.</li> + <li>I use Gmail Manager because my girlfriend uses Gmail on the same computer. I&#8217;m switching to Opera and she&#8217;ll stick with Firefox, so no problem there&#8230;</li> + <li>Secure Login? It&#8217;s called <em>Wand</em> and it has been built-in into Opera for the last decade or so.</li> + <li>Del.icio.us &ndash; OK, I won&#8217;t be able to access my favorite tags as quickly, but <a href="http://erlang.no/2005/10/06/delicious-opera-buttons-2/">someone</a> already came out with a few handy buttons for a better integration with the popular social bookmarking service.</li> +</ul> +<blockquote> +<p><strong><span class="caps">UPDATE</span>:</strong> For a list of the features provided by Firefox extensions which are included in Opera, see Rijk&#8217;s <a href="http://files.myopera.com/Rijk/blog/extensions.html">Top 150 Popular Firefox Extensions and Opera</a></p> +</blockquote> +<p style="float:right;"><img src="/files/opera/opera_navigation.png" alt="" /></p> +<p>Because I&#8217;m addicted to betas, I immediately downloaded <a href="http://www.opera.com/products/desktop/next/">Opera Kestrel</a>, i.e. Opera 9.50 beta 1. I never actually liked Opera&#8217;s default theme, so I started looking around for <strong><a href="http://my.opera.com/community/customize/skins/">new skins</a></strong> (yes, eye-candy matters sometimes) and came across the Ximple series by <a href="http://my.opera.com/community/customize/skins/author/?id=serafins">serafins</a>. In particular, <a href="http://my.opera.com/community/customize/skins/info/?id=3835">2nd thought &#8211; Jimple</a> quickly became my favorite.</p> +<h3>Tabs</h3> +<p><em>&#8220;Opera is the Web pioneer that delivered tabbed browsing in 2000 [&#8230;]&#8221;</em></p> +<p>Opera tabs <em>feel</em> stable and mature. Why? Probably because tabs are used more consistently to open not only web pages but also:</p> +<ul> + <li>Downloads (&#8220;Transfers&#8221;)</li> + <li><span class="caps">RSS</span> feeds</li> + <li>Notes</li> + <li>Emails</li> + <li>Bookmarks</li> + <li>Widget Management</li> + <li>Contacts</li> + <li>History</li> + <li>Page Links</li> +</ul> +<p>I think this is a great feature and Firefox should definitely consider it: v3.0 comes with new download and bookmark managers, but they&#8217;re still dialogs. Yes, I know, there&#8217;s probably some extension which allows you to display them in the sidebar, but that&#8217;s not the point: Opera brings more consistency to the overall browsing experience by using tabs wherever they should be used.</p> +<p>Additionally, Opera tabs&#8230;</p> +<ul> + <li>Can be rearranged, exactly like Firefox tabs</li> + <li>Can be restored, if closed accidently, by re-opening them from the Trash can</li> + <li>Can be locked, meaning that they can&#8217;t be closed accidently</li> + <li>Can be duplicated</li> + <li>Can be saved in groups (sessions) and re-opened later on</li> + <li>Can be restored if Opera crashes</li> +</ul> +<h3>Speed Dial</h3> +<p>When you open Opera for the first time, and <em>whenever you open a new empty tab</em> the Speed Dial is displayed. What I originally thought it was one of the most annoying things introduced by Opera 9 turned out to be actually useful and very addictive.</p> +<p>The idea behind it is simple:</p> +<ul> + <li>Show a default page with 9 slots</li> + <li>Allow users to drag links to those slots</li> + <li>Display preview of each slot (which is cached and can be updated by refreshing the page)</li> + <li>Allow users to quickly access pages saved in the Speed Dial via CTRL+1 .. CTRL+9 or simply by clicking them.</li> +</ul> +<p>Simple and effective. Once you get going with it, you&#8217;ll overcome the initial feeling of imposition and you&#8217;ll use it more and more: I literally can&#8217;t live without it now!</p> +<h3>Right-click goodies</h3> +<p>While I was testing Opera, my girlfriend came along and asked me to look something up on <a href="http://www.imdb.com/"><span class="caps">IMDB</span></a>. I normally had <span class="caps">IMDB</span> as custom search engine in Firefox, but unfortunately Opera didn&#8217;t seem to allow users to customize their search engines&#8230;</p> +<p>Totally wrong. Not only Opera lets you add any search engine to the search bar, it also does it with style and in the easiest way possible:</p> +<p style="float:right;"><img src="/files/opera/search_engines.png" alt="" /></p> +<ol> + <li>Go to your search engine or any website with a search form</li> + <li>Right click the search field</li> + <li>Click <strong>Create Search&#8230;</strong></li> + <li>Specify a name and a keyword for your search engine</li> +</ol> +<p>Done. You&#8217;ll now be able to search that particular site directly from the search bar. As you can see, I added Wikipedia, <span class="caps">IMDB</span> and even the <a href="http://www.uesp.net/wiki/Main_Page">Unofficial Elder Scrolls Pages</a> in this way.</p> +<p>Besides creating searches, Opera lets you do a lot by right-clicking anywhere on a page:</p> +<ul> + <li><strong>Block Content</strong>: Right-click an empty area of any webpage and select <strong>Block Content</strong> to select which ads, scripts and images will be blocked from now on.</li> + <li><strong>Validate</strong>: Validate the <span class="caps">HTML</span> source code of the current page.</li> + <li><strong>Translate</strong>: Translate the current page into a foreign language with just two clicks.</li> + <li><strong>Open With</strong>: Open the current page in another browser installed on your system.</li> + <li><strong>Edit Site Preferences&#8230;</strong>: Choose to block/allow cookies and popups, identify Opera as another browser, set a different encoding, enable/disable scripts, images, flash, etc. These setting apply to the <em>current web site only</em>.</li> + <li>View source, reload page every X seconds/minutes, send by email, etc.</li> +</ul> +<h3>Widgets</h3> +<p><a href="http://widgets.opera.com/">Opera Widgets</a> must not be considered as Opera&#8217;s counterpart to Firefox extensions. Instead, Opera Widgets can be used as <em>poor man&#8217;s Vista Gadgets</em> on Windows XP, and they do their job most remarkably.</p> +<p>I&#8217;m personally very fond of these ones:</p> +<ul> + <li><a href="http://widgets.opera.com/widget/3683/">The Free Dictionary</a></li> + <li><a href="http://widgets.opera.com/widget/8461/">Wikipedia</a></li> + <li><a href="http://widgets.opera.com/widget/3687/">Calendar</a></li> + <li><a href="http://widgets.opera.com/widget/4513/">Whois Widget</a></li> + <li><a href="http://widgets.opera.com/widget/3689/">Currency Converter</a></li> + <li><a href="http://widgets.opera.com/widget/5118/"><span class="caps">HTML</span> Entities</a></li> + <li><a href="http://widgets.opera.com/widget/7206/">Twitter</a></li> +</ul> +<p>They all have a common trait: they all behave as standalone programs, as they should be. The Wikipedia one, for example, can display Wikipedia entries directly inside the widget, unlike some others which just take you to Wikipedia, which is rather pointless.</p> +<p>Although widgets live within Opera, they can be displayed &#8220;always behind&#8221;, which means they&#8217;ll be glued to your desktop and therefore will be visible whenever Opera and other applications are minimized.</p> +<p>Needless to say that anyone brave enough can make widgets for Opera by following a simple <a href="http://dev.opera.com/articles/view/opera-widgets-specification-1-0/">Widget Specification</a>.</p> +<h3>Everything you can do on the Internet</h3> +<p>The term <em>browser</em> applied to Opera is somehow misleading. Personally I would have called it something like &#8220;Internet Suite&#8221;, because that would be a better choice due to the features it offers and the things it can do.</p> +<p>Traditionally speaking, a web browser can be used to browse web pages, read feeds (sometimes) and navigate through <span class="caps">FTP</span> directories. Here&#8217;s what Opera can handle:</p> +<p style="float:right;"><img src="/files/opera/files.png" alt="" /></p> +<ul> + <li>Web Pages &ndash; No need of explanations here.</li> + <li><span class="caps">FTP</span> &ndash; <span class="caps">FTP</span> directories are listed very clearly, overriding server&#8217;s settings with a more user-friendly layout.</li> + <li>Local Files &ndash; This was a surprise for me. Typing <code>file://</code> will automatically load a list of the drives currently available on your machine. Similarly, auto-completion for directory and file names is supported! I almost started using Opera as my everyday&#8217;s file manager (almost).</li> + <li>Feeds &ndash; An embedded feed reader can be used to subscribe to <span class="caps">RSS</span>/Atom feeds and view them&#8230; in a tab, of course.</li> + <li>E-mails &ndash; Opera <em>is</em> also a pretty decent email client. As of version 9.5 full <span class="caps">IMAP</span> support has been added, which definitely makes the difference.</li> + <li><span class="caps">IRC</span> &ndash; Opera can be used as an client, which works pretty well. Who needs ChatZilla anymore?</li> + <li>News &ndash; Opera can be used to signup and retrieve news from newsgroups.</li> + <li>Gopher/<span class="caps">WAIS</span> &ndash; Although not used everyday, Opera can handle these old protocols as well.</li> + <li>BitTorrent Files &ndash; By default, Opera can act as a BitTorrent client as well, so you can just open .torrent files through the program and then monitor the download progress in the Transfers window, like with any other normal download. While this feature is indeed useful, it is also possible to <a href="http://www.opera.com/support/search/view/840/">disable it</a> and still use your favorite BitTorrent client.</li> +</ul> +<h3>Portability and Synchronization</h3> +<p>Let&#8217;s spend some words about <em>portability</em>. Sure, there are two &#8220;Portable Opera&#8221; apps out there, and they work well enough, but one thing I&#8217;d like about a web browser is the ability to synchronize my preferences, customizations, themes, passwords etc. etc. across multiple computers. <br /> +Firefox is <a href="http://labs.mozilla.com/2007/12/introducing-weave/">getting there</a>, although the technology is still at a very early stage.<br /> +Opera is doing something similar through <a href="http://link.opera.com/">Opera Link</a>, which allows you to synchronize automatically your Bookmarks, your Personal Bar and your Speed Dial. All you need is to get a (free) Opera account, login to Opera Link and enable the synchronization feature from the <em>File</em> menu. From now on every time you&#8217;ll modify your Speed Dial or Bookmarks, the changes will be sent to your Opera Link page. Similarly, whenever you start using opera somewhere else, if you login to your Opera Account you should be able to synchronize your Bookmarks and Speed Dial.</p> +<p>Here are some thoughts on this type of technology:</p> +<ul> + <li>It&#8217;s not totally private yet. While it&#8217;s great to be able to sync bookmarks and speed dial, the problems arise when you finish using your friend&#8217;s computer for example&#8230; what happens to the bookmarks you just sync&#8217;ed? The only way to delete them would be to have your friend to log in to his Opera account and re-sync them. Not enough privacy for my liking.</li> + <li>Your passwords, notes, widgets, etc. etc. cannot be synchronized yet, but that will hopefully be possible in near future.</li> + <li>Sync&#8217;ing bookmarks is pointless for me. Although Opera still hopes to compete with Del.icio.us &amp; Co., that will be very hard to achieve. I stopped using in-browser bookmarks long ago.</li> + <li>Link seems and interesting feature considering that Opera is available on virtually <em>any operating system</em> and a lot of different devices (mobile phones, Nintendo DS &amp; Wii, &#8230;).</li> +</ul> +<p>At any rate, it is still possible to &#8220;carry around&#8221; your personal opera settings by following the instructions provided on <a href="http://help.opera.com/Windows/9.50/en/backup.html">this page</a> which explains pretty much everything you need to know aboud Opera files and local storage.</p> +<h3>Advanced Features</h3> +<p>Opera looks more &#8220;polished up&#8221; than Firefox in most cases. The superb usage of tabs for nearly everything is one example, and another one is the possibility to apply skins (themes) on-the-fly, without having to restart the browser. <br /> +Firefox <em>can</em> do this via the <a href="http://labs.mozilla.com/2007/12/personas-for-firefox/">Personas</a> extension, but Opera had this built-in for a long time.</p> +<p>To apply a new skin:</p> +<ol> + <li>Go to the <a href="http://my.opera.com/community/customize/skins/">Skins Directory</a></li> + <li>Download a skin you like</li> + <li>Opera will download and apply the skin immediately, <strong>and it will ask you whether you want to keep it or not</strong>. If you choose not to, it won&#8217;t save it in your profile (very useful for quick previews). Neat.</li> +</ol> +<p>Another quality opera always excelled to is accessibility. Besides using the interface in the traditional way, it is also possible to:</p> +<ul> + <li><strong>Use <a href="http://www.opera.com/products/desktop/mouse">mouse gestures</a></strong> &ndash; I wasn&#8217;t a big fan of this until I bothered reading the excellent documentation Opera provided for them (which is significantly better than <a href="http://www.mousegestures.org/">the Firefox&#8217;s equivalent</a>). It can be quite useful at times.</li> + <li><strong>Use <a href="http://www.opera.com/products/desktop/keyboard/">keyboard shortcuts</a></strong> &ndash; Believe it or not, you can literally <a href="http://www.opera.com/support/tutorials/nomouse/">use Opera without a mouse</a>.</li> + <li><strong><a href="http://www.opera.com/products/desktop/voice/">Speak</a> to it</strong> &ndash; Opera&#8217;s voice integration is getting better and better. Not only you can effectively <a href="http://www.opera.com/support/tutorials/voice/">tell your browser what to do</a>, you can also use the built-in text-to-speech function (Windows only) to have it read entire pages for you. It actually works quite well and it can parse punctuation well enough to apply the right intonation. Just for fun, I had it read it an Italian page&#8230; and it actually worked as expected: it was like listening to an American reading an Italian text using US pronuntiation!</li> +</ul> +<p>Finally, power users will be delighted of the way opera lets you hack the program settings, as you can:</p> +<ul> + <li>Use <strong>Tools &gt; Quick Preferences</strong> to block/unblock popups, cookies, Java applets, images, etc.</li> + <li>Use <strong>Tools &gt; Advanced</strong> to access detailed information concerning cookies, cache (it lists every image/object cached!), plug-ins, Wand passwords, etc.</li> + <li>Use <strong>Tools &gt; Appearence&#8230;</strong> to access and manage appearance-related settings, like skins, toolbars, buttons and panels</li> + <li>Use <strong>Tools &gt; Preferences&#8230;</strong> to access general preferences (all the rest)</li> + <li>Type in <strong>opera:config</strong> to view and tweak Opera&#8217;s internal settings, somehow like Firefox&#8217;s about:config, but much cleaner and easier to use.</li> + <li>Download the <strong><a href="http://dev.opera.com/tools/">Developer Console</a></strong> to have a simpler alternative to Firefox&#8217;s Web Developer Toolbar extension, to view <span class="caps">DOM</span> elements, <span class="caps">CSS</span> and Javascript information.</li> +</ul> +<h3>Annoyances</h3> +<p>After using as main browser for a few weeks now, I can say that it&#8217;s great but not perfect yet. It&#8217;s very advanced, faster and more mature than any other browser, of course,but there are a few things which should be fixed or improved.</p> +<p>In particular:</p> +<ul> + <li><strong>It&#8217;s not open source</strong> &ndash; This may not matter to someone, but some people consider this an essential requirement for their browser, and that&#8217;s why Firefox is their most obvious choice. Although Opera is free, it is proprietary software after all, which means is definitely not as open as you may want it to be. Personally I&#8217;m not too bothered, as I&#8217;m starting to think that too much openness may lead to too many unuseful and bloated extensions and make the program somehow &#8220;unpredictable&#8221; and heavy.</li> + <li><del><strong>No address bar search</strong> &ndash; Amazingly, only Firefox seems to have this feature built-in. I&#8217;m referring to the ability to type whatever in the address bar to be redirected to the site returned by a Google&#8217;s <em>I&#8217;m feeling lucky</em> search. It is possible to emulate this feature in Opera by creating a custom search for <em>I&#8217;m Feeling Lucky</em> and assign it a short keyword like &#8220;l&#8221;. In this way, for example, typing in <code>l h3rald</code> should lead you to this website. Not quite as immediate as in Firefox though.</del></li> + <li><del><strong>No find as you type</strong> &ndash; Another big disappointment for who comes from Firefox or Safari: Opera still uses a dialog box to perform page searches.</del></li> + <li><del><strong>No spell clecking</strong> &ndash; Again, both Firefox and Safari now offer text fields spell checking. Opera doesn&#8217;t yet.</del></li> + <li><del><strong>No <span class="caps">HTML</span> mail composer</strong> &ndash; Opera&#8217;s built-in mail client can display <span class="caps">HTML</span> emails but doesn&#8217;t yet allow users to create them.</del></li> + <li><del><strong>Auto-start widgets?</strong> &ndash; This is a feature enhancement Opera Dev Team should consider: allow users to configure certain widgets to start automatically when Opera starts.</del></li> + <li><del><strong>Google Reader + Flash problems</strong> &ndash; Sometimes I experiences some scrolling problems when reading news which contain embedded flash movies on Google Reader.</del></li> + <li><strong>Corporate Sites</strong> &ndash; Unfortunately some corporate web site do not support Opera or are not displayed correctly in Opera. Unfortunately there&#8217;s nothing much we can do about it but trying to &#8220;mask&#8221; Opera as another browser (via <strong>right-click &gt; Edit Site Preferences&#8230;</strong>)</li> + <li><del><strong>Default Browser Problems</strong> &ndash; Setting Opera as default browser on Windows doesn&#8217;t seem to set the file icons accordingly (or worse, it resets them to the default file icon).</del></li> +</ul> +<p><strong><span class="caps">ERRATA</span>:</strong></p> +<ul> + <li>It is possible to have Opera to redirect you to the right after typing a few words in thr address bar by setting Google&#8217;s &#8220;I&#8217;m feeling lucky&#8221; as default search engine <em>(thanks <strong>EJ902</strong>)</em>.</li> + <li>Spell Checking is <a href="http://www.opera.com/support/tutorials/opera/spellcheck/">supported</a> via <span class="caps">GNU</span> Aspell <em>(thanks <strong>cvm</strong>)</em> or by using <a href="http://opera.gt500.org/ospell/">Ospell</a> for inline spell checking <em>(thanks <strong>Dava</strong>)</em>.</li> + <li>Find as you type can be triggered by pressing <code>.</code> and typing <em>(thanks <strong>cvm</strong>)</em>.</li> + <li>It is possible to auto-start widgets by saving a session with all your widget open and reloading it at every startup [CTRL+F12 &gt; General &gt; Startup &gt; Continue saved sessions] <em>(thanks <strong>Tamil</strong> &amp; <strong>Ameer</strong>)</em>.</li> + <li>As of the <a href="http://my.opera.com/desktopteam/blog/">latest snapshot</a>, setting Opera as default browser and handler for <span class="caps">HTML</span> files doesn&#8217;t cause any problems <em>thanks <strong>Ayush</strong>)</em>.</li> +</ul> +<h3>Conclusion</h3> +<p>Despite the few annoyances listed in the previous section, Opera 9.5 beta 1 truly impressed me. I was waiting for Opera to get better before switching and now I&#8217;ve not been using Firefox for a few weeks.<br /> +Although Opera offers a lot of features, there&#8217;s still room for improvements, especially for what concerns integration with third party services: I would really like to see some sort of integration with del.icio.us, and that could be possible via widgets at least. <br /> +Regarding the new Opera Link feature, it looks very promising and a potential competitor for Mozilla Weave even though it will be used mainly to get more and more users to register to the Opera community (I did, at least), which is indeed very active any way.</p> +<p>To conclude this article, which still barely scratches the surface of this very powerful application, I&#8217;d like to praise two more things about Opera:</p> +<p><span style="float:right; margin:3px;"><br /> +<script type="text/javascript"> +digg_url = 'http://digg.com/software/A_Firefox_Lover_s_Guide_to_Opera'; +</script> +<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script><br /> +</span></p> +<ul> + <li>Their website network, and in particular their truly excellent documentation knowledge base, which is very comprehensive of references, tutorials and interesting articles. I am a full time technical writer myself, and I&#8217;ve hardly ever come across better documentation.</li> + <li>Their extensive <a href="http://www.opera.com/docs/specs/">support and compliance to web standards</a>, which makes Opera the most advanced browser ever made.</li> +</ul> +<p>If you&#8217;ve not tried Opera before, or if you&#8217;ve always dismissed it because &#8220;X browser is better&#8221;, you may want to <a href="http://www.opera.com/products/desktop/">give it another shot</a>: for me it was definitely worthwhile!</p>
A contents/articles/firefox3-revealed.html

@@ -0,0 +1,20 @@

+----- +title: Firefox 3 Revealed +content-type: article +timestamp: 1213670760 +tags: firefox|browsers|writing|review|books +----- +<p>When the SitePoint staff asked me to write an article summing up all the new features of Firefox 3, I gladly accepted: I wrote about Firefox before, and I thought it was just going to be a 2-3 hours job maximum. <br /> +After diving deeper into Firefox 3 development, reading dozens of different blogs and scouting Mozilla&#8217;s web sites, I realized I was wrong: Firefox 3 introduced <em>a lot</em> of new things, and keeping track of all of them, I admit, was quite a hard task.</p> +<p>Nevertheless, I wrote the article and delivered it to SitePoint in time fore the release, but my editor &#8220;complained&#8221; that 8,300+ words was about 3 times over the minimum requirements for a feature article! <br /> +<em>&#8220;I don&#8217;t really think that people can read the whole thing online&#8221;</em> &mdash;, he said, and I somehow agreed.</p> +<p>In the end, they decided to pack my &#8220;article&#8221; into a 30-pages <span class="caps">PDF</span> eBook which can be downloaded <em>absolutely free of charge</em> from SitePoint web site as well, so here it is:</p> +<p style="float:left;"><img src="/files/ff3-revealed.png" alt="" /></p> +<p><br /><br /> +<span style="font-size: 1.5em;"> <strong><a href="http://firefox.s3.sitepoint.com/ff3-revealed.zip">Firefox 3 Revealed</a></strong> </span></p> +<p>If you prefer though, you can still read the article directly on SitePoint, <a href="http://www.sitepoint.com/article/firefox-3-whats-new-whats-hot">here</a>.</p> +<p>This guide aims to give you a comprehensive overview of virtually <em>all</em> the new features and improvements introduced by Firefox 3.</p> +<p><br /><br /></p> +<p>I would like to thank the whole SitePoint staff for giving me the opportunity to write this eBook, and in particular <strong><a href="http://magain.com/blog/">Matthew Magain</a></strong> for his help and support (and for creating the <span class="caps">PDF</span> on a Sunday evening!).<br /> +Additionally, I would also like to thank the Mozilla Development Team for their awesome job with Firefox 3 and everyone else who made this eBook possible.</p> +<p><strong>Update:</strong> Feel free to <strong><a href="http://digg.com/software/FireFox_3_Revealed_Free_ebook_from_SitePoint">digg</a></strong> this eBook!</p>
A contents/articles/from-firefox-to-deer-park.html

@@ -0,0 +1,7 @@

+----- +title: From Firefox to... Deer Park? +content-type: article +timestamp: 1132509930 +tags: firefox|browsers|review +----- +On May 31st 2005 the Mozilla Foundation silently released the Deer Park browser... no, it's not another name change for Firefox, but the codename they gave to the long-awaited 1.1 release of the free, famous, award-winning browser. Actually what we have for now is just a non-feature complete developer preview release of the new milestone, the first alpha release, in other words. The alpha release nevertheless seems to be fully functional and already useable.ETAs for the actual stable version are not given as usual, but we should expect another alpha candidate soon hopefully (They wrote "June" on the <a href="http://www.mozilla.org/projects/firefox/">roadmap</a>, and we're already in July). Anyhow, this developer-oriented preview release can be <a href="http://www.mozilla.org/projects/firefox/">downloaded</a> and installed on Windows, Linux, and Mac OS X systems plus eventually, <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/deerpark/alpha1/contrib/">Solaris and others</a>. The decision of using the codename Deer Park instead of naming the release Firefox 1.1 alpha 1 or something of the like was made to avoid the havoc which occurred before the official release of Firefox 1.0 (which was codenamed "Phoenix" by the way,) when some websites offered a late preview release as the actual new version to download.<br />This time when you install and run the program the Firefox name has been substituted with Deer Park Alpha 1, so for example Deer Park is used in the browser's title bar and in the "About Deer Park Alpha 1" menu under "Help". The icon they used for this testing release is not even the usual firefox icon - it represents a plain blueish globe with no fox whatsoever. They have definitely put in effort this time to avoid confusion.<br /><br />Furthermore, when the browser is installed it does not overwrite your existing firefox installation, simply because (on windows) it's installed under a directory named "Deer Park Alpha 1". As a side note, the process is "firefox.exe", so you cannot run Firefox and Deer Park at the same time: you'll just open another window of the browser which is already running. Having said this, let us now examine what is new in this developer's release.<br /><br /><strong>Fixed bugs</strong><br />Like any other Firefox Release, Deer Park comes with several <a href="http://www.squarefree.com/burningedge/releases/1.1a1.html">Bug Fixes</a>. On the official changelog there are many bugs reported to be fixed, sometimes they are hardly noticeable but I experienced some of them when browsing some websites and also when creating applications myself:<br /><br />- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=103638">103638</a> - Targets with same name in different windows open in wrong window with javascript.<br />- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=97283">97283</a> - Mouse wheel scrolling does not work for elements such as div using overflow - auto or scroll.<br />- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=251986">251986</a> - Keyboard scrolling does not work for elements such as div using overflow - auto or scroll.<br />- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=245829">245829</a> - Download manager progress and title do not update correctly, wrong number of files and percentage after finishing or cancelling a download.<br /><br />These are in my opinion the most notable of the notable bugs which have been fixed in this release. I was particularly relieved when I noticed that all the issues regarding scrolling divs or similar elements had been resolved. Also, it must be noted that Deer Park seems overall slightly faster than Firefox 1.0.4 (Note: I also have a Pentium II, that is why I could notice that probably). The speed increase is most probably caused by the base for Deer Park being the Mozilla 1.8 Beta 2 code, which is almost 1 year newer than what used for Firefox 1.0.<br /><br /><br /><strong>New Features</strong><br />Although announced as a non-feature complete release, it comes with some new and useful features. The new feature list includes nothing too extraordinary for now and they are all somehow minor changes but they really do represent some improvements. Perhaps the two most obvious features introduced with this release are the <em><strong>Sanitize Deer Park</strong></em> and the <em><strong>Report Broken Sites</strong></em> functions. The first one is accessible through the Tools menu and basically allows you to delete the Browsing History, Saved Form Information, Saved Passwords, Download History, Cookies and Cache. Actually you can accomplish the same feat via Options->privacy, but with Sanitize you need just one click. Convenience I suppose?<br /><br />The Report Broken Sites feature is reachable via the Help menu and basically starts a short wizard that you can use when you notice something wrong with a website. You just have to provide the url of the website, the problem you experienced (Browser not supported, cannot login, plugin not installed, other content missing, odd behaviou, odd appearence, etc.) and an optional description and email and then the report will be submitted to the Mozilla Deleopers.<br /><br />Additional features included are also <em>Image thumbnails as Tab icons</em>, used when viewing a single image with firefox, not a shocking feature really but it's just a little (tiny) bit of eyecandy I guess. Furthermore, when you try accessing an FTP server anonymously and that server doesn't allow anonymous access, you are prompted to provide appropriate credentials (before it just didn't let you in)... another little improvement, which probably will not change your life, but it's nice to know that it's there.<br /><br />Another more notable feature only for linux and mac users though allows changes made in the Preferences menu to be applied immediately without restarting your system. Using Windows on the other hand, they improved the option interface with a more extensive use of tabbed interfaces, and also additional options concerning tabbed browsing (BUT in my opinion the <a href="https://addons.mozilla.org/extensions/moreinfo.php?id=158&application=firefox">tabbrowser preferences</a> extension is still necessary to achieve certain behaviours).<br /><br />Regarding something more technical, among the so-called developers features there are various improvements regarding CSS support, in particular CSS2's <a href="http://www.w3.org/TR/CSS21/generate.html#quotes-specify">quotes nesting</a> and even some new CSS3 (!) features, like <a href="http://www.w3.org/TR/css3-multicol/">Multi-column layouts</a> the :only-child selector, overflow-x and overflow-y properties and even various new <a href="http://www.w3.org/TR/css3-ui/#cursor">cursors names</a>.<br />Even more news from Mozilla suggests that Deer Park already supports some functions for resolution-independent scalable vector graphics (SVG 1.1), but it's obviously just experimental, and even scriptable bitmap drawing surface (<a href="http://developer-test.mozilla.org/docs/Drawing_Graphics_with_Canvas">Canvas</a>). Last but not least, even support for <a href="http://www.w3.org/MarkUp/Forms/">Xforms</a> is already possible in Deer Park through a <a href="http://www.mozilla.org/projects/xforms/">related project/extension</a>. <br /><br /><br /><strong>Final Thoughs</strong><br />Again the Mozilla Foundation - with this fully functional but yet incomplete preview release,- seem to be always improving their foundations, and always offering support for new technologies and features before others. This release has certainly seen some great improvements, on the other hand hardly anything changes for website developers with this release. It is without a doube that websites are viewed better with Deer Park than with Firefox 1.0.4 or IE or any other browser for that matter. But it is impossible to even start planning at this stage for the development of a publicly accessible site using for example SVG graphics and Xforms, as visitors using other browsers will not be able to see any "magic" in them, or perhaps even view them at all.<br /><br />It's always the same paradox of web-development: where on one side of the coin there are new and better products are available, a website/online application should be accessible by at least 90-95% of visitors. Unfortunately, for now though 90-95% of all internet users seem to use <em>some other product</em> instead of Firefox or Deer Park... But that's another story!<br />
A contents/articles/getting-started-with-lithium.html

@@ -0,0 +1,88 @@

+----- +title: Getting Started with Lithium +content-type: article +timestamp: 1256654880 +tags: li3|php|tutorial +----- +<p>So <a href="http://li3.rad-dev.org/">Lithium</a> is now officially out, and its 0.1 release can be freely <a href="http://rad-dev.org/lithium/versions">downloaded</a> from the official web site or by cloning the Lithium git repository. The good news is that although not many web hosts offer <span class="caps">PHP</span> 5.3, you can try it out youself, locally and with minimum effort.</p> +<h3>Requirements</h3> +<p>According to the <a href="http://rad-dev.org/wiki/guides/setup">Lithium Wiki</a>, to develop applications with Lithium you need:</p> +<ul> + <li>A web server, like Apache or <span class="caps">IIS</span></li> + <li><span class="caps">PHP</span> 5.3.0 or higher</li> + <li>Git (not required, but all example projects are on git repos, so you may as well have it)</li> +</ul> +<p>For this tutorial, more specifically, you need to download (just download, don&#8217;t install anything!):</p> +<ul> + <li><a href="http://code.google.com/p/mongoose/">mongoose</a>, a tiny, standalone (as <em>in one single file</em>), cross-platform web server.</li> + <li><a href="http://www.php.net/downloads.php#v5"><span class="caps">PHP</span> 5.3.0</a>, not the installer, the zip package.</li> + <li><a href="http://rad-dev.org/lithium/versions">Lithium</a> (version 0.1, at the time of writing)</li> + <li>The <a href="http://rad-dev.org/li3_docs">li3_docs plugin</a>.</li> +</ul> +<p>To get the li3_docs plugin you need to <a href="http://rad-dev.org/users/add">register</a> on rad-dev.org, and clone the li3_docs git repository. If you don&#8217;t have git installed or you don&#8217;t want to read <a href="http://spheredev.org/wiki/Git_for_the_lazy">another awesome tutorial</a> to install it and learn how to use it, I&#8217;ll save you the hassle and let you download the plugin from <a href="/files/li3_docs.zip">here</a>, for this time ony.</p> +<p><b>Note:</b> This tutorial assumes that you are on Windows. If you are not, some things may be a bit different depending on your platform.</p> +<h3>Setting up the environment</h3> +<p>Choose a directory on your sistem (let&#8217;s call it <b>D:\lithium_test</b> from now on). We&#8217;ll do everything in here, and you can move it anywhere you like afterwards, even on a <span class="caps">USB</span> stick, without breaking anything.</p> +<ol> + <li>Unzip Lithium in <b>D:\lithium_test</b>, so that it contains the following files and directories: + <ul> + <li>app/</li> + <li>libraries/</li> + <li>.htaccess (it won&#8217;t actually be used in this tutorial)</li> + </ul></li> + <li>Unzip <span class="caps">PHP</span> 5.3.0 somewhere and copy the following files to the <b>D:\lithium_test</b> folder: + <ul> + <li>php5.dll</li> + <li>php-cgi.exe</li> + <li>php.ini (just get php.ini-development from the <span class="caps">PHP</span> package and rename it)</li> + </ul></li> + <li>Copy the mongoose-2.8.exe executable in <b>D:\lithium_test</b> and rename it to <b>mongoose.exe</b> for convenience.</li> + <li>Create a <b>mongoose.conf</b> file containing the following lines:</li> +</ol> +<div class='text'><pre><code>cgi_interp php-cgi.exe +cgi_ext php</code></pre></div><p>If you did everything correctly, your <b>D:\lithium_test</b> directory should contain the following:</p> +<ul> + <li>app\</li> + <li>libraries\</li> + <li>.htaccess</li> + <li>mongoose.exe</li> + <li>mongoose.conf</li> + <li>php-cgi.exe</li> + <li>php.ini</li> + <li>php5.dll</li> +</ul> +<h3>Running Lithium</h3> +<p>Double click <b>mongoose.exe</b> and point your browser of choice to <a href="http://localhost:8080/app/webroot/index.php">http://localhost:8080/app/webroot/index.php</a>. You should see the Lithium temporary homepage (yes, I expected something fancier too):</p> +<p><img src="/img/pictures/lithium/temp_homepage.png" alt="" /></p> +<p>Now, let&#8217;s see if we can get the li3_docs plugin running as well:</p> +<ol> + <li>Unzip <b>li3_docs.zip</b> and copy the <b>li3_docs</b> folder in <b>D:\lithium_test\app\libraries\plugins</b>.</li> + <li>Open <b>D:\lithium_test\app\config\bootstrap.php</b> and add the line: <code>Libraries::add('plugin', 'li3_docs');</code> at the end. I actually found this commented out already (line 80).</li> +</ol> +<p>Go to <a href="http://localhost:8080/app/webroot/index.php?url=docs">http://localhost:8080/app/webroot/index.php?url=docs</a>, you should see something like this:</p> +<p><img src="/img/pictures/lithium/li3_docs.png" alt="" /></p> +<p>Congratulation, you&#8217;re now running your first Lithium application!</p> +<h3>Fixing URLs</h3> +<p>Once the initial excitement wears off you&#8217;ll notice that none of the links on the docs page works.</p> +<p>That&#8217;s because the mongoose web server does not support <span class="caps">URL</span> rewriting (and Lithium needs it badly right now), so we have to change the way URLs are created. <a href="http://twitter.com/nateabele">@nateabele</a> gave me <a href="http://pastium.org/view/3a966c1446fcbd1d4f5a94d882256987">some tips</a> on how to do this; it&#8217;s very simple:</p> +<ol> + <li>Create a directory called <b>action</b> in <b>D:\lithium_test\app\extensions</b>.</li> + <li>Create a file called <b>Request.php</b>, containing the following:</li> +</ol> +<div class='php'><pre><code>&lt;?php +namespace app\extensions\action; + +class Request extends \lithium\action\Request { + + protected function _base() { + return '?url='; + } +} +?&gt;</code></pre></div><p>We&#8217;re basically extending the <code>\lithium\action\Request</code> with a custom class, telling Lithium how to create the base <span class="caps">URL</span>.</p> +<p>After doing so, open <b>D:\lithium_test\app\webroot\index.php</b> and change:</p> +<p><code>echo lithium\action\Dispatcher::run();</code></p> +<p>into:</p> +<code>echo lithium\action\Dispatcher::run(new app\extensions\action\Request());</code> +<p>In this case, we&#8217;re instructing the dispatcher to use our custom Request class instead of the default one.</p> +<p>Now everything should work as expected. Reload the docs page (<a href="http://localhost:8080/app/webroot/index.php?url=docs">http://localhost:8080/app/webroot/index.php?url=docs</a>) and verify that the links work by navigating to <code>Lithium</code>, then <code>action</code> and finally <code>Controller</code>.</p> +<p>Now you can use Lithium to display its own <span class="caps">API</span> locally (if things didn&#8217;t work out, there&#8217;s always <a href="http://li3.rad-dev.org/docs">http://li3.rad-dev.org/docs</a>).</p>
A contents/articles/git-for-the-locals.html

@@ -0,0 +1,51 @@

+----- +title: Git for the Locals +content-type: article +timestamp: 1216095480 +tags: programming +----- +<p><em>&#8220;This is a <strong>local</strong> shop for <strong>local</strong> people, we want no trouble here!&#8221;</em></p> +<p>&mdash; Edward, <a href="http://en.wikipedia.org/wiki/League_of_gentlemen">The League of Gentlemen</a></p> +<p>I&#8217;m normally quite cautious when it comes to IT novelties like new frameworks, new methodologies and similar, especially when it feels like they&#8217;re over-hyped. Especially nowadays, it is sometimes very hard to tell whether something new is over-hyped or really a Good Thing&#8482; without spending some time looking into it. And especially nowadays, finding the time to look into something new can be a real challange.</p> +<p>I deliberately didn&#8217;t look into Git properly since it went &#8220;mainstream&#8221; (maybe I shouldn&#8217;t use this word), but when <a href="http://www.spheredev.org/wiki/Git_for_the_lazy">this tutorial</a> came out I couldn&#8217;t resist. Sure, I knew Git was an amazingly fast distributed version control system, that <a href="http://github.com/">GitHub</a> offered free accounts, that all the cool guys were slowly starting to use it in place of Subversion, etc. etc.</p> +<p>What I didn&#8217;t realize though, that the most obvious advantage of this <span class="caps">DVCS</span> was the fact that it was <strong>distributed</strong>, i.e., it <em>didn&#8217;t need</em> a centralized server.</p> +<p>Let me repeat this: <strong>Git <em>doesn&#8217;t need</em> a centralized server.</strong></p> +<p>Really.h3. &#8230;But it&#8217;s not user-friendly!</p> +<p>If you&#8217;re a Windows user and you used Subversion before, chances are that you got accustomed to <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>, too. TortoiseSVN is &mdash; in a way &mdash; a nice graphical fron-end to <span class="caps">SVN</span> which provides seamless Windows Explorer integration. <br /> +Git doesn&#8217;t have anything like that yet. There&#8217;s something in the works, sure, but nothing really comparable to TortoiseSVN. Therefore, you are <em>kindly suggested</em> to get on and use the command line for all your git stuff.</p> +<p>Oh well, I personally love using command line interfaces for certain tasks, event if I spend more time on Windows than on any other OS and well, the <span class="caps">DOS</span> prompt is no way near to bash &amp; Co.</p> +<p>For the <del>lazy gits</del> Windows users, <a href="http://code.google.com/p/msysgit/">MSysGit</a> is the answer to all your problems. <em>Officially</em> you have to install Cygwin and all its crap to be able to use Git on Windows. Not that Cygwin is bad, but I personally don&#8217;t like the extra layer it creates between you and an OS symulation which is not really what&#8217;s on your machine.It would be great if you could get all the Bash goodies natively, without the hassle.</p> +<p>that&#8217;s basically what you get for free when you install MSysGit: the best (to date) version of Bash you could possibly dream of for Windows, along with a few handy Gnu tools and of course all git commands.<br /> +In a few click, you&#8217;ll be able to use Git (and Bash!) right away: no tricks, no hassle, no kidding.</p> +<p>And stop moaning about the command line not being user friendly. You want a new repository <em>anywhere</em>? Just type in the following:</p> +<div class='text'><pre><code>git init +git add . +git commit</code></pre></div><p>This will create your new repository in the current directory, add all your files and filders recursively, and perform the initial commit. What&#8217;s so hard in this? Nothing. And it&#8217;s faster than <span class="caps">SVN</span>, for sure.</p> +<h3>Are you local?</h3> +<p>&#8220;Being local&#8221; has its own advantages: you know where you stand, you know what to expect, you don&#8217;t depend on other people. What I didn&#8217;t fully realize about Git is that it can be a 100% <em>local</em> repository.</p> +<p>The three Git commands I mentioned earlier can be used to create a repository <em>there</em>, exactly where you are: not on a server far, far away.<br /> +Let&#8217;s see what this means:</p> +<ol> + <li>You don&#8217;t need an Internet connection anymore to use a <span class="caps">VCS</span></li> + <li>You don&#8217;t get a .svn folder in <em>every</em> damn directory of your project, with a load of crappy files in it.</li> + <li>You get only a .git folder <em>at top level</em>, and that&#8217;s where your repository actually is. Granted, there are going to be quite a few files in there, but they&#8217;re not going to be scattered all over the place</li> + <li>You can physically copy your repository anywhere and still use it</li> + <li>You don&#8217;t need to signup to GitHub for an account, if you only want your own <span class="caps">VCS</span></li> +</ol> +<p>OK, this is an extreme scenario, but sometimes you may want your <em>own</em> local repository for your stuff. You may want a place to version your documents, or a place to version your own little pet programming project nobody knows about.<br /> +With Git, you can get all the advantages of a <span class="caps">VCS</span> (and an <em>incredibly fast</em> <span class="caps">VCS</span>) without having to setup any server infrastructure: just install Git on your machine, and you&#8217;re done. No server processes, no hassle.</p> +<h3>Don&#8217;t connect, synchronize</h3> +<p>All the information your repository needs is stored in that little .git folder, nowhere else. You can copy your files and that folder, and you&#8217;ll still get your repository back wherever you are. Maybe you can zip it before copying it, and then unzip it where you need a <span class="caps">VCS</span>, event.</p> +<p>I tried using some synchronization utilities like SyncToy or RoboCopy on Windows to keep my files synchronized on multiple computers: it all started off from the fact that I can&#8217;t use <span class="caps">SSH</span> at work, so I wouldn&#8217;t be able to push my commits back to a central repository online like GitHub.</p> +<p>So here&#8217;s what I did:</p> +<ol> + <li>I setup a local repository for my project on a local folder at work.</li> + <li>I started working on my project, did a few commits.</li> + <li>After performing the last commit for the day (you are encouraged to commit often by Git, really), I synchronized that folder with my <span class="caps">USB</span> key, via SyncToy.</li> + <li>Back at home, I used SyncToy again to synchronize my files (including the repository) between the <span class="caps">USB</span> key and my home computer.</li> + <li>Performing a <code>git status</code> showed that some files have been modified (all of them, actually): that&#8217;s because Git detected that they weren&#8217;t the same files which were committed, presumably because of different timestamps etc.</li> + <li>All I did was a <code>git reset --hard</code> to get <em>exactly</em> the same files I committed at work, with absolutely no information loss.</li> +</ol> +<p>Isn&#8217;t it a bad thing to move your git folder back and forth and let another program to synchronize files within it? Maybe, but it seems to work so far. A safer option, in this case, may be zipping the folder before synchronizing it, just to be sure.</p> +<h3>Conclusion</h3> +<p>Git can do much more than this. Git offers some really interesting branching features, for example, which I didn&#8217;t mention in this article, of course, like several dozens of other commands. What I tried to point out was that Git can be used by <em>anyone</em>, as a fast, simple and very effective private <em>local</em> repository. In case you need one, that is (if you are really <em>local</em>).</p>
A contents/articles/glyph-020-released.html

@@ -0,0 +1,76 @@

+----- +title: Glyph 0.2.0 Released +content-type: article +subtitle: Featuring single-file compilation, programmatic usage and auto-regeneration, and more +timestamp: 1273417200 +tags: glyph|ruby|opensource +----- + + <section class="section"> +<p>I am very pleased to announce the second release of the <a href="/glyph/">Glyph Document Authoring Framework</a>. For those who don&#8217;t know, Glyph is a pure-Ruby, extensible solution to author documents like books or articles using a simple, fully-customizable markup language.</p> +<p>Since the <a href="/articles/introducing-glyph/">first release</a>, came out, last month, a lot happened. Plenty of bugs were fixed and new features implemented, as shown by the <a href="http://github.com/h3rald/glyph/blob/master/CHANGELOG.textile">changelog</a>. Here&#8217;s a brief rundown of the most notable changes.</p> +<section class="section"> +<header><h1 id="h_1" class="toc">What Glyph code looks like</h1></header> +<p>Earlier this week I <a href="http://blog.h3rald.com/making-a-custom-vim-syntax-file">blogged</a> about my new <a href="http://github.com/h3rald/stash/blob/master/.vim/syntax/glyph.vim">Glyph vim syntax file</a>. I&#8217;ve been using it for a while, and all I can say is that it really helps! Here&#8217;s what it looks like:</p> +<p><img src="/img/pictures/glyph_syntax.png" /></p> +<p>I&#8217;m sorry for the Emacs and TextMate folks, but I only use Vim, so I only made a Vim syntax file. Anyhow, Glyph grammar is very simple, so rolling out your own syntax file for your favorite editor shouldn&#8217;t be too hard.</p> +</section> +<section class="section"> +<header><h1 id="h_2" class="toc">Notable features</h1></header> +<section class="section"> +<header><h1 id="h_3" class="toc">Single-file compilation</h1></header> +<p>Perhaps the most life-changing feature in this release is the possibility of compiling a single Glyph source file into an <span class="caps">HTML</span> or <span class="caps">PDF</span> file. This means you no longer need to create a full-blown project for writing a short article: just create a file anywhere and run <code>glyph compile filename.glyph</code>on it!</p> +<p>The good thing is that with this new release you can also define snippets, configuration settings, and even macros right into your Glyph files, so you can do almost anything without having to create a project or fiddle with <span class="caps">YAML</span> files.</p> +</section> +<section class="section"> +<header><h1 id="h_4" class="toc">Programmatic usage</h1></header> +<p>The second most notable feature is the possibility to use Glyph as a Ruby library, i.e. as you&#8217;d use a filter like RedCloth or MarkDown. Additionally, it is also possible to compile single files programmatically, so you can, for example, create <span class="caps">PDF</span> files for your articles from the same source file. Don&#8217;t believe me? Feel free to click the <em>Download <span class="caps">PDF</span></em> and <em>View Source</em> links on this very page to see for yourself&#8230;</p> +<p>For those of you using the awesome <a href="http://nanoc.stoneship.org">nanoc</a> static site generator, here&#8217;s a few source files you may want to take a look at:</p> +<ul> + <li><a href="http://github.com/h3rald/h3rald/blob/master/lib/glyph-data.rb">lib/glyph-data.rb</a> &#8212; How to update configuration settings.</li> + <li><a href="http://github.com/h3rald/h3rald/blob/master/lib/glyph-filter.rb">lib/glyph-data.rb</a> &#8212; a simple Glyph filter.</li> + <li><a href="http://github.com/h3rald/h3rald/blob/master/Rules">Rules</a> &#8212; a rule using the <code>Glyph#compile</code> method to generate <span class="caps">PDF</span> files.</li> +</ul> +</section> +<section class="section"> +<header><h1 id="h_5" class="toc">Auto-regeneration</h1></header> +<p>Another very interesting feature is the possibility to auto-regenerate your output files automatically whenever a source file is changed. Just run <code>glyph compile --auto</code> and you&#8217;re away. I&#8217;d like to thank <a href="http://koraktor.github.com">Sebastian Staudt</a> for proposing, implementing, and testing this feature.</p> +</section> +<section class="section"> +<header><h1 id="h_6" class="toc">Conditional macros</h1></header> +<p>Finally, although it may worry some, I added the possibility to evaluate conditional expressions directly in Glyph. The syntax is a bit verbose due to the extreme simplicity of Glyph parser, but it does the job:</p> +<p><code> +?[and[ + eq[$[document.output]|pdf]| + eq[$[tools.pdf_generator]|prince] + ]| + style[pagination.css]] +</code></p> +<p>The snippet above can be used to include the <code>pagination.css</code> stylesheet only when generating a <span class="caps">PDF</span> file with Prince <span class="caps">XML</span>.</p> +</section> +</section> +<section class="section"> +<header><h1 id="h_7" class="toc">What&#8217;s next?</h1></header> +<p>Release 0.3.0 is currently being planned, and so are its <a href="http://github.com/h3rald/glyph/issues">features</a>. For now, I&#8217;d like to thank the following individuals for contributing to Glyph:</p> +<ul> + <li><a href="http://www.jabbslad.com">Jamie Atkinson</a> (Jabbslad), for spotting and fixing some bugs and providing feedback.</li> + <li><a href="http://koraktor.github.com">Sebastian Staudt</a> (koraktor), for spotting and fixing some bugs, proposing and implementing new features.</li> +</ul> +<p>In particular, Sebastian is working on <a href="http://wiki.github.com/h3rald/glyph/feature-bibliography-support">bibliogaphy support</a> for Glyph, looking forward to it!</p> +<p>Although still in its infancy, Glyph is becoming more and more usable everyday. If you are interested, you can contribute in many different ways to the project, such as:</p> +<ul> + <li>By participating to discussions on the <a href="http://groups.google.com/group/glyph-framework">user group</a> (it&#8217;s a bit quiet of there for now&#8230;)</li> + <li>By spreading the word on Twitter, on your blog, or wherever you like.</li> + <li>By installing it, using it, reporting bugs and proposing new features (it&#8217;s just a <code>gem install glyph</code> away!).</li> + <li>By actually contributing to its development (it&#8217;s <a href="http://wiki.github.com/h3rald/glyph/contribution-guidelines">easy</a>!).</li> +</ul> +<p>Additionally, if you don&#8217;t like coding:</p> +<ul> + <li>feedback on the current documentation and on the <a href="http://github.com/h3rald/glyph/raw/master/book/output/pdf/glyph.pdf">Glyph book</a> is appreciated</li> + <li>if you are good with <span class="caps">CSS</span>, I&#8217;m looking for some nice new <span class="caps">CSS</span> styles to include in the standard Glyph distribution.</li> + <li>if you&#8217;re good with graphics, Glyph needs a good-looking logo&#8230;</li> +</ul> +<p>Any form of contribution will be credited in some way, e.g. by links and tweets.</p> +</section> + +</section>
A contents/articles/glyph-030-released.html

@@ -0,0 +1,84 @@

+----- +title: Glyph 0.3.0 Released +content-type: article +subtitle: The third release of the Glyph Authoring Framework features dramatic speed improvements, and much more +timestamp: 1276431000 +tags: glyph|ruby|opensource +----- + + <section class="section"> +<p>The third release of <a href="/glyph/">Glyph</a> is out!</p> + +<p>For those checking it out for the first time, Glyph is a <em>Rapid Document Authoring Framework</em> focused on extensibility and content reuse. For an example of what Glyph can do, have a look at Glyph's <a href="http://github.com/downloads/h3rald/glyph/glyph.pdf">free PDF book</a>.</p> + +<p>This release brings more stability to Glyph, more speed, and features affecting Glyph's core functionality. As a consequence, some <a href="http://github.com/h3rald/glyph/issues/closed#issue/121">incompatibilities</a> had to be introduced &ndash; but after all, better now than later.</p> + +<section class="section"> +<header><h1 id="h_1" class="toc">New parser and performance improvements</h1></header> +<p>This release's big news is the brand new <a href="http://yardoc.org/docs/h3rald-glyph/glyph/parser">Glyph Parser</a>. Until this release, Glyph relied on the awesome <a href="http://treetop.rubyforge.org/">Treetop</a> library for parsing Glyph language. Treetop is great when it comes to creating language parsers effortlessly, but it can add quite a bit of an overhead especially when using <a href="http://groups.google.com/group/treetop-dev/browse_thread/thread/15ff7659b2efbeed">dot star</a> patterns.</p> + + <p>So I ran a few benchmarks and in the end decided to write my very own (first!) parser from scratch using just the <a href="http://ruby-doc.org/core/classes/StringScanner.html">StringScanner</a> class, which is part of Ruby Standard Library. It took me a bit to get used to it, but in the end I managed to create something able to produce an Abstract Syntax Tree exactly the way I wanted.</p> + + <p>After adding the new parser, Glyph became significantly faster. This doesn't mean it's as fast as, say, RedCloth, but I it can be used to process long books in just a few <em>seconds</em> rather than <em>minutes</em>.</p> + +</section> + +<section class="section"> +<header><h1 id="h_2" class="toc">Macro Attributes</h1></header> +<p>Glyph now supports named attributes as well as positional parameters. This is particularly handy when you want to create macros with a lot of optional arguments: in this case, positional parameters are not great. As a result, for example, the <code>section</code> macro now takes an optional <code>title</code> and <code>id</code> attributes, rather than two parameters</p> + + <p>Attributes look like macros, but they all start with a <code>@</code> character. For example, see the the following image, showing this very section:</p> + + <img src="/img/pictures/updated_glyph_syntax.png" /> + +</section> + +<section class="section"> +<header><h1 id="h_3" class="toc">Full XML support</h1></header> +<p>Once macro attributes became available at parser level, having Glyph to produce arbitrary XML code became extremely easy. By default, now if Glyph doesn't find a macro it assumes you're inputting an XML tag of some kind, so you can write:</p> + + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>p[This is a paragraph with some em[emphasized] text.] +<span class="line-numbers"><a href="#n2" name="n2">2</a></span>img[ +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> @alt[Glyph Code] +<span class="line-numbers"><a href="#n4" name="n4">4</a></span> @width[50%] +<span class="line-numbers"><a href="#n5" name="n5">5</a></span> @height[50%] +<span class="line-numbers"><a href="#n6" name="n6">6</a></span> @src[glyph_code.png] +<span class="line-numbers"><a href="#n7" name="n7">7</a></span>]</pre></div> +</div> + + + <p>And get the following HTML code back:</p> + + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span><span class="tag">&lt;p&gt;</span>This is a paragraph with some <span class="tag">&lt;em&gt;</span>emphasized<span class="tag">&lt;/em&gt;</span> text.<span class="tag">&lt;/p&gt;</span> +<span class="line-numbers"><a href="#n2" name="n2">2</a></span><span class="tag">&lt;img</span> +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> <span class="attribute-name">alt</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">Glyph Code</span><span class="delimiter">&quot;</span></span> +<span class="line-numbers"><a href="#n4" name="n4">4</a></span> <span class="attribute-name">width</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">50%</span><span class="delimiter">&quot;</span></span> +<span class="line-numbers"><a href="#n5" name="n5">5</a></span> <span class="attribute-name">height</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">60%</span><span class="delimiter">&quot;</span></span> +<span class="line-numbers"><a href="#n6" name="n6">6</a></span> <span class="attribute-name">src</span>=<span class="string"><span class="delimiter">&quot;</span><span class="content">glyph_code.png</span><span class="delimiter">&quot;</span></span> +<span class="line-numbers"><a href="#n7" name="n7">7</a></span><span class="tag">/&gt;</span></pre></div> +</div> + + + <p>...and none of the macros used in the previosu Glyph code snippet are actually defined in Glyph. Among other things, this means that <em>you don't have to</em> use Textile or Markup within your Glyph code unless you absolutely need to (e.g. for lists, which would be a bit verbose to create using just Glyph markup).</p> + +</section> + +<section class="section"> +<header><h1 id="h_4" class="toc">Improved <code>include</code> macro and "safe mode"</h1></header> +<p>The <code>include</code> macro now <em>must</em> take an path to a file relative to the <code>text/</code> directory of your project, <em>or</em> it can also be used to include (and <em>evaluate</em>) ruby code within your <code>lib/</code> directory. Moreover, you can now use the <code>include</code> macro even when compiling single Glyph files.</p> + + <p>Now, while evaluating Ruby code in an external file can be quite handy, is also quite insecure. For this reason, it is now possible to use Glyph programmatically in "safe mode", thereby forbidding the usage of certain <em>unsafe</em> macros.</p> + +</section> + +<section class="section"> +<header><h1 id="h_5" class="toc">What's next?</h1></header> +<p>Sooner or later I'll have to implement support for generating multiple files in output. This would make it possible to make the <a href="http://github.com/downloads/h3rald/glyph/glyph.pdf">Glyph book</a> available online as a collection of separate HTML file, for example, or, later on, maybe even compiled into a (ugh!) CHM file.</p> + + <p>Additionally, HTML5 support is also on the horizon: given the current Glyph architecture, it will be relatively easy to have Glyph macros to produce HTML5 code instead of XHTML. LaTeX support, on the other hand, is a completely different game, mainly because I'm not familiar with it, so if anyone feels creative and would like an easier way to produce reusable LaTeX code, <a href="http://github.com/h3rald/glyph/">get forking</a> and contact me!</p> + +</section> + +</section>
A contents/articles/glyph-040-released.html

@@ -0,0 +1,69 @@

+----- +title: Glyph 0.4.0 Released +content-type: article +subtitle: Featuring web output, HTML5 support, stats, wkhtmltopdf, and much more +timestamp: 1283535900 +tags: glyph|ruby|opensource +----- + + <section class="section"> +<p>This new release of Glyph introduces an unusually large number of features, improvements and bugfixes. Not so much in terms of new macros maybe (no index or bibliography support for now, but it will come, don&#8217;t worry!), but rather&#8230; pretty much everything else!</p> + +<section class="section"> +<header><h1 id="h_1" class="toc">Web Output</h1></header> +<p>By far the biggest feature of this release is support for multi-file output, i.e. the possibility to transform your book into a web site. You&#8217;ve asked for it, I needed it too, and now it&#8217;s finally here.</p> +<p>An example? Sure. Take the <a href="http://github.com/downloads/h3rald/glyph/glyph.pdf">Glyph Book</a> (now a 98-page <span class="caps">PDF</span> file) for instance. My only regret was that a long <span class="caps">PDF</span> is quite heavy to digest and peruse, especially if you&#8217;re in a hurry. It would be so much nice to have it available online, in chunks of more manageable size.</p> +<p>Well, <a href="/glyph/book/">here it is</a>. That&#8217;s the very same document, split in several <span class="caps">HTML</span> files with a custom layout that matches this site&#8217;s. The good news is that you can do it too:</p> + +<div class="code"> +<pre> +<code> +section[ + @title[This title is compulsory] + @id[random_section] + @src[topic_file.glyph] +] +</code> +</pre> +</div> + <p>Note the <code>@src</code> attribute? It basically includes the specified topic file. So by creating a <code>document.glyph</code> file like <a href="http://github.com/h3rald/glyph/blob/master/book/document.glyph">this</a>, you can create a tidy table of contents (not a single <code>include</code> macro) <em>and</em> get a website for free. Glyph, as usual, takes care of anything for you, especially links between topics. Just link away like you did so far, nothing changes from previous versions, it will just work as expected (<a href="/glyph/book/compiling/compiling.html#web_output">read more</a>).</p> + +</section> +<section class="section"> +<header><h1 id="h_2" class="toc">HTML5 Output</h1></header> +<p>Compared to Web output, HTML5 support was trivial and only took a few hours to implement and test. You can now produce single-file HTML5-compliant documents (<code>html5</code> output format) or even HTML5-compliant web sites (<code>web5</code> output). Just using <code>section</code> tags instead of <code>div</code> tags made it worth it.</p> +<p>Of course, the default <span class="caps">CSS</span> files have been updated to be compatible with HTML5 output too.</p> + +</section> +<section class="section"> +<header><h1 id="h_3" class="toc">Project Statistics</h1></header> +<p>Anoher big thing was a shiny new command, <code>glyph stats</code>, which brings &#8212; guess &#8212; stats. No more chasing after bookmark references, just type <code>glyph stats --bookmark=#web_output</code> and you&#8217;ll know where the <code>#web_output</code> bookmark was defined <em>and</em> what links to it. Similar stats are available for:</p> +<ul> + <li>macros</li> + <li>links</li> + <li>files</li> + <li>snippets</li> +</ul> +<p><code>glyph stats -m</code> tells me that I used 3236 macro instances throughout the Glyph book. Just so you know.</p> + +</section> +<section class="section"> +<header><h1 id="h_4" class="toc">Custom tasks and commands</h1></header> +<p>&#8220;Glyph is extensible&#8221;, &#8220;Glyph lets you create your own macros&#8221;, &#8230;great, but kinda limited right? No more. Glyph now lets you create <em>custom Rake tasks</em> and even <em>custom commands</em>.</p> +<p>Have a look at <a href="/glyph/book/extending/commands_tasks.html">this page</a> for more information on what you can do and how. You can now extend Glyph in any way you like (including adding custom output formats) without having to touch its core, just do it <em>within your own project</em>.</p> + +</section> +<section class="section"> +<header><h1 id="h_5" class="toc">wkhtmltopdf</h1></header> +<p>Last but not least, you no longer need Prince <span class="caps">XML</span> to produce <span class="caps">PDF</span> file. Granted, Prince is awesome and the <span class="caps">PDF</span> it produces are very, very nice&#8230; but if you want to produce PDFs commercially and want to same some money, you can now use <a href="http://code.google.com/p/wkhtmltopdf/">wkhtmltopdf</a>: it&#8217;s <em>free</em> and <em>open source</em>, and it keeps getting better and better.</p> + +</section> +<section class="section"> +<header><h1 id="h_6" class="toc">...and more to come!</h1></header> +<p>After this release I&#8217;m going to take a small break from Glyph. Nothing major, I just want to redesign my site (again) and find the time to write a proper Glyph tutorial. This doesn&#8217;t mean that development will be halted or anything, just that it will take a few months for Glyph 0.5.0 to come out.</p> +<p>Meanwhile, there may be bugfix releases (depends how many bugs turn up). It would be a good time to come out of the closet and propose/vote on new <a href="http://github.com/h3rald/glyph/issues">features</a>!</p> +<p>Hope you enjoy using Glyph 0.4.0, and if you need anything or feel social, remember that the doors of the <a href="http://groups.google.com/group/glyph-framework">Glyph User Group</a> are always open!</p> + +</section> + +</section>
A contents/articles/glyph-050-released.html

@@ -0,0 +1,107 @@

+----- +title: Glyph 0.5.0 Released +content-type: article +subtitle: Featuring Calibre integration, macro composition, Turing-completeness, and more +timestamp: 1314559080 +tags: glyph|ruby|opensource +----- + + <section class="section"> +<p>Too much time passed since the last Glyph release. Way too much. Finally I found the time and will to tidy up the last few remaining bugs, update the docs, and release it!</p> +<p>This new release was mainly focused on extending the features of Glyph as a <em>language</em>. Besides a few improvements that make writing Glyph code easier and more readable (e.g. macro composition), Glyph is now Turing-complete. It supports iterations, recursion, variable assignments, basic arithmetics&#8230; you can even write a program to compute the factorial of an integer, if you wanted to.</p> +<p>Additionally, it also features enhanced content reuse through fragments and output-independent macros, and a few bugfixes.</p> + +<section class="section"> +<header><h1 id="h_1" class="toc">Calibre Integration</h1></header> +<p><a href="https://github.com/tammycravit">Tammy Cravit</a> proposed (and more or less implemented) an interesting new feature: integrate <a href="http://calibre-ebook.com/">Calibre</a> to generate ebooks in <span class="caps">EPUB</span> and <span class="caps">MOBI</span> format from Glyph&#8217;s native standalone <span class="caps">HTML</span> output format.</p> +<p>Although the support is still somewhat rough, you can, as a matter of fact, generate ebooks with Glyph, using Calibre.</p> + +</section> +<section class="section"> +<header><h1 id="h_2" class="toc">Macro Composition</h1></header> +<p>This release features an update at syntax-level: the possibility of &#8220;composing&#8221; macros, thereby eliminating nesting provided that containers take only one parameter and no attributes. What? This:</p> + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>?[ +<span class="line-numbers"><a href="#n2" name="n2">2</a></span> not[output?[pdf]]| +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> ... +<span class="line-numbers"><a href="#n4" name="n4">4</a></span>]</pre></div> +</div> + + +<p>Can be written like this:</p> + + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>?[ +<span class="line-numbers"><a href="#n2" name="n2">2</a></span> not/output?[pdf]| +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> ... +<span class="line-numbers"><a href="#n4" name="n4">4</a></span>]</pre></div> +</div> + + +<p>In this case, the <code>not</code> macro was composed with the <code>output?</code> macro, thus removing one level of nesting.</p> +<p>Additionally, I used this features to create an <code>xml</code> macro dispatcher that can be used to render raw <span class="caps">XML</span> tags, and an <code>s</code> macro dispatcher that basically is able to call nearly all the instance methods of the Ruby String class. So you can write things like <code>s/sub[This feature makes my life easier|/my/|your]</code> and similar.</p> + +</section> +<section class="section"> +<header><h1 id="h_3" class="toc">Turing-Completeness</h1></header> +<p>As of this version, Glyph can be considered <em>Turing-complete</em>, as it satisfies the following <a href="http://c2.com/cgi/wiki?LanguageRequirementsForTuringCompleteness">requirements for Turing-completeness</a>:</p> +<ul> + <li>A conditional construct, implemented via the <code>condition</code> macro.</li> + <li>Variable assignment, by setting the value of snippets using the <code>snippet:</code> macro and of attributes using the <code>attribute:</code> macro.</li> + <li>(infinite) iteration implemented through the new <code>while</code> macro or recursion, which is possible thanks to the new <code>define:</code> macro.</li> + <li>A memory model which emulates an infinite store: there are no enforced limits on attribute/snippets allocations and number of algorithms or parameters.</li> +</ul> +<p>Plus, Glyph now understand basic integer arithmetic:</p> + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>def:[factorial| +<span class="line-numbers"><a href="#n2" name="n2">2</a></span> ?[ +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> eq[{{0}}|0]|1| +<span class="line-numbers"><a href="#n4" name="n4">4</a></span> multiply[ +<span class="line-numbers"><a href="#n5" name="n5">5</a></span> {{0}} | factorial[subtract[{{0}}|1]] +<span class="line-numbers"><a href="#n6" name="n6">6</a></span> ] +<span class="line-numbers"><a href="#n7" name="n7">7</a></span> ] +<span class="line-numbers"><a href="#n8" name="n8">8</a></span>]</pre></div> +</div> + + <p>Not that you <em>need</em> to be able to calculate factorials in your documents, but know that now you <em>can</em>. An you can also define lexically scoped variables, err&#8230; <em>attributes</em>, like this:</p> + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>let[ +<span class="line-numbers"><a href="#n2" name="n2">2</a></span> @:[a|bits] +<span class="line-numbers"><a href="#n3" name="n3">3</a></span> @:[b|bobs] +<span class="line-numbers"><a href="#n4" name="n4">4</a></span> section[ +<span class="line-numbers"><a href="#n5" name="n5">5</a></span> @title[Something more about attributes] +<span class="line-numbers"><a href="#n6" name="n6">6</a></span>Attributes are like lexically scoped variables. You can use them to store @[a] and @[b]. +<span class="line-numbers"><a href="#n7" name="n7">7</a></span> ] +<span class="line-numbers"><a href="#n8" name="n8">8</a></span>]</pre></div> +</div> + + <p>Handy enough.</p> + +</section> +<section class="section"> +<header><h1 id="h_4" class="toc">Embeddable fragments</h1></header> +<p>Too lazy to create snippets? Feel the urge to re-use something you already wrote somewhere? Use a <em>fragment</em> and embed it, as follows:</p> + <div class="CodeRay"> + <div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span>Snippets and fragments ##[good_way|are a good way to reuse] small chunks of content, +<span class="line-numbers"><a href="#n2" name="n2">2</a></span>while the include and load macros <span class="error">&lt;</span>=[good_way] entire files.</pre></div> +</div> + + <p>&#8230;And you can also use a new <code>load</code> macro, to embed entire files without performing any evaluation (like <code>include</code> does).</p> + +</section> +<section class="section"> +<header><h1 id="h_5" class="toc">Incompatibilities with previous versions</h1></header> +<p>To sum up:</p> +<ul> + <li><code>snippets.yml</code> is no more, define all your snippets inside your document instead.</li> + <li>New &#8220;invisible space separator&#8221;: <code>\/</code> instead of <code>\.</code>. Because it&#8217;s slightly prettier, nothing else.</li> + <li>The <code>rewrite:</code> macro has been replaced by the <code>define:</code> macro, which also allows recursion, so be careful!</li> + <li>If you want to render raw <span class="caps">XML</span> tags, use <code>xml/tag_name</code> instead of <code>=tag_name</code>.</li> + <li>No more <code>match</code> macro, use <code>s/match</code> instead.</li> +</ul> +<p>For the full list of the issues fixed in this release, see the <a href="http://www.h3rald.com/glyph/book/changelog.html">Changelog</a>.</p> +<p>Hope you&#8217;ll enjoy this new release of Glyph. If you want to contribute, go ahead and <a href="https://github.com/h3rald/glyph">fork the repo</a>!</p> + +</section> + +</section>
A contents/articles/google-apps-for-your-domain.html

@@ -0,0 +1,67 @@

+----- +title: Google Apps for your domain: a shared hosting killer service? +content-type: article +timestamp: 1156737060 +tags: google|internet|ajax|web20|review +----- +<p>A while ago Google started offering services like <a href="http://mail.google.com/mail/">Google Mail</a> (Gmail) and <a href="http://www.google.com/calendar/">Google Calendar</a> to domain owners. Sure everyone likes Gmail, but one of the few bad things about it is that it never feels &#8220;unique&#8221;: your email address is always gonna be <something><code>gmail.com or &lt;something&gt;</code>googlemail.com. Not a big deal? Well, sure, not really, but it really depends on the people using the service and how fussy they are:</p> +<ul> + <li>small/medium business wouldn&#8217;t like this: @gmail.com gives farless credibility than @domain.com</li> + <li>When using Gmail with the Send As feature, messages will be sent &#8220;on behalf of&#8221;, and this can potentially mess things up as some spam filters don&#8217;t like it.</li> +</ul> +<p>Now it seems to be <a href="http://seattlepi.nwsource.com/business/1700AP_Google_Business_Applications.html">official</a>: Google is starting to offer customizable services to anyone who wish to sign up for it, not only as a restricted beta service.<br /> +What does this mean? Well, it can be the (free and easy) definitive web solution for small business, kids, grandmas and everyone who wants to establish a presence on the web by paying only the annual domain renewal fees&#8230;</p> +<h3>Included applications</h3> +<p>Note the title: <a href="https://www.google.com/a/">Google Apps</a> for your domain, not only Gmail. Here&#8217;s what you get:</p> +<ul> + <li><a href="http://mail.google.com/">Gmail</a> &#8211; You know what it offers: a state-of-the art <span class="caps">AJAX</span> interface, speed, reliability, very effective spam filter, loads of space, tagging (labels) stars and all the rest.</li> + <li><a href="http://www.google.com/calendar/">Google Calendar</a> &#8211; One of the best online calendar available. Features and <span class="caps">AJAX</span> interface, full integration with Gmail, ability to create private and public calendars, reminders,</li> + <li><em>Google Chat</em> &#8211; Google&#8217;s instant messenger, available through <a href="http://www.google.com/talk/">Google Talk</a> desktop application or online, seamlessly integrated in your Gmail interface.</li> + <li><a href="http://pages.google.com/">Google Web Pages</a> &#8211; aka Google&#8217;s page creator, easily create webpages using Google&#8217;s <span class="caps">WYSIWYG</span> online editor.</li> +</ul> +<p>Now, try imagining these four services combined and (almost) fully customizable&#8230; Still no idea? Well, keep reading for a list of all the included features.</p> +<h3>Included Features</h3> +<p>In order to use Google Apps for your domain, you must of course own a domain. The next step involves changing your domain&#8217;s MX entry to &#8220;<span class="caps">ASPMX</span>.L.<span class="caps">GOOGLE</span>.<span class="caps">COM</span>&#8221;, and follow the instructions to create an administration account for your Google applications, and after a while every email sent to your domain&#8217;s accounts will be routed to your new Google-powered inbox. Similarly, in order to use Google Page Creator on your domain, you&#8217;re required to change the <span class="caps">CNAME</span> record of your <span class="caps">DNS</span> to &#8220;ghs.google.com&#8221;.</p> +<blockquote> +<p>Note: in order to avoid inconveniences especially if a lot of users use your domain&#8217;s email, it is recommended that you pay attention on Google&#8217;s instructions on how to set the whole thing up. For further information refer to the official <a href="https://www.google.com/a/FAQ"><span class="caps">FAQ</span></a>. In order to be able to use Google Page Creator on your domain, you must setup an <span class="caps">URL</span> to publish your webpages: of course do <span class="caps">NOT</span> set this to &#8220;www.yourdomain.com&#8221; or any subdomain currently in use or your visitors will access the pages you created with Google Page Creator.</p> +</blockquote> +<p>Here&#8217;s what you get:<br /> +<img src="/img/pictures/gmail-hosted/gmail.png" alt="" /> <br /> +For a bigger image click <a href="/img/pictures/gmail-hosted/gmail_full.png">here</a>. Let&#8217;s now have a look at what are the main differences from the standard Gmail.</p> +<p><u><em><strong>Include your own logo</strong></em></u><br /> +<img src="/img/pictures/gmail-hosted/logo.png" alt="" /></p> +<p>Your own logo will be displayed on the upper left corner of every page. And this is truly sweet. All you have to do to change it is uploading a 143&#215;59 <span class="caps">PNG</span> or <span class="caps">GIF</span> image from your domain management panel (see below).</p> +<p><u><em><strong>Use your company name instead of Google&#8217;s</strong></em></u><br /> +<img src="/img/pictures/gmail-hosted/links.png" alt="" /></p> +<p>Besides a custom logo, it is possible to set a company name to be used instead of &#8220;Google&#8221; or &#8220;Gmail&#8221; in page titles and links. I chose &#8220;H3RALD.com Mail&#8221; and that&#8217;s displayed everywhere, including on the sign-in page.</p> +<p><u><em><strong>Control Panel</strong></em></u><br /> +All the custom settings can easily be managed through an easy-to use control panel:</p> +<p><img src="/img/pictures/gmail-hosted/options_panel.png" alt="" /></p> +<p>It&#8217;s really easy to use and has wizards to setup all the included services and options like setting up user accounts, settings etc.</p> +<p><img src="/img/pictures/gmail-hosted/domain.png" alt="" /></p> +<p><u><em><strong>User Accounts</strong></em></u><br /> +Through the control panel you can add new users and modifying existing user accounts to access your services. You can create administrators who are able to access administrative domain-wide settings, and standard users. Every user gets 2048MB of space for their emails, and that&#8217;s pretty generous considering that it seems that you&#8217;re able to create around 25 user accounts.</p> +<p>Already have a list of users you&#8217;re like to import? Just save them in <span class="caps">CSV</span> format and upload them.</p> +<p>Would you like to be able to contact all your users at once, e.g. via a newsletter? Google thought about this as well, and you can create your own personal newsletters which can be sent out automatically to your @yourdomain.com email accounts.</p> +<p><u><em><strong>Internal Messaging System</strong></em></u><br /> +But there&#8217;s more. We all know Google Talk: yes it&#8217;s nice, but probably <span class="caps">MSN</span> has more features, smileys and all the rest but it still remains a perfectly usable instant manager, which also allows file transfer. Your users can use Google Talk to communicate with each other <em>or</em> simply chat through their webmail interface, More features? Well, for example <a href="https://www.google.com/support/hosted/bin/answer.py?answer=34143">you can setup Google Talk to work on federated networks</a>.</p> +<p><u><em><strong>Appointments/Projects management</strong></em></u><br /> +Google Calendar is an excellent online calendar, and now you can use it within your own domain as well. This means, for example, that it can be used to set your company&#8217;s appointments, reminder, project deadlines by creating an unlimited number of custom calendars to share with your collaborators.</p> +<p><u><em><strong>Design your own site</strong></em></u><br /> +I know a lot of restaurants, shops and people who would like to have a small site for their business or activity, but they can&#8217;t develop web application themselves. So the most obvious solution is to hire some professional web developer to rip them off&#8230; erhm, to create a website for them. Now it is not necessary: by setting the correct <span class="caps">DNS</span> parameters, you can allow users to create their own webpages using a foolproof and advanced web editor powered by Google: <a href="http://pages.google.com/">Google Page Creator</a>. <br /> +I didn&#8217;t set it up on my own domain, but a preview of what you can do with Google Page Creator is available <a href="http://h3rald.googlepages.com/home">here</a>.</p> +<h3>Scenario</h3> +<p>After considering all this, I came to the conclusion that what Google did can help a lot of people and at the same time prevent some evil webmaster to charge them hundreds of Euro (they really get away with it!) for basic &#8220;websites&#8221; with &#8220;three or more static pages&#8221;.<br /> +All you have to do is buy your own domain, and that can be as cheap as 8$ per year, the rest comes for free, from Google:</p> +<ul> + <li>The best webmail interface you can possibly imagine</li> + <li>Nearly unlimited space for everything</li> + <li>A truly effective spam filter</li> + <li>About 25 fully-featured user account, possibly more if you ask nicely</li> + <li>Your own &#8220;corporate instant messenger&#8221;</li> + <li>Your own calendar to manage appointments, meetings etc.</li> + <li>An intuitive and advanced web page creator &#8211; not like Geocities</li> +</ul> +<p>All this for free. Yes, with ads (I&#8217;m not here to discuss <a href="http://www.gmail-is-too-creepy.com/">privacy concerns</a>), but after all they&#8217;re not displayed on your main site.</p> +<p><em>What about Server Side technologies for my sites?</em></p> +<p>OK kid, now that would be a little bit too much, even if I can foresee some possible &#8220;Google Web Widgets&#8221; at some point. &#8220;Create your <em>interactive and dinamic</em> website within minutes, no programming knowledge required&#8221;&#8230; that would be great (for Google) and bad (for freelance web developers). One thing at a time, after all G(od|oogle) has the whole eternity to fulfill his Goals.</p>
A contents/articles/google-chrome.html

@@ -0,0 +1,165 @@

+----- +title: Chrome - Google did it again! +content-type: article +timestamp: 1220401860 +tags: browsers|review|google +----- +<p style="float:left;"><img src="/files/google-chrome/chrome-logo.jpg" alt="" /></p> +<p>It looks like there&#8217;s a <a href="http://www.google.com/chrome">new open source browser</a> in town. As usual, nearly everything about it <a href="http://blogoscoped.com/archive/2008-09-01-n47.html">leaked</a> <a href="http://www.techcrunch.com/2008/09/01/first-public-screen-captures-of-google-chrome/">before</a> its <a href="http://www.google.com/chrome">release</a>. Every blog that matters is talking about it, so if you didn&#8217;t hear anything about it, you&#8217;d better take a look yourself. Don&#8217;t be fooled by the usual <a href="http://www.techcrunch.com/2008/09/01/meet-chrome-googles-windows-killer/">senseless ravings</a> of some weird, overly-hyped blogger though: a <em>browser</em> just came out, nothing more and nothing less. It&#8217;s not the end of Windows, it&#8217;s not the end of the Internet, it&#8217;s not the end of the world as we know it. It&#8217;s just a new player in the Browser Wars.</p> +<p>I particularly recommend reading the official <a href="http://books.google.com/books?id=8UsqHohwwVYC&amp;printsec=frontcover#PPP1,M1">Google Comic Book</a> about Chrome, however I included some of the most interesting parts of it in this article. It&#8217;s a nice 40-page comic booklet explaining how the browser works in a friendly way&#8230; I found it quite amusing and an interesting way to <del>leak</del> distribute info on a new project.</p> +<h3>Getting the damn thing</h3> +<p>You can freely download Google Chromm from <a href="http://www.google.com/chrome">here</a>. You&#8217;ll get a tiny 474KB setup file which installs the browser automatically. When I say automatically I mean automatically: you double click it, and it won&#8217;t ask <em>anything</em>: it will just install it in Program Files by itself. Idiot proof. Clever. Some people may like it, I damn hated it.</p> +<p>I downloaded it and installed it fine from home, on Vista, and it was blazing fast (on <em>Vista_, imagine!). I tried to do the same thing from work and I couldn&#8217;t. The damn installer is supposed to pick up the proxy settings from your default browser, but if the proxy uses authentication (like 99% of corporate proxies) it simply won&#8217;t work. As far as I know, there&#8217;s <a href="http://groups.google.com/group/google-chrome-help-troubleshooting/browse">no way around this</a></em>thread/thread/4c07ec5124f2eebc.</p> +<p>This is the reason why this article won&#8217;t have any chrome screenshots&#8230; to protest against Google&#8217;s stupid way of doing things &#8220;too user-friendly&#8221;.</p> +<p><strong>Update 1:</strong> Actually, it is now possible to download the full Chrome setup from <a href="http://cache.pack.google.com/chrome/install/149.27/chrome_installer.exe">here</a> (Thanks <a href="http://www.thecrazyaustralian.com/installing-google-chrome-behind-a-proxy/">Crazy Australian</a>).</p> +<p><strong>Update 2:</strong> After installing Chrome, if your company uses an automatic proxy script you won&#8217;t be able to browser web sites using Chrome. If that&#8217;s your case, make sure you change IE&#8217;s proxy settings by specifying your proxy address and port explicitly.</p> +<h3>How Google &#8220;re-invented&#8221; the browser</h3> +<p>Why did Google bother? Officially because&#8230;</p> +<p><em>&#8220;[&#8230;] we believe we can add value for users and, at the same time, help drive innovation on the web.&#8221;</em><br /> +(from <a href="http://googleblog.blogspot.com/2008/09/fresh-take-on-browser.html">Google Blog</a>)</p> +<p>In practice, a Google-branded browser makes sense especially because of the services offered by the search giant right now: nearly <em>every kind</em> of web application, from mail clients to <span class="caps">RSS</span> readers.</p> +<p>The philosophy of Google Chrome is fairly simple: the Web has changed since the nineties, we now have full-fledged applications instead of crappy hypertexts with animated GIFs, therefore browsers must change, too.</p> +<p>Every major browser has a fairly long development history. Think of Firefox: version 3? Not really: try adding up at least 7 versions of Netscape before that. Internet Explorer <strong>8</strong>, Opera <strong>9.5</strong>, &#8230;<br /> +Safari is probably the newest of the lot, but still not quite right.</p> +<p>All major browsers <em>evolved</em> through the years, but they never really changed: so why not to start from scratch?</p> +<p>Starting from scratch has a lot of advantages:</p> +<ul> + <li>You can learn from other people&#8217;s mistakes, and try to fix them</li> + <li>You can <em>get things right</em> from the very start</li> + <li>You do not have to worry about breaking compatibility with previous versions</li> + <li>People won&#8217;t have extremely high expectations, and they&#8217;ll be prepared for a relatively unstable product</li> +</ul> +<p>Obviously building a browser from the ground up is not a weekend project, but things changed since the nineties and starting fresh does not necessarily means re-inventing the wheel!</p> +<h3>An &#8220;old&#8221; Rendering Engine</h3> +<p>Let&#8217;s just say that the main work was already done for Google by the <a href="http://webkit.org">WebKit</a> guys. The rendering engine which now powers Safari, the Nokia Series 60 browser, Gnome&#8217;s Epiphany, Adobe <span class="caps">AIR</span> has been picked by the Google guys for Chrome.</p> +<p style="float:right;"><img src="/files/google-chrome/chrome-javascript.gif" alt="" /></p> +<p>This is a fairly obvious choice, if you ask me. Why?</p> +<ul> + <li>Presto (Opera&#8217;s engine) is proprietary</li> + <li>Trident (IE&#8217;s engine) is proprietary, and it sucks</li> + <li>Gecko (Mozilla&#8217;s engine) is open source, but a bit bulky</li> + <li>WebKit is open source, and arguably the fastest rendering engine to date</li> +</ul> +<p>The rendering engine, after all, may be considered one of the most important parts of the browser: it&#8217;s responsible of what users see, after all. <br /> +Google made the right choice, in my opinion: WebKit is also the most &#8220;embeddable&#8221; and lightweight engine available, and it is also used on the Android platform for this very reason.</p> +<h3>A &#8220;new&#8221; Javascript</h3> +<p>Mozilla has a <a href="http:http://www.mozilla.org/js/spidermonkey/Javascript">fast</a> engine, which will soon become <a href="http://ejohn.org/blog/tracemonkey/">much faster</a>. WebKit has a <a href="http://webkit.org/projects/javascript/">blazing fast</a> Javascript engine too, don&#8217;t forget. So why Google didn&#8217;t just use that?</p> +<p>&#8230;Because they wanted something <em>much</em> faster than that, in their own way (as someone already <a href="http://null-logic.net/blog/2008/09/02/javascript-performance-comparison-with-chrome/">pointed out</a>).</p> +<p>Meet <strong>V8</strong>, Chrome&#8217;s very own Javascript Virtual Machine. When reading the Chrome Comic, I was particularly impressed of two improvements introduced by this new javascript VM:</p> +<p style="float:right;"><img src="/files/google-chrome/chrome-javascript-gc.gif" alt="" /></p> +<ul> + <li>It actually compiles Javascript to machine code via a Just-In-Time compiler (<span class="caps">JIT</span>). This means that whenever you refresh a page containing Javascript the browser won&#8217;t re-interpret the whole script, but it will simply run the compiled version of it which was generated the first time the page was loaded. New concept? Not really, Mozilla is going <em>exactly</em> in the same direction with their own engine, and <span class="caps">JIT</span> compilation will be added as of Firefox 3.1.</li> + <li>V8&#8217;s incremental garbage collection looks like a much better alternative to the current conservative garbage collection methods used for Javascript. Because of V8&#8217;s new concept of Hidden Class Transitions, V8 knows <em>exactly</em> when something is no longer needed and thus it is able to garbace-collect it more effectively.</li> +</ul> +<p>While there has been some initial <a href="http://nexus.zteo.com/2008/09/01/google-chrome-an-index-of-what-developers-need-to-know-good-and-bad/">skepticism</a> on this new Javascript implementation, it looks like Google did it right. If you don&#8217;t believe it you can <a href="http://code.google.com/apis/v8/intro.html">download</a> V8&#8217;s C++ code and try it out yourself.</p> +<h3>One Process per Tab</h3> +<p>Google Chrome is the first multi-process browser. The idea is that <em>each tab</em> (because you can&#8217;t do browsers without tabs, these days, right?) has its own phisical process and it is therefore independent from each other.</p> +<p style="float:right;"><img src="/files/google-chrome/chrome-processes.gif" alt="" /></p> +<p>Hang on, isn&#8217;t that what IE 5 did? A new instance of the browser for each window? No, not quite: there&#8217;s a single instance of the browser and <em>multiple</em> tab instances. Each tab is independent in the sense that it has its own address bar, but it&#8217;s just a tab, at the end of the day.</p> +<p>This is what Internet Explorer could have done, <em>before</em> Internet Explorer 7, as an answer to the traditional concept of tabs promoted by Mozilla and Opera.</p> +<p>Actually, it turns out that <a href="http://blogs.msdn.com/ie/archive/2008/03/11/ie8-and-loosely-coupled-ie-lcie.aspx">this is <em>exactly</em> what&#8217;s planned for Internet Explorer 8</a>, as <a href="http://www.sriramkrishnan.com/blog/2008/09/thoughts-on-new-browser-wars.html">someone</a> already pointed out!</p> +<p>Additionally, Google thought of building in a mini task manager to let users monitor the <span class="caps">CPU</span> and memory usage of each tab. This is interesting, but it has a few implications discussed later on in this article.</p> +<p>What&#8217;s truly remarkable about this is that each tab seems to have an initial overhead of 1-2KB, which of course grows according to the site it loads. You can see all this in the task manager, which also picks up similar stats for any other browser running at the same time on your machine. <br /> +This was another clever move by Google: by looking at their own task manager, and running more than one browser together, you have everything you need to instantly compare browser performance (thus discovering that Chrome does an outstanding job, it seems).</p> +<p>What&#8217;s also remarkable about Chrome&#8217;s tabs is the way you can interact with them:</p> +<ul> + <li>You can move them around smoohtly, exactly like with Safari</li> + <li>You can detach them by drag and drop</li> + <li>You can re-attach them by drag and drop (which is truly awesome!)</li> +</ul> +<h3><del>AwesomeBar</del> <em>OmniBox</em> and <del>Speed Dial</del> <em>New Tab Page</em></h3> +<p>Did you like Mozilla&#8217;s AwesomeBar? Well, I personally did, others didn&#8217;t so much. Meet OmniBox&#8482; Google&#8217;s very own, semi-sentient address bar which really understands you.</p> +<p>Here&#8217;s what you can do with it:</p> +<ul> + <li>Type in URLs and view web sites (it would be damn funny if it couldn&#8217;t do that)</li> + <li>Get <del>extra Google crap</del> useful suggestions while typing. This includes, but it is not limited to: + <ul> + <li>Pages you visited</li> + <li>Bookmarks</li> + <li>Popular pages (guess who decides that&#8230;)</li> + </ul></li> + <li>Custom searches: search <span class="caps">IMDB</span>, Wikipedia, Amazon and google itself with a few clicks</li> +</ul> +<p><img src="/files/google-chrome/chrome-bar.gif" alt="" /></p> +<p>Unlike Firefox&#8217;s AwesomeBar, Google&#8217;s OmniBox seems more &#8220;evolved&#8221;: it doesn&#8217;t get too much in your way, it lets you go where you want to go, and it&#8217;s smart about searching. Apparently Mozilla is already planning to remove the search bar completely and incorporate it in the AwesomeBar&#8230; but Google released it first, sorry guys.</p> +<p>The other handy thing they <del>stole</del> kindly borrowed from Opera is the <em>New Tab Page</em>, basically like Opera&#8217;s Speed Dial, but with two interesting things:</p> +<ul> + <li>It displays the nine <em>most visited</em> pages: you don&#8217;t have to configure it!</li> + <li>It displays search boxes for the most visited sites where you searched something on.</li> +</ul> +<p>While I really like how this works (it requires no configuration whatsoever), I kinda miss dragging my favorite pages in the New Tab Page. If you come from Opera, you&#8217;ll miss this too: the pages I have in my speed dial are <span class="caps">NOT</span> necessarily the pages I visited the most!</p> +<p>I guess I&#8217;ll get used to it, though&#8230;</p> +<h3>Relax, it&#8217;s Google!</h3> +<p>Google is not Evil&#8482;. Google is good to everyone, from their own employees to developers and end users: and the funniest part of this whole thing is that everything they make <em>looks</em> good for you. You have absolutely no reason to fear Google.</p> +<p>They did it again: they apparently released a new browser which definitely looks inherently more secure than competitors. <br /> +Here&#8217;s why:</p> +<ul> + <li>It has an <em>Incognito</em> mode, which lets you browse everything you want without logging anything anywhere.</li> + <li>It confines popups to the tab they belong, minimized. You can then seletively decide to drag them out and promote them to their own window.</li> + <li>Each tab is sandboxed: i.e., it has no rights to write anything to your PC. Absolutely no chance. When plugins for Java and Flash are used, however, this doesn&#8217;t apply.</li> + <li>Chrome continuously downloads lists of malicious sites, so that you&#8217;re protected against phishing in real time.</li> +</ul> +<p style="float:left;"><img src="/files/google-chrome/chrome-blame.gif" alt="" /></p> +<p>Now, if everything goes wrong, you know it&#8217;s definitely <em>someone else who did it</em>. If you read the comic book between the lines, you&#8217;ll notice a not-so-subtle message to the end users:</p> +<ul> + <li>The browser is sandboxed, so if anything goes wrong, blame others (Adobe for Flash, Sun for Java, Microsoft for some other crap)</li> + <li>You can monitor the resource consumption of each tab, <em>ergo</em> what <em>each website</em> uses. This means that if a site is slow is definitely the web developer&#8217;s fault.</li> +</ul> +<p>This is basically what <a href="http://ejohn.org/blog/google-chrome-process-manager/">John Resig</a> immediately pointed out when the comic came out.</p> +<h3>How it feels</h3> +<p>Google Chrome is clearly a very nice product to use. It&#8217;s as intuitive as IE for the average Windows user, it has the best of Firefox and Opera features and it&#8217;s even more sleek than Safari. The UI, in my opinion, is a true masterpiece and feels well though out.</p> +<p>Everything is aimed to be intuitive and does not get in your way: it just works. You want to download a file? You can just do it, without worrying about where to save it: it will appear in a &#8220;download bucket&#8221; at the bottom of your tabs, and you can just drag and drop what you downloaded anywhere you like, if you need to.<br /> +Why nobody thought of this before?</p> +<p>Even the program settings are simple to understand. The Options dialog is divided in &#8220;Basics&#8221;, &#8220;Minor Tweaks&#8221; and &#8220;Under the Hood&#8221;. The idea is that anyone can understand the Basics, some people may tweak a bit more, and only geeks may want to go beyond that. This is particularly evident in the Italian translation (it comes bundled with 40 localizations, by the way), where they translated &#8220;Under the Hood&#8221; with &#8220;Roba da smanettoni&#8221; which means something like &#8220;Stuff for people who fiddle with PCs&#8221;. I personally found this translation a bit irritating, but anyway&#8230;</p> +<h3>Media Coverage and Target Audience</h3> +<p>The overall impression is that Google wanted to target end users with this browser, but also appeal geeks, too. This makes sense from a marketing point of view. While 90% of geeks switched from IE to another browser, ordinary people are still stuck with IE. Why? Because alternative browsers have gained a reputation of being geek-friendly (which, by popular belief, does not mean user-friendly).</p> +<p>Google&#8217;s marketing strategy is quite clear, and it doesn&#8217;t seem to be failing on any point:</p> +<ul> + <li>They targeted Windows first, because that&#8217;s what the bulk of IE aficionados uses.</li> + <li>They did their best to make it as user-friendly as possible: the sleek <span class="caps">GUI</span>, the comic book, etc.</li> + <li>They spread the world like crazy: every blog is talking about it, but also major news sites like <span class="caps">BBC</span> and <span class="caps">CNN</span>. When I got to work, a collegue of mine asked me if I tried the new Google browser and if I read the comic. She heard it at the radio. Here <em>in Italy</em>!</li> + <li>At the same time, they made the whole thing open source, released APIs and emphasized this, so that &#8220;computer fiddlers&#8221; couldn&#8217;t resist.</li> +</ul> +<p>To me, it looks like Google Chrome stands a good chance to succeed where others have failed: drive most of the Internet population away from Internet Explorer.</p> +<h3>Open Source, testing and quality</h3> +<p>Google is well known for its massive infrastructure. Moreover, Google is the only &#8220;entity&#8221; (let&#8217;s call it that way, shall we) who <em>knows</em> and <em>visited</em> almost every web page on the Internet. If something is not &#8220;on Google&#8221;, it may well not exist at all: this is not strictly true, but it&#8217;s the user perspective and ad the end of the day that&#8217;s all that matters.<br /> +Google, as a consequence, has virtually unlimited resources (compared to any other possible competitor) and virtually unlimited knowledge of the Internet, which makes automated testing no more than a joke.</p> +<p>From the Google Chrome Comic:</p> +<p><em>&#8220;Within 20-30 minutres of each new browser build, we can teswt it on tens of thousands of different web pages&#8221;</em></p> +<p>&#8230;and that&#8217;s certainly not an understatemend: you can believe that.</p> +<p><img src="/files/google-chrome/chrome-tests.gif" alt="" /></p> +<p>Google seems very concerned of building a &#8220;rock-solid&#8221; browser rather than being the coolest guy in town, and that&#8217;s a good sign. Google is <em>smart</em>, remember?</p> +<p>As if it weren&#8217;t enough, the entire thing (the rendering engine, the javascript implementation and the whole code of the broswer) is 100% open source which means, in a nutshell:</p> +<ul> + <li>Free testers</li> + <li>Free developers</li> + <li>Good publicity</li> +</ul> +<p><img src="/files/google-chrome/chrome-os.gif" alt="" /></p> +<p>If things go as planned, Chrome may become the most widely tested piece of software in the world. Let&#8217;s just see how the community takes this.</p> +<h3>Why it matters</h3> +<p>Everyone seems to have gone crazy about Chrome, even long before it was made available. Why does it matter, anyway? Isn&#8217;t it just a browser, at the end of the day? Well, yes, but:</p> +<ul> + <li>It&#8217;s 100% open source. If you like something of it, you can get it, modify it, bundle it in another project and redistribute it. Give it a few weeks and extensions which use some of Google&#8217;s new <span class="caps">API</span> will flock to the &#8217;fox like crazy.</li> + <li>It&#8217;s small, fast and very promising. Sure, it&#8217;s not perfect, but <span class="caps">YOU</span> can help improving it. Get it?</li> + <li>It&#8217;s on Windows, so it will reach the majority of Internet users&#8230; in theory.</li> +</ul> +<p>Last but not least, it comes bundled with <a href="http://gears.google.com/">Gears</a>, i.e. what Google would like you to use for RIAs. That&#8217;s perhaps the only &#8220;subliminal&#8221; message they are trying to send to their users (for now, at least).<br /> +As a matter of fact, nothing prevents them from using Chrome as a way to promote their technology and products. But at the same time nothing prevents a random developer to just fork the project and distribute a <em>neutral</em> and unbranded version of Chrome.</p> +<p>See? Google is not evil at all, it&#8217;s just smarter than others.</p> +<h3>The Bottom Line</h3> +<p>Google showed us once more that their &#8220;innovation&#8221; can be summarized with the following:</p> +<p><em><strong>&#8220;Do not invent new things, just make them better&#8221;</strong></em></p> +<p>They didn&#8217;t invent Internet search: they just made it better and smarted. The same philosophy applies to Chrome, too. Some examples? Sure:</p> +<ul> + <li>They didn&#8217;t create a new rendering engine, they used an existing one</li> + <li>They analyzed Safari&#8217;s neat <span class="caps">GUI</span> tricks and implemented something even better.</li> + <li>They added an IE8-like domain highlight in the <span class="caps">URL</span>.</li> + <li>They got the Firefox&#8217;s AwesomeBar and improved it.</li> + <li>They got Opera&#8217;s Speed Dial and improved it.</li> + <li>They got IE8&#8217;s one-process-per-tab architecture and improved it.</li> + <li>They didn&#8217;t think of a Javascript <span class="caps">JIT</span> first, they just made it widely-available first.</li> + <li>They didn&#8217;t think about merging the address bar with the search bar, Mozilla announced it first, but Google released it before they did.</li> + <li>Safari 4 allows users to create shortcuts for their favorite web apps, but unfortunately it&#8217;s only out for developers&#8230;</li> +</ul> +<p>Google did it, again. Exactly as planned.</p>
A contents/articles/google-earth.html

@@ -0,0 +1,7 @@

+----- +title: Software Review: Google Earth +content-type: article +timestamp: 1134215339 +tags: review|google +----- +Almost every person on Earth has seen an image taken from a satellite at least once in his or her life: now imagine putting all those images together to make a sort of "patchwork world"...this is unfortunately not as simple as gluing atlas maps together, because height, resolution and orientation must be considered. However, "A computer could do all that"...and so it happened!<strong>In the beginning...</strong><br /><br /><br /><a href="http://www.nasa.gov/home/index.html?skipIntro=1">Nasa.gov</a> has always been one of the most famous and most visited websites in history, and among the resources you can find there, besides the pictures of space-related objects and phenomena that everyone flocks to, are satellite pictures of Earth. <br />Perhaps one of the most wonderful things NASA did software-wise was the realization of an open source software called <a href="http://worldwind.arc.nasa.gov/index.html">WorldWind</a>: <em>"World Wind lets you zoom from satellite altitude into any place on Earth. Leveraging Landsat satellite imagery and Shuttle Radar Topography Mission data, World Wind lets you experience Earth terrain in visually rich 3D, just as if you were really there."</em><br />A really cool thing indeed, if you ask me. So cool that people from all over the world started downloading and using it, causing problems on NASA's server for the project, which was extremely busy or even unreachable. The download is now mirrored on Sourceforge, download.com, and Wayne State University, but the server problem has to do with getting to the server to access the images. So why bother downloading if you know it doesn't actually work, regardless of the reason?<br /><br />The alternative, until a year or so ago, was a product created by "Keyhole Corp." - I won't bother posting a link to the site, you'll read why below. Guys from Keyhole basically created a similar program that was much faster, with no server timeouts and better image resolution. Of course, they thought they could charge for it, and I believe that back in the day some people actually paid $70 for what was seen afterwards as a piece of software with a great potential that was never tapped.<br /><br /><br /><strong>Google enters the scene</strong><br /><br />"Hey, look! It works! Now let's get it and do it better!" - This is, in a nutshell, Google's policy in the last 2 years or so: they find relatively small(er) companies that produced something with potential, buy it, and they either improve and resell the product, or give it away for free, getting income from advertising. It happened before, with Picasa and Blogger, for example, and now, with Keyhole as well (for a pretty complete list of Google's acquisitions and possible future targets, have a look <a href="http://www.kuro5hin.org/story/2005/6/12/143721/743">here</a>).<br />This is not a bad thing for the end user, because often new Google-branded products are free or discounted, and Google is happy because it can still make a huge profit from it: if you ask me, that's a much better policy than Microsoft's ("Create something which doesn't work, try to patch it eventually, force people to use it"), at least from a certain point of view.<br /><br />Anyhow, Google <a href="http://www.google.com/press/pressrel/keyhole.html">purchased</a> Keyhole Corp. on October 27th, 2004. The next day, Google said "let's drop Keyhole's price to 30 bucks" - And Google saw that it was good.<br /><br />Then everything went (almost) silent, until June 18th, 2005, seven months and one day since the acquisition of Keyhole, Google officially <a href="http://slashdot.org/article.pl?sid=05/06/28/1733229&amp;from=rss">released</a> a new product, called <a href="http://earth.google.com/">Google Earth</a>. <em>"Thus the heavens and the earth were finished, and all the host of them" [Gen. 2:1]</em><br /><br /><br /><strong>Welcome to a brand new world</strong><br />Pseudo-biblical jokes apart, Google's new Earth can be downloaded and installed FOR FREE! Go and <a href="http://desktop.google.com/download/earth/index.html">get it</a> because it's interesting, but please don't click on the link I provided before because you'll find out that Google won't let you download it, because they got too many requests, so... <br />So that's why, also thanks to Google, I found some <a href="http://www.majorgeeks.com/download4659.html">Major Geeks</a> mirrors and got it from there. The file is 10 MB, so if you have 56K dial-up don't bother, because it needs at least a 128Kbps connection to run correctly. Below are the minimal system requirements, the recommended ones, and what my PC has. As you can see, processor speed actually doesn't matter if you have a good video card and a good Internet connection.<br /><br /><em>Minimal Configuration</em><br /> * Operating system: Windows 2000, Windows XP<br /> * CPU speed: Intel? Pentium? PIII 500 MHz<br /> * System memory (RAM): 128MB<br /> * 200MB hard-disk space<br /> * 3D graphics card: 3D-capable video card with 16MB VRAM<br /> * 1024x768, 32-bit true color screen<br /> * Network speed: 128 kbps ("Broadband/Cable Internet")<br /> <br /><em>Recommended Configuration</em> <br /> * Operating system: Windows XP<br /> * CPU speed: Intel? Pentium? P4 2.4GHz+ or AMD 2400xp+<br /> * System memory (RAM): 512MB<br /> * 2GB hard-disk space<br /> * 3D graphics card: 3D-capable video card with 32MB VRAM or greater<br /> * 1280x1024, 32-bit true color screen<br /> * Network speed: 128 kbps ("Broadband/Cable Internet")<br /><br /><em>h3raLd's crappy PC's Configuration</em> <br /> * Operating system: Windows XP<br /> * CPU speed: Intel? Pentium? PII 350 MHz<br /> * System memory (RAM): 256MB<br /> * 30 GB hard-disk space<br /> * 3D graphics card: nVidia GeForce II MX 32MB VRAM<br /> * 1024x768, 32-bit true color screen<br /> * Network speed: 1240 kbps<br /> <br />I downloaded it, installed it, and it worked fine on my PC. Please note that Google has been pretty specific regarding the compatible OSes, basically only Windows 2000/XP are supported: very old systems (Windows 95/98/Me and alike) and very new systems (Windows Server 2003, X-x64) are not meant to be able to run it. Mac users shouldn't bother trying, while Linux users will be glad to read that it's supposed to work under <a href="http://appdb.winehq.org/appview.php?versionId=3254">wine</a> (rated "bronze").<br /><br />Let's suppose you installed the program and you're running it. If you don't want to try it because you are still unsure if it's worth or not, you can have a look at this <a href="http://newrecruit.org/archives/2005/may/googlekeyhole">article</a>, and in particular at the screenshots. <br />I found it quite easy to use, as are nearly all Google applications; the interface is quite pretty and does the job. You'll immediately notice the main panel where the world and images will be shown, then there's a bottom panel mainly used for navigation, while on the right the three main functions of the program are clearly presented in 3 tabs ("Fly to", "Local Search" and "Directions"), together with two other tabs below for adding/removing details from the map and managing your saved places and results.<br /><br />As it's a Google product, one of the most handy features is the search engine. You can put in a city, town, even street or building, restaurant, or place of interest, and the program should be smart enough to find it and take you there. With the "Fly Now" feature it's possible to just center the view on one place, for example. The resulting map will be at a certain height, depending on what term you searched for. You can now zoom in or out with your mouse wheel or with the buttons provided in the navigation panel, and you'll see the map updating. This is a gradual process and depends mainly on your connection speed, but also the available RAM, the video card, and the processor speed. <br /><br />As it's still a relatively new product, don't expect to find everything... or better, you can find (nearly) everything, but it might not be at the highest resolution, for example, and thus appear blurred on zoom. Currently the USA, the UK, and Western Europe are the places with the most details. In particular, in the major cities of the US you can also see a 3-D re-creation of the buildings which, even though in plain gray, actually reproduce the real shape of the element. <br />Furthermore, in the navigation panel you can also tilt up and tilt down the view! So the end result is a map which is half real and half virtual.<br />If you search for another place, you will not be taken there instantaneously, but instead Google Earth zooms out appropriately and moves around the globe to where the new place is and zooms in appropriately: a really nice effect.<br /><br />Also keep in mind that you can add or highlight details on the map, like grids, roads, names, places to see, restaurants, stadiums, railroads, boundaries and borders, different types of schools, earthquake areas, and - even if the satellite maps used can be up to three years old - statistical data about Cloud Coverage and a lot of other things.<br /><br />The other two functions, "Local Search" and "Directions" allow you, respectively, to perform a search restricted to the area (i.e. Trafalgar Square - London, UK) and get directions between two places, highlighting the suggested path. Also, all places you see can be saved, marked, and printed: wonderful.<br /><br /><br /><strong>Limitations and Opinions</strong><br /><br />As a Beta, Google Earth does come with limitations: as I wrote earlier, only USA, UK, and Western Europe are (almost) fully supported, but you can already get some pretty decent pictures from 200 miles up anywhere in the world. Another limitation is that since the images often come from different satellites, "patches" can be seen sometimes, where part of a picture of an area is darker or lighter than another.<br /> <br />However, you can't really complain about this software, because it's free and obviously Google's server seems to be always available, unlike NASA's. f you want more, Google Earth is available as a Plus edition (20$) and Pro edition (400$), with more <a href="http://earth.google.com/product_comparison.html">features</a> and support. <br />What of Microsoft? Well, Microsoft is said to be planning to "strike back" during this summer, with <a href="http://www.google.com/url?sa=U&amp;start=1&amp;q=http%3A//blog.searchenginewatch.com/blog/050523-125208&amp;ei=hy3EQpqoGcmciALB8vinCw&amp;sig2=ZNIj3_KWXuDMr4_2WmrCNA">MS Virtual Earth</a>, let's just wait and see...<br />
A contents/articles/h3rald-71.html

@@ -0,0 +1,18 @@

+----- +title: Introducing H3RALD.com v7.1 +content-type: article +timestamp: 1225081740 +tags: website|rails +----- +<p>I finally decided to redesign my web site. About 2 years passed since last time and I think this was long overdue: a lot of people liked the black <em>Nitefall</em> theme, but a lot of people found a bit too dark for their liking.</p> +<p>I decided to go for something more <del>boring</del> traditional this time: white background and only black header and footer. I think the new design improves the overall readability of the site, also because this time I kept thing simple:</p> +<ul> + <li>No more sidebars &ndash; Who needs them anyway? Who wants to see my <a href="http://www.delicious.com/h3rald">delicious bookmarks</a> on <em>every single page</em>? Who wants to see that annoying Web 2.0-ish tag cloud listing all the tags I&#8217;ve ever used from 2006 onwards? I suddently realized that the right column was nothing more than wasted space, so I removed it altogether.</li> + <li>No more differentiation between <em>articles</em> and <em>blog posts</em> &ndash; As a matter of fact, I&#8217;m not posting little pointless tidbits everyday, it&#8217;s more likely just once a week or even once a month. When I post though, I tend to make it worthwhile both for me and the readers by writing about something which may interest people, for a change. In short: this may not be a &#8220;traditional blog&#8221; anymore, just a publishing platform for my articles.</li> + <li>No more &#8220;previews&#8221; &ndash; From now on, only the title of each articles is displayed in the home page, in the archives and even when searching. If you want to read an article, all you have to do is click on its title. No more &#8220;Read More&#8221; links.</li> + <li>Just three main pages: <a href="">Home</a>, <a href="/archives">Archives</a>, and <a href="/about">About</a>. Although there may be some more for special projects, at some point.</li> + <li>Use the <a href="/archives">Archives</a> to find my articles. There you&#8217;ll find a list of the 20 most used tags, a search form, and a timeline listing <em>all</em> my articles from 2006 onwards.</li> + <li>Use the tiny palette on the left side of each page to perform common actions like bookmarking, scroll up and down, etc. You can read more about it on the <a href="/about">About</a> page.</li> +</ul> +<p>I hope you like the new design, or at least I hope it makes my articles more readable. However, I&#8217;m open to suggestions, as usual.</p> +<p>P.S.: I dropped with Internet Explorer 6 compatibility According to my stats, less than 5% of my visitors use it, so it&#8217;s not worth the extra hassle.</p>
A contents/articles/h3rald-81.html

@@ -0,0 +1,51 @@

+----- +title: H3RALD.com v8.1 Released +content-type: article +subtitle: Featuring a a brand new newspaper-like design, powered by HTML5 and CSS3 +timestamp: 1285243465 +tags: website|webdevelopment +----- + + <section class="section"> +<p>Just <a href="/articles/take-back-your-site-with-nanoc">over a year ago</a> I released the 8th version of this web site. The biggest change then was abandoning the Rails-powered <a href="http://wiki.github.com/fdv/typo/">Typo</a> blogging platform in favor of <a href="http://nanoc.stoneship.org/">nanoc</a>, arguably the most versatile static site generator out there.</p> +<p>A year later, I am still very happy with nanoc, hence there&#8217;s no need for another major release. Nonetheless, I decided to improve the site&#8217;s overall design and image, making it (hopefully) easier to use and more pleasant to the eye.</p> +<p>I always had a problem finding the right theme for my web site. I always wanted to find something related to the word <em>herald</em>, so in the last release I went for a herandry-oriented theme. For this release, I decided to go for a newspaper-style layout: after all, the word <em>herald</em> is often used in newspaper titles, and I picked the name &#8220;h3rald&#8221; after the <a href="http://global.nytimes.com/?iht">International Herald Tribune</a>.</p> +<p>Also, I was desperate to try out the new features offered by HTML5 and CSS3, and a newspaper layout seemed a good excuse to use columns.</p> +<section class="section"> +<header><h1 id="h_1" class="toc">Browser Compatibility</h1></header> +<p>Although I shouldn&#8217;t really say this, the site is meant to be viewed with a WebKit-based browser, really. It works in other (modern) browsers (read: no IE6), and it degrades more or less gracefully if a particular feature is not supported.</p> +<p>That being said:</p> +<ul> + <li>IE7 and IE8 just barely render it (Javascript is used to &#8220;patch&#8221; the <span class="caps">DOM</span> with the new HTML5 elements)</li> + <li>Firefox 3+ renders pretty much everything right.</li> + <li>Safari and Chrome render the site as it is actually meant to be rendered</li> +</ul> +<p>Nobody ever died from not being able to see CSS3 rounded corners anyhow. The most important thing about this site is its content, and I made sure that whatever browser you&#8217;re using you can still read it.</p> + +</section> +<section class="section"> +<header><h1 id="h_2" class="toc">Columns and hyphenation</h1></header> +<p>As I previously stated, I couldn&#8217;t wait to try out CSS3 columns so I kinda went crazy on the home page, but just there. Some may argue that they are not suitable for web use of course, but I think they contribute to give the site layout a unique feeling.</p> +<p>The problem with having columns is of course text alignment: justified text looks good, but unless you hyphenate text properly it shows a lot of blank space. Luckily, I discovered <a href="http://code.google.com/p/hyphenator/">hyphenator.js</a>, which solved the problem nicely.</p> + +</section> +<section class="section"> +<header><h1 id="h_3" class="toc">CSS and layout improvements</h1></header> +<p>I made a point out of improving the old stylesheet to make the site easier to read and generally prettier. Beauty is in the eye of the beholder, but still, I think the new stylesheet brings some improvements, especially concerning text (the <a href="http://scripts.sil.org/gentium">Gentium</a> font is used throughout the site) and syntax highlighting.</p> +<p>Moreover, I worked on streamlining navigations across different sections of the site, in particular on article pages:</p> +<p><img src="/img/pictures/h3rald_81_article.png" /></p> + +</section> +<section class="section"> +<header><h1 id="h_4" class="toc">Under the hood</h1></header> +<p>Besides appearence, the new site also features some improvements in its underlying business logic. In particular:</p> +<ul> + <li>Better nanoc <a href="http://github.com/h3rald/h3rald/blob/master/Rules">Rules</a></li> + <li>Improved <a href="/glyph/">Glyph</a> integration, by extending nanoc <a href="http://github.com/h3rald/h3rald/blob/master/lib/glyph_context.rb">RuleContext</a></li> + <li>Minor updates to the custom <a href="http://github.com/h3rald/h3rald/blob/master/tasks/site.rake">Rake tasks</a></li> + <li><a href="http://disqus.com/overview/">Disqus</a> comments</li> +</ul> + +</section> + +</section>
A contents/articles/h3rald-83.html

@@ -0,0 +1,139 @@

+----- +title: H3RALD.com v8.3 Released +content-type: article +subtitle: A new minimalist design, powered by Twitter Bootstrap +timestamp: 1356648094 +tags: website|webdevelopment +----- + + <section class="section"> +<p>One of the many things that really bothered me about my web site was the fact that it didn&#8217;t look good on my iPhone, or any small screen for that matter.</p> +<p>Years ago I <a href="http://www.alistapart.com/articles/responsive-web-design/">read about</a> responsive web design, media queries, etc., but I never had the will or the time to dive into the subject. Then <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a> came out, and it changed <em>everything</em>.</p> +<p>Not only Bootstrap provides a very solid <span class="caps">HTML</span> boilerplate and grid system, it also comes with some very nice and complete styles for every <span class="caps">HTML</span> element, a few Javascript-enhanced UI components, and best of all it is fully responsive.</p> + +<section class="section"> +<header><h1 id="h_1" class="toc">Getting to know Bootstrap & its CSS wizardry</h1></header> +<p>Redesigning H3RALD.com using Twitter Bootstrap turned out to be fairly easy. I headed up to the <a href="http://twitter.github.com/bootstrap/customize.html">Customize and Download</a> page and set a few variables like the font to use (the beautiful <a href="http://aldusleaf.org/crimson.php">Crimson text</a>), the link color and so on, and downloaded the lot.</p> +<p>I more or less completely forgot about my old <span class="caps">CSS</span> stylesheets and went with Bootstrap all the way. I was happy with a lot of the defaults, but I had to add a few rules and overrides for:</p> +<ul> + <li>headings</li> + <li>line heights</li> + <li>A few custom classes I use extensively, like add a <code>text-align: justify;</code> for the <code>hyphenate</code> class.</li> +</ul> +<p>Now, one of the cool things of Bootstrap is that it comes with smart defaults, and that it lets you add specific features to elements simply by adding a <span class="caps">CSS</span> class to them. Take a look at how <a href="http://twitter.github.com/bootstrap/base-css.html#buttons">buttons</a> are constructed, for instance. Normal button? Sure:</p> +<table> +<tr> +<td> +<div class="code"> +<pre> +<code> +&lt;button class="btn"&gt;Click Me!&lt;/button&gt; +</code> +</pre> +</div> +<p></td><td><button class="btn">Click Me!</button></td></p> +</tr> +</table> +<p>That&#8217;s grey with black text. Boring. Want it red? Sure, add the <code>.btn-danger</code> class:</p> +<table> +<tr> +<td> +<div class="code"> +<pre> +<code> +&lt;button class="btn btn-danger"&gt;Click Me!&lt;/button&gt; +</code> +</pre> +</div> +<p></td><td><button class="btn btn-danger">Click Me!</button></td></p> +</tr> +</table> +<p>Too big? No problem, make it smaller with <code>.btn-sm</code>, so we have:</p> +<table> +<tr> +<td> +<div class="code"> +<pre> +<code> +&lt;button class="btn btn-danger btn-small"&gt;Click Me!&lt;/button&gt; +</code> +</pre> +</div> +<p></td><td><button class="btn btn-danger btn-small">Click Me!</button></td></p> +</tr> +</table> +<p>Wouldn&#8217;t it be nice to have a nice icon in it? Add an empty <code>&lt;i&gt;</code> element with a suitable class and there you have a nice <a href="http://twitter.github.com/bootstrap/base-css.html#icons">Glyphicon</a> before the button text (or you can use other icon fonts, like <a href="http://fontawesome.io/">FontAwesome</a>).</p> +<table> +<tr> +<td> +<div class="code"> +<pre> +<code> +&lt;button class="btn btn-danger btn-sm"&gt;&lt;i class="fa fa-check"&gt;&lt;/i&gt; Click Me!&lt;/button&gt; +</code> +</pre> +</div> +<p></td><td><button class="btn btn-danger btn-sm"><i class="fa fa-check"></i> Click Me!</button></td></p> +</tr> +</table> +<p>&#8230;You get the picture. And it works surprisingly well &#8212; if you embrace its philosophy, that is. Just like Rails &amp; Co.: an <em>opinionated</em> framework.</p> +<p>The only thing that bugged me about all this was that by adding smart <span class="caps">CSS</span> classes to elements you&#8217;re actually specifying how something looks like by polluting <span class="caps">HTML</span> code. Granted, if your stylesheet doesn&#8217;t include a <code>.btn-inverse</code> your buttons won&#8217;t automagically become black, but you know what I mean. Although in a very nice way, by following Bootstrap&#8217;s way of doing things you are no longer separating content from presentation. And in the next six months, when I&#8217;ll ditch Bootstrap for something better, all the previews of the code snippets above won&#8217;t work unless I keep using the Bootstrap stylesheet or at least some of its button classes.</p> +<p>The real problems arise for the stylesheets provided for general elements. By default, Bootstrap styles tables with no borders or colors. What if I wanted just ordinary tables to be striped and bordered? Sure, I can add the <code>.table-striped</code> and <code>.table-bordered</code> classes to all tables, and that&#8217;s it. In <span class="caps">EVERY</span> table. Or of course undo bootstrap&#8217;s magic by overriding the <span class="caps">CSS</span> rules for ordinary tables, to include the rules specified for <code>.table-striped</code> and <code>.table-bordered</code>. Copy &amp; paste someone else&#8217;s code? Not nice.</p> +<p>Luckily, using <a href="http://sass-lang.com/"><span class="caps">SASS</span></a> finally paid off, and here&#8217;s how to do it in a nice and tidy way:</p> + +<div class="code"> +<pre> +<code> +@import "_bootstrap.scss"; +/* The bootstrap stylesheet - just changed its extension and prepended an underscore, nothing more */ + +table { + @extend .table; + @extend .table-striped; + @extend .table-bordered; +} +</code> +</pre> +</div> +<p>There you go. All tables (ordinary <code>&lt;table&gt;</code> elements with no silly classes attached) are now bordered and striped.</p> + +</section> + + +<section class="section"> +<header><h1 id="h_2" class="toc">Header & navigation bar</h1></header> +<p>As far as the main site header goes, I decided to use the same one for all pages, containing:</p> +<ul> + <li>The site logo</li> + <li>The search input box (powered by <a href="http://www.google.com/cse/">Google Custom Search Engine</a></li> + <li>A <em>responsive</em> navigation bar with links to all the main sections of the site</li> +</ul> +<p>As far as the navigation bar goes, that&#8217;s pure Bootstrap goodness, nothing new there (except the serif font), <a href="http://twitter.github.com/bootstrap/components.html#navbar">look it up</a>.</p> +<p>For the logo&#8230; Well, I had this nice plan of using just plain <span class="caps">CSS</span> and web fonts to make it (hell, it&#8217;s basically the word &#8220;H3RALD&#8221;, with the 3 slightly bigger and moved a bit). It worked mostly fine (in webkit browser and in Opera), but Firefox didn&#8217;t like it much, and IE&#8230; well, some old versions of IE don&#8217;t play nice with web fonts, so I decided to make a nice <span class="caps">PNG</span> image and stick it there instead. Less hassle, it works everywhere, job done.</p> +<p>The search input box was a bit more of a challenge. I read up on the new <a href="https://developers.google.com/custom-search/docs/element">Custom Search Element Control <span class="caps">API</span></a>, discovered that Google decided that web designers don&#8217;t know Javascript or <span class="caps">CSS</span> nowadays and proposed a new <span class="caps">API</span> that has numerous advantages like:</p> +<blockquote> +<ul> + <li>Easy to use syntax—no JavaScript knowledge required.</li> + <li>Custom Search elements (search boxes and results pages) are rendered based on settings stored on the <span class="caps">CSE</span> servers (along with any client-side customization). Server-side changes don&#8217;t require you to copy and paste any new code into your site<br /> +</blockquote></li> +</ul> +<p>Thanks Google. Now every time I change my stylesheet I have to remember to go back to your page and change the link colors etc. And if I decide to hide the page <span class="caps">URL</span> underneath the link in the results? I can&#8217;t. And that&#8217;s why I decided to reverse engineer their <span class="caps">CSS</span> and provide my overrides. Nasty, but at least I have some control! They&#8217;re all <a href="https://github.com/h3rald/h3rald/blob/master/content/styles/_vendor.scss">here</a>, if you are curious.</p> + +</section> + +<section class="section"> +<header><h1 id="h_3" class="toc">Other minor changes & tweaks</h1></header> +<p>Other changes from the previous design were relatively minimal:</p> +<ul> + <li>No more newspaper-style home page with five columns, two will suffice.</li> + <li>A brand new <a href="/tags/">Tags</a> page, listing&#8230; well, all the site tags that were previously in the <a href="/archives/">Archives</a> pages (now only listing articles by month of publication)</li> + <li>No more Links page. No need for it.</li> + <li>A new, minimalist <a href="/contact/">Contact</a> page, featuring some of the nice <a href="http://zocial.smcllns.com/">Zocial</a> font icons.</li> + <li>No more social buttons on pages. If you use social networks like Twitter, Facebook or Google+ you already know how to share items using bookmarklets or browser extensions. No need to plague my web site with their nasty buttons, badges, ribbons &amp; alike.</li> + <li>No ads! I have a full-time job, my site uses free and open source technologies, and I write because I like to do so, not to make money. And I can afford the few bucks necessary to pay the hosting provider. That&#8217;s why there are NO <span class="caps">ADS</span> on H3RALD.com anymore <sup>(*)</sup>.</li> +</ul> +<p><sup>(*)</sup>: For now, that is. Then I&#8217;ll probably change my mind, but until then enjoy the true no-ads experience!</p> + +</section> + +</section>
A contents/articles/h3rald-v7-overview.html

@@ -0,0 +1,29 @@

+----- +title: Back on Track... +content-type: article +timestamp: 1182515880 +tags: website|rails +----- +<p>&#8230;or better, on <a href="http://www.rubyonrails.org">Rails</a>_. <br /> +Yep, this 7th (!) version of the H3RALD website is powered by the overly-popular Ruby web framework <em>and</em> by the <a href="http://www.typosphere.org">Typo</a> blogging platform.</p> +<p>Nope, I decided not to re-develop my website entirely from scratch this time, although I was tempted to, for three simple reasons:</p> +<ol> + <li>My &#8220;coding time&#8221; is close to non-existent nowadays, and even with a framework like Rails re-developing a site from scratch would have taken at least <em>some</em> time, which at the moment I don&#8217;t have.</li> + <li>Typo is a fairly robust and feature-rich blogging platform, and after learning a little bit of Rails I could customize it to my needs straight away. URLs didn&#8217;t break thanks to Rails&#8217; routing system, migration was easy enough, and developing the missing bits (like a rudimentary BBCode parser and a TextLinkAds sidebar) wasn&#8217;t hard at all.</li> + <li>I wanted to take a break from my site, not code it again.<br /> +<em>Fair enough, but why the new site anyway?</em></li> +</ol> +<p>Again, there&#8217;s more than one answer:</p> +<ul> + <li>Lately I didn&#8217;t feel comfortable sporting a Cake-powered website \- that makes sense, to an extent, right? Good.</li> + <li>I got fed up with spam. I wanted to re-open comments but I didn&#8217;t want to implement spam protection for the old site.</li> + <li>To be totally honest, I got fed up with <span class="caps">PHP</span> itself as well, after trying out Ruby for a few days and ordering and reading the 2nd edition of the <a href="http://www.pragmaticprogrammer.com/titles/ruby/">PickAxe</a>, which I <em>highly</em> recommend.</li> +</ul> +<p>&#8230;But let&#8217;s say something about what&#8217;s new in this new release, shall we?</p> +<ul> + <li>A new, black (and red) theme. Something completely different. Probably not that good, but quite useful: Every day I check my site from my laptop at work, and if it looks like a big black blob I know that I have to regulate my monitor. I showed it to my parents on their old monitor, and they realized that perhaps it&#8217;s time to buy an <span class="caps">LCD</span> one&#8230;</li> + <li>Comments, trackbacks, desktop client support, theme support, a cool admin area and everything else Typo offers.</li> + <li>Full <span class="caps">RSS</span> feeds. With no ads. So you don&#8217;t need to see this black blob anymore, if you really don&#8217;t like it.</li> + <li>No projects or bookmarks, just my blog and my articles. Let&#8217;s keep it simple.</li> +</ul> +<p>More to come&#8230;</p>
A contents/articles/hastyscribe.md

@@ -0,0 +1,173 @@

+----- +title: Introducing HastyScribe +content-type: article +subtitle: A simple command-line application to generate self-contained HTML documents +timestamp: 1405881092 +tags: writing|hastyscribe|opensource +----- + +Did you ever have to write a document, but didn't want to (or couldn't) use MS Word or another WYSIWYG word processor? Yep, I agree: that's what [Markdown](https://daringfireball.net/projects/markdown/) is for. + +Luckily, there are a lot of editors that support Markdown out there (I just installed [MacDown](http://macdown.uranusjr.com/) myself), and they work great, most of the time. Unfortunately though, they often: + + * Generate [HTML](class:caps) _fragments_ instead of full documents + * Don't include a proper stylesheet + * Generate more than one file + +The last one on the list in particular, is true for all of them: the stylesheet may be embedded in the document, but if you want to use images, they are managed as separate files; and the same thing happens if you want to use custom fonts. That's how [HTML](class:caps) works, after all... right? Nope. + +The [Data [URI](class:caps) Scheme](http://en.wikipedia.org/wiki/Data_[URI](class:caps)_scheme) can be used to include data inline inside web pages. This means that the **src** attribute of an **img** can be set to a data [URI](class:caps) containing _the full image_ encoded in base64 instead of a traditional [URL](class:caps). It turns out that you can actually use data [URI](class:caps)s even in [CSS](class:caps) files, for example to embed web fonts instead of linking to the usual .woff, .ttf, .otf etc. &ndash; The only downside is that Internet Explorer 8 only supports data [URI](class:caps)s for images, and only up to 32,768 characters. But luckily these limitations are no longer present in IE9+. + +Anyhow, back to writing documents. Having read a bit about data [URI](class:caps)s and after doing a few tests with all major browsers I thought of creating a program that would: + + * parse markdown and generate [HTML](class:caps) code + * automatically embed all images in the [HTML](class:caps) files + * include a _gorgeous_ stylesheet, with beautiful fonts and awesome icons. + +That's how the concept behind [HastyScribe](/hastyscribe/) was born! + +(Note: my wife actually came up with the name HastyScribe &ndash; I am totally useless when it come to naming programs) + +### The Ingredients + +The first I decided was _not_ to create a GUI for this program. I wanted a command-line utility, and I wanted it to be also self-contained and cross-platform. I am a big fan of [Fossil](http://www.fossil-scm.org/index.html/doc/tip/www/index.wiki) and [SQLite](http://www.sqlite.org/), and I wanted my utility to be tiny, have no dependencies, and run on both my Mac and my Windows computers (and on Linux of course, why not!). + +#### Nim Programming Language + +So I picked a programming language suitable to the task. The winner was [Nim](http://nim-lang.org/), because: + + * It is very elegant and very expressive, like a high-level programming language + * It generates C code that can be compiled on many platforms + * It produces very small executables + * It can work with existing C libraries + * My C is more than a bit rusty, but yes, someone else could have used C for this + * I really, really wanted to try building something with Nim + +#### Discount Markdown Library + +Then I went shopping for a Markdown library. At the time there weren't any in Nim, so I went looking for one implemented in C that I could use with Nim. I chose [Discount](http://www.pell.portland.or.us/~orc/Code/discount/) because of the unique features it offered compared to the competition, especially two of them: + + * Pseudo-protocols, e.g.: `[some text](class:some-class)` &ndash; useful to add a class to an inline element) + * Class blocks: <q>A blockquote with a first line of `> %class%` will become `<div class="class">` instead of a `<blockquote>`.</q> + +I know. I _know_. Those things are an insult to the very phylosophy of Markdown! Err... no, actually. I think David Parsons did an amazing job of adding those functionalities in a way that actually works really well with the rest of Markdown syntax. And besides, no one else had an alternative for class blocks (which are necessary to format things like notes or sidebars). + +#### Fonts! + +Next, I spent a considerable amount of time looking for suitable fonts. I wanted my utility to generate nice-looking documents, and therefore good fonts are essential. + +In the end, my choices were: + +* [FontAwesome][fa], the most obvious choice for all the icons. +* [Mr Bedfort](http://www.google.com/fonts/specimen/Mr+Bedfort), used as the base for the <span class="hastyscribe"></span> logo. +* [Source Sans Pro](https://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1959) and [Source Code Pro](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960), for all standard text and source code. + +[fa]:http://fortawesome.github.io/Font-Awesome/ + +### Developing HastyScribe + +The first thing to do was to make Discount work with Nim. It turned out to be relatively easy to do, because the Nim compiler calls a C compiler (clang or gcc, typically) after compiling Nim code to C, and the compiler call can be configured to link static C libraries to produce a single executable file. Just what I wanted. + +#### Compiling Discount + +So, compiling Discount (with all the options I needed to handle all the extra Markdown extensions) consists in running configure & make: + +> %terminal% +> ./configure.sh --with-tabstops=2 --with-dl=both --with-id-anchor --with-github-tags --with-fenced-code --enable-all-features +> +> make + +Easy peasy on my Mac (and I suspect on Linux too), on Windows as usual I ran into a couple of issues, but nothing huge. First of all you need [MinGW](http://www.mingw.org/), and in particular gcc and make. You can probably compile Discount with something else, but I felt more comfortable with MinGW anyway. + +The one thing I had to fix after running configure was on line 8 of mkdio.h &ndash; I had to change the following line: + +<pre><code class="c">typedef @DWORD@ mkd_flag_t; +typedef unsigned long DWORD; +typedef DWORD mkd_flag_t;</code></pre> + +There's probably a better way to go about this, but it did the trick and I got my **libmarkdown.a** both on Windows and then on Mac. I do have a Ubuntu machine at home but I hardly use it nowadays (I am normally happy with just my [Raspberry Pi](http://www.raspberrypi.org/) running Arch Linux ARM &ndash; but Nim doesn't run on ARM as far as I know). + +#### markdown.nim + +Next, I needed to be able to access Discount API to: + + * compile Markdown code into an [HTML](class:caps) fragment + * generate a Table of Contents automatically + * parse the Pandoc-style document headers (title, author, date) supported by Discount + + So I armed myself with [c2nim](https://github.com/h3rald/hastyscribe/blob/master/hastyscribe.nim) a handy little utility that can be used to convert C code into Nim. In practice, it is very handy for converting simple things like .h files, so I tried it on **markdown.h**. + + Didn't work in a totally automatic way, but it got me far enough that I could handle fixing the remaining bits, mostly consisting in name clashes due to Nim's rather unusual case-and-underscore-unsensitiveness and in a few pragmas to add here and there (`{.push importc, cdecl.}` at the start, for example). + +I also added two high level `md` functions that basically can generate an [HTML](class:caps) document with or without document headers. Here's one of them: + + proc md*(s: string, f = 0, data: var TMDMetadata): string = + var flags = uint32(f) + # Check if metadata is present + var lns = s.splitLines + var valid_metadata = false + var offset = 0 + if (lns[0][0] == '%') and (lns[1][0] == '%') and (lns[2][0] == '%'): + valid_metadata = true + else: + valid_metadata = false + if lns[0][0] == '%': + offset = 2 + if lns[1][0] == '%': + offset = 3 + var str = cstring(lns[offset..lns.len-1].join("\n")) + var mmiot = mkd_string(str, cint(str.len-1), flags) + if valid_metadata: + data.title = $mkd_doc_title(mmiot) + data.author = $mkd_doc_author(mmiot) + data.date = $mkd_doc_date(mmiot) + discard mkd_compile(mmiot, flags) + if (int(flags) and MKD_DOTOC) == MKD_DOTOC: + var toc = allocCStringArray([""]) + discard $mkd_toc(mmiot, toc) + try: + data.toc = cstringArrayToSeq(toc)[0] + except: + data.toc = "" + var res = allocCStringArray([""]) + discard mkd_document(mmiot, res) + result = cstringArrayToSeq(res)[0] + mkd_cleanup(mmiot) + return + +Anyhow, I managed to create a working [markdown.nim](https://github.com/h3rald/hastyscribe/blob/master/markdown.nim) that can be used as any other Nim library (provided that libmarkdown.a is available at compilation time). + +#### hastyscribe.nim + +Writing the code for HastyScribe itself wasn't too hard (Discount does all the heavy-lifting, let's be honest). + +At the beginning of [hastyscribe.nim](https://github.com/h3rald/hastyscribe/blob/master/hastyscribe.nim) you'll find a few `slurp`s &ndash; that yummy Nim proc is what's needed to physically embed all the assets in the executable, and that's why HastyScribe does not need any stylesheets or fonts lying around. + +For the implementation of the snippet functionality and for converting fonts and images into base64 to create the data [URI](class:caps)s I used Nim's [pegs](http://nim-lang.org/pegs.html) module. I chose this module simply because the [regular expression](http://nim-lang.org/re.html) module is an _impure_ (as in "not completely Nim code") module and requires PCRE as a dynamic library and... well, yes, it's the same self-contained obsession thing again, you guessed right. + +Anyhow, the pegs module did a great job with the snippet and image tag parsing. I didn't really even try to integrate this extra parsing within the Markdown code parsing done by Discount, and... well OK, I currently do two separate parsing passes: one before parsing Markdown, to parse snippets, which can therefore contain Markdown code, and another one after the Markdown code has been converted to [HTML](class:caps), to replace standard image (relative) URLs with data [URI](class:caps)s (no, I don't auto-download and convert remotely-hosted images... not yet anyway, so patches are welcome!). + +#### The stylesheet! + +Honestly, the Nim coding part wasn't the longest part of the development phase. If you look at the code stats on Github for the [HastyScribe](https://github.com/h3rald/hastyscribe) repository, it breaks down to the following: + + * Shell: 0.2% + * Nim: 17.1% + * [CSS](class:caps): 82.7% + +Yep. Most of the code is [CSS](class:caps) ([LESS](http://lesscss.org/) actually), and it did take a while to get it right. I used [normalize.css](http://necolas.github.io/normalize.css/) to start with, and I used part of the [FontAwesome][fa] LESS sources as well for the icon classes. The rest is all mine &ndash; but I did look for inspiration in GitHub's own stylesheet for the layout of notes and sidebars. + +I am happy enough with the result, but of course patches are more than welcome. + +Oh yes, and if you are looking for a cross-platform app to compile your LESS stylesheet and merge them automatically, try [Koala](http://koala-app.com/), it's a nice application that can combine and minify both [CSS](class:caps) and Javascript, it's cross-platform (written in Ruby I believe), open source, fun and easy to use, and works very well. + +### Conclusion + +And this is how HastyScribe was born. I have been using it for a few months (the development version) and I spent a lot of time perfecting it, adding features, and improving the stylesheet. + +It is something I needed myself desperately because I always wanted something able to create pretty documents out of Markdown files and that I could use both at work (on Windows) and at home (on OSX). I believe it fills a very specific niche and it will *not* therefore replace your Markdown editor/compiler any time soon &ndash; but if you are in a hurry and don't have time to spent hours creating a stylesheet that works for your needs, maybe this can help. + +An example document? Sure, here's the official [HastyScribe User Guide](/hastyscribe/HastyScribe_UserGuide.htm) (and here's the corresponding [source file](https://raw.githubusercontent.com/h3rald/hastyscribe/master/doc/HastyScribe_UserGuide.md)). + +If you're interested in giving HastyScribe a try, head over to the [project page](/hastyscribe/) and grab it. The pre-compiled binaries are only for Windows and Mac, but I think Linux/BSD/\*nix enthusiasts won't have any trouble compiling Discount and HastyScribe from source anyway! +
A contents/articles/herald-vim-021.html

@@ -0,0 +1,15 @@

+----- +title: herald.vim 0.2.1 released +content-type: article +timestamp: 1258029269 +tags: programming|vim +----- +<p style="float:right;"><img src="/images/herald.vim/0.2.1_release.png" alt="" /></p> +<p><span class="dropcap">I</span> just updated the <a href="/herald-vim-color-scheme/">Herald Vim color scheme</a> to improve the readability of delimiters and search results.</p> +<p>Delimiters are now red (the same color as operators) instead of yellow, so that you can tell the start and end of a string or regular expression more easily. Additionally, search results are no longer highlighted with black text on an orange background for two reasons:</p> +<ul> + <li>the orange background is a bit too strong</li> + <li>the black foreground causes letters to become <em>completely hidden</em> by the <em>cursorline</em> and <em>cursorcolumn</em></li> +</ul> +<p>Search results now have a gray background and a yellow background, as shown in the screenshot on the right.</p> +<p>If you have any constructive suggestion on how to improve this color scheme, don&#8217;t hesitate to add a comment to this post!</p>
A contents/articles/herald-vim-color-scheme.html

@@ -0,0 +1,31 @@

+----- +title: Herald (Vim Color Scheme) +content-type: article +subtitle: My very own VIM color scheme. Featuring 256, 16 and 8 color support, high readability and... pretty colors! +popular: true +timestamp: 1245211860 +tags: programming|vim +----- +<p>I use <a href="http://www.vim.org">Vim</a> a lot. It&#8217;s my editor of choice when I code (mainly in Ruby), and also when I write my blog post and articles (mainly in Textile).</p> +<p>One thing I always liked about Vim was it powerful syntax highlighting: there&#8217;s probably a syntax highlighting file for every programming language ever created, even the new ones (<a href="http://force7.de/nimrod/index.html">Nimrod</a>? Sure, <a href="http://www.vim.org/scripts/script.php?script_id=2632">here</a>!).</p> +<p>Furthermore, Vim allows you to create color schemes, and that&#8217;s surprisingly easy to do. Everything you need to do is in the <a href="http://vimdoc.sourceforge.net/htmldoc/syntax.html">docs</a>, but that may put you off, so you can just start by editing an existing one &#8212; that&#8217;s what I did.h3. InfiniteRed Black</p> +<p>I&#8217;ve been using the <a href="http://blog.infinitered.com/entries/show/8">ir_black</a> color scheme for near enough a year. It&#8217;s an excellent color scheme, recommended especially for writing Ruby code:</p> +<p><img src="/images/herald.vim/ir_black_vim_example.png" alt="" /></p> +<p>I honestly thought this was the best Vim color scheme until I discovered Moria&#8230;</p> +<h3>Moria</h3> +<p>Recently I switched to <a href="http://www.vim.org/scripts/script.php?script_id=1464">moria</a>, mainly because I find it easier on the eyes. It&#8217;s a matter of taste, of course:</p> +<p><img src="/images/herald.vim/moria_vim_example.png" alt="" /></p> +<p>The trick is in the background: it&#8217;s not completely black. Still, I didn&#8217;t quite like the colors, so I decided to write my own&#8230;</p> +<h3>Herald</h3> +<p>Meet <strong> <a href="/files/herald.vim">herald.vim</a> </strong> (this is a direct link to the raw file, but you may also want to check my <a href="http://github.com/h3rald/stash/tree/master">stash</a> on GitHub or the <a href="http://www.vim.org/scripts/script.php?script_id=2684">script page</a> on Vim.org):</p> +<p><img src="/images/herald.vim/herald_vim_example.png" alt="" /></p> +<p>To sum up, here&#8217;s the <em>features</em> offered by this new color scheme:</p> +<ul> + <li>It&#8217;s easier to differentiate syntax elements; in particular reserved words like <code>if</code> or <code>end</code>, constants (symbols) and identifiers (instance variables).</li> + <li>Operators are highlighted and easier to notice.</li> + <li>Dark gray background and black column/row selectors.</li> + <li>Added highlight for titles (useful for Textile)</li> + <li>Comments do not stand out, unlike in most color schemes</li> + <li>Support for 256 color terminal (special thanks to <a href="http://www.frexx.de/xterm-256-notes/">Wolfgang Frisch</a> for providing all the info and tools required)</li> +</ul> +<p>So what do you think? Is it tool colorful perhaps? How would <strong>you</strong> improve it?</p>
A contents/articles/hlrb-review.html

@@ -0,0 +1,67 @@

+----- +title: Book Review: Humble Little Ruby Book +content-type: article +timestamp: 1191383580 +tags: ruby|review|books +----- +<p>After reading the very first paragraph of Mr. Neighborly&#8217;s <a href="http://www.humblelittlerubybook.com/">Humble Little Ruby Book</a> (<span class="caps">HLRB</span> for short, from now on) it was very clear to me that it was going to be quite an unconventional read:</p> +<blockquote> +<p>&#8220;Yes, there is a Chapter 0. There is a little bit of introductory stuff we need to talk about before <br /> +we set you loose on Ruby. You wouldn&#8217;t want to get psyched about a new gadget, get it home, <br /> +and then figure out you need batteries, a grapefruit, and the ability to speak three languages to <br /> +even open the box would you?&#8221;</p> +</blockquote> +<p>That reminded me immediately of <a href="http://poignantguide.net/ruby/">Why&#8217;s Poignant Guide to Ruby</a>. without a doubt. I don&#8217;t know how it is possible that two witty, crazy, and very inventive guys grew fond of the same programming language. Anyhow, to reassure a few of you, you won&#8217;t find any foxes or chunky bacon cartoons in <span class="caps">HLRB</span>, just some very well made (although still pretty unconventional) diagrams like this one:</p> +<p><img src="/files/hlrb_diagram.png" alt="" /></p> +<p>Got the picture? Good. Let&#8217;s move on&#8230;h3. Chapter 0: What&#8217;chu talkin&#8217; &#8217;bout, mister?</p> +<p>Chapter 0 is like an introduction to the book <em>and</em> a place to put all the boring stuff you have to talk about in a book about a programming language:</p> +<ul> + <li>What is Ruby?</li> + <li>Installation procedure (on Windows, Mac OS X and Linux)</li> + <li>Hello, World!</li> +</ul> +<p>Yes, you can skip this one safely without losing too much, unless of course you still need to install Ruby on your machine.</p> +<h3>Chapter 1: Welcome to Ruby.</h3> +<blockquote> +<p>&#8220;This section aims to introduce the syntactic sugar and linguistic misfortunes of Ruby in the <br /> +quickest manner that will still allow for a full education on the subject.&#8221;</p> +</blockquote> +<p>As the first two lines of this chapter say, it&#8217;s time to learn the basics of Ruby. You&#8217;ll be quickly guided through strings, numbers, collections and variables. Every section with tons of code examples for your to play with. You won&#8217;t find a full list of all the 876 methods of the String class, but you&#8217;ll certainly learn the 10 most common ones at least (numbers are random, so no, don&#8217;t count them). <br /> +Sure, yes, right, whatever&#8230; <em>if you really want</em> you can skip this chapter too, but if you are already a Ruby Guru there&#8217;s probably no need for you to read books about Ruby, right? Beginners need to read this chapter. It&#8217;s compulsory, really, and pretty enjoyable, too.</p> +<h3>Chapter 2: Break it down now!</h3> +<p>Or &#8220;learn how to segment your code&#8221; using methods, and&#8230; blocks &amp; <code>Proc</code> objects! Gosh. Our poor newbies will probably have a heart attack if they never heard about blocks and closures before. I almost got scared myself, because this is normally regarded as a pretty tough topic. Despite, at page 25 of the book you&#8217;ll have to face your fears and dive into it. You&#8217;ll survive, anyway.</p> +<p><strong>Purist Warning:</strong> Please be aware that sometimes the author may decide to use certain terms and construct which may not sound 100% right to your ears. Just move on, beginners will understand more things like <em>&#8220;Think of Proc objects as blocks that are pushed into variables.&#8221;</em> than anything else, guaranteed.</p> +<p>After this section you&#8217;ll finally be introduced to Ruby classes. Now, this can piss someone off, no doubt. Ruby is a <em>fully OO language</em>, so people <em>must</em> learn about classes before anything else. I must admit I was a bit confused by the ordering of the topics at first, but if someone comes from a non-OO background he&#8217;ll probably find this particular order more suitable. <br /> +This section will cover class and object basics in Ruby like defining classes, instantiating objects, access control, methods, attributes, scope, duck typing. Finally, you&#8217;ll briefly look into modules as well.</p> +<h3>Chapter 3: Hustle and flow (control)</h3> +<p>Finally, the author will deal with flow control. So things like <code>if</code>, <code>case</code>, conditional operators, loops and statement modifiers. In my opinion this section is truly excellent: it introduces all the control structures in a very simple and crystal clear way, often using flowcharts. A great chance even for absolute beginners to understand these basic but powerful concepts.<br /> +Towards the end of the chapter, you&#8217;ll also learn how exceptions work: a clever way to tell people &#8220;you have to learn how to use exceptions from the very beginning&#8221;. Really nicely done.</p> +<h3>Chapter 4: The system beneath&#8230;</h3> +<p>Here comes the juicy stuff. Up to now you learnt the usual boring things you need to know when learning a new programming language, now finally you learn how to do <em>real things</em>. The chapter is full of complete and meaningful code snippets which will answer nearly all the questions you may have (at this time):</p> +<ul> + <li>How do I read and write to a file?</li> + <li>How do I handle threads and processes?</li> + <li>How do command-line parameters and environment variables work?</li> + <li>How can I perform specific Windows-only operations, like reading and writing to the Registry? What about <span class="caps">OLE</span> automation?</li> +</ul> +<p>Some of the big books out there will not spend too much time talking about Windows-only libraries, but I found <span class="caps">HLRB</span> gives quite a comprehensive introduction about them.</p> +<h3>Chapter 5: Looking beyond home</h3> +<p>More juicy stuff. If you are looking for a tutorial to learn the basics about networking, from from sockets to <span class="caps">FTP</span> to <span class="caps">POP</span> and web services, look no further: this chapter does a very remarkable job introducing various network-related libraries, with the usual well written code examples.<br /> +If that&#8217;s still not enough, you&#8217;ll also have a chance to explore the wonderful world of distributed Ruby and of databases. Granted, this chapter won&#8217;t tell you about the 1567 methods available in ActiveRecord (buy a copy of <a href="http://www.pragmaticprogrammer.com/title/rails/">Agile Web Development with Rails</a> for this), but will tell you enough to get started.</p> +<h3>Chapter 6: It&#8217;s a Library!</h3> +<p>The final chapter will go more in depth on some more advanced topics, like:</p> +<ul> + <li>Strings</li> + <li>Regexp</li> + <li>Date &amp; Time</li> + <li>Hashing and Cryptography</li> + <li>Unit Testing</li> +</ul> +<p>Everything with more and more useful code snippets.</p> +<h3>The Appendices</h3> +<p>Last but not least, a <span class="caps">HUGE</span> collection of links and resources to learn more about Ruby, and a quick digression on C/C++ extensions&#8230; not much, but enough to wet your appetite.</p> +<h3>The bottom line</h3> +<p><span class="caps">HLRB</span> is not <em>the only</em> book you need to read about Ruby. It&#8217;s better to make this clear otherwise I&#8217;ll be hunted forever by Dave Thomas, Chad Fowler, <span class="caps">DHH</span> and all the other excellent Ruby hackers who also wrote very successful books (which I bought as well). <span class="caps">HLRB</span> is <span class="caps">LITTLE</span> and <span class="caps">HUMBLE</span>, after all: it doesn&#8217;t aim at becoming the official Ruby Bible anytime soon (although a bird told me it may get updated <em>someday</em> and include more stuff), but it is still a worthwhile reading.</p> +<p>And of course I came to the very end of this review without mentioning the most important thing: this little wonder is free. All you need is to register to InfoQ (for free) and grab your <a href="http://www.infoq.com/minibooks/ruby/">free copy</a>. If you want you can buy a printed copy for just $9.95, if you feel in a good mood (please do).</p> +<p>The most obvious strengths of this book are the abundance of code examples and very useful working snippets, and the unconventional style which makes it very readable and not boring at all. If I were to name some of its weaknesses (but only if you force me to), I&#8217;d say some parts should be expanded and more info on other libraries should be provided&#8230; but you never know what the future will bring us!</p> +<p>Well done, <a href="http://www.jeremymcanally.com/">Mr. Neighborly</a>!</p>
A contents/articles/holiday-house-for-rent.html

@@ -0,0 +1,12 @@

+----- +title: Holiday house for rent +content-type: article +timestamp: 1240530840 +tags: personal +----- +<p><img src="/images/sessarego/outside.jpg" style="float:left; border: 1px solid #B80000; margin-right: 10px;" /></p> +<p>Part of my family house in the countryside is now available for rent! It&#8217;s located in the small village of <a href="http://italia.indettaglio.it/eng/liguria/genova_bogliasco_sessarego.html">Sessarego</a>, a few minutes away from the coast, on the Italian Riviera.<br /> +We&#8217;ve been living there recently for 6 months when I started working and then moved to the city in order to be nearer to my workplace, but we still go there on holidays or on the odd week end, sometimes.</p> +<p>The house is fully furnished, it has been recently renovated, and offers all major comforts and services (utilities, TV, internet, phone, etc.). It can be ideal as a holiday house for writers, programmers, or anyone who would like to take a break from the chaotic city life without giving up all the commodities of modern life, such as the Internet.</p> +<div style="padding: 30px"></div> +<p><strong>For more information, see <a href="/holidays">this page</a> and feel free to <a href="/about">contact me</a> if you want to book your stay or you needmore details!</strong></p>
A contents/articles/ie-lovers-guide-to-firefox.html

@@ -0,0 +1,7 @@

+----- +title: An IE Lover's Guide to Firefox +content-type: article +timestamp: 1132940820 +tags: ie|firefox|microsoft|firefox|browsers +----- +This is an attempt to explain to Internet Explorer users what Mozilla Firefox is, what its features are and how it can be enhanced or customized. Although this article is written primarily for IE users, it will make interesting reading for any Firefox user who wants to try to convince even the most hopeless IE fan to adopt Firefox for everyday use. <br /><strong><span style="text-decoration:underline;">My Point of View</span></strong><br />After using Mozilla Firefox for at least 2 years, I must admit two things: I'm biased towards Firefox, and I just about forgot what IE is like. When you ask someone who's been using Firefox for a while why he likes it, he would probably say something like, "because Firefox is much better than IE." Then he would start boasting about Firefox's features, like tabbed browsing, security improvements, popup blocking, extensions and so on, without thinking that maybe an accustomed IE user would be overwhelmed by all these new things, and in the end, might become even more obstinate in using IE. <br /><br />From here on, I'll play the part - for teaching purposes only, of course - of an Internet Explorer lover: IE is the only browser I've ever tried, and it is the only thing you need to surf the Net. I also talked with some IE users I know and I actually opened the browser myself (once again, for teaching purposes), and visited some sites. <br /><br />Why not have a real IE Lover write this article? Well, I thought about it, actually, and the only answer I could come up with was: there's no such thing as an 'IE lover', only a lot of people who are too used to IE to want to switch to Firefox. So, I'd better write this all myself; after all, a long time ago, I was just like those people.<br /><br /><br /><strong>IE: I've used it for years and it does the job</strong><br /><br />When I bought my computer from my favourite retailer, I immediately asked him: "Can I go on the Internet with it? Do I need to buy any particular program to visit websites?" and I was told that I didn't need anything at all, because it was all included in <em>Windows XP</em>. I just had to click on the start button and choose "Internet" from the pop-up menu. "Straightforward," I thought. "Anybody can do that!"<br />I soon noticed that to browse the Internet, Windows used a program called Internet Explorer 6, which was actually part of the whole Windows infrastructure, somehow: it's the same thing, more or less, that I use to view directories on my hard drive, just online. This is the way it should be - so tightly integrated with the operating system that you hardly notice its presence!<br /><br />After a while, I learned some more about Internet Explorer, and I noticed that a lot of other applications could be integrated into it, like download managers and <a href="http://www.adobe.com/products/acrobat/readstep2.html">PDF viewers</a>. I also discovered that I could even <a href="http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx">listen to music and watch videos</a> through my browser, directly from webpages.<br /><br />Then I discovered toolbars - and I wasn't entirely happy about them. I installed <a href="http://toolbar.google.com/index_2">Google Toolbar</a>, and I really enjoyed its features, but I noticed that some other toolbars seemed to be installed, even if I didn't want to: I think some other program asked me to install them or something; I don't really know. All I do now is just set Internet Explorer not to display them, and change my starting page back to what I want, because sometimes, for some reason, IE starts with a different page than what I want.<br /><br />All that aside, what I really like about IE is that I can use it for anything and everything, even updating Windows! Microsoft has another cool technology called ActiveX which allows me to download and install Windows security patches and upgrades automatically!<br /><br />I really don't understand how people can run an operating system other than Windows: the Web was <strong>made</strong> for Internet Explorer! It's even <a href="http://www.microsoft.com/mac/products/internetexplorer/internetexplorer.aspx?pid=internetexplorer">available for Macintosh</a>. <br /><br />A friend of mine told me he started using another browser called "Firefox" or "Firebird" or something, and he really likes it! He said it can be used on Windows, Macintosh, Linux, Solaris, and Unix, but when I asked him why it was so good, he told me, "Because it's better, and IE sucks." <br /><br />I don't understand how he can say that, especially because everyone I know uses Internet Explorer, Bill Gates made loads of money out of it, so it can't be that bad! Anyhow, I decided to give this Fire-thingie a shot.<br /><br /><br /><strong><span style="text-decoration:underline;">Face to Face with a Fox</span></strong><br />My friend told me to download this thing from a <a href="http://www.mozilla.org/products/firefox/">website</a>, because it's free. So what? IE is free, too, because it came with my PC. Anyhow, I figured I'd just go and download it so he'd leave me alone about it. I read that Firefox - that's its name - is a free browser developed by the <a href="http://www.mozilla.org">Mozilla Foundation</a> which has received a lot of <a href="http://www.mozilla.org/press/awards.html">awards</a> from various well-known computer-related websites and institutions. It also seem to have a promotional <a href="http://www.spreadfirefox.com/">website</a> that says it has been downloaded nearly seventy million times! All the geeks seem to use it, and they love it. Maybe it's really good, or maybe they just don't like Microsoft. <br /><br />When I ran Firefox for the first time, Internet Explorer warned me that it couldn't verify the authenticity of the download, or something like that, but it says that all the time when I download stuff.<br />The first thing that happened was that I was prompted to import my favourites from Internet Explorer. Great! I didn't want to lose all the sites I have had bookmarked for years. So far, so good.<br /> <br />There were no XP-related icons at all, just some weird ones I didn't like, especially the "Home Page" icon. It sucks compared to the one in IE. It doesn't integrate with Windows; it's just another application for browsing websites, like that <a href="http://www.netscape.com">Netscape</a> thing my friend made me try a few years ago. That at least had an email client and other things included with it. <br /><br />Firefox isn't worth the hassle: my favourite websites look "broken" and the thing is continuously complaining about plugins to view some pages. Some websites even tell me off now because I'm not using IE, in particular Microsoft, which doesn't let me update <a href="http://v4.windowsupdate.microsoft.com/en/thanks.asp?">anymore</a>. I switched back to IE after a few minutes of pointless struggle. <br /><br /><br /><strong>Here's What You Get</strong><br />Firefox and IE are two very different things, and I didn't like that, but I admit I had some prejudices, maybe because of the fact that my friend told me to download something and said it was better, and it really wasn't. So I decided to give both him and Firefox a second chance, and I asked him to explain to me why Firefox is better than Internet Explorer. <br />The first thing he mentioned was the different terminology used by the two browsers, which can be summarized as follows:<br /><code><br />| Internet Explorer | Firefox |<br />| Internet Options | Options |<br />| Temporary Internet Files | Cache |<br />| Favorites | Bookmarks |<br />| Address Bar | Location Bar |<br />| Refresh | Reload |<br />| Links Bar | Bookmarks Toolbar |<br />| Explorer Bar | Sidebar |<br />| Copy Shortcut | Copy Link Location |<br />| Save Target As | Save Link As |<br /></code><br />and that once you get used to the new terms, finding what you're looking for is easier than in Internet Explorer. <br /><br />My friend also said a new feature implemented by Firefox is <em>popup blocking</em>. So I told him that as of Service Pack 2, even Internet Explorer blocks popups (and before that, so did my Google Toolbar) but apparently Firefox had this feature long before Microsoft did. Good to know, but not really impressive.<br />What was more interesting was that Firefox lets you type in whatever you want in the Location bar, even if it's not a Web address, and you will still get the most relevant page available: for example, typing "firefox" takes me to <a href="http://www.mozilla.org/products/firefox/">http://www.mozilla.org/products/firefox/</a>. This is accomplished through Google's "<a href="http://www.google.com/help/features.html#lucky">I'm Feeling Lucky</a>" feature. IE doesn't do this: it gives me a search page for what I typed, or it tries to 'guess' the domain by adding a .com or .net after the word.<br /><br />Firefox still didn't really impress me: some nice tricks, but nothing that would make me want to switch. What started to make the difference was the <strong><em>Tabbed Browsing</em></strong> feature: I knew about it already, because IE started implementing that through the <a href="http://toolbar.msn.com/">MSN toolbar</a>, but it's a bit<a href="http://weblogs.mozillazine.org/asa/archives/008312.html">buggy</a>, so I didn't even try it. Firefox has had this feature since its very first <a href="http://www.mozilla.org/products/firefox/releases/0.1.html">release</a>, so I guess it they represents a fully-functional, stable, and key feature of the browser. Tabbed browsing introduces a new <em>philosophy</em> for browsing the web: there is only one browser window, but it can have multiple <em>tabs</em>, each displaying a different page. You can switch from one tab to another by clicking on the title (tab titles appear horizontally under the location bar), "Open Link in New Tab" by right-clicking on a link, and open empty tabs with either CTRL+T or from the <em>File</em> menu. It takes a while to get used to it, but after a while I couldn't really live without it!<br /><br />I then asked my friend why Firefox doesn't allow me to play music or videos or read pdf files, etc., and he said that I needed to install all the necessary <a href="https://pfs.mozilla.org/plugins/">plugins</a>. This is the most annoying thing about Firefox: you have to "feed" it and "teach" it things - a lot like a baby, really. If the analogy is truly valid, in the end it should be worth it, and I have the feeling that my Firefox will grow up well, if I'm careful.<br /><br />After learning about plugins, and teaching my little Firefox what to do with movies, songs and other types of files, I learnt that it had another really smart feature: outstanding, built-in <em>search capabilities</em>.<br />I had already noticed the small search bar on the top right, next to the location bar: it's basically a shortcut to Google Search. Cool, but I already had this in IE. One thing I didn't like about IE though, was that if I wanted to use a different search engine, like Yahoo or MSN, I had to install <em>another toolbar</em>, and I ended up with something like three different toolbars under the address bar, so I could hardly see the webpages I was browsing!<br /><br />Firefox apparently knows that people might need to use more than one search engine, so you can select other search engines by clicking on the little icon on the left of the aforementioned search bar. Yahoo, MSN, Wikipedia, and others are available, and <a href="http://mycroft.mozdev.org/download.html">others</a> can be installed easily. If you need a plugin for a search engine, and it doesn't exist yet, you can even make it yourself quite <a href="http://mycroft.mozdev.org/generator/">easily</a>.<br /><br />But let's come back a bit to when I ran Firefox for the first time: where did my IE Favourites go? Under the <em>Bookmarks</em> menu, obviously, and they even kept their folder structure. They can be organized through the <em>Manage Bookmarks</em> option, and indeed Firefox's <em>Bookmarks Manager</em>'s interface looks much cleaner and is easier to use than IE's. However, since all the imported bookmarks get dumped in a subfolder, it takes a little time to get them all up to the top level.<br /> <br />Firefox also implements <em>Live Bookmarks</em>: some sites, especially news-related ones like <a href="http://news.yahoo.com/">Yahoo News</a> and <a href="http://news.bbc.co.uk/">BBC News</a>, and <a href="http://slashdot.org/">Slashdot</a> offer <a href="http://en.wikipedia.org/wiki/RSS_%28file_format%29">RSS</a> feeds which are updated several times a day. With Firefox, you can <em>subscribe</em> to a particular site's RSS by clicking on the little square orange icon which appears on the status bar, and a <em>Live Bookmark</em> will be saved. They appear under the <em>Bookmarks</em> menu, in a specific folder, and also on your <em>Bookmarks Toolbar</em> which is under the location bar: clicking on one of them will show the corresponding site's current headlines. You can click on any of the headlines to read the full story/article.<br /><br />Even if my friend realised he just created another Firefox fan, he insisted on telling me a few words about Downloads and Options. Regarding Downloads, there's not much to say: Firefox incorporates a <em>Download Manager</em> that saves all files downloaded from the Net in a specific (selectable) folder, and keeps a history of all downloads. The download manager is opened automatically whenever a file is downloaded, and it also can be opened manually by selecting <em>Tools-Downloads</em>. The really handy part is that you can easily open a downloaded file or the folder it's in, or clear your download history all in one place. The drawback is that it stays open until you close it, and you have to click a button to clear the already downloaded files from the queue.<br /><br /><em>Options</em> is more complex to deal with, as Firefox does not rely on Windows' <em>Internet Options</em>. Firefox's Options (under the <em>Tools</em> menu) are more complete and better organized, as they are clearly divided into 5 main categories:<br /><br /><em>General</em><br />In this panel you can set up your starting page, fonts, colors, language, character encodings, whether or not Firefox is the default browser, and your connection settings.<br /><br /><em>Privacy</em><br />Here - and this is really much better than in IE, I must admit - you can clear and manage history items, saved form information, saved passwords, download manager history, cookies and the browser cache. You can clear everything with a single click, but you'll lose all your saved passwords and your history lists.<br /><br /><em>Web Features</em><br />This panel is for setting your preferences regarding popup blocking, software installation, images, Java and JavaScript.<br /><br /><em>Downloads</em><br />Here you can choose your download destinatination folder as well as set other download-related preferences, like setting particular file types to save to a particular folder.<br /><br /><em>Advanced</em><br />This panel is for - as the name implies - advanced preferences regarding accessibility, browsing, security, validation and certificates. You don't need to change anything here unless you've been told to or you know what you're doing.<br /><br /><em>Is That All?</em><br />That's what I thought, and although I was really impressed with Firefox, I was still missing some features that IE had, such as third party toolbars. My friend was about to go, but he quickly opened a pre-defined firefox bookmark: <a href="https://addons.mozilla.org/">Mozilla Update</a>. "Now you know how Firefox works: I'm sure you can work this out by yourself," he said, and left me with a door to another vast world to explore. The journey was far from over.<br /><br /><br /><strong>Extensions and Themes</strong><br />One aspect of Firefox that was a bit discouraging was the fact that once you install the browser you need to install this, download that, and configure the other thing. For any IE user (like me), this is a major hassle: before, I just wanted to browse the Net, and I didn't care what I was using or how I was using it. Now, I have to be aware of certain things, and more or less <strong>create</strong> the browser I need! On the other hand, this is sort of exciting, in the sense that unlike IE, Firefox can became whatever you want it to be.<br /><br />Even after using Firefox for a while, and even after my friend had explained all its nice features, I still felt that it was somehow incomplete. Luckily, Firefox has <em>extensions</em> and <em>themes</em>. The numerous <a href="https://addons.mozilla.org/extensions/?application=firefox">Extensions</a> enhance Firefox by adding new features which - honestly - I never thought were even conceivable to be included in a browser. Furthermore, Firefox also has <a href="https://addons.mozilla.org/themes/?application=firefox">Themes</a>, so you can change the browser into something completely different, with different icons, shapes and colors!<br /><br />It's worth it to mention some <em><strong>Extensions</strong></em> which really impressed me by the functionality or behaviours they added to Firefox:<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=10&application=firefox">Adblock</a><br />This extension blocks ads - if you don't want to see a banner on a certain site anymore, just right-click on it, select AdBlock, and it's gone! It also remembers your preferences for every URL or site. It's easily customizeable and useful.<br /> <br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=158&application=firefox">Tabbrowser Preferences</a><br />This adds a new category in your Options called Tabbed Browsing, where you can customize particular behaviours concerning tabs, like opening all addresses typed in the location bar in a new tab (focused or unfocused), forcing links to open in new tabs instead of new windows, and so on. <br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=220&application=firefox">FlashGot</a><br />I complained before that my download manager wasn't integrated with Firefox: this extension does that, and supports nearly every possible download manager and accelerators. It also has a built-in gallery to quickly see what file types you are downloading.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=743&application=firefox">CustomizeGoogle</a><br />This personalises Google-related sites and services, such as using <a href="http://www.google.com/webhp?complete=1&hl=en">Google Suggest</a> in every search, filtering content and ads, anonymizing data transmitted to Google, and much more.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=398&application=firefox">ForeCastFox</a><br />Get weather forecasts from all over the world displayed directly on your status bar or anywhere you want.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&category=Developer%20Tools&numpg=10&id=60">Developer Tools</a><br />This is THE ultimate solution if you are a web developer or interested in knowing more about webpages. With this extension you can:<br />- Disable <strong>anything</strong> with a single click (images, JavaScript, cookies, colors, animations, etc.)<br />- Get CSS information or modify a page's CSS<br />- Have fun with Forms (convert POSTs to GETs, show hidden fields, and so on)<br />- Perform image-related operations: show paths, attributes, outline particular images, etc.<br />- Get infos about various elements on a page<br />- Clear history, cookies, open java console, view document's source<br />- Outline particular elements (images, tables, etc.)<br />- Resize your browser to a custom or predefined resolution<br />- Validate a page (HTML, CSS, WAI accessibility, speed reports)<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=33">Googlebar</a><br />Clone of the IE Google Toolbar.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=270">Yahoo Companion</a><br />Clone of the IE Yahoo toolbar.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=219">FoxyTunes</a><br />Control your favourite media player (several programs supported) directly from Firefox!<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=16">ChatZilla</a><br />A complete, fully functional, easy-to-use IRC client which runs from Firefox.<br /><br /><a href="https://addons.mozilla.org/extensions/moreinfo.php?id=684">FireFTP</a><br />Fully integrated FTP client.<br /><br />There are actually many more extensions available from either the Firefox website or other <a href="http://www.extensionsmirror.nl/">portals</a> which can be very useful, depending on your needs, but there are also <strong>Themes</strong> which can change Firefox's look and feel completely, such as:<br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?id=7&application=firefox">Qute</a><br />This theme inspired Firefox default theme: "Icons designed to be modern, dynamic and fresh, with attention paid to usability and comfort over extended use".<br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?id=101&application=firefox">Silverskin</a> <br />"Your favourite browser with a silver skin (With the Qute icons by Arvid Axelsson)"<br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?application=firefox&category=Popular&numpg=10&id=414">Saferfox Xpanded</a> <br />"A full skin theme with a modern aqua design"<br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?application=firefox&category=Popular&numpg=10&id=213">Plastikfox Crystal SVG</a><br />"Plastik style from KDE with Crystal SVG icons" <br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?application=firefox&category=Popular&numpg=10&id=72">Noia (eXtreme)</a><br />"This theme is based on the Noia2.0 icon set by Carlitus."<br /><br /><a href="https://addons.mozilla.org/themes/moreinfo.php?application=firefox&category=Popular&numpg=10&id=548">Brushed</a><br />"A Brushed and Polished Browser Interface."<br /><br />Again, many more themes are available. There's something for everyone, really!<br /><br /><br /><strong>To switch or not to switch?</strong><br /><br />Yes, OK, it's not one of those questions which will keep you up at night, but for sure it can be a quandary. Personally, I decided to switch to Firefox gradually, while still viewing some sites in IE, because I think this can be a good compromise. The biggest problem is that even if Firefox supports Web standards (my friend said IE doesn't) some sites do not. Especially before Firefox, web developers apparently had to create their sites to be viewed correctly with Microsoft's browser. That's why some sites still have things like "This site is best viewed in Internet Explorer 6", or even, in some cases, they'll suggest you download the latest IE version, because <em>your browser is incompatible</em> when actually it's <em>the site</em> which is not compatible with <a href="http://www.w3c.org/">Web Standards</a>.<br />Furthermore, <a href="http://www.microsoft.com/com/default.mspx">ActiveX</a> is a non-standardized proprietary technology which Microsoft uses to make software components communicate and also provide complex functionalities necessary for things like Windows Update. Firefox doesn't support ActiveX, which has been exploited many times in the past (and still now): tough luck. Nowadays, Microsoft wants you to have Automatic Updates turned on, so you don't need to visit the Windows Update site anymore. As far as I'm concerned, I'm not too bothered by that, but if someday I need ActiveX technology, there's already a <a href="http://www.google.com/url?sa=U&start=1&q=http%3A//www.iol.ie/%7Elocka/mozilla/mozilla.htm&ei=cwnIQu_tBYqgiAKd9bGrCw&sig2=afi7r8Pa_YLozVo0JbGp9w">Mozilla Project</a> on it. Final note: If you need to switch back to IE for some reason, the <a href="https://addons.mozilla.org/extensions/moreinfo.php?id=35">IE View</a> extension can quickly give you the opportunity to do so, opening IE to view the page you're visiting.<br /><br />It looks like the Browser Wars have started again, and as a matter of fact, Firefox is becoming known for its features, innovations and <a href="http://www.mozillazine.org/">community support</a>. Switching can be scary, and people can try forcing you to do it, but you shouldn't listen to them: don't start using Firefox just because "it's cool" or "everybody uses it"; try it first, understand how it works, and spend time learning it, because it just might be worth it. <br /><br />One thing is certain: The existence of IE lovers is debatable, but there are over <a href="http://www.spreadfirefox.com">170 million</a> Firefox lovers. Go <a href="http://www.mozilla.org/products/firefox/">get it</a>! <br />
A contents/articles/im-on-twitter-anyway.html

@@ -0,0 +1,15 @@

+----- +title: I'm on Twitter, anyway... +content-type: article +timestamp: 1211101440 +tags: personal|review|programming +----- +<p>I&#8217;ve been neglecting my blog, I know. The truth is that I&#8217;m quite busy in this period: I have more responsibilities in my daily full-time jobs, my lunch breaks are getting shorter and I don&#8217;t have much free time. At any rate, here&#8217;s what&#8217;s going on:</p> +<ul> + <li>I&#8217;m writing a new article for an online magazine (assuming I&#8217;m gonna finish it)</li> + <li>I signed up for a freelance technical reviewing job, for a new Ruby book which will come out soon-ish</li> + <li>I&#8217;m getting ready to finally visit Rome (again), this time with my fiancée, for our fifth anniversary.</li> + <li>I&#8217;m slowly preparing a version 1.0 of <a href="http://code.google.com/p/redbook/">RedBook</a>, which involves quite a lot of refactoring (and hopefully better documentation and tests).</li> + <li>I&#8217;m trying to learn a little bit of Haskell: it seems to be one of the few non .<span class="caps">NET</span> languages able to produce standalone .exe files, nowadays&#8230;</li> +</ul> +<p>Last but not least, I now decided to use <a href="http://twitter.com">Twitter</a> regularly, so you can follow me <a href="http://twitter.com/h3rald/">there</a>, if you wish!</p>
A contents/articles/incomplete-guide-to-london.html

@@ -0,0 +1,165 @@

+----- +title: Fabio's (In)complete Guide to London +content-type: article +subtitle: Some (non-)essential tips on getting around, eating, and enjouing yourself +popular: true +timestamp: 1156307004 +tags: travelling +----- +<p>This summer I finally had a chance to spend <em>a whole week</em> in London. The city itself was not new to me, since I visited it 6 times before this one, but this summer was different, in a word: Roxy (my fiancee)&#8217;s brother Caspar was happy to host us at his place, for free.<a name="top"></a></p> +<h3>Table of Contents</h3> +<ul> + <li><a href="#pre">Preamble</a></li> + <li><a href="#trans">Transportation</a> + <ul> + <li><a href="#planes">Planes</a></li> + <li><a href="#trains">Trains, coaches and cabs</a></li> + <li><a href="#tube">The tube and buses</a></li> + </ul></li> + <li><a href="#food">Food</a> + <ul> + <li><a href="#rubbish">Rubbish Food</a></li> + <li><a href="#healthy">Healthy Food</a></li> + <li><a href="#brick">Brick Lane</a></li> + </ul></li> + <li><a href="#enter">Entertainment</a> + <ul> + <li><a href="#club">Clubbing</a></li> + <li><a href="#museums">Museums</a></li> + <li><a href="#theatres">Theatres</a></li> + <li><a href="#shop">Shopping</a></li> + </ul></li> +</ul> +<p><a name="pre"></a> <a href="#top">[Back to Top]</a></p> +<h3>Preamble</h3> +<p>This summer I finally had a chance to spend <em>a whole week</em> in London. The city itself was not new to me, since I visited it 6 times before this one, but this summer was different, in a word: Roxy (my fiancee)&#8217;s brother Caspar was happy to host us at his place, for free.</p> +<p>Although we obviously had to pay for our flight, transport, food, etc. etc., we didn&#8217;t have to pay for accommodation, which was indeed quite an achievement, considering the prices of hotels and flats in London. The bad news is that this Guide, although already lacking a lot of information (try describing everything you can do in London in a single, not-too-boring article), will not contain any particular hints and tips on how to find accommodation in one of the most interesting cities in Europe &#8211; unless of course you get to stay at Caspar&#8217;s place.</p> +<p><a name="trans"></a> <a href="#top">[Back to Top]</a></p> +<h3>Transportation</h3> +<p>Getting there is relatively easy and if you come from Europe there&#8217;s a quick answer to the universal traveller&#8217;s question:</p> +<p><em>&#8220;Is there any cheap, reliable and on-time airline?&#8221;</em></p> +<p><a name="planes"></a> <a href="#top">[Back to Top]</a></p> +<h4>Planes</h4> +<p>Yes, there is. Apparently some Irish man thought he could make millions by buying loads of Boeing 737-800 and selling cheap flight tickets to everyone going to or from London, and he actually did. <a href="http://www.ryanair.com">RyanAir</a> is the answer: a cheap-but-reliable airline which will make you arrive even early than you expected by paying tickets as low as 1p (plus 20-30 Euro airport taxes). Unfortunately they don&#8217;t provide full meals aboard, they don&#8217;t have any cutlery on board for you to steal, unlike <a href="http://www.britishairways.com/travel/globalgateway.jsp/global/public/en">BA</a><em>, and flight attendants are not hot either, unlike <a href="http://www.britishairways.com/travel/globalgateway.jsp/global/public/en">BA</a></em>, but since I&#8217;m happily engaged and Roxanne doesn&#8217;t fancy me stealing BA cutlery it&#8217;s better this way indeed. <br /> +Unfortunately we booked only a month before and thus the flight for both of us (return) was about 80 Euro in the end, but still not bad.</p> +<p>Luggage check? Not bad, unless you plan to arrive or depart right after an unfoiled bomb plot like I did: I had to take off my shoes, got checked everywhere, they emptied out my hand luggage, turned on and off my laptop and confiscated my gel-ink pen. Way to go!</p> +<p><a name="trains"></a> <a href="#top">[Back to Top]</a></p> +<h4>Trains, coaches and cabs</h4> +<p style="float:left;"><img src="/img/pictures/london/cab.jpg" alt="" /></p> +<p>The next question of the London newbie arriving in Stansted airport is:</p> +<p><em>&#8220;Cool, now I&#8217;m in the middle of nowhere in England, where&#8217;s London then?&#8221;</em></p> +<p>Nice innit? They sell you a cheap flight and then it seems you still have a 45-minutes journey to get to the actual city, and this is possible &#8211; apparently &#8211; only through the Stansted Express, the <em>fastest</em> way to get to London from Stansted. Dear as hell (about 25 <span class="caps">ENGLISH</span> <span class="caps">POUNDS</span> return, per head!). <br /> +Luckily there&#8217;s an alternative in the form of an endless amount coaches going from Stansted to London and vice-versa every now and then. I went with <a href="http://www.terravision.it/">Terravision</a> but there are many others. Significantly cheaper (34 Euro for two people return!).<br /> +The Stansted Express is the first example of how trains in the UK can be a lot dearer than you expect, especially if you come from Italy where you can go from Genoa to the Cinque Terre for as low as five Euro (for 100Km that is). Considering that Roxy and I spent about two pounds for about 15 Km to get from Victoria Station to Bromley South one way, well, yes, it is more expensive!</p> +<p>Once we got to Liverpool Street Station from Stansted with a load of (empty) suitcases, a weird pakistani guy in a a black leather jacket turns up out of nowhere and heads towards us. Damn airport regulations: unfortunately my almighty Victorinox pocket knife was in my suitcase. Luckily the guy approaches and simply asks:</p> +<p>Him: &#8220;Hey mate, need a taxi? &#8230;A taxi mate? A taxi?&#8221;<br /> +Me: &#8220;How much&#8221;<br /> +Him: &#8220;Where to?&#8221;<br /> +Me: &#8220;[Somewhere in Hackney]&#8221;<br /> +Him: &#8220;20 pounds&#8221;<br /> +Me: &#8220;Bye&#8221;</p> +<p>Just an unregistered cab driver. There are apparently millions around and they can spot a foreigner (especially Italians, it seems) from miles. Be prepared, and be aware that a cab from Liverpool Street for a 5-minutes drive in the night should not cost more than 6 pounds&#8230;</p> +<p><a name="tube"></a> <a href="#top">[Back to Top]</a></p> +<h4>The tube and buses</h4> +<p>Here are some tips for smooth travalling via the underground or buses:<br /> +1. Do not use a bus unless you can&#8217;t use the Tube for some particular reason (e.g. you need to go to Zone 3 or 4 and your Oyster card can be used only in zone 1 and 2)<br /> +2. Do not catch the Circle Line, always try a combination of two or more (e.g. District and Central) instead, because delays are frequent<br /> +3. Get down at Leicester Square if you&#8217;re going to Covent Garden: it&#8217;s just 300 metres away and Covent Garden station is small and packed<br /> +4. Always check whether the line you&#8217;re catching is marked with &#8220;Good Service&#8221;, try another route if there delays are expected<br /> +5. Keep right on escalators &#8211; there&#8217;s always some lunatic running up/down on the left side, from time to time, and trust me, he <span class="caps">WILL</span> mind being stopped for no valid reason<br /> +6. Mind the gap! (Especially at Bank station)<br /> +7. Mind the sweaty guys wearing suite and holding a briefcase, at peek hours, they can be deadly especially on escalators (See 5.).</p> +<p><a name="food"></a> &#8220;&gt; Back to Top &lt;&#8221;:#top</p> +<h3>Food</h3> +<p>I already noticed this during the previous visits: in London you can eat everywhere. Quite literally, both in the city centre and surrounding areas. If you can &#8211; and also if you feel brave enough to try at random &#8211; the areas surrounding the city centre are probably cheaper than the 4-million different food chains providing any kind of meal near Oxford Street &amp; Co. and possibly &#8211; arguably &#8211; more tasty.</p> +<p>If you dare to venture in the land of the Turkish/Bangladesh/Indian food shops you&#8217;re more than welcome to do so, but be prepared to a potentially long trial-and-error process: in the end you&#8217;ll eventually find the right one. Caspar recommended a particular one, and the <a href="http://www.astray.com/recipes/?show=Humus%20sandwich%20spread">humus sandwitch</a> was really great. Doner Kebab? Roxy insisted with the rumors they use roadkill for those (she&#8217;s vegetarian anyway) so she didn&#8217;t let me have one, aww.</p> +<p><a name="rubbish"></a> <a href="#top">[Back to Top]</a></p> +<h4>Rubbish Food</h4> +<p>I recently came across an interesting <a href="http://www.princeton.edu/%7Eina/infographics/starbucks.html">image</a> which gave me a better picture of how horrendously sick the world has become when it comes to rubbish food. <br /> +Yes, <a href="http://www.mcdonalds.com/">McDonald&#8217;s</a>, <a href="http://www.starbucks.com/">Starbucks</a> &amp; their nasty friends (<a href="http://www.pizzahut.com/">Pizza Hut</a>, <a href="http://www.kfc.com/"><span class="caps">KFC</span></a>, <a href="http://www.bk.com/">Burger King</a>&#8230;) are still there making millions at every corner, in London as well. Well, not quite: I noticed they were less last time, and apart from a few kids fretting for their <em>Happy Meal</em>, they weren&#8217;t so packed. I was pleased to notice that a load of new-ish healthier alternative are now available (see next section).</p> +<p><a name="healthy"></a> <a href="#top">[Back to Top]</a></p> +<h4>Healthy Food</h4> +<p style="float:right;"><img src="/img/pictures/london/pret.png" alt="" /></p> +<p>This was the relatively new surprise. Relatively new because I already noticed some of them last year, but this time I had a chance to try them all: they <em>healthy food gang</em>! This is the <span class="caps">REAL</span> food trend for London, it seems, and I was very glad about it.<br /> +The first one seems to have been <a href="http://www.pret.com/">Pret a Manger</a> a London-established company which is now spreading &#8211; apparently &#8211; in the US as well. They <a href="http://www.pret.com/about/">preach and believe</a> in the importance of healthy food and fight a silent &#8211; but effective &#8211; quest against aforementioned Rubbish Food Giants.</p> +<p>bq.<br /> +&#8220;Pret operates a bit like a restaurant. Every Pret has its own kitchen (except for one or two of the tiny ones). You won&#8217;t find &#8216;sell by&#8217; dates on our fresh sandwiches and salads. We don&#8217;t sell &#8216;factory&#8217; stuff. We offer our food to charity at the end of each day rather than keep it over.&#8221;</p> +<p>Sounds like a good plan. The food is indeed very nice and tasty and they even <em>apologize</em> for charging <span class="caps">VAT</span> when eating in. A carefully-thought marketing campaign or the just plain simple truth (Wot!)? Only time will tell, let&#8217;s hope for the best.<br /> +Another example of healthy food around London? Well, real, tasty <a href="http://www.westcornwallpasty.co.uk/flash.html">Cornish pasties</a> can be bought for a few quid around in the biggest stations and streets, for example. Freshly baked in Cornwall, and brought all over England the same day &#8211; or so they make out.</p> +<p><em>&#8220;Hey, what the hell is a pasty man?&#8221;</em><br /> +&#8220;Go back where you belong, you <a href="http://www.urbandictionary.com/define.php?term=emmet">emmit</a>!&#8221;</p> +<p>Roxanne and Caspar both lived in (West!) Cornwall for years, and they really appreciated their fellow pirates trying to take over the world.</p> +<p><a name="brick"></a> <a href="#top">[Back to Top]</a></p> +<h4>Brick Lane</h4> +<p><em>&#8220;Come in my restaurant&#8230; good food, cheap&#8230;&#8221;</em><br /> +&#8220;No.&#8221;<br /> +<em>&#8220;C&#8217;mon, I make a discount for you&#8221;</em><br /> +&#8220;How much?&#8221;<br /> +<em>&#8220;15% off&#8221;</em><br /> +&#8220;No way mate, last time it was 25% with a free round of drinks!&#8221;<br /> +<em>&#8220;You came here before? Impossible, we don&#8217;t do 25% off, we do 20% off maximum&#8221;</em><br /> +&#8220;No, 25% off, it was 25% off, but doesn&#8217;t matter, I&#8217;ll go somewhere else&#8230;&#8221;<br /> +<em>&#8220;No wait, 20% off and free drinks, ok?&#8221;</em><br /> +&#8220;25%&#8221;<br /> +<em>&#8220;OK, 25% and free drinks, but you come in OK? Good food!&#8221;</em></p> +<p>This is just an example of conversation between a guy working for a restaurant in <a href="http://www.visitbricklane.com/">Brick Lane</a> and a &#8220;potential customer&#8221;. Brick Lane (aka Banglatown) is a street in London which became popular for the moltitude of Indian/Bangladesh restaurants. There are literally dozens of them, and this fierce competition causes the owner to repeteadly offer &#8220;deals&#8221; to potential customers: getting 25% off the bill is not unusual, and sometimes if you can argue it well you can even get free drinks. Caspar took us to a really good place he went before, and the curry and rice and other typical dishes were absolutely fabulous. Price? 11 pounds per head for a filling (and spicy!) dinner.</p> +<p><a name="enter"></a> <a href="#top">[Back to Top]</a></p> +<h3>Entertainment</h3> +<p>So what can you do in London, other than meandering with the underground to get the most out of your Oyster card and eat out every day? Well, you can have fun of course! There&#8217;s loads to do for every taste. This is an <em>incomplete</em> guide, so I&#8217;ll just mention a few possibilities, but be aware that there&#8217;s much, much more than this.</p> +<p><a name="club"></a> <a href="#top">[Back to Top]</a></p> +<h4>Clubbing</h4> +<p>Each weekend, the following equation holds, for the average Londoner aged 20-30 at least:</p> +<p><code>100 pounds + Club + Friends = Loads of booze + Fun + Terrible hangover and amnesia the day after</code></p> +<p>That&#8217;s basically what the traditional Londoners (or maybe we shall generalise to all of England&#8230;) do every saturday night: they get trashed. Why? It&#8217;s not clever, it&#8217;s not good&#8230; but it&#8217;s bloody good fun!<br /> +Clubs, pubs and bars are the best place for this kind of activity: they are comfortable, there&#8217;s normally cool music on, air conditioning, totally hyper staff, and a huge bouncer too! <br /> +We went to <a href="http://www.ditchbar.com/">The Ditch</a>, a recently renovated place in Shoreditch (obviously). I must say I really liked the environment more than any club in Italy:</p> +<ul> + <li>Good music and deejay</li> + <li>Enough people inside, but not too crowded</li> + <li>Good drinks</li> + <li>Small &amp; comfy <span class="caps">VIP</span> room, obviously for us (no kidding)</li> + <li>A competent bouncer who kindly reminded us to &#8220;watch over&#8221; one of our friends, after she suddenly ordered four Vodka-RedBull at once&#8230;</li> +</ul> +<p>No wonders why Caspar &amp; his friends carefully picked this place as their ideal candidate for their own upcoming DJ mini-event in November: it&#8217;s an ideal place to spend your night.</p> +<p>Pity that English blokes (and birds too!) get way too trashed in the end: I reckon if you could place a single half-sober, decent-looking Italian guy in a club like that, he&#8217;d have pulled almost all the (decent-looking) girls available by the end of the night. I&#8217;ll definetely recommend some of my <em>free</em> (not as in software) friends to go over to London next summer.</p> +<p><a name="museums"></a> <a href="#top">[Back to Top]</a></p> +<h4>Museums</h4> +<p>Enough clubbing and equally shallow activities, let&#8217;s focus on culture, at once!<br /> +London is the best city in Europe (OK, <em>followed</em> by Paris) for museums, and the best thing is that they are (nearly) all free. This time we didn&#8217;t go to the <a href="http://www.thebritishmuseum.ac.uk/">National Gallery</a>, which hosts one of the most outstanding painting galleries in all over the world, because we already visited it too many times, so we went straight for the <a href="http://www.thebritishmuseum.ac.uk/">British Museum</a>. I originally went there a few years ago, and I forgot what was in it, exactly, and yes, I was amazed and perplexed at the same time:</p> +<p style="float:left;"><img src="/img/pictures/london/rosetta.jpg" alt="" /></p> +<p>I was amazed at the amount of stuff those British folks <em>nicked</em> from all over the world: I&#8217;m not talking about a few mummies from Egypt like we did in for our mini Egyptian museum in Turin, but rather stuff like the original sarcophagus of Cleopatra (&amp; others), the Rosetta Stone, the Ur Standard, whole monuments from Greece, gargantuan gateways from some Assirian city, and <em><span class="caps">ALL</span> <span class="caps">THE</span> <span class="caps">SCULPTURE</span> <span class="caps">DECORATIONS</span> OF ATHEN&#8217;S <span class="caps">PARTHENON</span>!</em> That was shocking really, but after all it was Napoleon who stole the Monna Lisa from us. Damn the French. (No discrimination intended, please mind the sarcasm)</p> +<p>The <a href="http://www.tate.org.uk/modern/">Tate Modern</a> was impressive as well for a few Dali&#8217;s and Kandinski&#8217;s paintings etc. etc., but I don&#8217;t think it can ever be as breath-taking as the other ones. I certainly don&#8217;t understand certain kinds of modern art, but I can&#8217;t understand how a random guy could get loads of money and ovation for the critics for putting a few basket-balls in a glass box. Clever.</p> +<p style="float:right;"><img src="/img/pictures/london/nh.jpg" alt="" /></p> +<p>To conclude this brief and silly overview of London&#8217;s most remarkable museums, let&#8217;s say something about the <a href="http://www.nhm.ac.uk/">National History Museum</a>. <br /> +First of all it must be noted that we have a decent equivalent in Genoa, so Roxy and I visited it not long prior to our departure for England. She liked it, and was impressed by the amount of stuffed animals on display, but she told me that the National History Museum in London was supposed to be <em>way better</em>.<br /> +We both expected, especially judging from outside this enourmous building which was built for the purpose, big halls full of taxidermist&#8217;s masterpieces, but alas, nothing like this at all. Yes, sure, there were a few stuffed animals here and there, and the minerals section was truly outstanding for completeness. The rest &#8211; in my very, very humble opinion &#8211; was a real insult to Science and to the dignity of the visitors over five years old.<br /> +They insisted in &#8220;renovating&#8221; the interior of a marvellous building, making almost every room pitch black only to allow a kid in a million to press a button to highlight a five-lines explanation for a absolutely pointless diagram. Well done. That was a real achievement, wasn&#8217;t it? I really don&#8217;t understand who could ever conceive such an abomination: a formerly very respected museum turned into a poorly-designed theme park.<br /> +OK, they probably wanted to involve younger generations into scientifical subjects through &#8220;interactivity&#8221;, and that&#8217;s understandable &#8211; in theory. In practice though, there are a few elements which weren&#8217;t obviously considered when developing such a subtly cunning marketing strategy:</p> +<ul> + <li>The average kid up to 5 years old enjoys pushing buttons, listening to sounds and looking at easy-to-understand (but <span class="caps">ARE</span> <span class="caps">THEY</span>?) pictures, but alas, can&#8217;t really bother to read, right?</li> + <li>The average kid over 5 years old would probably like reading some explanation about some weird phenomena, but alas, he really can&#8217;t be bothered to push button, move levers, etc. etc. only to highlight some text. Wake up dude, we never heard of Computer Graphics? Animation? even Educational Software, maybe with things like touchscreens etc. These kids are from the <span class="caps">XXI</span> century, not from the seventies ffs! Grow up (the museum&#8217;s managers, not the kids of course)!</li> + <li>Instead of ruining an historical building, they could have devoted just a few rooms to kids, investing in something slightly more amazing than out-of-fashin &#8220;interactive&#8221; toys.</li> +</ul> +<p><em>&#8220;Yes, but hey, we still have a huge queue of kids &amp; families at the entrance!&#8221;</em></p> +<p>And you know why? You know what are all these people queueing for? For a damn cheesy T-rex <a href="http://science.howstuffworks.com/animatronic.htm">animatronic</a>! Yes, really! And no, not the one from Jurassic Park, but only its rather shitty English-made cousin. <br /> +The funniest thing of the whole visit? They tell you to donate &#8220;at least&#8221; three quid for their wonders, same as for the British Museum and the National Gallery. You know what? I&#8217;d rather give <em>thirty</em> quid to a random kid if he promise not to visit such &#8220;museum&#8221;&#8230;</p> +<p><a name="theatres"></a> <a href="#top">[Back to Top]</a></p> +<h4>Theatres</h4> +<p>Luckily London theatres are still great. Unfortunately I didn&#8217;t have a chance to go to a musical this time, but I&#8217;ll definitely try to make it for one during my next visit. Adverts for the shows are all over the place, from streets to underground stations, and there are truly a lot of places where it is possible to buy tickets at discounted price while apparently buying full price tickets doesn&#8217;t seem to be possible&#8230;<br /> +Anyhow, not only we didn&#8217;t manage to go to a musical, but we also missed another theatrical performance by <a href="http://www.imdb.com/name/nm0001772/">Patrick Stewart</a>, who, for those who don&#8217;t know, happens to be one of the best Shakespearean actors alive&#8230; when he doesn&#8217;t <a href="http://en.wikipedia.org/wiki/Star_Trek:_First_Contact">fight against the Borg</a> or <a href="http://en.wikipedia.org/wiki/X-Men_(film)">plays funny tricks on a wheelchair</a>, of course (cheesy, cheesy joke).</p> +<p>Nevertheless we <em>did</em> manage to go and see a play, namely Shakespeare&#8217;s Antony and Cleopatra at the <a href="http://www.shakespeares-globe.org/navigation/framesetNS.htm">Globe</a>. The Globe Theatre is an almost-perfect reconstruction of the famous London Theatre where Shakespeare&#8217;s plays used to be acted. Like in the <span class="caps">XVII</span> century, you have two choices:</p> +<p>a. Book your seat (26 pounds)<br /> +b. Stand up on the ground, near the stage (5 pounds)</p> +<p style="float:left;"><img src="/img/pictures/london/globe.jpg" alt="" /></p> +<p>We obviously went for option b, of course, since we didn&#8217;t fancy the idea of paying that much &#8211; although it can be worthwhile. Only one thing to keep in mind: <em>always check the duration of the play you&#8217;re going to see beforehand</em> &#8211; if you don&#8217;t like standing up for a long time, you have to go for option a. <br /> +We obviously <em>didn&#8217;t</em> check how long the play was going to be &#8211; although we could have imagined it &#8211; so we ended up standing up for approx three hours (with a 15 minutes break). And you <em>have</em> to stand up, you can&#8217;t sit on the stairs and neither on the floor, and the staff is ready to enforce this rule at all costs: a 70-year-old lady brought a folded chair and decided to sit on it, only to be <em>kindly reminded</em> by the staff that it wasn&#8217;t allowed to do so. Go figure. <br /> +Anyhow, after all I must say it was the cheapest and the very best Shakespeare play I&#8217;ve ever been to so far, although I must also say that most of the ones I&#8217;ve been to before were acted in (yikes!) Italian (yes, we do dub theatrical works, <em>as well</em>). A really, really good idea for students and half-broke youth who shouldn&#8217;t be denied of the pleasure of watching Shakespeare&#8217;s masterpieces at the theatre. Please, keep it up.</p> +<p><a name="shop"></a> <a href="#top">[Back to Top]</a></p> +<h4>Shopping</h4> +<p>Last but not least, I felt compelled to include a short section about <em>shopping</em> in London. The universal answer to the question &#8220;Where can I find [insert random item here]&#8221; is normally <a href="http://www.oxfordstreet.co.uk/">Oxford Street</a>. When I visited it for the first time (I was about 14 years old, I believe) it all seemed huge&#8230; those never-ending malls et al, but now it just seems &#8220;normal&#8221;. Probably because now going to malls and megastores is just the plain normality, while in the nineties (in Italy) it was rather unusual. <br /> +Oxford Street has them all: computer shops, endless fashion shops, gargantuan bookshops etc. etc. <br /> +Biggest and most expensive shop in Oxford Street? Probably <a href="http://www.selfridges.com/">Selfridges</a> <br /> +Biggest bookshop? Definitely <a href="http://www.amazon.co.uk/exec/obidos/tg/stores/static/-/waterstones/waterstones-info/202-4070483-1661418">Waterstone</a> although the biggest bookshop in London (and in Europe) is the Waterstone one in Piccadilly, just round the corner.<br /> +<a href="http://www.harrods.com/Cultures/en-GB/homepageindex.htm">Harrods</a>? &#8211; it&#8217;s not far from there.</p> +<p>What if you like more traditional and less glamorous shopping? <a href="http://www.coventgardenlife.com/">Covent Garden</a> and its whereabouts is probably the best choice, also for souvenirs.</p> +<p>Had enough yet? Well, yes, let&#8217;s call it a day for this article, but be aware that there&#8217;s much, <span class="caps">MUCH</span> more to see and do in London than you can ever imagine. Unless you&#8217;re from the US, of course.</p>
A contents/articles/inline-introduction.html

@@ -0,0 +1,173 @@

+----- +title: RawLine - a 100% Ruby solution for console inline editing +content-type: article +timestamp: 1205128740 +tags: ruby|programming|opensource|rawline +----- +<p>One of the many things I like about Ruby is its cross-platform nature: as a general rule, Ruby code runs on everything which supports Ruby, regardless of its architecture and platform (yes, there are quite a few exceptions, but let&#8217;s accept this generalization for now).</p> +<p>More specifically, I liked the fact that I could use the <a href="http://tiswww.case.edu/php/chet/readline/rltop.html"><span class="caps">GNU</span> Readline library</a> with Ruby seamlessly on both Windows and Linux.<br /> +Readline offers quite a lot of features which are useful for those people like me who enjoy creating command-line scripts, in a nutshell, it provides:</p> +<ul> + <li>File/Word completion</li> + <li>History support</li> + <li>Custom key bindings which can be modified via .inputrc</li> + <li>Emacs and Vi edit modes</li> +</ul> +<p>Basically it makes your command-line interface fast and powerful, and that&#8217;s not an overstatement. Ruby&#8217;s own <span class="caps">IRB</span> can be enhanced by enabling readline and completion, and it works great &#8212; at least on *nix systems.</p> +<p>For some weird reason, some people had problems with Readline on Windows: in particular, things get nasty when you start editing long lines. Text gets garbled, the cursor goes up one or two lines and doesn&#8217;t come back, and other similar leprechaun&#8217;s tricks, which are not that funny after a while.</p> +<p>Apparently there&#8217;s no alternative to Readline in the Ruby world. If you wan&#8217;t tab completion that&#8217;s it, you&#8217;re stuck. Would it be difficult to implement <em>some</em> of Readline functionality natively in Ruby? Maybe, but the problem is that for some reason the Ruby Standard Library doesn&#8217;t have low level methods to operate on keystrokes&#8230;</p> +<p>&#8230;but luckily, the <a href="http://highline.rubyforge.org/">HighLine</a> gem does! James Edward Gray II keeps pointing out here and here that HighLine&#8217;s own <code>get_character</code> method does just that: it returns the corresponding character code(s) right when a key is pressed, unlike <code>IO#gets()</code> which waits for the user to press <span class="caps">ENTER</span>.</p> +<p>Believe it or not, that tiny method can do wonders&#8230;h2. Reverse-engineering escape codes</p> +<p>So here&#8217;s a little script which uses <code>get_character()</code> in an endless loop, diligently printing the character codes corresponding to a keystroke:</p> +<div class='ruby'><pre><code>#!/usr/local/bin/ruby -w + +require 'rubygems' +require 'highline/system_extensions' + +include HighLine::SystemExtensions + +puts "Press a key to view the corresponding ASCII code(s) (or CTRL-X to exit)." + +loop do + + print "=&gt; " + char = get_character + case char + when ?\C-x: print "Exiting..."; exit; + else puts "#{char.chr} [#{char}] (hex: #{char.to_s(16)})"; + end + +end</code></pre></div><p>A pretty harmless little thing. Try to run it and press some keys, and see what you get:</p> +<div style="font-family: Monospace"> +<p>Press a key to view the corresponding <span class="caps">ASCII</span> code(s) (or <span class="caps">CTRL</span>-X to exit).</p> +<p>=&gt; a <sup class="footnote" id="fnr96"><a href="#fn96">96</a></sup> (hex: 61)</p> +<p>=&gt; 1 <sup class="footnote" id="fnr49"><a href="#fn49">49</a></sup> (hex: 31)</p> +<p>=&gt; Q <sup class="footnote" id="fnr81"><a href="#fn81">81</a></sup> (hex: 51)</p> +<p>=&gt; &alpha; <sup class="footnote" id="fnr224"><a href="#fn224">224</a></sup> (hex: e0)</p> +<p>=&gt; K <sup class="footnote" id="fnr75"><a href="#fn75">75</a></sup> (hex: 4b)</p> +</div> +<p>Hang on, what are the last two codes? <em>A left arrow key on Windows</em>, apparently.</p> +<p><strong>Welcome to the wonderful world of input escape sequences!</strong></p> +<p>To cut a long story short, both Windows and *nix system &#8220;terminals&#8221; translate special keystrokes into sequences of two or more codes. This applies to things like <span class="caps">DEL</span>, <span class="caps">INSERT</span>, arrows, etc. etc.<br /> +For some ideas, check out:</p> +<ul> + <li><a href="http://www.microsoft.com/whdc/device/input/Scancode.mspx">Windows Scancodes</a> (Thanks <a href="http://64.223.189.234/node/92">Huff</a>)</li> + <li><a href="http://www.connectrf.com/Documents/vt220.html">VT220 Terminal Input Sequences</a> (Thanks <a href="http://www.grayproductions.net/">James</a>)</li> +</ul> +<p>Let&#8217;s now assume that we&#8217;re smart and we can write a program which can parse keystroke properly, including handling different input escape sequences according to the OS, what can it be used for?<br /> +Well:</p> +<ul> + <li>For normal characters, just print them back to the screen (<code>get_character</code> doesn&#8217;t print anything, it &#8220;steals&#8221; the keystroke)</li> + <li>For special characters, do something nice!</li> +</ul> +<p>We could setup <span class="caps">TAB</span> to auto-complete the current word according to an array of matches, or bind the up arrow to load the last line typed in by the user, for example, that&#8217;s basically something Readline does, right?</p> +<h2>RawLine: how it works and what it does</h2> +<p>I created a small project on RubyForge called <a href="http://rubyforge.org/projects/rawline/">RawLine</a> (not to be confused with RubyInline, a completely different thing altogether, sorry about that) to play around with the possibilities offered by the <code>get_character</code> method. The library is just a preview of things which can be done, but it&#8217;s already usable, provided that you&#8217;re brave enough to try it out, that is.</p> +<p>The basic idea behind RawLine is to be able to parse keystrokes properly on different platforms and re-bind them to a set of predefined, cross-platform actions or a user-defined code block.</p> +<h3>Basic line-editing operations</h3> +<p>The first challenge was to re-invent the wheel, i.e. re-bind keystrokes to their typical actions: a left arrow moves the cursor left, a backspace deletes the character at the left of the cursor and so on. Yes, because <code>get_characters</code> gives you the right character codes at the price of <em>cancelling their normal effects</em>, which is a great thing, as you&#8217;ll soon find out.</p> +<p>Printing a character on the screen was one of the easiest tasks (at first). <code>IO#putc</code> does the job pretty well: it prints a character out.<br /> +What about moving left? Easy: print a non-descructive backspace (\b) and hope it is really not destructive. I did some tests and it seems to do as it&#8217;s told and move the cursor back by one position.</p> +<p>Moving right was a little trickier: the easiest thing I found was to re-print the character under the cursor, which will then move the cursor forward (as naive as it may seem, it does the job!). If there&#8217;s nothing under the cursor, then we must be at the end of the line and it shouldn&#8217;t move anywhere, so there we go.</p> +<p>What if I move left a bit and then start typing normal characters? Well, everything is rewritten of course: this will be our &#8220;character replace mode&#8221;. Unfortunately users don&#8217;t like this behavior that much, so what I did was this:</p> +<ol> + <li>Copy all characters from the one at the left of the cursor till the end of the line</li> + <li>Print the character to be inserted</li> + <li>Re-print the previously-copied characters</li> + <li>Move the cursor back at the right place</li> +</ol> +<p>Again, a primitive solution which works seamlessly on all platforms, and yes, it&#8217;s fast enough that you don&#8217;t notice the difference.</p> +<p>As you may have guessed, this of course means that I always had to keep track of:</p> +<ul> + <li>The cursor position within the line</li> + <li>The text currently printed to the screen</li> +</ul> +<p>Backspace and delete were implemented in a similar way, you can figure it out yourself or look at the source code: I won&#8217;t bore you any further!</p> +<h3>History management</h3> +<p>The next step was to implement a history for both the characters inputted by the user (to allow undoing and redoing operations) and for the whole lines. This was just an ordinary programming exercise: a simple buffer with some extra controls here and there, nothing too scary.</p> +<p>So every &#8220;modification&#8221; to the current line being typed is saved in a line history buffer and all the lines entered are saved in another history buffer. All is left is to allow users to navigate through these buffers back and forth. <br /> +Nothing impossible: all I had to do was keeping track of the current element of the history being retrieved and then overwrite the current line with a new line stored in the buffer? How&#8217;s this line overwriting done? Same old:</p> +<ol> + <li>Move the cursor to the beginnig of the line</li> + <li>Print X spaces, where X is the line length, so that the characters are no longer displayed in the console</li> + <li>Move the cursor back to the beginning of the line</li> + <li>Print the new line.</li> +</ol> +<p>Easy and naive, as usual. But again, it works well enough.</p> +<h3>Word completion</h3> +<p>The other challange was word completion. The current implementation can be summarized as follows:</p> +<ul> + <li>If <span class="caps">TAB</span> (or another character, if you wish) is pressed, call a user-defined <code>completion_proc</code> method which returns an array and show the first element of the array (in this case I actually used a cyclic RawLine::HistoryBuffer, not an array)</li> + <li>If the user presses <span class="caps">TAB</span> again, show another match, and so <em>ad infinitum</em> if the user keeps pressing <span class="caps">TAB</span>.</li> + <li>If the user presses another key, accept the default completion and move on.</li> +</ul> +<p>Obviously this means that:</p> +<ul> + <li>RawLine has to keep track of the current &#8220;word&#8221;. A word is everything separated by a user defined <code>word_separator</code>, which can obviously modified at runtime, with care.</li> + <li>Regarding the <code>completion_proc</code>, typically you may want to return only the elements matching the word which is currently being written, so that&#8217;s given as default parameter for your proc. Exactly like with ReadLine, the only difference is that you can access other things like <em>the whole line</em> and <em>the whole history</em> in real time, which can be really handy at times!</li> +</ul> +<p>Here&#8217;s a simple example:</p> +<div class='ruby'><pre><code>editor.completion_proc = lambda do |word| + if word + ['select', 'update', 'delete', 'debug', 'destroy'].find_all { |e| e.match(/^#{Regexp.escape(word)}/) } + end +end</code></pre></div><h3>Custom key bindings</h3> +<p>All these pretty things are obviously bound to some keystrokes. If the key corresponds to only one code, everything is fine, but because special keys typically aren&#8217;t so it was necessary to implement a mechanism to track an escape key (e.g. 0xE0 and 0 on Windows and \e on Linux) and listen to further characters, in case a known sequence is found. Anyhow, the final result of the method used for character binding is the following:</p> +<p><code>bind(key, &amp;block)</code></p> +<p>Where key can be:</p> +<ul> + <li>A <code>Fixnum</code> corresponding to a single character code</li> + <li>An <code>Array</code> of one or more character codes</li> + <li>A <code>String</code> corresponding to an escape sequence</li> + <li>A <code>Symbol</code> corresponding to a known escape sequence or key</li> + <li>A <code>Hash</code> to define a new key or escape sequences</li> +</ul> +<p>So, in the end you can do things like this:</p> +<div class='ruby'><pre><code>editor.bind(:left_arrow) { editor.move_left } +editor.bind("\etest") { editor.overwrite_line("Test!!") } +editor.bind(?\C-z) { editor.undo } +editor.bind([24]) { exit }</code></pre></div><p>Which, for Rubyists, it&#8217;s far sexier and more flexible than editing an .inputrc file.</p> +<h3>How do I use it, anyway?</h3> +<p>A code example is better than a thousand words, right? So here you are:</p> +<div class='ruby'><pre><code>#!/usr/local/bin/ruby -w + +require 'rubygems' +require 'rawline' + +puts "*** Inline Editor Test Shell ***" +puts " * Press CTRL+X to exit" +puts " * Press CTRL+C to clear command history" +puts " * Press CTRL+D for line-related information" +puts " * Press CTRL+E to view command history" + +editor = RawLine::Editor.new + +editor.bind(:ctrl_c) { editor.clear_history } +editor.bind(:ctrl_d) { editor.debug_line } +editor.bind(:ctrl_e) { editor.show_history } +editor.bind(:ctrl_x) { puts; puts "Exiting..."; exit } + +editor.completion_proc = lambda do |word| + if word + ['select', 'update', 'delete', 'debug', 'destroy'].find_all { |e| e.match(/^#{Regexp.escape(word)}/) } + end +end + +loop do + puts "You typed: [#{editor.read("=&gt; ").chomp!}]" +end</code></pre></div><p>This example can be found in examples/rawline_shell.rb within the RawLine source code or gem package.</p> +<h2>Current status and availability</h2> +<p>I currently <a href="http://rubyforge.org/forum/forum.php?forum_id=22543">released</a> RawLine 0.1.0 on <a href="http://rubyforge.org/projects/rawline">SourceForge</a>, and it can be installed via:</p> +<p><code>gem install -r rawline</code></p> +<p>The RDoc documentation is available <a href="http://rawline.rubyforge.org/">here</a>.</p> +<p>Feel free to try it out. First of all try the <code>rawline_shell.rb</code> example, and see if it works on your machine. If it doesn&#8217;t than maybe you try re-binding some keys (use <code>key_tester.rb</code> to &#8220;reverse-engineer&#8221; your terminal&#8217;s input escape sequences), and let me know!</p> +<p>Status information and limitations:</p> +<ul> + <li>It has been tested on Windows (XP, using the usual command prompt) and on Linux (ZenWalk, using <span class="caps">XFCE</span> Terminal).</li> + <li>It can handle lines no longer than the maximum terminal width &#8211; 2. This is to ensure that the cursor never &#8220;falls down&#8221; to the next line.</li> + <li>On Windows, the cursor doesn&#8217;t blink immedialy when moving left, but it moves, don&#8217;t worry.</li> + <li>On Linux, you should really consider installing the <a href="http://raa.ruby-lang.org/project/ruby-termios/">Termios</a> library for a faster experience (otherwise <code>get_character</code> won&#8217;t parse characters correctly if you press and hold a key, and that, trust me, is a real mess!).</li> + <li>RawLine is very far from being a complete replacement for the ReadLine library, and it is currently in alpha stage.</li> + <li>Release 0.1.0 has been created after 2 weeks of sporadic coding during lunch breaks and week-ends.</li> +</ul> +<p>For any ideas on where to go from here, comments and feedback, just reply below or send an email to my usual email address.</p>
A contents/articles/inline-name-change.html

@@ -0,0 +1,18 @@

+----- +title: InLine name change: what's your opinion? +content-type: article +timestamp: 1206595800 +tags: ruby|programming|opensource|rawline +----- +<p>I&#8217;ve been kindly asked by the lead developer of <a href="http://www.zenspider.com/ZSS/Products/RubyInline/">RubyInLine</a> to change the name of my <a href="http://rubyforge.org/projects/inline/">InLine</a> project, due to potential confusion and conflicts.</p> +<p>This makes sense, and I&#8217;m ready to change the name of my project, although I&#8217;m not that good at choosing original and <em>smart</em> names, so well, any suggestion is more than welcome!</p> +<p>I was thinking of something like:</p> +<ul> + <li>RawLine</li> + <li>EditLine</li> + <li>RawInput</li> + <li>RubyInput</li> + <li>RubyLine</li> +</ul> +<p>I personally think that <strong>RawLine</strong> is probably the best option, but please, if have any better idea just speak up!</p> +<p>P.S.: &#8220;RedLine&#8221; is taken, unfortunately, otherwise it would have been my first choice since the beginning.</p>
A contents/articles/introducing-glyph.html

@@ -0,0 +1,79 @@

+----- +title: Introducing Glyph +content-type: article +timestamp: 1270834239 +tags: glyph|ruby|frameworks|writing +----- +<p>I&#8217;ve been writing technical documents for a living for the past four years, and I can tell you: there is no easy way to go about it.</p> +<p>For example, you can use:</p> +<ul> + <li><strong>a Word Processor</strong> like MS Word, for example &#8212; anyone can do that, right? Sure, but no, thanks: I strongly believe that Word Processors should not be used for writing technical documents as I firmly don&#8217;t believe GUIs are suitable for doing this at a professional level.</li> + <li><strong>a Document Authoring Software</strong> like Adobe Framemaker, Robohelp, etc. Still GUIs, only more complicated to use.</li> + <li><strong><span class="caps">XML</span>, like <span class="caps">DITA</span> or DocBook, or other markups</strong>, like ReStructuredText. Better, but still not easily extensible and flexible enough.</li> + <li><strong>your company&#8217;s tools</strong>, if you have them. That&#8217;s great if they are usable enough and the result makes your boss happy.</li> + <li><strong>LaTeX</strong>, and that&#8217;s probably your best option, if you know what you&#8217;re doing.</li> + <li><strong><span class="caps">XHTML</span> and CSS3</strong>, in conjunction with a <span class="caps">PDF</span> renderer like <a href="http://www.princexml.com/">Prince <span class="caps">XML</span></a> &#8212; that&#8217;s great if you know <span class="caps">HTML</span> and <span class="caps">CSS</span>, and you don&#8217;t mind hand-crafting the structure of the document.</li> +</ul> +<h3>Lightweight markups</h3> +<p>I love Textile and Markdown. When people aren&#8217;t looking, I even use them at work to generate <span class="caps">HTML</span> code, because it&#8217;s just so much faster. Textile in particular can be used as a drop-in replacement for <span class="caps">HTML</span> (and a bit of LaTeX, too), as it can produce most inline <span class="caps">HTML</span> tags effortlessly and some block-level tags, too.</p> +<p>For things like <code>&lt;div&gt;</code> tags and <code>&lt;tables&gt;</code> though, Textile is not the best thing in the world, so you normally end up falling back to <span class="caps">HTML</span>.</p> +<p>Another &#8220;problem&#8221; is that <strong>Textile</strong> or other similar lightweight markups cannot be extended easily, simply because they were not meant to be extended in the first place.</p> +<p>Moreover, if you are producing a book, Textile can&#8217;t help you if you want to generate things like a Table of Contents automatically or validate links: those things are simply not part of Textile&#8217;s job.</p> +<h3>How Glyph can help</h3> +<p style="float:right;"><img src="/img/pictures/glyph.png" alt="" /></p> +<p>There are a few projects on the Internet that tackle structured document generation. One of them is <a href="http://github.com/fnando/kitabu">Kitabu</a>, which looks promising and is able to produce pretty documents using Textile and Prince for <span class="caps">PDF</span> rendering&#8230; but again, it&#8217;s not extensible because it relies too much on Textile and Markdown.</p> +<p><a href="/glyph/">Glyph</a> is different. For one, it is much younger than any other, therefore it is most likely full of bugs.</p> +<p>Jokes aside, Glyph follows a much more radical approach, which consists in using a <em>macro language</em> on top of Textile or Markdown. The good thing about it is that this macro language is very simple to learn and &#8212; most importantly &#8212; very easy to extend.</p> +<p>Here&#8217;s an example:</p> +<div class='text'><pre><code>section[header[Something about Glyph] +You can use Glyph macros in conjunction + with _Textile_ or _Markdown_ to +produce HTML files effortlessly. + section[header[What about PDFs?|pdf] +Once you have a single, well-formatted HTML +file, converting it to PDF is +extremely easy with a 3rd-party +renderer like =&gt;[http://www.princexml.com|Prince]. + ] +]</code></pre></div><p>Which translates to:</p> +<div class='html'><pre><code>&lt;div class="section"&gt; + &lt;h2 id="h_1"&gt;Something about Glyph&lt;/h2&gt; + &lt;p&gt;You can use Glyph macros in conjunction with + &lt;em&gt;Textile&lt;/em&gt; or &lt;em&gt;Markdown&lt;/em&gt; to + produce HTML files effortlessly.&lt;/p&gt; + &lt;div class="section"&gt; + &lt;h3 id="pdf"&gt;What about PDFs?&lt;/h3&gt; + &lt;p&gt;Once you hav