<?xml version="1.0" encoding="iso-8859-1"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
        xmlns="http://purl.org/rss/1.0/" 
        xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://blog.blog.sgconsulting.it/blog.html">
        <title>SG Dev Corner</title>
        <link>http://www.sgconsulting.it/blog/blog.html</link>
        <description>On programming, erlang, science, web design, business and politics.</description>
        <dc:creator>Filippo Pacini (mailto:pacini@blog.sgconsulting.it)</dc:creator>
        <image rdf:resource="" />
        <items>
            <rdf:Seq>
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=74" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=71" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=70" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=69" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=68" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=67" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=66" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=65" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=64" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=63" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=62" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=61" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=60" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=59" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=58" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=57" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=56" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=55" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=54" />
                
                <rdf:li resource="http://blog.blog.sgconsulting.it/blog.html?identry=53" />
                
            </rdf:Seq>
        </items>
    </channel>
    
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=74">
        <title>Useless and Blue - Inutile e blu</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=74</link>
        <description>&lt;p&gt;After a long time I come back to the blog.&lt;/p&gt;&lt;p&gt;The occasion is not something programming related, but a book &amp;quot;Inutile e blu&amp;quot; (the translated title would be Useless and blue) written by a friend and climber, Andrea Ballotti. The book is in italian. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;I try to translate the back cover: &lt;/p&gt;&lt;pre&gt;A travel novel, between mountains, climbers and Irish green lands. &lt;br /&gt;An antihero and melancholic in search for something more. &lt;br /&gt;A restless love for a woman who&amp;#39;s fleeing also from herself. &lt;br /&gt;A confused and nightly road that clarifies. &lt;br /&gt;A wait at the end that becomes a start.&lt;/pre&gt;&lt;p&gt;Some words on the title &amp;quot;Useless and blue&amp;quot;&lt;/p&gt;&lt;p&gt;Blue is the color of Melancholy, of Blues, of past things. &lt;br /&gt; &lt;/p&gt;&lt;p&gt;As for the Useless, well my useless is climbing, and the mountain like the novel protagonist, but it&amp;#39;s also hacking or learning a new programming language, and a lot of other things. It&amp;#39;s the joy of making something just for the pleasure it gives you. I see can&amp;#39;t explain it very well.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;If there&amp;#39;s some italian reader you can find the translation below and the book here:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.365bookmark.it/scheda_libro.lasso?codice_prodotto=20071106144251636672"&gt;Buy the book online&lt;/a&gt;&lt;a href="http://www.mannieditori.it/index_x.asp?contenuto=dettaglio_libri&amp;amp;ID=1140"&gt; &lt;/a&gt;&lt;/p&gt; &lt;hr /&gt; Dopo un bel po&amp;#39; di tempo torno a scrivere nel blog.&lt;p&gt;L&amp;#39;ocasione non ha niente  a che vedere con la programmazione, ma e&amp;#39; un libro &amp;quot;Inutile e blu&amp;quot; scritto da un amico alpinista, Andrea Ballotti.&lt;/p&gt;&lt;p&gt;Dalla quarta di copertina:&lt;/p&gt;&lt;pre&gt;Un romanzo di viaggio, tra montagne, alpinisti e terre verdi d&amp;#39;Irlanda.&lt;br /&gt;Un antieroe scanzonato e malinconico alla ricerca de qualcosa in pi&amp;ugrave;.&lt;br /&gt;Un amore inquieto per una donna che fugge anche da s&amp;egrave;.&lt;br /&gt;Una strada confusa e notturna che per&amp;ograve; chiarisce.&lt;br /&gt;Un&amp;#39;attesa, alla fine, che diventa inizio. &lt;/pre&gt;&lt;p&gt;Qualche parola sul titolo &amp;quot;Inutile e blu&amp;quot;&lt;/p&gt;&lt;p&gt;Il blu del titolo &amp;egrave; il colore della malinconia, del Blues, delle cose passate. &lt;/p&gt;&lt;p&gt;Per quanto riguarda l&amp;#39;Inutile invece, be&amp;#39; il mio inutile e&amp;#39; l&amp;#39;arrampicata e la montagna come per il protagonista del libro, ma e&amp;#39; anche l&amp;#39;hacking o imparare l&amp;#39;ennesimo linguaggio di programmazione, e un sacco di altre cose. E&amp;#39; la gioia di fare qualcosa soltanto per il piacere che ti da. Non mi riesce di spiegarlo bene, meglio se leggete il libro :-)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Titolo &amp;quot;Inutile e blu&amp;quot;&lt;br /&gt;Autore: Andrea Ballotti&lt;br /&gt;Ed. : Manni Editori&lt;/p&gt;&lt;p&gt;Lo po tete &lt;a href="http://www.365bookmark.it/scheda_libro.lasso?codice_prodotto=20071106144251636672"&gt;acquistare online qui&lt;/a&gt; o richiedere direttamente &lt;a href="http://www.mannieditori.it/index_x.asp?contenuto=dettaglio_libri&amp;amp;ID=1140"&gt;sul sito dell&amp;#39;editore&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=71">
        <title>Another Palio di Siena website</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=71</link>
        <description>Here is another website (in italian) about the Palio di Siena.&lt;br&gt;&lt;br&gt;&lt;a href="http://ilpaliodisiena.splinder.com"&gt;http://ilpaliodisiena.splinder.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;The site contains news, links, video, ecc...&lt;br&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=70">
        <title>How to use Yatsy</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=70</link>
        <description>&lt;a href="http://blog.tornkvist.org/blog.yaws?id=1183311409264197"&gt;This article&lt;/a&gt; explains how to use Yatsy.&lt;br&gt;&lt;br&gt;Yatsy (Yet Another Test Server + Yaws) is a test framework for erlang applications that collects results of test cases and presents them either via a web interface or as HTML files on disk.&lt;br&gt;&lt;br&gt;This is the first part of the article explaining how to setup all the required packages and how to write a simple test case.&lt;br&gt;In the second part of the article more advanced features will be explained. &lt;br&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=69">
        <title>An Haskell Web Store</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=69</link>
        <description>
