<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Alessandro Lacava's Blog</title>
	<link>http://www.alessandrolacava.com/blog</link>
	<description>Blog about computer programming languages, techniques, articles, tips &#038; tricks and much...much more!</description>
	<pubDate>Tue, 29 Sep 2009 10:31:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>How to set an MP3 as an alarm in an Android phone</title>
		<link>http://www.alessandrolacava.com/blog/how-to-set-an-mp3-as-an-alarm-in-an-android-phone/</link>
		<comments>http://www.alessandrolacava.com/blog/how-to-set-an-mp3-as-an-alarm-in-an-android-phone/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 10:23:54 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/how-to-set-an-mp3-as-an-alarm-in-an-android-phone/</guid>
		<description><![CDATA[If you&#8217;re reading this post then you probably want to use an MP3 file as the sound played by your Android phone when it wakes you up in the morning. 
To do that you just need to create a folder named alarms (lowercase) and put the MP3 file under it.
IMPORTANT NOTE: you might need to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re reading this post then you probably want to use an MP3 file as the sound played by your Android phone when it wakes you up in the morning. <img src='http://www.alessandrolacava.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
To do that you just need to create a folder named <b>alarms</b> (lowercase) and put the MP3 file under it.</p>
<p><b>IMPORTANT NOTE: you might need to reboot your phone in order to see the new alarm tone</b></p>
<p>P.S.: I&#8217;ve got a Samsung Galaxy i7500 and that worked for me. However, it should work for every Android phone.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/how-to-set-an-mp3-as-an-alarm-in-an-android-phone/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Undo close tab in Eclipse</title>
		<link>http://www.alessandrolacava.com/blog/undo-close-tab-in-eclipse/</link>
		<comments>http://www.alessandrolacava.com/blog/undo-close-tab-in-eclipse/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 09:33:59 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>IDE</category>
	<category>Eclipse</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/undo-close-tab-in-eclipse/</guid>
		<description><![CDATA[I don&#8217;t know about you, but I love the Firefox&#8217;s undo-close-tab feature (Ctrl+Shift+T). If you use Eclipse you might be glad to know you can undo the close-tab action in Eclipse as well. You can do that both using your mouse by clicking on the yellow left arrow you can see in the Eclipse toolbar [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about you, but I love the Firefox&#8217;s <strong>undo-close-tab</strong> feature (Ctrl+Shift+T). If you use <b>Eclipse</b> you might be glad to know you can undo the close-tab action in Eclipse as well. You can do that both using your mouse by clicking on the yellow left arrow you can see in the Eclipse toolbar and through the keybord using the Alt+Left Arrow key combination.</p>
<p>I hope this helps.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/undo-close-tab-in-eclipse/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>How to disable Firefox 3 address bar smart completing</title>
		<link>http://www.alessandrolacava.com/blog/how-to-disable-firefox-3-address-bar-smart-completing/</link>
		<comments>http://www.alessandrolacava.com/blog/how-to-disable-firefox-3-address-bar-smart-completing/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 10:01:28 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Miscellaneous</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/how-to-disable-firefox-3-address-bar-smart-completing/</guid>
		<description><![CDATA[I don&#8217;t know about you, but i don&#8217;t really like the new firefox smart location bar feature. To disable it and rollback to the firefox 2 version you need to edit two entries in the firefox configuration. Here&#8217;s what you need to do:
1. Open a new tab.
2. Type about:config in the address bar and hit [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know about you, but i don&#8217;t really like the new firefox smart location bar feature. To disable it and rollback to the firefox 2 version you need to edit two entries in the firefox configuration. Here&#8217;s what you need to do:</p>
<p>1. Open a new tab.</p>
<p>2. Type about:config in the address bar and hit the enter key.</p>
<p>3. Search for <strong>urlbar</strong> in the Filter text box.</p>
<p>4. Change <strong>browser.urlbar.matchOnlyTyped</strong> to <strong>true</strong> and <strong>browser.url<span class="hilite3">bar</span>.maxRichResults</strong> to <strong>1</strong> or any number of results you want firefox to suggest.</p>
<p>I hope this helps.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/how-to-disable-firefox-3-address-bar-smart-completing/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Object not found &#124; EasyPHP &#124; MySQL &#124; phpMyAdmin</title>
		<link>http://www.alessandrolacava.com/blog/object-not-found-easyphp-mysql-phpmyadmin/</link>
		<comments>http://www.alessandrolacava.com/blog/object-not-found-easyphp-mysql-phpmyadmin/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 09:46:05 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Apache</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/object-not-found-easyphp-mysql-phpmyadmin/</guid>
		<description><![CDATA[After installing EasyPHP, when you try to run phpMyAdmin you might get the following error:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
This might be due to the fact that it tries the following URL:
http://127.0.0.1/mysql/
Try this one instead:
http://127.0.0.1/home/mysql/
If it works [...]]]></description>
			<content:encoded><![CDATA[<p>After installing EasyPHP, when you try to run phpMyAdmin you might get the following error:</p>
<p><strong>Object not found!</strong></p>
<p><strong>The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.</strong></p>
<p>This might be due to the fact that it tries the following URL:</p>
<p><strong>http://127.0.0.1/mysql/</strong></p>
<p>Try this one instead:</p>
<p><strong>http://127.0.0.1/home/mysql/</strong></p>
<p>If it works then you can work it out by adding the following line to the httpd.conf file of Apache (you can find it under the %EASYPHP_HOME%/apache/conf path, where %EASYPHP_HOME% is the home directory of your EasyPHP installation). Open the file with a text editor and look up the following string: <strong>Alias /home/mysql</strong></p>
<p>You should find something similar to the following line:</p>
<p>Alias /home/mysql &#8220;C:/Program Files/EasyPHP 3.0/phpmyadmin&#8221;</p>
<p>Just add, to the next line, the following string:</p>
<p>Alias /mysql &#8220;C:/Program Files/EasyPHP 3.0/phpmyadmin&#8221;</p>
<p>Restart EasyPHP. Now try to open http://127.0.0.1/mysql/. It should work.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/object-not-found-easyphp-mysql-phpmyadmin/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Java split() of String &#124; Multiple whitespace characters</title>
		<link>http://www.alessandrolacava.com/blog/java-split-of-string-multiple-whitespace-characters/</link>
		<comments>http://www.alessandrolacava.com/blog/java-split-of-string-multiple-whitespace-characters/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 10:47:02 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Java</category>
	<category>RegEx</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/java-split-of-string-multiple-whitespace-characters/</guid>
		<description><![CDATA[The split method of the String class is very useful when you want to tokenize a string. Its power lies in the fact that it accepts a string, as a parameter, which can be a regular expression. However you must be careful when you want to split a string using the whitespace character as a [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>split</strong> method of the <strong>String</strong> class is very useful when you want to tokenize a string. Its power lies in the fact that it accepts a string, as a parameter, which can be a regular expression. However you must be careful when you want to split a string using the whitespace character as a delimiter. Consider the following snippet of code:</p>
<div class="igBar"><span id="ljava-3"><a href="#" onclick="javascript:showPlainTxt('java-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span><br />
<div id="java-3">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> str = <span style="color: #ff0000;">"Testing split using two  whitespace characters"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> tokens = str.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\\</span>s"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> token : tokens<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"-"</span> + token + <span style="color: #ff0000;">"-"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>What's the output produced by the previous code? If you think it is the following one you're wrong:<strong><br />
-Testing-<br />
-split-<br />
-using-<br />
-two-<br />
-whitespace-<br />
-characters-</strong></p>
<p>The actual output is instead the following one:</p>
<p><strong>-Testing-<br />
-split-<br />
-using-<br />
-two-<br />
--<br />
-whitespace-<br />
-characters-</strong></p>
<p>Where in the hell did that empty string come out from? It comes out from the two whitespace characters that are between the word <strong>two</strong> and <strong>whitespace</strong> of the <strong>str</strong> string. If this is what you want OK. However, most of the time, you will want to discard that empty string from your resulting string array. You can obtain this result by using the <strong>\\s+</strong> regex in place of <strong>\\s</strong>. Basically, the previuos code becomes:</p>
<div class="igBar"><span id="ljava-4"><a href="#" onclick="javascript:showPlainTxt('java-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span><br />
<div id="java-4">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> str = <span style="color: #ff0000;">"Testing split using two  whitespace characters"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> tokens = str.<span style="color: #006600;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\\</span>s+"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a> token : tokens<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"-"</span> + token + <span style="color: #ff0000;">"-"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/java-split-of-string-multiple-whitespace-characters/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>OutOfMemoryError in Eclipse &#124; Java Virtual Machine (JVM)</title>
		<link>http://www.alessandrolacava.com/blog/outofmemoryerror-in-eclipse-java-virtual-machine-jvm/</link>
		<comments>http://www.alessandrolacava.com/blog/outofmemoryerror-in-eclipse-java-virtual-machine-jvm/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 08:53:07 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Java</category>
	<category>IDE</category>
	<category>Eclipse</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/outofmemoryerror-in-eclipse-java-virtual-machine-jvm/</guid>
		<description><![CDATA[OutOfMemoryError in Eclipse &#124; Java Virtual Machine (JVM)
It might happen that while running a Java application within the Eclipse environment you get an OutOfMemoryError due to the maximum amount of memory dedicated to the heap. You can fix it by increasing the minimum (-Xms parameter) and maximum (-Xmx parameter) heap size. You can do it [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: center; font-size: 15px; font-weight: bold">OutOfMemoryError in Eclipse | Java Virtual Machine (JVM)</h1>
<p>It might happen that while running a Java application within the Eclipse environment you get an OutOfMemoryError due to the maximum amount of memory dedicated to the heap. You can fix it by increasing the minimum (-Xms parameter) and maximum (-Xmx parameter) heap size. You can do it in two different ways:</p>
<p>1. By editing your <strong>eclipse.ini</strong> file you find under your Eclipse installation directory. Within that file you should find two lines similar to the following ones:</p>
<p><strong>-Xms40m</strong><br />
<strong> -Xmx512m</strong></p>
<p>You might want to change them depending on your hardware. For example I changed them as follows:</p>
<p><strong>-Xms256m</strong><br />
<strong>-Xmx1024m</strong></p>
<p>It means: "start with an initial heap size of 256 MB and grow to a maximum of 1024MB, that is 1GB."</p>
<p>2. By editing the <strong>Run Configurations in Eclipse</strong>. To do this, right-click on the class you want to run (the one with the main method) and then select:</p>
<p><strong>Run As -> Run Configurations</strong></p>
<p>Click on the <strong>Arguments</strong> tab. In the VM Arguments box type:</p>
<p><strong>-Xms256m -Xmx1024m</strong></p>
<p>or whatever you prefer, depending on the hardware you possess.</p>
<p><strong>IMPORTANT NOTE: It is strongly recommended that you make a backup copy of your eclipse.ini file before editing it in any way.</strong>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/outofmemoryerror-in-eclipse-java-virtual-machine-jvm/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Mapping between charset name and Java name</title>
		<link>http://www.alessandrolacava.com/blog/mapping-between-charset-name-and-java-name/</link>
		<comments>http://www.alessandrolacava.com/blog/mapping-between-charset-name-and-java-name/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 10:44:49 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Java</category>
	<category>Encoding</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/mapping-between-charset-name-and-java-name/</guid>
		<description><![CDATA[The following table shows a mapping between XML names and Java names for encoding.
An example of class where you can use these Java names for encoding is the OutputStreamWriter class
Table 1. Standard Character Sets and Encodings


XML Name
Java Name
First supported in Java
Scripts and Languages


ISO-8859-1
8859_1
1.1
Latin-1: ASCII plus the accented characters needed for most   Western European [...]]]></description>
			<content:encoded><![CDATA[<h1 style="font-size: 15px; text-align: left">The following table shows a mapping between XML names and Java names for encoding.</h1>
<h1 style="font-size: 15px; text-align: left">An example of class where you can use these Java names for encoding is the OutputStreamWriter class</h1>
<div style="margin-top: 10px"><strong>Table 1. Standard Character Sets and Encodings</strong></p>
<table width="570" border="1" summary="Standard Character Sets and Encodings">
<thead>
<th>XML Name</th>
<th>Java Name</th>
<th>First supported in Java</th>
<th>Scripts and Languages</th>
</tr>
<tr>
<td>ISO-8859-1</td>
<td>8859_1</td>
<td>1.1</td>
<td>Latin-1: ASCII plus the accented characters needed for most   Western European languages including Albanian, Basque, Breton, Catalan, Cornish,    Danish, Dutch, English, Estonian, Faroese, Finnish, French, Frisian, Galician, German, Greenlandic,    Icelandic, Irish, Italian, Latin,    Luxemburgish, Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Sorbian, Spanish, and Swedish as well as many non-European languages written in the Latin alphabet such as Swahili and Malaysian</td>
</tr>
<tr>
<td>ISO-8859-2</td>
<td>8859_2</td>
<td>1.1</td>
<td>Latin-2: ASCII plus the accented characters needed for most   Central European languages including Albanian,   Croatian, Czech, Finnish, German, Hungarian, Latin, Polish, Romanian,  Slovak, Slovenian, and Sorbian</td>
</tr>
<tr>
<td>ISO-8859-3</td>
<td>8859_3</td>
<td>1.1</td>
<td>Latin-3: ASCII plus the accented characters needed for most   Southern European languages including    English, Esperanto, Finnish,  French, German, Italian, Latin, Maltese,  Portuguese, and Turkish</td>
</tr>
<tr>
<td>ISO-8859-4</td>
<td>8859_4</td>
<td>1.1</td>
<td>Latin-4: ASCII plus the accented characters needed for most   Northern European languages including  Danish, English, Estonian,  Finnish, German, Greenlandic,  Latin, Latvian, Lithuanian, Norwegian, S?mi,  Slovenian, and Swedish</td>
</tr>
<tr>
<td>ISO-8859-5</td>
<td>8859_5</td>
<td>1.1</td>
<td>ASCII plus Cyrillic</td>
</tr>
<tr>
<td>ISO-8859-6</td>
<td>8859_6</td>
<td>1.1</td>
<td>ASCII plus Arabic</td>
</tr>
<tr>
<td>ISO-8859-7</td>
<td>8859_7</td>
<td>1.1</td>
<td>ASCII plus Greek</td>
</tr>
<tr>
<td>ISO-8859-8</td>
<td>8859_8</td>
<td>1.1</td>
<td>ASCII plus Hebrew</td>
</tr>
<tr>
<td>ISO-8859-9</td>
<td>8859_9</td>
<td>1.1</td>
<td>Latin-5: same as Latin-1 except the Turkish letters   G, g, I, i, S, and s    take the place of the Icelandic letters þ, Þ, ý, Ý, Ð, and ð</td>
</tr>
<tr>
<td>ISO-8859-13</td>
<td>ISO8859_13</td>
<td>1.3</td>
<td>Latin-7: ASCII plus the accented characters needed for most   Baltic languages including Latvian, Lithuanian, Estonian, and Finnish,   as well as English, Danish, Swedish, German, Slovenian,   and Norwegian.</td>
</tr>
<tr>
<td>ISO-8859-15</td>
<td>ISO8859_15_FDIS</td>
<td>1.2</td>
<td>Latin-9: same as Latin-1 but with the Euro sign    €   instead of the international currency   symbol ¤. It also replaces the infrequently used symbol characters   ¦, ¨, ´, ¸, ¼, ½, and ¾ with the    infrequently used French and Finnish letters Š, š, Ž, ž,   Œ, œ, and Ÿ.</td>
</tr>
<tr>
<td>UTF-8</td>
<td>UTF8</td>
<td>1.1</td>
<td>The default encoding of XML documents; each Unicode character   is represented in between 1 and 4 bytes.</td>
</tr>
<tr>
<td>UTF-16</td>
<td>UnicodeBig or UnicodeLittle</td>
<td>1.2</td>
<td>An encoding of Unicode in which characters in the Basic Multilingual Plane   are encoded in two bytes, and all other characters are encoded as two two-byte   surrogates</td>
</tr>
<tr>
<td>ISO-10646-UCS-2</td>
<td>N/A</td>
<td>N/A</td>
<td>A straightforward encoding in which each Unicode character   is represented as a two-byte integer; cannot represent characters outside the    Basic Multilingual Plane</td>
</tr>
<tr>
<td>ISO-10646-UCS-4</td>
<td>N/A</td>
<td>N/A</td>
<td>A straightforward encoding in which each Unicode character   is represented as a four-byte integer</td>
</tr>
<tr>
<td>ISO-2022-JP</td>
<td>JIS</td>
<td>1.1</td>
<td>Japanese</td>
</tr>
<tr>
<td>Shift_JIS</td>
<td>SJIS</td>
<td>1.1</td>
<td>Japanese</td>
</tr>
<tr>
<td>EUC-JP</td>
<td>EUCJIS</td>
<td>1.1</td>
<td>Japanese</td>
</tr>
<tr>
<td>US-ASCII</td>
<td>ASCII</td>
<td>1.2</td>
<td>English</td>
</tr>
<tr>
<td>GBK</td>
<td>GBK</td>
<td>1.1</td>
<td>Simplified Chinese</td>
</tr>
<tr>
<td>Big5</td>
<td>Big5</td>
<td>1.1</td>
<td>Traditional Chinese</td>
</tr>
<tr>
<td>ISO-2022-CN</td>
<td>ISO2022CN</td>
<td>1.1</td>
<td>Traditional Chinese</td>
</tr>
<tr>
<td>ISO-2022-KR</td>
<td>ISO2022KR</td>
<td>1.1</td>
<td>Korean</td>
</tr>
</table>
</div>
<div style="margin-top: 10px">Note: The previous table is extracted from the following book: <a target="_blank" href="http://www.amazon.com/exec/obidos/ISBN%3D0201771861/ref=nosim/cafeaulaitA/">Processing XML with Java(TM): A Guide to SAX, DOM, JDOM, JAXP, and TrAX</a></div>
<div>I suggest you read it if you're serious about processing XML using the Java programming language</div>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/mapping-between-charset-name-and-java-name/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>How to round fieldset corners in Firefox (make it behave like Internet Explorer)</title>
		<link>http://www.alessandrolacava.com/blog/how-to-round-fieldset-corners-in-firefox-make-it-behave-like-internet-explorer/</link>
		<comments>http://www.alessandrolacava.com/blog/how-to-round-fieldset-corners-in-firefox-make-it-behave-like-internet-explorer/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 14:25:01 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/how-to-round-fieldset-corners-in-firefox-make-it-behave-like-internet-explorer/</guid>
		<description><![CDATA[If you already used the &#60;fieldset&#62; HTML tag then you might have noticed that it is rendered differently in Internet Explorer and Firefox. In the former it is rendered with rounded corners while in the latter with squared ones. Nevertheless you can tell Firefox to round the fieldset corners using the following CSS:
PLAIN TEXT
HTML:




&#60;fieldset style="-moz-border-radius: 5pt"&#62;


&#60;legend&#62;You [...]]]></description>
			<content:encoded><![CDATA[<p>If you already used the &lt;fieldset&gt; HTML tag then you might have noticed that it is rendered differently in Internet Explorer and Firefox. In the former it is rendered with rounded corners while in the latter with squared ones. Nevertheless you can tell Firefox to round the fieldset corners using the following CSS:</p>
<div class="igBar"><span id="lhtml-6"><a href="#" onclick="javascript:showPlainTxt('html-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span><br />
<div id="html-6">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/fieldset.html"><span style="color: #000000; font-weight: bold;">&lt;fieldset</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">"-moz-border-radius: 5pt"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/legend.html"><span style="color: #000000; font-weight: bold;">&lt;legend&gt;</span></a></span>You Title<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/legend&gt;</span></span>  </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"fieldsetContent"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Your Content<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fieldset&gt;</span></span>   </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Of course you can edit the value assigned to the -moz-border-radius  property to  change the radius of the corner.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/how-to-round-fieldset-corners-in-firefox-make-it-behave-like-internet-explorer/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Performance differences between IN and EXISTS</title>
		<link>http://www.alessandrolacava.com/blog/performance-differences-between-in-and-exists/</link>
		<comments>http://www.alessandrolacava.com/blog/performance-differences-between-in-and-exists/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 13:33:24 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Oracle</category>
	<category>Database</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/performance-differences-between-in-and-exists/</guid>
		<description><![CDATA[Very often I hear people wondering if it's better the EXISTS or the IN operator.
Let's start by saying that the two operators behave differently when NULL values are involved (see this post).
If you are sure that the field used to join the tables does not include NULL values then the IN operator performs "generally" better [...]]]></description>
			<content:encoded><![CDATA[<p>Very often I hear people wondering if it's better the EXISTS or the IN operator.<br />
Let's start by saying that the two operators behave differently when NULL values are involved (see <a href="http://www.alessandrolacava.com/blog/not-in-vs-not-exists-when-null-values-are-involved/">this post</a>).</p>
<p>If you are sure that the field used to join the tables does not include NULL values then the IN operator performs "generally" better than EXISTS. I say "generally" because this is not always the case. For example consider the following query:</p>
<div class="igBar"><span id="lsql-11"><a href="#" onclick="javascript:showPlainTxt('sql-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-11">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> table_a a</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> a.cd_field <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> b.cd_field <span style="color: #993333; font-weight: bold;">FROM</span> table_b b<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The previous query is processed more or less as follows:</p>
<div class="igBar"><span id="lsql-12"><a href="#" onclick="javascript:showPlainTxt('sql-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-12">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> table_a a,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span> cd_field <span style="color: #993333; font-weight: bold;">FROM</span> table_b<span style="color:#006600; font-weight:bold;">&#41;</span> b</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> a.cd_field != b.cd_field; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The subquery is evaluated and the duplicates removed from the result (DISTINCT).<br />
Then it is joined to the outer table. Now lets analyze the same query using NOT EXISTS:</p>
<div class="igBar"><span id="lsql-13"><a href="#" onclick="javascript:showPlainTxt('sql-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-13">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> table_a a</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #993333; font-weight: bold;">FROM</span> table_b b <span style="color: #993333; font-weight: bold;">WHERE</span> a.cd_field = b.cd_field<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The previous query is processed more or less as follows:</p>
<div class="igBar"><span id="lsql-14"><a href="#" onclick="javascript:showPlainTxt('sql-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-14">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FOR</span> x <span style="color: #993333; font-weight: bold;">IN</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> * <span style="color: #993333; font-weight: bold;">FROM</span> table_a <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">LOOP</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">IF</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #993333; font-weight: bold;">FROM</span> table_b b <span style="color: #993333; font-weight: bold;">WHERE</span> x.cd_field = b.cd_field <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">THEN</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">--output the record</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">END <span style="color: #993333; font-weight: bold;">IF</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">END LOOP </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This means that using NOT EXISTS always results in a full scan of the outer table whereas the query which uses NOT IN can exploit an index on table_a.cd_field.<br />
In general NOT IN performs better when the result of the subquery is small and there's an index on the field used by the join. On the other hand, NOT EXISTS is to prefer when the subquery has many rows, the outer query is relatively small and there's an index on the field used to join the two tables. In this latter case the cost of removing duplicates (DISTINCT) could be greater than the cost of the full scan of the outer table.</p>
<p>Of course this is a very general guideline, you should always conduct some test using indexes and so on to figure out which method to use.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/performance-differences-between-in-and-exists/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>NOT IN vs. NOT EXISTS when NULL values are involved</title>
		<link>http://www.alessandrolacava.com/blog/not-in-vs-not-exists-when-null-values-are-involved/</link>
		<comments>http://www.alessandrolacava.com/blog/not-in-vs-not-exists-when-null-values-are-involved/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 13:24:09 +0000</pubDate>
		<dc:creator>alessandrolacava</dc:creator>
		
	<category>Computer</category>
	<category>Oracle</category>
	<category>Database</category>
		<guid isPermaLink="false">http://www.alessandrolacava.com/blog/not-in-vs-not-exists-when-null-values-are-involved/</guid>
		<description><![CDATA[NOT IN does not behave as you would expect when NULL values are involved.
Suppose you have the following tables:
TABLE_A


CD_FIELD
DS_FIELD


1
ALPHA


2
BETA


TABLE_B


CD_FIELD
DS_FIELD


1
GAMMA


NULL
DELTA


Now try the following query:
PLAIN TEXT
SQL:




SELECT *


FROM table_a a


WHERE a.cd_field NOT IN &#40;SELECT b.cd_field FROM table_b b&#41;; 






Does the previous query return any row? The answer is NO it doesn't, even if there is a value (2) [...]]]></description>
			<content:encoded><![CDATA[<p>NOT IN does not behave as you would expect when NULL values are involved.<br />
Suppose you have the following tables:</p>
<div style="margin-bottom: 0pt; font-weight: bold">TABLE_A</div>
<table border="1">
<tr>
<td style="color: #ff0000">CD_FIELD</td>
<td style="color: #ff0000">DS_FIELD</td>
</tr>
<tr>
<td>1</td>
<td>ALPHA</td>
</tr>
<tr>
<td>2</td>
<td>BETA</td>
</tr>
</table>
<div style="font-weight: bold">TABLE_B</div>
<table border="1">
<tr>
<td style="color: #ff0000">CD_FIELD</td>
<td style="color: #ff0000">DS_FIELD</td>
</tr>
<tr>
<td>1</td>
<td>GAMMA</td>
</tr>
<tr>
<td>NULL</td>
<td>DELTA</td>
</tr>
</table>
<p>Now try the following query:</p>
<div class="igBar"><span id="lsql-18"><a href="#" onclick="javascript:showPlainTxt('sql-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-18">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> table_a a</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> a.cd_field <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> b.cd_field <span style="color: #993333; font-weight: bold;">FROM</span> table_b b<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Does the previous query return any row? The answer is NO it doesn't, even if there is a value (2) in table_a.cd_field which is not present in table_b.cd_field.</p>
<p>I think this is because NOT IN internally uses the inequality operator.<br />
You should never use the equality or inequality operators with NULL, but IS NULL and IS NOT NULL, respectively.<br />
For this reason, in SQL, NULL is not equal to NULL.<br />
If you don't believe me then try the following query:</p>
<div class="igBar"><span id="lsql-19"><a href="#" onclick="javascript:showPlainTxt('sql-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-19">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'test'</span> c</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> dual</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">NULL</span> = <span style="color: #993333; font-weight: bold;">NULL</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>It returns 0 rows.</p>
<p>So how can you work this out? Enter the EXISTS (and NOT EXISTS) operator.</p>
<p>Try the following query:</p>
<div class="igBar"><span id="lsql-20"><a href="#" onclick="javascript:showPlainTxt('sql-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">SQL:</span><br />
<div id="sql-20">
<div class="sql">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">SELECT</span> *</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">FROM</span> table_a a</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #993333; font-weight: bold;">FROM</span> table_b b <span style="color: #993333; font-weight: bold;">WHERE</span> a.cd_field = b.cd_field<span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The previous query returns 1 row, that is what you would expect since there is a row in table_a with cd_field = 2 which is not present in table_b.cd_field.</p>
<p>From now on beware of using NOT IN and IN when NULL values are involved.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.alessandrolacava.com/blog/not-in-vs-not-exists-when-null-values-are-involved/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
