<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>UBIK - RPL&#8217;s Geek Passenger - Yet Another (b)Log about all that geeky weird stuff </title>
 <link href="http://ubik.cc/atom.xml" rel="self"/>
 <updated>2011-01-08T06:30:07+01:00</updated>
 <id>http://ubik.cc/</id>
 <author>
   <name>Luca Greco</name>
   <email>rpl@ubik.cc</email>
 </author>
 
 
 <entry>
   <title>MozREPL Custom Commands</title>
   <link href="http://ubik.cc/2009/12/mozrepl-custom-commands.html"/>
   <updated>2009-12-06T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/12/mozrepl-custom-commands</id>
   <content type="html">&lt;p&gt;During common &amp;#8220;&lt;span class=&quot;caps&quot;&gt;XUL&lt;/span&gt; extensions/application&amp;#8221; development workflow, we need to reload&lt;br /&gt;
XULRunner chrome environment and enable/disable common debugging preferences.&lt;/p&gt;
&lt;p&gt;The &amp;#8220;Extension Developer Extension&amp;#8221; Firefox Addon can do this kind of stuff&lt;br /&gt;
but is bigger than our needs.&lt;/p&gt;
&lt;p&gt;So, at work, we have extracted this two common functionalities in two &lt;br /&gt;
&lt;a href=&quot;http://wiki.github.com/bard/mozrepl/custom-commands&quot;&gt;MozREPL custom commands&lt;/a&gt;&lt;/p&gt;
&lt;script src=&quot;http://gist.github.com/250341.js?file=mozrepl-xuldev-utils.js&quot;&gt;&lt;/script&gt;&lt;p&gt;To enable these new custom commands set &amp;#8220;extensions.mozrepl.initUrl&amp;#8221;&lt;br /&gt;
to the correct &amp;#8220;file:///&amp;#8221; url in your profile preferences.&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br /&gt;
rpl&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>CouchDB, ExtJS and Simile Timeline</title>
   <link href="http://ubik.cc/2009/11/couchdb-extjs-similetimeline.html"/>
   <updated>2009-11-18T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/11/couchdb-extjs-similetimeline</id>
   <content type="html">&lt;p&gt;In this post I&amp;#8217;ll try to summarize my first experiment on using CouchDB in a solution of a real world problem.&lt;/p&gt;
&lt;h3&gt;Problem&lt;/h3&gt;
&lt;p&gt;At work we are developing a &lt;span class=&quot;caps&quot;&gt;VOIP&lt;/span&gt; application based on &lt;a href=&quot;http://yate.null.ro&quot;&gt;Yate&lt;/a&gt; (an OpenSource &lt;span class=&quot;caps&quot;&gt;VOIP&lt;/span&gt; Engine) and in this kind of application timing is a very important factor, more important than in classic Web applications.&lt;/p&gt;
&lt;p&gt;The application is working like a charm but sometimes it encounter exceptional conditions and we feel it can be related to something we&amp;#8217;re not handling in the right way or&amp;#8230; at the &lt;b&gt;right time&lt;/b&gt; ;-)&lt;/p&gt;
&lt;p&gt;How can we trace and debug this kind of problems?&lt;/p&gt;
&lt;p&gt;We need a complete tracelog of messages received and how our application is handling them&amp;#8230; and we need to trace the &lt;b&gt;real-deployed-application&lt;/b&gt;, where this exceptional conditions occurs.&lt;/p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
&lt;p&gt;The solution we&amp;#8217;re prototyping is based on a simple and not so new architecture:&lt;/p&gt;
&lt;p&gt;The application push useful tracing information in a central storage, and we want to search, filter, analize and visualize useful informations from it.&lt;/p&gt;
&lt;p&gt;This kind of problem can be solved in a number of ways and technologies but our experimental solution use CouchDB as &amp;#8220;tracing-info&amp;#8221; storage, and a pure client-side javascript application to access the data.&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;a href=&quot;/attachments/log_on_couchdb.png&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;/attachments/log_on_couchdb.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;h3&gt;Some Tech Details&lt;/h3&gt;
&lt;p&gt;Our application is developed in &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; (sigh!) so we&amp;#8217;re using the simpler &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt; binding of the CouchDB Rest &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://github.com/dready92/PHP-on-Couch&quot;&gt;http://github.com/dready92/&lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;-on-Couch&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://wiki.apache.org/couchdb/Getting_started_with_PHP&quot;&gt;http://wiki.apache.org/couchdb/Getting_started_with_PHP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;: &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;-on-Couch don&amp;#8217;t support authentication so I wrote a small patch (and I will setup a github fork asap)&lt;/p&gt;
&lt;p&gt;In our current design decision every tracing session became a new different couchdb database:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;php&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// CONNECT TO A DATABASE AND DATABASE CREATION&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;couchClient&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;http://localhost:5984&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;alcadialer_tracelogs_&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$start_tracing_datetime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 