&lt;a href="http://braintreehemp.com.au/"&gt;Braintree Hemp&lt;/a&gt; is s web store completely written in Haskell.&lt;br&gt;Source code is available from:&lt;br&gt;&lt;pre&gt;darcs get &lt;a rel="nofollow" href="http://braintreehemp.com.au/www.braintreehemp.com.au-WASH/" target="_top"&gt;http://braintreehemp.com.au/www.braintreehemp.com.au-WASH/&lt;/a&gt;&lt;br&gt;&lt;/pre&gt;Here some of the features of the site.&lt;br&gt;&lt;ul&gt;&lt;li&gt;Written in Haskell, using &lt;a href="http://www.informatik.uni-freiburg.de/%7Ethiemann/WASH/"&gt;WASH&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Shopping basket and checkout
&lt;/li&gt;&lt;li&gt;Google Maps
&lt;/li&gt;&lt;li&gt;Google Analytics
&lt;/li&gt;&lt;li&gt;Google Webmaster tools
&lt;/li&gt;&lt;li&gt;Template Haskell for HaskellDB description (describe a table or a field in one line)
&lt;/li&gt;&lt;li&gt;GPL, execpt where stated otherwise.
&lt;/li&gt;&lt;li&gt;Heavyweight Content Management System (CMS)
&lt;/li&gt;&lt;li&gt;Froogle RSS generator
&lt;/li&gt;&lt;li&gt;Configurable help for each page
&lt;/li&gt;&lt;li&gt;Concept of inventory levels
&lt;/li&gt;&lt;li&gt;Concept of users and permissions
&lt;/li&gt;&lt;li&gt;Naive-user management of products, users, and page content
&lt;/li&gt;&lt;li&gt;XML import tool and wizard for inventory level reconciliation&lt;br&gt;
between warehouse and site database
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;All of these with 4200 lines of Haskell code. See the &lt;a href="http://article.gmane.org/gmane.comp.lang.haskell.cafe/21159"&gt;announcement&lt;/a&gt; for more details.&lt;/p&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=68">
        <title>Foto Palio Siena</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=68</link>
        <description>
