<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-17614970</id><updated>2011-11-24T19:05:58.713+01:00</updated><category term='plot'/><category term='opensolaris'/><category term='python'/><category term='mercurial'/><category term='tips'/><category term='gmail'/><category term='howto'/><category term='macosx'/><category term='programming'/><category term='latex'/><title type='text'>nivox's blog</title><subtitle type='html'>Pensieri più o meno deliranti di una mente malata</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-17614970.post-8030437659515312813</id><published>2008-06-08T13:07:00.002+02:00</published><updated>2008-06-08T13:31:05.661+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='plot'/><title type='text'>Plotting</title><content type='html'>For my thesis I've to produce plot of a lot of data. These plot are fairly simple: basically I have a set of points and I simply need to plot them in various styles. The data is taken from a text file containing the outputs of various simulations.&lt;br /&gt;&lt;br /&gt;First attempt was python + gnuplot. It worked, by I wasn't satisfied. Then i discover matplotlib, a python plotting library. It does everything I need (actually a lot more than what I need) and it's in python... that is: integrate it into my parsing/manipulating script it's flawless.&lt;br /&gt;&lt;br /&gt;In a few minutes I've managed to write a script that parses the data... manipulates it in the way I need (average/variation calculation and stuff like that), plots it, saves the plots in eps and in the end produces a latex file which shows all the generated plot.&lt;br /&gt;&lt;br /&gt;I already was a fan of the coding speed of python. Now I've found another thing that make it even more appealing to me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-8030437659515312813?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/8030437659515312813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=8030437659515312813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/8030437659515312813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/8030437659515312813'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/06/plotting.html' title='Plotting'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-255972074852459234</id><published>2008-06-08T11:32:00.002+02:00</published><updated>2008-06-08T11:36:19.743+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='opensolaris'/><title type='text'>OpenSolaris upgrade &amp; Boot Environment</title><content type='html'>I finally did an "image-update" of my OpenSolaris2008.05 installation. The process was a little slow (especially in the "generating plan" part) but otherwise effortless on my side.&lt;br /&gt;&lt;br /&gt;Anyway some gigabyte of download later I had my OpenSolaris 2008.05 updated to svn90. The output tells me a new BE was created (like I knew what a BE is!)  and it tells me to reboot when ready to use it.&lt;br /&gt;&lt;br /&gt;To make a long story short booting using the new GRUB entry didn't work so well. The computer started the boot process but silently rebooted. So I begun to suspect something wasn't going that well as I thought. Rebooted in the old Boot Environment and did a little googling and here's what I found:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;Instructions to update OpenSolaris 2008.05 to build 89 or later&lt;br /&gt;================================================================&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;The command "pkg image-update" can be used to update an OpenSolaris&lt;br /&gt;2008.05 system to build 89 or later.  However due to changes in the&lt;br /&gt;GRUB boot system, one must manually update the Master Boot Record (MBR)&lt;br /&gt;to include these latest changes.&lt;br /&gt;&lt;br /&gt;When "pkg image-update" completes successfully, it will print a message&lt;br /&gt;of the form&lt;br /&gt;&lt;br /&gt;A clone of opensolaris exists and has been updated and&lt;br /&gt;activated. On next boot the Boot Environment opensolaris-1 will&lt;br /&gt;be mounted on '/'. Reboot when ready to switch to this updated&lt;br /&gt;BE.&lt;br /&gt;&lt;br /&gt;The name of the newly created clone can also be seen by looking for the&lt;br /&gt;"Active on reboot" entry in the output of the "beadm list" command&lt;br /&gt;&lt;br /&gt;$ beadm list&lt;br /&gt;BE            Active Active on Mountpoint     Space&lt;br /&gt;Name                 reboot                   Used&lt;br /&gt;----          ------ --------- ----------     -----&lt;br /&gt;opensolaris-1 no     yes       -              17.06M&lt;br /&gt;opensolaris   yes    no        -              33.92M&lt;br /&gt;&lt;br /&gt;First, mount the clone under the /mnt directory&lt;br /&gt;&lt;br /&gt;$ pfexec mount -F zfs rpool/ROOT/opensolaris-1 /mnt&lt;br /&gt;&lt;br /&gt;Next, update the GRUB configuration on your ZFS boot device(s) using&lt;br /&gt;&lt;br /&gt;$ pfexec /mnt/boot/solaris/bin/update_grub -R /mnt&lt;br /&gt;&lt;br /&gt;When you're ready to boot into the updated boot environment, you can&lt;br /&gt;reboot(1M) or init(1M) as usual.&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Did that and finally I was able to boot using the new Boot Environment.  Cool!&lt;br /&gt;I've had to spend some time studying this... uhm... well I'll add it to the list of&lt;br /&gt;things to check out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-255972074852459234?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/255972074852459234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=255972074852459234' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/255972074852459234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/255972074852459234'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/06/opensolaris-upgrade-boot-environment.html' title='OpenSolaris upgrade &amp; Boot Environment'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-6677981596621879993</id><published>2008-02-19T18:55:00.003+01:00</published><updated>2008-02-19T19:03:40.640+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='macosx'/><title type='text'>Macosx resize partition</title><content type='html'>A great feature of macosx 10.5 (leopard) that I discover only yesterday (just after having done damages!) is the ability to resize a hfs+ journaled partition on the fly. This means you don't have to boot from the install cd. All you need to do is open DiskUtility. Select the disk you want to modify, go to the Partition tab and simply adjust the partitions size. Awesome!&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I found out this features becouse my System volume was almost full but I had a lot of free space on my user volume (BTW: partitions are evil! Long live to ZFS).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the next time I'll have to modify the space allocation on my disk I'll just backup important data and let DiskUtility do the job.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-6677981596621879993?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/6677981596621879993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=6677981596621879993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/6677981596621879993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/6677981596621879993'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/macosx-resize-partition.html' title='Macosx resize partition'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-3285270132610974524</id><published>2008-02-15T17:44:00.003+01:00</published><updated>2008-02-15T18:10:12.621+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mercurial'/><title type='text'>Mercurial repository @ SourceForge</title><content type='html'>Today I set up 2 mercurial repositories on sourceforge.net for my project &lt;a href="http://jmmslib.sourceforge.net"&gt;jMmsLib&lt;/a&gt;.&lt;br /&gt;It's been quite easy... I basically followed &lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/MercurialOnSourceforge"&gt;this&lt;/a&gt; simple howto and all went straight once I solved one little problem.&lt;br /&gt;&lt;br /&gt;Thought the howto state that you have to put you hg distribution inside your project directory, I decided to put it in my user home directory and make a symbolic link in the project home. So at the moment of trying the cgi page I get a python error. It was telling me that it couldn't find a module that was inside the hg distribution.&lt;br /&gt;At first I thought I had messed up the path in the cgi script, so I checked, but all seemed right to me. So I tried to set the path to the hg distribution in the mutt prject home. This time it worked.&lt;br /&gt;&lt;br /&gt;Mmm... So thinking the problem was in my hg distribution (maybe a corrupted one!) I substitute it with the one from mutt (always putting it in my user home directory). But still it didn't work...&lt;br /&gt;To make a long story short, the problem was apache (or at least I think it was apache) refuses to include a python module outside the file system portion devoted to projects. So I had to move the hg distribution from my user home to my project home and after all worked like a charm.&lt;br /&gt;&lt;br /&gt;Thinking about it now, it is a normal security policy. I wonder why I didn't thought it from the first moment. Besides that, I hope SF will support mercurial soon or later!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-3285270132610974524?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/3285270132610974524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=3285270132610974524' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/3285270132610974524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/3285270132610974524'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/mercurial-repository-sourceforge.html' title='Mercurial repository @ SourceForge'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-5380012266905437042</id><published>2008-02-12T11:39:00.000+01:00</published><updated>2008-12-10T23:03:46.578+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latex'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><title type='text'>Latex: lstlistings pseudo language</title><content type='html'>For my thesis I need to display a lot of algorithm to document the actions taken by peers talking a specific protocol. Since the thesis should present a theoretical view of the protocol itself and the algorithms, I do not want to display them in a specific language. I do want to use a pseudo language. Also I want the keyword of the language to be highlighted to ease the reading.&lt;br /&gt;&lt;br /&gt;Here's the definition of my pseudo language to be used with &lt;span style="font-style: italic;"&gt;lstlistings&lt;/span&gt; latex package:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;\lstdefinelanguage{pseudo}{&lt;br /&gt;morekeywords={if, else, for, in, remove, from, case, do, forever, to, False, True},&lt;br /&gt;sensitive=true,%&lt;br /&gt;  morecomment=[l]\#,%&lt;br /&gt;  morestring=[b]',%&lt;br /&gt;}&lt;br /&gt;\lstset{language=pseudo}&lt;br /&gt;\lstset{commentstyle=\textit}&lt;br /&gt;\lstset{literate=&lt;br /&gt; {&lt;=} {$\le$}{2}     {!=} {$\neq$}{2} {=}  {$\leftarrow$}{2}     {==} {=}{2}     {&amp;amp;&amp;amp;} {$\cap$}{2}     {||} {$\cup$}{2} }&lt;/blockquote&gt;&lt;br /&gt;This is an example of what your listing will look like:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_YO5nL-LqUq4/R7F9gdjzSJI/AAAAAAAAAGo/B74KVsJYaRQ/s1600-h/pseudoListing.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_YO5nL-LqUq4/R7F9gdjzSJI/AAAAAAAAAGo/B74KVsJYaRQ/s320/pseudoListing.png" alt="" id="BLOGGER_PHOTO_ID_5166048244214745234" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-5380012266905437042?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/5380012266905437042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=5380012266905437042' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/5380012266905437042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/5380012266905437042'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/latex-lstlistings-pseudo-language.html' title='Latex: lstlistings pseudo language'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_YO5nL-LqUq4/R7F9gdjzSJI/AAAAAAAAAGo/B74KVsJYaRQ/s72-c/pseudoListing.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-8011589939551024263</id><published>2008-02-11T17:50:00.000+01:00</published><updated>2008-02-11T18:11:37.576+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><title type='text'>Gmail IMAP backup</title><content type='html'>Today I decided to try out Gmail IMAP. Untill today I downloaded mail via POP from gmail and keep them in my home IMAP server. This way I was able to use thunderbird and have my mail synched on all my computers. Now that gmail offer an integrated imap server I decided to switch to that so I'll able to use also gmail web interface and have all synched (before I used to use OverLook that's quite useful, but really slow... at least on my small home server).&lt;br /&gt;&lt;br /&gt;In the end now all my mail reside on gmail and I have no local copy (except for thunderbird local file...). I want to keep a local copy of the gmail account to be able to recover from loss of data by google. Also I want it to be synched daily.&lt;br /&gt;&lt;br /&gt;Well, the first solution I thought is imapsync.&lt;br /&gt;Here's how to backup a gmail account with it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;blockquote&gt;imapsync --host1 imap.gmail.com --ssl1 --user1 user@gmail.com \&lt;br /&gt;--password1 gmailPass --host2 local --user2 user@local \&lt;br /&gt;--password2 localPass --prefix2 INBOX.gmail-backup. \&lt;br /&gt;--authuser1 user@gmail.com --authmech1 LOGIN \&lt;br /&gt;--authmech2 LOGIN --syncinternaldates&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;div style="text-align: left;"&gt;A more secure way is to put the passwords in 2 file and use --passfile1 and --passfile2.&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-8011589939551024263?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/8011589939551024263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=8011589939551024263' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/8011589939551024263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/8011589939551024263'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/gmail-imap-backup.html' title='Gmail IMAP backup'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-6903776533775467738</id><published>2008-02-11T11:46:00.000+01:00</published><updated>2008-02-11T12:16:14.394+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latex'/><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><title type='text'>Latex: listings side by side</title><content type='html'>Here's how to display two listings side by side in a figure using the subfig and lstlistings packages.&lt;br /&gt;&lt;br /&gt;First, put the code you want to display in 2 files (say a and b). Then do the following:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;\begin{figure}&lt;br /&gt;\subfloat[subcaption 1]{\lstinputlisting{a}}&lt;br /&gt;\hspace{20pt}&lt;br /&gt;\subfloat[subcaption 2]{\lstinputlisting{b}}&lt;br /&gt;\caption{Global caption}&lt;br /&gt;\end{figure}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This way you obtain the listing side by side. The only issue is that their vertical align is centered. So if the height of the two listings is not the same, the short one is not vertically aligned to the long one.&lt;br /&gt;&lt;br /&gt;One way to solve this issue is to use \raisebox{xxpt}{\subfloat[...]{...}} where xx is how much points you want to raise the listing. Anyway I found the result not good enough.&lt;br /&gt;&lt;br /&gt;Googling a little bit I found something on the faq section of subfig'sdocumentation. Here it is:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;6.1 "My sub-floats are not aligned along their bottoms. Why?"&lt;br /&gt;Remember! The subfig package aligns sub-floats along their baselines with the sub- caption (if any) sticking out above or below. The above problem is usually due to using a minipage, tabular or array environment that, by default, places the baseline at the center of the box that it generates. If the two sub-floats are different sizes, or if onesub-float is generated in some other way with its baseline not at the expected place (perhaps an \includegraphics), then the sub-float will be misaligned. One solution is to use the environment options `[t]' or `[b]' to move the baseline to the top or bottom rather than the center.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;I tried (not that hard to be honest), but I wasn't able to align both figure to the top. After all I think I'll keep the center valign...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-6903776533775467738?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/6903776533775467738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=6903776533775467738' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/6903776533775467738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/6903776533775467738'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/latex-listings-side-by-side.html' title='Latex: listings side by side'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-1510170769722228256</id><published>2008-02-07T14:33:00.000+01:00</published><updated>2008-02-07T15:03:43.012+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='howto'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>CVS to Mercurial</title><content type='html'>This week I finally tried out Mercurial.&lt;br /&gt;Having used only CVS before, I found this VCS simply amazing.&lt;br /&gt;It's really simple to use and also to learn. Useless to say I decided&lt;br /&gt;to move all my projects from CVS to mercurial.&lt;br /&gt;&lt;br /&gt;After searching a while on the net I found some alternatives:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Mercurial &lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/ConvertExtension"&gt;ConvertExtension&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://progetti.arstecnica.it/tailor"&gt;Tailor&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.selenic.com/mercurial/wiki/index.cgi/fromcvs"&gt;fromcvs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://hg.beekhof.net/hg/cvs-import"&gt;hg-cvs-import&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; Mercurial ConvertExtension is shipped with mercurial 0.95 so I decided to&lt;br /&gt;use this but probably Tailor is the most flexible of all. Surely it deserve&lt;br /&gt;a try.&lt;br /&gt;&lt;br /&gt;Anyhow, the documentation on the ConvertExtension wiki page is just non&lt;br /&gt;existent and the online help of mercurial does not helped me a lot.&lt;br /&gt;&lt;br /&gt;So here's how to convert a CVS module:&lt;br /&gt;&lt;br /&gt;First of all checkout the module you want to convert as usual.&lt;br /&gt;Let's say myproject is the checked out module, then do the following in&lt;br /&gt;the directory containing the module:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;$ hg convert myproject/&lt;br /&gt;assuming destination myproject-hg&lt;br /&gt;initializing destination myproject-hg repository&lt;br /&gt;connecting to :ext:user@cvs.example.com:/cvsroot&lt;br /&gt;scanning source...&lt;br /&gt;sorting...&lt;br /&gt;converting...&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now mercurial convert CVS commits to changesets and in the end it creates&lt;br /&gt;a .hgtags file containing the mapping between CVS releases and mercurial&lt;br /&gt;changesets.&lt;br /&gt;&lt;br /&gt;Here it is. Now your module is ready to be used with mercurial. Just to see&lt;br /&gt;if all is ok:&lt;br /&gt;&lt;blockquote&gt;$ cd myproject-hg&lt;br /&gt;$ hg log&lt;br /&gt;&lt;/blockquote&gt;And you should see all you CVS history.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-1510170769722228256?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/1510170769722228256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=1510170769722228256' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/1510170769722228256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/1510170769722228256'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/cvs-to-mercurial.html' title='CVS to Mercurial'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-9048686761419915713</id><published>2008-02-05T14:05:00.000+01:00</published><updated>2008-02-05T14:57:31.368+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Send MMS</title><content type='html'>Some months ago I've had to write a simple software for sending MMS. Before that moment, my knowledge of MMS or WAP was very limited. Indeed my mobile phone do not even supports MMS... (or color to be honest).&lt;br /&gt;&lt;br /&gt;So I've start to  search the internet for some documentation regarding MMS and how to send them through a GPRS connection. Unfortunately there's not so much documentation on these matters. In the end I figured out that I could use &lt;a href="http://jwap.sf.net/"&gt;jWAP&lt;/a&gt; to send the binary MMS message to the MMSC of the provider. The last problem was how to build a binary MMS. The only Java library  I found capable of encoding a binary MMS was "MMS Java Library" from Nokia. The first problem with this libarry was the download (for some reason, it's not downloadable from the Nokia web site anymore and I had to search for it a lot to find a copy). The second problem was the license that wasn't so clear (the only thing I found it's a &lt;a href="http://discussion.forum.nokia.com/forum/showthread.php?t=14758"&gt;post&lt;/a&gt; on the Nokia forum where it's said you cand modify if freely).&lt;br /&gt;&lt;br /&gt;So after all I decided it was a better idea to write a simple library to encode MMS messages. Fortunately the specification avaiable at &lt;a href="http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html"&gt;Open Mobile Alliance&lt;/a&gt; are quite detailed. The only problematic thing is to find the informations you need in all those pdf files.&lt;br /&gt;&lt;br /&gt;In the end the results of this work are avaiable &lt;a href="http://jmmslib.sf.net/"&gt;here&lt;/a&gt;. You'll find the library for encoding and decoding MMS and a simple client to send them trough a WAP gateway. At the moment the library is quite simple, it supports encoding of &lt;span style="font-style: italic;"&gt;send_req&lt;/span&gt; messages and decoding of &lt;span style="font-style: italic;"&gt;send_conf&lt;/span&gt; ones only. Also it does supports only image and text parts. In the future it's possible that new features will be added.&lt;br /&gt;&lt;br /&gt;Anyway if someone is searching information on how to send MMS take a look at the sources of &lt;a href="http://jmmslib.sourceforge.net/sendMMS.html"&gt;SendMMS&lt;/a&gt; (a total of 3 classes with one being an Exception and one a container).&lt;br /&gt;If you want details on how to encode a MMS message take a look at the sources of &lt;a href="http://jmmslib.sourceforge.net/index.html"&gt;jMmsLib&lt;/a&gt;, they  are quite simple to read and understand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-9048686761419915713?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/9048686761419915713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=9048686761419915713' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/9048686761419915713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/9048686761419915713'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2008/02/send-mms.html' title='Send MMS'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-113140717431218265</id><published>2005-11-08T00:35:00.000+01:00</published><updated>2005-11-08T00:56:47.053+01:00</updated><title type='text'>String &lt;-&gt; InputStream</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;In questi giorni mi sono concentrato sugli Stream, ma ho ancora qualche difficoltà a gestirli efficientemente. In particolare qualora questi non supportano il reset.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Cercando un po' di informazioni in internet mi sono trovato davanti a del codice che implementa una cosa che non ero mai riuscito a fare in modo efficiente (se non utilizzando classi deprecate).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Conversione da InputStream a String:&lt;/span&gt;&lt;/span&gt;&lt;blockquote  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;&lt;span style="font-family: verdana;"&gt;  &lt;span style="font-size:130%;"&gt;&lt;span style="font-family: courier new;"&gt;public String parseISToString(java.io.InputStream is){&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   java.io.DataInputStream din = new java.io.DataInputStream(is);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   StringBuffer sb = new StringBuffer();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   try{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     String line = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     while((line=din.readLine()) != null){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;       sb.append(line+"\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   }catch(Exception ex){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     ex.getMessage();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   }finally{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     try{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;       is.close();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     }catch(Exception ex){}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   return sb.toString();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Conversione da String ad InputStream:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;  &lt;span style="font-size:130%;"&gt;&lt;span style="font-family: courier new;"&gt;public java.io.InputStream parseStringToIS(String str){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   if(str==null) return null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   str = str.trim();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   java.io.InputStream in = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   try{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;     in = new java.io.ByteArrayInputStream(str.getBytes("UTF-8"));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   }catch(Exception ex){}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;   return in;      &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Commenti sulla qualità di queste due funzioni? Alternative migliori?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-113140717431218265?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/113140717431218265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=113140717431218265' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113140717431218265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113140717431218265'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/11/string-inputstream.html' title='String &lt;-&gt; InputStream'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-113089455457555966</id><published>2005-11-02T01:22:00.000+01:00</published><updated>2005-11-02T02:50:11.886+01:00</updated><title type='text'>Primi test su IBM Java 1.5 Beta</title><content type='html'>Alla fine sono riuscito a ottenere e testare la beta del jdk di IBM.&lt;br /&gt;Il primo test è semplicemente l'avvio di Eclipse, abbastanza grosso per verificare che in effetti tutto funzioni a dovere.&lt;br /&gt;&lt;br /&gt;La nota positiva è che in effetti tutto parte e funziona correttamente, quella negativa invece sono i tempi:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;Avvio di Eclipse (Java5): 55 secondi&lt;/li&gt;   &lt;li&gt;Avvio di Eclipse (Java1.4): 45 secondi&lt;/li&gt;   &lt;li&gt;Avvio SWTHelloWorld da Eclipse (Java5): 7 secondi&lt;br /&gt; &lt;/li&gt;   &lt;li&gt;Avvio SWTHelloWorld da Eclipse (Java1.4): 4 secondi&lt;/li&gt;   &lt;li&gt;Avvio SwingHelloWorld da Eclipse (Java 5): 7 secondi&lt;br /&gt; &lt;/li&gt;   &lt;li&gt;Avvio SwingHelloWorld da Eclipse (Java1.4): 6 secondi&lt;/li&gt; &lt;/ul&gt; Ho poi effettuato una serie di test (array sort, test numeri primi, divisioni floating point). I tempi sono espressi in millisecondi:&lt;br /&gt;&lt;br /&gt;IBM Java5:&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;Array sort: 5551&lt;/li&gt;   &lt;li&gt;Test numeri primi: 25086&lt;/li&gt;   &lt;li&gt;Divisioni floating point: 14063&lt;/li&gt; &lt;/ul&gt;&lt;br /&gt;IBM Java1.4&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;Array sort: 4279&lt;/li&gt;   &lt;li&gt;Test numeri primi: 1049&lt;/li&gt;   &lt;li&gt;Divisioni floating point: 458&lt;/li&gt; &lt;/ul&gt; Il codice utilizzato per questi test è lo stesso utilizzato in &lt;a href="http://arys.sytes.net/awiki/SomeDocs/GcjIntroduction"&gt;Introduzione a Gcj&lt;/a&gt; nella sezione Conclusioni.&lt;br /&gt;&lt;br /&gt;In conclusione un paio di note positive: in questa vesione di Java, IBM ha incluso anche un plugin per mozilla e Java Web Start. Ho effettuato qualche semplice test su entrambi:&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;2 chat basate su java per il plugin per mozilla&lt;/li&gt;   &lt;li&gt;&lt;a href="http://www.javazoom.net/jlgui/sources.html"&gt;jlGui&lt;/a&gt; web start installer&lt;br /&gt;  &lt;/li&gt; &lt;/ul&gt; Speriamo che per il rilascio finale IBM risolva i problemi di velocità e fornisca a tutti i possessori di architetture PowerPC una Java5 degna di questo nome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-113089455457555966?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/113089455457555966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=113089455457555966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113089455457555966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113089455457555966'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/11/primi-test-su-ibm-java-15-beta.html' title='Primi test su IBM Java 1.5 Beta'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-113085486679406462</id><published>2005-11-01T15:07:00.001+01:00</published><updated>2005-11-01T15:23:25.640+01:00</updated><title type='text'>IBM Java 1.5 Beta</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;IBM ha rilasciato (abbastanza silenziosamente a dire il vero) la &lt;a href="http://www-128.ibm.com/developerworks/java/jdk/java5beta/"&gt;beta della sua implementazione di Java 5&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Al momento non sono ancora riuscito a provarla, dopo la richiesta di download  mi viene detto:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family:verdana;"&gt;This product is subject to strict US export control laws. Prior to providing access, we must validate whether you are eligible to receive it under an available US export authorization.&lt;/span&gt;&lt;br /&gt;  &lt;b style="font-family: verdana;"&gt;Your request is being reviewed.&lt;/b&gt;&lt;br /&gt;  &lt;span style="font-family:verdana;"&gt; Upon completion of this review, you will be contacted if we are able to give access.  We apologize for any inconvenience.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:verdana;"&gt;      &lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;La cosa veramente positiva di questo annuncio è che finalmente i possessori di PPC hanno a disposizione una implementazione di Java 1.5 con tanto di plugin per mozilla.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Appena riuscirò a provarla, pubblicherò qualche benchmark.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-113085486679406462?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/113085486679406462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=113085486679406462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113085486679406462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113085486679406462'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/11/ibm-java-15-beta_01.html' title='IBM Java 1.5 Beta'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-113015678865196547</id><published>2005-10-24T14:09:00.000+02:00</published><updated>2005-10-24T14:26:28.656+02:00</updated><title type='text'>Articolo sullo stato di gcj</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: verdana;"&gt;Tom Tromey ha scritto per Red Hat Magazine "&lt;a href="http://www.redhat.com/magazine/012oct05/features/java/"&gt;The state of Java on Linux&lt;/a&gt;": un interessante articolo sullo stato di gcj che fa il punto sulle cose funzionanti e su quelle da implementare.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-113015678865196547?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/113015678865196547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=113015678865196547' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113015678865196547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/113015678865196547'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/articolo-sullo-stato-di-gcj.html' title='Articolo sullo stato di gcj'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112967131272293521</id><published>2005-10-18T23:30:00.000+02:00</published><updated>2005-10-18T23:35:12.726+02:00</updated><title type='text'>Introduzione a Gcj</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: verdana;"&gt;Preso da una smania di condividere quello che ho appreso in questi giorni di test con gcj e per fare in modo che anche altri si avvicinino a questa piattaforma ho scritto una breve introduzione (sentra troppo pretese) a gcj/gij.&lt;br /&gt;&lt;br /&gt;Potete trovare l'articolo &lt;a href="http://arys.sytes.net/awiki/SomeDocs/GcjIntroduction"&gt;qui&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Se nel leggere trovate errori (...ma anche orrori...) fatemelo sapere e provvederò a correggere.&lt;br /&gt;&lt;br /&gt;Prossimamente scriverò anche un breve howto sulla compilazione di applicazione basate sulle SWT con gcj.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112967131272293521?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112967131272293521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112967131272293521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112967131272293521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112967131272293521'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/introduzione-gcj.html' title='Introduzione a Gcj'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112923682614847010</id><published>2005-10-13T22:39:00.000+02:00</published><updated>2005-10-13T22:53:46.156+02:00</updated><title type='text'>GNU Classpathx</title><content type='html'>&lt;span style="font-family: verdana;font-size:85%;" &gt;GNU Classpathx è un progetto che mira ad un implementazione libera delle librerie aggiuntive della Sun. Al momento la lista contiene:&lt;/span&gt;   &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul style="font-family: verdana;"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="activation" href="http://www.gnu.org/software/classpathx/jaf/jaf.html"&gt;JavaBeans™ Activation Framework&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;JavaBean infobus&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="infobus"&gt;&lt;/a&gt;Java cryptography (diventato GNU Crypto)&lt;a name="mail" href="http://www.gnu.org/software/classpathx/javamail/javamail.html"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="mail" href="http://www.gnu.org/software/classpathx/javamail/javamail.html"&gt;JavaMail&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="mail" href="http://www.gnu.org/software/classpathx/javamail/javamail.html"&gt;&lt;/a&gt;&lt;a href="http://www.gnu.org/software/classpathx/jaxp/jaxp.html"&gt;JAXP&lt;/a&gt; (Java API per la manipolazione di XML)&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="jaxp" href="http://www.gnu.org/software/classpathx/jaxp/jaxp.html"&gt;&lt;/a&gt;net extensions&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="net"&gt;&lt;/a&gt;servlet API&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;&lt;span style="font-family: verdana;"&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: verdana;"&gt;In particolare l'implementazione di JavaMail è compatibile con le specifiche 1.3 (al momento in cui scrivo la versione disponibile sul sito della sun è 1.3.3) e dispone di provider per i protocolli: smtp, imap, pop3, nntp, mbox, maildir.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112923682614847010?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112923682614847010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112923682614847010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112923682614847010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112923682614847010'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/gnu-classpathx.html' title='GNU Classpathx'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112923550592440293</id><published>2005-10-13T21:59:00.000+02:00</published><updated>2005-10-13T22:32:42.890+02:00</updated><title type='text'>In the end...</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Dopo alcuni giorni di prove finalmente ieri sono riuscito a risolvere il problema del linking a swt. Devo ringraziare Tom Tromey di Red Hat e sviluppatore di gcj per avermi assistito.&lt;br /&gt;&lt;br /&gt;Gli "undefined reference" erano causati dal fatto che non compilavo il .jar, ma lo includevo solo nel classpath. In particolare il primo "undefined reference" riferito a Test::Class era causato dal fatto che l'opzione --main di gcj deve contenere l'intero percorso della classe(test.swt.Test).&lt;br /&gt;&lt;br /&gt;Il passo successivo è stato quindi di procedere alla compilazione come segue:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;nivox@host:~/Test/$gcj --main=test.swt.Test --classpath $SWT_HOME/swt.jar test/swt/Test.java $SWT_HOME/swt.jar -lswt-gtk-3138&lt;br /&gt;org/eclipse/swt/graphics/ImageLoader.java: In class 'org.eclipse.swt.graphics.ImageLoader':&lt;br /&gt;org/eclipse/swt/graphics/ImageLoader.java: In method 'org.eclipse.swt.graphics.ImageLoader.load(java.lang.String)':&lt;br /&gt;org/eclipse/swt/graphics/ImageLoader.java:149: error: verification error at PC=40&lt;br /&gt;org/eclipse/swt/graphics/ImageLoader.java:149: error: label part of different subroutines&lt;/blockquote&gt;&lt;br /&gt;Questo altro problema è invece meno banale del primo: è causato dal fatto che alcune applicazioni utilizzano del codice loro per leggere stream di bytecode e caricarli come classi utilizzando ClassLoader.defineClass().&lt;br /&gt;Una spiegazione dettagliata del problema è della sua soluzione si trova sul wiki di gcc: &lt;a href="http://gcc.gnu.org/wiki/How%20to%20BC%20compile%20with%20GCJ"&gt;How to BC compile with GCJ&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Per farla breve è necessario utilizzare i flag -findirect-dispath e -fjni (poichè le swt utilizzano la Java Native Interface per accedere a librerie native):&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;blockquote&gt;nivox@host:~/Test/$gcj -fjni -findirect-dispatch --main=test.swt.Test --classpath $SWT_HOME/swt.jar test/swt/Test.java $SWT_HOME/swt.jar -lswt-gtk-3138&lt;br /&gt;nivox@host:~/Test/$ls&lt;br /&gt;test a.out&lt;/blockquote&gt;&lt;br /&gt;Insomma in conclusione la compilazione di un applicazione basata sulle SWT tramite gcj non è stata così semplice come predicato dai vari articoli che si trovano su internet.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112923550592440293?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112923550592440293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112923550592440293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112923550592440293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112923550592440293'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/in-end.html' title='In the end...'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112906196901737883</id><published>2005-10-11T22:05:00.001+02:00</published><updated>2005-10-11T22:19:29.020+02:00</updated><title type='text'>Un passo alla volta...</title><content type='html'>&lt;span style="font-family: verdana;font-size:85%;" &gt;Dopo un iniziale sconforto per non riuscire a risolvere il problema riguardo alla compilazione nativa con gcj preso da una smania di free-java ho provato a cambiare momentaneamente rotta tentando la strada di gij.&lt;br /&gt;&lt;br /&gt;Gij è l'interprete java che va a braccetto con gcj. Infatti il compilatore permette si di compilare in codice macchina (comportamente di default) ma prevede anche la possibilità di compilare in bytecode che verrà poi interpreta da gij appunto.&lt;br /&gt;&lt;br /&gt;Con mia grande soddisfazione con gij sono riuscito a far funzionare la mia demo in swt, ma la cosa che mi ha lasciato davvero a bocca aperta è stato il fatto che, senza fare assolutamente nulla, eclipse è partito al primo colpo.&lt;br /&gt;&lt;br /&gt;Non tutto funziona ovviamente (Swing/AWT) ma la maggior parte delle cose sembrano funzionare egregiamente anche se ho l'impressione che sia un po' più lento&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: verdana;"&gt;Qesta scoperta mi ha sollevato di molto il morale! Adesso non mi resta che riuscire a compilare nativamente. Una volta che sarò riuscito a far funzionare tutto come dovrebbe e mi sarò studiato un po' più a fondo gcj penso che scriverò un qualche tutorial/howto per aiutare quelli che come me si vogliono affacciare ad un uso libero di java.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112906196901737883?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112906196901737883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112906196901737883' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112906196901737883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112906196901737883'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/un-passo-alla-volta_11.html' title='Un passo alla volta...'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112889380755947646</id><published>2005-10-09T23:05:00.001+02:00</published><updated>2005-10-13T22:33:08.743+02:00</updated><title type='text'>Java... goes free</title><content type='html'>&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;In questi giorni ho guardato con maggiore attenzione gcj. Dopo essermi documentato un po' e aver focalizzato i pregi maggiori (risparmio di memoria, amento in velocità, è free-software!) nonchè i difetti più visibili (Non tutte le classi di J2SE sono implementate: in particolare c'è uno scarso supporto per AWT e SWING) mi sono messo a giocarci un po'.&lt;br /&gt;&lt;br /&gt;Un primo test di compilazione nativa su un programmino abbastanza stupido (connessioni http ed un minimo di parsing) ha dato esito positivo senza apparenti problemi. Galvanizzato da questo successo ho subito provato con qualcosa di più complesso: un HelloWorld grafico utilizzando le SWT.&lt;br /&gt;&lt;br /&gt;Qui le cose non sono andate altrettanto bene, infatti mi sono bloccato alla fase di compilazione:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;nivox@host:~/Test/$gcj --classpath $SWT_HOME/swt.jar -c test/swt/Test.java&lt;br /&gt;&lt;br /&gt;nivox@host:~/Test/$ ls&lt;br /&gt;test  Test.o&lt;br /&gt;&lt;br /&gt;nivox@host:~/Test/$gcj --main=Test -lswt-gtk-3138&lt;br /&gt;ccDiLjH7.i:(.text+0x2e): undefined reference to `Test::class$'&lt;br /&gt;ccDiLjH7.i:(.text+0x32): undefined reference to `Test::class$'&lt;br /&gt;Test.o: In function `test::swt::Test::main(JArray&lt;java::lang::string&gt;*)':&lt;br /&gt;Test.java:(.text+0x2e): undefined reference to `org::eclipse::swt::widgets::Display::class$'&lt;br /&gt;Test.java:(.text+0x32): undefined reference to `org::eclipse::swt::widgets::Display::class$'&lt;br /&gt;Test.java:(.text+0x44): undefined reference to `org::eclipse::swt::widgets::Display::Display()'&lt;br /&gt;Test.java:(.text+0x52): undefined reference to `org::eclipse::swt::widgets::Shell::class$'&lt;br /&gt;Test.java:(.text+0x56): undefined reference to `org::eclipse::swt::widgets::Shell::class$'&lt;br /&gt;Test.java:(.text+0x70): undefined reference to `org::eclipse::swt::widgets::Shell::Shell(org::eclipse::swt::widgets::Display*)'&lt;br /&gt;...&lt;/java::lang::string&gt;&lt;/blockquote&gt;&lt;br /&gt;Tutto ciò è molto frustrante... stò sbagliando qualcosa, ma non capisco cosa... e purtroppo anche google non mi è stato d'aiuto. Nei prossimi giorni vedrò di andare a fondo in questa faccienda.&lt;br /&gt;&lt;br /&gt;Sono rimasto impressionato dalle potenzialità di GNU gcj e di altri progetti come GNU Classpath e Kaffe. E molto fiducioso per &lt;a href="http://mail-archives.apache.org/mod_mbox/incubator-general/200505.mbox/%3CCA4BEB82-3D84-457D-9531-1477DD749919@apache.org%3E"&gt;Apache Harmony&lt;/a&gt;: un progetto non ancora ufficiale della Apache Foundation (E' stato proposto a Maggio) che mira ad una implementazione libera di J2SE concentrando gli sforzi dei tre porgetti di cui sopra. &lt;a href="http://www.mackmo.com/apacheharmony/default/"&gt;Qui&lt;/a&gt; il blog non ufficiale del progetto: l'ultimo post è di Giugno... ma spero di avere presto buone nuove da parte di questo promettente progetto.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112889380755947646?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112889380755947646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112889380755947646' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112889380755947646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112889380755947646'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/java-goes-free_09.html' title='Java... goes free'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-17614970.post-112879469825270899</id><published>2005-10-08T19:04:00.000+02:00</published><updated>2005-10-08T20:04:58.266+02:00</updated><title type='text'>JavaMail API</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Platform/Protocol-independent framework per integrare all'interno di un'applicazione la gestione della posta elettronica. E' molto semplice aggiungere protocolli alla dotazione di default (imap, imaps, pop3, pop3s, smtp), si tratta fondamentalmente di estendere 3 classi: Store/Transport, Folder, Message.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;Il pacchetto fa parte di Java2EnterpriseEdition ma è scaricabile come pacchetto stand-alone da qui: &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://java.sun.com/javamail"&gt;http://java.sun.com/javamail&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mokabyte.it/"&gt;Mokabyte.it&lt;/a&gt; ha realizzato una serie di articoli illustrativi sulle funzioni  delle API:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt; &lt;ul&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.mokabyte.it/2003/11/javamail-1.htm"&gt;JavaMail Parte I&lt;/a&gt;:     gestire la posta elettronica in Java.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.mokabyte.it/2003/12/javamail-2.htm"&gt;JavaMail Parte II&lt;/a&gt;:   eventi e messaggi multipart.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.mokabyte.it/2004/01/javamail-3.htm"&gt;JavaMail Parte III&lt;/a&gt;: eventi e messaggi multipart.&lt;br /&gt;   &lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://www.mokabyte.it/2004/02/javamail-4.htm"&gt;JavaMail ParteIV&lt;/a&gt;:   approfondimento sulla gestione dei messagi.&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/17614970-112879469825270899?l=nivox.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nivox.blogspot.com/feeds/112879469825270899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=17614970&amp;postID=112879469825270899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112879469825270899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/17614970/posts/default/112879469825270899'/><link rel='alternate' type='text/html' href='http://nivox.blogspot.com/2005/10/javamail-api.html' title='JavaMail API'/><author><name>Andrea Zito (nivox)</name><uri>http://www.blogger.com/profile/14439131286540656135</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
