<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rants of a mobile dev &#187; Programing</title>
	<atom:link href="http://blog.smartcube.co.za/category/programing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartcube.co.za</link>
	<description>Mobile developer ranting about mobile stuff</description>
	<lastBuildDate>Sun, 02 May 2010 20:58:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Optimizing J2mepolish Build Proccess</title>
		<link>http://blog.smartcube.co.za/2009/08/19/optimizing-j2mepolish-build-proccess/</link>
		<comments>http://blog.smartcube.co.za/2009/08/19/optimizing-j2mepolish-build-proccess/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 07:25:43 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[J2me]]></category>
		<category><![CDATA[J2mepolish]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=173</guid>
		<description><![CDATA[J2mepolish as a build framework is great! I have been using parts of it since before it was in beta. J2mepolish provides different licenses depending on how you use the product now while this can be looked on in a bad light but I quite like the fact that it is open-source as well as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://j2mepolish.org/">J2mepolish</a> as a build framework is great! I have been using parts of it since before it was in beta.</p>
<p>J2mepolish provides different <a href="http://www.j2mepolish.org/cms/leftsection/licensing.html">licenses</a> depending on how you use the product now while this can be looked on in a bad light but I quite like the fact that it is open-source as well as long as you your self release the code under the same license should you wish to release under a different license there are other payed options available. </p>
<p>The build framework is licensed under <a href="http://www.gnu.org/licenses/gpl.html">GPL</a> no matter how you use it.</p>
<p>I have found that the build proccess can be pretty slow and time consuming I have also found that with out obsfication it by default includes ALL classes in the framework include the GUI/Utils. While you don&#8217;t make use of them you aren&#8217;t violating the license it does increase the application size. There are a few tweeks that one can make to their own personal setup to improve this.</p>
<p>Firstly <a href="http://en.wikipedia.org/wiki/TMPFS ">tmpfs</a> and mounting your /build and /dist directory into memory (For debugging only I wouldn&#8217;t mount a full build) You would have to replace the standard build clean target since the standard user <strong>shouldn&#8217;t</strong> have permissions to delete/create tmpfs<br />
Standard:</p>
<blockquote><p>&lt;delete dir=\&quot;dist\&quot; /&gt;</p></blockquote>
<p>Changed</p>
<blockquote><p>
&lt;delete includeemptydirs=\&quot;true\&quot;&gt;<br />
    &lt;fileset dir=\&quot;dist\&quot; includes=\&quot;**/*\&quot; defaultexcludes=\&quot;false\&quot;/&gt;<br />
&lt;/delete&gt;</p></blockquote>
<p>Secondly the since the build proccess includes all the J2mepolish source files by default you should be able to just set <strong>polish.client.source</strong> to a empty directory but it contains a reference <a href="http://www.j2mepolish.org/javadoc/j2me/index.html">Locale</a> which also contains references to other files(Which are not 100% needed unless you actually use the Utilities provided by J2mepolish)</p>
<p>So a simple fix is create a folder structure with /path/to/directory/de/enough/polish/util/Local.java and place this <a href="http://blog.smartcube.co.za/wp-content/uploads/2009/08/Locale.java">Local.java</a> in there.</p>
<p>In the build file or one of the config files set </p>
<blockquote><p>polish.client.source=/path/to/directory</p></blockquote>
<p> and you should be all set. I noticed huge build time improvements but I don&#8217;t currently make sure of the GUI/Utils.</p>
<p>Hope this helps make you more productive. If you have any other tweaks I would love to hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2009/08/19/optimizing-j2mepolish-build-proccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Python to Format Json</title>
		<link>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/</link>
		<comments>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 08:04:47 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[Api]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=159</guid>
		<description><![CDATA[I have been working quite a bit with Json. Json disregards whitespace by implementation this makes the standard format of Json being a single very long line of not so readable text. Simple example. {"query":"some text","results":[{"title":"some result","id":"213"}]} I had some plan to write some simple python script to format it nicely. I have used the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working quite a bit with <a href="http://json.org">Json</a>. <a href="http://json.org">Json</a> disregards whitespace by implementation this makes the standard format of <a href="http://json.org">Json</a> being a single very long line of not so readable text.<br />
Simple example.<br />
<code>{"query":"some text","results":[{"title":"some result","id":"213"}]}</code><br />
I had some plan to write some simple python script to format it nicely. I have used the <a href="http://blog.smartcube.co.za/2009/07/02/re-dumping-currently-loaded-firefox-urls/">json module before</a>, I wasn&#8217;t aware it had a format function  as part of<a href="http://docs.python.org/library/json.html ">json.tool</a>.</p>
<p><a href="http://curl.haxx.se/">curl</a> + <a href="http://json.org">Json</a> + <a href="http://python.org">Python</a><br />
<code>curl  http://domain.com/api.json 2> /dev/null | python -mjson.tool</code></p>
<p>I found that with our redirection the error output to /dev/null i was getting.</p>
<blockquote><p> % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br />
                                 Dload  Upload   Total   Spent    Left  Speed<br />
  0    67    0    67    0     0     76      0 &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211; &#8211;:&#8211;:&#8211;     0</p></blockquote>
<p>Formated Json</p>
<blockquote><pre>
{
    "query": "some text",
    "results": [
        {
            "id": "213",
            "title": "some result"
        }
    ]
}</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2009/07/14/using-python-to-format-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re Dumping currently loaded Firefox URLs</title>
		<link>http://blog.smartcube.co.za/2009/07/02/re-dumping-currently-loaded-firefox-urls/</link>
		<comments>http://blog.smartcube.co.za/2009/07/02/re-dumping-currently-loaded-firefox-urls/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 10:26:50 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=145</guid>
		<description><![CDATA[bryce posted his Perl version of Dumping currently loaded Firefox URLs. I decided perl is unreadable and the file is json any way. So with the python-json package You can get some pretty readable code so I wrote a pretty simple Python version ff-pages. Usage: python ff-pages.py /path/to/location/sessionstore.js I am starting off with python so [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www2.bryceharrington.org:8080">bryce</a> posted his Perl version of <a href="http://www2.bryceharrington.org:8080/drupal/ff-pages">Dumping currently loaded Firefox URLs</a>.</p>
<p>I decided perl is unreadable <img src='http://blog.smartcube.co.za/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and the file is <a href="http://json.org">json</a> any way. <del datetime="2009-07-02T10:26:05+00:00">So with the python-json package</del> You can get some pretty readable code so I wrote a pretty simple Python version <a href="http://blog.smartcube.co.za/wp-content/uploads/2009/07/ff-pages.py">ff-pages</a>.</p>
<p>Usage:<br />
<code>python ff-pages.py /path/to/location/sessionstore.js<br />
</code><br />
I am starting off with python so all comments are welcome.</p>
<p>Update 02/06/2009:<br />
python-json isn&#8217;t needed.<br />
Seems to only work with firefox3.5</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2009/07/02/re-dumping-currently-loaded-firefox-urls/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Sun Unreleases WTK3.0</title>
		<link>http://blog.smartcube.co.za/2009/06/29/sun-unreleases-wtk3-0/</link>
		<comments>http://blog.smartcube.co.za/2009/06/29/sun-unreleases-wtk3-0/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 11:47:13 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[J2me]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Wtk]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=136</guid>
		<description><![CDATA[I have heard alot about how amazing J2me development on their new WTK3.0 is. The reason I say &#8220;have heard&#8221; is I refuse to use/try it until they release the Linux based version. I mean the product wont even run on their own Solaris OS way to go on marketing your own products. The windows [...]]]></description>
			<content:encoded><![CDATA[<p>I have heard alot about how amazing <a href="http://en.wikipedia.org/wiki/Java_Platform,_Micro_Edition">J2me</a> development on their new <a href="http://java.sun.com/javame/downloads/sdk30.jsp">WTK3.0</a> is.</p>
<p>The reason I say &#8220;have heard&#8221; is I refuse to use/try it until they release the <a href="http://en.wikipedia.org/wiki/Linux">Linux</a> based version. I mean the product wont even run on their own <a href="www.sun.com/software/solaris/">Solaris</a> OS way to go on marketing your own products.</p>
<p>The <a href="http://www.glassfit.co.za/">windows</a> version has been out for more ages. I have logged a bug request on their site, I didn&#8217;t get a reply not that I was actually expecting to get one.</p>
<p>Under the <a href="http://java.sun.com/javame/downloads/sdk30.jsp#req">Requirements section</a> &#8220;Windows&#8221; are you kidding me, The guys that have been pushing and that revolutionized <a href="http://en.wikipedia.org/wiki/Cross-platform">cross platform</a> development.</p>
<p>For now at least my beliefs hold strong and I wont touch their shiny new toy until they release a Linux version. &lt;/EndRant&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2009/06/29/sun-unreleases-wtk3-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Batch Set Var From Application Output</title>
		<link>http://blog.smartcube.co.za/2008/12/11/batch-var-application-output/</link>
		<comments>http://blog.smartcube.co.za/2008/12/11/batch-var-application-output/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 11:53:28 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=44</guid>
		<description><![CDATA[I have been looking for this line of code for a while. I needed to set a var in a batch script to be the output from an application. FOR /F "tokens=*" %%R IN ('PROGRAM.EXE /SWITCH') DO SET VAR=%%R My first attempt was something like this application > ~tmpFile set /p var= < ~tmpFile del [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking for this line of code for a while. I needed to set a var in a batch script to be the output from an application.</p>
<blockquote><p><code>FOR /F "tokens=*" %%R IN ('PROGRAM.EXE /SWITCH') DO SET VAR=%%R</code>
</p></blockquote>
<p>My first attempt was something like this </p>
<blockquote><p><code>application > ~tmpFile<br />
set /p var= < ~tmpFile<br />
del ~tmpFile<br />
</code></p></blockquote>
<p>This post is a prequel to simple mysql backup script for windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2008/12/11/batch-var-application-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pigs Can Fly</title>
		<link>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/</link>
		<comments>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 19:17:29 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=37</guid>
		<description><![CDATA[Php is so loosely typed that true==false in php. $a = &#8216;foo&#8217;; $b = 0; if ( $a == true &#38;&#38; $b == false &#38;&#38; $a == $b ) { echo &#8220;Pigs Can Fly&#8221;; } Produces &#8220;Pigs Can Fly&#8221;. Strings are considered true if they are not empty or null. so &#8216;foo&#8217;==true would be true==true [...]]]></description>
			<content:encoded><![CDATA[<p>Php is so loosely typed that true==false in php.</p>
<blockquote><p>
$a = &#8216;foo&#8217;;<br />
$b = 0;<br />
if ( $a == true &amp;&amp; $b == false &amp;&amp; $a == $b ) {<br />
echo &#8220;Pigs Can Fly&#8221;;<br />
}</p></blockquote>
<p>Produces  &#8220;Pigs Can Fly&#8221;.<br />
Strings are considered true if they are not empty or null. so &#8216;foo&#8217;==true would be true==true ie true<br />
Numbers are considered false if they are 0. so 0 == false is false == false ie true<br />
As for the last point this still fascinates me.<br />
Because there are no numbers in variable $a, is set to 0, therefore int 0 == int 0.</p>
<p><a href="http://stuweb.jcu.edu/ptagliamonte11/">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
