<?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>SIMOTRONE WEB PAGE &#187; Binary People</title>
	<atom:link href="http://www.simotrone.it/category/informatica/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simotrone.it</link>
	<description>Simotrone is always here!</description>
	<lastBuildDate>Sat, 04 Feb 2012 18:30:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Mojolicious respond_to</title>
		<link>http://www.simotrone.it/2012/02/04/mojolicious-respond_to/</link>
		<comments>http://www.simotrone.it/2012/02/04/mojolicious-respond_to/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 16:21:07 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[Mojolicious]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3755</guid>
		<description><![CDATA[Mentre la bufera di neve torna ad affliggere Bologna, io giochicchio con Mojolicious e mi segno un paio di note. Per provare a scimmiottare un&#8217;interfaccia REST seria, m&#8217;ero costruito a colpi di given un controller che generava la risposta in funzione dell&#8217;attributo format dello stash (solite cose: html, json, xml); per altro, poichè non stavo [...]]]></description>
			<content:encoded><![CDATA[<p>Mentre la bufera di neve torna ad affliggere Bologna, io giochicchio con Mojolicious e mi segno un paio di note.</p>
<p>Per provare a scimmiottare un&#8217;interfaccia REST seria, m&#8217;ero costruito a colpi di <strong>given</strong> un controller che generava la risposta in funzione dell&#8217;attributo format dello stash (solite cose: html, json, xml); per altro, poichè non stavo usando &#8220;<em>the right way</em>&#8221; mi stavo pure scontrando con alcune difficoltà implementative (1).</p>
<p>In realtà esiste un comodissimo metodo <a href="http://mojolicio.us/perldoc/Mojolicious/Controller#respond_to">respond_to</a> che già compie questa selezione internamente (il <a href="https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L397">codice</a>).</p>
<p>Dato questo codice:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="co1">#!/usr/bin/env perl</span><br />
<span class="kw2">use</span> Mojolicious::<span class="me2">Lite</span>;<br />
get <span class="st0">&#8216;/test&#8217;</span> =&gt; <span class="kw2">sub</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">my</span> <span class="re0">$self</span> = <a href="http://perldoc.perl.org/functions/shift.html"><span class="kw3">shift</span></a>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">my</span> <span class="re0">$data</span> = <span class="br0">&#123;</span> a =&gt; <span class="nu0">1</span>, b =&gt; <span class="nu0">2</span>, c =&gt; <span class="nu0">3</span> <span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$self</span>-&gt;<span class="me1">respond_to</span><span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; json =&gt; <span class="br0">&#123;</span> json =&gt; <span class="re0">$data</span> <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; html =&gt; <span class="br0">&#123;</span> text =&gt; <span class="re0">$self</span>-&gt;<span class="me1">dumper</span><span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span> <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span>;<br />
app-&gt;<span class="me1">start</span>;</div>
</div>
<p>possiamo ottenere diverse risposte:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span> sim@titanio:/tmp$ mojo get -v -H <span class="st0">&#8216;Accept: text/html&#8217;</span> <span class="st0">&#8216;http://localhost:3001/test&#8217;</span><br />
GET /<span class="kw3">test</span> HTTP/<span class="nu0">1.1</span><br />
User-Agent: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Accept: text/html<br />
Content-Length: <span class="nu0">0</span><br />
Host: localhost:<span class="nu0">3001</span></p>
<p>HTTP/<span class="nu0">1.1</span> <span class="nu0">200</span> OK<br />
X-Powered-By: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Type: text/html;<span class="re2">charset=</span>UTF<span class="nu0">-8</span><br />
Connection: keep-alive<br />
Date: Sat, <span class="nu0">04</span> Feb <span class="nu0">2012</span> <span class="nu0">15</span>:<span class="nu0">33</span>:<span class="nu0">23</span> GMT<br />
Server: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">39</span></p>
<p><span class="br0">&#123;</span><br />
&nbsp; <span class="st0">&#8216;c&#8217;</span> =&gt; <span class="nu0">3</span>,<br />
&nbsp; <span class="st0">&#8216;a&#8217;</span> =&gt; <span class="nu0">1</span>,<br />
&nbsp; <span class="st0">&#8216;b&#8217;</span> =&gt; <span class="nu0">2</span><br />
<span class="br0">&#125;</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<span class="br0">&#40;</span><span class="nu0">2</span><span class="br0">&#41;</span> sim@titanio:/tmp$ mojo get -v -H <span class="st0">&#8216;Accept: application/json&#8217;</span> <span class="st0">&#8216;http://localhost:3001/test&#8217;</span><br />
GET /<span class="kw3">test</span> HTTP/<span class="nu0">1.1</span><br />
User-Agent: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Accept: application/json<br />
Content-Length: <span class="nu0">0</span><br />
Host: localhost:<span class="nu0">3001</span></p>
<p>HTTP/<span class="nu0">1.1</span> <span class="nu0">200</span> OK<br />
X-Powered-By: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Type: application/json<br />
Connection: keep-alive<br />
Date: Sat, <span class="nu0">04</span> Feb <span class="nu0">2012</span> <span class="nu0">15</span>:<span class="nu0">34</span>:<span class="nu0">01</span> GMT<br />
Server: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">19</span></p>
<p><span class="br0">&#123;</span><span class="st0">&quot;c&quot;</span>:<span class="nu0">3</span>,<span class="st0">&quot;a&quot;</span>:<span class="nu0">1</span>,<span class="st0">&quot;b&quot;</span>:<span class="nu0">2</span><span class="br0">&#125;</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<span class="br0">&#40;</span><span class="nu0">3</span><span class="br0">&#41;</span> sim@titanio:/tmp$ mojo get -v -H <span class="st0">&#8216;Accept: text/plain&#8217;</span> <span class="st0">&#8216;http://localhost:3001/test&#8217;</span>GET /<span class="kw3">test</span> HTTP/<span class="nu0">1.1</span><br />
User-Agent: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Accept: text/plain<br />
Content-Length: <span class="nu0">0</span><br />
Host: localhost:<span class="nu0">3001</span></p>
<p>HTTP/<span class="nu0">1.1</span> <span class="nu0">204</span> No Content<br />
X-Powered-By: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Connection: keep-alive<br />
Date: Sat, <span class="nu0">04</span> Feb <span class="nu0">2012</span> <span class="nu0">15</span>:<span class="nu0">34</span>:<span class="nu0">40</span> GMT<br />
Server: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">0</span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<span class="br0">&#40;</span><span class="nu0">4</span><span class="br0">&#41;</span> sim@titanio:/tmp$ mojo get -v -H <span class="st0">&#8216;Accept: text/plainz&#8217;</span> <span class="st0">&#8216;http://localhost:3001/test&#8217;</span><br />
GET /<span class="kw3">test</span> HTTP/<span class="nu0">1.1</span><br />
User-Agent: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Accept: text/plainz<br />
Content-Length: <span class="nu0">0</span><br />
Host: localhost:<span class="nu0">3001</span></p>
<p>HTTP/<span class="nu0">1.1</span> <span class="nu0">200</span> OK<br />
X-Powered-By: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Type: text/html;<span class="re2">charset=</span>UTF<span class="nu0">-8</span><br />
Connection: keep-alive<br />
Date: Sat, <span class="nu0">04</span> Feb <span class="nu0">2012</span> <span class="nu0">15</span>:<span class="nu0">35</span>:<span class="nu0">15</span> GMT<br />
Server: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">39</span></p>
<p><span class="br0">&#123;</span><br />
&nbsp; <span class="st0">&#8216;c&#8217;</span> =&gt; <span class="nu0">3</span>,<br />
&nbsp; <span class="st0">&#8216;a&#8217;</span> =&gt; <span class="nu0">1</span>,<br />
&nbsp; <span class="st0">&#8216;b&#8217;</span> =&gt; <span class="nu0">2</span><br />
<span class="br0">&#125;</span></div>
</div>
<p>Le prime tre sono corrette, poichè dati determinati header ottengo le risposte giuste:</p>
<ol>
<li>text/html &#8211; 200</li>
<li>application/json &#8211; 200</li>
<li>text/plain &#8211; 204 &#8211; nessuna rappresentazione corretta</li>
</ol>
<p>Il quarto a mio avviso è un <em>fail</em>, o meglio una scelta discutibile: invece che riconoscere l&#8217;header sbagliato  e mandare a spendere il client con un 204, gli serviamo html.</p>
<p>Benchè alla fine di quel metodo venga restituito un 204 se il $target non esite (<a href="https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L423">#L423</a>), il gioco &#8220;sporco&#8221; accade <a href="https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L406">20 righe prima</a> dove nel caso la rappresentazione passata non venga individuata, si ricade nella situazione di default (html di solito). Il problema a questo punto si incrocia con la possibilità che Mojolicious non abbia dentro di se la rappresentazione corretta benchè sia comune (openoffice, pdf &#8211; che forse ora sono stati inseriti, non so), cosa che può portare a conclusioni di default anche quando la rappresentazione richiesta è corretta ma non presente nei tipi di Mojo. In ogni caso, si può sempre aggiungere qualcosa ai <a href="http://mojolicio.us/perldoc/Mojolicious/Types">MIME</a>. </p>
<p>Ho comunque poi scoperto che la cosa è stata <a href="https://github.com/kraih/mojo/issues/237">discussa in passato</a> ed è stato deciso così.<br />
Well, basta saperlo. <img src='http://www.simotrone.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PS: Io avrei lasciato i client mal fatti nel loro brodo, ma tant&#8217;è &#8211; probabilmente non capisco bene le implicazioni.</p>
<p>Note:<br />
(1) Le <a href="http://mojolicio.us/perldoc/Mojolicious/Routes">rotte</a> in Mojolicious permettono di selezionare il formato utilizzando un <em>array reference</em></p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">get <span class="st0">&#8216;/formats&#8217;</span> =&gt; <span class="br0">&#91;</span><a href="http://perldoc.perl.org/functions/format.html"><span class="kw3">format</span></a> =&gt; <span class="br0">&#91;</span><span class="st0">&#8216;html&#8217;</span>,<span class="st0">&#8216;xml&#8217;</span><span class="br0">&#93;</span><span class="br0">&#93;</span> =&gt; <span class="kw2">sub</span> <span class="br0">&#123;</span> <span class="br0">&#125;</span>;</div>
</div>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">sim@titanio:/tmp$ <span class="kw2">perl</span> myapp.pl routes -v<br />
/formats &nbsp;GET &nbsp;formats &nbsp;^/formats\.<span class="br0">&#40;</span>xml|html<span class="br0">&#41;</span>$</div>
</div>
<p>ma, come si vede dalla regex, questo fa sì che la rotta &#8220;pulita&#8221; diventi &#8220;/formats.&#8221; che non è proprio quello che si vuole, di solito.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/02/04/mojolicious-respond_to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTP RESTful</title>
		<link>http://www.simotrone.it/2012/01/31/http-restful/</link>
		<comments>http://www.simotrone.it/2012/01/31/http-restful/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 17:25:57 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3750</guid>
		<description><![CDATA[Da un po&#8217; di tempo a questa parte tutti i web framework presentano riferimenti all&#8217;architettura REST che propone di sfruttare completamente (?) le potenzialità del protocollo HTTP senza livelli aggiuntivi (ie SOAP). Domande e risposte su stackoverflow Steve Klabnik: e Haters gonna HATEOAS Dr. Elkstein: What is REST? R. T. Fielding: REST APIs must be [...]]]></description>
			<content:encoded><![CDATA[<p>Da un po&#8217; di tempo a questa parte tutti i web framework presentano riferimenti all&#8217;architettura <a href="http://en.wikipedia.org/wiki/Representational_state_transfer">REST</a> che propone di sfruttare completamente (?) le potenzialità del protocollo HTTP senza livelli aggiuntivi (ie SOAP).</p>
<ul>
<li><a href="http://stackoverflow.com/questions/2001773/understanding-rest-verbs-error-codes-and-authentication">Domande e risposte su stackoverflow</a></li>
<li>Steve Klabnik: <a href="http://blog.steveklabnik.com/posts/2011-07-03-nobody-understands-rest-or-http"></a> e <a href="http://timelessrepo.com/haters-gonna-hateoas">Haters gonna HATEOAS</a></li>
<li>Dr. Elkstein: <a href="http://rest.elkstein.org/2008/02/what-is-rest.html">What is REST?</a></li>
<li>R. T. Fielding: <a href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven">REST APIs must be hypertext-driven</a></li>
</ul>
<p>Poi, se proprio vogliamo farci del male&#8230; <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm">Architectural Styles and the Design of Network-based Software Architectures</a> di <a href="http://www.ics.uci.edu/~fielding/">Roy T. Fielding</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/01/31/http-restful/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moose::Roles</title>
		<link>http://www.simotrone.it/2012/01/18/mooseroles/</link>
		<comments>http://www.simotrone.it/2012/01/18/mooseroles/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 22:29:14 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[moose]]></category>
		<category><![CDATA[Moose::Role]]></category>
		<category><![CDATA[object oriented]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[ruoli]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3745</guid>
		<description><![CDATA[Ho rispolverato alcuni appunti cartacei relativi i Ruoli di Perl Moose che riporto qui. I ruoli rappresentano comportamenti condivisi fra le classi La classe fa ciò che dice il ruolo. I ruoli non sono classi; infatti i ruoli non si ereditano e non si istanziano. I ruoli vengono consumati da classi o da altri ruoli. [...]]]></description>
			<content:encoded><![CDATA[<p>Ho rispolverato alcuni appunti cartacei relativi i Ruoli di Perl Moose che riporto qui.</p>
<ul>
<li>I ruoli rappresentano comportamenti condivisi fra le classi</li>
<li>La classe fa ciò che dice il ruolo.</li>
<li>I ruoli <strong>non</strong> sono classi; infatti i ruoli non si ereditano e non si istanziano.</li>
<li>I ruoli vengono <strong>consumati</strong> da classi o da altri ruoli.</li>
<li>I ruoli sono <strong>composti</strong> in una classe con la funzione <em>with</em>.</li>
<li>Tutti i metodi, modificatori, attributi definiti in un ruolo sono aggiunti direttamente alla classe che consuma il ruolo.</li>
<li>Attributi e metodi appariranno come se fossero definiti nella classe.</li>
<li>Una sottoclasse della classe consumata (cioè con il ruolo) eredita tutti questi metodi/attributi.</li>
</ul>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><a href="http://perldoc.perl.org/functions/package.html"><span class="kw3">package</span></a> Breakable;<br />
<span class="kw2">use</span> Moose::<span class="me2">Role</span>;</p>
<p>has <span class="st0">&#8216;is_broken&#8217;</span> =&gt; <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; is &nbsp;=&gt; <span class="st0">&#8216;rw&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; isa =&gt; <span class="st0">&#8216;Bool&#8217;</span>,<br />
<span class="br0">&#41;</span>;</p>
<p><span class="kw2">sub</span> break <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">my</span> <span class="re0">$self</span> = <a href="http://perldoc.perl.org/functions/shift.html"><span class="kw3">shift</span></a>;<br />
&nbsp; &nbsp; &nbsp; <a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="st0">&quot;I broke<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; <span class="re0">$self</span>-&gt;<span class="me1">is_broken</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><a href="http://perldoc.perl.org/functions/package.html"><span class="kw3">package</span></a> Car;<br />
<span class="kw2">use</span> Moose;<br />
with <span class="st0">&#8216;Breakable&#8217;</span>;</p>
<p>has <span class="st0">&#8216;engine&#8217;</span> =&gt; <span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; is &nbsp;=&gt; <span class="st0">&#8216;ro&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; isa =&gt; <span class="st0">&#8216;Engine&#8217;</span>,<br />
<span class="br0">&#41;</span>;</div>
</div>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw1">my</span> <span class="re0">$car</span> = Car-&gt;<span class="me1">new</span><span class="br0">&#40;</span> engine =&gt; Engine-&gt;<span class="me1">new</span> <span class="br0">&#41;</span>;<br />
<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="re0">$car</span>-&gt;<span class="me1">is_broken</span> ? <span class="st0">&#8216;Busted&#8217;</span> : <span class="st0">&#8216;Still working&#8217;</span>; &nbsp; <span class="co1"># Still working</span><br />
<span class="re0">$car</span>-&gt;<span class="me1">break</span>; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co1"># I broke</span><br />
<a href="http://perldoc.perl.org/functions/print.html"><span class="kw3">print</span></a> <span class="re0">$car</span>-&gt;<span class="me1">is_broken</span> ? <span class="st0">&#8216;Busted&#8217;</span> : <span class="st0">&#8216;Still working&#8217;</span>; &nbsp; <span class="co1"># Busted</span><br />
<span class="re0">$car</span>-&gt;<span class="me1">does</span><span class="br0">&#40;</span><span class="st0">&#8216;Breakable&#8217;</span><span class="br0">&#41;</span></div>
</div>
<p>Riferimenti:</p>
<ul>
<li>Moose::Role</li>
<li><a href="http://search.cpan.org/~doy/Moose-2.0401/lib/Moose/Manual/Roles.pod">Moose::Manual::Roles</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/01/18/mooseroles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaTeX in Debian</title>
		<link>http://www.simotrone.it/2012/01/16/latex-in-debian/</link>
		<comments>http://www.simotrone.it/2012/01/16/latex-in-debian/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 06:25:48 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3735</guid>
		<description><![CDATA[LaTeX è un linguaggio di markup basato sul TeX &#8211; un programma di tipografia digitale progettato da Donald Knuth. I pacchetti relativi tex minimi su Debian sono i seguenti (discendono dall&#8217;installazione di texlive-base, e dipendono dalla distribuzione textlive): libkpathsea5 luatex tex-common Pacchetto con file in comune e documentazione generica su TeX e Debian texlive-common texlive-doc-base [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://it.wikipedia.org/wiki/LaTeX">LaTeX</a> è un linguaggio di markup basato sul <a href="http://it.wikipedia.org/wiki/TeX">TeX</a> &#8211; un programma di tipografia digitale progettato da <a href="http://it.wikipedia.org/wiki/Donald_Knuth">Donald Knuth</a>.</p>
<p>I pacchetti relativi tex minimi su Debian sono i seguenti (discendono dall&#8217;installazione di texlive-base, e dipendono dalla distribuzione textlive):</p>
<dl>
<dt>libkpathsea5</dt>
<dd></dd>
<dt>luatex</dt>
<dd></dd>
<dt>tex-common</dt>
<dd>Pacchetto con file in comune e documentazione generica su TeX e Debian</dd>
<dt>texlive-common</dt>
<dt>texlive-doc-base</dt>
<dd><a href="http://tug.org/texlive/doc/texlive-en/texlive-en.html">Documentazione TeX Live</a></dd>
<dt>texlive-binaries</dt>
<dt><a href="http://packages.debian.org/sid/texlive-base">texlive-base</a></dt>
</dl>
<p>Pacchetti necessari per usare LaTeX.</p>
<dl>
<dt><a href="http://packages.debian.org/sid/texlive-latex-base">texlive-latex-base</a></dt>
<dt><a href="http://packages.debian.org/sid/texlive-latex-recommended">texlive-latex-recommended</a></dt>
</dl>
<p>Pacchetti aggiuntivi.</p>
<dl>
<dt>preview-latex-style</dt>
<dt>texlive-pictures</dt>
<dt>texlive-latex-extra</dt>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/01/16/latex-in-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmer Competency Matrix</title>
		<link>http://www.simotrone.it/2012/01/12/programmer-competency-matrix/</link>
		<comments>http://www.simotrone.it/2012/01/12/programmer-competency-matrix/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 07:03:51 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3728</guid>
		<description><![CDATA[Ho trovato interessante il tabellone linkato perchè almeno può dare una direzione da seguire per colmare quel che manca.]]></description>
			<content:encoded><![CDATA[<p>Ho trovato interessante il tabellone <a href="http://www.starling-software.com/employment/programmer-competency-matrix.html">linkato</a> perchè almeno può dare una direzione da seguire per colmare quel che manca. <img src='http://www.simotrone.it/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://img269.imageshack.us/img269/2571/zzzkx.jpg" alt="grafici" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/01/12/programmer-competency-matrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protocollo HTTP</title>
		<link>http://www.simotrone.it/2012/01/06/protocollo-http/</link>
		<comments>http://www.simotrone.it/2012/01/06/protocollo-http/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 23:59:48 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[protocolli]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3711</guid>
		<description><![CDATA[Smanettando con Mojolicious, mi sono ritrovato a guardare meglio il protocollo http (rfc 2616), che in effetti ho sempre usato ma approfondito poco. Un po&#8217; di info estese si possono trovare su wikipedia, ma in sostanza HTTP è un protocollo che si basa su richieste di uno user agent (client) e risposte di un web [...]]]></description>
			<content:encoded><![CDATA[<p>Smanettando con <a href="http://mojolicio.us/">Mojolicious</a>, mi sono ritrovato a guardare meglio il protocollo http (<a href="http://tools.ietf.org/html/rfc2616">rfc 2616</a>), che in effetti ho sempre usato ma approfondito poco.<br />
Un po&#8217; di info estese si possono trovare su <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">wikipedia</a>, ma in sostanza HTTP è un protocollo che si basa su richieste di uno user agent (client) e risposte di un web server (server).</p>
<p>Generalmente ad una richiesta del client segue una risposta del server che può fornire risorse di qualunque genere, anche se generalmente server file HTML &#8211; interpretati poi dal client; un messaggio di risposta contiene informazioni sullo stato (attraverso un codice numerico), vari header, e eventualmente un contenuto.</p>
<p>Le risorse HTTP sono identificate da URI (Uniform Resource Identifiers) o, più precisamente, URL (Uniform Resource Locators) che ne permettono la chiamata.</p>
<p>La principale differenza fra la versione del protocollo 1.0 e la 1.1 è che la specifica più recente permette di riutilizzare la medesima connessione più volte &#8211; mentre la versione più antica richiedeva una connessione separata per ogni transazione richiesta-risposta.</p>
<h2>Richiesta</h2>
<p>Un messaggio di richiesta può presentarsi come segue:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">sim@titanio:~/dev/<span class="kw2">perl</span>/homerun$ ./homerun.pl get &#8211;verbose <span class="st0">&#8216;/get/20120105_002516.jpg&#8217;</span> <span class="nu0">2</span>&gt;&amp;<span class="nu0">1</span>| <span class="kw2">cat</span> | <span class="kw2">head</span> -n13<br />
GET /get/20120105_002516.jpg HTTP/<span class="nu0">1.1</span><br />
User-Agent: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">0</span><br />
Host: localhost:<span class="nu0">19987</span></div>
</div>
<p>La richiesta presenta un metodo, un URI e un protocollo, alcuni header aggiuntivi, e la linea &#8220;Host:&#8221; che determina a chi stiamo chiedendo la risorsa (obbligatorio nella v. 1.1).</p>
<h2>Risposta</h2>
<p>La risposta del server alla nostra richiesta è la parte interessante. In cima c&#8217;è lo status della risposta, seguito da una serie di header che possono fornire informazioni aggiuntive di vario genere; infine, dopo una riga vuota, segue il corpo.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">HTTP/<span class="nu0">1.1</span> <span class="nu0">200</span> OK<br />
X-Powered-By: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Connection: keep-alive<br />
Date: Thu, <span class="nu0">05</span> Jan <span class="nu0">2012</span> <span class="nu0">22</span>:<span class="nu0">57</span>:<span class="nu0">04</span> GMT<br />
Server: Mojolicious <span class="br0">&#40;</span>Perl<span class="br0">&#41;</span><br />
Content-Length: <span class="nu0">22880</span></div>
</div>
<p>Un body se presente mandato via HTTP request o response è in un formato codificato definito dagli header.<br />
Quando un corpo (entity-body indica l&#8217;insieme di oggetti serviti come corpo &#8211; compresa ad esempio una codifica di sicurezza) è incluso in un messaggio, il tipo del body è determinato via Content-Type e Content-Encoding.<br />
Il Content-Type specifica il tipo di media e l&#8217;Encoding può essere usato per, ad esempio, compressioni applicate ai dati; non vi è alcun Content-Encoding di default.</p>
<p>Qualunque messaggio HTTP/1.1 contenga un body dovrebbe includere un Content-Type: in caso di mancanza, il client può provare a capire cosa gli viene mandato; se l&#8217;ispezione non ha successo, il ricevente dovrebbe trattare il file come &#8220;application/octet-stream&#8221;.<br />
Anche il Content-Length è molto importante perchè fornisce informazioni sul numero di byte passati.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2012/01/06/protocollo-http/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CJK Unified Ideographs</title>
		<link>http://www.simotrone.it/2011/12/11/cjk-unified-ideographs/</link>
		<comments>http://www.simotrone.it/2011/12/11/cjk-unified-ideographs/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 12:15:22 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[japanese fonts]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3695</guid>
		<description><![CDATA[Volevo vedere questa gamma di caratteri nei browser su titanio, e ho dunque installato i pacchetti debian ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy It works!]]></description>
			<content:encoded><![CDATA[<p>Volevo vedere <a href="http://www.kreativekorp.com/charset/unicode.php?block=8aad">questa gamma di caratteri</a> nei browser su titanio, e ho dunque installato i pacchetti debian</p>
<ul>
<li>ttf-wqy-microhei</li>
<li> ttf-wqy-zenhei</li>
<li>xfonts-wqy</li>
</ul>
<p>It works!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2011/12/11/cjk-unified-ideographs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>oss-compat</title>
		<link>http://www.simotrone.it/2011/12/06/oss-compat/</link>
		<comments>http://www.simotrone.it/2011/12/06/oss-compat/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 06:19:47 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[oss-compat]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3689</guid>
		<description><![CDATA[The purpose of this package is for applications that only support OSS to depend on it, hence preventing common &#8220;/dev/dsp not found&#8221; errors that would confuse unexperienced users. sim@titanio:~$ apt-cache show oss-compat Package: oss-compat Version: 0.0.6 Installed-Size: 72 Maintainer: Debian Games Team Architecture: all Depends: module-init-tools &#124; hurd Description: Open Sound System (OSS) compatibility package [...]]]></description>
			<content:encoded><![CDATA[<p>The purpose of this package is for applications that only support OSS to depend on it, hence preventing common &#8220;/dev/dsp not found&#8221; errors that would confuse unexperienced users.</p>
<pre>sim@titanio:~$ apt-cache show oss-compat
Package: oss-compat
Version: 0.0.6
Installed-Size: 72
Maintainer: Debian Games Team
<pkg-games-devel@lists.alioth.debian.org>
Architecture: all
Depends: module-init-tools | hurd
Description: Open Sound System (OSS) compatibility package
 This package ensures that Open Sound System support is provided in
 some way. On Linux, it enables the ALSA compatibility modules. On
 other kernels where OSS is the default interface, no action is
 taken.
 .
 The purpose of this package is for applications that only support OSS
 to depend on it, hence preventing common "/dev/dsp not found" errors
 that would confuse unexperienced users.
Tag: admin::configuring, role::app-data, special::auto-inst-parts,
works-with::audio
Section: sound
Priority: extra
Filename: pool/main/o/oss-compat/oss-compat_0.0.6_all.deb
Size: 3962
MD5sum: 888fa2d88f12049faecaf61792281f0b
SHA1: 4aad2073ba67303f9fd22fcad502cf6d72b9a757
SHA256: 171cb887c9e9152f5974cecb94f53ee181ca542a8814cdd9f00d2f40ab0b9bfe</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2011/12/06/oss-compat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualizzare utf-8 con Perl</title>
		<link>http://www.simotrone.it/2011/12/02/visualizzare-utf-8-con-perl/</link>
		<comments>http://www.simotrone.it/2011/12/02/visualizzare-utf-8-con-perl/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 06:39:52 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3680</guid>
		<description><![CDATA[Trovata qua una riga di comando che mostra un po&#8217; di caratteri utf-8 con Perl. $ perl -CS -e &#8216; &#160; &#160; for ($i = 128; $i &#60; 11_620; $i++) { &#160; &#160; &#160; &#160; print chr $i, $i%30 ? &#34; &#34; : &#34;\n$i &#34; &#160; &#160; }; &#160; &#160; print &#34;\n&#34; &#160;&#8217;]]></description>
			<content:encoded><![CDATA[<p>Trovata <a href="http://fruit.je/utf-8">qua</a> una riga di comando che mostra un po&#8217; di caratteri utf-8 con Perl.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">$ perl -CS -e <span class="st0">&#8216;<br />
&nbsp; &nbsp; for ($i = 128; $i &lt; 11_620; $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; print chr $i, $i%30 ? &quot; &quot; : &quot;\n$i &quot;<br />
&nbsp; &nbsp; };<br />
&nbsp; &nbsp; print &quot;\n&quot;<br />
&nbsp;&#8217;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2011/12/02/visualizzare-utf-8-con-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Il bello della tecnologia vecchia&#8230;</title>
		<link>http://www.simotrone.it/2011/11/30/il-bello-della-tecnologia-vecchia/</link>
		<comments>http://www.simotrone.it/2011/11/30/il-bello-della-tecnologia-vecchia/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 20:38:16 +0000</pubDate>
		<dc:creator>Simotrone</dc:creator>
				<category><![CDATA[Binary People]]></category>
		<category><![CDATA[nVidia]]></category>
		<category><![CDATA[scheda video]]></category>

		<guid isPermaLink="false">http://www.simotrone.it/?p=3685</guid>
		<description><![CDATA[.. è che costa poco. Mi è morta la GF 8600 GT di cui avevo scritto qui. Che nostalgia vedere le mie prime box &#8220;fatte a mano&#8221;&#8230; 2007. Uh. Comunque non funzica più, e ora voglio trovare qualcosa di analogo non avendo alcuna necessità grafica. Dovrebbe essere una cosa semplice ed economica. ^_^ Vediamo un [...]]]></description>
			<content:encoded><![CDATA[<p>.. è che costa poco. <img src='http://www.simotrone.it/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Mi è morta la GF 8600 GT di cui avevo scritto <a href="http://www.simotrone.it/2007/10/05/nuovo-pc-winz/">qui</a>.<br />
Che nostalgia vedere le mie prime box &#8220;fatte a mano&#8221;&#8230; 2007. Uh.</p>
<p>Comunque non funzica più, e ora voglio trovare qualcosa di analogo non avendo alcuna necessità grafica.<br />
Dovrebbe essere una cosa semplice ed economica. ^_^ Vediamo un po&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simotrone.it/2011/11/30/il-bello-della-tecnologia-vecchia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

