<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>doodle dabbles</title>
	
	<link>http://ashish.tonse.com</link>
	<description>a little nerdery for everyone</description>
	<lastBuildDate>Thu, 17 Sep 2009 21:35:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/DoodleDabbles" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Thoughts on Google FastFlip</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/ns0YXZyvA50/</link>
		<comments>http://ashish.tonse.com/2009/09/thoughts-on-google-fastflip/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 21:34:15 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=148</guid>
		<description><![CDATA[Recently, Google debuted their new experimental Google News interface, named Google Fast Flip. The motivation behind this feature lies in the question, &#8220;Why can&#8217;t the web function like a magazine?&#8221;
After examining the UI, I had some concerns that&#8217;ll hopefully be addressed by Google.
Firstly, it is a very slick UI. Everything moves smoothly like butter,  and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, Google debuted their new experimental Google News interface, named Google Fast Flip. The motivation behind this feature lies in the question, &#8220;Why can&#8217;t the web function like a magazine?&#8221;</p>
<p>After examining the UI, I had some concerns that&#8217;ll hopefully be addressed by Google.</p>
<p>Firstly, it is a very slick UI. Everything moves smoothly like butter,  and it is a very nifty UI for demonstrations and showcases. But is it an effective way to browse news articles?</p>
<p>When I browse for articles with heavy textual content (like in most newspapers or even Google News), I look for headlines. In the default view of fastflip where the thumbnails are very small, the headlines are too small to read. You could read them if you squinted a bit, but that would make things harder, not easier, to browse for articles. To address this (and probably accessibility), Google displays the headline of the article under the thumbnail. However, if my eyes have to keep shuttling back and forth between the thumbnail and headline, that results in a jarring effect. Yet more work I have to do on an interface that&#8217;s supposed to be more &#8220;casual.&#8221;</p>
<p><a href="http://ashish.tonse.com/wp-content/uploads/2009/09/Picture-3.png"><img class="alignnone size-full wp-image-153" title="Google FastFlip Thumbnails" src="http://ashish.tonse.com/wp-content/uploads/2009/09/Picture-3.png" alt="Google FastFlip Thumbnails" width="304" height="75" /></a></p>
<p>Visual Artwork based browsing</p>
<p>The idea of replicating the flipping of magazine pages is interesting. But most pages in magazines are meant to catch your eye. Whether they use beautiful artwork in advertisements, or provocative messaging, the idea is that you have about 1-2 seconds of a reader&#8217;s attention, so you better catch their attention enough to want to find out what you&#8217;re selling to them.</p>
<p>But this idea doesn&#8217;t work on the web, or with fastflip. Most of the articles are bodies of black text on white backgrounds. There is simply not much distinguishing each article, apart from the design of the publication&#8217;s website, and occasionally a really beautiful picture which will draw your attention.</p>
<p>On the topic of design and artwork in newsstands, there&#8217;s a great <a title="TED Talk" href="http://www.ted.com/talks/lang/eng/jacek_utko_asks_can_design_save_the_newspaper.html" target="_blank">TED Talk</a>.</p>
<p><span style="background-color: #ffffff;">Perhaps some of these designs would make Google&#8217;s FastFlip more compelling.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/09/thoughts-on-google-fastflip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/09/thoughts-on-google-fastflip/</feedburner:origLink></item>
		<item>
		<title>Netstat is your friend</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/dc0bpw1q8AA/</link>
		<comments>http://ashish.tonse.com/2009/06/netstat-is-your-friend/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 16:00:31 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=134</guid>
		<description><![CDATA[Every now and then, you need to run a server like JBoss, whose services bind to a handful of default ports (1099, 1098, 8080). And occasionally, you get a JVM_Bind error for these ports:
java.net.BindException: Address already in use: JVM_Bind 
Cause: java.rmi.server.ExportException: Port already in use: 1098;
The first (and more obvious) solution is to check that there [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then, you need to run a server like JBoss, whose services bind to a handful of default ports (1099, 1098, 8080). And occasionally, you get a JVM_Bind error for these ports:</p>
<pre>java.net.BindException: Address already in use: JVM_Bind 
Cause: java.rmi.server.ExportException: Port already in use: 1098;</pre>
<p>The first (and more obvious) solution is to check that there isn&#8217;t already an instance of JBoss. Once you&#8217;ve made sure (by killing all java.exe/javaw.exe processes), how do you find out what program is still listening on a particular port?</p>
<p>Netstat will help you there.</p>
<p><span id="more-134"></span><strong>Netstat</strong></p>
<p>Netstat (or equivalent) is a utility available in all major OSs, and allows you to view protocol statistics.  You can view incoming and outgoing ports that are in use, along with the IPs and hostnames that the sockets are connected to. In Windows, typing <strong>netstat -ab</strong> (-a for all connections, -b for the executable involved) in the command prompt results in a list of TCP and UDP sockets and the name of the process that is listening on that socket. Here&#8217;s some example output:</p>
<pre>  TCP    MyComputerName:6060    MyComputerName:0       LISTENING       1132
  [ibmtcsd.exe]

  TCP    MyComputerName:1026    MyComputerName:0       LISTENING       1508
  [UNS.exe]

  TCP    MyComputerName:1141    MyComputerName:0       LISTENING       28668
  [googletalkplugin.exe]

  TCP    MyComputerName:5152    MyComputerName:0       LISTENING       1572
  [jqs.exe]

  TCP    MyComputerName:5354    MyComputerName:0       LISTENING       896
  [mDNSResponder.exe]

  TCP    MyComputerName:27015   MyComputerName:0       LISTENING       12500
  [AppleMobileDeviceService.exe]

  TCP    MyComputerName:netbios-ssn  MyComputerName:0       LISTENING       4
  [System]

  TCP    MyComputerName:1141    localhost:1142         ESTABLISHED     28668
  [googletalkplugin.exe]

  TCP    MyComputerName:1142    localhost:1141         ESTABLISHED     29716
  [chrome.exe]

  TCP    MyComputerName:1405    localhost:1406         ESTABLISHED     33508
  [firefox.exe]</pre>
<p>Hope this helps you track down that annoying process that&#8217;s keeping JBoss from loading.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/06/netstat-is-your-friend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/06/netstat-is-your-friend/</feedburner:origLink></item>
		<item>
		<title>Working on Remote Files in TextMate with SSHFS</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/cQs6yktkkWs/</link>
		<comments>http://ashish.tonse.com/2009/06/working-on-remote-files-in-textmate-with-sshfs/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 01:30:34 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=122</guid>
		<description><![CDATA[I&#8217;ve been developing Wordpress templates for a client lately and it helps to have the templates directly on the server so I can work easily with the designer and she can see all my updates immediately. So this is what I want to be able to do:

Edit files on the server in a secure way
Use [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been developing Wordpress templates for a client lately and it helps to have the templates directly on the server so I can work easily with the designer and she can see all my updates immediately. So this is what I want to be able to do:</p>
<ul>
<li>Edit files on the server in a secure way</li>
<li>Use Textmate or a local editor</li>
<li>Not have to run rsync or any sync/upload utility</li>
</ul>
<p>Enter MacFUSE (and MacFusion) and SSHFS.</p>
<p><span id="more-122"></span><a href="http://code.google.com/p/macfuse/">MacFUSE</a> is an OS X port of the excellent <a href="http://fuse.sourceforge.net/">FUSE</a> (Filesystem in User Space) project. It allows you to build your own &#8220;filesystem&#8221; quite easily. (technical <a href="http://www.youtube.com/watch?v=cY8lBOSO3ak">video</a> on MacFuse available) Some nifty filesystems include:</p>
<ul>
<li>SSHFS &#8211; allows you to mount a directory on a remote server over SSH, as a local Volume</li>
<li>FTPFS &#8211; same, but using FTP</li>
</ul>
<p>The beauty of this is, programs that are only designed to edit local files can now edit remote files without realizing it.</p>
<h3>Step 1: Mount the remote folder as a local volume</h3>
<p>First, <a title="download MacFusion" href="http://www.macfusionapp.org/">download MacFusion</a>, which allows you to setup your SSH server parameters and mount it as a local volume. I was initially going to type out sshfs shell commands, but this is a much cleaner solution.</p>
<p>MacFusion should be intuitive enough that you can enter the host, username, password, and main directory. For extra security (yes, this actually is more secure), use public key authentication for SSH with the added convenience of auto-login (if your certificate doesn&#8217;t have a password).</p>
<h3>Step 2: Edit in Textmate (or other editor)</h3>
<p>Textmate (TM) is slow while using SSHFS for various reasons.</p>
<p>Firstly, when TM loses focus (say, you activate your browser) and regains focus, it rescans your project directory for any file changes. While this is a nifty and near-instantaneous feature for a local volume, it will take a few seconds on a remote server. There&#8217;s a quick remedy for that: <a title="ReMate" href="http://ciaranwal.sh/remate/" target="_blank">ReMate</a> &#8211; a TM plugin that disables the project folder refresh. This will make the experience much more bearable.</p>
<p>Saving files will result in a noticeable lag, but I think this is overall a good solution for having your cake files on a remote server) and eating it too.</p>
<p>Anyone inclined to suggest source control or rails like capistrano deployment scripts, this is a quick and dirty solution for wordpress themes and editing files on the server for instant feedback. For more complex apps, those deployment packages will do a much better job.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/06/working-on-remote-files-in-textmate-with-sshfs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/06/working-on-remote-files-in-textmate-with-sshfs/</feedburner:origLink></item>
		<item>
		<title>My Summer of Firsts (in DC)</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/gJqgMaVl1cg/</link>
		<comments>http://ashish.tonse.com/2009/04/my-summer-of-firsts-in-dc/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 01:34:43 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=98</guid>
		<description><![CDATA[This weekend, I accomplished 3 DC firsts. These were 3 quintessentially &#8221;DC&#8221; things to do, that I hadn&#8217;t done in my 16 years in the place I call home:

Visited the farmers&#8217; markets in the Eastern Market/Capitol Hill area
Cherry Blossom Festival at the Tidal Basin
Jazz on U Street (Bohemian Caverns, unique atmosphere, good food, great music)

It made me [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend, I accomplished 3 DC firsts. These were 3 quintessentially &#8221;DC&#8221; things to do, that I hadn&#8217;t done in my 16 years in the place I call home:</p>
<ul>
<li>Visited the farmers&#8217; markets in the Eastern Market/Capitol Hill area</li>
<li>Cherry Blossom Festival at the Tidal Basin</li>
<li>Jazz on U Street (Bohemian Caverns, unique atmosphere, good food, great music)</li>
</ul>
<p>It made me think about all the other things I haven&#8217;t discovered in this amazing city and the surrounding area, which inspired me to compile a sort of &#8220;bucket list&#8221; but for the summer. This is going to be a live list that I&#8217;d like to tick off and blog about as I accomplish these things.</p>
<p><span id="more-98"></span></p>
<p>The criteria for the list are as follows:</p>
<ul>
<li>Must happen in the DC Metro Area (or within a 2 hour drive)</li>
<li>Must not take more than a day to complete (most activities will be a few hours at most)</li>
<li>Indoor or Outdoor, doesn&#8217;t matter</li>
<li>Preferably something more unique to DC (watching movies doesn&#8217;t count)</li>
<li>If I haven&#8217;t done it in 2-3 years, it counts.</li>
</ul>
<p>Without further ado, the list (in no particular order):</p>
<ul>
<li>Ride the Capital Crescent Bike Trail</li>
<li>Ride the Beach Drive Bike Trail</li>
<li>Ride the Mount Vernon Bike Trail</li>
<li>At least 1 restaurant on DCFoodies&#8217; list of favorites</li>
<li>Go to the top of the Washington Monument</li>
<li>White House (sober, during the day, and not when on one of my introspective drives at 2am)</li>
<li>National Air and Space Museum&#8217;s Udvar-Hazy Center (near Dulles Airport)</li>
<li>Dupont Circle Farmers Market</li>
<li>Outdoor concerts by the Army, Navy, Air Force and Marine Corps Bands at the Capitol grounds</li>
<li>(From Limbo in comments) USMC Band at the Barracks on I St, and at the Iwo Jima Memorial (Tuesdays)</li>
<li>Performance at the Carter-Barron Amphitheater on 16th St</li>
<li>Performance at the Kennedy Center (I used to go 4-5 times a year, haven&#8217;t gone in ages)</li>
<li>Performance at the 9:30 club (seeing Prodigy there on May 18)</li>
<li>Performance at Wolftrap</li>
<li>Grab a Telescope and go see the stars at night in Shenandoah Valley</li>
<li>Ethiopian Food on U St</li>
<li>At least one more Jazz club on U St (apart from my regular Utopia and now, Bohemian Caverns)</li>
</ul>
<p>Suggestions on things to add?</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/04/my-summer-of-firsts-in-dc/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/04/my-summer-of-firsts-in-dc/</feedburner:origLink></item>
		<item>
		<title>“Using” the Quickbooks API for Time Tracking</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/EJBZ5-w866U/</link>
		<comments>http://ashish.tonse.com/2009/01/using-the-quickbooks-api-for-time-tracking/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 21:08:43 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=68</guid>
		<description><![CDATA[As an IT consultant who subcontracts from various companies, I enter my hours in at least 3 different systems on any given day.

My own company&#8217;s system hosted on Freshbooks &#8211; This is the master copy since my invoicing is driven by it
Quickbooks, two of my clients use it and require me to enter hours in [...]]]></description>
			<content:encoded><![CDATA[<p>As an IT consultant who subcontracts from various companies, I enter my hours in at least 3 different systems on any given day.</p>
<ol>
<li>My own company&#8217;s system hosted on Freshbooks &#8211; This is the master copy since my invoicing is driven by it</li>
<li>Quickbooks, two of my clients use it and require me to enter hours in there for accurate billing</li>
<li>GHG&#8217;s Timesheet software &#8211; err&#8230; this abomination of an app barely functions, forget asking for an API</li>
</ol>
<p>I want to be able to record hours on all 3 systems in one click or even from my iPhone.</p>
<p><span id="more-68"></span></p>
<h3>Freshbooks</h3>
<p>Freshbooks&#8217; API is very clean and they have an iPhone app, so this is the least of my worries.</p>
<p>Request:</p>
<p><code>&lt;request method="time_entry.create"&gt;<br />
&lt;time_entry&gt;<br />
&lt;project_id&gt;1&lt;/project_id&gt;        # Associated project_id (Required)<br />
&lt;task_id&gt;1&lt;/task_id&gt;              # Associated task_id    (Required)<br />
&lt;hours&gt;4.5&lt;/hours&gt;                # (Optional)<br />
&lt;notes&gt;Freshbooks Test&lt;/notes&gt; <span> </span> # (Optional)<br />
&lt;date&gt;2007-01-01&lt;/date&gt;           # (Optional)<br />
&lt;/time_entry&gt;<br />
&lt;/request&gt;</code></p>
<p>Response:</p>
<p><code>&lt;response status="ok"&gt;<br />
&lt;time_entry_id&gt;211&lt;/time_entry_id&gt;<br />
&lt;/response&gt;</code></p>
<p>Almost too easy. <img src='http://ashish.tonse.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thank you Freshbooks.</p>
<h3>Quickbooks (the Big Kahuna)</h3>
<p>Quickbooks doesn&#8217;t have an API, but have exposed API-like functionality to their Outlook plugin and Vista Gadget. Since Vista Gadgets (and Apple Dashboard Widgets as well) are just html/javascript, some simple hacking revealed exactly what I needed.</p>
<p>&#8220;Extracting&#8221; the Quickbooks Time Tracker Vista Gadget&#8217;s protocol</p>
<p>I first downloaded the .gadget file from Quickbooks&#8217; site after logging in. Since this is a CAB (Cabinet) file, you can open it natively within Windows or use File Juicer on the Mac. The CAB file reveals a directory structure with tons of images, html files, and javascript files. From here, it&#8217;s relatively easy to find the right files you need.</p>
<p>Of particular interest are:</p>
<p><code>js/loginAndSynch.js<br />
js/persistentSettings.js</code></p>
<p>After about half an hour of hacking at the javascript code and many invalid cURL requests to the QB server, this is essentially the protocol I was able to get working:</p>
<p>&#8220;GetLists&#8221; &#8211; Obtains the list of customers and service jobs from the Quickbooks server</p>
<p>Endpoint: https://timetracking.quickbooks.com/j/tts/widget</p>
<p>POST Body:</p>
<p><code>cmd=getLists&amp;version=1.0v&amp;login=%7B%22companyid%22%3A%22your_company_id%22%2C%22username%22%3A%22your_username_value%22%2C%22password%22%3A%22your_password_value%22%7D</code></p>
<p>cURL command for debugging: <code>curl -v -d @post.data -X POST https://timetracking.quickbooks.com/j/tts/widget</code></p>
<p>Make sure you put the POST body above in a file named &#8220;post.data&#8221; in the same directory where you run cURL. It&#8217;ll use the contents of the file as the POST body.</p>
<p>And you will receive all the Customer Names and Service Items in JSON (fake company names/IDs for confidentiality):</p>
<p><code>{"CustomerJobs":[{"Name":"Food Network","ID":"999999"},{"Name":"Food Network:Rachael Ray","ID":"7777777"},{"Name":"Cartoon Network","ID":"25252525"},{"Name":"Cartoon Network:Family Guy","ID":"2343333"},{"Name":"Vacation","ID":"888888"}],"ServiceItems":[{"Name":"Contractor-Admin work","ID":"111111"},{"Name":"Contractor-Support Work","ID":"222222"},{"Name":"Contractor-Support Work:Training","ID":"33333"},{"Name":"Support Work","ID":"444444"},{"Name":"Support Work:Maintenance Work","ID":"5555555"}]}</code></p>
<p>The easiest way for me to quickly inspect a JSON struct is to fire up the Ruby interactive console (irb) and do the following:</p>
<p><code>&gt;&gt; require 'rubygems'<br />
=&gt; false<br />
&gt;&gt; require 'json' <span> </span># 'sudo gem install json' if you don't have the json gem<br />
=&gt; true<br />
&gt;&gt; a = JSON.parse(File.read('customers.json'))</code></p>
<p>&#8230; &#8216;a&#8217; now has the json struct</p>
<p>From here, I can iterate through the hash and inspect its keys and data:</p>
<p><code>&gt;&gt; a.keys<br />
=&gt; ["ServiceItems", "CustomerJobs"]<br />
&gt;&gt; a['CustomerJobs'].each do |job| puts job['Name'] end</code></p>
<p>&#8230; prints out all the customer job names</p>
<p>Voila! We have the first half (and arguably the easier half) of this Quickbooks API project.</p>
<p>In the next part, I will outline how I did the second half, the actual Time Entry piece. (After I figure it out)</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/01/using-the-quickbooks-api-for-time-tracking/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/01/using-the-quickbooks-api-for-time-tracking/</feedburner:origLink></item>
		<item>
		<title>Firefox Illegal Character JS Error</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/-BEdRGKtnWs/</link>
		<comments>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 13:33:24 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=48</guid>
		<description><![CDATA[I encountered the following error in FireBug (FireFox) on jQuery&#8217;s ui.core.js that halts execution of the rest of my scripts:
illegal character 
The last time I encountered this problem, I renamed the file a few times and that fixed it. Yes, that makes no sense but as long as it was fixed, I just went about [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered the following error in FireBug (FireFox) on jQuery&#8217;s ui.core.js that halts execution of the rest of my scripts:</p>
<p><code>illegal character </code></p>
<div id="attachment_80" class="wp-caption alignnone" style="width: 368px"><img class="size-full wp-image-80" title="illegal-character" src="http://ashish.tonse.com/wp-content/uploads/2009/01/illegal-character.png" alt="Illegal Character error in Firebug" width="358" height="93" /><p class="wp-caption-text">Illegal Character error in Firebug</p></div>
<p>The last time I encountered this problem, I renamed the file a few times and that fixed it. Yes, that makes no sense but as long as it was fixed, I just went about my merry self until it happened again today, and no amount of file renaming would fix it. So I did a little bit of investigation to figure out exactly why this happened.</p>
<p><span id="more-48"></span></p>
<p>First, I found this problem only happening in Firefox, and not Chrome, or IE.</p>
<p>When accessing the file directly in the browser, the first 3 chars were:</p>
<p><code>﻿<br />
/*<br />
*<br />
*<br />
*<br />
*<br />
*/</code></p>
<p><code> </code></p>
<p><code>(function($) {<br />
</code></p>
<p>cURL returned the same result, narrowing it down to either the server adding that character, or the file containing it. Since the server is JBoss, it&#8217;s most likely the file.</p>
<p>Opening the file in Binary mode in Textpad, I found that the first 3 bytes had the hex value: <code>EF BB BF</code></p>
<p>This has to be a standard hex header for a certain file format (probably unicode related?) So I googled for that hex value. The first result was a <a title="wikipedia entry" href="http://en.wikipedia.org/wiki/Byte-order_mark" target="_blank">wikipedia entry</a> for Byte-order mark. This made total sense already. The Byte-order mark specifies the byte order (<a href="http://en.wikipedia.org/wiki/Endianness">endianness</a>) of the file that follows, with relation to unicode-related encodings. It turns out that <code>EF BB BF</code> is the Byte-order mark to denote UTF-8, but at the same time, it is completely unnecessary as UTF-8 has no byte-order issues by design.</p>
<p>So I had to get notepad++ to remove the first 3 bytes of that file, by choosing the option for &#8220;Encode in UTF-8 without BOM&#8221; in the Format Menu.</p>
<p>This fixed the issue! I hope this helps others that encounter this completely obscure looking error.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2009/01/firefox-illegal-character-js-error/</feedburner:origLink></item>
		<item>
		<title>The Ruby Console’s help() command</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/O1t6qAWSnaI/</link>
		<comments>http://ashish.tonse.com/2008/09/the-ruby-consoles-help-command/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 23:11:10 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[docs]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/2008/09/the-ruby-consoles-help-command/</guid>
		<description><![CDATA[I am writing this blog post offline on my flight to Austin via Atlanta. I am working on a Rails application and I needed to look at the different methods available for ruby Arrays. And I didn&#8217;t take an offline copy of the Rails or Ruby documentation. But I thought that perhaps Ruby would have [...]]]></description>
			<content:encoded><![CDATA[<p>I am writing this blog post offline on my flight to Austin via Atlanta. I am working on a Rails application and I needed to look at the different methods available for ruby Arrays. And I didn&#8217;t take an offline copy of the Rails or Ruby documentation. But I thought that perhaps Ruby would have something similar to Python&#8217;s dir() command, which is essentially a function in the python console that returns a list of possible functions and meta information for a given type.</p>
<p><span id="more-44"></span></p>
<p>So for example, if you did the following in the Python console:</p>
<p><code><br />
&gt;&gt;&gt; a = ['a']<br />
&gt;&gt;&gt; dir(a)<br />
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__str__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']<br />
</code></p>
<p>As you can see, the object &#8216;a&#8217; is an array. And when I type dir(a), the python console returns the properties available to a Python Array object. It&#8217;s an extremely useful way of discovering the features of the languages, especially when you just like tinkering.</p>
<p>It turns out (and I didn&#8217;t know this) that there&#8217;s a similar command in the Ruby interative console, help(). This basically allows you to look up the documentation for base classes and features of the given class. So you can do the following (slightly different from Python):</p>
<p><code><br />
&gt;&gt; help(Array)<br />
</code></p>
<p>Ruby sends you to a text page similar to a *nix man (manual) page. This works on the class level and also the class method level, such as:</p>
<p><code><br />
&gt;&gt; help('Array.delete')<br />
</code></p>
<p>Note that when mentioning a method for a class, you must enclose it in quotes, or it won&#8217;t be able to find it in help. It&#8217;s not necessary to enclose a class lookup in quotes though. This is a really useful command for people who are stuck on a plane or in a similar offline situation, like I am right now. It can also be much quicker than googling for a particular reference, as you can keep one terminal shell open with irb running all the time, and get your reference in an instant.</p>
<p>See what you can discover just by tinkering with help() or dir() commands in Ruby and Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2008/09/the-ruby-consoles-help-command/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2008/09/the-ruby-consoles-help-command/</feedburner:origLink></item>
		<item>
		<title>OpenSSL: The Gift that Keeps On Giving</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/0IWhZAHOoJs/</link>
		<comments>http://ashish.tonse.com/2008/08/openssl-the-gift-that-keeps-on-giving/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 23:42:11 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=36</guid>
		<description><![CDATA[OpenSSL is just a gem of a package. It is so incredibly powerful, and does just about anything you could imagine that a crypto library could do. I am admittedly just an amateur at using this library, but when debugging an SSL issue where a cert was not verifying for me, I discovered this command [...]]]></description>
			<content:encoded><![CDATA[<p>OpenSSL is just a gem of a package. It is so incredibly powerful, and does just about anything you could imagine that a crypto library could do. I am admittedly just an amateur at using this library, but when debugging an SSL issue where a cert was not verifying for me, I discovered this command through Tha Googles: </p>
<pre>openssl s_client -connect www.logoworks.com:443 -showcerts</pre>
<p>This shows you every step in which the SSL verification takes place, where the verification fails, etc. Really nifty.</p>
<p><span id="more-36"></span></p>
<p>But while you can get the MD5 hash of a file using the &#8220;md5&#8243; command (or &#8220;md5sum&#8221; on Linux), if you want to find the SHA1 or RIPEMD-160 hashes of a file, you can do so with:</p>
<pre>openssl sha1 whatever_filename
openssl rmd160 whatever_filename</pre>
<p>Also, from this <a title="awesome tip" href="http://osxdaily.com/2007/05/02/quickly-encrypt-a-file-with-openssl/">awesome tip</a> from OS X Daily, you can quickly encrypt a file using openssl using the following (I used AES 128 in CBC mode) &#8212; it even prompts you for the encryption password (key) twice:</p>
<pre>openssl aes-128-cbc -e -in filetoencrypt.txt -out encryptedfilename</pre>
<p>and decrypt with:</p>
<pre>openssl aes-128-cbc -d -in encryptedfilename -out decryptedfilename</pre>
<p>It prompts you for the decryption password once and you&#8217;re all set.</p>
<p>I&#8217;m still discovering all the goodies inside the OpenSSL command. But so far, it&#8217;s proving to be incredibly powerful awesome. I understand it&#8217;s the underlying library for SSH, one of the workhorse protocols of the secure internet, but I didn&#8217;t know that so much functionality was exposed through the console.</p>
<p>Update: Wow Ok misconception. I thought OpenSSH was based on OpenSSL &#8211; it&#8217;s not. It&#8217;s apparently a common misconception. <img src='http://ashish.tonse.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2008/08/openssl-the-gift-that-keeps-on-giving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2008/08/openssl-the-gift-that-keeps-on-giving/</feedburner:origLink></item>
		<item>
		<title>Interesting Algorithmic Result</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/35y1iROMDUg/</link>
		<comments>http://ashish.tonse.com/2008/08/interesting-algorithmic-result/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 00:58:29 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=28</guid>
		<description><![CDATA[I&#8217;ve always admired the way Google News aggregates news content from thousands of sources into groups of stories. But every now and then, you get interesting, and amusing results like this (Phelps photo with the Dam story):
 
For some reason I was just amused by it  
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always admired the way Google News aggregates news content from thousands of sources into groups of stories. But every now and then, you get interesting, and amusing results like this (Phelps photo with the Dam story):</p>
<p> </p>
<div id="attachment_29" class="wp-caption aligncenter" style="width: 509px"><a href="http://ashish.tonse.com/wp-content/uploads/2008/08/picture-1.png"><img class="size-full wp-image-29" title="GNews + Phelps" src="http://ashish.tonse.com/wp-content/uploads/2008/08/picture-1.png" alt="Google News confuses the story" width="499" height="120" /></a><p class="wp-caption-text">Google News confuses the story</p></div>
<p>For some reason I was just amused by it <img src='http://ashish.tonse.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2008/08/interesting-algorithmic-result/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2008/08/interesting-algorithmic-result/</feedburner:origLink></item>
		<item>
		<title>Lost my template :(</title>
		<link>http://feedproxy.google.com/~r/DoodleDabbles/~3/i498p1n-c8s/</link>
		<comments>http://ashish.tonse.com/2008/08/lost-my-template/#comments</comments>
		<pubDate>Sat, 16 Aug 2008 17:11:10 +0000</pubDate>
		<dc:creator>Ashish</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashish.tonse.com/?p=25</guid>
		<description><![CDATA[While moving to a new provider (Slicehost), I successfully backed up all my post and blog content, but I didn&#8217;t backup my theme. So now I forgot what theme it was AND lost the tweaks I made to it  
How unfortunate! I&#8217;ll spend the next few weeks fixing this, but I can&#8217;t right now [...]]]></description>
			<content:encoded><![CDATA[<p>While moving to a new provider (Slicehost), I successfully backed up all my post and blog content, but I didn&#8217;t backup my theme. So now I forgot what theme it was AND lost the tweaks I made to it <img src='http://ashish.tonse.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>How unfortunate! I&#8217;ll spend the next few weeks fixing this, but I can&#8217;t right now because I&#8217;m swamped with consulting work, and setting up <a href="http://www.kznconsulting.com" target="_blank">the business</a>.</p>
<p>Update: Found Hemingway for Wordpress. This was my post. Now I have to retrieve the really nice floating top navigation I had. That one I found on someone&#8217;s blog so there&#8217;s no way I&#8217;m going to find that again. DAMN.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashish.tonse.com/2008/08/lost-my-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://ashish.tonse.com/2008/08/lost-my-template/</feedburner:origLink></item>
	</channel>
</rss>