&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;databaseExists&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;createDatabase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// COLLECT TRACING INFO AND STORE IT ON COUCHDB&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;$ev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setParam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;AlcaDialerCommand&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;get_class&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$command&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;nv&quot;&gt;$response&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;storeDoc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$ev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;ERROR: &amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getMessage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot; (&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getCode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;)&amp;lt;br&amp;gt;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;x&quot;&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;So we&amp;#8217;ve tracing logs databases in a CouchDB service&amp;#8230; &lt;br /&gt;
now we need to navigate them in useful ways and in a timing problem &amp;#8220;useful ways&amp;#8221; means &amp;#8220;visualize events on a timeline&amp;#8221;&amp;#8230; and the &amp;#8220;simile timeline&amp;#8221; is so pretty and simple to use:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://www.simile-widgets.org/timeline/&quot;&gt;http://www.simile-widgets.org/timeline/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now the question is: how can we host all this stuff on CouchDB? we need a separate service?&lt;br /&gt;
The answer is: CouchDB is enough :-)&lt;/p&gt;
&lt;p&gt;A more technical answer to this question can be: CouchApp is the way :-D&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://github.com/couchapp/couchapp&quot;&gt;http://github.com/couchapp/couchapp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After CouchApp installation we can generate a CouchDB standalone application working tree (as Rails do)&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;couchapp generate myapp

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ls -l myapp

drwxr-xr-x 4 rpl rpl 4096 2009-11-16 19:02 _attachments
-rw-r--r-- 1 rpl rpl   97 2009-11-16 07:03 couchapp.json
drwxr-xr-x 2 rpl rpl 4096 2009-11-16 07:01 lists
drwxr-xr-x 2 rpl rpl 4096 2009-11-16 07:01 shows
drwxr-xr-x 2 rpl rpl 4096 2009-11-16 07:01 updates
drwxr-xr-x 3 rpl rpl 4096 2009-11-16 07:01 vendor
drwxr-xr-x 2 rpl rpl 4096 2009-11-16 07:01 views
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;In our usecase we have to put all files of our javascript application in the _attachments dir:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ls _attachments/ -l

-rw-r--r-- 1 rpl rpl 1255 2009-11-16 19:02 index.html
drwxr-xr-x 4 rpl rpl 4096 2009-11-16 22:47 js
drwxr-xr-x 2 rpl rpl 4096 2009-11-16 19:01 style

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;ls _attachments/js -l

-rw-r--r-- 1 rpl rpl 5440 2009-11-16 22:47 application.js
drwxr-xr-x 4 rpl rpl 4096 2009-11-16 07:13 extjs
drwxr-xr-x 4 rpl rpl 4096 2009-11-16 14:52 timeline
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;In &amp;#8220;_attachments/js&amp;#8221; there is our application.js and two directories, extjs and timeline, where are our application dependencies (I think they can/could be stored under vendor directory&amp;#8230; but I will try this in a second experiment)&lt;br /&gt;
From extjs and timeline directories we&amp;#8217;ve removed unused stuff (examples, documentations etc.).&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s see some of the code of application.js (the interesting part of application.js code :-D).&lt;/p&gt;
&lt;p&gt;How can we put CouchDB data in an ExtJS grid?&lt;br /&gt;
On CouchDB wiki there&amp;#8217;s a CouchStore prototype for ExtJS&amp;#8230; but it don&amp;#8217;t work very well (it have to be reworked, I think), but in our usecase we only need to get from a CouchDB database, so we can use a classic JSONStore from the ExtJS standard lib:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;store&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Ext&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;JsonStore&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// store configs&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;autoDestroy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;trace&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;/tracelogdb/_design/messages/_view/all_by_seqid&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;storeId&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;myStore&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// reader configs&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;rows&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;idProperty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;totalProperty&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;total_rows&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;restful&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;id&amp;#39;&lt;/span&gt;      &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;  
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;key&amp;#39;&lt;/span&gt;     &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;  
            &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;value&amp;#39;&lt;/span&gt;   &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;And attach it to a GridPanel.&lt;/p&gt;
