<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>arjuna del toso</title>
	
	<link>http://arjuna.deltoso.net</link>
	<description />
	<pubDate>Thu, 16 Apr 2009 13:04:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/adt-en" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Ecofont, reduce ink consumption saving the green (and money)</title>
		<link>http://arjuna.deltoso.net/articoli/ecofont-reduce-ink-consumption-saving-the-green-and-money/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/ecofont-reduce-ink-consumption-saving-the-green-and-money/en/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 17:52:32 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[font]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=227</guid>
		<description><![CDATA[Quick post only to point out a nice project of Spranq.nl called Ecofont. The aim of the project is to help people reducing the amount of ink used for printing, and save money too  
&#8220;The font produced uses up to 20% less ink&#8221; - they say. You can download it for free here http://www.ecofont.eu/downloads_en.html, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-228" title="ecofont_logo_witte_bg" src="http://arjuna.deltoso.net/wp-content/uploads/2009/02/ecofont_logo_witte_bg.jpg" alt="" width="200" height="108" />Quick post only to point out a nice project of <a href="http://www.spranq.nl/" target="_blank">Spranq.nl</a> called <a href="http://www.ecofont.eu/ecofont_en.html" target="_blank">Ecofont</a>. The aim of the project is to help people reducing the amount of ink used for printing, and save money too <img src='http://arjuna.deltoso.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&#8220;The font produced uses <a href="http://www.ecofont.eu/results.html" target="_blank">up to 20% less</a> ink&#8221; - they say. You can download it for free here <a href="http://www.ecofont.eu/downloads_en.html" target="_blank">http://www.ecofont.eu/downloads_en.html</a>, instructions on how to install under Linux can be found at this page <a href="http://www.ecofont.eu/linux_en.html" target="_blank">http://www.ecofont.eu/linux_en.html</a> (little tip: if you are on Ubuntu and don&#8217;t have <code>ttmkfdir</code> just <code>sudo apt-get install ttmkfdir</code> on a terminal).</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/ecofont-reduce-ink-consumption-saving-the-green-and-money/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Pligg Italian Language for version 9.9.5</title>
		<link>http://arjuna.deltoso.net/progetti/pligg-italian-language-for-version-995/en/</link>
		<comments>http://arjuna.deltoso.net/progetti/pligg-italian-language-for-version-995/en/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:36:16 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[progetti]]></category>

		<category><![CDATA[language]]></category>

		<category><![CDATA[pligg]]></category>

		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=218</guid>
		<description><![CDATA[Pligg is a MYODLWSMS (Make Your Own Digg Like Web Site Management System) written in PHP and it is used to make digg-like websites (this can&#8217;t surprise you, right?).
Since I wasn&#8217;t able to find a translation into Italian, I made one by myself starting from a previous version (I can&#8217;t remember where I found that [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Pligg Home Page" href="http://www.pligg.com/" target="_blank">Pligg</a> is a MYODLWSMS (Make Your Own Digg Like Web Site Management System) written in PHP and it is used to make <a title="Digg - A web site with something social" href="http://digg.com/" target="_blank">digg</a>-like websites (this can&#8217;t surprise you, right?).</p>
<p>Since I wasn&#8217;t able to find a translation into Italian, I made one by myself starting from a previous version (I can&#8217;t remember where I found that translation, if you recognize it as yours drop a message and I will give credit).</p>
<p>Here you can download the file:</p>
<h4><a href="http://file.deltoso.net/language_italian_pligg_9_9_5.zip">Pligg 9.9.5 Italian Translation</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/progetti/pligg-italian-language-for-version-995/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>“The Fundamentals of Graphic Design” Wordpress Theme</title>
		<link>http://arjuna.deltoso.net/progetti/the-fundamentals-of-graphic-design-wordpress-theme-2/en/</link>
		<comments>http://arjuna.deltoso.net/progetti/the-fundamentals-of-graphic-design-wordpress-theme-2/en/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 23:58:21 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[progetti]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[themes]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=153</guid>
		<description><![CDATA[Recently I have bought a book called &#8220;The Fundamentals of Graphic Design&#8221; by Gavin Ambrose &#38; Paul Harris  (AVA Academia).
Finding the design of the book interesting I used it as an inspiration for this wordpress theme.

The theme has been selected by Wordpress authors and now you can grab it from the official wordpress themes [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have bought a book called &#8220;<a href="http://www.avabooks.ch/index.php/ava/bookdetails/978-2-940373-82-6" target="_blank">The Fundamentals of Graphic Design</a>&#8221; by Gavin Ambrose &amp; Paul Harris  (AVA Academia).</p>
<p>Finding the design of the book interesting I used it as an inspiration for this wordpress theme.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-208" title="The Fundamentals of Graphics Design" src="http://arjuna.deltoso.net/wp-content/uploads/2009/01/screenshot.png" alt="" width="300" height="225" /></p>
<p style="text-align: left;">The theme has been selected by Wordpress authors and now you can grab it from the official wordpress themes directory: <a title="The Fundamentals of graphic design wordpress theme" href="http://wordpress.org/extend/themes/the-fundamentals-of-graphic-design">http://wordpress.org/extend/themes/the-fundamentals-of-graphic-design</a></p>
<p style="text-align: left;">The theme features:</p>
<ul>
<li> a <strong>widgetized</strong> bottom sidebar;</li>
<li><strong>excerpts</strong> exposed before the post content;</li>
<li><strong>hierachical</strong> categories;</li>
<li>customizable <strong>colors</strong> and blog <strong>position</strong>.</li>
</ul>
<p>For support please use the official wordpress forum at <a href="http://wordpress.org/tags/the-fundamentals-of-graphic-design?forum_id=10#postform" target="_blank">http://wordpress.org/tags/ the-fundamentals-of-graphic-design ?forum_id=10#postform</a></p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/progetti/the-fundamentals-of-graphic-design-wordpress-theme-2/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Automatic Oracle 10g Startup and Shutdown at Ubuntu Linux system boot</title>
		<link>http://arjuna.deltoso.net/articoli/automatic-oracle-10g-startup-and-shutdown-at-ubuntu-linux-system-boot/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/automatic-oracle-10g-startup-and-shutdown-at-ubuntu-linux-system-boot/en/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 13:09:56 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[Database]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=111</guid>
		<description><![CDATA[Set the restart flag to &#8220;Y&#8221; in /etc/oratab, from something like this
dbname:/u01/app/oracle/product/10.2.0/db_1:N
to something like
dbname:/u01/app/oracle/product/10.2.0/db_1:Y
Copy&#38;paste the boot script code that follows into /etc/init.d/dbora (the file dbora doesn&#8217;t exists, so create it) and modify the bold values to reflect your installation:
#!/bin/sh
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you [...]]]></description>
			<content:encoded><![CDATA[<p>Set the restart flag to &#8220;Y&#8221; in /etc/oratab, from something like this</p>
<p>dbname:/u01/app/oracle/product/10.2.0/db_1:<strong>N</strong></p>
<p>to something like</p>
<p>dbname:/u01/app/oracle/product/10.2.0/db_1:<strong>Y</strong></p>
<p>Copy&amp;paste the boot script code that follows into /etc/init.d/dbora (the file dbora doesn&#8217;t exists, so create it) and modify the bold values to reflect your installation:</p>
<pre>#!/bin/sh
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORACLE_HOME=<strong>/u01/app/oracle/product/10.2.0/db_1</strong>
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH

ORA_HOME=<strong>/u01/app/oracle/product/10.2.0/db_1</strong>
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        ;;
esac</pre>
<p>Assign proper script privileges:</p>
<p><code>chmod 750 /etc/init.d/dbora</code></p>
<p>Create the symbolic links related to boot runlevels [since I'm a long-time-Slackware-user and pretty new to Ubuntu, I'm not well versed about Ubuntu boot system so feel free to correct me (the comments are at the end of the post)]:</p>
<pre>ln -s /etc/init.d/dbora /etc/rc0.d/k01dbora
ln -s /etc/init.d/dbora /etc/rc1.d/k01dbora
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc4.d/S99dbora</pre>
<p>at the end you should have something like this:</p>
<pre>lrwxrwxrwx 1 root root   17 2008-07-16 14:16 /etc/rc0.d/k01dbora -&gt; /etc/init.d/dbora
lrwxrwxrwx 1 root root   17 2008-07-16 14:16 /etc/rc1.d/k01dbora -&gt; /etc/init.d/dbora
lrwxrwxrwx 1 root root   17 2008-07-16 14:16 /etc/rc2.d/S99dbora -&gt; /etc/init.d/dbora
lrwxrwxrwx 1 root root   17 2008-07-16 14:16 /etc/rc3.d/S99dbora -&gt; /etc/init.d/dbora
lrwxrwxrwx 1 root root   17 2008-07-16 14:16 /etc/rc4.d/S99dbora -&gt; /etc/init.d/dbora</pre>
<p>Release 2 bug: inside /u01/app/oracle/product/10.2.0/db_1/bin/dbstart there is a bug that will prevent the listener to start (<em>Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr</em>); to solve change line 78 from</p>
<pre>ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr</pre>
<p>to</p>
<pre>ORACLE_HOME_LISTNER=$ORACLE_HOME</pre>
<p><em>(in this article a modified version of the script at <a href="http://www.oracle-base.com/articles/linux/AutomatingDatabaseStartupAndShutdownOnLinux.php" target="_blank">http://www.oracle-base.com/articles/linux/ AutomatingDatabaseStartupAndShutdownOnLinux.php</a>)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/automatic-oracle-10g-startup-and-shutdown-at-ubuntu-linux-system-boot/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Auto increment Integer Value on Oracle Database (10g)</title>
		<link>http://arjuna.deltoso.net/articoli/auto-increment-integer-value-on-oracle-database-10g/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/auto-increment-integer-value-on-oracle-database-10g/en/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 13:30:27 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[10g]]></category>

		<category><![CDATA[auto increment]]></category>

		<category><![CDATA[Database]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[sequence]]></category>

		<category><![CDATA[trigger]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=99</guid>
		<description><![CDATA[Using databases it is often useful to have rows identified by a unique numeric value (mainly for ID columns), no matter what the value is. If, like me, you have a background of MySQL (where auto increment values are easy like saying AUTO_INCREMENT) but for some reasons you have to develop something on Oracle Database [...]]]></description>
			<content:encoded><![CDATA[<p>Using databases it is often useful to have rows identified by a <strong>unique numeric value</strong> (mainly for ID columns), no matter what the value is. If, like me, you have a background of <em>MySQL</em> (where auto increment values are easy like saying <a id="pax." title="Autoincrement on MySQL database" href="http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html" target="_blank">AUTO_INCREMENT</a>) but for some reasons you have to develop something on <a id="dwtr" title="Oracle Database 10g" href="http://www.oracle.com/technology/products/database/oracle10g/index.html" target="_blank">Oracle Database 10g</a> you&#8217;ll be a little confused about the lack of a single auto increment function.</p>
<p>Here is a simple <em>howto</em> on how to have an <strong>auto incremented numeric column value on Oracle Database</strong> using a <strong>sequence</strong> and a <strong>trigger</strong> (if you find some errors please use the comments):</p>
<p><em>Tested on: Oracle Database 10g Enterprise Edition</em><br id="hfwk" /> <br id="hfwk0" /> <em>Precondition: a numeric type (INTEGER is ok) column in a table (in this example the schema is PROVA01 and the table is UTENTI with ID as column).</em></p>
<ol>
<li id="es640"> Log in Oracle Enterprise Manager (probably http://servername:1158/em/) as     user with proper privileges (SYS as SYSDBA will work);</li>
<li id="ka.n"> Go to &#8220;Administration&#8221;;</li>
<li id="ka.n0"> Under &#8220;Schemas &gt; Database Objects&#8221; open &#8220;Sequence&#8221;;</li>
<li id="auwc"> Select proper schema (in this how to is <em>PROVA01</em>, the table is <em>UTENTI</em> and the field is <em>ID</em>);</li>
<li id="v9bb"> Create a new sequence by filling:
<ol>
<li id="e:5c0"> Name: choose a name, something like <em>UTENTI_ID</em>_SEQ should be fine;</li>
<li id="e:5c0"> Schema: select PROVA01;</li>
<li id="e:5c0">Max value: no limit;</li>
<li id="e:5c0">Min value: enter value 1;</li>
<li id="e:5c0">Increment: 1;</li>
<li id="e:5c0">Start: 1;</li>
<li id="e:5c0">De-select &#8220;Use Cache&#8221;</li>
<li id="e:5c0">When done click &#8220;OK&#8221; button <em>(the screenshot is in italian)</em><br />
<a href="http://arjuna.deltoso.net/wp-content/uploads/2008/09/oracle_sequence.png"><img class="alignnone size-medium wp-image-100" title="oracle_sequence" src="http://arjuna.deltoso.net/wp-content/uploads/2008/09/oracle_sequence-218x300.png" alt="" width="218" height="300" /></a></li>
</ol>
</li>
<li>Return back to administration page and go to &#8220;Programs &gt; Triggers&#8221; and create a new trigger:
<ol>
<li>Name: TRIGGER_SEQ_UTENTI is a good choice;</li>
<li>Schema: PROVA01;</li>
<li>Select &#8220;Replace if exists&#8221;</li>
<li>Trigger body (in bold values you may change):
<pre>BEGIN
SELECT <strong>UTENTI_ID_SEQ</strong>.NEXTVAL
INTO   :NEW.<strong>ID</strong>
FROM   DUAL;
END <strong>UTENTE_SEQ_TRIGGER</strong>;</pre>
</li>
<li>Go to &#8220;Event&#8221; tab and configure the trigger:
<ol>
<li>&#8220;Execute the trigger&#8221; on Table;</li>
<li>Table: in this case PROVA01.UTENTI;</li>
<li>Start trigger: before;</li>
<li>Event: INSERT;</li>
</ol>
</li>
<li>Go to &#8220;Advanced&#8221; and select &#8220;FOR EACH ROW&#8221;;</li>
</ol>
</li>
<li>Save the trigger and, if any, check out the errors.</li>
</ol>
<p>Test the sequence and trigger by inserting a new table row, the ID value will be auto-inserted (and incremented).</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/auto-increment-integer-value-on-oracle-database-10g/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>A List Apart - Survey 2008 for people who make web sites</title>
		<link>http://arjuna.deltoso.net/articoli/a-list-apart-survey-2008-for-people-who-make-web-sites/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/a-list-apart-survey-2008-for-people-who-make-web-sites/en/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 12:06:15 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[A Lists Apart]]></category>

		<category><![CDATA[Survey]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=80</guid>
		<description><![CDATA[Last year nearly 33,000 developers, designers, editors, &#8230; took the survey. Now it&#8217;s out the 2008 edition.

The data gathered by the 2007 Survey spotlighted the identikit of the &#8220;person who make web sites&#8221;: male (82,8%) white (84,6%), aged between 25 and 32 years (43,6%), from United States (48,1%) and developer (25,3%).
The full findings are available [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.alistapart.com/articles/webdesignsurvey" target="_blank">Last year</a> nearly 33,000 developers, designers, editors, &#8230; took the survey. Now it&#8217;s out the 2008 edition.</p>
<p style="text-align: center;"><a href="http://www.alistapart.com/articles/survey2008"><img class="aligncenter size-full wp-image-78" title="i-took-the-2008-survey" src="http://arjuna.deltoso.net/wp-content/uploads/2008/08/i-took-the-2008-survey.gif" alt="" width="180" height="46" /></a></p>
<p>The data gathered by the 2007 Survey <span onclick="dr4sdgryt(event)">spotlight</span>ed the identikit of the &#8220;person who make web sites&#8221;: male (82,8%) white (84,6%), aged between 25 and 32 years (43,6%), from United States (48,1%) and developer (25,3%).</p>
<p>The full findings are available here <a href="http://www.alistapart.com/articles/2007surveyresults" target="_blank">http://www.alistapart.com/articles/2007surveyresults</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/a-list-apart-survey-2008-for-people-who-make-web-sites/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Load the MeSH vocabulary into a MySQL database. A simple script.</title>
		<link>http://arjuna.deltoso.net/articoli/load-the-mesh-vocabulary-into-a-mysql-database-a-simple-script/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/load-the-mesh-vocabulary-into-a-mysql-database-a-simple-script/en/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 19:07:24 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[mesh]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=30</guid>
		<description><![CDATA[A simple script written in Java to load the MeSH terms into a MySQL database.
This script simply loads the MeSH terms (the value of &#8220;/DescriptorRecordSet &#62; DescriptorRecord &#62; DescriptorName &#62; String&#8221; XML tag) that can be found in the MeSH XML formatted version of the vocabulay (http://www.nlm.nih.gov/mesh/filelist.html) into a MySQL relational database.
Download the script or [...]]]></description>
			<content:encoded><![CDATA[<p><em>A simple script written in <a title="Java Programming Language" href="http://www.java.com" target="_blank">Java</a> to load the <a title="MeSH Home Page" href="http://www.nlm.nih.gov/mesh/meshhome.html" target="_blank">MeSH</a> terms into a <a title="MySQL Home Page" href="http://www.mysql.com/" target="_blank">MySQL</a> database.</em></p>
<p>This script simply loads the <strong>MeSH terms</strong> (the value of &#8220;<code>/DescriptorRecordSet &gt; DescriptorRecord &gt; DescriptorName &gt; String</code>&#8221; XML tag) that can be found in the MeSH XML formatted version of the vocabulay (<a title="Download MeSH vocabulary" href="http://www.nlm.nih.gov/mesh/filelist.html" target="_blank">http://www.nlm.nih.gov/mesh/filelist.html</a>) into a MySQL relational database.</p>
<p><a href="http://arjuna.deltoso.net/wp-content/uploads/2008/07/mesh2database.zip">Download the script</a> or read it:</p>
<div class="highlight">
<pre><span style="font-style: italic; color: #60a0b0;">/**</span>
<span style="font-style: italic; color: #60a0b0;"> * @author Arjuna Del Toso</span>
<span style="font-style: italic; color: #60a0b0;"> * @url http://arjuna.deltoso.net/</span>
<span style="font-style: italic; color: #60a0b0;"> * </span>
<span style="font-style: italic; color: #60a0b0;"> * @FAQ: what the hell is this?</span>

<span style="font-style: italic; color: #60a0b0;"> * A simple, very simple, program to load the MESH Terms to a MySQL database</span>
<span style="font-style: italic; color: #60a0b0;"> * </span>
<span style="font-style: italic; color: #60a0b0;"> * @USAGE</span>
<span style="font-style: italic; color: #60a0b0;"> * 1-configure some stuff in the code ("//: CHANGE A VALUE HERE" string is a placeholder for what to change);</span>
<span style="font-style: italic; color: #60a0b0;"> * 2-install the required packages (jdbc connector [http://www.mysql.com/products/connector/j/] and dom4j [http://www.dom4j.org/]);</span>
<span style="font-style: italic; color: #60a0b0;"> * 3-compile it ($javac mesh2database.java);</span>

<span style="font-style: italic; color: #60a0b0;"> * 4-put the MESH Descriptor XML file and the MESH Descriptor DTD file in the current directory;</span>
<span style="font-style: italic; color: #60a0b0;"> * 5-run the program ($java mesh2database) and wait;</span>
<span style="font-style: italic; color: #60a0b0;"> * 6-enjoy the 20.000+ records inserted in your database.</span>
<span style="font-style: italic; color: #60a0b0;"> * </span>
<span style="font-style: italic; color: #60a0b0;"> */</span>

<span style="font-style: italic; color: #60a0b0;">// Some imports in order to run this program; you need</span>

<span style="font-style: italic; color: #60a0b0;">// the jdbc driver for connecting to MySQL database</span>
<span style="font-style: italic; color: #60a0b0;">// and the dom4j package for XML manipulation</span>
import java.io.<span style="color: #666666;">F</span>ile<span style="color: #666666;">;</span>
import org.dom4j.<span style="color: #666666;">D</span>ocument<span style="color: #666666;">;</span>
import org.dom4j.<span style="color: #666666;">D</span>ocumentException<span style="color: #666666;">;</span>

import org.dom4j.<span style="color: #666666;">E</span>lement<span style="color: #666666;">;</span>
import org.dom4j.<span style="color: #666666;">E</span>lementHandler<span style="color: #666666;">;</span>
import org.dom4j.<span style="color: #666666;">E</span>lementPath<span style="color: #666666;">;</span>
import org.dom4j.io.<span style="color: #666666;">SAXR</span>eader<span style="color: #666666;">;</span>

import java.sql.<span style="color: #666666;">*;</span>

<span style="font-style: italic; color: #60a0b0;">// a very fanciful name</span>
public class mesh2database {

	<span style="font-style: italic; color: #60a0b0;">// all work done here</span>
	public static void main(<span style="color: #666666;">S</span>tring<span style="color: #666666;">[</span>] args) throws <span style="color: #666666;">SQLE</span>xception {

		<span style="font-style: italic; color: #60a0b0;">// load the jdbc driver</span>

		<span style="font-weight: bold; color: #007020;">try</span> {
			<span style="color: #666666;">C</span>lass.forName(<span style="color: #4070a0;">"com.mysql.jdbc.Driver"</span>).newInstance();
		} <span style="font-weight: bold; color: #007020;">catch</span> (<span style="color: #666666;">I</span>nstantiationException e1) {
		} <span style="font-weight: bold; color: #007020;">catch</span> (<span style="color: #666666;">I</span>llegalAccessException e1) {
		} <span style="font-weight: bold; color: #007020;">catch</span> (<span style="color: #666666;">C</span>lassNotFoundException e1) {}

		<span style="font-style: italic; color: #60a0b0;">// the connection to mysql db</span>

<span style="font-style: italic; color: #60a0b0;">//: CHANGE A VALUE HERE</span>
<span style="font-style: italic; color: #60a0b0;">//: set your database values</span>
		final <span style="color: #666666;">C</span>onnection con <span style="color: #666666;">=</span> <span style="color: #666666;">D</span>riverManager.getConnection(<span style="color: #4070a0;">"jdbc:mysql://localhost/table"</span><span style="color: #666666;">,</span> <span style="color: #4070a0;">"user"</span><span style="color: #666666;">,</span> <span style="color: #4070a0;">"password"</span>);
		<span style="font-style: italic; color: #60a0b0;">// a preparedStatement in the hope to improve speed</span>

<span style="font-style: italic; color: #60a0b0;">//: CHANGE A VALUE HERE</span>
<span style="font-style: italic; color: #60a0b0;">//: configure to match your database schema</span>
		final <span style="color: #666666;">P</span>reparedStatement s <span style="color: #666666;">=</span> con.prepareStatement(<span style="color: #4070a0;">"INSERT IGNORE INTO `table`.`mesh` (`id` , `mesh` ) VALUES (NULL , ?)"</span>);

		<span style="font-style: italic; color: #60a0b0;">// the MESH Descriptors XML file,</span>
		<span style="font-style: italic; color: #60a0b0;">// can be found at http://www.nlm.nih.gov/mesh/</span>

<span style="font-style: italic; color: #60a0b0;">//: CHANGE A VALUE HERE</span>
<span style="font-style: italic; color: #60a0b0;">//: insert the path to your mesh file</span>
		<span style="color: #666666;">F</span>ile file <span style="color: #666666;">=</span> <span style="font-weight: bold; color: #007020;">new</span> <span style="color: #666666;">F</span>ile(<span style="color: #4070a0;">"desc2007"</span>);

		<span style="font-style: italic; color: #60a0b0;">// enable pruning mode to call me back as each node is complete</span>

		<span style="color: #666666;">SAXR</span>eader reader <span style="color: #666666;">=</span> <span style="font-weight: bold; color: #007020;">new</span> <span style="color: #666666;">SAXR</span>eader(<span style="font-weight: bold; color: #007020;">false</span>);

		reader.addHandler( <span style="color: #4070a0;">"/DescriptorRecordSet/DescriptorRecord/DescriptorName/String"</span><span style="color: #666666;">,</span>
				<span style="font-weight: bold; color: #007020;">new</span> <span style="color: #666666;">E</span>lementHandler() {
			public void onStart(<span style="color: #666666;">E</span>lementPath path) {}
			public void onEnd(<span style="color: #666666;">E</span>lementPath path) {
				<span style="font-style: italic; color: #60a0b0;">// process a single element</span>

				<span style="color: #666666;">E</span>lement meshDescriptorValue <span style="color: #666666;">=</span> path.getCurrent();
				<span style="color: #666666;">E</span>lement descname <span style="color: #666666;">=</span> meshDescriptorValue.getParent();
				<span style="color: #666666;">E</span>lement descrecord <span style="color: #666666;">=</span> descname.getParent();

				<span style="font-style: italic; color: #60a0b0;">// remove .toLowerCase() if you are Case Sensitive <img src='http://arjuna.deltoso.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </span>

				<span style="color: #666666;">S</span>tring meshHeading <span style="color: #666666;">=</span> meshDescriptorValue.getText().toLowerCase();

				<span style="font-style: italic; color: #60a0b0;">// i just don't want something like</span>
				<span style="font-style: italic; color: #60a0b0;">// "DNA Degradation, Apoptotic"</span>
				<span style="font-style: italic; color: #60a0b0;">// as single record in my database</span>
				<span style="font-weight: bold; color: #007020;">if</span>(<span style="color: #666666;">!</span>meshHeading.contains(<span style="color: #4070a0;">","</span>)){

					<span style="font-style: italic; color: #60a0b0;">// simple debug code (outputs the MESH DESCRIPTORS) </span>

					<span style="color: #666666;">S</span>ystem.out.println(meshHeading);

					<span style="font-style: italic; color: #60a0b0;">// the database INSERTs executed here</span>
					<span style="font-weight: bold; color: #007020;">try</span> {
						<span style="font-style: italic; color: #60a0b0;">// insert current value in the preparedStatement</span>
						s.setString(<span style="color: #40a070;">1</span><span style="color: #666666;">,</span> meshHeading);
						<span style="font-style: italic; color: #60a0b0;">// execute the statement</span>

						s.executeUpdate();
					} <span style="font-weight: bold; color: #007020;">catch</span> (<span style="color: #666666;">SQLE</span>xception e1) {}
				}
				<span style="font-style: italic; color: #60a0b0;">// prune the tree</span>
				descrecord.detach();
			}
		}
		);

		<span style="font-style: italic; color: #60a0b0;">// just reading the file will do all the work</span>
		<span style="font-weight: bold; color: #007020;">try</span> {
			<span style="color: #666666;">D</span>ocument <span style="color: #007020;">document</span> <span style="color: #666666;">=</span> reader.read(file);
		} <span style="font-weight: bold; color: #007020;">catch</span> (<span style="color: #666666;">D</span>ocumentException e) {}

		<span style="font-style: italic; color: #60a0b0;">// closing statement and connection</span>

		s.close();
		con.close();
	}

}</pre>
</div>
<p>In order to run this script you need the <a title="Download Java compiler" href="http://java.sun.com/" target="_blank">Java compiler</a>, the <a title="MeSH on XML file" href="http://www.nlm.nih.gov/mesh/filelist.html" target="_blank">MeSH XML file</a>, a <strong>MySQL installation</strong> and <em>two java libraries</em>: <a title="MySQL Java Connector" href="http://www.mysql.com/products/connector/j/" target="_blank">MySQL Connector/J</a> and <a title="DOM4J" href="http://www.dom4j.org/" target="_blank">dom4j</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/load-the-mesh-vocabulary-into-a-mysql-database-a-simple-script/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Drupal, hide install text files using rewrite rules</title>
		<link>http://arjuna.deltoso.net/articoli/drupal-hide-install-text-files-using-rewrite-rules/en/</link>
		<comments>http://arjuna.deltoso.net/articoli/drupal-hide-install-text-files-using-rewrite-rules/en/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 18:31:44 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[articoli]]></category>

		<category><![CDATA[cms]]></category>

		<category><![CDATA[drupal]]></category>

		<category><![CDATA[rewrite rule]]></category>

		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=8</guid>
		<description><![CDATA[I see lots of web sites that are using drupal cms and most of them are not hiding the text files that the installation process leave in the root directory. This is not a problem in general, but if you use an old version of drupal maybe is better not to show them to the [...]]]></description>
			<content:encoded><![CDATA[<p>I see lots of web sites that are using <a title="External site" href="http://drupal.org/" target="_blank">drupal cms</a> and most of them are not hiding the text files that the installation process leave in the root directory. This is not a problem in general, but if you use an old version of drupal maybe is better not to show them to the world. Take a look at <a title="External site" href="http://drupal.org/CHANGELOG.txt" target="_blank">drupal.org changelog file</a> (yes this site is supposed to be up of date;).</p>
<p>So I use this basic solution, note that I update drupal using cvs method so I hide also the CVS directories. Put this code in your <code>.htaccess</code> file after <code>RewriteEngine on</code> inside the <code>IfModule mod_rewrite.c</code> section:</p>
<pre>RewriteRule    ^(.*)CHANGELOG\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)INSTALL\.mysql\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)INSTALL\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)MAINTAINERS\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)CVS$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)CVS/$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)INSTALL\.pgsql\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)LICENSE\.txt$  http://www.yoursite.net [R,L]
RewriteRule    ^(.*)UPGRADE\.txt$  http://www.yoursite.net [R,L]</pre>
<p>Modify to fix your needs and save the .htaccess file.</p>
<h5>F.A.Q.</h5>
<p>1 - Why you use tons of rules for every file and not something like ^(.*)\.txt$ ?</p>
<p>Mhh, I really don’t remember, maybe I have some text file I want to be accessible in the site.</p>
<p>2 - Why not just removing that text files?</p>
<p>I think that CVS imports them on every update, so you have to remove the files many times.</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/articoli/drupal-hide-install-text-files-using-rewrite-rules/en/feed/en/</wfw:commentRss>
		</item>
		<item>
		<title>Wordpress Old Style theme</title>
		<link>http://arjuna.deltoso.net/progetti/wordpress-old-style-theme-2/en/</link>
		<comments>http://arjuna.deltoso.net/progetti/wordpress-old-style-theme-2/en/#comments</comments>
		<pubDate>Fri, 04 May 2007 19:24:43 +0000</pubDate>
		<dc:creator>Arjuna Del Toso</dc:creator>
		
		<category><![CDATA[progetti]]></category>

		<guid isPermaLink="false">http://arjuna.deltoso.net/?p=44</guid>
		<description><![CDATA[Here you can download (zip, 80KB) the Old Style Wordpress theme or watch a demo site.
Install it as usual.

The theme uses JQuery for hiding/showing the top sidebar.
]]></description>
			<content:encoded><![CDATA[<p>Here you can <a href="http://file.deltoso.net/old-style.zip">download (zip, 80KB)</a> the <strong>Old Style</strong> Wordpress theme or watch a <a href="http://test.perdomani.net/" target="_blank">demo site</a>.<br />
Install it as usual.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-176" title="Old Style Wordpress Theme - Screenshot" src="http://arjuna.deltoso.net/wp-content/uploads/2008/12/oldstyle-screenshot.png" alt="" width="300" height="200" /></p>
<p style="text-align: left;">The theme uses JQuery for hiding/showing the top sidebar.</p>
]]></content:encoded>
			<wfw:commentRss>http://arjuna.deltoso.net/progetti/wordpress-old-style-theme-2/en/feed/en/</wfw:commentRss>
		</item>
	</channel>
</rss>
