<?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>Flying memes &#187; Approfondimenti</title>
	<atom:link href="http://sandropaganotti.com/categoria/approfondimenti/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandropaganotti.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 08 Jan 2012 16:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Handling thousands of pics from a mobile device</title>
		<link>http://sandropaganotti.com/2011/11/27/handling-thousands-of-pics-from-a-mobile-device/</link>
		<comments>http://sandropaganotti.com/2011/11/27/handling-thousands-of-pics-from-a-mobile-device/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 21:25:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Algoritmi]]></category>
		<category><![CDATA[Approfondimenti]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[lot of images]]></category>
		<category><![CDATA[mobile safari]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=561</guid>
		<description><![CDATA[Lately I&#8217;ve been involved into a fascinating project called PepperTweet which consist in extract and visualize streams of pics from twitter starting from some search keywords. While working on a new visualization algorithm I discovered how easy it is to make mobile browsers crash trying to display a relative small amount of images.  I&#8217;ve used an [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been involved into a fascinating project called <a href="http://peppertweet.com/" target="_blank">PepperTweet</a> which consist in extract and visualize streams of pics from twitter starting from some search keywords.</p>
<p><span id="more-561"></span>While working on a new visualization algorithm I discovered how easy it is to make mobile browsers crash trying to display a relative small amount of images.  I&#8217;ve used an IPad 1 with IOs 5 for my tests, so with other devices the results may vary but I think the point is the same, there are two main problems while handling a lot of images from a mobile browser:</p>
<h3>Loading rate:</h3>
<p>If I load <a href="http://jsfiddle.net/sandro_paganotti/GMs4d/embedded/result/" target="_blank">this simple javascript code</a> in my IPad mobile safari just crash, this is because (imho) the device is not able to handle such a big image loading rate and goes into some form of buffer overflow.</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/sandro_paganotti/GMs4d/embedded/js" frameborder="0" width="320" height="240"></iframe></p>
<h3>Image quantity:</h3>
<p>Using the same image (notice how in the previous example I&#8217;ve appended a random number after each image URL in order to force its download) I was able to hit another limit, the maximum number of images a mobile device can display simultaneously, <a href="http://jsfiddle.net/sandro_paganotti/brj6m/2/embedded/result/" target="_blank">this code</a> which tries to print 500 images made my mobile browser freeze:</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/sandro_paganotti/brj6m/2/embedded/js" frameborder="0" width="320" height="240"></iframe></p>
<h3>A workaround:</h3>
<p>I&#8217;ve managed to load and show thousands of images using canvas, in the following example each image is loaded, printed on canvas and the discarded, also the number of concurrent loads is limited to avoid browser crash, <a href="http://jsfiddle.net/sandro_paganotti/rrdFt/4/embedded/result/" target="_blank">this example</a> uses 10000 images but I think higher image quantities can be easily reached:</p>
<p><iframe style="width: 100%; height: 300px;" src="http://jsfiddle.net/sandro_paganotti/rrdFt/4/embedded/js,result" frameborder="0" width="320" height="240"></iframe></p>
<h3>Some refinements:</h3>
<p>It seems that mobile Safari cannot handle canvas bigger than a certain value (<a href="http://jsfiddle.net/sandro_paganotti/rrdFt/5/embedded/result/" target="_blank">try this</a>), to handle this problem one solution could be using the &#8216;<a href="http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl" target="_blank">toDataUrl</a>&#8216; method when the canvas is full of pics in order to extract a screenshot. Then this screnneshot can be added to the page before the canvas so the canvas can be cleaned and reused for the upcoming pics.</p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2011/11/27/handling-thousands-of-pics-from-a-mobile-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Euruko 2010 and some CSS3 experiments</title>
		<link>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/</link>
		<comments>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 13:34:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Annunci]]></category>
		<category><![CDATA[Approfondimenti]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Euruko 2010]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=386</guid>
		<description><![CDATA[update 14/07/2010: rubyinside.com featured my speaker showcase ! Here&#8217;s the post ! update 19/06/2010: my speakers showcase gets a dedicated post at euruko2010 official blog from Ela. Thanks guys ! Euruko 2010 is over. It was a great week-end spent among cool people having fun and talking about Ruby. As Matz said &#8220;we have a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>update 14/07/2010: </strong><a href="http://rubyinside.com">rubyinside.com</a> featured my speaker showcase ! <a href="http://www.rubyinside.com/euruko-2010-presentations-3538.html">Here&#8217;s the post </a>!</p>
<p><strong>update 19/06/2010: </strong>my <a href="http://euruko2010.heroku.com" target="_blank">speakers showcase</a> gets a dedicated post at <a href="http://euruko2010.org" target="_blank">euruko2010 official blog</a> from <a href="http://twitter.com/elamadej">Ela</a>. Thanks guys !</p>
<p><a href="http://euruko2010.org">Euruko 2010</a> is over. It was a great week-end spent among cool people having fun and talking about Ruby. As Matz said &#8220;we have a nice community&#8221;, and that&#8217;s absolutely true. To honor this conference (and to test some CSS3 features ^_^ ) <a href="http://euruko2010.heroku.com" target="_blank">I&#8217;ve developed a page</a> showcasing the speakers and their talks. For each of them you may find a short summary and some resources (slide, etc..).</p>
<p><span id="more-386"></span>Working with CSS3 highlight some browser performances problem I was unaware before, for example I tried to have a scrolling background under a shadowed box, <a href="http://euruko2010.heroku.com/?bgon=true" target="_blank">you can try this in your browser and notice how it is slow</a>. However if we turn the shadows off the scrolling become smooth again (<a href="http://euruko2010.heroku.com/?bgon=true&amp;shadow_off=true" target="_blank">try this</a>).</p>
<p>Ok, nothing left to say, hope you&#8217;ll enjoy the showcase:</p>
<p style="text-align: center;"><a href="http://euruko2010.heroku.com" target="_blank"><img class="aligncenter size-full wp-image-387" style="border: 1px solid black;" title="ishot-179" src="http://sandropaganotti.com/wp-content/uploads/2010/06/ishot-179.png" alt="" width="529" height="570" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2010/06/06/euruko-2010-and-some-css3-experiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matematica e carte da Briscola</title>
		<link>http://sandropaganotti.com/2009/10/10/matematica-e-carte-da-briscola/</link>
		<comments>http://sandropaganotti.com/2009/10/10/matematica-e-carte-da-briscola/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 08:20:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Algoritmi]]></category>
		<category><![CDATA[Approfondimenti]]></category>
		<category><![CDATA[Carte da Briscola]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=214</guid>
		<description><![CDATA[Ho trascorso la scorsa settimana in Kenya, durante il soggiorno ho avuto modo di assistere ad un interessante gioco eseguito da Salvo, uno degli animatori del villaggio. Le istruzioni per ripeterlo sono queste: Mescolate un mazzo di carte da Briscola; Tenete il mazzo in mano in modo che le carte siano a faccia in su; [...]]]></description>
			<content:encoded><![CDATA[<p>Ho trascorso <a title="Alcune immagini della mia vacanza in Kenya" href="http://picasaweb.google.com/sandro.paganotti/Kenia2009#" target="_blank">la scorsa settimana in Kenya</a>, durante il soggiorno ho avuto modo di assistere ad un interessante gioco eseguito da Salvo, uno degli animatori del villaggio.</p>
<p><span id="more-214"></span>Le istruzioni per ripeterlo sono queste:</p>
<ol>
<li>Mescolate un mazzo di <a title="Alcune informazioni sulla briscola" href="http://en.wikipedia.org/wiki/Briscola" target="_blank">carte da Briscola;</a></li>
<li>Tenete il mazzo in mano in modo che le carte siano a faccia in su;</li>
<li>Estraete la prima carta dal mazzo, memorizzatene il valore ( da 1 a 10 ) e appoggiatela a faccia coperta sul tavolo;</li>
<li>Estraete le successive 10-k carte ed impilatele, sempre a faccia coperta, sulla precedente ( dove k è il valore memorizzato al punto 3 );</li>
<li>Ripetete i punti 3 e 4 con le restanti carte del mazzo. Se non doveste trovare sufficienti carte per completare l&#8217;ultima pila disponete le carte di questa pila a faccia in giù sul tavolo separandole una dall&#8217;altra ( possiamo chiamarle &#8216;carte del resto&#8217;).</li>
</ol>
<p>Ok, se avete operato nel modo corretto la somma delle carte capofila di ogni mazzetto (quelle del punto 3) dovrebbe corrispondere alla seguente formula:</p>
<pre><code>(numero di mazzetti * 11) + carte del resto - 40
</code></pre>
<p>Cerchiamo di capire come si possa arrivare ad un simile risultato:</p>
<p>Cominciamo affermando che ogni mazzetto di carte è composto da 11 &#8211; k carte dove k è il valore della carta a capofila quindi, ad esempio, se la carta capofila è un due il mazzetto conterrà 9 carte: il due e le otto successive, con questa osservazione è possibile stendere una prima versione della formula:</p>
<p><img class="aligncenter size-full wp-image-218" title="chart" src="http://sandropaganotti.com/wp-content/uploads/2009/10/chart3.png" alt="chart" width="162" height="49" /></p>
<p>Dove con n indichiamo il numero di mazzetti, con <img class="size-full wp-image-219 alignnone" title="chart" src="http://sandropaganotti.com/wp-content/uploads/2009/10/chart4.png" alt="chart" width="19" height="18" /> il valore della carta capofila dell&#8217;x-esimo mazzetto e con r il numero della &#8216;carte del resto&#8217;. Ora non ci resta che isolare il più possibile k, per fare questo non dobbiamo fare altro che applicare alcune trasformazioni alla formula:</p>
<p><img class="aligncenter size-full wp-image-220" title="chart0" src="http://sandropaganotti.com/wp-content/uploads/2009/10/chart0.png" alt="chart0" width="185" height="49" /></p>
<p><img class="aligncenter size-full wp-image-221" title="chart1" src="http://sandropaganotti.com/wp-content/uploads/2009/10/chart11.png" alt="chart1" width="186" height="49" /></p>
<p><img class="aligncenter size-full wp-image-222" title="chart2" src="http://sandropaganotti.com/wp-content/uploads/2009/10/chart21.png" alt="chart2" width="162" height="49" /></p>
<p>Done, con questi semplici passaggi siamo riusciti a ricostruire il funzionamento di un piccolo gioco che è riuscito ad impressionarmi ed incuriosirmi.</p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2009/10/10/matematica-e-carte-da-briscola/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Biomimicry: apprendere dalla natura</title>
		<link>http://sandropaganotti.com/2009/08/25/biomimicry-apprendere-dalla-natura/</link>
		<comments>http://sandropaganotti.com/2009/08/25/biomimicry-apprendere-dalla-natura/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 22:13:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Approfondimenti]]></category>
		<category><![CDATA[Biomimicry]]></category>
		<category><![CDATA[Janine Benyus]]></category>

		<guid isPermaLink="false">http://sandropaganotti.com/?p=190</guid>
		<description><![CDATA[Biomimicry è una nuova disciplina scientifica che si pone l&#8217;obiettivo di implementare tecnologicamente alcune strategie tipiche della natura, la quale si dimostra essere nella maggior parte dei casi di gran lunga più efficiente di noi. Dopo essermi interessato all&#8217;argomento sono rimasto piacevolmente colpito dalle opportunità che questa studi promettono di offrirci. Prendiamo ad esempio gli [...]]]></description>
			<content:encoded><![CDATA[<p>Biomimicry è una nuova disciplina scientifica che si pone l&#8217;obiettivo di implementare tecnologicamente alcune strategie tipiche della natura, la quale si dimostra essere nella maggior parte dei casi di gran lunga più efficiente di noi. Dopo essermi interessato all&#8217;argomento sono rimasto piacevolmente colpito dalle opportunità che questa studi promettono di offrirci.</p>
<p><span id="more-190"></span></p>
<p>Prendiamo ad esempio gli studi sullo squalo; l&#8217;analisi della struttura della sua pella ha portato allo sviluppo delle famose tute acquatiche <a href="http://www.speedousa.com/product/index.jsp?productId=3106340&amp;kwCatId=&amp;kw=sharks&amp;origkw=shark&amp;sr=1">FastSkin</a> firmate Speedo ma ha anche evidenziato come il pattern della pelle di questo predatore impedisca alle colonie batteriche di attecchire; qualità che è stata replicata con successo nei prodotti medicali della <a href="http://www.sharklet.com/">Sharklet Technologies</a> studiati per migliorare le condizioni igeniche degli ambienti ospedalieri.</p>
<p>Di esempi ce ne sono veramente molti, vorrei concludere questo breve post segnalandovi <a href="http://www.ted.com/talks/janine_benyus_biomimicry_in_action.html">un&#8217;ottimo talk </a>dell&#8217;edizione 2009 del <a href="http://www.ted.com/">TED</a> tenuto da <a href="http://en.wikipedia.org/wiki/Janine_Benyus">Janine Benyus</a>, pioniera in questo campo e <a href="http://asknature.org">asknature.com</a> un portale-community dedicato a tutto quanto possiamo ancora apprendere dalla natura.</p>
]]></content:encoded>
			<wfw:commentRss>http://sandropaganotti.com/2009/08/25/biomimicry-apprendere-dalla-natura/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

