<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Mihai Mobile</title>
	<atom:link href="http://blog.javia.org/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.javia.org</link>
	<description>Android apps</description>
	<lastBuildDate>Fri, 05 Feb 2010 09:04:32 +0000</lastBuildDate>
	
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Android package name by Pierre</title>
		<link>http://blog.javia.org/android-package-name/comment-page-1/#comment-3203</link>
		<dc:creator>Pierre</dc:creator>
		<pubDate>Fri, 05 Feb 2010 09:04:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=101#comment-3203</guid>
		<description>That is clearly and simply explained. Thank you very much for this useful entry !</description>
		<content:encoded><![CDATA[<p>That is clearly and simply explained. Thank you very much for this useful entry !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Nexus One display and subpixel pattern by Marcello</title>
		<link>http://blog.javia.org/nexus-one-display-and-subpixel-pattern/comment-page-1/#comment-3190</link>
		<dc:creator>Marcello</dc:creator>
		<pubDate>Thu, 04 Feb 2010 23:51:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=108#comment-3190</guid>
		<description>I took some closeup pictures of the Nexus One here: 
http://www.flickr.com/photos/marcello3d/sets/72157623343650142/</description>
		<content:encoded><![CDATA[<p>I took some closeup pictures of the Nexus One here:<br />
<a href="http://www.flickr.com/photos/marcello3d/sets/72157623343650142/" rel="nofollow">http://www.flickr.com/photos/marcello3d/sets/72157623343650142/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Synergetic Stupidity in Java by brezel</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-3128</link>
		<dc:creator>brezel</dc:creator>
		<pubDate>Tue, 02 Feb 2010 19:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-3128</guid>
		<description>this article is nonsense.

public class Main {
    static int entries = 100000000;
    static byte[] barr = new byte[entries];

    static {
        System.err.println(Runtime.getRuntime().totalMemory());
        for (int i = 0; i &lt; entries; i++) {
            barr[i] = new Byte(&quot;1&quot;);
        }
        System.err.println(barr.length);
        System.err.println(Runtime.getRuntime().totalMemory());
    }

    public static void main(String[] args) {
        
    }
}</description>
		<content:encoded><![CDATA[<p>this article is nonsense.</p>
<p>public class Main {<br />
    static int entries = 100000000;<br />
    static byte[] barr = new byte[entries];</p>
<p>    static {<br />
        System.err.println(Runtime.getRuntime().totalMemory());<br />
        for (int i = 0; i &lt; entries; i++) {<br />
            barr[i] = new Byte(&quot;1&quot;);<br />
        }<br />
        System.err.println(barr.length);<br />
        System.err.println(Runtime.getRuntime().totalMemory());<br />
    }</p>
<p>    public static void main(String[] args) {</p>
<p>    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The 10 principles of Assembly Java by Neil Harding</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-3030</link>
		<dc:creator>Neil Harding</dc:creator>
		<pubDate>Mon, 01 Feb 2010 21:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-3030</guid>
		<description>For the absolute best case in optimization for case 2, you should use -1,0,1 for the values then you can do

class Animal {
  static final int DOG=-1, CAT=1, MOUSE = 0;
  String saySomething(int kind) {
   if (kind  0) return &quot;meow&quot;;
   return &quot;squeak&quot;;
   }
}

this also allows you to do DOG &#124; CAT is != 0
CAT &#124; MOUSE &gt;= 0 etc

If you have a lot of cases then by grouping related ones into negative / positive you can use 0. The Java compiler is like the old C compilers back in the &#039;80s before any of the optimizations that were made (some C++ compilers can generate code that is almost as good as assembly, but since Java is already slow on Mobiles and size limited it is worth optimizing the code rather than letting the compiler, although a tool such as proguard means you can use more maintainable code, but it won&#039;t solve all your problems since it doesn&#039;t refactor the logic, just the generated code).</description>
		<content:encoded><![CDATA[<p>For the absolute best case in optimization for case 2, you should use -1,0,1 for the values then you can do</p>
<p>class Animal {<br />
  static final int DOG=-1, CAT=1, MOUSE = 0;<br />
  String saySomething(int kind) {<br />
   if (kind  0) return &#8220;meow&#8221;;<br />
   return &#8220;squeak&#8221;;<br />
   }<br />
}</p>
<p>this also allows you to do DOG | CAT is != 0<br />
CAT | MOUSE &gt;= 0 etc</p>
<p>If you have a lot of cases then by grouping related ones into negative / positive you can use 0. The Java compiler is like the old C compilers back in the &#8217;80s before any of the optimizations that were made (some C++ compilers can generate code that is almost as good as assembly, but since Java is already slow on Mobiles and size limited it is worth optimizing the code rather than letting the compiler, although a tool such as proguard means you can use more maintainable code, but it won&#8217;t solve all your problems since it doesn&#8217;t refactor the logic, just the generated code).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to fix multi-tap by Neil Harding</title>
		<link>http://blog.javia.org/how-to-fix-multi-tap/comment-page-1/#comment-3027</link>
		<dc:creator>Neil Harding</dc:creator>
		<pubDate>Mon, 01 Feb 2010 18:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=65#comment-3027</guid>
		<description>ASTEROID is a reasonably well know English word that uses 8 of the 9 initial letters that you&#039;ve picked so would be a good name to call the system. The 0 key should be space, dot, comma (and # to switch between numeric / text) so you can do &quot;call me on 123 456789&quot; and * could switch from abc,Abc,accented</description>
		<content:encoded><![CDATA[<p>ASTEROID is a reasonably well know English word that uses 8 of the 9 initial letters that you&#8217;ve picked so would be a good name to call the system. The 0 key should be space, dot, comma (and # to switch between numeric / text) so you can do &#8220;call me on 123 456789&#8243; and * could switch from abc,Abc,accented</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Synergetic Stupidity in Java by Neil Harding</title>
		<link>http://blog.javia.org/synergetic-stupidity-in-java/comment-page-1/#comment-3025</link>
		<dc:creator>Neil Harding</dc:creator>
		<pubDate>Mon, 01 Feb 2010 17:07:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/synergetic-stupidity-in-java/#comment-3025</guid>
		<description>I wrote a bytecode optimizer for J2ME when I worked at I-Play (Digital Bridges at that time). Because of the cost of adding a new class, it makes sense to do store objects inside int arrays.

public final static int X = 0;
public final static int Y = 1;
public final static int z = 2;
public final static int IMAGE_INDEX = 3;
public final static int SPRITE_SIZE = 4;

So that you can do draw(sprites[index + X],sprites[index + Y],sprites[index + IMAGE_INDEX])

However, Javac is very bad compiler and actually generates code index + 0 (rather than saying +0 is not actually much use and removing it).

So I removed that code, and some other optimizations and one of them I did was to replace code like
static final byte B[] = {10, 20, 30, 40, 50, 60, 70, 80, …};

with static final byte B[] = Bytecode::ArrayFromString(&quot;encodedString&quot;,offset), the encoded string was generated via the optimizer and occurred once in the class pool and had simple run length encoding as well (the other option would have been to load the data from a resource, but the string encoding was the simplest since I didn&#039;t need to worry about it not being available).</description>
		<content:encoded><![CDATA[<p>I wrote a bytecode optimizer for J2ME when I worked at I-Play (Digital Bridges at that time). Because of the cost of adding a new class, it makes sense to do store objects inside int arrays.</p>
<p>public final static int X = 0;<br />
public final static int Y = 1;<br />
public final static int z = 2;<br />
public final static int IMAGE_INDEX = 3;<br />
public final static int SPRITE_SIZE = 4;</p>
<p>So that you can do draw(sprites[index + X],sprites[index + Y],sprites[index + IMAGE_INDEX])</p>
<p>However, Javac is very bad compiler and actually generates code index + 0 (rather than saying +0 is not actually much use and removing it).</p>
<p>So I removed that code, and some other optimizations and one of them I did was to replace code like<br />
static final byte B[] = {10, 20, 30, 40, 50, 60, 70, 80, …};</p>
<p>with static final byte B[] = Bytecode::ArrayFromString(&#8220;encodedString&#8221;,offset), the encoded string was generated via the optimizer and occurred once in the class pool and had simple run length encoding as well (the other option would have been to load the data from a resource, but the string encoding was the simplest since I didn&#8217;t need to worry about it not being available).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The 10 principles of Assembly Java by Richeve Bebedor</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-2928</link>
		<dc:creator>Richeve Bebedor</dc:creator>
		<pubDate>Fri, 29 Jan 2010 17:32:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-2928</guid>
		<description>Added to my post i want to encourage this part because little things are sure to be forgotten XD what we want to achieve as a programmer is a program with fewer codes, maintainable and optimized to achieve that we need to explore. it is just a matter of combinations. i am saying as a programmer with a beginner&#039;s point of view thank you XD</description>
		<content:encoded><![CDATA[<p>Added to my post i want to encourage this part because little things are sure to be forgotten XD what we want to achieve as a programmer is a program with fewer codes, maintainable and optimized to achieve that we need to explore. it is just a matter of combinations. i am saying as a programmer with a beginner&#8217;s point of view thank you XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The 10 principles of Assembly Java by Richeve Bebedor</title>
		<link>http://blog.javia.org/assembly-java/comment-page-1/#comment-2927</link>
		<dc:creator>Richeve Bebedor</dc:creator>
		<pubDate>Fri, 29 Jan 2010 17:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=31#comment-2927</guid>
		<description>these are good tips for mobile applications only but i appreciate it so much because for me, as a non mobile app programmer, code optimization is a very big consideration. this is a great help! thank you for having these principles XD</description>
		<content:encoded><![CDATA[<p>these are good tips for mobile applications only but i appreciate it so much because for me, as a non mobile app programmer, code optimization is a very big consideration. this is a great help! thank you for having these principles XD</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Nexus One display and subpixel pattern by kscott</title>
		<link>http://blog.javia.org/nexus-one-display-and-subpixel-pattern/comment-page-1/#comment-2701</link>
		<dc:creator>kscott</dc:creator>
		<pubDate>Wed, 20 Jan 2010 21:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=108#comment-2701</guid>
		<description>&gt;&quot; ... I’m sure I’ve read somewhere that it’s even more sensible to red.&quot;

Nope. Most sensitive to green (around the 530 - 550 nm mark). Considerably less sensitive to red and green by about 1-2 orders of magnitude (See: www.yorku.ca/eye/lambdas.htm and look at the dotted line; that is your colour vision. The scale is logarithmic, so a plus or minus one on the relative sensitivity axis is a difference of ten times the sensitivity). So the relative pixel size makes sense.

&gt;&quot; I guess this may be due to red being a danger colour for humans.&quot;

I&#039;m sure I read somewhere that this is purely cultural - that in some cultures red stands for purity, joy, good luck, happiness, prosperity, etc., but I&#039;m not sure. I will have to Google it.</description>
		<content:encoded><![CDATA[<p>&gt;&#8221; &#8230; I’m sure I’ve read somewhere that it’s even more sensible to red.&#8221;</p>
<p>Nope. Most sensitive to green (around the 530 &#8211; 550 nm mark). Considerably less sensitive to red and green by about 1-2 orders of magnitude (See: <a href="http://www.yorku.ca/eye/lambdas.htm" rel="nofollow">http://www.yorku.ca/eye/lambdas.htm</a> and look at the dotted line; that is your colour vision. The scale is logarithmic, so a plus or minus one on the relative sensitivity axis is a difference of ten times the sensitivity). So the relative pixel size makes sense.</p>
<p>&gt;&#8221; I guess this may be due to red being a danger colour for humans.&#8221;</p>
<p>I&#8217;m sure I read somewhere that this is purely cultural &#8211; that in some cultures red stands for purity, joy, good luck, happiness, prosperity, etc., but I&#8217;m not sure. I will have to Google it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Nexus One display and subpixel pattern by Nick</title>
		<link>http://blog.javia.org/nexus-one-display-and-subpixel-pattern/comment-page-1/#comment-2700</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Wed, 20 Jan 2010 20:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.javia.org/?p=108#comment-2700</guid>
		<description>Come to think, this may have worked better had the red-blue ordering not changed every other row.  I didn&#039;t notice the green fringe on the right side of light areas until I went looking for it, but I noticed the red-blue-red-blue sawtooth artifact on the left within a few minutes of using the display.  Had there just been a red or blue fringe on the left, I might not have noticed.</description>
		<content:encoded><![CDATA[<p>Come to think, this may have worked better had the red-blue ordering not changed every other row.  I didn&#8217;t notice the green fringe on the right side of light areas until I went looking for it, but I noticed the red-blue-red-blue sawtooth artifact on the left within a few minutes of using the display.  Had there just been a red or blue fringe on the left, I might not have noticed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