My friend Filippo published the site:&lt;br&gt;&lt;a href="http://www.fotopaliosiena.it/"&gt;www.fotopaliosiena.it&lt;/a&gt; &lt;br&gt;&lt;br&gt;containing a photo reportage of Palio di Siena.&lt;br&gt;Photos can be bought online.&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=67">
        <title>Google Gears</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=67</link>
        <description>
Google released a new interesting technology to enable Offline Web Applications called &lt;a href="http://code.google.com/apis/gears/"&gt;Google Gears&lt;/a&gt;&lt;br&gt;Google Gears consists of three modules:&lt;br&gt;&lt;ul&gt;&lt;li&gt;LocalServer: Cache and Serve application resources locally&lt;/li&gt;&lt;li&gt;Database: store data locally in a relationable database&lt;/li&gt;&lt;li&gt;WorkerPool: make your application more responsive by performing resource-intensive operations asynchronously&lt;/li&gt;&lt;/ul&gt;This combined with a server answering json requests makes a great development platform&lt;br&gt;&lt;br&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=66">
        <title>''The shape of your mind''</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=66</link>
        <description>
Eric Merrit wrote an interesting post on his blog &lt;a href="http://erlangish.blogspot.com/2007/05/shape-of-your-mind.html"&gt;"The shape of your mind"&lt;/a&gt; on how knowing different programming languages shapes your mind and the way you think to problems.&lt;br&gt;&lt;br&gt;This reminded me of the &lt;a href="http://en.wikipedia.org/wiki/Sapir-Whorf_hypothesis"&gt;Sapir-Whorf hypotesis&lt;/a&gt; taken from linguistic.&lt;br&gt;This hypotesis has many formulations, some weak and some strong. The strong formulation, stating that language determines thought, is thought to be incorrect in linguistic.&lt;br&gt;I think a lot of programmers would instead agree with the strong formulation.&lt;br&gt;&lt;br&gt;&lt;br&gt;And now I know I have to add Forth to the list of languages to learn :-).&lt;br&gt;&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=65">
        <title>The Art of 'Ware</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=65</link>
        <description>&lt;a href="http://en.wikipedia.org/wiki/Bruce_Webster"&gt;Bruce Webster&lt;/a&gt; in the early '90s wrote a book titled "&lt;a href="http://and-still-i-persist.com/?page_id=236"&gt;The Art of 'Ware&lt;/a&gt;". A reinterpretation of &lt;a href="http://en.wikipedia.org/wiki/The_Art_of_War"&gt;Sun Tzu "The Art of War"&lt;/a&gt;. &lt;br&gt;&lt;br&gt;The original book is out of print, but author has published an updated version on his blog.&lt;br&gt;&lt;br&gt;Read&amp;nbsp; &lt;a href="http://and-still-i-persist.com/?page_id=236"&gt;The Art of 'Ware&lt;/a&gt; online

</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=64">
        <title>sgte 0.3.0</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=64</link>
        <description>