&lt;p&gt;Our JsonStore use a design view in the tracelogdb so we need to create it (we&amp;#8217;ve not automated the task right now):&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;_id&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;_design/messages&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;language&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;javascript&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;views&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&amp;quot;all_by_seqid&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
      &lt;span class=&quot;s2&quot;&gt;&amp;quot;map&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;function(doc) {  emit(doc.params.AlcaDialerSeqID, doc); }&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Now we&amp;#8217;ve a local (to the browser) store of CouchDB documents and every row in the view have a timestamp in a sub-property of &amp;#8216;value&amp;#8217;, so we can use that value to insert and visualize events in a simile timeline component:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TimelineInit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DefaultEventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bandInfos&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createBandInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;          &lt;span class=&quot;s2&quot;&gt;&amp;quot;70%&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
            &lt;span class=&quot;nx&quot;&gt;intervalUnit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SECOND&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
            &lt;span class=&quot;nx&quot;&gt;intervalPixels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;    &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// THIS BAND ZOOM ON MOUSE WHEEL&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;zoomIndex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;      &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
            &lt;span class=&quot;nx&quot;&gt;zoomSteps&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;280&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SECOND&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;140&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SECOND&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;mi&quot;&gt;70&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SECOND&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;mi&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;SECOND&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MINUTE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MINUTE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
              &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pixelsPerInterval&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;nx&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MINUTE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
	    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}),&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createBandInfo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;overview&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;    &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;	  
            &lt;span class=&quot;nx&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;          &lt;span class=&quot;s2&quot;&gt;&amp;quot;10%&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
            &lt;span class=&quot;nx&quot;&gt;intervalUnit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;   &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;HOUR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
            &lt;span class=&quot;nx&quot;&gt;intervalPixels&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}),&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;timeline_data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
	&lt;span class=&quot;s1&quot;&gt;&amp;#39;wiki-url&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;http://fake-url/&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
	&lt;span class=&quot;s1&quot;&gt;&amp;#39;wiki-section&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Fake Section&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
	&lt;span class=&quot;s1&quot;&gt;&amp;#39;dateTimeFormat&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;Gregorian&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;s1&quot;&gt;&amp;#39;events&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;last_timestamp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;seq&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;render_event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;description&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;c1&quot;&gt;// ... FORMAT EVENT DESCRIPTION FROM RECORD CONTENT&lt;/span&gt;

	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;durationEvent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;(&amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;) - &amp;quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;origin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
	    &lt;span class=&quot;nx&quot;&gt;icon&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;js/timeline/timeline_js/images/dark-red-circle.png&amp;#39;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;store&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;timeline_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;render_event&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// SYNC TIME BAND&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;bandInfos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;syncWith&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;bandInfos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;highlight&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// CREATE TIMELINE&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;tl&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;my-timeline&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bandInfos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// CENTER TO THE FIRST EVENT&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;tl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getBand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setCenterVisibleDate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parseGregorianDateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;timeline_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;events&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// LOAD ALL DATA&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;eventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;loadJSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;timeline_data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;location&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We can enhance grid/timeline interactions with a listener that move timeline on grid row selection events:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;listeners&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;rowclick&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rowIndex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;selected&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getSelectionModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getSelected&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;timeline_view&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;getBand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setCenterVisibleDate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;Timeline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;parseGregorianDateTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;selected&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;origin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)));&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;How it looks right now?&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;a href=&quot;/attachments/alcadialer_traceview.png&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;/attachments/thumb-alcadialer_traceview.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;ohhh&amp;#8230; Yes.. it&amp;#8217;s only a prototype but it&amp;#8217;s soooo fun, isn&amp;#8217;t it? :-)&lt;/p&gt;
&lt;p&gt;Happy Hacking,&lt;br /&gt;
rpl&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>MozRepl in a Panel</title>
   <link href="http://ubik.cc/2009/09/mozrepl-in-a-panel.html"/>
   <updated>2009-09-27T00:00:00+02:00</updated>
   <id>http://ubik.cc/2009/09/mozrepl-in-a-panel</id>
   <content type="html">&lt;p&gt;As &lt;span class=&quot;caps&quot;&gt;XUL&lt;/span&gt; developer, MozRepl is definitely my favourite Firefox AddOn, an open door from my emacs to my firefox development profile.&lt;/p&gt;
