<?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>Naufraghi nella rete &#187; software libero</title>
	<atom:link href="http://www.slug.it/naufraghi/tag/software-libero/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slug.it/naufraghi</link>
	<description>… dolce m’è il naufragar in questo mare?</description>
	<lastBuildDate>Fri, 03 Feb 2012 16:10:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>F2PY rulez!</title>
		<link>http://www.slug.it/naufraghi/f2py-rulez/</link>
		<comments>http://www.slug.it/naufraghi/f2py-rulez/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 18:37:36 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[Generale]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/?p=567</guid>
		<description><![CDATA[I recently found some old Fortran code from the paper Algorithm AS197 A Fast Algorithm for the Exact Likelihood of Autoregressive-Moving Average Models (Melard 1984) [pdf] [code]. I&#8217;m not very fluent in Fortran77 and I don&#8217;t like the idea of &#8230; <a href="http://www.slug.it/naufraghi/f2py-rulez/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently found some old Fortran code from the paper <em>Algorithm AS197 A Fast Algorithm for the Exact Likelihood of Autoregressive-Moving Average Models (Melard 1984)</em> [<a href="http://www.stat.berkeley.edu/classes/s244/as197.pdf">pdf</a>] [<a href="http://lib.stat.cmu.edu/apstat/197">code</a>].</p>
<p>I&#8217;m not very fluent in Fortran77 and I don&#8217;t like the idea of rewriting a well tested piece of code introducing new bugs, so why not give a try to <a href="http://www.scipy.org/F2py">F2PY</a>?</p>
<blockquote><p>F2PY is a tool that provides an easy connection between Python and Fortran languages. F2PY is part of <a href="http://www.scipy.org/NumPy">NumPy</a>.<br />
F2PY creates extension modules from (handwritten or F2PY generated) signature files or directly from Fortran sources.</p></blockquote>
<p><a href="http://www.slug.it/naufraghi/ingegneria/interface-legacy-fortran-code-from-python-with-f2py/">Continue&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/f2py-rulez/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone TPM? Linguaggi interpretati all&#8217;arrembaggio!</title>
		<link>http://www.slug.it/naufraghi/iphone-tpm-linguaggi-interpretati-allarrembaggio/</link>
		<comments>http://www.slug.it/naufraghi/iphone-tpm-linguaggi-interpretati-allarrembaggio/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 11:02:58 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[Generale]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/iphone-drm-linguaggi-interpretati-allarrembaggio/</guid>
		<description><![CDATA[La voglia è tanta&#8230; ma questa cosa del TPM rende mooolto più facile la tattica della &#8220;volpe e l&#8217;uva&#8221;! Da sviluppatore è proprio inconcepibile avere un oggetto, con un sistema operativo, un SDK, ottima documentazione, e&#8230; non poter provare un &#8230; <a href="http://www.slug.it/naufraghi/iphone-tpm-linguaggi-interpretati-allarrembaggio/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fsf.org/blogs/community/5-reasons-to-avoid-iphone-3g"><img src="http://www.fsf.org/blogs/community/5-reasons-to-avoid-iphone-3g/iphone3g-small.png" class="alignleft" /></a></p>
<p>La voglia è tanta&#8230; ma questa cosa del TPM rende mooolto più facile la tattica della &#8220;volpe e l&#8217;uva&#8221;!</p>
<p>Da sviluppatore è proprio inconcepibile avere un oggetto, con un sistema operativo, un SDK, ottima documentazione, e&#8230; non poter provare un programma sul MIO dispositivo senza avergli fatto fare una giratina virtuale per prendere una firma a Cupertino (99€/anno per lo scomodo)!!</p>
<p>Poi un pensiero: «Perché mai iPhone è uscito senza Java?»</p>
<p>Ma è facile, perché con Java basta avere una Virtual Machine firmata per far girare tutti i programmi del mondo, e ciao ciao AppStore! Stessa cosa per Python-Ruby-Perl!</p>
<p>Quindi TPM mio caro, non hai un gran futuro! (spero!, non ho indagato a fondo, ma credo che il controllo sia per processo e non per&#8230; boh, sul linking dinamico o che sò)</p>
<p><span id="more-225"></span></p>
<p>A volte mi trovo a non riuscire a spiegare quale sia e quanto sia profondo il limite di questa scelta di Apple per la &#8220;libertà&#8221; del compratore.</p>
<p>Molti rispondono «Ma quando mai avrò bisogno di scrivere un programma per il mio cellulare?», però anche se non è evidente, quello che sta vendendo Apple, nel mondo delle auto sarebbe come comprare una bella macchina, pagarla più del suo prezzo (perché la tecnologia equivalente la trovate a giro anche a molto meno) e come &#8220;bonus&#8221; per la spesa maggiorata, poter fare il pieno solo da Agip!</p>
<p>La comprereste?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/iphone-tpm-linguaggi-interpretati-allarrembaggio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone&#8230;</title>
		<link>http://www.slug.it/naufraghi/iphone/</link>
		<comments>http://www.slug.it/naufraghi/iphone/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 07:18:51 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[Generale]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/iphone/</guid>
		<description><![CDATA[But can I download the SDK and install my own Applications on my iPhone? No. The free SDK only lets you run applications in the iPhone Simulator. To install your application on your iPhone, you need to be a $99/year &#8230; <a href="http://www.slug.it/naufraghi/iphone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>But can I download the SDK and install my own Applications on my iPhone?</strong></p>
<blockquote><p>No. The free SDK only lets you run applications in the iPhone Simulator.<br />
To install your application on your iPhone, you need to be a $99/year<br />
developer. (per poter uploadare in app store).</p></blockquote>
<p>Insomma, da bravo sviluppatore non posso proprio tollerare di non poter far girare la MIA applicazione sul MIO cellulare. In questo capisco la radicalità di Stallman nella GPL3, che di fatto impedisce di rilasciare software GPL3 su iPhone.</p>
<p>Per ora, capisco che per molti il commento sia &#8220;fanculo la GPL3, c&#8217;è la GPL2&#8243;, ma spero nella viralità della licenza e che presto il pensiero diventi &#8220;fanculo l&#8217;iPhone blindato!&#8221;.</p>
<p>Però se volete vincerne uno (e farmene vincere uno a me se vincete <img src='http://www.slug.it/naufraghi/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ): <a href="http://www.wikio.it/concorso/iphone?sponsoringPlayerCode=9C0A05046">Concorso Wikio</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ho trovato un buggettino a cElementTree!</title>
		<link>http://www.slug.it/naufraghi/ho-trovato-un-buggettino-a-celementtree/</link>
		<comments>http://www.slug.it/naufraghi/ho-trovato-un-buggettino-a-celementtree/#comments</comments>
		<pubDate>Tue, 18 Dec 2007 20:10:07 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[informatica]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/ho-trovato-un-buggettino-a-celementtree/</guid>
		<description><![CDATA[Giorni fa ho trovato il mio primo bug in un codice sorgente &#8220;serio&#8221;! Playing with PyInstaller I have found that the final part of _elementtree.c: Index: Modules/_elementtree.c =================================================================== &#8212; Modules/_elementtree.c &#160; &#160; &#160;&#40;revisione 59540&#41; +++ Modules/_elementtree.c &#160; &#160; &#160;&#40;copia locale&#41; &#8230; <a href="http://www.slug.it/naufraghi/ho-trovato-un-buggettino-a-celementtree/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Giorni fa ho trovato il mio primo bug in un codice sorgente &#8220;serio&#8221;!</p>
<p>Playing with PyInstaller I have found that the final part of _elementtree.c:</p>
<div class="codesnip-container" >
<div class="diff codesnip" style="font-family:monospace;">Index: Modules/_elementtree.c<br />
===================================================================<br />
<span class="re3">&#8212; Modules/_elementtree.c &nbsp; &nbsp; &nbsp;<span class="br0">&#40;</span>revisione <span class="nu0">59540</span><span class="br0">&#41;</span></span><br />
<span class="re4">+++ Modules/_elementtree.c &nbsp; &nbsp; &nbsp;<span class="br0">&#40;</span>copia locale<span class="br0">&#41;</span></span><br />
<span class="re6">@@ -<span class="nu0">2780</span>,<span class="nu0">7</span> +<span class="nu0">2780</span>,<span class="nu0">10</span> @@</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#41;</span>;</p>
<p><span class="re7">- &nbsp; &nbsp;PyRun_String<span class="br0">&#40;</span>bootstrap, Py_file_input, g, NULL<span class="br0">&#41;</span>;</span><br />
<span class="re8">+ &nbsp; &nbsp;if <span class="br0">&#40;</span>PyRun_String<span class="br0">&#40;</span>bootstrap, Py_file_input, g, NULL<span class="br0">&#41;</span> == NULL<span class="br0">&#41;</span> <span class="br0">&#123;</span></span><br />
<span class="re8">+ &nbsp; &nbsp; &nbsp; &nbsp;m = PyErr_Occurred<span class="br0">&#40;</span><span class="br0">&#41;</span>;</span><br />
<span class="re8">+ &nbsp; &nbsp; &nbsp; &nbsp;return;</span><br />
<span class="re8">+ &nbsp; &nbsp;<span class="br0">&#125;</span></span></p>
<p>&nbsp; &nbsp; elementpath_obj = PyDict_GetItemString<span class="br0">&#40;</span>g, &quot;ElementPath&quot;<span class="br0">&#41;</span>;</div>
</div>
<p>execute a bit of python code without checking the return value.<br />
That can lead to weird things playing with import hooks,<br />
for example an assert like this can fail:</p>
<p><span id="more-201"></span></p>
<div class="codesnip-container" >
<div class="diff codesnip" style="font-family:monospace;">Index: Lib/test/test_elemettree.py<br />
===================================================================<br />
<span class="re3">&#8212; Lib/test/test_elemettree.py <span class="br0">&#40;</span>revisione <span class="nu0">0</span><span class="br0">&#41;</span></span><br />
<span class="re4">+++ Lib/test/test_elemettree.py <span class="br0">&#40;</span>revisione <span class="nu0">0</span><span class="br0">&#41;</span></span><br />
<span class="re6">@@ -<span class="nu0">0</span>,<span class="nu0">0</span> +<span class="nu0">1</span>,<span class="nu0">21</span> @@</span><br />
<span class="re8">+#! /usr/bin/env python</span><br />
<span class="re8">+</span><br />
<span class="re8">+def importHook<span class="br0">&#40;</span>*args, **kwargs<span class="br0">&#41;</span>:</span><br />
<span class="re8">+ &nbsp; &nbsp;if &#8216;xml.etree&#8217; in args:</span><br />
<span class="re8">+ &nbsp; &nbsp; &nbsp; &nbsp;raise ImportError</span><br />
<span class="re8">+ &nbsp; &nbsp;else:</span><br />
<span class="re8">+ &nbsp; &nbsp; &nbsp; &nbsp;return __real__import__<span class="br0">&#40;</span>*args, **kwargs<span class="br0">&#41;</span></span><br />
<span class="re8">+</span><br />
<span class="re8">+import os</span><br />
<span class="re8">+import __builtin__</span><br />
<span class="re8">+__real__import__ = __builtin__.__import__</span><br />
<span class="re8">+__builtin__.__import__ = importHook</span><br />
<span class="re8">+</span><br />
<span class="re8">+try:</span><br />
<span class="re8">+ &nbsp; &nbsp;import xml.etree.cElementTree as cET</span><br />
<span class="re8">+except ImportError:</span><br />
<span class="re8">+ &nbsp; &nbsp;pass</span><br />
<span class="re8">+else:</span><br />
<span class="re8">+ &nbsp; &nbsp;out = os.popen<span class="br0">&#40;</span>&quot;python -c &#8216;import xml.etree.cElementTree as cET; print dir<span class="br0">&#40;</span>cET<span class="br0">&#41;</span>&#8216;&quot;<span class="br0">&#41;</span>.read<span class="br0">&#40;</span><span class="br0">&#41;</span>.strip<span class="br0">&#40;</span><span class="br0">&#41;</span></span><br />
<span class="re8">+ &nbsp; &nbsp;assert str<span class="br0">&#40;</span>dir<span class="br0">&#40;</span>cET<span class="br0">&#41;</span><span class="br0">&#41;</span> == out, <span class="br0">&#40;</span>str<span class="br0">&#40;</span>dir<span class="br0">&#40;</span>cET<span class="br0">&#41;</span><span class="br0">&#41;</span>, out<span class="br0">&#41;</span></span><br />
<span class="re8">+</span></div>
</div>
<p>Quite a novice with python internals, so comments are welcome.</p>
<p>Fredrik conferma, a parte il fatto che il
<div class="codesnip-container" >m = PyErr_Occurred();</div>
<p> è superfluo, ed il bug verrà fixato in Python 2.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/ho-trovato-un-buggettino-a-celementtree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lavoro</title>
		<link>http://www.slug.it/naufraghi/lavoro/</link>
		<comments>http://www.slug.it/naufraghi/lavoro/#comments</comments>
		<pubDate>Sat, 04 Nov 2006 09:39:14 +0000</pubDate>
		<dc:creator>Matteo</dc:creator>
				<category><![CDATA[informatica]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software libero]]></category>

		<guid isPermaLink="false">http://www.slug.it/naufraghi/lavoro/</guid>
		<description><![CDATA[Ho cominciato a lavorare! Lavoro per la [Develer](http://www.develer.com/), azienda di sviluppo software e non solo, credo di aver capito specializzata nel non specializzarsi. Sono stato assegnato ad un progetto interno un po&#8217; noioso che consiste nell&#8217;adattare [Achievo](http://www.achievo.org/) per consentire la &#8230; <a href="http://www.slug.it/naufraghi/lavoro/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ho cominciato a lavorare! Lavoro per la [Develer](http://www.develer.com/), azienda di sviluppo software e non solo, credo di aver capito specializzata nel non specializzarsi.</p>
<p>Sono stato assegnato ad un progetto interno un po&#8217; noioso che consiste nell&#8217;adattare [Achievo](http://www.achievo.org/) per consentire la visione delle statistiche delle ore lavorate anche ai clienti, limitando l&#8217;accesso ai soli progetti a cui i clienti sono interessati.</p>
<p>Nel farlo ho notato che Achievo è un po&#8217; limitato nell&#8217;interfaccia di gestione delle ore lavorate, prevede l&#8217;inserimento di un giorno e di un numero di ore.</p>
<p>Lavorando con orari liberi in Develer, il totale ore è spesso la somma di strani intervalli, tipo *10:30-12:30 + 13:50-19:20*</p>
<p><span id="more-176"></span></p>
<p>E qua Python viene in aiuto fornendo gli strumenti per creare un banale parser:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="kw1">import</span> <span class="kw3">datetime</span>, <span class="kw3">time</span></p>
<p><span class="kw1">def</span> parse_hhmm<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">datetime</span>.<span class="kw3">datetime</span><span class="br0">&#40;</span><span class="sy0">*</span><span class="kw3">time</span>.<span class="me1">strptime</span><span class="br0">&#40;</span>val, <span class="st0">&quot;%H:%M&quot;</span><span class="br0">&#41;</span><span class="br0">&#91;</span>:-2<span class="br0">&#93;</span><span class="br0">&#41;</span></p>
<p><span class="kw1">def</span> parse_hinterval<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; val1, val2 = val.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;-&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; d1 = parse_hhmm<span class="br0">&#40;</span>val1<span class="br0">&#41;</span><br />
&nbsp; &nbsp; d2 = parse_hhmm<span class="br0">&#40;</span>val2<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> d2 <span class="sy0">&lt;</span> d1:<br />
&nbsp; &nbsp; &nbsp; &nbsp; d2 += <span class="kw3">datetime</span>.<span class="me1">timedelta</span><span class="br0">&#40;</span>1<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> d2 &#8211; d1</p>
<p><span class="kw1">def</span> parse_wtime<span class="br0">&#40;</span>val<span class="br0">&#41;</span>:<br />
&nbsp; &nbsp; vals = val.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span>,<span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;+&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; res = <span class="kw3">datetime</span>.<span class="me1">timedelta</span><span class="br0">&#40;</span>0<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">for</span> ival <span class="kw1">in</span> vals:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="st0">&quot;-&quot;</span> <span class="kw1">in</span> ival:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res += parse_hinterval<span class="br0">&#40;</span>ival<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res += parse_hinterval<span class="br0">&#40;</span><span class="st0">&quot;00:00-%s&quot;</span> <span class="sy0">%</span> ival<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">return</span> res</p>
<p><span class="kw1">if</span> __name__==<span class="st0">&quot;__main__&quot;</span>:<br />
&nbsp; &nbsp; <span class="kw1">print</span> parse_wtime<span class="br0">&#40;</span><span class="st0">&quot;10:06-13:06 + 14:16-17:47 + 18:08-20:33&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="kw1">print</span> parse_wtime<span class="br0">&#40;</span><span class="st0">&quot;9:47-13:08 + 14:08-19:00&quot;</span><span class="br0">&#41;</span></div>
</div>
<p>Che eseguito restituisce:</p>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="sy0">&gt;&gt;&gt;</span> <br />
<span class="nu0">8</span>:<span class="nu0">56</span>:00<br />
<span class="nu0">8</span>:<span class="nu0">13</span>:00<br />
<span class="sy0">&gt;&gt;&gt;</span></div>
</div>
<p>Un po&#8217; di documentazione: <a href="http://www.python.org/doc/2.4.1/lib/datetime-timedelta.html">6.10.2 timedelta Objects</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slug.it/naufraghi/lavoro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