I have completed the parser rewrite of sgte.&lt;br&gt;The new version (0.3.0) is available for download on the google project page:&lt;br&gt;&lt;a href="http://code.google.com/p/sgte/"&gt;http://code.google.com/p/sgte/&lt;/a&gt;&lt;br&gt;&lt;h3&gt;Changes&lt;/h3&gt;&lt;h4&gt;join of items&lt;/h4&gt;In the previous version a join template was written like this:&lt;br&gt;&lt;pre&gt;$join ", " columns$ &lt;br&gt;&lt;/pre&gt;&lt;p&gt;In the new version the same template is written:&lt;/p&gt;&lt;pre&gt;$join:{, } columns$&lt;/pre&gt;&lt;p&gt;The new syntax for join reflects the syntax used for the inline map.&lt;/p&gt;&lt;h4&gt;map feature&lt;/h4&gt;Map has undergone the major changes. There was a bug in the management of multiple inline templates (thanks to tobbe for finding the bug and for his suggestions). I.e. when you had a template like:&lt;br&gt;&lt;pre&gt;$map:{&lt;br&gt;&amp;lt;li class="odd"&amp;gt;$item$&amp;lt;/li&amp;gt;,&lt;br&gt;&amp;lt;li class="even"&amp;gt;$item$&amp;lt;/li&amp;gt;} itemList$&lt;/pre&gt;Where itemList was [{item, "Item1"}, {}item, "Item2", {item, "Item3"}]. You got:&lt;br&gt;&lt;pre&gt;&amp;lt;li class="odd"&amp;gt;Item1&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;li class="even"&amp;gt;Item2&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;li class="odd"&amp;gt;Item3&amp;lt;/li&amp;gt;&lt;/pre&gt;&lt;p&gt;The problem was the templates separator "," if found both as a separator and as text to be rendered was parsed incorrectly. Moreover the use of the comma as a separator was really a bad choice since it can easily be found in javascript code and in normal text to render.&lt;/p&gt;&lt;p&gt;I've removed this feature for now. &lt;br&gt;I don't think anyone uses it at the moment. If someone needs it let me know and I'll put it back in place choosing a better separator.&lt;br&gt;&lt;/p&gt;&lt;p&gt;The non inline map instead now can assume one of the following forms:&lt;/p&gt;&lt;pre&gt;$map tmpl items$&lt;br&gt;$mmap tmpl1 tmpl2 tmpl3 items$&lt;br&gt;$mapl tmpl items$&lt;br&gt;&lt;/pre&gt;&lt;p&gt;The first one is the map of compiled template tmpl over a list of items as before. &lt;br&gt;&lt;/p&gt;&lt;p&gt;If you have multiple templates you want to alternate (e.g. for even and odd rows in a table) you can use mmap. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Finally mapl is a small facility that can be usefull in some cases. I illustrate it with a small example:&lt;/p&gt;&lt;pre&gt;{ok, Row} = sgte:compile("- $attr$").&lt;br&gt;{ok, MapTmpl} = sgte:compile("$map row names$").&lt;br&gt;sgte:render(MapTmpl, [{row, Row}, {names, ["foo", "bar", "baz"]}]).&lt;br&gt;&lt;/pre&gt;&lt;p&gt;Here names is a list of values instead of a list of {key,value} pairs. each name is passed to the row template using attr as key. names is converted during rendering to [{attr, "foo"}, {attr, "bar"}, {attr, "baz"}]. The result is:&lt;br&gt;&lt;/p&gt;&lt;pre&gt;- foo&lt;br&gt;- bar&lt;br&gt;- baz&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;h4&gt;Other changes&lt;/h4&gt;&lt;p&gt;Other changes include:&lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;line numbers added in error messages&lt;/li&gt;&lt;li&gt;better management of blanks in templates. Multiple spaces and newlines are properly handled inside template statements&lt;/li&gt;&lt;li&gt;the make test now works&lt;/li&gt;&lt;li&gt;code has been refactored in a parse module and a render module&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=63">
        <title>sgte parser rewrite</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=63</link>
        <description>
After some testing and the first experiences using sgte I'm doing a complete rewrite of the parser. &lt;br&gt;The code in the first version after some changes was quickly becoming unmantainable, so I decided to rewrite it from scratch.&lt;br&gt;The interface and the language is mainly the same as the previous version. There are a couple of new features and some smaller incompatible changes I will document before merging the new version in the main trunk.&lt;br&gt;&lt;br&gt;The rewrite can be found in the TRY-parser-rewrite branch on the project page on Google.&lt;br&gt;&lt;br&gt;You can checkout the branch with the command:&lt;br&gt;&lt;pre&gt;&lt;tt&gt;svn checkout &lt;b&gt;&lt;i&gt;http&lt;/i&gt;&lt;/b&gt;://sgte.googlecode.com/svn/branches/TRY-parser-rewrite sgte&lt;br&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;p&gt;The rewrite is almost finished. I have to fix some bugs in the if templates, and write documentation for the new features.&lt;br&gt;&lt;/p&gt;The new version should be available in the next week.&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=62">
        <title>Wedding-Siena.com</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=62</link>
        <description>
