<?xml version="1.0"?>
<rss version="2.0"><channel><title>h3 weblog</title><link>http://www.postronic.org/h3/</link><description>garbage in, garbage out</description><language>en</language><image><title>h3 weblog</title><url>http://www.postronic.org/h3/images/feedlogo.gif</url><link>http://www.postronic.org/h3/</link><width>88</width><height>31</height><description>garbage in, garbage out</description></image><item><guid>http://www.postronic.org/h3/pid51.html</guid><title>Another GAE bug</title><link>http://www.postronic.org/h3/pid51.html</link><description>Today I played again with the Google App Engine (Java preview release) for a couple of hours and found another bug.&#xD;&#xD;Seems like the MemcacheService namespaces  are completely ignored in production.&#xD;&#xD;Bug 1364 already reported.&#xD;&#xD;The JCache API I used last week was just an higher-level interface built on top of the MemcacheService.&#xD;I found that using the low-level API directly is a better approach because it exposes some additional functionalities with no drawbacks.&#xD;Atomic-increment of cached entries for example is an extremely useful feature in a clustered environment.</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Today I played again with the Google App Engine (Java preview release) for a couple of hours and found another bug.<br/><br/>Seems like the MemcacheService namespaces  are completely ignored in production.<br/><br/>Bug <a href="http://code.google.com/p/googleappengine/issues/detail?id=1364">1364</a> already reported.<br/><br/>The JCache API I used last week was just an higher-level interface built on top of the MemcacheService.<br/>I found that using the low-level API directly is a better approach because it exposes some additional functionalities with no drawbacks.<br/>Atomic-increment of cached entries for example is an extremely useful feature in a clustered environment.]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2009-04-19T21:51:32+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><comments>http://www.postronic.org/h3/pid51.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid50.html</guid><title>Google App Engine bug</title><link>http://www.postronic.org/h3/pid50.html</link><description>In these days of holiday I've been playing with the Java version of the Google App Engine (yes I have been lucky to have access to the "early look" version).&#xD;In general I find it wonderful. I really like how the Eclipse plugin integrates with the App engine and GWT.&#xD;The included services are implemented using standard APIs whenever possible, but you are free to use the underlying technologies in a more low-level way if needed.&#xD;&#xD;My first idea has been to implement a sort of "comet" service for a GWT application, and I must admit: it's not easy because of the many limitations:&#xD;1) You can't create threads.&#xD;2) You can't use continuations.&#xD;3) All threads (generated from http requests) have a maximum lifetime of 30 seconds.&#xD;&#xD;Anyway finally I found a tricky way to implement a sort of slow-polling using the Memcache service, but.. &#xD;I found a bug: JCache entries' expiration time is not reset when entries are updated! I think this is quite a big issue.&#xD;&#xD;Bug report 1284 already submitted :)&#xD;</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[In these days of holiday I've been playing with the Java version of the Google App Engine (yes I have been lucky to have access to the "early look" version).<br/>In general I find it wonderful. I really like how the Eclipse plugin integrates with the App engine and GWT.<br/>The included services are implemented using standard APIs whenever possible, but you are free to use the underlying technologies in a more low-level way if needed.<br/><br/>My first idea has been to implement a sort of "comet" service for a GWT application, and I must admit: it's not easy because of the many limitations:<br/>1) You can't create threads.<br/>2) You can't use continuations.<br/>3) All threads (generated from http requests) have a maximum lifetime of 30 seconds.<br/><br/>Anyway finally I found a tricky way to implement a sort of slow-polling using the Memcache service, but.. <br/>I found a bug: JCache entries' expiration time is not reset when entries are updated! I think this is quite a big issue.<br/><br/>Bug report <a href="http://code.google.com/p/googleappengine/issues/detail?id=1284">1284</a> already submitted :)<br/>]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2009-04-13T20:42:32+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><comments>http://www.postronic.org/h3/pid50.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid49.html</guid><title>Knack released as Open Source</title><link>http://www.postronic.org/h3/pid49.html</link><description>It feels like opening the cage of your beloved pet and staring at him while he walks into the wild, finally free like wild animals.&#xD;It's a bit scary and you hope he is ready for this step, but you know that this is good for him, in the long run.&#xD;Knack has been my pet project for some years and starting from today it is Free Software. &#xD;&#xD;Please contribute!</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[It feels like opening the cage of your beloved pet and staring at him while he walks into the wild, finally free like wild animals.<br/>It's a bit scary and you hope he is ready for this step, but you know that this is good for him, in the long run.<br/><a href="http://knack.googlecode.com/svn/trunk/Site/index.html">Knack</a> has been my pet project for some years and starting from today it is <a href="http://en.wikipedia.org/wiki/Free_software">Free Software</a>. <br/><br/>Please <a href="http://code.google.com/p/knack/">contribute</a>!]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2008-11-08T21:55:02+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><comments>http://www.postronic.org/h3/pid49.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid48.html</guid><title>IM me from the web</title><link>http://www.postronic.org/h3/pid48.html</link><description>If you want to chat with me just click below :)&#xD;&#xD;</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[If you want to chat with me just click below :)<br/><br/><iframe src="http://www.google.com/talk/service/badge/Show?tk=z01q6amlq4oebr9cfk6lbsskvmenq9q8m0n720fhgh59m4eibu0hj0qfhj5li3d5vadrhbkipknrrchou4tcqiemgcuf4gopma3c00a84ve06hoac61tedac0kvicpiq0duavla1ppc44u3n2bog06iv93ln4bq8m1ro6uvfl&w=200&h=60" allowtransparency="true" width="200" frameborder="0" height="60"></iframe>]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2008-08-11T23:09:33+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><comments>http://www.postronic.org/h3/pid48.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid47.html</guid><title>I.T. Salaries</title><link>http://www.postronic.org/h3/pid47.html</link><description>Sadly, in Italy you must divide this by 2 or 3...</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Sadly, in Italy you must divide <a href="http://www.indeed.com/salary?q1=Senior+Java+developer&l1=&tm=1">this</a> by 2 or 3...]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2008-06-08T14:40:18+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><comments>http://www.postronic.org/h3/pid47.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid46.html</guid><title>My new remix</title><link>http://www.postronic.org/h3/pid46.html</link><description>You can listen it here in streaming:&#xD;&#xD;    Foals &#x96; Electric Bloom (h3-r3 remix)&#xD;&#xD;or downlad the MP3&#xD;&#xD;If you are a Last.fm user please scrobble it!!</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[You can listen it here in streaming:<br/><br/><object width="13" height="13" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" allowNetworking="internal"> <param name="allowScriptAccess" value="sameDomain" /><param name="FlashVars" value="resourceID=200291755&flp=true" /> <param name="movie" value="http://static.last.fm/webclient/inline/6/inlinePlayer.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed wmode="transparent" src="http://static.last.fm/webclient/inline/6/inlinePlayer.swf" quality="high" FlashVars="resourceID=200291755&flp=true" bgcolor="#ffffff" width="13" height="13" name="inlinePlayer" allowNetworking="internal" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> <a href="http://www.lastfm.it/music/Foals">Foals</a>  <a href="http://www.lastfm.it/music/Foals/_/Electric+Bloom+%28h3-r3+remix%29">Electric Bloom (h3-r3 remix)</a><br/><br/>or <a href="http://freedownloads.last.fm/download/200291755/Electric%2BBloom%2B%2528h3-r3%2Bremix%2529.mp3">downlad the MP3</a><br/><br/>If you are a <a href="http://last.fm">Last.fm</a> user please scrobble it!!]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2008-05-20T22:46:01+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><comments>http://www.postronic.org/h3/pid46.html#comments</comments></item><item><guid>http://www.postronic.org/h3/pid45.html</guid><title>J2ME rotozoomer</title><link>http://www.postronic.org/h3/pid45.html</link><description>Today I tried to code an oldschool demo effect for my mobile phone (a Nokia 3110 classic)...&#xD;I created a simple rotozomeer :)&#xD;&#xD;here is the code (J2ME MIDP 2.0)&#xD;&#xD;package org.postronic.h3.testmidlet;&#xD;&#xD;import javax.microedition.lcdui.Display;&#xD;import javax.microedition.midlet.MIDlet;&#xD;import javax.microedition.midlet.MIDletStateChangeException;&#xD;&#xD;public class RotozoomerMIDlet extends MIDlet {&#xD;&#xD;  public RotozoomerMIDlet() { }&#xD;&#xD;  protected void startApp() throws MIDletStateChangeException {&#xD;    RotozoomerCanvas canvas = new RotozoomerCanvas();&#xD;    Display display = Display.getDisplay(this);&#xD;    display.setCurrent(canvas);&#xD;    canvas.run();&#xD;  }&#xD;	&#xD;  protected void pauseApp() { }&#xD;	&#xD;  protected void destroyApp(boolean arg0) throws MIDletStateChangeException { }&#xD;&#xD;}&#xD;&#xD;&#xD;&#xD;package org.postronic.h3.testmidlet;&#xD;&#xD;import javax.microedition.lcdui.Graphics;&#xD;import javax.microedition.lcdui.Image;&#xD;import javax.microedition.lcdui.game.GameCanvas;&#xD;&#xD;public class RotozoomerCanvas extends GameCanvas {&#xD;&#xD;  protected RotozoomerCanvas() {&#xD;    super(true);&#xD;    setFullScreenMode(true);&#xD;  }&#xD;&#xD;  public void run() {&#xD;    int imgWidth = getWidth();&#xD;    int imgHeight = getHeight();&#xD;    Graphics g = getGraphics();&#xD;    int[] img = new int[imgWidth * imgHeight];&#xD;		&#xD;    Image texture = Image.createImage(32, 16);&#xD;    Graphics tg = texture.getGraphics(); &#xD;    tg.setColor(200, 200, 255);&#xD;    tg.drawString("h3-r3", 2, 0, Graphics.TOP | Graphics.LEFT);&#xD;    tg.setColor(200, 200, 255);&#xD;    tg.drawString("h3-r3", 4, 0, Graphics.TOP | Graphics.LEFT);&#xD;    tg.setColor(0, 0, 255);&#xD;    tg.drawString("h3-r3", 3, 0, Graphics.TOP | Graphics.LEFT);&#xD;    int[] txImg = new int[32 * 16]; &#xD;    texture.getRGB(txImg, 0, 32, 0, 0, 32, 16);&#xD;    texture = null; // dispose the texture Image&#xD;                   &#xD;    float tx, ty;&#xD;    float dtx, dty;&#xD;    float otx, oty;&#xD;		&#xD;    double cont = 0;&#xD;    double cos, sin;&#xD;    double size;&#xD;    int offs;&#xD;    for(;;) {&#xD;      cos = Math.cos(cont);&#xD;      sin = Math.sin(cont);&#xD;      tx = (float) cos * 20; &#xD;      ty = (float) sin * 20;&#xD;      size = cos;&#xD;      dtx = (float) (cos * size); &#xD;      dty = (float) (sin * size);&#xD;      cont += 0.02;&#xD;      for (int y = 0; y &lt; imgHeight; y++) {&#xD;        otx = tx;&#xD;        oty = ty;&#xD;        offs = y * imgWidth;&#xD;        for (int x = 0; x &lt; imgWidth; x++) {&#xD;          img[x + offs] = txImg[((int)(tx) & 31) + (((int)(ty) & 15) * 32)];&#xD;          tx += dtx;&#xD;          ty += dty;&#xD;        }&#xD;        tx = otx - dty;&#xD;        ty = oty + dtx;&#xD;      }&#xD;      g.drawRGB(img, 0, imgWidth, 0, 0, imgWidth, imgHeight, false);&#xD;      flushGraphics();&#xD;    }&#xD;  }&#xD;&#xD;}&#xD;</description><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[Today I tried to code an oldschool demo effect for my mobile phone (a Nokia 3110 classic)...<br/>I created a simple rotozomeer :)<br/><br/>here is the code (J2ME MIDP 2.0)<br/><br/><span style="font-family: courier;">package org.postronic.h3.testmidlet;<br/><br/>import javax.microedition.lcdui.Display;<br/>import javax.microedition.midlet.MIDlet;<br/>import javax.microedition.midlet.MIDletStateChangeException;<br/><br/>public class RotozoomerMIDlet extends MIDlet {<br/><br/>&nbsp; public RotozoomerMIDlet() { }<br/><br/>&nbsp; protected void startApp() throws MIDletStateChangeException {<br/>&nbsp; &nbsp; RotozoomerCanvas canvas = new RotozoomerCanvas();<br/>&nbsp; &nbsp; Display display = Display.getDisplay(this);<br/>&nbsp; &nbsp; display.setCurrent(canvas);<br/>&nbsp; &nbsp; canvas.run();<br/>&nbsp; }<br/>	<br/>&nbsp; protected void pauseApp() { }<br/>	<br/>&nbsp; protected void destroyApp(boolean arg0) throws MIDletStateChangeException { }<br/><br/>}<br/><br/><br/><br/>package org.postronic.h3.testmidlet;<br/><br/>import javax.microedition.lcdui.Graphics;<br/>import javax.microedition.lcdui.Image;<br/>import javax.microedition.lcdui.game.GameCanvas;<br/><br/>public class RotozoomerCanvas extends GameCanvas {<br/><br/>&nbsp; protected RotozoomerCanvas() {<br/>&nbsp; &nbsp; super(true);<br/>&nbsp; &nbsp; setFullScreenMode(true);<br/>&nbsp; }<br/><br/>&nbsp; public void run() {<br/>&nbsp; &nbsp; int imgWidth = getWidth();<br/>&nbsp; &nbsp; int imgHeight = getHeight();<br/>&nbsp; &nbsp; Graphics g = getGraphics();<br/>&nbsp; &nbsp; int[] img = new int[imgWidth * imgHeight];<br/>		<br/>&nbsp; &nbsp; Image texture = Image.createImage(32, 16);<br/>&nbsp; &nbsp; Graphics tg = texture.getGraphics(); <br/>&nbsp; &nbsp; tg.setColor(200, 200, 255);<br/>&nbsp; &nbsp; tg.drawString("h3-r3", 2, 0, Graphics.TOP | Graphics.LEFT);<br/>&nbsp; &nbsp; tg.setColor(200, 200, 255);<br/>&nbsp; &nbsp; tg.drawString("h3-r3", 4, 0, Graphics.TOP | Graphics.LEFT);<br/>&nbsp; &nbsp; tg.setColor(0, 0, 255);<br/>&nbsp; &nbsp; tg.drawString("h3-r3", 3, 0, Graphics.TOP | Graphics.LEFT);<br/>&nbsp; &nbsp; int[] txImg = new int[32 * 16]; <br/>&nbsp; &nbsp; texture.getRGB(txImg, 0, 32, 0, 0, 32, 16);<br/>&nbsp; &nbsp; texture = null; // dispose the texture Image<br/>                   <br/>&nbsp; &nbsp; float tx, ty;<br/>&nbsp; &nbsp; float dtx, dty;<br/>&nbsp; &nbsp; float otx, oty;<br/>		<br/>&nbsp; &nbsp; double cont = 0;<br/>&nbsp; &nbsp; double cos, sin;<br/>&nbsp; &nbsp; double size;<br/>&nbsp; &nbsp; int offs;<br/>&nbsp; &nbsp; for(;;) {<br/>&nbsp; &nbsp; &nbsp; cos = Math.cos(cont);<br/>&nbsp; &nbsp; &nbsp; sin = Math.sin(cont);<br/>&nbsp; &nbsp; &nbsp; tx = (float) cos * 20; <br/>&nbsp; &nbsp; &nbsp; ty = (float) sin * 20;<br/>&nbsp; &nbsp; &nbsp; size = cos;<br/>&nbsp; &nbsp; &nbsp; dtx = (float) (cos * size); <br/>&nbsp; &nbsp; &nbsp; dty = (float) (sin * size);<br/>&nbsp; &nbsp; &nbsp; cont += 0.02;<br/>&nbsp; &nbsp; &nbsp; for (int y = 0; y &lt; imgHeight; y++) {<br/>&nbsp; &nbsp; &nbsp; &nbsp; otx = tx;<br/>&nbsp; &nbsp; &nbsp; &nbsp; oty = ty;<br/>&nbsp; &nbsp; &nbsp; &nbsp; offs = y * imgWidth;<br/>&nbsp; &nbsp; &nbsp; &nbsp; for (int x = 0; x &lt; imgWidth; x++) {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; img[x + offs] = txImg[((int)(tx) & 31) + (((int)(ty) & 15) * 32)];<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tx += dtx;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ty += dty;<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; tx = otx - dty;<br/>&nbsp; &nbsp; &nbsp; &nbsp; ty = oty + dtx;<br/>&nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; &nbsp; g.drawRGB(img, 0, imgWidth, 0, 0, imgWidth, imgHeight, false);<br/>&nbsp; &nbsp; &nbsp; flushGraphics();<br/>&nbsp; &nbsp; }<br/>&nbsp; }<br/><br/>}</span><br/>]]></content:encoded><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">h3</dc:creator><dc:date xmlns:dc="http://purl.org/dc/elements/1.1/">2007-12-23T21:29:27+01:00</dc:date><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><comments>http://www.postronic.org/h3/pid45.html#comments</comments></item></channel></rss>
