<?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>Fabio Falcinelli &#187; Nature</title>
	<atom:link href="http://www.fabiofalcinelli.it/category/photography/nature/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fabiofalcinelli.it</link>
	<description>A mix of code and photos...</description>
	<lastBuildDate>Sat, 29 May 2010 12:16:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>iSync con Samsung SGH-E250</title>
		<link>http://www.fabiofalcinelli.it/2009/07/isync-con-samsung-sgh-e250/</link>
		<comments>http://www.fabiofalcinelli.it/2009/07/isync-con-samsung-sgh-e250/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 19:59:25 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iSync]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Rosa]]></category>
		<category><![CDATA[Samsung]]></category>
		<category><![CDATA[SGH-E250]]></category>

		<guid isPermaLink="false">http://www.fabiofalcinelli.it/?p=323</guid>
		<description><![CDATA[La cosa bella di un Mac è che presenta una rosa di software pronta all&#8217;uso. La cosa brutta è che non essendo software OpenSource spesso non è possibile personalizzare al meglio le funzionalità che più ci occorrono. iSync è un&#8217;applicazione veramente ben fatta, mi ha dato subito soddisfazione con il mio vecchio Nokia 6600 per [...]]]></description>
			<content:encoded><![CDATA[<p>La cosa bella di un Mac è che presenta una <strong>rosa</strong> di software pronta all&#8217;uso. La cosa brutta è che non essendo software OpenSource spesso non è possibile personalizzare al meglio le funzionalità che più ci occorrono.</p>
<p>iSync è un&#8217;applicazione veramente ben fatta, mi ha dato subito soddisfazione con il mio vecchio Nokia 6600 per il quale, installando un agent sul cellulare stesso, tutto è andato alla grande. Con il Samsung SGH-E250, invece, il risultato era sempre lo stesso: dispositivo non supportato.</p>
<p>Con un po&#8217; di ricerche con Google, però, ho visto che telefoni come il Samsung D900, che è molto simile nell&#8217;aspetto e nelle specifiche al mio, funzionano alacremente.</p>
<p>Sono andato dunque dentro la cartella di iSync ( <em>/Applications/iSync.app/</em> ) a cercare qualcosa ed ho trovato appunto i driver del D900 dentro la cartella</p>
<p>/Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/Samsung-D900.phoneplugin</p>
<p>e mi son detto che magari come per le stampanti il mio telefono potrebbe funzionare con un driver di un altro molto simile a lui&#8230; E di fatti ha funzionato!</p>
<p>In sostanza mi sono limitato a copiare la cartella in</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/Samsung-E250.phoneplugin</div></div>
<p>All&#8217;interno della cartella ho sostituito tutte le occorrenze di &#8220;D900&#8243; con &#8220;E250&#8243; nei seguenti file</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/Samsung-E250.phoneplugin/Contents/Info.plist<br />
/Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/Samsung-E250.phoneplugin/Contents/Resources/MetaClasses.plist</div></div>
<p>ed infine ho rinominato il file (situato nella cartella /Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/Samsung-E250.phoneplugin/Contents/Resources/) <strong>com.samsung.D900.tiff</strong> in <strong>com.samsung.E250.tiff</strong>.</p>
<p>Certo, l&#8217;icona non è proprio la stessa però ci si avvicina molto ed è sempre meglio di niente :)</p>
<p>Avviando iSync la sincronizzazione è andata a buon fine, numeri di cellulare, indirizzi e-mail e compleanni sono stati caricati correttamente, solo le immagini personali non sono state caricate, ma direi che è accettabile anche questo :)</p>
<p>Il driver, ottenuto come sopra, per il Samsung SGH-E250 lo potete scaricare dal mio sito a <a title="Samsung E250 phone plugin" href="http://www.fabiofalcinelli.it/files/Samsung-E250.phoneplugin.tar.gz" target="_blank">questo link</a>, ricordate però che non è ufficiale e che l&#8217;utilizzo è a vostro rischio e pericolo ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fabiofalcinelli.it/2009/07/isync-con-samsung-sgh-e250/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Restyle!</title>
		<link>http://www.fabiofalcinelli.it/2009/06/restyle/</link>
		<comments>http://www.fabiofalcinelli.it/2009/06/restyle/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 13:28:41 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Nature]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Canon]]></category>
		<category><![CDATA[EOS]]></category>
		<category><![CDATA[Flower]]></category>

		<guid isPermaLink="false">http://www.fabiofalcinelli.it/?p=245</guid>
		<description><![CDATA[Da pochi giorni ho acquistato la reflex entry level della Canon, la EOS 1000D. Che dire, mi sto appassionando veramente alla fotografia, e sto iniziando a prenderci la mano, così ho deciso di dare una riorganizzata a questo spazio web. Grazie alla fantastica gallery creata da Chris Wallace, questo sito ha cambiato completamente aspetto! Mi [...]]]></description>
			<content:encoded><![CDATA[<p>Da pochi giorni ho acquistato la reflex entry level della Canon, la EOS 1000D.</p>
<p>Che dire, mi sto appassionando veramente alla fotografia, e sto iniziando a prenderci la mano, così ho deciso di dare una riorganizzata a questo spazio web.</p>
<p>Grazie alla fantastica <a title="Gallery, a free WoedPress Theme" href="http://www.chris-wallace.com/2009/05/04/gallery-wordpress-theme/" target="_blank">gallery</a> creata da <a title="Designer &amp; Developer" href="http://www.chris-wallace.com" target="_blank">Chris Wallace</a>, questo sito ha cambiato completamente aspetto! Mi sono limitato a fare delle semplici modifiche per automatizzare il processo di creazione delle thumbnail e delle immagini dentro ai post, ho aggiunto e modificato alcuni dettagli al css in modo da adattarlo ai miei gusti ed ho aggiunto anche lightbox&#8230; Insomma, il risultato è quello che vedete e non mi dispiace affatto :)</p>
<p>L&#8217;idea è di integrare la fotografia con quello che di tanto in tanto scrivo qui. Sentitevi liberi di lasciare commenti di qualunque tipo, sulle mie scarse capacità fotografiche (per ora ;) )  sulla qualità dei post, ogni critica, se costruttiva, è la benvenuta.</p>
<p>Le foto che mancano, verranno pian piano&#8230; Ho bisogno di tempo per sperimentare e imparare bene ad usare una reflex :)</p>
<p>Buona navigazione!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fabiofalcinelli.it/2009/06/restyle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 10g &#8211; Upsert</title>
		<link>http://www.fabiofalcinelli.it/2009/01/oracle-10g-upsert/</link>
		<comments>http://www.fabiofalcinelli.it/2009/01/oracle-10g-upsert/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 12:03:07 +0000</pubDate>
		<dc:creator>Fabio</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JDBC]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://fabiofalcinelli.netsons.org/?p=17</guid>
		<description><![CDATA[Recentemente mi è capitato di dover eseguire una insert or update, anche detta upsert, su Oracle 10g. Su MySQL ero solito usare la forma &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE &#8230;&#8221; che funziona piuttosto bene, ma che non era supportata dal database che stavo utilizzando. La versione 10g di Oracle, però, supporta l&#8217;operazione &#8220;MERGE&#8221;, entrata [...]]]></description>
			<content:encoded><![CDATA[<p>Recentemente mi è capitato di dover eseguire una <strong>insert or update</strong>, anche detta <strong>upsert</strong>, su Oracle 10g. Su MySQL ero solito usare la forma &#8220;INSERT &#8230; ON DUPLICATE KEY UPDATE &#8230;&#8221; che funziona piuttosto bene, ma che non era supportata dal database che stavo utilizzando.</p>
<p>La versione 10g di Oracle, però, supporta l&#8217;operazione &#8220;MERGE&#8221;, entrata a far parte dello standard SQL nel 2003, e si è rivelata molto comoda utilizzandola tramite JDBC.</p>
<p>Supponiamo di dover memorizzare in una tabella l&#8217;ultima pagina visitata da un utente in un dato giorno, possiamo utilizzare il seguente prepared statement java:</p>
<div class="codecolorer-container java twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003399;">PreparedStatement</span> pstmt <span style="color: #339933;">=</span> conn.<span style="color: #006633;">prepareStatement</span><span style="color: #009900;">&#40;</span><br />
<span style="color: #0000ff;">&quot;MERGE INTO last_page_table dst &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;USING ( &quot;</span><span style="color: #339933;">+</span><br />
<span style="color: #0000ff;">&quot;SELECT <span style="color: #000099; font-weight: bold;">\'</span>&quot;</span><span style="color: #339933;">+</span>username<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\'</span> USER_ID, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;TO_DATE(<span style="color: #000099; font-weight: bold;">\'</span>&quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">sql</span>.<span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">System</span>.<span style="color: #006633;">currentTimeMillis</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\'</span>YYYY-MM-DD') &nbsp;DATE_FIELD, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\'</span>&quot;</span><span style="color: #339933;">+</span>lastPage<span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\'</span> LAST_PAGE &quot;</span><span style="color: #339933;">+</span><br />
<span style="color: #0000ff;">&quot;FROM DUAL) src &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;ON (dst.USER_ID = src.USER_ID AND &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;dst.DATE_FIELD = src.DATE_FIELD) &quot;</span><span style="color: #339933;">+</span><br />
<span style="color: #0000ff;">&quot;WHEN MATCHED THEN &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;UPDATE SET dst.LAST_PAGE = src.LAST_PAGE &quot;</span><span style="color: #339933;">+</span><br />
<span style="color: #0000ff;">&quot;WHEN NOT MATCHED THEN &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;INSERT (dst.USER_ID, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;dst.DATE_FIELD, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;dst.LAST_PAGE) &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; <span style="color: #0000ff;">&quot;VALUES (src.USER_ID, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;src.DATE_FIELD, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;src.LAST_PAGE)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>In sostanza, l&#8217;operazione &#8220;MERGE&#8221; funziona tra tabelle, prende i valori di una e li inserisce o aggiorna nell&#8217;altra in base al matching della condizione nella clausola &#8220;ON&#8221;.<br />
Tuttavia, la necessità non era di utilizzare valori preesistenti di una tabella ed inserirli o aggiornarli nell&#8217;altra, ma l&#8217;effettivo popolamento della tabella. Esigenza risolta appoggiandosi alla tabella &#8220;DUAL&#8221;.<br />
Ovviamente, invece di inserire direttamente nella stringa i valori necessari, si poteva utilizzare anche il &#8216;?&#8217; e chiamare poi le funzioni della classe PreparedStatement.</p>
<div class="codecolorer-container java twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003399;">PreparedStatement</span> pstmt <span style="color: #339933;">=</span> conn.<span style="color: #006633;">prepareStatement</span><span style="color: #009900;">&#40;</span><br />
<span style="color: #0000ff;">&quot;MERGE INTO last_page_table dst &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;USING ( &quot;</span><span style="color: #339933;">+</span><br />
<span style="color: #0000ff;">&quot;SELECT ? USER_ID, ? &nbsp;DATE_FIELD, ? LAST_PAGE &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;FROM DUAL) src &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;ON (dst.USER_ID = src.USER_ID AND &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;dst.DATE_FIELD = src.DATE_FIELD) &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;WHEN MATCHED THEN &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;UPDATE SET dst.LAST_PAGE = src.LAST_PAGE &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp;<span style="color: #0000ff;">&quot;WHEN NOT MATCHED THEN &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;INSERT (dst.USER_ID, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;dst.DATE_FIELD, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;dst.LAST_PAGE) &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;VALUES (src.USER_ID, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;src.DATE_FIELD, &quot;</span><span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;src.LAST_PAGE)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Se non vi sono particolari necessità in termini di performance, sicurezza, flessibilità, in genere preferisco inserire tutto direttamente nella stringa in modo da poterla scrivere facilmente su un file di log prima di inviarla al driver:</p>
<div class="codecolorer-container java twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003399;">String</span> sqlMerge <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;MERGE INTO ...&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #003399;">PreparedStatement</span> pstmt <span style="color: #339933;">=</span> conn.<span style="color: #006633;">prepareStatement</span><span style="color: #009900;">&#40;</span>sqlMerge<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Executing &quot;</span><span style="color: #339933;">+</span>sqlMerge<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
pstmt.<span style="color: #006633;">executeUpdate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fabiofalcinelli.it/2009/01/oracle-10g-upsert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