&lt;a href="http://www.wedding-siena.com/"&gt;Wedding-Siena.com&lt;/a&gt; is a newly published website of &lt;a href="http://www.filippogalluzzi.it"&gt;Filippo Galluzzi&lt;/a&gt;. &lt;br&gt;&lt;br&gt;Filippo recently started his new adventure as a photographer.&lt;br&gt;So if you are planning a wedding in Tuscany, or if you are looking for great photos of Tuscany countryside, take a look at his websites and contact him. &lt;br&gt;He is a great photographer as well as a friend.&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=61">
        <title>sgte Google project</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=61</link>
        <description>
I created a Google project for sgte development and a Google group for discussion.&lt;br&gt;&lt;br&gt;I uploaded the files to the project: &lt;br&gt;source code and a test module. &lt;br&gt;&lt;br&gt;The tests use a small library (sgeunit) I wrote when I started learning Erlang. The source of the library is included.&lt;br&gt;&lt;br&gt;Here are the links:&lt;br&gt;&lt;a href="http://code.google.com/p/sgte/"&gt;sgte project home page&lt;/a&gt;&lt;br&gt;&lt;a href="http://groups.google.com/group/sgte-code"&gt;sgte google group&lt;/a&gt;&lt;br&gt;&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=60">
        <title>Update to the map code</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=60</link>
        <description>&lt;p&gt;A few days ago after some feedback from Eric Merritt I made a small change to the way the map works. It breaks the old code and I hadn't documented it yet since I was the only user. Now sgte is getting some attention on the yaws mailinglist, so it's better if I update the doc :-) .&lt;/p&gt;&lt;p&gt;The old map worked like this:&lt;br&gt;&lt;/p&gt;&lt;pre&gt;{ok, C} = sgte:compile("$map:{&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;$attr$&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;} names$").&lt;br&gt;sgte:render(C4, [{names, ["foo", "bar", "baz"]}]).&lt;/pre&gt;

here the element taken from the list is implicitely called attr and it gets the values "foo", "bar", "baz". &lt;br&gt;I made a change and now I iter over a list of {key, value} tuples so I can do something like this.&lt;br&gt;&lt;pre&gt;{ok, C} = sgte:compile("$map:{&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;$first_name$ $last_name$&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;} names$").&lt;br&gt;sgte:render(C4, [{names, [&lt;br&gt;			[{first_name, "filippo"}, {last_name, "pacini"}],&lt;br&gt;			[{first_name, "foo"}, {last_name, "bar"}]&lt;br&gt;			]&lt;br&gt;		}]).&lt;br&gt;&lt;/pre&gt;&lt;p&gt;To get:&lt;/p&gt;&lt;pre&gt;&amp;lt;li&amp;gt;filippo pacini&amp;lt;/li&amp;gt;&lt;br&gt;&amp;lt;li&amp;gt;foo bar&amp;lt;/li&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;


This seems much better than how I previously used it. I think in the future I could also support the old way it worked adding a mapList feature, or something like that.&lt;br&gt;&lt;br&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=59">
        <title>Javascript form validation</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=59</link>
        <description>