&lt;p&gt;Using &lt;a href=&quot;http://wiki.github.com/bard/mozrepl&quot;&gt;MozRepl&lt;/a&gt; from emacs is simple and agile thanks to an Emacs minor-mode&lt;br /&gt;
which connect an emacs buffer to a MozRepl session, over a tcp telnet-like connection.&lt;/p&gt;
&lt;p&gt;I use &lt;a href=&quot;http://wiki.github.com/bard/mozrepl&quot;&gt;MozRepl&lt;/a&gt; for real-time interaction session during talks and&lt;br /&gt;
courses on Javascript, OpenWeb e Mozilla Platform, but not all the audience is&lt;br /&gt;
&amp;#8220;emacs-addicted&amp;#8221; so they lost the interactive workflow experienced during this sessions.&lt;/p&gt;
&lt;p&gt;Some months ago I&amp;#8217;ve assembled a little experimental extension which embed a &lt;a href=&quot;http://wiki.github.com/bard/mozrepl&quot;&gt;MozRepl&lt;/a&gt;&lt;br /&gt;
session in a &lt;span class=&quot;caps&quot;&gt;XUL&lt;/span&gt; panel.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/projects/mozrepl-panel&quot;&gt;MozRepl in a Panel&lt;/a&gt; adds a Tool menupopup in Firefox, Thunderbird and Songbird,&lt;br /&gt;
and can be adapted to overlay other XULRunner application with no work.&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;a href=&quot;/projects/mozrepl-panel/firefox.png&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;/projects/mozrepl-panel/thumb-firefox.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;It can be very useful to debug your extensions or XULRunner applications and to demostrate&lt;br /&gt;
scripting features during technical talks.&lt;/p&gt;
&lt;center&gt;
&lt;h3&gt;&lt;a href=&quot;/projects/mozrepl-panel&quot;&gt;Give it a try, guys ;-)&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;/projects/mozrepl-panel/songbird.png&quot;&gt;&lt;br /&gt;
&lt;img src=&quot;/projects/mozrepl-panel/thumb-songbird.png&quot; alt=&quot;&quot; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/h3&gt;
&lt;/center&gt;</content>
 </entry>
 
 <entry>
   <title>MAOW 2009 - Firenze</title>
   <link href="http://ubik.cc/2009/06/MAOW09_Firenze.html"/>
   <updated>2009-06-20T00:00:00+02:00</updated>
   <id>http://ubik.cc/2009/06/MAOW09-Firenze</id>
   <content type="html">&lt;img src=&quot;http://workshop.xulfr.org/pics/robot.png&quot; style=&quot;float:right;&quot;/&gt;
Seems like this is going to be my Year of Mozilla :-D 
&lt;br/&gt;&lt;br/&gt;
I was in Bruxelles for FOSDEM09, where I took part to a series of workshops 
on the Mozilla platform and to an intense debate among European XUL communities 
organized by &lt;a title=&quot;Paul Rouget&quot; href=&quot;http://blog.mozbox.org/&quot; id=&quot;et8s&quot;&gt;Paul Rouget&lt;/a&gt;...
&lt;br/&gt;&lt;br/&gt;
I had the opportunity to include JavaScript, DOM Scripting, JavaScript Frameworks (jQuery and ExtJS) and 
&lt;a title=&quot;Mozilla as Platform Intro&quot; href=&quot;http://labs.alcacoop.it/doku.php?id=projects:learning:mozillaplatform_intro&quot;&gt;Mozilla Extension Development&lt;/a&gt; in a local Master Course...
&lt;br/&gt;&lt;br/&gt;
... And negotiations are well underway for a 50-hour course on &quot;JavaScript, the Open Web and 
Firefox as Development Tool&quot; in a secondary school.
&lt;br/&gt;&lt;br/&gt;
... and now?
&lt;br&gt;&lt;br&gt;
Now it's time for &lt;a title=&quot;the first Italian MAOW&quot; href=&quot;https://wiki.mozilla.org/MAOW:2009:Firenze&quot;&gt;the first Italian MAOW&lt;/a&gt; (Mozilla Add Ons Workshop) in Florence!!!
&lt;br&gt;&lt;br&gt;
This month, in the afternoon of Saturday 27th, thanks to &lt;a title=&quot;Mozilla Europe&quot; href=&quot;http://www.mozilla-europe.org/&quot;&gt;Mozilla Europe&lt;/a&gt;, &lt;a title=&quot;Mozilla Italia&quot; href=&quot;http://www.mozillaitalia.it/&quot;&gt;Mozilla Italia&lt;/a&gt; and the &lt;a title=&quot;XULit&quot; href=&quot;http://xulit.org&quot;&gt;XULit community&lt;/a&gt; (of which I'm part), there will be four hours packed with content and hand-on activity for aspiring Firefox Developers.&amp;nbsp; Have a look at the &lt;a title=&quot;MAOW page&quot; href=&quot;https://wiki.mozilla.org/MAOW:2009:Firenze&quot;&gt;MAOW agenda&lt;/a&gt;.
&lt;br&gt;&lt;br&gt;
We hope this will be a way for other young developers in Italy to approach this powerful&amp;nbsp; platform and
community effortlessly, and that it will be just the first of a series of Italian Mozilla Hacking days.
&lt;br&gt;&lt;br&gt;
Oh, and remember to &lt;a title=&quot;register&quot; href=&quot;http://events.mozilla-europe.org/event/?id=9&quot;&gt;register&lt;/a&gt;,
so we can make sure everybody has a comfortable seat. ;) We're looking forward to seeing you in Florence!
&lt;br&gt;&lt;br&gt;

