<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Massimo Oliviero</title>
	
	<link>http://www.massimooliviero.net</link>
	<description>I deliri digitali di un programmatore informatico e aspirante musicista...</description>
	<lastBuildDate>Tue, 24 Jan 2012 13:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MassimoOliviero" /><feedburner:info uri="massimooliviero" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Chrome, 3 estensioni in per chi lavora con REST e JSON</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/9iqd_M3hS2w/</link>
		<comments>http://www.massimooliviero.net/2011/12/22/chrome-3-estensioni-in-per-chi-lavora-con-rest-e-json/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 06:47:41 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=1027</guid>
		<description><![CDATA[Lentamente lo store il Chrome web store si sta popolando di estensioni interessanti e funzionali. In particolare per chi lavora pesantemente con servizi REST segnalo questi 3 strumenti: JSONView Advanced REST client Application REST Console Must have]]></description>
			<content:encoded><![CDATA[<p>Lentamente lo store il <a href="ps://chrome.google.com/webstore/">Chrome web store </a>si sta popolando di estensioni interessanti e funzionali. In particolare per chi lavora pesantemente con servizi REST segnalo questi 3 strumenti:</p>
<ol>
<li><a href="https://chrome.google.com/webstore/detail/chklaanhfefbnpoihckbnefhakgolnmc">JSONView</a></li>
<li><a href="https://chrome.google.com/webstore/detail/hgmloofddffdnphfgcellkdfbfbjeloo">Advanced REST client Application</a></li>
<li><a href="https://chrome.google.com/webstore/detail/cokgbflfommojglbmbpenpphppikmonn">REST Console</a></li>
</ol>
<p>Must have <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/9iqd_M3hS2w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/12/22/chrome-3-estensioni-in-per-chi-lavora-con-rest-e-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/12/22/chrome-3-estensioni-in-per-chi-lavora-con-rest-e-json/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=chrome-3-estensioni-in-per-chi-lavora-con-rest-e-json</feedburner:origLink></item>
		<item>
		<title>Perché XCode 4 è così lento?</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/aRF9mpj-Uds/</link>
		<comments>http://www.massimooliviero.net/2011/12/21/perche-xcode-4-e-cosi-lento/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 11:00:25 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[iLesson]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS5]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=1021</guid>
		<description><![CDATA[Già perché? Perché fa schifo, semplice. La dimostrazione è la quantità spropositata di forum e messaggi di aiuto che circolano in rete. In particolare XCode 4.2 è flemmatico e ottuso. Purtroppo la storia di questo IDE è costellata da tutta una serie di bug incredibili, di feature mancanti e addirittura di funzionalità rimosse senza spiegazione! Una [...]]]></description>
			<content:encoded><![CDATA[<p>Già perché? Perché <strong><em>fa schifo</em></strong>, semplice. La dimostrazione è la quantità spropositata di forum e messaggi di aiuto che circolano in rete. In particolare <strong><em>XCode 4.2</em></strong> è flemmatico e ottuso. Purtroppo la storia di questo <strong><em>IDE</em></strong> è costellata da tutta una serie di <strong><em>bug</em></strong> incredibili, di <strong><em>feature</em></strong> mancanti e addirittura di <a href="http://stackoverflow.com/questions/6568817/how-to-create-an-interface-builder-plugin-in-xcode4">funzionalità rimosse</a> senza spiegazione!</p>
<p>Una approccio ingiustificato da parte di <strong><em>Apple</em></strong> che nonostante tutto continua a trincerarsi dietro un silenzio assordante. Un pratica che io non comprendo e che aborro dal profondo. Questa incuria dei suoi <strong><em>developer</em></strong> che nonostante tutto sono di gran lunga i più fanatici sul globo. Una pratica che permea l&#8217;azienda di Cupertino fin dalle origini e che non accenna a diradarsi. L&#8217;uscita di <strong><em>iOS5</em></strong> e <strong><em>XCode 4.2</em></strong> ne è l&#8217;esempio lapalissiano.</p>
<p>Su questi aspetti avrò modo di ritornarci nei successivi post. Dicevamo <em>XCode</em> lento, che fare? Non molto purtroppo, a parte i soliti consigli da mentecatti come &#8220;<em>compra più RAM</em>&#8221; o &#8220;<em>cambia mac</em>&#8221; gli unici che mi sento di suggerire veramente sono:</p>
<ol>
<li><a href="http://stackoverflow.com/questions/5410191/hidden-features-of-xcode-4/7925816#7925816">Limitare il numero di cocurrent build operation</a></li>
<li><a href="http://stackoverflow.com/questions/5410191/hidden-features-of-xcode-4/7925816#7925816">Disabilitare l&#8217;indexing del codice</a></li>
</ol>
<p>Come si dice &#8220;di più ninzò&#8221; <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Qualche fonte:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/5410191/hidden-features-of-xcode-4">http://stackoverflow.com/questions/5410191/hidden-features-of-xcode-4</a></li>
<li><a href="http://developer.apple.com/library/ios/#releasenotes/DeveloperTools/RN-Xcode/_index.html">http://developer.apple.com/library/ios/#releasenotes/DeveloperTools/RN-Xcode/_index.html</a></li>
<li><a href="http://stackoverflow.com/questions/7780663/why-are-xcodebuild-and-xcode-4-2-so-slow">http://stackoverflow.com/questions/7780663/why-are-xcodebuild-and-xcode-4-2-so-slow</a></li>
</ul>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/aRF9mpj-Uds" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/12/21/perche-xcode-4-e-cosi-lento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/12/21/perche-xcode-4-e-cosi-lento/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=perche-xcode-4-e-cosi-lento</feedburner:origLink></item>
		<item>
		<title>Emeli Sandé, Heaven</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/0JTp9SnCxgo/</link>
		<comments>http://www.massimooliviero.net/2011/12/21/emeli-sande-heaven/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 08:20:00 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[Musica]]></category>
		<category><![CDATA[Colonna sonora]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=1017</guid>
		<description />
			<content:encoded><![CDATA[<p><iframe width="560" height="315" src="http://www.youtube.com/embed/cwHe0ddggig?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/0JTp9SnCxgo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/12/21/emeli-sande-heaven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/12/21/emeli-sande-heaven/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=emeli-sande-heaven</feedburner:origLink></item>
		<item>
		<title>iPhone, precisione del ricevitore GPS</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/qRUFLf_iKek/</link>
		<comments>http://www.massimooliviero.net/2011/12/14/iphone-precisione-del-ricevitore-gps/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 06:04:15 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=1014</guid>
		<description><![CDATA[Purtroppo non ci sono dati ufficiali sulla precisione, in varie situazioni, del ricevitore GPS montato sull&#8217;iPhone 3gs e 4. Dopo lunghe ricerche mi sono imbattuto su un forum dove sono riportate le seguenti specifiche non ufficiali: 3G iPhone w/ A-GPS ~ 8m 3G iPhone w/ wifi ~ 74 m 3G iPhone w/ Cellular positioning ~ [...]]]></description>
			<content:encoded><![CDATA[<p>Purtroppo non ci sono dati ufficiali sulla precisione, in varie situazioni, del ricevitore GPS montato sull&#8217;iPhone 3gs e 4.</p>
<p>Dopo lunghe ricerche mi sono imbattuto su un forum dove sono riportate le seguenti specifiche non ufficiali:</p>
<ul>
<li>3G iPhone w/ A-GPS ~ 8m</li>
<li>3G iPhone w/ wifi ~ 74 m</li>
<li>3G iPhone w/ Cellular positioning ~ 600m</li>
<li>iPhone4 w/ A-GPS ~ 7m</li>
</ul>
<div>Inoltre l&#8217;iPhone 4 sembra sia equipaggiato con il chip <a href="http://www.broadcom.com/products/GPS/GPS-Silicon-Solutions/BCM4750" target="_blank">Broadcom BCM4750</a>.</div>
<p>Qualche fonte:</p>
<ul>
<li><a href="http://stackoverflow.com/questions/312775/how-accurate-is-the-triangulated-gps-of-the-non-3g-iphone">http://stackoverflow.com/questions/312775/how-accurate-is-the-triangulated-gps-of-the-non-3g-iphone</a></li>
<li><a href="http://forums.arcgis.com/threads/21917-iOS-Android-GPS-Accuracy">http://forums.arcgis.com/threads/21917-iOS-Android-GPS-Accuracy</a></li>
<li><a href="http://stackoverflow.com/questions/824403/iphone-gps-performance">http://stackoverflow.com/questions/824403/iphone-gps-performance</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/qRUFLf_iKek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/12/14/iphone-precisione-del-ricevitore-gps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/12/14/iphone-precisione-del-ricevitore-gps/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=iphone-precisione-del-ricevitore-gps</feedburner:origLink></item>
		<item>
		<title>Networking framework per iOS e Mac OS X</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/9F4uHXFqAak/</link>
		<comments>http://www.massimooliviero.net/2011/12/13/networking-framework-per-ios-e-mac-os-x/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 21:54:00 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[ASIHTTPRequest]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[NSURLConnection]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=1008</guid>
		<description><![CDATA[ASIHTTPrequest, per chi ancora non lo conoscesse, è uno dei migliori framework per gestire connessioni http con iOS e Mac OS. E&#8217; diventato il mio framework di riferimento per tutti i progetti che richiedono una comunicazione client/server, tipicamente con servizi REST. ASIHTTPRequest porta con se una ricca dote di funzionalità e semplificazioni non indifferenti, soprattutto [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://allseeing-i.com/ASIHTTPRequest/">ASIHTTPrequest</a>, per chi ancora non lo conoscesse, è uno dei migliori framework per gestire connessioni http con <em>iOS </em>e<em> Mac OS</em>. E&#8217; diventato il mio framework di riferimento per tutti i progetti che richiedono una comunicazione client/server, tipicamente con servizi REST. ASIHTTPRequest porta con se una ricca dote di funzionalità e semplificazioni non indifferenti, soprattutto se paragonato al blando e scarno <a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html">NSURLConnection</a>.</p>
<p>Ultimamente sto valutando delle alternative più leggere e moderne. Dopo qualche ricerca mi sono imbattuto in due framework interessanti:</p>
<ol>
<li><a href="https://github.com/AFNetworking/AFNetworking">AFNetworking &#8211; A delightful iOS and OS X networking framework</a></li>
<li><a href="https://github.com/MugunthKumar/MKNetworkKit/tree/master/MKNetworkKit">MKNetworkKit - Full ARC based Networking Kit for iOS 4+ devices</a></li>
</ol>
<p>Sicuramente da valutare.</p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/9F4uHXFqAak" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/12/13/networking-framework-per-ios-e-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/12/13/networking-framework-per-ios-e-mac-os-x/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=networking-framework-per-ios-e-mac-os-x</feedburner:origLink></item>
		<item>
		<title>iPhone Simulator Crash log</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/QxRpMPcjk-Y/</link>
		<comments>http://www.massimooliviero.net/2011/11/18/iphone-simulator-crash-log/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 05:12:03 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[iOS tips&tricks]]></category>
		<category><![CDATA[Crash]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone Simulator]]></category>
		<category><![CDATA[Log]]></category>
		<category><![CDATA[simulator]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=998</guid>
		<description><![CDATA[Quando crasha un&#8217;applicazione sull&#8217;iPhone Simulator viene generato un log con il dettaglio dell&#8217;errore, proprio come succede con il device fisico. Se il crash avviene quando non si è in debug con in XCode l&#8217;unica possibilità è recuperare questo file tramite il file system. I crash log del simulatore sono posizionati in questa cartella: ~/Library/Logs/DiagnosticReports/ I file [...]]]></description>
			<content:encoded><![CDATA[<p>Quando <em><strong>crasha</strong></em> un&#8217;applicazione sull&#8217;<strong><em>iPhone Simulator</em></strong> viene generato un <strong><em>log</em></strong><em> con il dettaglio dell&#8217;errore</em><strong><em>,</em></strong> proprio come succede con il <em>device</em> fisico. Se il <em>crash</em> avviene quando non si è in debug con in <strong><em>XCode</em></strong> l&#8217;unica possibilità è recuperare questo file tramite il file system.</p>
<p>I crash log del simulatore sono posizionati in questa cartella:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Logs<span style="color: #000000; font-weight: bold;">/</span>DiagnosticReports<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>I file da considerare sono quelli con estensione <strong><em>.crash</em></strong>. Ovviamente <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/QxRpMPcjk-Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/11/18/iphone-simulator-crash-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/11/18/iphone-simulator-crash-log/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=iphone-simulator-crash-log</feedburner:origLink></item>
		<item>
		<title>iOS, bloccare lo scrolling di una UIWebView</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/fP9SUcW2DDA/</link>
		<comments>http://www.massimooliviero.net/2011/11/17/ios-bloccare-lo-scrolling-di-una-uiwebview/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 14:02:18 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[iOS tips&tricks]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iOS4]]></category>
		<category><![CDATA[iOS5]]></category>
		<category><![CDATA[Scrolling]]></category>
		<category><![CDATA[UIWebView]]></category>
		<category><![CDATA[web view]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=990</guid>
		<description><![CDATA[Ecco un piccolo tip per bloccare lo scrolling di una web view in iOS 4.x. Infatti in tutte le versione dell&#8217;SDK fino alla 4.3.5 la UIScrollView presente all&#8217;interno della UIWebView non è esposta esternamente. Per poterla modificare è necessario cercarla all&#8217;interno delle subviews della web view. for &#40;id subview in self.webView.subviews&#41; &#123; if &#40;&#91;&#91;subview class&#93; isSubclassOfClass: [...]]]></description>
			<content:encoded><![CDATA[<p>Ecco un piccolo tip per bloccare lo <strong><em>scrolling</em></strong> di una <strong><em>web view</em></strong> in<strong><em> iOS 4.x</em></strong>. Infatti in tutte le versione dell&#8217;<strong><em>SDK</em></strong> fino alla 4.3.5 la <strong><em>UIScrollView</em></strong> presente all&#8217;interno della <strong><em>UIWebView</em></strong> non è esposta esternamente. Per poterla modificare è necessario cercarla all&#8217;interno delle subviews della <em>web view</em>.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span> subview <span style="color: #a61390;">in</span> self.webView.subviews<span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>   
   <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>subview class<span style="color: #002200;">&#93;</span> isSubclassOfClass<span style="color: #002200;">:</span> <span style="color: #002200;">&#91;</span>UIScrollView class<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>   
   <span style="color: #002200;">&#123;</span>       
      <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>UIScrollView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>subview<span style="color: #002200;">&#41;</span>.scrollEnabled <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;       
      <span style="color: #a61390;">break</span>;   
   <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">// oppure così (anche se è meno sicuro perché non è certo</span>
<span style="color: #11740a; font-style: italic;">// che la scroll view si trovi sempre nella prima posizione)</span>
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>webView.subviews objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span> setScrollEnabled<span style="color: #002200;">:</span><span style="color: #a61390;">NO</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>E con<em><strong> iOS 5</strong></em>? beh le cose si semplificano di un pelo&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">self.webView.scrollView.scrollEnabled <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;</pre></div></div>

<p>o no? <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/fP9SUcW2DDA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/11/17/ios-bloccare-lo-scrolling-di-una-uiwebview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/11/17/ios-bloccare-lo-scrolling-di-una-uiwebview/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ios-bloccare-lo-scrolling-di-una-uiwebview</feedburner:origLink></item>
		<item>
		<title>Mac OSX, abilitare l’auto completamento e i colori di Git</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/V6MhpTRAuqY/</link>
		<comments>http://www.massimooliviero.net/2011/11/16/mac-osx-abilitare-lauto-completamento-e-i-colori-di-git/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 21:20:51 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[MacOSX tips&tricks]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=971</guid>
		<description><![CDATA[Utilizzo quotidianamente git da molti mesi e fin dall&#8217;inizio ho sentito l&#8217;esigenza di migliorare l&#8217;esperienza d&#8217;uso di questo strumento. Quello che non tutti sanno è che la versione installata su Mac OSX è configurata in modo essenziale  e questo vuol dire che: non ci sono colori nel comando status non c&#8217;è l&#8217;auto completamento dei comandi di [...]]]></description>
			<content:encoded><![CDATA[<p>Utilizzo quotidianamente <em><strong><a href="http://git-scm.com/">git</a></strong></em> da molti mesi e fin dall&#8217;inizio ho sentito l&#8217;esigenza di migliorare l&#8217;esperienza d&#8217;uso di questo strumento. Quello che non tutti sanno è che la versione installata su Mac OSX è configurata in modo essenziale  e questo vuol dire che:</p>
<ol>
<li>non ci sono colori nel comando status</li>
<li>non c&#8217;è l&#8217;auto completamento dei comandi di git</li>
<li>non ci sono nel prompt delle indicazioni sul branch in uso</li>
</ol>
<div>In pratica se entriamo in un progetto e digitiamo<em><strong> git status</strong></em> quello che otteniamo è una listato uniforme e molto confuso (figura 1)</div>
<div><a href="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_nothing.png"><img class="size-full wp-image-972 aligncenter" style="margin-top: 10px; margin-bottom: 10px;" title="mac_shell_nothing" src="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_nothing.png" alt="" width="532" height="434" /></a></div>
<div>Andiamo con ordine. Per prima cosa abilitiamo i colori di <strong><em>git</em></strong> con questo semplice comando:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> config color.ui <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<div>Se ora digitiamo il comando<strong><em> git status</em></strong> otteniamo</div>
<div><a href="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_git_status_color.png"><img class="size-full wp-image-976 aligncenter" style="margin-top: 10px; margin-bottom: 10px;" title="mac_shell_git_status_color" src="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_git_status_color.png" alt="" width="532" height="234" /></a></div>
<div>Decisamente meglio. Next step: attivare l&#8217;auto completamento dei comandi git. Per farlo è necessario scaricare i file che servono dal repository ufficiale in questo modo:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #666666; font-style: italic;"># se non esiste già</span>
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>tmp
$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>git.kernel.org<span style="color: #000000; font-weight: bold;">/</span>pub<span style="color: #000000; font-weight: bold;">/</span>scm<span style="color: #000000; font-weight: bold;">/</span>git<span style="color: #000000; font-weight: bold;">/</span>git.git
$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #c20cb9; font-weight: bold;">git</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> checkout v<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #660033;">--version</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> contrib<span style="color: #000000; font-weight: bold;">/</span>completion<span style="color: #000000; font-weight: bold;">/</span>git-completion.bash ~<span style="color: #000000; font-weight: bold;">/</span>.git-completion.bash
$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;&gt;&gt; .profile</span></pre></div></div>

<div>In particolare quest&#8217;ultimo comando creerà il file .profile nello home directory dell&#8217;utente se non esiste. Se tutto è andato a buon fine l&#8217;auto complemtamento dei comandi git dovrebbe essere attivo. Quindi digitando per esempio:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">stat</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>tab<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<div>Il comando dovrebbe auto-completarsi. Andiamo oltre, attiviamo anche la visualizzazione sul <strong><em>prompt</em></strong> dei comandi il nome del <strong><em>branch</em></strong> attivo e il suo stato. Per farlo basta modificare il file <strong><em>.profile</em></strong>, sulla home directory dell&#8217;utente, e aggiungere il seguente codice:</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">GIT_PS1_SHOWDIRTYSTATE</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    . <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash_completion
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">'\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '</span></pre></div></div>

<div>Già che ci siamo diamo anche un tocco di colore alla shell in generale aggiungendo due righe in testa al file (se non sono già presenti):</div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CLICOLOR</span>=<span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LSCOLORS</span>=GxFxCxDxBxegedabagaced</pre></div></div>

<div>Riavviamo il Terminale, entriamo in un progetto git e digitiamo git status quello che otteniamo è mostrato nella figura seguente.</div>
<div><a href="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_git_status_power.png"><img class="aligncenter size-full wp-image-981" title="mac_shell_git_status_power" src="http://www.massimooliviero.net/wp-content/uploads/2011/11/mac_shell_git_status_power.png" alt="" width="635" height="273" /></a></div>
<div>Beh che dire, tutta un&#8217;altra storia!!! <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </div>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/V6MhpTRAuqY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/11/16/mac-osx-abilitare-lauto-completamento-e-i-colori-di-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/11/16/mac-osx-abilitare-lauto-completamento-e-i-colori-di-git/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=mac-osx-abilitare-lauto-completamento-e-i-colori-di-git</feedburner:origLink></item>
		<item>
		<title>iOS, altezza dinamica di una UITableViewCell</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/RDGBDGzj95w/</link>
		<comments>http://www.massimooliviero.net/2011/10/13/ios-altezza-dinamica-di-una-uitableviewcell/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 22:11:19 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[iOS tips&tricks]]></category>
		<category><![CDATA[UITableView]]></category>
		<category><![CDATA[UITableViewCell]]></category>
		<category><![CDATA[UiTableViewDataSource]]></category>
		<category><![CDATA[UITableViewDelegate]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=958</guid>
		<description><![CDATA[Il metodo tableView:heightForRowAtIndexPath:indexPath del protocol UITableViewDelegate permette di ridefinire a runtime l&#8217;altezza delle celle. Se in una UITableView abbiamo celle di altezze diverse (e magari non note a priori) possiamo sfruttare questo metodo in modo intelligente: 1 2 3 4 5 6 7 #pragma mark - UITableViewDelegate Methods &#160; - &#40;CGFloat&#41;tableView:&#40;UITableView *&#41;tableView heightForRowAtIndexPath:&#40;NSIndexPath *&#41;indexPath &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>Il metodo <strong><em><a href="http://developer.apple.com/library/IOS/#documentation/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:heightForRowAtIndexPath:">tableView:heightForRowAtIndexPath:indexPath</a></em></strong> del protocol <strong><em>UITableViewDelegate</em></strong> permette di ridefinire a runtime l&#8217;altezza delle celle. Se in una <strong><em>UITableView</em></strong> abbiamo celle di altezze diverse (e magari non note a priori) possiamo sfruttare questo metodo in modo intelligente:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#pragma mark - UITableViewDelegate Methods</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView heightForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSIndexPath</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath
<span style="color: #002200;">&#123;</span>
    UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self tableView<span style="color: #002200;">:</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span>indexPath<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> cell.frame.size.height;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>In pratica ricaviamo la cella corrente dal data source e recuperiamo la sua altezza effettiva. Attenzione a non cadere nel subdolo tranello di richiedere la cella corrente direttamente alla tableView (o a self.table) in questo modo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#pragma mark - UITableViewDelegate Methods</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView heightForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSIndexPath</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath
<span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// errore!</span>
    UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span>indexPath<span style="color: #002200;">&#93;</span>;
    <span style="color: #a61390;">return</span> cell.frame.size.height;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Facendo così si manderà il programma loop! Questo perché la cella non è ancora presente nella <strong><em>tableView</em></strong> ma solo nel <strong><em>datasource</em></strong>. Se si tenta di recuperare la cella direttamente dalla <strong><em>tableView</em></strong> questa, essendone priva, ne richiederà una nuova al data source che a sua volta richiamerà <strong><em><a href="http://developer.apple.com/library/IOS/#documentation/UIKit/Reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:heightForRowAtIndexPath:">tableView:heightForRowAtIndexPath:indexPath</a></em></strong> per ottere l&#8217;altezza e così via in un circolo senza fine. Anzi no con una fine:<strong><em> EXC_BAD_ACCESS!</em></strong></p>
<p><strong>Per finire piccola nota sulle performance:</strong><br />
in effetti questo metodo non è molto efficiente in quanto ogni singola cella viene creata due volte, la prima per misurare l&#8217;altezza e la seconda volta per  poter essere aggiunta alla tabella. E&#8217; chiaro che ci sono ampi margini di miglioramento. Magari li vediamo in un prossimo articolo <img src='http://www.massimooliviero.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/RDGBDGzj95w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/10/13/ios-altezza-dinamica-di-una-uitableviewcell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/10/13/ios-altezza-dinamica-di-una-uitableviewcell/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ios-altezza-dinamica-di-una-uitableviewcell</feedburner:origLink></item>
		<item>
		<title>iOS, personalizzare la funzione NSLog</title>
		<link>http://feedproxy.google.com/~r/MassimoOliviero/~3/jeyBlhEM6Bk/</link>
		<comments>http://www.massimooliviero.net/2011/10/10/ios-personalizzare-la-funzione-nslog/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 20:22:06 +0000</pubDate>
		<dc:creator>Massimo</dc:creator>
				<category><![CDATA[iOS tips&tricks]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[NSLog]]></category>
		<category><![CDATA[obje]]></category>
		<category><![CDATA[objectivec]]></category>

		<guid isPermaLink="false">http://www.massimooliviero.net/?p=944</guid>
		<description><![CDATA[La funzione NSLog presente nel Foundation Kit è molto comoda in fase di debug di un&#8217;applicazione. NSLog non fa altro che stampare a console la stringa passata come argomento. Possiamo rendere NSLog &#8220;parlante&#8221; aggiungendo delle informazioni interessanti, come il nome del metodo e il numero di linea, ogni volta che viene chiamata. Per farlo è [...]]]></description>
			<content:encoded><![CDATA[<p>La funzione NSLog presente nel Foundation Kit è molto comoda in fase di debug di un&#8217;applicazione. NSLog non fa altro che stampare a console la stringa passata come argomento. Possiamo rendere NSLog &#8220;parlante&#8221; aggiungendo delle informazioni interessanti, come il nome del metodo e il numero di linea, ogni volta che viene chiamata.</p>
<p>Per farlo è necessario definire una propria funzione &#8220;MYLog&#8221; in un header comune o nel file .pch in questo modo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;"># define MYLog(fmt, ...) NSLog((@&quot;%s [Line %d] &quot; fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);</span></pre></td></tr></table></div>

<p><em><a href="http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html">__PRETTY_FUNCTION__</a></em> e <em><a href="http://developer.apple.com/library/mac/#documentation/DeveloperTools/gcc-4.0.1/cpp/Standard-Predefined-Macros.html">__LINE__</a></em> sono due macro che hanno proprio lo scopo di visualizzare il nome del metodo e la linea. Ci sono anche altre macro che si posso utilizzare ad ognuno la sua scelta.</p>
<p>Se invece vogliamo fare in modo che queste informazioni siano stampate solo in DEBUG basta aggiungere un if in questo modo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#ifdef DEBUG</span>
<span style="color: #6e371a;">#   define MYLog(fmt, ...) NSLog((@&quot;%s [Line %d] &quot; fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);</span>
<span style="color: #6e371a;">#else</span>
<span style="color: #6e371a;">#   define MYLog(...)</span>
<span style="color: #6e371a;">#endif</span></pre></td></tr></table></div>

<p>Niente di più semplice e funzionale.</p>
<img src="http://feeds.feedburner.com/~r/MassimoOliviero/~4/jeyBlhEM6Bk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.massimooliviero.net/2011/10/10/ios-personalizzare-la-funzione-nslog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.massimooliviero.net/2011/10/10/ios-personalizzare-la-funzione-nslog/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ios-personalizzare-la-funzione-nslog</feedburner:origLink></item>
	</channel>
</rss>