Recently I was asked to change the form validation code for a couple of websites.&lt;br&gt;&lt;br&gt;It was the occasion to rewrite from scratch the validation code of an old library I've been using for several years.&lt;br&gt;&lt;br&gt;The library (&lt;a href="http://www.sgconsulting.it/download/sgForms.js"&gt;sgForms.js&lt;/a&gt;) depends on &lt;a href="http://www.prototypejs.org/"&gt;prototype&lt;/a&gt; and is released under the &lt;a href="http://www.mozilla.org/MPL/"&gt;Mozilla Public Library&lt;/a&gt;. You can download &lt;a href="http://www.sgconsulting.it/download/sgForms.js"&gt;sgForms&lt;/a&gt; along with a simple &lt;a href="http://www.sgconsulting.it/download/test_sgforms.html"&gt;test page&lt;/a&gt;.&lt;br&gt;&lt;br&gt;To use the form validators you have to include the prototype library and sgForms in the html page:&lt;br&gt;&lt;pre&gt;&amp;lt;&lt;span class="start-tag"&gt;script&lt;/span&gt;&lt;span class="attribute-name"&gt; src&lt;/span&gt;=&lt;span class="attribute-value"&gt;"prototype.js"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="end-tag"&gt;script&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;script&lt;/span&gt;&lt;span class="attribute-name"&gt; src&lt;/span&gt;=&lt;span class="attribute-value"&gt;"sgForms.js"&lt;/span&gt;&amp;gt;&amp;lt;/&lt;span class="end-tag"&gt;script&lt;/span&gt;&amp;gt;&lt;br&gt;&lt;/pre&gt;Here's an example form to check:&lt;br&gt;&lt;pre&gt;&amp;lt;&lt;span class="start-tag"&gt;form&lt;/span&gt;&lt;span class="attribute-name"&gt; name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"testForm" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"testForm" &lt;/span&gt;&lt;span class="attribute-name"&gt;method&lt;/span&gt;=&lt;span class="attribute-value"&gt;"GET" &lt;/span&gt;&lt;span class="attribute-name"&gt;action&lt;/span&gt;=&lt;span class="attribute-value"&gt;"#" &lt;/span&gt;&lt;span class="attribute-name"&gt;onSubmit&lt;/span&gt;=&lt;span class="attribute-value"&gt;"return checkForm();"&lt;/span&gt;&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;label&lt;/span&gt;&amp;gt;email&amp;lt;/&lt;span class="end-tag"&gt;label&lt;/span&gt;&amp;gt; &amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"text" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"email" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"email" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;""&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="start-tag"&gt;br&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;label&lt;/span&gt;&amp;gt;field 1&amp;lt;/&lt;span class="end-tag"&gt;label&lt;/span&gt;&amp;gt; &amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"text" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"one" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"one" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;""&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="start-tag"&gt;br&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;label&lt;/span&gt;&amp;gt;field 2&amp;lt;/&lt;span class="end-tag"&gt;label&lt;/span&gt;&amp;gt; &amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"text" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"two" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"two" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;""&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="start-tag"&gt;br&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;label&lt;/span&gt;&amp;gt;CheckBox&amp;lt;/&lt;span class="end-tag"&gt;label&lt;/span&gt;&amp;gt; &amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"checkbox" &lt;/span&gt;&lt;span class="attribute-name"&gt;id&lt;/span&gt;=&lt;span class="attribute-value"&gt;"myCheck" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"myCheck" &lt;/span&gt;&lt;span class="attribute-name"&gt;title&lt;/span&gt;=&lt;span class="attribute-value"&gt;"CheckBox" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;"whatever"&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="start-tag"&gt;br&lt;/span&gt;&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;label&lt;/span&gt;&amp;gt;regex&amp;lt;/&lt;span class="end-tag"&gt;label&lt;/span&gt;&amp;gt;  &amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"text" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"regex" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;""&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class="start-tag"&gt;br&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;&lt;span class="start-tag"&gt;input&lt;/span&gt;&lt;span class="attribute-name"&gt; type&lt;/span&gt;=&lt;span class="attribute-value"&gt;"submit" &lt;/span&gt;&lt;span class="attribute-name"&gt;name&lt;/span&gt;=&lt;span class="attribute-value"&gt;"clickme" &lt;/span&gt;&lt;span class="attribute-name"&gt;value&lt;/span&gt;=&lt;span class="attribute-value"&gt;"Check Form"&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;/&lt;span class="end-tag"&gt;form&lt;/span&gt;&amp;gt;&lt;br&gt;&lt;/pre&gt;&lt;p&gt;Each form field must have an id. I use the onSubmit event to check the form validity and based on the result to stop the submit or continue.&lt;/p&gt;&lt;p&gt;Here's the checkForm function where we define the validation rules for each field and call a function in the sgForms library that performs the validation:&lt;/p&gt;&lt;pre&gt;&amp;lt;&lt;span class="start-tag"&gt;script&lt;/span&gt;&lt;span class="attribute-name"&gt; language&lt;/span&gt;=&lt;span class="attribute-value"&gt;"javascript"&lt;/span&gt;&amp;gt;&lt;br&gt;&amp;lt;!--&lt;br&gt;function checkForm() {&lt;br&gt;    var rules = {'email':['notEmpty', 'email'], 'one':['notEmpty'], 'two':['notEmpty'], 'myCheck':['isChecked']};&lt;br&gt;    return sgFormValidateAlert(rules, 'it');&lt;br&gt;}&lt;br&gt;//--&amp;gt;&lt;br&gt;&amp;lt;/&lt;span class="end-tag"&gt;script&lt;/span&gt;&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;&lt;p&gt;rules is a javascript object which is transformed into an hash (associative array) using protype. Rules contains the ids of the fields to validate and the rules to apply to each field. &lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;'notEmpty' rule means a field is required&lt;/li&gt;&lt;li&gt;'email' applies a regular expression to check for a valid email&lt;/li&gt;&lt;li&gt;'isChecked' applied to a checkbox field verifies the field is checked&lt;/li&gt;&lt;li&gt;other rules are 'float' and 'number' to check for a float or number value respectively&lt;/li&gt;&lt;/ul&gt;You can supply custom validators defining a rule such as:&lt;br&gt;&lt;pre&gt;'myField': [myRuleValidator]&lt;br&gt;&lt;/pre&gt;&lt;p&gt;where myRuleValidator is a functions of three arguments &lt;br&gt;&lt;/p&gt;&lt;pre&gt;myRuleValidator(field, fieldValue, lang)&lt;br&gt;&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;field is a reference to the field we are validating (I use it to build error messages together with lang)&lt;/li&gt;&lt;li&gt;fieldValue is the value of field&lt;/li&gt;&lt;li&gt;lang is the language for the error messages ('en' for english, 'it' for italian)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;sgForms contains a basic validator (sgFormValidate) which performs the validation and returns an empty list if all fields validated correctly, or a list with the errors. On this I've built a sgFormValidateAlert wich calls sgFormValidate and returns the errors if present in an alert window. There are also sgFormsValidateBrString returning a &amp;amp;lt;br&amp;amp;gt; separated string of errors and sgFormsValidateString returning a '
' separated string of errors. However you can use sgFormValidate to present errors in the way you prefer.&lt;br&gt;&lt;/p&gt;&lt;p&gt;I've already used the library on some sites and it seems to work fine. My next steps will be to add some validators (e.g. a regex validator) and to teach its use to web designers to see if it's easy enough to be used also by a non-programmer.&lt;/p&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=58">
        <title>Building an OTP Application</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=58</link>
        <description>In &lt;a href="http://erlware.blogspot.com/2007/01/building-otp-application.html"&gt;this article&lt;/a&gt; Martin J Logan guides you in the creation of an Erlang/OTP application.