</content>
 </entry>
 
 <entry>
   <title>Reintroducing Javascript</title>
   <link href="http://ubik.cc/2009/05/reintroducing_javascript.html"/>
   <updated>2009-05-26T00:00:00+02:00</updated>
   <id>http://ubik.cc/2009/05/reintroducing_javascript</id>
   <content type="html">&lt;p&gt;When I&amp;#8217;ve started 2 years ago to re-learn javascript myself my goals was to change &lt;br /&gt;
the old and wrong vision of the javascript programming language, take advantage &lt;br /&gt;
of the unlimited possibilities of the &amp;#8220;Programmable Web&amp;#8221; and learn how to use &lt;br /&gt;
javascript as a self-defence weapon in this &lt;b&gt;not-so-open-yet web-world&lt;/b&gt; :-D&lt;/p&gt;
&lt;p&gt;Everyone with a strong programming background can start to re-learn javascript &lt;br /&gt;
himself in really no-time:&lt;br /&gt;
some papers and video of presentations on the Good and Bad Parts &lt;br /&gt;
(Thanks Crockford!!!) and a quick review of Javascript Reference&lt;br /&gt;
is definitely enough.&lt;/p&gt;
&lt;p&gt;Write and read more and more code to try yourself &lt;br /&gt;
bad and good parts, bad and good habits, useful tools and &lt;br /&gt;
develop your workspace and workflow, need&amp;#8217;s a little more time.&lt;/p&gt;
&lt;p&gt;Allright&amp;#8230; now I feel confortable working in this new javascript world,&lt;br /&gt;
but what do I have to do to help others to re-learn Javascript?&lt;/p&gt;
&lt;p&gt;In my first try I&amp;#8217;ve assembled a course outline as step by step&lt;br /&gt;
presentations of Javascript syntax, data types, control structures,&lt;br /&gt;
functions and objects with embedded notes on the &amp;#8220;bad parts&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;IMHO&lt;/span&gt; it worked well&amp;#8230; but not enough.&lt;/p&gt;
&lt;p&gt;After 4 days full of all this javascript concepts, &lt;br /&gt;
with good and bad parts mixed together remember exactly&lt;br /&gt;
&amp;#8220;what the good part was&amp;#8221; can be difficult&lt;/p&gt;
&lt;p&gt;Now I&amp;#8217;m thinking to refactor the course outline with:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;a shorter lesson with only good parts and good habits&lt;/li&gt;
	&lt;li&gt;a longer lesson with all the bad parts examples and how to avoid them&lt;/li&gt;
&lt;/ul&gt;</content>
 </entry>
 
 <entry>
   <title>Pre-processing Javascript with GPP</title>
   <link href="http://ubik.cc/2009/03/preprocessing-javascript.html"/>
   <updated>2009-03-13T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/03/preprocessing-javascript</id>
   <content type="html">&lt;p&gt;Today I was reading some new posts on Mozilla Education Planet and I notice someone is going to figure out how to pre-process javascript sources:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://johnhford.blogspot.com/2009/03/release-07.html&quot;&gt;http://johnhford.blogspot.com/2009/03/release-07.html&lt;/a&gt; :&lt;/p&gt;
