<?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/"
	>

<channel>
	<title>clorophilla.blog</title>
	<atom:link href="http://www.clorophilla.net/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.clorophilla.net/blog</link>
	<description>blog goes here</description>
	<lastBuildDate>Wed, 19 Jun 2013 19:50:37 +0000</lastBuildDate>
	<language>it</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>About Predis and benchmarks: why a pure-PHP Redis client anyway?</title>
		<link>http://www.clorophilla.net/blog/?p=499</link>
		<comments>http://www.clorophilla.net/blog/?p=499#comments</comments>
		<pubDate>Wed, 19 Jun 2013 17:59:21 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=499</guid>
		<description><![CDATA[As some of you might know I&#8217;m the author and maintainer of Predis, a pure-PHP client library for Redis. When I started this project back in mid-2009 Redis was a very young yet promising NoSQL key-value store with only three client libraries available for PHP (one of which was a C-based extension that eventually led [...]]]></description>
			<content:encoded><![CDATA[<p>As some of you might know I&#8217;m the author and maintainer of <a title="nrk/predis" href="https://github.com/nrk/predis">Predis</a>, a pure-PHP client library for <a title="Redis" href="http://redis.io">Redis</a>. When I started this project back in mid-2009 Redis was a very young yet promising NoSQL key-value store with only three client libraries available for PHP (one of which was a C-based extension that eventually led to <a title="nicolasff/phpredis" href="https://github.com/nicolasff/phpredis">phpredis</a>) offering support only for the Redis commands implemented at that time, and plagued by many bugs. Fast forward to date, and both Predis and phpredis are now the two most used, stable and up-to-date clients in PHP-land among the bunch available. Although it&#8217;s mostly a one-man project, I&#8217;m very proud of the work behind its development and thankful for the contributions received from the community.</p>
<p>So why am I writing this blog post? To cut it straight to the point, I think there&#8217;s sometimes a little misconception about the very reason for which Predis exists nowadays and Aleksey&#8217;s <a title="Benchmarking Memcached and Redis clients" href="http://alekseykorzun.com/post/53283070010/benchmarking-memcached-and-redis-clients">recent blog post</a> is offering me a good opportunity to clarify things a bit. Don&#8217;t get me wrong he made various valid points, but what has actually caught my attention and prompted me to write this post is the very introduction:</p>
<blockquote><p><em>As some of you may know, I’m crazy about speed. So when I saw that people were happily using Predis as their choice of PHP client for Redis, I was a bit confused.</em></p>
<p><em>Why use a client written in PHP for something that should be ‘fast’ like Redis?</em></p>
<p><em>That kind of defeats the purpose - unless you don’t really care about response times and scalability. </em></p></blockquote>
<p>Predis was initially developed to fill the lack for a decent client library but turned into a more comprehensive solution allowing for maximum extensibility. In a sense, you may think of this library not only as a mere client for Redis but as a sort of <em>framework</em> (pass me the buzzword) with various building blocks that developers can leverage to create abstractions for features based upon Redis and expose them through a consistent interface. In my opinion a great example of such extensibility is the <a title="Predis: Abstraction for handling Lua scripts as plain Redis commands" href="https://github.com/nrk/predis#abstraction-for-handling-lua-scripts-as-plain-redis-commands">abstraction used to support Lua script</a>s exposing them as if they were common Redis operations such as <em>GET</em> or <em>SET</em> (and it works when using client-side sharding or master/slave replication too). Some parts were also reused to build <a title="nrk/predis-async" href="https://github.com/nrk/predis-async">a fully-asynchronous version of the client</a>!</p>
<p>Obviously there&#8217;s a price to pay for everything and, in our case, that price is a penalty in raw speed compared to a C-based extension due to the undeniable greater overhead of a pure-PHP implementation. You can mitigate part of this overhead by using PHP &gt;= 5.4 (faster at method dispatching), an opcode cache (you should do that anyway on production servers) or even plugging in <a title="nrk/phpiredis" href="https://github.com/nrk/phpiredis">phpiredis</a> for faster protocol (de)serialization, but in the end you are optimizing your stack on a single-server basis. You can have 5, 10, 100 servers hitting Redis for distributed operations: that&#8217;s where Redis shines the best and that&#8217;s why it&#8217;s considered blazing fast. In such distributed scenarios, when one or more Redis instances are running on remote hosts, you will soon notice that most of the difference in speed is lost due to network round-trip times so you will be left for the most part with the inherent overhead of compiling the source code (or loading the cached opcodes) of Predis on each request. We&#8217;ve always been clear on what to expect out of Predis in this case and this is the reason why we have a <a title="Predis is a pure-PHP implementation: it can not be fast enough!" href="https://github.com/nrk/predis/blob/v0.8.3/FAQ.md#predis-is-a-pure-php-implementation-it-can-not-be-fast-enough">FAQ about performances</a> shipped along with the library. It&#8217;s a matter of trade offs: you sacrifice a low overhead for the sake of flexibility.</p>
<p>But then again, is it possible to use Predis when you also need decent overall performances or scalability? Depending on your definition of &#8220;decent performances&#8221; in the context of your application and provided a correct setup and architecture, yes. I personally know of a few high-load web sites using Predis, each one with a different reason behind their choice. Sure, if you don&#8217;t need fancy features and you only have one server performing requests against Redis running on the localhost then you would probably prefer to stick with phpredis thanks to its lower overhead, but that doesn&#8217;t mean being able to scale. Is Predis better than phpredis, or the other way around? Simply put, they are two solutions to the same problem and both have their different strong and weak points. In the end you are the one to decide based on your needs but, more importantly and as Aleksey concluded, don&#8217;t base your decisions on assumptions. And, I&#8217;d just like to add, not even on general benchmarks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=499</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About to buy a DSC-RX100? Sony will announce its successor soon.</title>
		<link>http://www.clorophilla.net/blog/?p=480</link>
		<comments>http://www.clorophilla.net/blog/?p=480#comments</comments>
		<pubDate>Mon, 17 Jun 2013 18:50:42 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Techworld]]></category>
		<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[compact camera]]></category>
		<category><![CDATA[dsc-rx100]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[sony]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=480</guid>
		<description><![CDATA[NOTE: this post is unusual for my almost-abandoned blog: it&#8217;s written in English instead of Italian and it&#8217;s about photography instead of software development or computer programming. Think of it as an experiment (or an attempt) to resume blogging. As an happy owner of the DSC-RX100 I can&#8217;t deny that the news that Sony is about to [...]]]></description>
			<content:encoded><![CDATA[<p><small>NOTE: this post is unusual for my almost-abandoned blog: it&#8217;s written in English instead of Italian and it&#8217;s about photography instead of software development or computer programming. Think of it as an experiment (or an attempt) to resume blogging.</small></p>
<p>As an happy owner of the <a title="Sony DSC-RX100 - In Depth Review at DPReview" href="http://www.dpreview.com/reviews/sony-cybershot-dsc-rx100">DSC-RX100</a> I can&#8217;t deny that the news that Sony is about to announce a revised version of this high-end and enthusiast-oriented compact camera on 27th June (namely the <strong>DSC-RX100M2</strong>) has caught my attention. Actual details about this camera come from its recently leaked Japanese <a title="DSC-RX100M2 User Manual" href="http://ux.getuploader.com/nokishita/download/1/44659720M-JP.pdf">user manual</a>. The great <a title="Sony Alpha Rumors" href="http://www.sonyalpharumors.com/">Sony Alpha Rumors</a> blog spotted the rumor first and they recently confirmed it by publishing a bullet-point list of changes extracted from the above mentioned manual, I simply reused their list in this post to add my own considerations but credits for the actual news go to them.</p>
<p>Let&#8217;s start with the list of improvements of the DSC-RX100M2:</p>
<ol>
<li><strong>Exmor R (BSI) sensor</strong><br />
It sports the same size and resolution of the previous Exmor CMOS sensor (1&#8243; and ~20 megapixels) but that R indicates it&#8217;s now back-illuminated. This may be nice news but the BSI technology is said to be mostly useful on sensors with a photosite size equal or less than 1.75µm (usually on 1/2.3&#8243; sensors or smaller) while the size of the photosites of the RX100 is 2.4µm. I guess we can&#8217;t really say anything without seeing the actual RAW output first.</li>
<li><strong>Wi-Fi 802.11b/g/n</strong><br />
This is not something I miss and I&#8217;d be inclined to classify this addition as typical P&amp;S gadgetry, unless it allows for some kind of remote shutter release control of some kind, but I highly doubt it and I don&#8217;t see any indication of it.</li>
<li><strong>NFC</strong><br />
I suppose this is solely meant to easily configure Wi-Fi connectivity for transferring photos to other devices such as smartphones. See above.</li>
<li><strong>Multi Interface Shoe and EVF support</strong><br />
The MIS is a proprietary camera hotshoe system (21+3 pin) introduced by Sony in late 2012. Besides the dedicated Sony accessories, it can drive ISO flashes. It will also make it possible to use an external electronic view finder which is definitely a nice addition albeit the recommended retail price of $/€ 449.99 for the FDA-EV1MK (the same EVF for both the DSC-RX1 and DSC-HX50V) does hurt.</li>
<li><strong>Mini-HDMI has been moved from bottom to side, next to Micro-USB</strong><br />
Surely OK, actually they should have positioned it like that since start, but how many times do you film/shoot with the camera while attached to a TV?</li>
<li><strong>Improved battery life, from 330 to 350 shots (CIPA)</strong><br />
Even slight improvements are <em>yay</em>s in the battery life department to me, but I can easily get a full day of shooting with the current RX100 and I prefer to have a spare battery with me anyway, so it&#8217;s not something that would affect me much in practice. The battery remained the same <a title="Sony NP-BX1 Battery" href="http://store.sony.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10551&amp;storeId=10151&amp;langId=-1&amp;productId=8198552921666552381">NP-BX1</a> which is good.</li>
<li><strong>ISO starts from 100 instead of 125</strong><br />
I suppose they are referring to native ISO since the current RX100 can go as low as ISO 80 and 100 through expansion.</li>
<li><strong>Control ring can be set to smooth or click</strong><br />
This improvement is big if you listen to most of the complaints over the internet about the control ring being clickless, which makes setting certain parameters such as ISO levels almost impossible without looking at the display if you have sounds turned off as I do. Luckily for me I like having the control ring assigned to manual focus operations where a smooth ring is actually better, so I&#8217;m not affected that much.</li>
<li><strong>Movie button can be disabled</strong><br />
The dedicated movie button is handy and it proved to be so in a few real-life occasions, but sometimes it can be accidentally pressed. It happened a couple of times to me, but I still prefer to have it enabled to catch those unexpected moments instead of having to manually switch the camera to video mode which takes more time.</li>
<li><strong>24p option for movies</strong><br />
The original RX100 is already quite capable for shooting videos but having the added ability to record them in 24p is nice.</li>
<li><strong>White balance bracketing</strong><br />
This is hardly useful when capturing images in the RAW format as you can adjust the WB later, but when shooting with multi-shot noise reduction or automatic HDR (both are only able to output JPG files for obvious reasons) this can be useful. Personally I&#8217;d have vastly preferred a more flexible exposure bracketing system than the current one which uses 3 exposures at only 0.3EV or 0.7EV intervals.</li>
<li><strong>Improved in-camera battery recharge times</strong><br />
The charging current has been increased from 0.5A to 1.5A (approaching the 1.89A limit of the NP-BX1 battery), this should translate to 3 times faster charging times. While 99% of the time I use an external battery charger which offers faster charges, having the ability to charge the battery in-camera via USB is still useful and being able to do it faster is great.</li>
<li><strong>Tilt screen</strong><br />
This is a great addition with the downside of making the camera slightly thicker (only 2.4mm), but that shouldn&#8217;t affect by much its <em>jeans-pocketabily</em>. The tilt system being used looks similar to the one adopted for the NEX-3N.</li>
<li><strong>Weight increased from 240g to 281g</strong><br />
Finally, this is the price to pay for these <em>physical</em> improvements in terms of weight.</li>
</ol>
<p>Now let&#8217;s see what <strong>didn&#8217;t</strong> make it in this revision compared to what people kept whining about:</p>
<ol>
<li>First of all, for those wanting both a wider lens but faster at the telephoto end it&#8217;s been confirmed that such a thing won&#8217;t happen: the lens is still a <strong>Vario-Sonnar T* 28-100mm</strong> (35mm equiv.)<strong> f1.8/4.9</strong>. Honestly I think far too many people keep demanding the impossible in terms of lens performances out of such a compact package. It&#8217;s most likely impossible to achieve a wider lens (many ask for 24mm!) keeping its f1.8 capabilities when the original RX100 already suffers from soft edges at 28mm due to barrel distortion corrections, and a faster lens at telephoto would surely require a different disposition of the optical groups. I&#8217;m also ignoring absurd requests for powerful zoom capabilities going up to say 140mm. At this point, and with a sensor of that size, almost nothing can be sensibly improved in terms of lens performances without affecting the whole package size.</li>
<li>No integrated GPS. I find it useless anyway as it adds burden to the battery, personally I&#8217;m more than satisfied with using my <a title="iBlue 747+ GPS Logger - TranSystem " href="http://www.transystem.com.tw/product.php?b=g&amp;m=pe&amp;cid=4&amp;sid=&amp;id=59">TranSystem iBlue 747A+</a> GPS logger (now superseded by a newer model) to log all of my trips: I keep it always on when out for the whole day up to five days without worrying about battery, it&#8217;s fast to lock satellites and it&#8217;s probably way more precise than any built-in GPS. The obvious downside is that you must manually synchronize the internal camera time with the GPS time (you actually need to do that only once in a while) and you must geotag your shots later, but <a title="GeoTag" href="http://geotag.sourceforge.net/">GeoTag</a> makes it easy to do that in bulk from a GPX file and can write EXIF data to JPG, RAW files of various vendors and XMP files.</li>
<li>On-sensor phase-detect autofocus. That&#8217;s simply not gonna happen, not even the DSC-RX1 has it.</li>
<li>No hand grip or rugged surface for a more secure handhold. This can be easily worked around using third-party accessories, personally I don&#8217;t feel the need for it.</li>
<li>No signs of the new JPEG engine that promises an improved compression quality. This engine will debut on Sony&#8217;s new Xperia flagship device (C680X code-named <em>Honami)</em> and will also be used on cameras starting with the SLT lineup through a firmware update. I find the current JPEG engine used by Sony to perform poorly compared to the output generated by other vendors.</li>
</ol>
<p>All in all some of the improvements over the original DSC-RX100 are nice, but as a whole they are probably not worth the upgrade for anyone already owning it as they seem to be mostly targeted to satisfy those finding this camera lacking due to the absence of a tilt screen or an EVF-capable hotshoe.</p>
<p>Personally I&#8217;d be more interested in the new sensor if it proves to yield higher SNR ratios translating to visibly better outputs in low-light conditions and with less noise at high ISO levels, but I guess this is unlikely happen to an appreciable degree (we won&#8217;t get a whole stop of advantage). I find it very disappointing that the maximum shutter speed remained at 1/2000th second making wide apertures in strong sunlight a bit problematic, especially since there&#8217;s no built-in ND filter. Also, the EB is still limited to 3 exposure at 0.3EV or 0.7EV intervals.</p>
<p>Conclusions? Revision or not, the DSC-RX100 (with its flaws and compromises, just like any camera) provides the best IQ in such a pocketable package and competition has yet to announce a product comparable when combining performances and size.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=480</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Succede solo il primo Aprile (ormai annualmente)</title>
		<link>http://www.clorophilla.net/blog/?p=470</link>
		<comments>http://www.clorophilla.net/blog/?p=470#comments</comments>
		<pubDate>Mon, 01 Apr 2013 08:01:00 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=470</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.clorophilla.net/blog/public/wp-uploads/2013/04/yaomingface.jpg" alt="Yao Ming Face" title="Yao Ming Face" width="365" height="500" class="aligncenter size-full wp-image-471" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=470</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Succede solo il primo Aprile (immancabilmente)</title>
		<link>http://www.clorophilla.net/blog/?p=415</link>
		<comments>http://www.clorophilla.net/blog/?p=415#comments</comments>
		<pubDate>Sun, 01 Apr 2012 09:48:43 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[bla bla bla]]></category>
		<category><![CDATA[etc etc]]></category>
		<category><![CDATA[primo aprile]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=415</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://knowyourmeme.com/memes/trollface-coolface-problem"><img src="http://www.clorophilla.net/blog/public/wp-uploads/2012/04/trollface__.jpg" alt="Troll Face" title="trollface__" width="441" height="362" class="size-full aligncenter wp-image-416" /></a><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=415</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Succede solo il primo Aprile (la vendetta)</title>
		<link>http://www.clorophilla.net/blog/?p=409</link>
		<comments>http://www.clorophilla.net/blog/?p=409#comments</comments>
		<pubDate>Fri, 01 Apr 2011 20:36:31 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[bla bla bla]]></category>
		<category><![CDATA[etc etc]]></category>
		<category><![CDATA[non ci crede nessuno]]></category>
		<category><![CDATA[non è uno scherzo]]></category>
		<category><![CDATA[primo aprile]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=409</guid>
		<description><![CDATA[E&#8217; il primo Aprile no? Pensavate che mi sarei dimenticato dell&#8217;appuntamento ormai annuale, preciso come un orologio Svizzero, con questo blog? In effetti stavo per dimenticarmene, ma eccomi qui. Questa volta però niente elenchi puntati, toppo noiosi e sterili. Piuttosto sono indeciso se rompere questa tradizione, ormai consolidatasi, e iniziare a postare qualche messaggio sempre [...]]]></description>
			<content:encoded><![CDATA[<p>E&#8217; il primo Aprile no? Pensavate che mi sarei dimenticato dell&#8217;appuntamento ormai annuale, preciso come un orologio Svizzero, con questo blog? <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  In effetti stavo per dimenticarmene, ma eccomi qui. Questa volta però niente elenchi puntati, toppo noiosi e sterili. Piuttosto sono indeciso se rompere questa tradizione, ormai consolidatasi, e iniziare a postare qualche messaggio sempre inerente alla programmazione ma molto più easy, per esempio un breve resoconto sull&#8217;ottimo evento <a href="http://www.nosqlday.it/" title="NoSQL Day">NoSQL Day</a> svoltosi settimana scorsa in quel di Brescia. Per altro, giusto che si sta parlando di NoSQL e visto che è quanto successo una mezz&#8217;ora prima di scrivere questo post, ho appena rilasciato una <a href="http://gist.github.com/898721" title="Predis 0.6.6 (2011-04-01) - Release notes">nuova versione</a> di <a href="http://github.com/nrk/predis" title="nrk/predis - GitHub">Predis</a>, un client PHP per <a href="http://redis.io/" title="Redis">Redis</a>. Cercherò di trattenermi dallo scrivere di più in questo post proprio per provare a convincermi a preparare qualche altro post successivo, anche se onestamente sarà difficile. Nel frattempo, se proprio ci tenete, sapete <a href="http://twitter.com/JoL1hAHN">dove</a> <a href="http://github.com/nrk">trovarmi</a> <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=409</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Succede solo il primo Aprile (reprise)</title>
		<link>http://www.clorophilla.net/blog/?p=408</link>
		<comments>http://www.clorophilla.net/blog/?p=408#comments</comments>
		<pubDate>Thu, 01 Apr 2010 20:19:10 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[bla bla bla]]></category>
		<category><![CDATA[etc etc]]></category>
		<category><![CDATA[non ci crede nessuno]]></category>
		<category><![CDATA[non è uno scherzo]]></category>
		<category><![CDATA[primo aprile]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=408</guid>
		<description><![CDATA[Credevate che con il mio ultimo post, risalente esattamente a un anno fa (primo Aprile, ma del 2009 appunto), io stessi scherzando. In effetti anche io ne ero convinto, ma alla fine &#232; successo veramente: &#232; passato un anno prima di veder comparire un nuovo post su questo blog. Riproviamoci con un altro elenco puntato: [...]]]></description>
			<content:encoded><![CDATA[<p>Credevate che con il mio ultimo post, risalente esattamente a un anno fa (primo Aprile, ma del 2009 appunto), io stessi scherzando. In effetti anche io ne ero convinto, ma alla fine &#232; successo veramente: &#232; passato un anno prima di veder comparire un nuovo post su questo blog. Riproviamoci con un altro elenco puntato:</p>
<ul>
<li>Dopo svariati anni ho cambiato completamente la pagina nella <a title="clorophilla.net" href="http://clorophilla.net/">root di questo dominio</a> pensando a qualcosa di molto semplice ma decisamente pi&#249; utile di quella precedente. </li>
<li><a title="Twitter / JoL1hAHN" href="Twitter / JoL1hAHN">Twitter</a> rules (lo ribadisco) e no, niente Facebook (ci tengo a ribadire anche questo). </li>
<li>Alla fine in Giappone ci sono stato! Circa 10 mesi fa a dire il vero. Che dire, ci vorrebbe un blog intero solo per raccontare l&#8217;esperienza. Ovviamente nei piani &#232; previsto un ritorno in pompa magna nel paese del Sol Levante, ma in un periodo non ancora definito. Posterei anche qualche fotografia, se solo avessi finito di sistemarle (sono fermo a 330 su circa 1200 foto).</li>
<li>Evviva gli EeePC. Windows 7 + Kubuntu sul disco e ArchLinux (con fluxbox) su chiave USB e posso fare praticamente tutto ovunque io sia. Tra l&#8217;altro &#232; solo qualche mese che utilizzo ArchLinux ma devo ammettere che mi sta piacendo molto come distribuzione.</li>
<li>Vorrei scrivere un blog &quot;tecnico&quot; in inglese, ma come potrei anche solamente pensarci quando non riesco ad aggiornare nemmeno quello nella mia lingua madre?</li>
<li>Tra l&#8217;altro girano leggende metropolitane tra qualche persona che conosco secondo cui un post che compare su questo blog &#232; presagio di impressionanti catastrofi, o quanto meno di tempo metereologico palesemente avverso per il fine settimana. Nel dubbio oggi &#232; caduta grandine, per il weekend staremo a vedere. </li>
<li>Ah, buona Pasqua.</li>
<li>42</li>
</ul>
<p>OK, lo ammetto, in realt&#224; era tutta una scusa per postare qualcosa dopo un anno esatto <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Mi piacerebbe ripartire, ma dovrei trovare prima il tempo e saper scegliere tra la miriade di argomenti che potrei trattare. Non sono sicuro di riuscirci, ma vedremo come andr&#224; <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=408</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Succede solo il primo di Aprile</title>
		<link>http://www.clorophilla.net/blog/?p=405</link>
		<comments>http://www.clorophilla.net/blog/?p=405#comments</comments>
		<pubDate>Wed, 01 Apr 2009 10:58:27 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[etc etc]]></category>
		<category><![CDATA[giappone]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[IronRuby]]></category>
		<category><![CDATA[non è uno scherzo]]></category>
		<category><![CDATA[primo aprile]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=405</guid>
		<description><![CDATA[Esisto. Voglio dire, &#232; il primo di Aprile per cui quale occasione migliore per tornare a scrivere su questo blog dopo poco pi&#249; di 5 mesi dall&#8217;ultimo messaggio? Per&#242; non &#232; uno scherzo! Onestamente volevo fare cifra tonda e arrivare a 6 mesi, ma ormai credo di aver trascurato fin troppo questi lidi. Non star&#242; [...]]]></description>
			<content:encoded><![CDATA[<p>Esisto. Voglio dire, &#232; il primo di Aprile per cui quale occasione migliore per tornare a scrivere su questo blog dopo poco pi&#249; di 5 mesi dall&#8217;ultimo messaggio? Per&#242; non &#232; uno scherzo! Onestamente volevo fare cifra tonda e arrivare a 6 mesi, ma ormai credo di aver trascurato fin troppo questi lidi. Non star&#242; nemmeno a spiegarvi il perch&#233; e il percome di questa lunga pausa, anche perch&#233; onestamente credo ci sia ben poco di interessante, tuttavia nonostante impegni e riflessioni non sono stato con le mani in mano in giro per la rete:</p>
<ul>
<li>Ho iniziato a usare <a title="GitHub - Social Coding" href="https://github.com/">GitHub</a>, di conseguenza Git come DVCS, per <a title="GitHub - nrk&#39;s profile" href="http://github.com/nrk">condividere il codice su cui lavoro</a>. C&#8217;&#232; un po&#8217; di tutto: esperimenti come <a title="couchdb-lua-viewserver" href="http://github.com/nrk/couchdb-lua-viewserver/tree">couchdb-lua-viewserver</a> oppure <a title="hpricot-pure" href="http://github.com/nrk/hpricot-pure/tree">hpricot-pure</a> ma anche lavori un po&#8217; pi&#249; utili e seri come <a title="redis-lua" href="http://github.com/nrk/redis-lua/tree">redis-lua</a> oppure <a title="ironruby-hpricot" href="http://github.com/nrk/ironruby-hpricot/tree">ironruby-hpricot</a> e <a title="ironruby-json" href="http://github.com/nrk/ironruby-json/tree">ironruby-json</a>. </li>
<li>Proprio <a title="ironruby-hpricot" href="http://github.com/nrk/ironruby-hpricot/tree">ironruby-hpricot</a> e <a title="ironruby-json" href="http://github.com/nrk/ironruby-json/tree">ironruby-json</a> rappresentano i miei primi due progetti concreti per <a title="IronRuby" href="http://www.ironruby.net/">IronRuby</a> e sono i rispettivi i port delle librerie <a title="Home - hpricot - GitHub" href="http://wiki.github.com/why/hpricot">hpricot</a> e <a title="JSON implementation for Ruby" href="http://json.rubyforge.org/">json</a> (entrambe basate su <a title="Ragel State Machine Compiler" href="http://www.complang.org/ragel/">Ragel</a>) che sono disponibili per l&#8217;MRI. Ora come ora mi sto divertendo focalizzandomi principalmente sulla compatibilit&#224; di IronRuby con l&#8217;MRI, come del resto testimoniato dalla natura della decina di <a title="RubyForge: IronRuby" href="http://rubyforge.org/tracker/index.php?group_id=4359&amp;atid=16798">bug report</a> che ho aperto, ma prima o poi inizier&#242; anche con qualche progetto che si integri con il framework .NET (e ho gi&#224; qualche idea in merito, manca solo il tempo). </li>
<li>Con <a title="Daniele Alessandri (JoL1hAHN) on Twitter" href="http://twitter.com/JoL1hAHN">Twitter</a> ormai ci ho preso gusto, soprattutto negli ultimi 6 mesi. Ho potuto seguire botte-e-risposta interessanti, sono potuto entrare in contatto con gente altrettanto interessante e tecnicamente molto preparata, inoltre la velocit&#224; con cui &#232; possibile catturare notizie &#232; stupefacente. Certamente la percezione di &quot;interessante&quot; e di &quot;utile&quot; pu&#242; variare da persona a persona ed &#232; proprio per questo che, a chi fosse ancora scettico, non posso far altro che dire che solo con la prova sul campo &#232; possibile carpirne le potenzialit&#224;. Per la cronaca io stesso ero <a title="Mi mancava giusto Twitter" href="http://www.clorophilla.net/blog/?p=383">uno dei poco convinti</a>, se non addirittura uno dei suoi quasi-detrattori. Ah, per inciso non mi iscriver&#242; mai a Facebook. Si lo so, mai dire mai, ma c&#8217;&#232; sempre l&#8217;eccezione che conferma la regola. </li>
<li>Il mese scorso ho riesumato anche <a title="A tumblelog is fine too" href="http://nrk.tumblr.com/">il mio tublelog</a>, con tanto di nuovo look visto che quello vecchio faceva abbastanza schifo (il nuovo tema &#232; uno di quelli disponibili sulla galleria di temi di Tumblr ma con modifiche e adattamenti sparsi). </li>
<li>Giappone! Finalmente si sta per concretizzare un viaggio che per motivi sempre differenti sono stato costretto a rinviare pi&#249; volte negli ultimi 6 anni. In realt&#224; &#232; gi&#224; tutto pronto, manca solo la partenza <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  OK non c&#8217;entra nulla con le mie attivit&#224; online, ma mi andava di dirlo lo stesso. </li>
</ul>
<p>Per ora chiudo qui, credo di avervi tediato abbastanza. Ora vedremo se riuscir&#242; a tener fede al fatto che questo post non vuole essere uno pesce d&#8217;Aprile, ovvero spero di riuscire a non scrivere il prossimo messaggio tra altri 5 mesi ma di dargli un seguito con qualcosa di pi&#249; interessante e tecnico entro breve.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=405</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This\is\lame\r\n &#8230; &#232; un namespace, almeno in PHP 5.3</title>
		<link>http://www.clorophilla.net/blog/?p=404</link>
		<comments>http://www.clorophilla.net/blog/?p=404#comments</comments>
		<pubDate>Sun, 26 Oct 2008 09:30:25 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[namespace]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=404</guid>
		<description><![CDATA[Finalmente la lunga saga dell&#8217;introduzione del supporto per i namespace in PHP 5.3 &#232; giunta, forse, al termine nelle ultime ore. Finalmente perch&#233; la discussione &#232; andata avanti per diversi mesi, con lunghi thread su php.internals aperti in maniera pressoch&#233; perpetua ma spesso abbastanza inconcludenti. Vi anticipo fin da subito il finale della storia, ma [...]]]></description>
			<content:encoded><![CDATA[<p>Finalmente la lunga saga dell&#8217;introduzione del supporto per i namespace in PHP 5.3 &#232; giunta, forse, al termine nelle ultime ore. <em>Finalmente</em> perch&#233; la discussione &#232; andata avanti per diversi mesi, con lunghi thread su php.internals aperti in maniera pressoch&#233; perpetua ma spesso abbastanza inconcludenti. Vi anticipo fin da subito il finale della storia, ma vi avviso che secondo me non &#232; dei migliori: &#232; stato deciso di sostituire <strong>::</strong> con il carattere <strong>\</strong> per identificare la separazione dei namespace.</p>
<p>Il problema principale della scelta di <strong>::</strong> come separatore per i namespace, secondo i core developer di PHP, risiede nel fatto che in alcuni casi pu&#242; crearsi un&#8217;ambiguit&#224; non risolvibile dall&#8217;interprete poich&#233; lo stesso <strong>::</strong> viene usato anche per accedere ai metodi di classe statici. Ecco un esempio pratico:</p>
<p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:828eb20b-c1a1-4de0-af8c-fe4d70f03c12" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #999999;"> 1</span> <span style="color: #008000;">//</span><span style="color: #008000;"> --------------------------------------
</span><span style="color: #999999;"> 2</span> <span style="color: #008000;">// primo caso: Classe::methodoStatico()</span><span style="color: #008000;">
</span><span style="color: #999999;"> 3</span> <span style="color: #008000;"></span><span style="color: #000000;">
</span><span style="color: #999999;"> 4</span> <span style="color: #000000;"></span><span style="color: #0000FF;">class</span><span style="color: #000000;"> Foo {
</span><span style="color: #999999;"> 5</span> <span style="color: #000000;">    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">function</span><span style="color: #000000;"> bar() {
</span><span style="color: #999999;"> 6</span> <span style="color: #000000;">        </span><span style="color: #0000FF;">echo</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Foo::bar()</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #999999;"> 7</span> <span style="color: #000000;">    }
</span><span style="color: #999999;"> 8</span> <span style="color: #000000;">}
</span><span style="color: #999999;"> 9</span> <span style="color: #000000;">
</span><span style="color: #999999;">10</span> <span style="color: #000000;">Foo</span><span style="color: #000000;">::</span><span style="color: #000000;">bar();
</span><span style="color: #999999;">11</span> <span style="color: #000000;">
</span><span style="color: #999999;">12</span> <span style="color: #000000;"></span><span style="color: #008000;">//</span><span style="color: #008000;"> --------------------------------------
</span><span style="color: #999999;">13</span> <span style="color: #008000;">// secondo caso: Namespace::funzione()</span><span style="color: #008000;">
</span><span style="color: #999999;">14</span> <span style="color: #008000;"></span><span style="color: #000000;">
</span><span style="color: #999999;">15</span> <span style="color: #000000;">namespace Foo;
</span><span style="color: #999999;">16</span> <span style="color: #000000;">
</span><span style="color: #999999;">17</span> <span style="color: #000000;"></span><span style="color: #0000FF;">function</span><span style="color: #000000;"> bar() {
</span><span style="color: #999999;">18</span> <span style="color: #000000;">    </span><span style="color: #0000FF;">echo</span><span style="color: #000000;"> </span><span style="color: #000000;">&quot;</span><span style="color: #000000;">Foo::bar()</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">;
</span><span style="color: #999999;">19</span> <span style="color: #000000;">}
</span><span style="color: #999999;">20</span> <span style="color: #000000;">
</span><span style="color: #999999;">21</span> <span style="color: #000000;">Foo</span><span style="color: #000000;">::</span><span style="color: #000000;">bar();</span></div>
</pre>
</div>
<p>L&#8217;ambiguit&#224; delle righe 10 e 21 risulta evidente, tanto che anche l&#8217;interprete in questo caso non saprebbe come comportarsi. Per questo motivo gli sviluppatori di PHP hanno pensato di aggirare il problema cambiando appunto in <strong>\</strong> il separatore per i namespace.</p>
<p>Se doveste chiedermi cosa ne penso vi direi che, cos&#236; di primo acchito e pur non avendo da offrire soluzioni in merito alla questione, per conto mio l&#8217;idea non &#232; stata delle migliori. Senza alcun dubbio c&#8217;erano dei problemi, ma se da un lato &#232; vero che cos&#236; vengono risolte possibili ambiguit&#224;, con la scelta di <strong>\</strong> vedo l&#8217;introduzione di bug subdoli dovuti alla mancata attenzione nell&#8217;uso della quotazione singola o, in caso contrario, un errato escaping.</p>
<p><div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:0bf2f9a5-ecd6-4d06-986d-39705a5c4910" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #800080;">$singleQuote</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ReflectionClass(</span><span style="color: #000000;">'</span><span style="color: #000000;">foo\bar\className</span><span style="color: #000000;">'</span><span style="color: #000000;">);
</span><span style="color: #800080;">$doubleQuoteWithEscape</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ReflectionClass(</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">foo\\bar\\</span><span style="color: #800080;">$classNameInVar</span><span style="color: #000000;">&quot;</span><span style="color: #000000;">);
</span></div>
</pre>
</div>
<p>Ad ogni modo vi fornisco alcuni link la cui lettura pu&#242; tornarvi utili per farvi un&#8217;opinione sulla decisione presa:</p>
<ul>
<li><a title="Use \ as namespace separator" href="http://wiki.php.net/rfc/backslashnamespaces#use_as_namespace_separator" target="_blank">Use \ as namespace separator</a> e <a title="Description of what it means to use \ as namespace separator" href="http://wiki.php.net/rfc/backslashnamespaces#description_of_what_it_means_to_use_as_namespace_separator" target="_blank">Description of what it means to use \ as namespace separator</a>. </li>
<li><a title="Request for Comments: Namespace Separators" href="http://wiki.php.net/rfc/namespaceseparator" target="_blank">Request for Comments: Namespace Separators</a></li>
<li><a title="endnamespacediscussion" href="http://news.php.net/php.internals/41374" target="_blank">Annuncio del cambiamento</a> sulla mailing list php.internals</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=404</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Silverlight 2.0 RTM, support per Eclipse, port su Symbian. Poi?</title>
		<link>http://www.clorophilla.net/blog/?p=403</link>
		<comments>http://www.clorophilla.net/blog/?p=403#comments</comments>
		<pubDate>Mon, 13 Oct 2008 17:09:53 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[rtm]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=403</guid>
		<description><![CDATA[Ok anche questa volta penserete allo scherzo ma no, non lo &#232; nemmeno in questo caso. Scott Guthrie, oltre ad aver appena annunciato via conferenze telefonica che domani (14 ottobre 2008) vedr&#224; la luce la versione RTM di Silverlight 2.0, ha dato la notizia che la piattaforma di sviluppo offerta da Eclipse sar&#224; supportata, seppur [...]]]></description>
			<content:encoded><![CDATA[<p>Ok anche questa volta penserete allo scherzo ma no, non lo &#232; nemmeno in questo caso. Scott Guthrie, oltre ad aver appena annunciato via conferenze telefonica che domani (14 ottobre 2008) vedr&#224; la luce la versione RTM di <a title="The Official Microsoft Silverlight Site" href="http://silverlight.net/">Silverlight 2.0</a>, ha dato la notizia che la piattaforma di sviluppo offerta da <strong>Eclipse</strong> sar&#224; supportata, seppur non direttamente, <strong>per la creazione di applicazioni Silverlight</strong>:</p>
<blockquote><p><em>Microsoft announced plans to support additional tools for developing Silverlight applications by providing funding to Soyatec, a France-based IT solutions provider and Eclipse Foundation member, to lead a project to integrate advanced Silverlight development capabilities into the Eclipse IDE. Soyatec plans to release the project under the Eclipse Public License Version 1.0 on SourceForge and submit it to the Eclipse Foundation as an open Eclipse project.</em></p>
</blockquote>
<p>Potete trovare maggiori dettagli in <a title="Microsoft Releases Silverlight 2, Already Reaching One in Four Consumers Worldwide" href="http://www.microsoft.com/presspass/press/2008/oct08/10-13Silverlight2PR.mspx">questa pagina fresca di pubblicazione</a>, inoltre &#232; stato reso noto il sito <a title="Eclipse Tools for Microsoft Silverlight" href="http://www.eclipse4sl.org/">Eclipse Tools for Microsoft Silverlight</a> su cui &#232; gi&#224; online e <a title="Eclipse Tools for Microsoft Silverlight - Download" href="http://www.eclipse4sl.org/download/">disponibile per il download</a> una prima alpha del plugin per Eclipse con dettagli e istruzioni su alcune modalit&#224; di configurazione. Nella stessa pagina si pu&#242; notare anche una curiosa nota: <em>Windows XP SP2 (or above) or Windows Vista SP1 &#8211; Other OS are planned for future versions</em>. In effetti mi chiedo quanti sviluppatori .NET <u>su Windows</u> usino Eclipse, considerazione che riporta un po&#8217; tutti con i piedi per terra, per&#242; quel futuro supporto per altri sistemi operativi&#8230; mah, chiss&#224;&#8230;</p>
<p>Ad ogni modo l&#8217;altra notizia (di cui non ci sono ancora testimonianze ufficiali scritte mentre sto scrivendo) &#232; che a quanto pare Microsoft e Nokia lavoreranno per portare <strong>Silverlight su piattaforma Symbian</strong>.</p>
<p>Per ora sembrerebbe non esserci altro. E dire che il PDC 2008 &#232; tra meno di quindici giorni&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=403</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Social Club, Milano &#8211; Atto terzo: missione compiuta</title>
		<link>http://www.clorophilla.net/blog/?p=400</link>
		<comments>http://www.clorophilla.net/blog/?p=400#comments</comments>
		<pubDate>Mon, 29 Sep 2008 19:20:02 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[cazzeggio applicato]]></category>
		<category><![CDATA[rsc]]></category>
		<category><![CDATA[ruby social club]]></category>
		<category><![CDATA[serate]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=400</guid>
		<description><![CDATA[Anche se con un po&#8217; di ritardo, ci tenevo a esprimere la mia soddisfazione per la bella serata che &#232; stata organizzata mercoled&#236; scorso in quel di Milano dai ragazzi di Mikamai per il terzo Ruby Social Club. Una trentina di persone (successone), atmosfera molto informale, talk veloci ma interessanti e una transumata di massa [...]]]></description>
			<content:encoded><![CDATA[<p>Anche se con un po&#8217; di ritardo, ci tenevo a esprimere la mia soddisfazione per la bella serata che &#232; stata organizzata mercoled&#236; scorso in quel di Milano dai ragazzi di <a href="http://mikamai.com/" target="_blank">Mikamai</a> per il terzo <a title="Ruby Italia: Ruby Social Club" href="http://ruby-it.org/pages/Ruby+Social+Club" target="_blank">Ruby Social Club</a>. Una trentina di persone (successone), atmosfera molto informale, talk veloci ma interessanti e una transumata di massa al locale dove sono continuate le discussioni sugli argomenti pi&#249; disparati tra birra e qualche piatto di cibarie. Purtroppo non sono mai riuscito a partecipare alle precedenti edizioni e devo dire che questa volta &#232; valsa la pena fare di tutto per esserci. Il buon riffraff (a cui tra l&#8217;altro devo anche una birra, lo scrivo qui cos&#236; rimane fino alla prossima occasione) <a href="http://riffraff.blogsome.com/2008/09/27/note-dal-ruby-social-club-milano-3/" target="_blank">ha gi&#224; scritto qualche dettaglio sparso</a> sulla serata, per cui non mi dilungher&#242; ulteriormente. Sicuramente ci saranno altri appuntamenti in futuro, per cui&#8230; al prossimo RSC <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft e jQuery (sembra uno scherzo, ma non lo &#232;)</title>
		<link>http://www.clorophilla.net/blog/?p=399</link>
		<comments>http://www.clorophilla.net/blog/?p=399#comments</comments>
		<pubDate>Sun, 28 Sep 2008 19:35:47 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=399</guid>
		<description><![CDATA[Risale a qualche minuto fa la notizia che Microsoft ha stretto una partnership con il team di jQuery non solo per supportare ufficialmente questa libreria all&#8217;interno dei suoi prodotti di sviluppo come Visual Studio 2008 e la versione free di Visual Web Developer ma anche per distribuirla in alcune sue librerie web-oriented come l&#8217;ormai prossima [...]]]></description>
			<content:encoded><![CDATA[<p>Risale a qualche minuto fa la notizia che Microsoft ha stretto una partnership con il team di <a title="jQuery: The Write Less, Do More, JavaScript Library" href="http://jquery.com/" target="_blank">jQuery</a> non solo per supportare ufficialmente questa libreria all&#8217;interno dei suoi prodotti di sviluppo come Visual Studio 2008 e la versione free di Visual Web Developer ma anche per distribuirla in alcune sue librerie web-oriented come l&#8217;ormai prossima <a title="ASP.NET MVC: The Official Microsoft ASP.NET Site" href="http://www.asp.net/mvc/" target="_blank">ASP.NET MVC</a> o AJAX Control Toolkit. Il supporto negli ambienti di sviluppo sar&#224; fornito inizialmente da un pacchetto scaricabile gratuitamente nelle prossime settimane mentre in futuro sar&#224; integrato direttamente in Visual Studio. Vorrei citare solo due passaggi, il primo dal <a title="ScottGu&#39;s Blog" href="http://weblogs.asp.net/scottgu/" target="_blank">blog di Scott Guthrie</a> che riporta l&#8217;annuncio:</p>
<blockquote><p><em>We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch.&#160; The files will continue to use and ship under the existing jQuery MIT license.</em></p>
</blockquote>
<p>Il secondo invece arriva dal<a title="jQuery to ship with ASP.NET MVC and Visual Studio" href="http://www.hanselman.com/blog/jQueryToShipWithASPNETMVCAndVisualStudio.aspx" target="_blank"> post di Scott Hanselman</a> (e che in effetti riassume uno dei principali motivi per cui questo annuncio mi ha stupito):</p>
<blockquote><p><em>Folks have said Microsoft would never include Open Source in the platform, I&#8217;m hoping this move is representative of a bright future.</em></p>
</blockquote>
<p>Ecco i rispettivi annunci ufficiali da parte di <a title="jQuery and Microsoft" href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">Scott Guthrie</a> e <a title="jQuery &#187; jQuery, Microsoft, and Nokia" href="http://jquery.com/blog/2008/09/28/jquery-microsoft-nokia/" target="_blank">John Resig</a> (il quale estende la notizia riportando anche la collaborazione ufficiale di jQuery con Nokia).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=399</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sinatra has taken the stage!</title>
		<link>http://www.clorophilla.net/blog/?p=398</link>
		<comments>http://www.clorophilla.net/blog/?p=398#comments</comments>
		<pubDate>Fri, 12 Sep 2008 17:40:12 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[sinatra]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=398</guid>
		<description><![CDATA[Non si tratta del compianto Frank, ma di uno degli ultimi framework per lo sviluppo web arrivati in casa Ruby. La caratteristica principale di Sinatra &#232; la sua semplicit&#224;, ancora pi&#249; spinta rispetto a quella a volte anche un po&#8217; troppo magica di Camping: con sole 5 righe &#232; possibile ottenere una risposta dal server. [...]]]></description>
			<content:encoded><![CDATA[<p>Non si tratta del compianto Frank, ma di uno degli ultimi framework per lo sviluppo web arrivati in casa Ruby. La caratteristica principale di <a title="Sinatra" href="http://www.xnot.org/sinatra/">Sinatra</a> &#232; la sua <strong>semplicit&#224;</strong>, ancora pi&#249; spinta rispetto a quella a volte anche un po&#8217; troppo magica di <a title="Camping, a Microframework" href="http://code.whytheluckystiff.net/camping/">Camping</a>: con sole 5 righe &#232; possibile ottenere una risposta dal server. Non ci credete? Allora, dopo averlo installato usando rubygems (<code>gem install sinatra -y</code>), provate il seguente codice&#8230;</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:0782ee3c-4b2a-48b0-a6bf-7f9c1506a111" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> main.rb</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #000000;">
</span><span style="color: #0000DD;">require</span><span style="color: #000000;"> </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">rubygems</span><span style="color: #7F007F;">'</span><span style="color: #000000;">
</span><span style="color: #0000DD;">require</span><span style="color: #000000;"> </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">sinatra</span><span style="color: #7F007F;">'</span><span style="color: #000000;">

get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">Cool, Sinatra is performing on the main stage!</span><span style="color: #7F007F;">'</span><span style="color: #000000;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">
</span></div>
</pre>
</div>
<p>Usando il comando <code>ruby main.rb</code> si ottiene un&#8217;istanza di <a title="Mongrel" href="http://mongrel.rubyforge.org/">Mongrel</a> con la nostra applicazione pronta a ricevere le chiamate dal browser, mentre nella finestra del terminale si viene avvisati che <em>Sinatra has taken the stage on port 4567!</em> Non resta da far altro che verificare l&#8217;effettivo funzionamento con un semplice <code>wget -qO- http://localhost:4567/</code> (oppure <code>curl http://localhost:4567/</code> se preferite):</p>
<p><em>Cool, Sinatra is performing on the main stage!</em></p>
<p>Sinatra pu&#242; essere definito un micro-framework traverstito da <a title="Domain-specific language - Wikipedia" href="http://en.wikipedia.org/wiki/Domain-specific_programming_language">DSL</a> dotato di una grammatica ridotta, semplice e immediata. Sinatra non obbliga lo sviluppatore a strutturare la propria applicazione seguendo l&#8217;architettura <a title="Model-View-Controller - Wikipedia" href="http://it.wikipedia.org/wiki/Model-View-Controller">MVC</a> (ma &#232; comunque possibile replicarla), non &#232; legato a un particolare motore di template (ma supporta molto bene <a title="Class: ERB" href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html">ERB</a> e l&#8217;ottimo <a title="#haml" href="http://haml.hamptoncatlin.com/">HAML</a>), non offre la miriade di helpers inclusi nel prezzo come altri framework e inoltre &#232; assolutamente ORM-agnostico: tutto ci&#242; pu&#242; avere i suoi pro e contro, ma queste caratteristiche lo rendono indubbiamente un ottimo framework per lo sviluppo di prototipi o di applicazioni semplici ma relativamente veloci. Sinatra, per come &#232; strutturato, promuove inoltre lo sviluppo di interfacce <a title="REST - Representational State Transfer - Wikipedia" href="http://it.wikipedia.org/wiki/REST_-_Representational_State_Transfer">REST</a> per le proprie applicazioni web, rendendolo quindi uno strumento agevole per prototipizzare API.</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:fc10809f-bdf1-4992-91a3-abe25b68f755" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> mostra risorsa</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

post </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> crea risorsa</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

put </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> aggiorna risorsa</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

delete </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> cancella risorsa</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #0000DD;">end</span></div>
</pre>
</div>
<p>Viene naturale a questo punto chiedersi come vengano gestite le rotte, ma anche in questo caso &#232; tutto molto semplice e intuitivo:</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:4a4b1771-92ab-4e38-bb98-a04705740f85" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/hello</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    redirect </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/hello/anonymous</span><span style="color: #7F007F;">'</span><span style="color: #000000;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/hello/anonymous</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">Hello Mr. Anonymous, I would be glad to know your name!</span><span style="color: #7F007F;">'</span><span style="color: #000000;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/hello/:name</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    user </span><span style="color: #000000; font-weight: bold;">=</span><span style="color: #000000;"> params</span><span style="color: #000000; font-weight: bold;">[</span><span style="color: #000000;">:</span><span style="color: #0077FF;">name</span><span style="color: #000000; font-weight: bold;">]</span><span style="color: #000000;">
    </span><span style="color: #7F007F;">&quot;</span><span style="color: #7F007F;">Hello, #{user}!</span><span style="color: #7F007F;">&quot;</span><span style="color: #000000;">
</span><span style="color: #0000DD;">end</span><span style="color: #000000;">

</span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> wget -qO- </span><span style="color: #008000; font-style: italic; text-decoration: underline;">http://localhost:4567/hello</span><span style="color: #008000; font-style: italic;">
#</span><span style="color: #008000; font-style: italic;"> Hello Mr. Anonymous, I would be glad to know your name!</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #000000;">
</span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> wget -qO- </span><span style="color: #008000; font-style: italic; text-decoration: underline;">http://localhost:4567/hello/anonymous</span><span style="color: #008000; font-style: italic;">
#</span><span style="color: #008000; font-style: italic;"> Hello Mr. Anonymous, I would be glad to know your name!</span><span style="color: #008000; font-style: italic;">
</span><span style="color: #000000;">
</span><span style="color: #008000; font-style: italic;">#</span><span style="color: #008000; font-style: italic;"> wget -qO- </span><span style="color: #008000; font-style: italic; text-decoration: underline;">http://localhost:4567/hello/NRK</span><span style="color: #008000; font-style: italic;">
#</span><span style="color: #008000; font-style: italic;"> Hello, NRK!</span></div>
</pre>
</div>
<p>Occorre solamente far notare che Sinatra effettua il lookup delle rotte nell&#8217;ordine di definizione, per questo motivo la seconda rotta <code>/hello/anonymous</code> non viene catturata dalla terza che invece specifica un pi&#249; generico <code>/hello/:name</code>. Concentrandosi appunto su quest&#8217;ultima, possiamo notare come pi&#249; in generale le variabili all&#8217;interno di una rotta possano essere definite semplicemente sfruttando la stessa sintassi utilizzata per definire un simbolo in Ruby e come esse vengano automaticamente rese disponibili nell&#8217;hash <code>params</code>.</p>
<p>Se avessimo bisogno di un approccio pi&#249; in stile MVC? Partendo dal presupposto che con Sinatra non serve creare una classe controller ma basta definire le singole azioni, a questo punto mancano solo le viste. Occorre quindi creare una directory <code>views</code> nel path della nostra applicazione, preparare il proprio template salvando il file relativo nella suddetta directory (per esempio <code>greet.haml</code> oppure <code>greet.erb</code> a seconda di quale motore di template vogliate usare) e scrivere una semplice riga di codice per la rotta:</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:65e5822b-af6b-4f6f-8112-4834bd00c59e" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">get </span><span style="color: #7F007F;">'</span><span style="color: #7F007F;">/hello/:name</span><span style="color: #7F007F;">'</span><span style="color: #000000;"> </span><span style="color: #0000DD;">do</span><span style="color: #000000;">
    haml :</span><span style="color: #0077FF;">greet</span><span style="color: #000000;">
</span><span style="color: #0000DD;">end</span></div>
</pre>
</div>
<p>Per convenzione Sinatra effettua l&#8217;autocompletamento del nome del file della vista aggiungendo .haml o .erb, per cui basta specificarne il nome. Se avessi voluto utilizzare erb avrei scritto <code>erb :greet</code> ma dal momento che haml tutto sommato mi piace (<code>gem install haml</code>), ecco qui il codice d&#8217;esempio assolutamente minimale:</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:e0f8e433-73a5-46b5-9995-7c6802c55bdf" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">!!!
%html
  %head
    %title Greetings!
  %body
    %span
      Hello,
      %strong= params[:name]</span></div>
</pre>
</div>
<p>A questo punto la chiamata a <code>http://localhost:4567/hello/NRK</code> produrr&#224; il seguente output:</p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:d5371dea-44fe-4e79-9872-4e38172b2f94" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">&lt;!</span><span style="color: #FF00FF;">DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
</span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">html</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">head</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">title</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">Greetings!</span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">title</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">head</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">body</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">span</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
      Hello,
      </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">strong</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">NRK</span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">strong</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">span</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">body</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
</span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">html</span><span style="color: #0000FF;">&gt;</span></div>
</pre>
</div>
<p>Tutto molto semplice, no? </p>
<p>Sinatra &#232; in una fase di sviluppo abbastanza attiva ma &#232; un framework gi&#224; particolarmente interessante per tutte quelle necessit&#224; in cui Ruby on Rails oppure framework similari risulterebbero soluzioni spropositate. Essendo basato su <a title="Rack: a Ruby Webserver Interface" href="http://rack.rubyforge.org/">Rack</a> &#232; possibile servire le applicazioni usando server differenti da Mongrel, come per esempio <a title="Thin - yet another web server" href="http://code.macournoyer.com/thin/">Thin</a> o <a title="Overview - Phusion Passenger (a.k.a. mod_rails / mod_rack)" href="http://www.modrails.com/">Phusion Passenger</a> via Apache. Personalmente lo sto provando nei ritagli di tempo per creare una sorta di gateway da un servizio JSON-RPC che avevo realizzato qualche tempo fa a un servizio REST-oriented con tanto di interfaccia web per la gestione delle azioni e la visualizzazione dei dati, per ora sono molto soddisfatto della sua semplicit&#224;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=398</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ping? Pong! Spizzichi di Chrome, virtual machine, io, telecomandi e ruby</title>
		<link>http://www.clorophilla.net/blog/?p=395</link>
		<comments>http://www.clorophilla.net/blog/?p=395#comments</comments>
		<pubDate>Fri, 05 Sep 2008 19:15:32 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[IronRuby]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[slicehost]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[win32api]]></category>
		<category><![CDATA[zoom player]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=395</guid>
		<description><![CDATA[Per esserci ci sono&#8230; s&#236; insomma, esisto ancora. Il fatto &#232; che non avevo alcuna voglia di scrivere sul blog e mi scuso per questo, purtroppo per&#242; non riuscir&#242; mai a rientrare nella logica blogorroica e spesso prettamente italica secondo cui l&#8217;assenza di un flusso costante di messaggi, possibilmente con cadenza giornaliera e magari anche [...]]]></description>
			<content:encoded><![CDATA[<p>Per esserci ci sono&#8230; s&#236; insomma, esisto ancora. Il fatto &#232; che non avevo alcuna voglia di scrivere sul blog e mi scuso per questo, purtroppo per&#242; non riuscir&#242; mai a rientrare nella logica blogorroica e spesso prettamente italica secondo cui l&#8217;assenza di un flusso costante di messaggi, possibilmente con cadenza giornaliera e magari anche quando da scrivere non si avrebbe proprio nulla, equivale a essere marchiati a fuoco come bloggher un po&#8217; scarsi. Oddio in effetti un po&#8217; scarso lo sono in questo senso (oso addirittura fregarmene delle statistiche!), per&#242; il fatto di non aver scritto per pi&#249; di un mese non mi stupisce troppo dal momento che periodi simili mi sono capitati anche in passato in quel di usenet, quando ci bazzicavo una decina di anni fa. Tuttavia, in passato come oggi, il risultato finale &#232; sempre lo stesso: rieccomi. <em>Ah beh, che culo!</em></p>
<p>Digressioni &amp; deliri messi da parte, ci terrei a confessarvi di avere una discreta quantit&#224; di argomenti utili e interessanti (spero) su cui scrivere, mi auguro di avere il tempo materiale per riuscire nell&#8217;impresa, prima per&#242; preferirei seguire un percorso riabilitativo al posting abbastanza dolce per cui&#8230; ecco il temibile tag &lt;ul/&gt;, una bella unordered list per voi:</p>
<ul>
<li><a title="Google Chrome" href="http://www.google.com/chrome/">Chrome</a>. Google &#232; un fenomeno del marketing, me lo fa pensare il fatto che tutti stiano andando pazzi per un browser che fondamentalmente&#8230; crasha. <em>Ehi, per&#242; crashano i singoli tab, mica tutto il browser</em>: accidenti scusate, allora &#232; tutto ok posso unirmi al delirio generalizzato! <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Ironie e crash a parte, il browser &#232; veloce e in effetti <a title="v8 - Google Code" href="http://code.google.com/p/v8/">v8</a> &#232; una scheggia, magari non sempre sovraumana in tutte le circostanze come vorrebbero far credere con i benchmark studiati ad hoc ma si tratta comunque dell&#8217;engine ECMAScript/Javascript pi&#249; performante attualmente in circolazione, lo sta dimostrando con dei fatti. Il browser in s&#232; potrebbe non essere malvagio, ma magari ci rivedremo pi&#249; avanti quando Google l&#8217;avr&#224; sistemato ancora un po&#8217;, avr&#224; fatto uscire qualcosa di compilato anche per le altre piattaforme e magari, gi&#224; che sono in ballo, avr&#224; smesso di fare presunti pasticci con l&#8217;EULA. Per ora sulla mia macchina virtuale linux di sviluppo sono rimasti solo i sorgenti di v8 e il risultato della loro compilazione, mi interessano molto di pi&#249; di tutto il resto.</li>
<li>A proposito di macchine virtuali, ho acquistato una VPS linux con <a title="SliceHost - VPS Hosting" href="http://www.slicehost.com/">SliceHost</a> scegliendo il loro piano di base da 20$/mese. In seguito ho registrato un nuovo nome di dominio con Aruba (mi tornava comodo solo per la registrazione, infatti ho provveduto a cambiare immediatamente i nameserver autoritativi con quelli di SliceHost appena &#232; stato possibile) e infine per gestire la posta ho creato un account di <a title="Google Apps" href="http://www.google.com/a/help/intl/it/index.html">Google Apps</a> sottoscrivendo il profilo standard nonch&#233; gratuito. Livello di soddisfazione: elevato, per ora. Ho diverse idee in testa, tra le varie figura anche la migrazione di questo blog (come del resto mi ripropongo da almeno due anni), ma ogni cosa avverr&#224; a tempo debito.</li>
<li>Scusate se non ve l&#8217;ho mai detto, ma <a title="io" href="http://www.iolanguage.com/">io &#232; un linguaggio di programmazione</a> grandioso. Dinamico, basato sulla prototipizzazione degli oggetti come Javascript, interamente orientato ai messaggi, totalmente privo di keywords, dannatamente curioso e divertente da scoprire. Ok &#232; molto giovane, ci sono pochissime librerie e la documentazione non &#232; propriamente aggiornata con lo stato dello sviluppo, inoltre &#232; probabile che non sar&#224; nemmeno la next big thing in programming (anche se non si sa mai), per&#242; vi assicuro che &#232; un linguaggio molto divertente.</li>
<li>L&#8217;altro giorno ho acquistato il gadget allegato all&#8217;ultimo numero di Win Magazine (mai comprato in vita mia, sia chiaro): un telecomando IR per PC e Media Center, completo ovviamente di ricevitore USB. Semplice, sottile, 15&#8364;&#8230; ne volevo uno da tempo, ma non lo desideravo abbastanza intensamente da giustificare una spesa da 30&#8364; o pi&#249;. Peccato per&#242; che non sembri andare molto d&#8217;accordo con <a title="Inmatrix.com" href="http://www.inmatrix.com/">Zoom Player</a> (da anni il mio player video per Windows preferito) per quanto riguarda la mappatura dei comandi. Fortunatamente per&#242; ZP &#232; grande e pu&#242; essere <a title="Inmatrix.com - Zoom Player Help" href="http://www.inmatrix.com/zplayer/comm.shtml">remotato in maniera piuttosto banale</a> e documentata via TCP/IP oppure usando l&#8217;API <a title="SendMessage Function ()" href="http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx">SendMessage</a> di Windows, per cui ho pensato: perch&#233; non sviluppare un&#8217;applicazione residente in background che ascolti i comandi provenienti dal mio bel telecomando e li traduca in comandi da inviare a ZP, mappando il tutto come diamine voglio io? Ci sto lavorando in C#, anche se il core &#232; pi&#249; lavoro di interazione con le API Win32 che altro. Qualche messaggio sull&#8217;argomento approder&#224; anche su questi lidi.</li>
<li>Dalla saga del telecomando &#232; scaturito quasi per caso un altro piccolo progetto, questa volta pi&#249; generico e potenzialmente pi&#249; utile anche ad altri. L&#8217;idea inziale per l&#8217;applicazione di cui vi ho accennato poco sopra prevedeva l&#8217;utilizzo integrale di <a title="IronRuby - IronRuby" href="http://www.ironruby.net/">IronRuby</a> per la sua realizzazione, tuttavia mi sono accorto presto che le sue capacit&#224; di interop sono ancora particolarmente limitate per diversi aspetti (ecco perch&#233; ho scelto di usare C#). In compenso il codice che ho scritto per le prove mi ha portato all&#8217;idea di effettuare un porting per IronRuby del modulo <a title="Programmin Ruby: The Pragmatic Programmer&#39;s Guide" href="http://www.rubycentral.com/pickaxe/lib_windows.html#Win32API">Win32API</a> distribuito nella standard lib dell&#8217;MRI, il tutto in onore di una sana <em>compatibility-love.</em> Dopo 3 giorni avevo gi&#224; una prima versione funzionante come <a title="Win32API.so ported to IronRuby" href="http://gist.github.com/8440">testimoniato da questo gist</a>, ora inizia il lavoro di pulizia e ottimizzazioni che si concluderanno con il rilascio del tutto su <a title="GitHub" href="http://github.com">GitHub</a> e con una serie di post sul blog dedicati all&#8217;argomento dal momento che ci sono svariate considerazioni tecniche che potrebbero risultare particolarmente interessanti.</li>
</ul>
<p>Per ora &#232; tutto. Per ora&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=395</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gist, il pastebin definitivo</title>
		<link>http://www.clorophilla.net/blog/?p=394</link>
		<comments>http://www.clorophilla.net/blog/?p=394#comments</comments>
		<pubDate>Sun, 27 Jul 2008 19:34:43 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Link vari]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Varie ed eventuali]]></category>
		<category><![CDATA[gist]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[pastebin]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=394</guid>
		<description><![CDATA[Oggi come oggi esiste una moltitudine di servizi pastebin sparsi per internet ma da qualche giorno &#232; stato aperto quello che attualmente considero essere il pastebin definitivo: Gist. Gist &#232; offerto dall&#8217;ormai noto GitHub, il servizio di hosting di progetti probabilmente pi&#249; in voga in questo momento, e pu&#242; vantare funzionalit&#224; piuttosto interessanti come: supporto [...]]]></description>
			<content:encoded><![CDATA[<p>Oggi come oggi esiste una moltitudine di servizi <a title="pastebin @ Wikipedia" href="http://en.wikipedia.org/wiki/Pastebin">pastebin</a> sparsi per internet ma da qualche giorno &#232; stato aperto quello che attualmente considero essere il pastebin definitivo: <a title="Gist - GitHub" href="http://gist.github.com/">Gist</a>. Gist &#232; offerto dall&#8217;ormai noto <a title="GitHub" href="http://github.com/">GitHub</a>, il servizio di hosting di progetti probabilmente pi&#249; in voga in questo momento, e pu&#242; vantare funzionalit&#224; piuttosto interessanti come:</p>
<ul>
<li>supporto per una settantina di linguaggi/grammatiche differenti&#8230; anche se manca <a title="LOLCode @ Wikipedia" href="http://en.wikipedia.org/wiki/LOLCODE">LOLCode</a>, nonostante ci sia <a title="Brainfuck @ Wikipedia" href="http://en.wikipedia.org/wiki/Brainfuck">Brainfuck</a> <img src='http://www.clorophilla.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>pastie (qui chiamati gist) pubblici o privati, anonimi oppure &quot;identificati&quot; se effettuati tramite il proprio account GitHub. Le operazioni, in questo caso, sono elencate all&#8217;interno della dashboard</li>
<li>ogni gist pu&#242; essere composto da file multipli, con possibilit&#224; di scaricare comodamente la versione raw di ogni file oppure di effettuare il download del pacchetto intero in formato tar.gz</li>
<li>possibilit&#224; di modificare i propri gist con tanto di accesso allo storico delle varie revisioni</li>
<li>clone URL pubblici e privati per ogni singolo gist, pronti per essere dati in pasto a Git</li>
</ul>
<p>Provatelo, &#232; veramente ottimo. Giusto per curiosit&#224;, questa &#232; <a title="Public Gists by NRK" href="http://gist.github.com/NRK">la pagina con i miei Gist</a> pubblici&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=394</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LuaRocks! Ovvero, un comodo package manager per le librerie di Lua</title>
		<link>http://www.clorophilla.net/blog/?p=390</link>
		<comments>http://www.clorophilla.net/blog/?p=390#comments</comments>
		<pubDate>Sun, 27 Jul 2008 14:08:36 +0000</pubDate>
		<dc:creator>nrk</dc:creator>
				<category><![CDATA[Lua]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[luarocks]]></category>

		<guid isPermaLink="false">http://www.clorophilla.net/blog/?p=390</guid>
		<description><![CDATA[Lua &#232; un linguaggio di programmazione dinamico e portabile particolarmente noto e utilizzato come linguaggio embdedded grazie ad alcune caratteristiche, proprie e della sua VM, che lo rendono ottimo per lo scripting di applicazioni pi&#249; o meno complesse scritte in altri linguaggi, solitamente compilati. Ovviamente pu&#242; essere utilizzato anche per programmare intere applicazioni oppure semplicemente [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Lua (programming language) @ Wikipedia" href="http://en.wikipedia.org/wiki/Lua_%28programming_language%29">Lua</a> &#232; un linguaggio di programmazione dinamico e portabile particolarmente noto e utilizzato come linguaggio embdedded grazie ad alcune caratteristiche, proprie e della sua VM, che lo rendono ottimo per lo scripting di applicazioni pi&#249; o meno complesse scritte in altri linguaggi, solitamente compilati. Ovviamente pu&#242; essere utilizzato anche per programmare intere applicazioni oppure semplicemente script di automazione, ma in casi simili &#232; molto facile che ci si ritrovi con la necessit&#224; di utilizzare librerie esterne da installare e gestire separatamente e manualmente: Lua infatti, diversamente da linguaggi come Ruby o Python, nella sua distribuzione ufficiale non fornisce un set di librerie standard insieme al runtime. Il crescente numero di queste librerie di terze parti ha cominciato a rendere difficile la gestione delle stesse nei propri sistemi e per questo, quasi un anno fa, &#232; nato <a title="LuaRocks Wiki: LuaRocks" href="http://www.luarocks.org/"><em>LuaRocks</em></a>, un progetto per la realizzazione di sistema di distribuzione e gestione di moduli per Lua che per certi versi risulta essere molto simile a RubyGems.</p>
<p>Attualmente per installare LuaRocks nella maggior parte delle distribuzioni Linux &#232; necessario prelevare il tarball ed eseguire i soliti passaggi <em>./configure &#038;&#038; make &#038;&#038; make install</em>, tuttavia l&#8217;installazione sulle Ubuntu-derivate a partire da 8.04 <em>Intrepid Ibex</em> o su Debian a partire da 5.0 <em>Lenny</em> sar&#224; molto pi&#249; semplice dal momento che baster&#224; installare il pacchetto <em>luarocks </em>tramite apt-get. Per Windows esiste un installer che automatizza le procedure, lasciando all&#8217;utente la scelta se installare un interprete Lua basilare senza librerie fornito dallo stesso installer o se utilizzare un interprete gi&#224; installato nel proprio sistema. Tutte le informazioni necessarie al download e all&#8217;installazione di LuaRocks sono disponibili <a title="LuaRocks Wiki: Download" href="http://www.luarocks.org/en/Download">sul relativo sito</a>.</p>
<p>Nel frattempo pochi mesi fa &#232; nato un installer di Lua per Windows chiamato, con molta fantasia, <a title="Lua for Windows: A batteries included Lua installation on Windows" href="http://luaforwindows.luaforge.net/"><em>Lua for Windows</em></a>. Esso include molte delle pi&#249; note librerie per Lua e un ambiente di sviluppo/debug gi&#224; configurato e basato su <a title="Scintilla and SciTE" href="http://www.scintilla.org/SciTE.html">SciTE</a>. Si tratta quindi di un&#8217;ottima soluzione per avere in pochi secondi tutto il necessario per poter programmare in Lua, tuttavia LuaRocks non &#232; stato ancora incluso per cui ecco i passaggi da seguire per integrare il tutto:</p>
<ul>
<li><a title="LuaForge: Lua for Windows: Project Filelist" href="http://luaforge.net/frs/?group_id=377">Scaricare</a> <em>Lua for Windows</em> (LfW) e procedere con l&#8217;installazione: la mia installazione &#232; stata effettuata nel path proposto di default, ovvero <u>C:\Programmi\Lua\5.1</u> </li>
<li><a title="LuaForge: LuaRocks: Project Filelist" href="http://luaforge.net/frs/?group_id=220">Scaricare</a> <em>LuaRocks</em> per Windows, decomprimere l&#8217;archivio e aprire la shell dei comandi nella directory contenente <u>install.bat</u> </li>
<li>L&#8217;installer di LuaRocks permette di specificare alcune opzioni. Ecco come installarlo in modo che sfrutti l&#8217;interprete reso disponibile da LfW e che utilizzi un unico path per l&#8217;installazione dei pacchetti rock:
<p><code>install /LUA C:\Programmi\Lua\5.1 /BIN C:\Programmi\Lua\5.1 /P C:\Programmi\Lua\5.1\LuaRocks\0.6 /CONFIG C:\Programmi\Lua\5.1\LuaRocks /TREE C:\Programmi\Lua\5.1\LuaRocks\ /SCRIPTS C:\Programmi\Lua\5.1\LuaRocks\ /FORCECONFIG</code>       </p>
<p>Di default LuaRocks permette anche ad utenti non amministrativi di installare dei pacchetti rock locali (solitamente in <u>%APPDATA%/luarocks/rocks/</u>), mentre con l&#8217;opzione <em>/FORCECONFIG </em>verr&#224; considerato un unico file di configurazione, quello specificato da <em>/CONFIG</em>, e un unico path per l&#8217;installazione di rock e script a livello di sistema, specificati rispettivamente da <em>/TREE</em> e <em>/SCRIPT</em>. Potete fare riferimento alla documentazione per un approfondimento in merito.</li>
<li>La directory <u>C:\Programmi\Lua\5.1</u> viene automaticamente aggiunta al PATH di sistema dall&#8217;installer di LfW per cui possiamo creare un hardlink ai file <u>luarocks.bat</u> e <u>luarocks-admin.bat</u> con il fine di poter invocare gli stessi pi&#249; comodamente dalla shell. Da Windows XP in avanti si pu&#242; operare come segue:
<p><code>cd C:\Programmi\Lua\5.1\LuaRocks\0.6<br />
        fsutil hardlink create ../../luarocks.bat luarocks.bat<br />
        fsutil hardlink create ../../luarocks-admin.bat luarocks-admin.bat</code>       </li>
<li>Modificare la variabile di sistema <em>LUA_PATH</em> <strong>aggiungendo</strong> ai path gi&#224; impostati da LfW il seguente percorso per il caricamento dei file della libreria LuaRocks:
<p><code>C:\Programmi\Lua\5.1\LuaRocks\0.6\lua\?.lua</code> </li>
</ul>
<p>Ora LuaRocks &#232; installato e funzionante, basta aprire la shell dei comandi e lanciare <em>luarocks search &#8211;all</em> per visualizzare tutti i pacchetti rock disponibili sul server (&#232; disponibile anche <a title="Available rocks" href="http://luarocks.luaforge.net/rocks/">un elenco consultabile</a> pi&#249; comodamente) e <em>luarocks install nomepacchetto</em> per installare i pacchetti rock nel sistema. A questo punto negli script Lua baster&#224; aggiungere la riga <em>require &quot;luarocks.require&quot;</em> che si occuper&#224; di effettuare l&#8217;override della funzione require standard di Lua, rendendo possibile il caricamento delle librerie installate tramite LuaRocks. Alternativamente si pu&#242; ottenere lo stesso risultato lanciando cos&#236; l&#8217;interprete: <em>lua -lluarocks.require</em></p>
<p>Ecco un esempio di come sfruttare una libreria installata tramite LuaRocks:</p>
<p>
<div class="wlWriterSmartContent" id="scid:F2210F5F-69EB-4d4c-AFF7-B8A050E9CC72:03205ce6-3677-4dd8-97a2-d45552f04dcf" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre  style="width:100%;;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000;">--</span><span style="color: #008000;"> luarocks install colors</span><span style="color: #008000;">
</span><span style="color: #000000;">
</span><span style="color: #FF00FF;">require</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">luarocks.require</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
</span><span style="color: #FF00FF;">require</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">colors</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">

green </span><span style="color: #000000;">=</span><span style="color: #000000;"> colors.new(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">#0f8923</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)

</span><span style="color: #FF00FF;">print</span><span style="color: #000000;">(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Verdolino:</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, green)    </span><span style="color: #008000;">--</span><span style="color: #008000;"> Verdolino:    #0f8923</span></div>
</pre>
</div>
<p>LuaRocks con l&#8217;ultima release ha raggiunto un livello di maturit&#224; accettabile e l&#8217;elenco delle librerie disponibili sotto forma di pacchetti rock &#232; in lento ma costante aumento, ma ci sono alcune applicazioni o framework che ne traggono beneficio per l&#8217;installazione e la gestione delle loro dipendenze come per esempio <a title="Kepler: The Lua Web Development Platform" href="http://www.keplerproject.org/kepler/">Kepler</a> (un framework per lo sviluppo web generico in Lua), <a title="Orbit" href="http://orbit.luaforge.net/">Orbit</a> (un altro framework per lo sviluppo web in Lua, ma MVC oriented) e <a title="Sputnik: An Extensible Wiki (in Lua)" href="http://sputnik.freewisdom.org/">Sputnik</a> (un wiki scritto in Lua, leggero ma estendibile). Per la cronaca, ecco invece <a title="Installazione e configurazione dell&#8217;interprete LUA in Windows" href="http://www.clorophilla.net/blog/?p=278">cosa si era costretti a fare</a> solamente un anno fa per avere un&#8217;installazione minimale di Lua in Windows e cominciare ad aggiungere librerie come LuaSocket.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.clorophilla.net/blog/?feed=rss2&#038;p=390</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: basic
Object Caching 906/1101 objects using apc

 Served from: www.clorophilla.net @ 2013-06-19 21:50:50 by W3 Total Cache -->