<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>waelchatila.com - java tag</title>
  <link>http://waelchatila.com:80/tags/java/</link>
  <description>Notes on Software, Engineering and Science</description>
  <language>en</language>
  <copyright>Wael Chatila</copyright>
  <lastBuildDate>Thu, 11 Mar 2010 03:23:48 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Turn your roomba into a walking google bot </title>
    <link>http://waelchatila.com:80/2010/03/01/1267514760000.html</link>
    
      
        <description>
          When my latest son was born I got a little worried since he didn&#039;t look at all like me. I decided I needed a discrete device to spy on my wife while I was at work. I started hacking my roomba and made a  &lt;b&gt;G&amp;#229;&amp;#229;gleBot&lt;/b&gt; (pronounced &lt;i&gt;/google-bot/&lt;/i&gt;). G&amp;#229;&amp;#229;gleBot is a &#034;home crawler&#034; consisting of a vacuum roomba with an on board webserver and camera.
        While the vacuum goes about its business, it extracts text from the images it takes.
        The text is later put in a database on the roomba and searchable through a web interface. This was a good pretext for my wife. I, of course, also added the ability to remote control the roomba using AJAX...for spying purposes...hehe.

&lt;br/&gt;
&lt;a href=&#034;http://www.gaaglebot.com&#034;&gt;&lt;img src=&#034;http://www.gaaglebot.com/building/r2.jpg&#034; alt=&#034;GaagleBot&#034;/&gt;&lt;/a&gt;
&lt;br/&gt;
I created a dedicated site for the little fellow for fun with showcase app. &lt;a href=&#034;http://www.gaaglebot.com&#034;&gt;http://www.GaagleBot.com&lt;/a&gt;
&lt;br/&gt;
&lt;br/&gt;
This is the next version of &lt;a href=&#034;http://waelchatila.com/2006/07/13/1152788433678.html&#034;&gt;My AJAX Lego Robot&lt;/a&gt;.
I&#039;m working on yet another version of my AJAX Remote Controlled thingies...stay tuned.
        </description>
      
      
    
    
    
    <category>AJAX</category>
    
    <category>Hardware</category>
    
    <category>Java</category>
    
    <category>Games &amp; Fun</category>
    
    <category>Web</category>
    
    <comments>http://waelchatila.com:80/2010/03/01/1267514760000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2010/03/01/1267514760000.html</guid>
    <pubDate>Tue, 02 Mar 2010 07:26:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Running Jetty as Non Root</title>
    <link>http://waelchatila.com:80/2009/01/20/1232522160000.html</link>
    
      
        <description>
          I&#039;m kicking the tires of Jetty and am in the process of setting it up on a production machine and found that the latest Jetty realeas (6.1.14) has a really easy way to start jetty out running as root and later switch to a uid of your choice which enables you to open up server sockets on the privileged ports 80 &amp; 443. See the README file under {jetty.root}/extras/setuid. The process is just a one-liner...well, there are some more perks as you&#039;ll see at the end.
&lt;p&gt;
The README seems little bit out of date as my
&lt;div class=&#034;codeSample&#034;&gt;mvn install&lt;/div&gt;
did all of the compiling and copying steps. However, when I try to launch jetty with the new jetty-setuid.xml config file I get the following error.

&lt;div class=&#034;codeSample&#034;&gt;
2009-01-20 23:10:33.887::WARN:  Config error at &amp;lt;Set name=&#034;uid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
2009-01-20 23:10:33.888::WARN:  EXCEPTION
java.lang.reflect.InvocationTargetException
   at java.lang.reflect.Constructor.newInstance(libgcj.so.81)
   at org.mortbay.xml.XmlConfiguration.set(XmlConfiguration.java:405)
   at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:248)
   at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:214)
   at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:974)
   at java.lang.reflect.Method.invoke(libgcj.so.81)
   at org.mortbay.start.Main.invokeMain(Main.java:194)
   at org.mortbay.start.Main.start(Main.java:523)
   at org.mortbay.start.Main.main(Main.java:119)