</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=57">
        <title>Haskell, bondage-and-discipline and separation-of-concerns programming</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=57</link>
        <description>
&lt;pre&gt;"This is a long, involved defense of purity, both in terms of what it affords us&lt;br&gt;&amp;nbsp;in terms of power and in how it enforces "good" programming practices."&lt;/pre&gt;&lt;p&gt;&lt;a href="http://syntaxfree.wordpress.com/2007/01/08/haskell-bondage-and-discipline-and-separation-of-concerns-programming/"&gt;Read the complete article&lt;/a&gt; on Data.Syntaxfree&lt;br&gt;&lt;/p&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=56">
        <title>''No Silver Bullet'' and Functional Programming</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=56</link>
        <description>&lt;a href="http://cogito.blogthing.com/2006/12/06/no-silver-bullet-and-functional-programming/"&gt;''No Silver Bullet'' and Functional Programming&lt;/a&gt;&lt;br&gt;Interesting blog article.&lt;br&gt;

</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=55">
        <title>SGTE - update</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=55</link>
        <description>I've started using sgte for my web development.&lt;br&gt;Using it I've found some problems and thing thath should be improved.&lt;br&gt;&lt;br&gt;First of all I've added a new feature: application of an attribute to another.&lt;br&gt;&lt;pre&gt;$apply myFun myAttr$&lt;br&gt;&lt;/pre&gt;If myFun is a function/1 the result of the template rendering is&lt;br&gt;&lt;pre&gt;myFun(myAttr)&lt;br&gt;&lt;/pre&gt;&lt;p&gt;This can be used for example when myvar is a record and you want to extract a field from the record.&lt;/p&gt;&lt;p&gt;Adding the apply keyword I also changed the keyword for template reference. It's not call anymore, but include. This to avoid confusion between call and apply.&lt;/p&gt;&lt;p&gt;I hope also to improve error reporting soon, and to add a small site, or page project with the latest version and with documentation.&lt;/p&gt;

