<?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>Juggling Eggs &#187; JavaScript</title>
	<atom:link href="http://sonnygill.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://sonnygill.net</link>
	<description>Priceless eggs, variable gravity</description>
	<lastBuildDate>Sun, 06 May 2012 19:47:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GMail hack results in business loss</title>
		<link>http://sonnygill.net/javascript/gmail-hack-results-in-business-loss/</link>
		<comments>http://sonnygill.net/javascript/gmail-hack-results-in-business-loss/#comments</comments>
		<pubDate>Wed, 26 Dec 2007 18:40:22 +0000</pubDate>
		<dc:creator>sonnygill</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sonnygill.wordpress.com/2007/12/27/gmail-hack-results-in-business-loss/</guid>
		<description><![CDATA[Read about how a GMail vulnerability resulted in logo designer David Airey losing his domain name - Google’s GMail security failure leaves my business sabotaged In short, check the filters in your GMail settings, and make sure that there are &#8230; <a href="http://sonnygill.net/javascript/gmail-hack-results-in-business-loss/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Read about how a GMail vulnerability resulted in <a href="http://www.davidairey.co.uk">logo designer</a> David Airey losing his domain name -<br />
<a href="http://www.davidairey.co.uk/StaticPage.html">Google’s GMail security failure leaves my business sabotaged</a></p>
<p>In short, check the filters in your GMail settings, and make sure that there are no filters there forwarding your email to an unknown address.</p>
<p>Update &#8211; Some suggestions for <a href="/2007/12/27/security-against-malicious-websites/">safeguarding against malicious websites</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sonnygill.net/javascript/gmail-hack-results-in-business-loss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Douglas Crockford: JavaScript &#8211; The Good Stuff</title>
		<link>http://sonnygill.net/javascript/douglas-crockford-javascript-the-good-stuff-2/</link>
		<comments>http://sonnygill.net/javascript/douglas-crockford-javascript-the-good-stuff-2/#comments</comments>
		<pubDate>Mon, 18 Jun 2007 07:15:09 +0000</pubDate>
		<dc:creator>sonnygill</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sonnygill.wordpress.com/2007/06/18/douglas-crockford-javascript-the-good-stuff-2/</guid>
		<description><![CDATA[A 40 minute talk by Douglas Crockford on the beginning of JavaScript, JSON and JSLint, lambda expressions in JavaScript, and how he went from thinking JavaScript as moronic to loving it - Douglas Crockford: JavaScript &#8211; The Good Stuff (via &#8230; <a href="http://sonnygill.net/javascript/douglas-crockford-javascript-the-good-stuff-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A 40 minute talk by <a href="http://www.crockford.com/">Douglas Crockford</a> on the beginning of JavaScript, JSON and <a href="http://www.jslint.com/">JSLint</a>, lambda expressions in JavaScript, and how he went from thinking JavaScript as moronic to loving it -</p>
<p><a href="http://video.yahoo.com/video/play?vid=630959">Douglas Crockford: JavaScript &#8211; The Good Stuff</a></p>
<p>(via <a href="http://yuiblog.com/">Yahoo User Interface Blog</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://sonnygill.net/javascript/douglas-crockford-javascript-the-good-stuff-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stringtree &#8211; Simple JSON in Java</title>
		<link>http://sonnygill.net/java/stringtree-simple-json-in-java/</link>
		<comments>http://sonnygill.net/java/stringtree-simple-json-in-java/#comments</comments>
		<pubDate>Wed, 24 Jan 2007 13:45:52 +0000</pubDate>
		<dc:creator>sonnygill</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sonnygill.wordpress.com/2007/01/24/stringtree-simple-json-in-java/</guid>
		<description><![CDATA[If you are like me, you probabely find that most of the Java implementations of JSON are rather bloated, especially for simple uses of JSON. Most of the time, I only need to convert a simple map to JSON, which &#8230; <a href="http://sonnygill.net/java/stringtree-simple-json-in-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are like me, you probabely find that most of the Java implementations of JSON are rather bloated, especially for simple uses of JSON. Most of the time, I only need to convert a simple map to JSON, which I do using a simple class I had written</p>
<p>Some time ago, I came accross a very simple implementation of JSON-Java converstion. See <a href="http://blog.stringtree.org/2006/08/12/json/" title="Stringtree JSON">Stringtree JSON</a> .</p>
<p>It is a nice, simple implementation consisting of all of 2 classes. I have only used the JSONReader class so far, and it seems to do its job well.</p>
<p>I had to make a few changes to fix a couple of issues, though. In case anybody runs into the same issues, here are my changes (in all their Unified Diff glory <img src='http://sonnygill.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) -</p>
<p>Bugfix for infinite loop if a value is null, true or false -<br />
<code>@@ -81,13 +81,17 @@<br />
} else if (c == 't' &amp;&amp; next() == 'r' &amp;&amp; next() == 'u' &amp;&amp; next() == 'e') {<br />
ret = Boolean.TRUE;<br />
+            next();<br />
} else if (c == 'f' &amp;&amp; next() == 'a' &amp;&amp; next() == 'l' &amp;&amp; next() == 's' &amp;&amp; next() == 'e') {<br />
ret = Boolean.FALSE;<br />
+            next();<br />
} else if (c == 'n' &amp;&amp; next() == 'u' &amp;&amp; next() == 'l' &amp;&amp; next() == 'l') {<br />
ret = null;<br />
+            next();<br />
} else if (Character.isDigit(c) || c == '-') {<br />
ret = number();<br />
}</code></p>
<p>-        System.out.println(&#8220;token: &#8221; + ret); // enable this line to see the token stream<br />
+//        System.out.println(&#8220;token: &#8221; + ret); // enable this line to see the token stream<br />
+<br />
token = ret;<br />
return ret;</p>
<p>In JSONWriter. To fix the null pointer error, if the field has no getter or is inaccessible otherwise -<br />
<code><br />
String name = prop.getName();<br />
Method accessor = prop.getReadMethod();<br />
-                Object value = accessor.invoke(object, (Object[])null);<br />
-                add(name, value);<br />
+                if(accessor != null) {<br />
+                    Object value = accessor.invoke(object, (Object[])null);<br />
+                    add(name, value);<br />
+                }</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sonnygill.net/java/stringtree-simple-json-in-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Auto-Login user script work on Flock</title>
		<link>http://sonnygill.net/hack/making-auto-login-user-script-work-on-flock/</link>
		<comments>http://sonnygill.net/hack/making-auto-login-user-script-work-on-flock/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 02:06:48 +0000</pubDate>
		<dc:creator>sonnygill</dc:creator>
				<category><![CDATA[Hack]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://sonnygill.wordpress.com/2006/12/12/making-auto-login-user-script-work-on-flock/</guid>
		<description><![CDATA[I use the Auto-Login user script at http://labs.beffa.org/greasemonkey/ to ease some of the pain of JEE development. Recently, I decided to try out Flock for a few days, and the script didn&#8217;t work with it. Thanks to Dive Into Greasemonkey, &#8230; <a href="http://sonnygill.net/hack/making-auto-login-user-script-work-on-flock/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use the Auto-Login user script at <a href="http://labs.beffa.org/greasemonkey/" title="http://labs.beffa.org/greasemonkey/">http://labs.beffa.org/greasemonkey/</a> to ease some of the pain of JEE development.</p>
<p>Recently, I decided to try out Flock for a few days, and the script didn&#8217;t work with it.</p>
<p>Thanks to <a href="http://diveintogreasemonkey.org/toc/index.html">Dive Into Greasemonkey</a>, here is a quick fix.</p>
<p>This part of the script fails when running on Flock browser -</p>
<pre class="brush: jscript; title: ; notranslate">
//to prevent submit to stupid site which put fake login / pass value
if (thisElement.value != thisElement.defaultValue) {
passfield = true;
thisElement.addEventListener(&amp;acirc;keypress&amp;acirc;, al_KeyPress, true);
}
</pre>
<p></p>
<p>For some reason,  <span style="color:#808080"><em><em>thisElement.value </em></em></span>is always empty on Flock. On Firefox, it shows the actual value of the field.<br />
Anyway, since I only use this script to login into a particular web page, I removed that if condition, and it works fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://sonnygill.net/hack/making-auto-login-user-script-work-on-flock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