Caused by: java.lang.NumberFormatException: invalid character at position 1 in jetty
   at java.lang.Integer.parseInt(libgcj.so.81)
   at java.lang.Integer.&amp;lt;init&amp;gt;(libgcj.so.81)
   at java.lang.reflect.Constructor.newInstance(libgcj.so.81)
   ...8 more
&lt;/div&gt;
My jetty-setuid.xml file looks like:
&lt;div class=&#034;codeSample&#034;&gt;
&amp;lt;Configure id=&#034;Server&#034; class=&#034;org.mortbay.setuid.SetUIDServer&#034;&amp;gt;
  &amp;lt;Set name=&#034;startServerAsPrivileged&#034;&amp;gt;false&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;umask&#034;&amp;gt;2&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;uid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;gid&#034;&amp;gt;jetty&amp;lt;/Set&amp;gt;
&amp;lt;/Configure&amp;gt;
&lt;/div&gt;
For some reason its expecting an integer instead of &#034;jetty&#034;...well well
&lt;div class=&#034;codeSample&#034;&gt;
&amp;gt; su jetty
&amp;gt; id
uid=1002(jetty) gid=1003(jetty) groups=1003(jetty)
&lt;/div&gt;
My jetty-setuid.xml now looks like:
&lt;div class=&#034;codeSample&#034;&gt;
&amp;lt;Configure id=&#034;Server&#034; class=&#034;org.mortbay.setuid.SetUIDServer&#034;&amp;gt;
  &amp;lt;Set name=&#034;startServerAsPrivileged&#034;&amp;gt;false&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;umask&#034;&amp;gt;2&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;uid&#034;&amp;gt;1002&amp;lt;/Set&amp;gt;
  &amp;lt;Set name=&#034;gid&#034;&amp;gt;1003&amp;lt;/Set&amp;gt;
&amp;lt;/Configure&amp;gt;
&lt;/div&gt;
...works like a charm.
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <category>Java</category>
    
    <category>Web</category>
    
    <comments>http://waelchatila.com:80/2009/01/20/1232522160000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2009/01/20/1232522160000.html</guid>
    <pubDate>Wed, 21 Jan 2009 07:16:00 GMT</pubDate>
  </item>
  
  <item>
    <title>GreenMail v1.3 Released</title>
    <link>http://waelchatila.com:80/2007/12/19/1198107540000.html</link>
    
      
        <description>
          This release contains minor changes to GreenMail core, most notable the introduction of slf4j for logging.