The updated package can be found at &lt;a href="http://www.sgconsulting.it/download/sgte.erl"&gt;the same place&lt;/a&gt; :-)&lt;br&gt;</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=54">
        <title>SGTE - bug fixed</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=54</link>
        <description>
I've fixed a bug with embedded if tokens in templates and uploaded the fixed version on our website.&lt;br&gt;&lt;br&gt;You can download it &lt;a href="http://www.sgconsulting.it/download/sgte.erl"&gt;here&lt;/a&gt;.&lt;br&gt;
</description>
    </item>
    
    <item rdf:about="http://blog.blog.sgconsulting.it/blog.html?identry=53">
        <title>SGTE update</title>
        <link>http://blog.blog.sgconsulting.it/blog.html?identry=53</link>
        <description>
&lt;p&gt;I've uploaded an &lt;a href="http://www.sgconsulting.it/download/sgte.erl"&gt;updated version of sgte&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Below are the changes from the previous version and the &lt;span style="font-weight: bold;"&gt;template reference&lt;/span&gt; feature I forgot to mention in my previous post.&lt;/p&gt;&lt;h3&gt;Changes&lt;/h3&gt;- sgte is no longer a gen_server behaviour. It's a simple library. OTP behaviour, as well as caching of the compiled templates will be part of the web framework I'm building on sgte. So you don't need the initial call to start_link to use the library.&lt;br&gt;- error reporting: if compilation fails now you get an tuple explaining where the error occured.&lt;br&gt;- I rewrote the code documentation using edoc. You can &lt;a href="http://www.sgconsulting.it/download/sgte_doc.tar.gz"&gt;download the generated html&lt;/a&gt;.&lt;br&gt;&lt;h3&gt;Template reference&lt;/h3&gt;In the previous post I also forgot to mention the template reference feature.&lt;br&gt;In a template we can refer to other templates.&lt;br&gt;&lt;br&gt;First we define the template to be included:&lt;br&gt;&lt;pre&gt;{ok, C1} = sgte:compile("bar").&lt;br&gt;&lt;/pre&gt;Then we define the template including it, and we call the render passing the previous compiled template in the data:&lt;br&gt;&lt;pre&gt;{ok, C2} = sgte:compile("foo $call tmpl$ baz").&lt;br&gt;sgte:render(C2, [{tmpl, C1}]).&lt;br&gt;&lt;/pre&gt;And so we get: &lt;br&gt;&lt;pre&gt;"foo bar baz"&lt;br&gt;&lt;/pre&gt;&lt;p&gt;Note that in the template after call we can use any atom (e.g. $call page_header$). Then when we call the render we pass the compiled template to include (e.g. {page_header, CompiledHeader}).&lt;/p&gt;&lt;p&gt;[edited] the token for template reference is changed. Use include instead of call [edited]&lt;br&gt;&lt;/p&gt;
</description>
    </item>
    
</rdf:RDF>
