<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Eltit Golb</title>
	<atom:link href="http://roberto.open-lab.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://roberto.open-lab.com</link>
	<description>think upstream</description>
	<lastBuildDate>Tue, 14 May 2013 09:18:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='roberto.open-lab.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Eltit Golb</title>
		<link>http://roberto.open-lab.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://roberto.open-lab.com/osd.xml" title="Eltit Golb" />
	<atom:link rel='hub' href='http://roberto.open-lab.com/?pushpress=hub'/>
		<item>
		<title>jQuery Gantt editor – new release: include today</title>
		<link>http://roberto.open-lab.com/2013/01/28/jquery-gantt-editor-include-today/</link>
		<comments>http://roberto.open-lab.com/2013/01/28/jquery-gantt-editor-include-today/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 15:10:20 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://roberto.open-lab.com/?p=919</guid>
		<description><![CDATA[Online Demo Download Sources   We have just released a new version that implements a feature requested on this blog Now you can configure the Gantt editor to show always &#8220;today&#8221; even if not included in the project time-scope. Moreover we introduced two new methods: 1) Ganttalendar.centerOnToday(),  that scroll the Gantt graph to &#8220;today&#8221; 2) Ganttalendar.fitGantt(), [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=919&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td class="linkButton" align="center">
<h3><a title="Online Demo" href="http://gantt.twproject.com/" target="_blank">Online Demo</a></h3>
</td>
<td class="linkButton" align="center">
<h3><a title="Github project" href="https://github.com/robicch/jQueryGantt" target="_blank">Download Sources</a></h3>
</td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</tbody>
</table>
<p><a href="http://gantt.twproject.com/distrib/gantt.html"><img class="wp-image-888 alignnone" title="jQuery Gantt editor demo" alt="jQuery Gantt editor demo" src="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg?w=639&#038;h=383" width="639" height="383" /></a></p>
<p align="right"><a title="test Gantt editor" href="http://gantt.twproject.com/" target="_blank"> </a></p>
<p>We have just released a new version that implements a feature requested on this blog <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Now you can configure the Gantt editor to show always &#8220;today&#8221; even if not included in the project time-scope.</p>
<p>Moreover we introduced two new methods:</p>
<p>1) <strong>Ganttalendar.centerOnToday(), </strong> that scroll the Gantt graph to &#8220;today&#8221;</p>
<p>2) <strong>Ganttalendar.fitGantt(), </strong>that will find the best-fitting scale</p>
<p>&nbsp;</p>
<p>Enjoy this release, and let me know what you think about.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/919/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/919/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=919&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2013/01/28/jquery-gantt-editor-include-today/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg" medium="image">
			<media:title type="html">jQuery Gantt editor demo</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Gantt editor &#8211; bugfix: invalid project handling</title>
		<link>http://roberto.open-lab.com/2012/08/31/jquery-gantt-editor-bugfix-invalid-project-handling/</link>
		<comments>http://roberto.open-lab.com/2012/08/31/jquery-gantt-editor-bugfix-invalid-project-handling/#comments</comments>
		<pubDate>Fri, 31 Aug 2012 15:51:38 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gantt]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://roberto.open-lab.com/?p=900</guid>
		<description><![CDATA[Online Demo Download Sources   We worked on the strange behaviour when loading a project with invalid data/structure  and we released a new version Bug fixed: if project loading fails for invalid/incomplete data, you loose the control of the  application you can restrict parent changing duration even if not allowed by constraints: e.g.: a larger [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=900&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td class="linkButton" align="center">
<h3><a title="Online Demo" href="http://gantt.twproject.com/" target="_blank">Online Demo</a></h3>
</td>
<td class="linkButton" align="center">
<h3><a title="Github project" href="https://github.com/robicch/jQueryGantt" target="_blank">Download Sources</a></h3>
</td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</tbody>
</table>
<p><a href="http://gantt.twproject.com/distrib/gantt.html"><img class="wp-image-888 alignnone" title="jQuery Gantt editor demo" src="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg?w=639&#038;h=383" alt="jQuery Gantt editor demo" width="639" height="383" /></a></p>
<p align="right"><a title="test Gantt editor" href="http://gantt.twproject.com/" target="_blank"> </a></p>
<p>We worked on the strange behaviour when loading a project with invalid data/structure  and we released a new version</p>
<p>Bug fixed:</p>
<ol>
<li>if project loading fails for invalid/incomplete data, you loose the control of the  application</li>
<li>you can restrict parent changing duration even if not allowed by constraints: e.g.: a larger child</li>
</ol>
<p>Improvement:</p>
<ol>
<li>better snap-to-grid moving tasks</li>
<li>better feedback if project loading fails</li>
</ol>
<p style="text-align:left;" align="right">
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/900/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/900/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=900&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/08/31/jquery-gantt-editor-bugfix-invalid-project-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg" medium="image">
			<media:title type="html">jQuery Gantt editor demo</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Gantt editor &#8211; bugfix released</title>
		<link>http://roberto.open-lab.com/2012/08/30/jquery-gantt-editor-bugfix-released/</link>
		<comments>http://roberto.open-lab.com/2012/08/30/jquery-gantt-editor-bugfix-released/#comments</comments>
		<pubDate>Thu, 30 Aug 2012 15:49:37 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gantt]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://roberto.open-lab.com/?p=887</guid>
		<description><![CDATA[Online Demo Download Sources &#160; After few days of &#8220;massive debugging&#8221; we released an upgraded version of jQuery Gantt editor (try it) Bugs fixed: an ugly bug when using the editor with a western time-zone: GMT-n (e.g: USA, Canada, South America etc.). an invalid message call when a circular reference was created that force  js [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=887&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td align="center" class="linkButton">
<h3><a title="Online Demo" href="http://gantt.twproject.com/" target="_blank">Online Demo</a></h3>
</td>
<td align="center" class="linkButton">
<h3><a title="Github project" href="https://github.com/robicch/jQueryGantt" target="_blank">Download Sources</a></h3>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</tbody>
</table>
<p>After few days of &#8220;massive debugging&#8221; we released an upgraded version of jQuery Gantt editor</p>
<p><a href="http://gantt.twproject.com/distrib/gantt.html"><img class="size-full wp-image-888 alignnone" title="jQuery Gantt editor demo" src="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg?w=600" alt="jQuery Gantt editor demo"   /></a></p>
<p align="right"><a title="test Gantt editor" href="http://gantt.twproject.com/" target="_blank">(try it)</a></p>
<p style="text-align:left;" align="right">Bugs fixed:</p>
<ol>
<li>an ugly bug when using the editor with a western time-zone: GMT-<em>n</em> (e.g: USA, Canada, South America etc.).</li>
<li>an invalid message call when a circular reference was created that force  js execution to stop</li>
<li>no detection for avoiding a parent depending on its descendant</li>
</ol>
<p>New feature:</p>
<ol>
<li>dependencies now supports lags: you can specify a dependency in the form of &#8220;7:3&#8243; that means the task will start after three days task &#8220;7&#8243; is completed</li>
</ol>
<p style="text-align:left;" align="right">I&#8217;ve upgraded the component documentation: <a href="http://roberto.open-lab.com/2012/08/24/jquery-gantt-editor/">http://roberto.open-lab.com/2012/08/24/jquery-gantt-editor/</a></p>
<p style="text-align:left;" align="right">Try the demo here <a href="http://gantt.twproject.com/">http://gantt.twproject.com/</a></p>
<p style="text-align:left;" align="right">Feedback welcome!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/887/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/887/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=887&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/08/30/jquery-gantt-editor-bugfix-released/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/screen071.jpg" medium="image">
			<media:title type="html">jQuery Gantt editor demo</media:title>
		</media:content>
	</item>
		<item>
		<title>jQuery Gantt editor</title>
		<link>http://roberto.open-lab.com/2012/08/24/jquery-gantt-editor/</link>
		<comments>http://roberto.open-lab.com/2012/08/24/jquery-gantt-editor/#comments</comments>
		<pubDate>Fri, 24 Aug 2012 08:48:07 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[Gantt]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[LGPL]]></category>
		<category><![CDATA[MIT]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=834</guid>
		<description><![CDATA[Online Demo Download Sources &#160; As promised in my last post, here I will try to explain how to use our jQuery Gantt editor, how it works and how to customize it for your needs. (try it) First let me list its key features: jQuery based MIT licensed: you can reuse it everywhere json import-export [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=834&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<table width="100%">
<tbody>
<tr>
<td align="center" class="linkButton">
<h3><a title="Online Demo" href="http://gantt.twproject.com/" target="_blank">Online Demo</a></h3>
</td>
<td align="center" class="linkButton">
<h3><a title="Github project" href="https://github.com/robicch/jQueryGantt" target="_blank">Download Sources</a></h3>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</tbody>
</table>
<p>As promised in <a href="http://roberto.open-lab.com/2012/06/14/the-javascript-gantt-odyssey/" target="_blank">my last post</a>, here I will try to explain how to use our jQuery Gantt editor, how it works and how to customize it for your needs.</p>
<p><a href="http://gantt.twproject.com" target="_blank"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/08/image1.png?w=596&#038;h=358" alt="image" width="596" height="358" border="0" /></a></p>
<p align="right"><span style="font-size:xx-small;"><a title="test Gantt editor" href="http://gantt.twproject.com/" target="_blank">(try it)</a></span></p>
<p>First let me list its key features:</p>
<ul>
<li>jQuery based</li>
<li>MIT licensed: you can reuse it everywhere</li>
<li>json import-export</li>
<li>internationalizable</li>
<li>manage task statuses –&gt; sort of workflow handling</li>
<li>manage dependecies</li>
<li>manage assignements (resources, roles, efforts)</li>
<li>server synchronization ready</li>
<li>full undo-redo support</li>
<li>cross browser (at least for recent versions)</li>
</ul>
<p>Source codes are available on GitHub here: <a href="https://github.com/robicch/jQueryGantt">https://github.com/robicch/jQueryGantt</a></p>
<p>In order to better understand this component I will introduce some concepts below.</p>
<h1></h1>
<h1>Genesis</h1>
<p>This editor has been created mainly as part of our <a href="http://twproject.com" target="_blank">project management solution, Teamwork</a>.</p>
<p>During the development we always kept in mind creating an open-source reusable “component”, while the focus was integration with Teamwork. This constraint gave us the opportunity to extend the standard Gantt behaviour by introducing key features like task’s statuses, or time buffers for parent tasks.</p>
<p>This is not the right place to discuss how these features make project modelling and management more flexible and closer to the real world: if you want go deeper have a look at <a href="http://www.twproject.com/documentation.page" target="_blank">Teamwork user guide</a>.</p>
<p>If  Teamwork’s model influenced the behavior of the editor, the environment where Teamwork lives (Java Jsp Html5  jQuery internationalized server side multi-db cross-operating-system etc.) influenced the packaging and the libraries of our editor; this is the reason for so many dependencies.</p>
<p>Despite this facts, our Gantt editor can be easily customized and extended as Javascript component.</p>
<h1>Main concepts</h1>
<p>While a Gantt viewer (hence read-only) can be easily packed as a single component, a Gantt editor is a way more  complicated object; so I prefer to think of it as jQuery application and not just as a plugin.</p>
<p>Actually our Gantt editor is composed by three main sub parts/editors: the grid editor on the left, the Gantt editor on the right, and the detailed task editor in popup; actually the popup editor is used also for resources and assignments.</p>
<p>The goal of our editor is to generate a json file representing the full project state that could be sent to a server to store it. During editing there is no interaction with the server.</p>
<p>The distributed version uses local storage to save the project status, but examples of server calls are available in the source code.</p>
<h1>How to use it</h1>
<p>Download the component source code <a title="jQueryGantt sources" href="https://github.com/robicch/jQueryGantt/zipball/master" target="_blank">here</a>, unzip the file: the “gantt.html” is already a working Gantt editor. If you open “gantt.html” with your preferred html editor: the source contains some comments so it should be readable <img class="wlEmoticon wlEmoticon-smile" style="border-style:none;" src="http://rbicchierai.files.wordpress.com/2012/08/wlemoticon-smile.png?w=600" alt="Smile" /> .</p>
<p>To play with the code use Firefox with Firebug plugin installed or Chrome (as I do).</p>
<p>In the code first we defined a global variable for accessing the editor, called “ge”.</p>
<p>In your browser try to change something on the gantt and then from your js debugger execute</p>
<blockquote><p>ge.saveProject()</p></blockquote>
<p>This method returns the project in form of a json object. In the demo page we use local storage for saving the project (or a textarea if local storage is not available), but in a real environment you probably will need to send data to a server. I left a commented code for ajax communication with the server.</p>
<p>In order to load a project you must obviously supply a json object in the same format that has been saved on the server:</p>
<blockquote><p>ge.loadProject( <em>[yourJsonProject] </em>)</p></blockquote>
<p>The same json object can be used both ways: load or save, and in consequence client-to-server or server-to-client.</p>
<h1>Project data structure</h1>
<p>This is a project json object structure:</p>
<blockquote><p>{<br />
tasks:[…]<br />
resources: […]<br />
roles: […]<br />
… more<br />
}</p></blockquote>
<p>here  tasks, resources and roles are arrays.</p>
<p>As it easy to guess, the “tasks” array contains a list of task in the Gantt, and this is the most relevant data to manage.</p>
<p>“Resources” and “roles” will be easy to understand by looking first to a task element in the “tasks” array:</p>
<blockquote><p>{<br />
&#8220;id&#8221;:&#8221;tmp_fk1345562123031&#8243;,<br />
&#8220;name&#8221;:&#8221;approval&#8221;,<br />
&#8220;code&#8221;:&#8221;APP&#8221;,<br />
&#8220;level&#8221;:2,<br />
&#8220;status&#8221;:&#8221;STATUS_SUSPENDED&#8221;,<br />
&#8220;start&#8221;:1348696800000,<br />
&#8220;duration&#8221;:10,<br />
&#8220;end&#8221;:1349906399999,<br />
&#8220;startIsMilestone&#8221;:false,<br />
&#8220;endIsMilestone&#8221;:false,<br />
&#8220;assigs&#8221;:[…],<br />
&#8220;depends&#8221;:&#8221;7:3,8&#8243;,<br />
&#8220;description&#8221;:&#8221;Approval of testing&#8221;,<br />
&#8220;progress&#8221;:20<br />
}</p></blockquote>
<p>First important consideration: the order of tasks in the array is the same of the editor. The index of the array is used as reference for dependencies.</p>
<p>Attributes like name, code and description require no explanation, but some do:</p>
<ul>
<li><strong>id</strong>: used to synch data with the server. If the id is supplied by the server it will untouched. Tasks created client side will acquire a temporary id starting with  “tmp_”</li>
<li><strong>level</strong>: it is the depth (the indentation) of a task in the Gantt structure. The root task is at level 0 (zero), its children at level 1 (one) and so on. Levels must be consistent with the project structure: you can&#8217;t have a task of level <em>n+1</em> if you don’t have a task of level <em>n </em>above on the array</li>
<li><strong>start, end</strong>: are expressed in milliseconds. “start” is set to the first millisecond of the day, “end” is set to the last millisecond of the day.</li>
<li><strong>duration</strong>: is always in working days. If there are holidays on the calendar (see below for  holydays configuration) the end date will take it into account. Actually the end date is always recomputed using “start” and “duration”, and it is supplied for comfort  <img class="wlEmoticon wlEmoticon-smile" style="border-style:none;" src="http://rbicchierai.files.wordpress.com/2012/08/wlemoticon-smile.png?w=600" alt="Smile" /></li>
<li><strong>startIsMilestone, endIsMilestone</strong>: booleans. Once set to true, task&#8217; start/end can’t move accidentally. You always can change dates directly on the task, but not by acting on children or predecessors.</li>
<li><strong>depends</strong>: a string comma delimited containing indexes of tasks on which this task depends. Multiple dependencies are supported. Only the <a title="Project dependencies types" href="http://en.wikipedia.org/wiki/Dependency_(project_management)" target="_blank">finish-to-start</a> dependency type is supported (other types can be workarounded by introducing intermediary brother tasks or children). It is possible to specify a &#8220;lag&#8221; in days by using a &#8220;:&#8221;. E.g.: 7:3,8 means that the task will start 3 days after task 7 is completed and task 8 is completed.</li>
<li><strong>status</strong>: this is a string representing the status of the task. Allowed statuses are: STATUS_ACTIVE, STATUS_DONE, STATUS_FAILED, STATUS_SUSPENDED, STATUS_UNDEFINED. As stated before, task statuses allow to use your project like a sort of workflow: e.g.: if “task b” depends on “task a”, “task b” will remain in “STATUS_SUSPENDED” until “task a” will pass from “STATUS_ACTIVE” to “STATUS_DONE”. For the complete status transition rules see below.</li>
<li><strong>progress</strong>: a number that specifies progress: 0%  none 50% half way and so on. For Teamwork in some case 123% can be a meaningful value for progress, so there are no constraints.</li>
<li><strong>assigs</strong>: array of  assignment. Each assignment has the following structure:<br />
<blockquote><p>{<br />
&#8220;resourceId&#8221;:&#8221;tmp_1&#8243;,<br />
&#8220;id&#8221;:&#8221;tmp_1345560373990&#8243;,<br />
&#8220;roleId&#8221;:&#8221;tmp_1&#8243;,<br />
&#8220;effort&#8221;:36000000<br />
}</p></blockquote>
</li>
</ul>
<p>mainly assignments are structured for carrying server-side  data:</p>
<ul>
<li><strong>resourceId</strong>: is the unique id for the resource. Refers to the “resources” array</li>
<li><strong>id</strong>: is the unique identifier of this assignment</li>
<li><strong>roleId</strong>: is the unique identifier of this assignment. Refers to the “roles” array</li>
<li><strong>effort</strong>: is the estimated effort in milliseconds</li>
</ul>
<p>The “resources” array contains elements in the following form:</p>
<blockquote><p>{<br />
&#8220;id&#8221;:&#8221;tmp_1&#8243;,<br />
&#8220;name&#8221;:&#8221;Resource 1&#8243;<br />
}</p></blockquote>
<p>The “roles”  array contains elements in the following form:</p>
<blockquote><p>{<br />
&#8220;id&#8221;:&#8221;tmp_1&#8243;,<br />
&#8220;name&#8221;:&#8221;Project Manager&#8221;<br />
}</p></blockquote>
<p>You must remember that this editor is the client part of something that manages persistence, alerts, interaction with other systems server-side; so we have to handle a few more attributes:</p>
<blockquote><p>deletedTaskIds:[…]<br />
selectedRow: 7<br />
canWrite: true<br />
canWriteOnParent: true<br />
minEditableDate:1349906300000<br />
maxEditableDate:3499063999999</p></blockquote>
<p>where</p>
<ul>
<li><strong>deletedTaskIds:</strong> is an array containing the ids of the tasks removed client side. Only tasks with a “real” id will be notified to the server (so not those starting with “tmp_”), locally generated ones will be removed silently.</li>
<li><strong>selectedRow</strong>: is the line currently in edit</li>
<li><strong>canWrite</strong>: is a boolean stating if you have permission to write/change/create/delete tasks on this project or not. Set it to true for a basic usage.</li>
<li><strong>canWriteOnParent</strong>: this is a little bit obscure. It is used in case you are editing only a small part of a complex project. For instance  you are a PM of  sub-task but not of the top-project: maybe some changes you made on dates may affect the top-project schedule.<br />
Setting this boolean to false you will stop propagation to top project/s. Set it to true for a basic usage.</li>
<li><strong>minEditableDate, maxEditableDate</strong>: are the boundaries used in case you can’t  write on parent</li>
</ul>
<p>Here is an example a the project json object:</p>
<pre class="brush: jscript; gutter: false; title: ; notranslate">
{
    &quot;tasks&quot;:[
      {
        &quot;id&quot;:&quot;tmp_fk1345624806538&quot;,
        &quot;name&quot;:&quot;Gantt editor &quot;,
        &quot;code&quot;:&quot;&quot;,
        &quot;level&quot;:0,
        &quot;status&quot;:&quot;STATUS_ACTIVE&quot;,
        &quot;start&quot;:1346623200000,
        &quot;duration&quot;:5,
        &quot;end&quot;:1347055199999,
        &quot;startIsMilestone&quot;:false,
        &quot;endIsMilestone&quot;:false,
        &quot;assigs&quot;:[
          {
            &quot;resourceId&quot;:&quot;tmp_3&quot;,
            &quot;id&quot;:&quot;tmp_1345625008213&quot;,
            &quot;roleId&quot;:&quot;tmp_1&quot;,
            &quot;effort&quot;:7200000
          }
        ],
        &quot;depends&quot;:&quot;&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;progress&quot;:0
      },
      {
        &quot;id&quot;:&quot;tmp_fk1345624806539&quot;,
        &quot;name&quot;:&quot;phase 1&quot;,
        &quot;code&quot;:&quot;&quot;,
        &quot;level&quot;:1,
        &quot;status&quot;:&quot;STATUS_ACTIVE&quot;,
        &quot;start&quot;:1346623200000,
        &quot;duration&quot;:2,
        &quot;end&quot;:1346795999999,
        &quot;startIsMilestone&quot;:false,
        &quot;endIsMilestone&quot;:false,
        &quot;assigs&quot;:[
          {
            &quot;resourceId&quot;:&quot;tmp_1&quot;,
            &quot;id&quot;:&quot;tmp_1345624980735&quot;,
            &quot;roleId&quot;:&quot;tmp_1&quot;,
            &quot;effort&quot;:36000000
          }
        ],
        &quot;depends&quot;:&quot;&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;progress&quot;:0
      },
      {
        &quot;id&quot;:&quot;tmp_fk1345624789530&quot;,
        &quot;name&quot;:&quot;phase 2&quot;,
        &quot;code&quot;:&quot;&quot;,
        &quot;level&quot;:1,
        &quot;status&quot;:&quot;STATUS_SUSPENDED&quot;,
        &quot;start&quot;:1346796000000,
        &quot;duration&quot;:3,
        &quot;end&quot;:1347055199999,
        &quot;startIsMilestone&quot;:false,
        &quot;endIsMilestone&quot;:false,
        &quot;assigs&quot;:[
          {
            &quot;resourceId&quot;:&quot;tmp_2&quot;,
            &quot;id&quot;:&quot;tmp_1345624993405&quot;,
            &quot;roleId&quot;:&quot;tmp_2&quot;,
            &quot;effort&quot;:36000000
          }
        ],
        &quot;depends&quot;:&quot;2&quot;,
        &quot;description&quot;:&quot;&quot;,
        &quot;progress&quot;:0
      }
    ],
    &quot;resources&quot;:[
      {
        &quot;id&quot;:&quot;tmp_1&quot;,
        &quot;name&quot;:&quot;Resource 1&quot;
      },
      {
        &quot;id&quot;:&quot;tmp_2&quot;,
        &quot;name&quot;:&quot;Resource 2&quot;
      },
      {
        &quot;id&quot;:&quot;tmp_3&quot;,
        &quot;name&quot;:&quot;Resource 3&quot;
      }
    ],&quot;roles&quot;:[
    {
      &quot;id&quot;:&quot;tmp_1&quot;,
      &quot;name&quot;:&quot;Project Manager&quot;
    },
    {
      &quot;id&quot;:&quot;tmp_2&quot;,
      &quot;name&quot;:&quot;Worker&quot;
    }
  ],
    &quot;canWrite&quot;:true,
    &quot;canWriteOnParent&quot;:true,
    &quot;selectedRow&quot;:0,
    &quot;deletedTaskIds&quot;:[],
  }
</pre>
<h1>Status transition rules (aka project workflow)</h1>
<p>Task statuses are a key feature of Teamwork, and our Gantt editor supports them in full.</p>
<p>Use the <a href="http://gantt.twproject.com/" target="_blank">demo</a> page and try to close some tasks (change status to “completed”); you will see how dependent tasks/children will change their status according to the following rules:</p>
<ul>
<li><strong><em>any status</em>-&gt; STATUS_DONE</strong>:  may activate dependent tasks, both suspended and undefined. Will set to done all descendants.</li>
<li><strong>STATUS_FAILED -&gt; STATUS_DONE</strong>:  do nothing if not forced by hand.</li>
<li><strong>STATUS_UNDEFINED -&gt; STATUS_ACTIVE: </strong>all children become active, if they have no dependencies.</li>
<li><strong>STATUS_SUSPENDED -&gt; STATUS_ACTIVE :</strong> sets to active all children and their descendants that have no inhibiting dependencies.</li>
<li><strong>STATUS_DONE -&gt; STATUS_ACTIVE: </strong>all those that have dependencies must be set to suspended.</li>
<li><strong>STATUS_FAILED -&gt; STATUS_ACTIVE: </strong>nothing happens: child statuses must be reset by hand.</li>
<li><strong><strong><em>any status</em></strong>-&gt; STATUS_SUSPENDED</strong>: all active children and their active descendants become suspended. when not failed or forced</li>
<li><strong><strong><em>any status</em></strong>-&gt; STATUS_UNDEFINED</strong>: all active children and their active descendants become suspended. when not failed or forced.</li>
<li><strong><strong><em>any status</em></strong>-&gt; STATUS_FAILED</strong>: children and dependants are set to failed.</li>
</ul>
<h1>A basic minimal implementation</h1>
<p>The demo example is quite simple and commented, it should the right point to start.</p>
<p>Here I’ll sum-up what you&#8217;ll need to use our Gantt editor in your application:</p>
<p>first include javascript dependencies</p>
<pre class="brush: xml; gutter: false; title: ; notranslate">
&lt;script src=&quot;/jquery/1.7/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/jquery-ui.min.js&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;libs/jquery.livequery.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/jquery.timers.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/platform.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/date.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/i18nJs.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/dateField/jquery.dateField.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;libs/JST/jquery.JST.js&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;ganttUtilities.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;ganttTask.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;ganttDrawer.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;ganttGridEditor.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;ganttMaster.js&quot;&gt;&lt;/script&gt;
</pre>
<p>then some css</p>
<pre class="brush: xml; gutter: false; title: ; notranslate">
 &lt;link rel=stylesheet href=&quot;platform.css&quot; type=&quot;text/css&quot;&gt;
 &lt;link rel=stylesheet href=&quot;libs/dateField/jquery.dateField.css&quot; type=&quot;text/css&quot;&gt;
 &lt;link rel=stylesheet href=&quot;gantt.css&quot; type=&quot;text/css&quot;&gt;
</pre>
<p>then you need a div where to place the editor, something like:</p>
<pre class="brush: xml; gutter: false; title: ; notranslate">
&lt;div id=&quot;workSpace&quot; style=&quot;padding:0px; overflow-y:auto; overflow-x:hidden; border:1px solid #e5e5e5; position:relative; margin:0 5px; width:1024px; height:800px;&quot;&gt;&lt;/div&gt;
</pre>
<p>now create the Gant editor and bind it to your div</p>
<pre class="brush: jscript; gutter: false; title: ; notranslate">
var ge = new GanttMaster();
ge.init($(&quot;#workSpace&quot;));
</pre>
<p>your editor its ready to use.</p>
<h2></h2>
<p>If you want to know how our Gantt editor works, go in depth by reading next chapter…</p>
<h2></h2>
<h1>How it is built</h1>
<p>Environment first!</p>
<h2>Libraries</h2>
<p>Our Gantt editor is based on <a href="http://jquery.com/" target="_blank">jQuery</a> and use some <a href="http://jqueryui.com/" target="_blank">jQuery UI</a> components like draggable, sortable etc.</p>
<p>Other jQuery related libraries are used here like <a href="http://docs.jquery.com/Plugins/livequery" target="_blank">livequery</a> and <a href="http://archive.plugins.jquery.com/project/timers" target="_blank">timers</a>.</p>
<p>For data selection I used one of  my components (I have not yet published it but I will&#8230;; anyway its included here):</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/08/image2.png"><img style="background-image:none;margin:0;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/08/image_thumb.png?w=213&#038;h=184" alt="image" width="213" height="184" border="0" /></a><a href="http://rbicchierai.files.wordpress.com/2012/08/image3.png"><img style="background-image:none;margin:0;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/08/image_thumb1.png?w=214&#038;h=184" alt="image" width="214" height="184" border="0" /></a></p>
<p>It supports date shortcuts like “t” (today), “y” (yesterday), “lm” (last month), “lq” (last quarter), “-4w” (4 week ago)  and so on. See files on “/libs/dateField” folder for details. This component is MIT licensed so use it!</p>
<p>Another key component is a javascript template library called “JST” that I wrote some years ago and discussed in a <a href="http://roberto.open-lab.com/2010/09/14/easy-going-javascript-templates/" target="_blank">previous post “Easy going JavaScript templates”</a>.</p>
<p>It is used for creating editor side rows and Gantt task elements. The library is in “/libs/JST” folder; it is very powerful and I used it in several products.</p>
<p>Our Gantt editor uses extensively date computation and formatting.</p>
<p>I used <a href="http://javascripttoolbox.com/lib/date/" target="_blank">Matt Kruse’s date library</a> with some extensions for managing holidays in date computation and with some changes for more comprehensive support of Java date formats and internationalization.</p>
<p>Our Gantt editor supports internationalization, but only English is implemented. Have a look at “/libs/i18n.js” file. Here you will find all the internationalization defaults, including the definition of a sample holidays calendar.</p>
<p>The last library used is “/libs/platform.js” that is a sort of toolbox for input validation, feedback management, extension of js objects (String, Array, Date) for cross-browser compatibility and other tricks.</p>
<p>I’m not very proud of this library and I cleaned it up many times with the secret hope to remove it completely, but it is very tightly linked to our “historic” development environment; if I had to fork the Gantt from our platform it would become difficult to maintain.</p>
<h2>Core objects</h2>
<p>We have now arrived at the application&#8217;s core.</p>
<p>We divided the editor in three parts:</p>
<ol>
<li>the <strong>GridEditor</strong> object that manages the left part of the editor. Data editing is managed here.</li>
<li>the <strong>Ganttalendar</strong> (sorry for the ugly name!) object that manages the right part of the editor with Gantt drawing, calendar scale, task date movement</li>
<li>the <strong>GantMaster</strong> object that is responsible for the coordination of both sides, transactional management, event management and persistence.<br />
Your code should “talk” only with this object.</li>
</ol>
<p>These objects are in the gridEditor.js, gantDrawer.js and gantMaster.js files respectively.</p>
<p>The entities managed are: <strong>Task</strong>, <strong>Link</strong>, <strong>Resource</strong>, <strong>Role</strong>, <strong>Assignment</strong>, and are defined in ganttTask.js file.</p>
<h2>Events</h2>
<p>Once the Gantt Editor has been initialized</p>
<blockquote><p>var ge = new GanttMaster();<br />
ge.init($(&#8220;#workSpace&#8221;));</p></blockquote>
<p>it binds some events on the DOM object, in this case the DIV “workspace”.</p>
<p>Events bound are:</p>
<ul>
<li><strong>refreshTasks.gantt</strong>: perform a redraw of all tasks</li>
<li><strong>refreshTask.gantt</strong>: accepts a task as parameter. Redraw the passed task:</li>
<li><strong>deleteCurrentTask.gantt</strong>: delete the current selected task</li>
<li><strong>addAboveCurrentTask.gantt</strong>: add a task above the current ones. The task inserted will be a brother of the current one</li>
<li><strong>addBelowCurrentTask.gantt</strong>: add a task below the current ones. The task inserted will be a child of the current one</li>
<li><strong>indentCurrentTask.gantt</strong>: the current task will become a child of the task above</li>
<li><strong>outdentCurrentTask.gantt</strong>: the current task will become a brother of the task above</li>
<li><strong>moveUpCurrentTask.gantt</strong>: the current task (and its own children) will be moved up</li>
<li><strong>moveDownCurrentTask.gantt</strong>: the current task (and its own children) will be moved down</li>
<li><strong>zoomPlus.gantt</strong>: restrict  the time scale of the Gantt side (more detail)</li>
<li><strong>zoomMinus.gantt</strong>: enlarge the time scale of the Gantt side (less detail)</li>
<li><strong>undo.gantt</strong>: undo the last actions performed</li>
<li><strong>redo.gantt</strong>: redo last actions</li>
</ul>
<p>A basic usage for triggering an event will look like:</p>
<blockquote><p>$(&#8216;#workSpace&#8217;).trigger(&#8216;zoomMinus.gantt&#8217;);</p></blockquote>
<p>When you perform an action in the project tree, the action could propagate along the tree. There are many constraints that must be respected like milestones, statuses, dependencies, boundaries and so on. Every constrain could make it impossible to complete the operation so we decided to wrap tree operations with a  “transaction”; in case of constraint violation we rollback all the changes already done.</p>
<p>Events are transaction-safe, so you don&#8217;t need to worry about them.</p>
<h2>Methods</h2>
<p>The GanttMaster object exposes some useful methods you may need for your application.</p>
<p>Be careful: unlike events, methods exposed are “low-level”, so you are responsible for managing transactions correctly; transactions are not managed unless otherwise specified.</p>
<p>Here is a list of most important methods:</p>
<h3>init (jQueryDomObject)</h3>
<p><strong>description</strong>: creates the Gantt editor, initializes project arrays, binds events.</p>
<p><em>jQueryDomObject</em>: is a jQuery proxy for a DOM object tipically a &lt;div&gt; where you want to create the Gantt editor</p>
<p><strong>return</strong>: nothing</p>
<h3>createTask (id, name, code, level, start, duration)</h3>
<p><strong>description</strong>: creates a Task object. The task created is not added to project, just created</p>
<p><em>id</em>: task id<br />
<em>name</em>: task name<br />
<em>code</em>: task code<br />
<em>level</em>: task indentation level. Root task is 0 (zero)<br />
<em>start</em>: the task start date in millisecond<br />
<em>duration</em>: task duration in days</p>
<p><strong>return</strong>: the task created</p>
<h3>createResource (id, name)</h3>
<p><strong>description</strong>: creates a Resource object. The resource created is not added to resource list, just created</p>
<p><em>id</em>: resource id<br />
<em>name</em>: resource name</p>
<p><strong>return</strong>: the resource created</p>
<h3>addTask (task, row)</h3>
<p><strong>description</strong>: adds a task to the project at the specified row</p>
<p><em>task</em>: a Task object<br />
<em>row</em>: row where to add the object, zero based</p>
<p><strong>return</strong>: the task added</p>
<h3>loadProject(project)</h3>
<p><strong>description</strong>: loads a project on the editor. This method is transaction safe.</p>
<p><em>project</em>: a project in json format as above defined in “Project Data Format” section.</p>
<p><strong>return</strong>: nothing</p>
<h3>saveProject()</h3>
<p><strong>description</strong>: gets the project in json format as above defined in “Project Data Format” section</p>
<p><strong>return</strong>: the json object</p>
<h3>loadTasks(tasks,row)</h3>
<p><strong>description</strong>: adds tasks to the current project from the specified row on</p>
<p><em>tasks</em>: an array of Task object<br />
<em>row</em>: row where to start adding tasks, zero based</p>
<p><strong>return</strong>: nothing</p>
<h3>getTask(taskId)</h3>
<p><strong>description</strong>: retrieves a task by id</p>
<p><em>tasksId</em>: the id of the task you want</p>
<p><strong>return</strong>: a Task object</p>
<h3>getResource(resourceId)</h3>
<p><strong>description</strong>: retrieves a resource by id</p>
<p><em>respurceId</em>: the id of the resource you want</p>
<p><strong>return</strong>: a Resource object</p>
<h2></h2>
<h3>changeTaskDates (task, start, end)</h3>
<p><strong>description</strong>: changes scheduling for a task in the project</p>
<p><em>task</em>: task you want to change<br />
<em>start</em>: the task start date in millisecond<br />
<em>end</em>: task end in milliseconds</p>
<p><strong>return</strong>: <em>true</em> if changing was performed, <em>false</em> if changes required are invalid. Error codes are set on current transaction.</p>
<h3>moveTask (task,newStart)</h3>
<p><strong>description</strong>: moves a task to a new starting date</p>
<p><em>task</em>: task you want to move<br />
<em>start</em>: the task start date in millisecond</p>
<p><strong>return</strong>: <em>true</em> if changing was performed, <em>false</em> if changes required are invalid. Error codes are set on current transaction.</p>
<h3>updateLinks(task)</h3>
<p><strong>description</strong>: updates project link structure as defined in “task.depends” property</p>
<p><em>task</em>: task you want to change</p>
<p><strong>return</strong>: <em>true</em> if changing was performed, <em>false</em> if changes required are invalid. Error codes are set on current transaction.</p>
<h3>taskIsChanged ()</h3>
<p><strong>description</strong>: notifies GanttMaster that a task has been changed and enqueues a request for redrawing both sides. Redraw is executed asynchronously and only once after 50 milliseconds</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>redraw()</h3>
<p><strong>description</strong>: redraw both sides. Redraw is executed immediately</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>reset()</h3>
<p><strong>description</strong>: starts a new project and empties both sides</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>showTaskEditor(taskId)</h3>
<p><strong>desciption</strong>: shows the complete task editor in popup</p>
<p><em>taskId</em>: the id of the task you want to edit</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>undo()</h3>
<p><strong>description</strong>: undoes the last operation performed. There is no limit to the number of operations (the limit is just the memory of your browser)</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>redo()</h3>
<p><strong>description</strong>: redoes last operation undo-ed</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>beginTransaction()</h3>
<p><strong>description</strong>: saves the current state of the project in memory. Transactions cannot be nested</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h3>endTransaction()</h3>
<p><strong>description</strong>: closes the current transaction by making changes performed active. If there are errors set on the transaction, it rollbacks to previous state</p>
<p><strong>return</strong>: <em>true </em>in case of  successful commit<em>, false </em>if a rollback was performed</p>
<h3>setErrorOnTransaction(errorMessage, task))</h3>
<p><strong>description</strong>: sets an error message related to a Task object in the current transaction. If no transaction is started the message is displayed on console instead.</p>
<p><em>errorMessage</em>: a string containing the error message</p>
<p><em>task</em>: the Task object that generates the error</p>
<p><strong>return</strong>: <em>nothing</em></p>
<h1>Customization</h1>
<p>The Gantt editor uses CSS so you can play customizing your Gantt editor look-and-feel.</p>
<p>Regarding internationalization, the question is a little bit complicated. As I’ve already said, actually only the English version is available.</p>
<p>The file “libs/i18n.js” is used for managing generic language/country specific data.  There you can change the values for month names, day names, currency format, date format and some default message strings. Actually in our real environment (<a href="http://twproject.com" target="_blank">Teamwork</a>) this file is server-side generated in base of user&#8217;s language settings.</p>
<p>In the same file you can/must change the implementation of the method isHoliday(date) that is used for taking care of  working days. The current implementation supports both fixed holydays (like Christmas) and mobile ones (like Easter), but you can refine the implementation for your needs.</p>
<p>Gantt specific string are set on GanttMaster.messages object, and by default its values are in English: you can implement you own language.</p>
<h1>Recycling</h1>
<p>There are lots of “tools” that can be reused; here is a list of some that I think may save a lot of time to developers:</p>
<p><strong>JST</strong>: a javascript templating system, see here <a href="http://roberto.open-lab.com/2010/09/14/easy-going-javascript-templates/" target="_blank">previous post “Easy going JavaScript templates”</a>, but the version in Gantt is the updated ones (read until my last comment in the post linked!)</p>
<p><strong>DateField</strong>: a jQuery calendar input component. No frills!</p>
<p><strong>Date/Time</strong>: lots of functions that support multiple formats, relative dates, shortcuts etc. The changes from <a href="http://javascripttoolbox.com/lib/date/" target="_blank">Matt Kruse’s date library</a> should be really useful for Java developers, and in general my version is a little bit more complete, even if the original its great by itself!</p>
<p><strong>Gridify</strong>: a jQuery component that transforms a &lt;table&gt; making columns resizable. See it at work on the left side of Gantt editor</p>
<p><strong>Splittify</strong>: a jQuery component that creates a splitter in a specified dom element. Used for splitting the editor from the Gantt part</p>
<p><strong>Transaction, undo-redo</strong>:  the idea and the implementation is very basic, so it can be used in many contexts</p>
<p><strong>Profiler</strong>: a helpful tool for monitoring your javascript code performance</p>
<p><strong>Field validation</strong>: validation function for email, url, date, time, integer, double, currency etc.</p>
<p>Everything is MIT!</p>
<p>I’m not sure if anyone can be interested on this stuff so for the moment that’s all, but in case someone is interested I’ll be pleased to publish a new post about them.</p>
<p>Every feedback will be really appreciated.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/834/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/834/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=834&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/08/24/jquery-gantt-editor/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/image1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/08/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>The JavaScript Gantt odyssey</title>
		<link>http://roberto.open-lab.com/2012/06/14/the-javascript-gantt-odyssey/</link>
		<comments>http://roberto.open-lab.com/2012/06/14/the-javascript-gantt-odyssey/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 08:00:56 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[Gantt]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[LGPL]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=822</guid>
		<description><![CDATA[An “extended” overview of available JavaScript Gantt components…. and more &#160; I cant believe it; I did it again! I promised, but can’t resist……. I should have known it! &#160; But let&#8217; start from the beginning. O course all of you know very well (at least you should!) Teamwork, the wonderful project management software that [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=822&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>An “extended” overview of available JavaScript Gantt components…. and more</h1>
<p>&nbsp;</p>
<p><em><strong>I cant believe it; I did it again!</strong> </em></p>
<p><em>I promised, but can’t resist……. I should have known it!</em></p>
<p>&nbsp;</p>
<p>But let&#8217; start from the beginning.</p>
<p>O course all of you know very well (at least you should!) <a href="http://twproject.com" target="_blank">Teamwork</a>, the <strong>wonderful</strong> project management software that <a href="http://www.open-lab.com" target="_blank">Open Lab</a> is developing since 2003, which is about to celebrate its fifth major release; finally I can confirm that we will be out at the end of June.</p>
<p>One of the major new features for version 5  is a full Gantt editor, browser based.</p>
<p>I was in charge to select a JavaScript component that we could embed in our product – in order to save time.</p>
<p>So this post is firstly a selection of available components, but …….. read until the end.<br />
<a href="#ourSolution"><span style="font-size:xx-small;">(no thanks! I’m in a hurry)</span></a></p>
<p>&nbsp;</p>
<p>My ideal component should be based on  jQuery, be LGPL (or an equivalent free-free license), be easy to configure, skinnable, multi-browser.</p>
<p>Unlike in my previous articles, when I was looking for <a href="http://roberto.open-lab.com/2010/01/30/javascript-grid-editor-i-want-to-be-excel/" target="_blank">grid components</a>, <a href="http://roberto.open-lab.com/2010/02/10/a-delicious-javascript-tagging-input-field/" target="_blank">tag inputs</a>,  <a href="http://roberto.open-lab.com/2010/04/06/ultra-light-jquery-calendar/" target="_blank">calendar</a>, <a href="http://roberto.open-lab.com/2010/09/14/easy-going-javascript-templates/" target="_blank">JavaScript templates</a>,  <a href="http://roberto.open-lab.com/2012/01/26/easy-to-confirm/" target="_blank">confirm</a> etc., for Gantt editors the market offers few opportunities.</p>
<p>&nbsp;</p>
<p>Here is what I found:</p>
<p>&nbsp;</p>
<p><a href="http://dhtmlx.com/docs/products/dhtmlxGantt/index.shtml" target="_blank">DHX Editable JavaScript Gantt Chart</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image.png"><img style="background-image:none;margin:0 5px 0 0;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb.png?w=600&#038;h=458" alt="image" width="600" height="458" border="0" /></a></p>
<p>This component is very easy to use, simple and well documented.</p>
<p>It supports drag&amp;drop and edit.</p>
<p>In my case the problem was that this component is tightly linked with the DHTMLX library and this is not my choice.</p>
<p>But if you are not already “linked” to a “framework” (like jQuery) maybe this could be your choice.</p>
<p>Regarding licensing, its both under GPL or commercial license. A fee of $699 for an enterprise license may be worth it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.bryntum.com/products/gantt/" target="_blank">Brynthum EXT Gantt</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb1.png?w=609&#038;h=272" alt="image" width="609" height="272" border="0" /></a></p>
<p>I think this is the best component I found ever.</p>
<p>The user interface is smooth, responsive and well designed. It supports editing in place, zooming, buffering for large Gantt (what could be the meaning of a project with 1000 tasks? <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style:none;" src="http://rbicchierai.files.wordpress.com/2012/06/wlemoticon-winkingsmile.png?w=600" alt="Winking smile" /> ) drag&amp;drop etc.</p>
<p>The documentation is well done and complete…… sigh! it is based on <a href="http://www.sencha.com/products/extjs" target="_blank">EXTJs</a>!</p>
<p>The second negative point is the licensing that doesn’t fit our needs. Only a commercial license is provided.</p>
<p>But if this component fits you, give it a try as it is a great component.</p>
<p>&nbsp;</p>
<p>A little sad about leaving EXT gannt, I found</p>
<p><a href="http://www.jsgantt.com/" target="_blank">jsGantt</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb2.png?w=601&#038;h=225" alt="image" width="601" height="225" border="0" /></a></p>
<p>this component developed by <a name="tCredits"></a>Shlomy Gantz and Brian Twidt seems a little bit “rude” when compared with the two above, but undoubtedly it has the value of  being built from scratch. No libraries! 100% sweat of the brow!</p>
<p>This component is written for data display, so if you want to drag&amp;drop, edit, interact in some way, you must to write your code.</p>
<p>Documentation is…. concise, but complete.  The license model is BSD.</p>
<p>The lack of the editing ability convinced me to pass over.</p>
<p>&nbsp;</p>
<p><a href="https://github.com/thegrubbsian/jquery.ganttView" target="_blank">jquery.ganttView</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb3.png?w=608&#038;h=321" alt="image" width="608" height="321" border="0" /></a></p>
<p>Finally a jQuery one!</p>
<p>As the name suggests it is only a viewer. Even the data model is a little weak, missing support for dependencies, but is one of the few components I found built upon jQuery. The project seems to be dying and the author Frank Grubbs did not release updates since 2 years ago.</p>
<p>There is an interesting work started from this project <a href="http://mbielanczuk.com/2011/06/jquery-gantt-chart/">http://mbielanczuk.com/2011/06/jquery-gantt-chart/</a></p>
<p>but it still lacks some features.</p>
<p>&nbsp;</p>
<p>I was scraping the bottom of the barrel, when I found this Japanese component</p>
<p><a href="http://www.maro-z.com/examples/jquery.gantt/" target="_blank">jquery.gantt</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image4.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb4.png?w=596&#038;h=145" alt="image" width="596" height="145" border="0" /></a></p>
<p>Done by Maro, this is a very light Gantt viewer; it doesn’t support dependencies, editing or other advanced features, but it can be used as a starting point.</p>
<p>&nbsp;</p>
<p>I was really desperate at this point! What I was looking for was something like the component used on</p>
<p><a href="http://gantter.com/" target="_blank">Gantter</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb5.png?w=596&#038;h=335" alt="image" width="596" height="335" border="0" /></a></p>
<p>Gantter is an online service, so not a part of this family of components, but I used it to set my requirements.</p>
<p>They don’t sell their component.</p>
<p>&nbsp;</p>
<p>But searching for something similar I found interesting stuff in the far east:</p>
<p><em><a href="http://www.51diaodu.cn/" target="_blank">Sunflower 向日葵任务甘特图</a> </em></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image6.png"><img style="background-image:none;margin:0;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb6.png?w=590&#038;h=358" alt="image" width="590" height="358" border="0" /></a></p>
<p>If you are fluent with Chinese, maybe you’ll find working with this component easier than I did.</p>
<p>But Chinese apart this is a really full featured component, and I work with it for a while. It supports editing, drag&amp;drop, dependencies, zooming, etc.</p>
<p>I didn’t understand the license type very well, but a free version seems available.</p>
<p>Documentation is available in Chinese only, and Google Translate can help you only partially.</p>
<p>It doesn’t use jQuery.</p>
<p>&nbsp;</p>
<p>What I found really incredible is how Sunflower component is similar to the one used by the above online service…</p>
<p>&nbsp;</p>
<p>And last but not least I found</p>
<p>&nbsp;</p>
<p><a href="http://www.tgantt.com/treegrid/www/Gantt.html" target="_blank">TreeGrid Gantt Char</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image7.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb7.png?w=566&#038;h=313" alt="image" width="566" height="313" border="0" /></a></p>
<p>This component is awesome! really! it can do everything.</p>
<p>Supports every kind of  actions, notation, dependencies, colors, really everything.</p>
<p>There are lots of examples and the online documentation is complete and effective.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image8.png"><img style="background-image:none;margin:0 4px 0 0;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb8.png?w=346&#038;h=260" alt="image" width="346" height="260" align="left" border="0" /></a>Maybe someone can argue that the readability of this kind of Gantt is not ideal, but the component can be used in a simpler way.</p>
<p>Scalability is not an issue at all for this component, there is an example with 1000000 rows and 1000 columns!</p>
<p>Also compatibility is wider than any marketer requirement could ever be (runs even on IE6).</p>
<p>&nbsp;</p>
<p>Ok it is not based on jQuery, and the commercial license cannot fit every wallet, but a component like this requires years for developing it.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://dojotoolkit.org/reference-guide/1.7/dojox/gantt.html">dojox.gantt</a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image9.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb9.png?w=574&#038;h=270" alt="image" width="574" height="270" border="0" /></a></p>
<p>I have to cite the dojo library for completeness, but I didn’t play with this component.</p>
<p>Seems quite complete and the documentation is well done. Based on <a href="http://dojotoolkit.org/" target="_blank">Dojo</a>, not on jQuery.</p>
<p>&nbsp;</p>
<h1>Our solution</h1>
<p><a name="ourSolution"></a>If you reached this point maybe you are asking what component did I choose?</p>
<p>I told you at the beginning:</p>
<p>&nbsp;</p>
<p><strong>I did it again!</strong></p>
<p><strong>I developed my own component!</strong></p>
<p>&nbsp;</p>
<p>Why?</p>
<ol>
<li>because none of the component mentioned above is LGPL/MIT</li>
<li>none is built in jQuery</li>
<li>I need to actively manage the data model because a Teamwork task/project’ one is more flexible than one representable with a Gantt</li>
</ol>
<p>but mainly because I love to write code!</p>
<p>In this case the work seemed really hard so I  worked in pair with <a href="http://bornineightytwo.com/" target="_blank">Silvia</a>, and this is actually a nice experience by itself!</p>
<p>&nbsp;</p>
<p><a href="http://gantt.twproject.com/" target="_blank">Here</a>’s the result of our efforts:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image10.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb10.png?w=590&#038;h=367" alt="image" width="590" height="367" border="0" /></a></p>
<p>Even if the layout is clean and may seem barebones it actually supports a lot of features:</p>
<ul>
<li>in-place editing <a href="http://rbicchierai.files.wordpress.com/2012/06/image11.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb11.png?w=324&#038;h=137" alt="image" width="324" height="137" align="right" border="0" /></a></li>
<li>drag&amp;drop</li>
<li>zooming</li>
<li>do/undo</li>
<li>multiple dependencies</li>
<li>full editing</li>
<li>dates shortcuts <a href="http://rbicchierai.files.wordpress.com/2012/06/image12.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb12.png?w=244&#038;h=114" alt="image" width="244" height="114" align="right" border="0" /></a></li>
<li>css skin</li>
<li>multiple browser</li>
<li>resources editing</li>
<li>multiple assignment</li>
<li>milestones</li>
<li>export data in JSON format</li>
<li>resize &amp; scroll</li>
</ul>
<p>and</p>
<ul>
<li><strong>tasks status!</strong></li>
</ul>
<p>the last point is the mayor difference introduced in <a href="http://www.twproject.com/" target="_blank">Teamwork task management</a>  model.</p>
<p>Teamwork focus is capturing work done in real time. To do this we built a tool that can model real time situations and easily change in time. This is in contrast with traditional project management methodology where projects are defined in advance in all details – not realistic for most work situations.<br />
So Teamwork’s model of project, task trees, dates and task states is different from that of classical Gantts: tasks can be open beyond their due dates, task can be suspended inside their time scope, and so on. Also the automation due to dependencies has been somewhat simplified with respect to classical Gantt tools.</p>
<p>&nbsp;</p>
<p>The introduction of task’s states lets our Gantt act as a sort of workflow.  Let’s see what happens when you close a phase with dependencies:</p>
<p>here the first phase is open (second row: green-&gt; open)</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image13.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb13.png?w=649&#038;h=275" alt="image" width="649" height="275" border="0" /></a></p>
<p>&nbsp;</p>
<p>here I closed the first phase (all subtasks become blue-&gt;closed : rows 3 and 4 ) so the second phase can start and become green-&gt;open and its dependants become orange-&gt;suspended<a href="http://rbicchierai.files.wordpress.com/2012/06/image14.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb14.png?w=647&#038;h=256" alt="image" width="647" height="256" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image15.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb15.png?w=422&#038;h=263" alt="image" width="422" height="263" align="left" border="0" /></a> This is the task full editor</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://rbicchierai.files.wordpress.com/2012/06/image16.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2012/06/image_thumb16.png?w=423&#038;h=264" alt="image" width="423" height="264" align="left" border="0" /></a></p>
<p>and the resource quick editor</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>You can try our component online here on <a href="http://gantt.twproject.com/">http://gantt.twproject.com/</a></p>
<p>Source code is available on GitHub <a href="https://github.com/robicch/jQueryGantt">here</a>. This component is release under MIT license.</p>
<p>&nbsp;</p>
<p>In the next post I’ll describe in detail how to use the component code, stay tuned.</p>
<p>&nbsp;</p>
<p>The complete link collection for this article is in a Licorize booklet: <a href="http://licorize.com/projects/rbicchierai/JS-Gantt-editor">http://licorize.com/projects/rbicchierai/JS-Gantt-editor</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/822/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=822&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/06/14/the-javascript-gantt-odyssey/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/wlemoticon-winkingsmile.png" medium="image">
			<media:title type="html">Winking smile</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/06/image_thumb16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Easy to confirm!</title>
		<link>http://roberto.open-lab.com/2012/01/26/easy-to-confirm/</link>
		<comments>http://roberto.open-lab.com/2012/01/26/easy-to-confirm/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 11:00:46 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=759</guid>
		<description><![CDATA[A jQuery confirm plugin &#160; I’m re-writing some components for our&#160; world-wide selling Teamwork, and I was in the need to have a nicer way to confirm some “dangerous” user actions. The standard JavaScript solution is something like &#160; While the code is very simple, the popup alert is unfashionable and old-smelling. The best solution [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=759&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>A jQuery confirm plugin</h1>
<p>&#160;</p>
<p>I’m re-writing some components for our&#160; world-wide selling <a href="http://twproject.com" target="_blank">Teamwork</a>, and I was in the need to have a nicer way to confirm some “dangerous” user actions.</p>
<p>The standard JavaScript solution is something like</p>
<pre class="brush: jscript; title: ; notranslate">
if (confirm(“do you want to destroy everything?”)) 
  … &lt;em&gt;here the code for destroying&lt;/em&gt; 
</pre>
<p>&#160;</p>
<p>While the code is very simple, the popup alert is unfashionable and old-smelling.</p>
<p>The best solution I found is the <a href="http://nadiana.com/jquery-confirm-plugin" target="_blank">Nadia Alramli’s jQuery confirm plugin</a> that I have already used massively in <a href="http://licorize.com" target="_blank">Licorize</a>.</p>
<p>The first great idea in the Nadia’s plugin is that the confirm question is shown exactly where you clicked for the action.</p>
<p>The second idea is that the “confirm” is just “applied after” your code behavior.</p>
<p>Let se the simplest example (from <a href="http://nadiana.com/jquery-confirm-plugin" target="_blank">Nadias’ blog</a>):</p>
<pre class="brush: jscript; title: ; notranslate">
// The action.
$('a').click(function() {
  alert('click');
  return false;
});
 
// The most simple use.
$('a').confirm();
</pre>
<p>&#160;</p>
<p>As you can see, first you bind the event normally, then you will apply the confirm.</p>
<p>This approach is very nice, but its is very “javascript oriented”; what I mean is that you need a js piece of code for setting up the confirm, and this is a little bit rigid for an inline usage.</p>
<p>Example:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;button onclick=”destroyAll()”&gt;
</pre>
<p>&#160;</p>
<p>where “destroyAll” is your function.</p>
<p>&#160;</p>
<p>So I wrote this little jQuery plugin that can be used like this:</p>
<pre class="brush: jscript; title: ; notranslate">&lt;button onclick=”$(this).confirm(destroyAll)&gt;</pre>
<p>Here the code:</p>
<pre class="brush: jscript; title: ; notranslate">
 $.fn.confirm = function(action, message) {
    if (typeof(action) != &quot;function&quot;)
      return;
    this.each(function() {
      var el = $(this);
      var div = $(&quot;&lt;div&gt;&quot;).addClass(&quot;confirmBox&quot;).
              html(message ? message : i18n.DO_YOU_CONFIRM);
      div.css({&quot;min-width&quot;:el.outerWidth(),&quot;min-height&quot;:el.outerHeight()});
      div.oneTime(5000, &quot;autoHide&quot;, function() {
        $(this).fadeOut(100, function() {
          el.show();
          $(this).remove();
        });
      });
      var no = $(&quot;&lt;span&gt;&quot;).addClass(&quot;confirmNo&quot;)
              .html(i18n.NO).click(function() {
        $(this).parent().fadeOut(100, function() {
          el.show();
          $(this).remove();
        }).stopTime(&quot;autoHide&quot;);
      });
      var yes = $(&quot;&lt;span&gt;&quot;).addClass(&quot;confirmYes&quot;)
              .html(i18n.YES).click(function() {
        $(this).parent().fadeOut(100, function() {
          el.show().oneTime(1, &quot;doaction&quot;, action);
          $(this).remove();
        }).stopTime(&quot;autoHide&quot;);
      });

      div.append(&quot;&amp;nbsp;&amp;nbsp;&quot;)
              .append(yes)
              .append(&quot;&amp;nbsp;/&amp;nbsp;&quot;)
              .append(no);
      el.hide().after(div);

    });

    return this;
  };
</pre>
<p>few lines of CSS for the sake of completeness:</p>
<pre class="brush: css; title: ; notranslate">
.confirmBox{
    display:inline-block;
    z-index:10000;
    vertical-align:middle;
    text-align:center;
    font-size:larger;
    font-style:italic;
    color:#a0a0a0;
  }
  .confirmBox .confirmNo{
    color:#e06060;
    cursor:pointer;
    font-weight:bolder;
  }
  .confirmBox .confirmYes{
  color:#60e060;
  cursor:pointer;
    font-weight:bolder;
  }</pre>
<p>and two lines for internationalization:</p>
<pre class="brush: jscript; title: ; notranslate">
var i18n = {
    YES:&quot;Yes&quot;,
    NO:&quot;No&quot;,
    DO_YOU_CONFIRM:&quot;Do you confirm?&quot;
  };
</pre>
<p>&#160;</p>
<p>See a <a href="http://s3.amazonaws.com/OLtmp/bicch/confirm/testConfirm.html" target="_blank">Demo page here</a></p>
<p>This component is released under MIT license.</p>
<p>Your feedback will be appreciated.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/759/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/759/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=759&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/01/26/easy-to-confirm/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>
	</item>
		<item>
		<title>To JSON or not to JSON</title>
		<link>http://roberto.open-lab.com/2012/01/18/to-json-or-not-to-json/</link>
		<comments>http://roberto.open-lab.com/2012/01/18/to-json-or-not-to-json/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 10:29:30 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=746</guid>
		<description><![CDATA[How to simply convert a sqlite database to JSON Last week my collegue Matteo (aka pupunzi) was porting an iPad application (booo!) to HTML5 (yeah!). The iPad application was a virtual museum that was using a sqlite dabatase for reading data relative to rooms, biography, history and so on. Even if sqlite is internally supported [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=746&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<h1>How to simply convert a sqlite database to JSON</h1>
<p>Last week my collegue Matteo (aka <a href="http://pupunzi.com/" target="_blank">pupunzi</a>) was porting an iPad application (booo!) to HTML5 (yeah!).</p>
<p>The iPad application was a virtual museum that was using a sqlite dabatase for reading data relative to rooms, biography, history and so on.</p>
<p>Even if sqlite is internally supported by some browsers (e.g. Chrome) the easiest way to read data in javascript is to have a JSON object.</p>
<p>I wrote a simple java code to dump the whole database into a JSON object.</p>
<blockquote>
<pre style="font-size:12px;line-height:18px;">
import net.sf.json.JSONObject;
import net.sf.json.JSONArray;
import java.sql.*;
import java.util.List;
import java.util.ArrayList;
import java.io.FileOutputStream;
public class DB2JSON {

  public static void main(String[] args) {

    if (args.length&lt;1)
      return;
    Connection conn = null;

    try {
      String dbFile = args[0];
      JSONObject ret = new JSONObject();
      Class.forName(&quot;org.sqlite.JDBC&quot;);
      conn = DriverManager.getConnection(&quot;jdbc:sqlite:&quot; + dbFile);
      Statement stat = conn.createStatement();

      ResultSet tables = stat.executeQuery(&quot;SELECT name 
         FROM sqlite_master 
         WHERE type=&#039;table&#039; ORDER BY name;&quot;);
      List tableNames = new ArrayList();
      while (tables.next()) {
        tableNames.add(tables.getString("name"));
      }
      tables.close();

      for (String tableName : tableNames) {
        JSONArray jsa = new JSONArray();

        ResultSet rows = stat.executeQuery("select * from " + 
           tableName + ";");

        while (rows.next()) {
          JSONObject row = new JSONObject();
          ResultSetMetaData meta = rows.getMetaData();
          for (int i = 1; i &lt;= meta.getColumnCount(); i++) {
            row.element(meta.getColumnName(i), rows.getObject(i));
          }
          jsa.add(row);
        }

        rows.close();
        ret.element(tableName, jsa);
      }

      conn.close();

      // result on console
      System.out.println(ret.toString());

      //result on file
      FileOutputStream fos = new FileOutputStream(dbFile+&quot;.json&quot;);
      fos.write(ret.toString().getBytes());
      fos.close();     

    } catch (Throwable e) {
      try {
        if (conn != null)
          conn.close();
      } catch (SQLException s) {
      }
      e.printStackTrace();
    }
  }
}
</pre>
</blockquote>
<p>The resulting JSON object will have a property for each table containing an array of records. Different types of properties are supported (String, int, long, dates etc.)</p>
<p>There are two dependencies to external libraries:</p>
<ol>
<li> <a href="http://json-lib.sourceforge.net/">http://json-lib.sourceforge.net/</a></li>
<li><a href="http://www.zentus.com/sqlitejdbc/">http://www.zentus.com/sqlitejdbc/</a></li>
</ol>
<p>Enjoy.</p>
<p>P.S.: the pupunzi’s porting result is an HTML5 application that runs everywhere and it is looks even more beautiful than the iOS one <img class="wlEmoticon wlEmoticon-smile" style="border-style:none;" src="http://rbicchierai.files.wordpress.com/2012/01/wlemoticon-smile.png?w=600" alt="Smile" /> !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/746/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=746&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2012/01/18/to-json-or-not-to-json/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2012/01/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>
	</item>
		<item>
		<title>How to destroy an evil presence and live better</title>
		<link>http://roberto.open-lab.com/2011/11/11/how-to-destroy-an-evil-presence-and-live-better/</link>
		<comments>http://roberto.open-lab.com/2011/11/11/how-to-destroy-an-evil-presence-and-live-better/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 22:37:02 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[cooking]]></category>
		<category><![CDATA[my life]]></category>
		<category><![CDATA[chocolate]]></category>
		<category><![CDATA[food]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=730</guid>
		<description><![CDATA[&#160; Yesterday while I was biking my dog&#160; across Cascine park in Florence mumbling about a new product idea, my eyes was attracted by some strange orange points in the autumnal yellow carpets. I got off the bike to have a closer look. WOW! there was thousand of alkekengi fruits on the ground. Alkekengi (Physalis [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=730&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>&#160;</p>
<p>Yesterday while I was biking my dog&#160; across Cascine park in Florence mumbling about a new product idea, my eyes was attracted by some strange orange points in the autumnal yellow carpets. I got off the bike to have a closer look. WOW! there was thousand of alkekengi fruits on the ground.</p>
<p>Alkekengi <a href="http://en.wikipedia.org/wiki/Physalis_alkekengi" target="_blank">(Physalis alkekengi L.)</a> is a plant from the same family of tomatoes, it is&#160; invasive and an alien specimen in Italy, it is something negative!</p>
<p>Let me explain how to “eradicate” this evil presence:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0576.jpg"></a></p>
<p>1) pick-up some dozens of alkekengi fruits with their orange “lanterns”</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_05761.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0576" border="0" alt="20111106-IMG_0576" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0576_thumb.jpg?w=484&#038;h=324" width="484" height="324" /></a> </p>
<p>&#160;</p>
<p>2) pop the lanterns and get the balls “naked”, but without removing the ”leaves”</p>
</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0590.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0590" border="0" alt="20111106-IMG_0590" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0590_thumb.jpg?w=244&#038;h=184" width="244" height="184" /></a> <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0594.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0594" border="0" alt="20111106-IMG_0594" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0594_thumb.jpg?w=244&#038;h=184" width="244" height="184" /></a>&#160; <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0595.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0595" border="0" alt="20111106-IMG_0595" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0595_thumb.jpg?w=244&#038;h=184" width="244" height="184" /></a>&#160;<a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0593.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0593" border="0" alt="20111106-IMG_0593" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0593_thumb.jpg?w=244&#038;h=184" width="244" height="184" /></a> </p>
</p>
</p>
</p>
</p>
<p>3) prepare a “bain marie” for dark chocolate. If you don’t have the right pot you can stack a metal bowl on a boiling water pot</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0586.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0586" border="0" alt="20111106-IMG_0586" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0586_thumb.jpg?w=243&#038;h=362" width="243" height="362" /></a> <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0587.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0587" border="0" alt="20111106-IMG_0587" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0587_thumb.jpg?w=242&#038;h=361" width="242" height="361" /></a> </p>
</p>
<p>3) when chocolate melts, start dipping alkekengi balls one at a time.    <br />Use folded leaves for holding them</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0596.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0596" border="0" alt="20111106-IMG_0596" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0596_thumb.jpg?w=244&#038;h=191" width="244" height="191" /></a> <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0597.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0597" border="0" alt="20111106-IMG_0597" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0597_thumb.jpg?w=244&#038;h=191" width="244" height="191" /></a></p>
<p>&#160;</p>
<p>4) then place the hot ball on a baking paper sheet to let them cooling down</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0599.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0599" border="0" alt="20111106-IMG_0599" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0599_thumb.jpg?w=496&#038;h=248" width="496" height="248" /></a> </p>
<p>&#160;</p>
<p>5) in the meanwhile get some hot chilies (I used real small ones that decide to happily colonize a lemon vase), smash them in a mortar and then add them to hot chocolate. Stir to amalgamate.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0600.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0600" border="0" alt="20111106-IMG_0600" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0600_thumb.jpg?w=165&#038;h=141" width="165" height="141" /></a> <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0601.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0601" border="0" alt="20111106-IMG_0601" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0601_thumb.jpg?w=165&#038;h=141" width="165" height="141" /></a> <a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0602.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0602" border="0" alt="20111106-IMG_0602" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0602_thumb.jpg?w=164&#038;h=140" width="164" height="140" /></a> </p>
<p>&#160;</p>
<p>6) now you are ready for the last chocolate passage. </p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0604.jpg"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="20111106-IMG_0604" border="0" alt="20111106-IMG_0604" src="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0604_thumb.jpg?w=502&#038;h=249" width="502" height="249" /></a> </p>
<p>&#160;</p>
<p>7) let chocolate solidify and eventually repeat last passage. </p>
<p>&#160;</p>
<p>The chilled dark chocolate is in perfect balance with the sour flavor of alkekengi.</p>
<p><strong>Now&#160; you are ready to destroy this evil presence!</strong> </p>
<p>&#160;</p>
<p>P.S.: I forgot for the rest of the week-end the fu$#£!…. idea on the new product. </p>
<p><strong>Power of chocolate.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/730/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/730/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=730&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2011/11/11/how-to-destroy-an-evil-presence-and-live-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0576_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0576</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0590_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0590</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0594_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0594</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0595_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0595</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0593_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0593</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0586_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0586</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0587_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0587</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0596_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0596</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0597_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0597</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0599_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0599</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0600_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0600</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0601_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0601</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0602_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0602</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/11/20111106img_0604_thumb.jpg" medium="image">
			<media:title type="html">20111106-IMG_0604</media:title>
		</media:content>
	</item>
		<item>
		<title>Tassellate: playing on CANVAS</title>
		<link>http://roberto.open-lab.com/2011/02/10/tassellate-canvas/</link>
		<comments>http://roberto.open-lab.com/2011/02/10/tassellate-canvas/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 15:08:36 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=693</guid>
		<description><![CDATA[I’ve enjoyed so much playing on HTML5 &#60;CANVAS&#62; that now I cannot stop… (test demo here) Now I’m playing on a component that I’d like to use as replacement for the current “weekly review” game on Licorize. If you are wondering about a “game” on a GTD operation like “weekly review”, have a look at [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=693&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I’ve enjoyed so much playing on HTML5 &lt;CANVAS&gt; that now I cannot stop…</p>
<p><a title="Tassellate at work!" href="http://licorize.com/applications/licorize/site/test/canvas/tassellate.jsp" target="_blank"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image18.png?w=624&#038;h=430" border="0" alt="image" width="624" height="430" /></a></p>
<p>(<a href="http://licorize.com/applications/licorize/site/test/canvas/tassellate.jsp" target="_blank">test demo here</a>)</p>
<p>Now I’m playing on a component that I’d like to use as replacement for the current “weekly review” game on <a href="http://licorize.com" target="_blank">Licorize</a>. If you are wondering about a “game” on a GTD operation like “weekly review”, have a look at <a href="http://pietro.open-lab.com/2010/11/09/game-mechanics-for-thinking-users/" target="_blank">Game mechanics for thinking users</a> article by <a href="http://pietro.open-lab.com" target="_blank">Pietro Polsinelli</a>.</p>
<p>The goal is to transmit the idea of having something to be “cleared”; a picture covered with black pieces should work fine!</p>
<p>The requirement is that the number of pieces covering the image must be pre-determined.</p>
<p>First of all I need an algorithm to “tassellate” the image with random shaped triangles. Actually the triangles are not overlaying, so I divide recursively the space available.</p>
<p>Go have a simple algorithm, first I split the image in two triangles, then I apply to both the recursive splitting.</p>
<p>A single splitting step:<a href="http://rbicchierai.files.wordpress.com/2011/02/image19.png"><img style="display:inline;margin-left:0;margin-right:0;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb14.png?w=275&#038;h=167" border="0" alt="image" width="275" height="167" align="right" /></a></p>
<p>1) choose a random side</p>
<p>2) find a point (x) on that side, nearly in the middle</p>
<p>3) link the point (x) with the opposite corner and generate two triangles</p>
<p>4) apply splitting on both triangles</p>
<p>here is the code:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image20.png"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb15.png?w=562&#038;h=389" border="0" alt="image" width="562" height="389" /></a></p>
<p>Then the recursive function: notice that I have to use a queue to “balance” the recursion on both splitted parts, otherwise I will divide only the first triangle reaching the exit condition (x pieces reaced).</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image21.png"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb16.png?w=520&#038;h=345" border="0" alt="image" width="520" height="345" /></a></p>
<p>Then I used my simple Stage object to manage canvas interactions (read <a href="http://roberto.open-lab.com/2011/02/04/lenscape-a-canvas-interaction-tutorial/">lenscape a canvas interaction tutorial</a> for details) as click on triangles, mouse over, etc…</p>
<p>I’ve also added a sound on “remove piece” button, but dealing with the &lt;AUDIO&gt; tag is another history…</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/693/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/693/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=693&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2011/02/10/tassellate-canvas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Lenscape, a canvas interaction tutorial</title>
		<link>http://roberto.open-lab.com/2011/02/04/lenscape-a-canvas-interaction-tutorial/</link>
		<comments>http://roberto.open-lab.com/2011/02/04/lenscape-a-canvas-interaction-tutorial/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 16:11:00 +0000</pubDate>
		<dc:creator>Roberto Bicchierai</dc:creator>
				<category><![CDATA[in english]]></category>
		<category><![CDATA[information technology]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">https://rbicchierai.wordpress.com/?p=646</guid>
		<description><![CDATA[Recently I started playing with the HTML5 &#60;CANVAS&#62; object sometimes having fun and sometimes feeling pain. I would like to share here my pains with your all (see example and bookmarks) I approached html drawing far in the past when svg was a weak light in the darkness of browser graphics. Mainly due to the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=646&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Recently I started playing with the HTML5 &lt;CANVAS&gt; object sometimes having fun and sometimes feeling pain. <strong>I would like to share here my pains with your all</strong> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://licorize.com/applications/licorize/site/test/canvas/lenscape.jsp" target="_blank"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image16.png?w=592&#038;h=301" border="0" alt="image" width="592" height="301" /></a></p>
<p><span style="font-size:xx-small;">(see </span><a href="http://licorize.com/applications/licorize/site/test/canvas/lenscape.jsp" target="_blank"><span style="font-size:xx-small;">example</span></a><span style="font-size:xx-small;"> and </span><a href="http://licorize.com/projects/rbicchierai/blogmaterial/canvas" target="_blank"><span style="font-size:xx-small;">bookmarks</span></a><span style="font-size:xx-small;">) </span></p>
<p>I approached html drawing far in the past when <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" target="_blank">svg</a> was a weak light in the darkness of browser graphics. Mainly due to the lack of IE support for svg at the time I chose to create my own graphic library emulating  pixel drawing with thousands of lilliputian &lt;div&gt;.</p>
<p>In the following years I had only sparse contacts with html graphics but always having in mind the svg approach, where a line, a circle or whatever is a solid xml tag.</p>
<p>e.g: &lt;ellipse cx=&#8221;300&#8243; cy=&#8221;150&#8243; rx=&#8221;200&#8243; ry=&#8221;80&#8243; style=&#8221;fill:rgb(200,100,50);”/&gt;</p>
<p>this is really “natural” for me, html-writer: every single element has its own tag, and we are all happy!</p>
<p>Last month here, in Open Lab, we decided to start developing our first game (first for the company but not for the people working in it) and we decided to develop it using HTML5!</p>
<p>It’s time for me to resurrect dormant skills, and have a look at what is happening in the world of html gaming.</p>
<p><strong>Surprise</strong>! Nobody is using svg for gaming, the main road is deeply tracked through <a href="http://en.wikipedia.org/wiki/Canvas_element" target="_blank">&lt;canvas&gt;</a> fields;  so then I started studying it.</p>
<p>First of all I got a punch in the stomach learning that a canvas is, as the word says, only a place where to “draw” something, not a place where to “store” something. That means that once you have put something in a canvas, there is no way to recall  it, or even worst to detect its presence.</p>
<p>This implies that if you want, for instance, to do something when clicking on a “circle” you cannot “bind” an event on that circle, simply because that “circle” doesn’t exist.  So if you need to interact with objects in the scene you need to work around it.</p>
<p>Actually this tutorial will explain how to approach canvas interaction,  <strong>so this will result as a shortcut for avoiding the pain and getting only the fun part</strong>!</p>
<p><strong> </strong></p>
<p><strong>Disclaimer</strong>: I know there are lots of html gaming engines as <a href="http://ajaxian.com/archives/aves-game-engine" target="_blank">Aves</a> recently acquired by Zinga, <a href="http://labs.hyperandroid.com/animation" target="_blank">CAAT</a> by HyperAndroid, <a href="http://strikedisplay.blogspot.com/" target="_blank">Strikedisplay</a> by Josh Strike or <a href="http://impactjs.com/" target="_blank">Impact</a> by Dominic Szablewski (this list is far from complete). So if you are not interested in going in depth in canvas technicalities, this is a good point where to stop reading.</p>
<p>If you are interested in going deeper, first of all I suggest you to have a look at what is happening in the canvas world:  <a href="http://www.canvasdemos.com">canvasdemos</a> is a great source of inspiration. Then have a look to the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html" target="_blank">canvas element reference</a>, just to taste the complexity…</p>
<p>I chose as final destination of this short trip in the canvas world the construction of a simple application,that emulates a lens moving on a picture. In the meantime I’d like to lay the foundations of my own canvas animation(?) library.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image2.png"><img style="display:inline;border-width:0;margin:0 10px 0 0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb1.png?w=165&#038;h=166" border="0" alt="image" width="165" height="166" align="left" /></a>Summing up I’m going to realize a lens, that will enlarge a part of an underlying background image.</p>
<p>The lens can be moved over the image, to get a detailed view, using drag&amp;drop.</p>
<p>The first step is to have a large image, larger than the screen (e.g.: 4000 x 2000) with full resolution, and use it as canvas background.</p>
<p>In order to have a canvas background you can use at least two different approaches:</p>
<p>1) using CSS background-image. This is an interesting approach as the background is not in the canvas itself, so you do not need to redraw it once you clear the canvas. In my case this solution doesn’t fit as I need to stretch the image, and moreover this feature is not supported by all browsers, actually even canvas is not supported….</p>
<p>2) coping “bits” from an existing image to the canvas. I choose this approach even if this requires to redraw the background after each “clear” action, as this approach is supported by all browser canvas implementations.</p>
<p>First two rows of code: a general style for canvas and the “large” image</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb2.png?w=583&#038;h=148" border="0" alt="image" width="583" height="148" /></a></p>
<p>As the image is “large” everything starts at the “onload” event on the image, that may happen seconds after the page is loaded.</p>
<p>Just a couple of global variables to refer to the image, the stage, and the context.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image4.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb3.png?w=247&#038;h=72" border="0" alt="image" width="247" height="72" /></a></p>
<p><strong><em>img </em></strong>variable is used only for shortening code and is a jQuery proxy for the &lt;img&gt;. I used jQuery only because I’m used to use it, but it isn’t a requirement.</p>
<p><strong><em>ctx</em></strong> is the canvas context and is the main entry point for canvas operation (have a look at the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#2dcontext" target="_blank">complete reference of 2d context</a>); here <strong><em>context</em></strong> is reached via a global variable only for shortening code but the right place (“right” in terms of object modeling) should be in the “stage” object.</p>
<p><strong><em>stage </em></strong>is the “object model” of our environment, this supplies the lack of state of canvas itself, it holds all the objects of our “world” in an array.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image5.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb4.png?w=170&#038;h=88" border="0" alt="image" width="170" height="88" /></a></p>
<p>First setup fills variables and then initializes the stage:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image6.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb5.png?w=564&#038;h=277" border="0" alt="image" width="564" height="277" /></a></p>
<p>We are creating a canvas with the same aspect ratio of the original image. The Canvas object is our model for html  canvas, it exposes two methods: <strong><em>init</em></strong> and <strong><em>draw</em></strong>.</p>
<p><strong><em>Init</em></strong> method is responsible for canvas creation, context acquisition, and events binding:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image7.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb6.png?w=362&#038;h=259" border="0" alt="image" width="362" height="259" /></a> …</p>
<p><strong>Draw</strong> method is called every time you need to refresh the scene (really often during interactions) and, in our example, is here only to repaint the background:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image8.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb7.png?w=810&#038;h=115" border="0" alt="image" width="810" height="115" /></a></p>
<p>so, just clear and use the <strong><em>drawImage</em></strong> function to perform a bulk copy from our “large” off-screen  image to the canvas. This is a sort of powerful <a href="http://en.wikipedia.org/wiki/Bit_blit" target="_blank">bitBlit</a> operation that supports crop, translate and resize operations.</p>
<p>Then the <strong><em>Lens</em></strong> object: it is responsible for holding the lens position and magnification. It exposes three methods: <strong><em>draw</em></strong>, <strong><em>moveTo</em></strong>, <strong><em>setMagnification</em></strong>.</p>
<p>The Lens constructor:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image9.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb8.png?w=717&#038;h=427" border="0" alt="image" width="717" height="427" /></a></p>
<p>A little complication here is the fact that we are zooming over an image off-screen while we are moving over the canvas, so we need some scaling factor to calculate the position of the underlying point in the “large” image.</p>
<p>Then lens drawing.</p>
<p>The lens effect is rendered by copying a part of the “large” image, eventually magnified, by cropping the image in a round shape, and applying a radial gradient on an alpha channel.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image10.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb9.png?w=761&#038;h=612" border="0" alt="image" width="761" height="612" /></a></p>
<p>Note once again the usage of <strong><em>drawImage</em></strong> method to copy and enlarge the image and the  <strong><em>clip</em></strong> method for creating a circular clipping region. Then we will apply the radial gradient using color with an alpha channel.</p>
<p>The lens modeled using a js object makes it comfortable to have one or more instances of the same object:</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image11.png"><img style="display:inline;border-width:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb10.png?w=569&#038;h=121" border="0" alt="image" width="569" height="121" /></a></p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image12.png"><img style="display:inline;border-width:0;margin:0 10px 0 0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb11.png?w=390&#038;h=225" border="0" alt="image" width="390" height="225" align="left" /></a></p>
<p>Here you see two lenses with different sizes and different magnification factors.</p>
<p>Now everything is working but there is no interaction with the user.</p>
<p>Lets try to add <strong>drag&amp;drop</strong> capability.</p>
<p>I have to cite <a href="http://www.html5canvastutorials.com/">html5canvastutorials</a> that helped me understand the first steps in managing interactions.</p>
<p>In order to start dragging we have to intercept the <strong><em>mouseDown</em></strong> event on the lens, but as I told you before, canvas do not retain the state of the object you&#8217;ve drawn on, so you cannot bind any event on the circle containing the lens: you can only bind events on the whole canvas, so if the user clicks the mouse on the lens you will receive the event on the canvas, not on the circle.</p>
<p>How to determine if there is <em>your</em> lens under the mouse? A simple, mathematical solution is to calculate the distance between the mouse and the lens center (you have all you need, mouse x-y coordinates from the js event, and the lens center from our Lens object), then if distance is  lower than the lens radius the click was inside, out otherwise. <a href="http://rbicchierai.files.wordpress.com/2011/02/image13.png"><img style="display:inline;margin-left:0;margin-right:0;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb12.png?w=260&#038;h=168" border="0" alt="image" width="260" height="168" align="right" /></a></p>
<p>This approach will work fine mainly for rectangles and circles, but how to manage a complex shape like the one in the picture? (yes, <strong>I know that this sucks</strong>!)</p>
<p>In this case the “math” approach is definitively more complex.</p>
<p>Hopefully canvas can answer the question “is this point in path?”. The “sole” limitation is that you can ask this question “only while” your are drawing, that in terms of canvas context is only between <strong>context.beginPath()</strong> and <strong>context.closePath()</strong> calls; so we have to store somewhere the mouse coordinates, then ask <strong>isPointInPath(mouseX, mouseY)</strong> and<strong> </strong>store the result on the Lens object.</p>
<p>Summing up: all events are binded to the canvas object, the stage redrawing is called on mouse move, and the “over” state is recorded on the Lens object. <strong>Mousedown</strong>, <strong>mouseup</strong>, and <strong>mouseleave</strong> only perform simple operations.</p>
<p><a href="http://rbicchierai.files.wordpress.com/2011/02/image14.png"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image_thumb13.png?w=623&#038;h=623" border="0" alt="image" width="623" height="623" /></a></p>
<p><strong><em>Stage</em></strong> holds the object currently in drag status.</p>
<p>Note that we move the object that is first dragged on top of the stage.<strong>stageObjects</strong> list; this will act as a z-order operation, bringing the object to the front.</p>
<p><a href="http://licorize.com/applications/licorize/site/test/canvas/lenscape.jsp" target="_blank"><img style="display:inline;border:0;" title="image" src="http://rbicchierai.files.wordpress.com/2011/02/image15.png?w=654&#038;h=245" border="0" alt="image" width="654" height="245" /></a></p>
<p>The running example is <a href="http://licorize.com/applications/licorize/site/test/canvas/lenscape.jsp" target="_blank">here</a>, and source code <a href="http://licorize.com/applications/licorize/site/test/canvas/lenscape.htm" target="_blank">here</a> under MIT licence, so feel free to change and reuse.</p>
<p>All the material referred in this post is in my <a href="http://licorize.com" target="_blank">Licorize</a> booklet for canvas related material: <a href="http://licorize.com/projects/rbicchierai/blogmaterial/canvas" target="_blank">http://licorize.com/projects/rbicchierai/blogmaterial/canvas</a></p>
<p>I took the photos used as examples in my travels.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rbicchierai.wordpress.com/646/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rbicchierai.wordpress.com/646/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=roberto.open-lab.com&#038;blog=9711353&#038;post=646&#038;subd=rbicchierai&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://roberto.open-lab.com/2011/02/04/lenscape-a-canvas-interaction-tutorial/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/463bee7888aaf9f21ef6e6506622d6f4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rbicchierai</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://rbicchierai.files.wordpress.com/2011/02/image15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