&lt;pre&gt;
If this doesn’t work I am going to have to figure out 
how to pre-process javascript files.
&lt;/pre&gt;
&lt;p&gt;uhm&amp;#8230; I remember something&amp;#8230; I&amp;#8217;ve seen pre-processed javascript sources somewhere&amp;#8230; where?&lt;/p&gt;
&lt;p&gt;Finally I remembered I&amp;#8217;ve seen an interesting method to pre-process javascript sources with a &lt;br /&gt;
common and tested tool: &lt;a href=&quot;http://directory.fsf.org/project/gpp/&quot;&gt;gpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve seen this stuff after FOSDEM09 in the &lt;a href=&quot;http://croczilla.com/oni&quot;&gt;Oni&lt;/a&gt; sources, a javascript library/&lt;span class=&quot;caps&quot;&gt;DSL&lt;/span&gt;&lt;br /&gt;
for concurrent programming, developed by Alexander Fritze (&lt;a href=&quot;http://croczilla.com&quot;&gt;croczilla.com&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s see how Alex use gpp on javascript sources in the master Oni Mercurial repository:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://hg.mozilla.org/users/alex_croczilla.com/oni/file/fad93da44825/Makefile&quot;&gt;http://hg.mozilla.org/users/alex_croczilla.com/oni/file/fad93da44825/Makefile&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;http://hg.mozilla.org/users/alex_croczilla.com/oni/file/fad93da44825/oni.js.in&quot;&gt;http://hg.mozilla.org/users/alex_croczilla.com/oni/file/fad93da44825/oni.js.in&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;kudos to Alex ;-)&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Ubiquity say something to me</title>
   <link href="http://ubik.cc/2009/03/ubiquity-say-command.html"/>
   <updated>2009-03-04T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/03/ubiquity-say-command</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://labs.mozilla.com/projects/ubiquity/&quot;&gt;Mozilla Ubiquity&lt;/a&gt; 
is one of my favourite &lt;strong&gt;Mozilla Labs&lt;/strong&gt; projects, I love command line as
paradigm for user interaction so I like this 
Firefox extension a lot.&lt;/p&gt;

&lt;p&gt;Some weeks ago I added a command (a &lt;strong&gt;verb&lt;/strong&gt; in Ubiquity terminology)
to read for me any text fragment selected in my browser, I don't really need
a complex Text-to-Speech system... I only want a simple method to
run &lt;a href=&quot;http://espeak.sourceforge.net&quot;&gt;espeak&lt;/a&gt; with the
selected text as one of his parameters.&lt;/p&gt;

&lt;p&gt;How many lines of code it needed? Not so much :-)&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;CmdUtils&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;CreateCommand&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt; 
  &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;say&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;homepage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;http://ubik.cc/2009/03/ubiquity-say-command.html&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Luca Greco&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;luca.greco@alcacoop.it&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;license&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;GPL3&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;description&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;pronunce selected text with espeak&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;help&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;pronunce selected text with espeak&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;takes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;input&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;noun_arb_text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Components&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;@mozilla.org/file/local;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
                         &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Components&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;interfaces&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nsILocalFile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;initWithPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;/usr/bin/padsp&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;process&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Components&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;@mozilla.org/process/util;1&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
                            &lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Components&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;interfaces&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nsIProcess&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;init&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;espeak&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;-v&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;en&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;-s&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;100&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;-x&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;padsp&lt;/strong&gt; is a wrapper needed to redirect espeak
audio requests to the &lt;strong&gt;PulseAudio&lt;/strong&gt; daemon (the sound mixing daemon of
the GNOME desktop environment)&lt;/p&gt;

&lt;p&gt;MDC references:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en/Code_snippets/Running_applications&quot;&gt;https://developer.mozilla.org/en/Code_snippets/Running_applications&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en/NsIProcess&quot;&gt;https://developer.mozilla.org/en/NsIProcess&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple and Fun :-)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>A bit of Javascript in the new GNOME Shell</title>
   <link href="http://ubik.cc/2009/03/abit-of-javascript-in-new-gnomeshell.html"/>
   <updated>2009-03-02T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/03/gnome-shell</id>
   <content type="html">&lt;p&gt;Interesting stuffs are happening in the GNOME community underground...
Next-Generation &lt;strong&gt;GNOME Shell&lt;/strong&gt; is obviously a very interesting one :-D&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href='http://live.gnome.org/GnomeShell'&gt;http://live.gnome.org/GnomeShell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The new Gnome Shell is a prototype by now... but from a Developer POV
it's ready enough to give it a try and see what GNOME scripting
may be in the future.&lt;/p&gt;

&lt;p&gt;The most interesting thing I noticed after a rapid reading of the project
general vision, is the complete Javascript binding of the GNOME environment:&lt;/p&gt;