&lt;p/&gt;
New in this release is a JBoss service for GreenMail.
The service runs GreenMail as a lightweight mail server sandbox, nicely suited for developers.
&lt;p/&gt;
Check out the project page &lt;a href=&#034;http://www.icegreen.com/greenmail&#034;&gt;http://www.icegreen.com/greenmail&lt;/a&gt;
for the latest documentation!
&lt;p/&gt;
Note about the released files (&lt;a href=&#034;http://sourceforge.net/project/showfiles.php?group_id=159695&amp;package_id=179329&amp;release_id=562874&#034;&gt;goto download page&lt;/a&gt;):
&lt;ul&gt;
&lt;li&gt;greenmail-1.3-bundle.jar : mvn upload bundle&lt;br&gt;
&lt;li&gt;greenmail-1.3.jar : contains all greenmail core classes&lt;br&gt;
&lt;li&gt;greenmail-1.3-src.zip : contains sources, javadoc, required libs, docs&lt;br&gt;
&lt;li&gt;greenmail-1.3.zip : like above, but no sources&lt;br&gt;
&lt;li&gt;greenmail-jboss-service-1.3.sar : deployable JBoss service archive&lt;br&gt;
&lt;/ul&gt;
&lt;p/&gt;
&lt;br&gt;
&lt;b&gt;Changes:&lt;/b&gt;&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;Added logging via slf4j, replacing System.out.println&lt;br&gt;
&lt;li&gt;Minor improvements:&lt;ul&gt;
  &lt;li&gt;c.i.g.AbstractServer exposes ServerSetup&lt;br&gt;
  &lt;li&gt;c.i.g.util.GreenMailUtil exposes sendTextEmail(...)&lt;br&gt;
&lt;/ul&gt;
&lt;li&gt;New JBoss service wrapper (see the &lt;a href=&#034;http://www.icegreen.com/greenmail&#034;&gt;project page&lt;/a&gt;)&lt;br&gt;
&lt;/ul&gt;
&lt;p/&gt;
&lt;b&gt;Credits:&lt;/b&gt;&lt;br&gt;
Marcel May added the JBoss service and contributed the logging changes. Thanks!&lt;br&gt;
&lt;p/&gt;
&lt;b&gt;Upcoming changes:&lt;/b&gt;&lt;br&gt;
For 1.4 we plan to replace the current Foedus smtp and pop implementation with &lt;a href=&#034;http://subetha.tigris.org&#034; rel=&#034;nofollow&#034;&gt;http://subetha.tigris.org&lt;/a&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://waelchatila.com:80/2007/12/19/1198107540000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/12/19/1198107540000.html</guid>
    <pubDate>Wed, 19 Dec 2007 23:39:00 GMT</pubDate>
  </item>
  
  <item>
    <title>RXTX on Gumstix</title>
    <link>http://waelchatila.com:80/2007/08/24/1187975400000.html</link>
    
      
        <description>
          &lt;p&gt;
Since it could be tricky to get the RXTX sources compiling properly for the gumstix platforms I thought I&#039;d spare anyone the pain by providing my binaries. 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#034;http://www.icegreen.com/rxtx_gumstix/librxtxSerial_PXA255.so&#034;&gt;librxtxSerial_PXA255.so &lt;/a&gt; (Connex / Basix)&lt;/li&gt;
&lt;li&gt;&lt;a href=&#034;http://www.icegreen.com/rxtx_gumstix/librxtxSerial_PXA270.so&#034;&gt;librxtxSerial_PXA270.so &lt;/a&gt; (Verdex)&lt;/li&gt;
&lt;/ul&gt;

However, since you&#039;re here, I would advise against using java on the gum. Sure, the programs themselves are a breeze to develop, but getting jam and classpath to compile and run properly can very well take a considerable amount of time. Just think of the reason why you are reading this. Chances are you probably have troubles getting the RXTX sources to compile or run smoothly. Just do yourself a favor, write it in small fast c/c++ or something.
        </description>
      
      
    
    
    
    <category>Unix/Linux</category>
    
    <comments>http://waelchatila.com:80/2007/08/24/1187975400000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/08/24/1187975400000.html</guid>
    <pubDate>Fri, 24 Aug 2007 17:10:00 GMT</pubDate>
  </item>
  
  <item>
    <title>Groovy vs BeanShell</title>
    <link>http://waelchatila.com:80/2007/05/09/1178775480000.html</link>
    
      
        <description>
          Below is a quick and dirty test to compare the speed performance between bean shell and groovy. Bean shell is an order of magnitude faster. If you don&#039;t need groovy closure and other nice groovy features...just use bean shell. It&#039;s only one small jar away.


&lt;div class=&#034;codeSample&#034;&gt;
public static void main(String[] args) throws EvalError {
        StringBuilder script = new StringBuilder();
        for (int i=0;i&lt;900;i++) {
            script.append(&#034;res&#034;);
            script.append(i);
            script.append(&#034;=&#034;);
            script.append(i+&#034;+&#034;+i+&#034;*&#034;+i);
            script.append(&#034;;\n&#034;);
        }
        GroovyShell groovyShell = new GroovyShell();
        Interpreter bsh = new Interpreter();

        long t = System.currentTimeMillis();
        groovyShell.evaluate(script.toString());
        System.out.println(System.currentTimeMillis() - t);

        t = System.currentTimeMillis();
        for (int i=0;i&lt;1000;i++) {
            int j = i+i*i;
        }
        System.out.println(System.currentTimeMillis() - t);

        t = System.currentTimeMillis();
        bsh.eval(script.toString());
        System.out.println(System.currentTimeMillis() - t);

    }
&lt;/div&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://waelchatila.com:80/2007/05/09/1178775480000.html#comments</comments>
    <guid isPermaLink="true">http://waelchatila.com:80/2007/05/09/1178775480000.html</guid>
    <pubDate>Thu, 10 May 2007 05:38:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>