&lt;p&gt;&lt;i&gt;All desktop composition, workspace and window management will be
Javascript scriptable and Gtk application can be coded in Javascript from
head to tail.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;All this libraries bindings are not implemented by hand but
automated by a new &quot;introspection technology&quot; for GObject (&lt;a href='http://live.gnome.org/GObjectIntrospection'&gt;http://live.gnome.org/GObjectIntrospection&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;Build it now&lt;/h2&gt;

&lt;p&gt;Build tasks, automated by &lt;strong&gt;jhbuild&lt;/strong&gt;, are simple and work out of box in my
Ubuntu 8.10 laptop system, to minimize potential problems I recommend creation 
of a dedicated user (ex. &lt;strong&gt;gnomeng&lt;/strong&gt;) for building and testing execution commands.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;gnomeng@ubik:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;curl -O http://git.gnome.org/cgit/gnome-shell/&lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
                        plain/tools/build/gnome-shell-build-setup.sh
gnomeng@ubik:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;sh gnome-shell-build-setup.sh

&lt;span class=&quot;c&quot;&gt;### NOW YOU HAVE JHBUILD&lt;/span&gt;

gnomeng@ubik:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PATH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/bin:&lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;
gnomeng@ubik:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;jhbuild build
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You need various gnome/gtk/glib, cairo e xulrunner-1.9 &lt;strong&gt;**-dev packages&lt;/strong&gt; already installed in your
system and 165MB of free space.&lt;/p&gt;

&lt;h2&gt;Give it a try&lt;/h2&gt;

&lt;p&gt;If all building steps are completed without problems, in the &lt;strong&gt;gnome-shell&lt;/strong&gt; directory inside gnomeng home
there'll be an &lt;strong&gt;install&lt;/strong&gt; and a &lt;strong&gt;source&lt;/strong&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;install&lt;/strong&gt; contains gnome-shell compiled dependencies and resources&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;source&lt;/strong&gt; contains source checkouts from git repositories&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;gobject-introspection: gobject introspection tools&lt;/li&gt;
&lt;li&gt;gir-repository: repository of gboject interfaces&lt;/li&gt;
&lt;li&gt;gjs: GNOME Javascript Shell (based on spidermonkey)&lt;/li&gt;
&lt;li&gt;clutter: 3d interactive canvas library&lt;/li&gt;
&lt;li&gt;metacity-clutter: metacity window manager with clutter-based composition features&lt;/li&gt;
&lt;li&gt;gnome-shell: Javascript-scriptable replacement of gnome-desktop and gnome-panels&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;&lt;/p&gt;

&lt;p&gt;I tried to launch gnome-shell inside Xephyr as described in
live.gnome.org, but it don't works very well for me
(It's possible that my Xephyr version is not recent) so I tried to
launch it with --replace option from a gnome-session already started
and it worked... and worked very good :-D&lt;/p&gt;

&lt;h2&gt;Dissecting some javascript source file&lt;/h2&gt;

&lt;p&gt;All this stuffs are very interesting, this projects are very young
but can already run, so we can experiment
Javascript scripting of this new &lt;strong&gt;Desktop Composition
Engine&lt;/strong&gt; in the 20 minutes of a full build from sources.&lt;/p&gt;

&lt;p&gt;In the file &lt;strong&gt;gnome-shell/js/ui/windowManage.js&lt;/strong&gt;
we can see how all the windows and workspace events are hooked by
Javascript lambdas:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;switch-workspace&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;actors&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;get_switch_workspace_actors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_switchWorkspace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actors&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;kill-switch-workspace&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_switchWorkspaceDone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;minimize&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_minimizeWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;kill-minimize&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_minimizeWindowDone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_shellwm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;connect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;maximize&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ty&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;me&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_maximizeWindow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ty&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;tw&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Desktop Windows animations are configured in Javascript language
too, &lt;strong&gt;Tweener&lt;/strong&gt; is a port of an animation ActionScript library:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;Tweener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addTween&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                         &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scale_x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scale_x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;scale_y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;scale_y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;time&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;WINDOW_ANIMATION_TIME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;easeOutQuad&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onComplete&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_maximizeWindowDone&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onCompleteScope&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onCompleteParams&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onOverwrite&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_maximizeWindowOverwrite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onOverwriteScope&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                           &lt;span class=&quot;nx&quot;&gt;onOverwriteParams&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;actor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
                         &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Loading of external modules is done by reference properties of the
&lt;strong&gt;imports&lt;/strong&gt; global object:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;kr&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Clutter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;gi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Clutter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Lang&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Mainloop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;mainloop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Signals&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;signals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kr&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Tweener&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;imports&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;tweener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;tweener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;h2&gt;Gjs vs. Seed&lt;/h2&gt;

&lt;p&gt;Using &lt;strong&gt;gobject-introspection&lt;/strong&gt; GNOME guys have
already prototyped 2 different implementations of Javascript GNOME
environment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;a href=&quot;http://live.gnome.org/Gjs&quot;&gt;Gjs&lt;/a&gt; based on Mozilla Spidermonkey &lt;/li&gt;
&lt;li&gt; &lt;a href=&quot;http://live.gnome.org/Seed&quot;&gt;Seed&lt;/a&gt; based on Webkit JavascriptCore &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two different implementation in so short time... It's
good... &lt;strong&gt;gobject-introspection&lt;/strong&gt; proven to work. 
There's a lot of people interested in this topic... it's definitely
a hot topic :-P&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.grillbar.org/wordpress/?p=307&quot;&gt;http://www.grillbar.org/wordpress/?p=307&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://bitworking.org/news/396/Gnome-JavaScript-and-Gio&quot;&gt;http://bitworking.org/news/396/Gnome-JavaScript-and-Gio&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blogs.gnome.org/lucasr/category/gnome/javascript/&quot;&gt;http://blogs.gnome.org/lucasr/category/gnome/javascript/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://arstechnica.com/open-source/news/2009/01/javascript-gtk-bindings.ars&quot;&gt;http://arstechnica.com/open-source/news/2009/01/javascript-gtk-bindings.ars&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;I feel that GNOME and Mozilla could learn a lot each other:&lt;/p&gt;
&lt;p&gt;GNOME can learn from Mozilla the &lt;strong&gt;&quot;Javascript as an extension language&quot;&lt;/strong&gt;
lesson and Mozilla can learn &lt;strong&gt;&quot;deCORBAmination&quot;&lt;/strong&gt; one from GNOME.&lt;/p&gt;
&lt;p&gt;In the past years GNOME project &lt;strong&gt;deCORBAminated&lt;/strong&gt; its core and replaced it with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;DBUS&lt;/strong&gt; (to replace &quot;Services&quot; of the CORBA technology)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;gobject-introspection&lt;/strong&gt; (to replace &quot;Language Independent Bindings&quot; of the CORBA technology)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two lightweight solutions to replace a complex technologies:&lt;/p&gt;
&lt;p&gt;Mozilla &quot;deCOMtamination&quot; intentions aren't so different and a &quot;not so
different&quot; experience can be useful I think (something like
&lt;strong&gt;XPCOM&lt;/strong&gt; for services and 
&lt;strong&gt;JS-ctypes&lt;/strong&gt; for native libraries bindings):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.mozilla.org/Mozilla_2&quot;&gt;https://wiki.mozilla.org/Mozilla_2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.0xdeadbeef.com/weblog/?p=359&quot;&gt;http://www.0xdeadbeef.com/weblog/?p=359&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://wiki.mozilla.org/Embedding/NewApi&quot;&gt;https://wiki.mozilla.org/Embedding/NewApi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://starkravingfinkle.org/blog/2008/04/js-ctypes-status&quot;&gt;http://starkravingfinkle.org/blog/2008/04/js-ctypes-status&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the meantime Mozilla has a long time experience in
&lt;strong&gt;&quot;Javascript as extension language&quot;&lt;/strong&gt; and in Extension deployment
and automatic update... GNOME can learn a lot from past and future
direction of Mozilla in this complex topic.&lt;/p&gt;

&lt;p&gt;... and a last word on the new GNOME Shell prototype:
Could be GNOME the first Desktop to blur its edge with the Web?
It would be Great!!! isn' it? :-P&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Hello world!</title>
   <link href="http://ubik.cc/2009/03/helloworld.html"/>
   <updated>2009-03-01T00:00:00+01:00</updated>
   <id>http://ubik.cc/2009/03/helloworld</id>
   <content type="html">&lt;p&gt;This is the &quot;Hello world&quot; of this blog... ok... it's true... it isn't my
first blog but this is absolutely my first non-italian one!&lt;p/&gt;

&lt;p&gt;Posts in Italian language are not very accessible to the rest of
the world so I've started this little one to... &lt;strong&gt;join the conversation&lt;/strong&gt;
;-)&lt;/p&gt;

&lt;p&gt;... yes yes... yet another little and unuseful source of noise on the net.&lt;/p&gt;

&lt;p&gt;I know I read English better than I write (I know... this isn't English at all ;-))
but this is a further reason to start an English blog (from my POV :-P)&lt;/p&gt;

&lt;p&gt;As for all the other (programming) languages I've learned... I need
to read, to study and to write a lot of code :-)&lt;/p&gt;

&lt;p&gt;So I'm starting to write this blog now... and I'll
run &lt;strong&gt;make&lt;/strong&gt; to check if it could
run without errors or need some debug work&lt;/p&gt;

</content>
 </entry>
 
 
</feed>
