<?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>thirstymind.org</title>
	<atom:link href="http://www.thirstymind.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thirstymind.org</link>
	<description>andrew watts' weblog</description>
	<lastBuildDate>Sat, 17 Oct 2009 22:11:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implementing python&#8217;s string format() in javascript</title>
		<link>http://www.thirstymind.org/2009/10/17/implementing-pythons-string-format-in-javascript/</link>
		<comments>http://www.thirstymind.org/2009/10/17/implementing-pythons-string-format-in-javascript/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 22:11:16 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=541</guid>
		<description><![CDATA[In python 2.6, a new standard string method was introduced: format(). I have started using it a lot in my python code and it is the new standard way to format strings in python 3.0.
I also write a lot of javascript, and probably more javascript than python, but debugging in javascript is difficult and I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>In python 2.6, a new standard string method was introduced: <code>format()</code>. I have started using it a lot in my python code and it is the new standard way to format strings in python 3.0.</p>
<p>I also write a lot of javascript, and probably more javascript than python, but debugging in javascript is difficult and I&#8217;ve overridden firebug&#8217;s <code>console.log()</code> and <code>console.dir()</code> for my conveniences.  In order to make those conveniences even easier, I&#8217;ve added a format method that implements the  simple replacement fields portion of python&#8217;s <code>format()</code>.  </p>
<p>Here it is:</p>
<p><script src="http://gist.github.com/212206.js"></script></p>
<p>It&#8217;s not perfect and it&#8217;s far from <a href="http://docs.python.org/library/string.html#formatstrings">python&#8217;s full implementation</a>, but it works 98% of the time I want to use something like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2009/10/17/implementing-pythons-string-format-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on Google Wave</title>
		<link>http://www.thirstymind.org/2009/06/05/google-wave/</link>
		<comments>http://www.thirstymind.org/2009/06/05/google-wave/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 13:20:32 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[thinking]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=495</guid>
		<description><![CDATA[If you don&#8217;t know, Google Wave is a new ambitious product from Google that is attempting to change the way we communicate electronically by making Email, IM, document editing, etc&#8230; all realtime and collaborative on a single page in the web browser.  There is an interesting and entertaining video out there that I recommend watching.
And as I watched [...]]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t know, <a title="Google Wave" href="http://wave.google.com">Google Wave</a> is a new ambitious product from Google that is attempting to change the way we communicate electronically by making Email, IM, document editing, etc&#8230; all realtime and collaborative on a single page in the web browser.  There is an <a title="Google Wave" href="http://www.youtube.com/watch?v=v_UyVmITiYQ">interesting and entertaining video</a> out there that I recommend watching.</p>
<p>And as I watched I started to record notes that I was going to publish here, but a bunch has already been said and I&#8217;ve read so much of it, so, I thought I would just hi-light a couple of the more poignant comments that I&#8217;ve read in all the hype from the last week.</p>
<p>My initial gut reaction was, okay cool, Google re-invented Lotus Notes and moved it onto the web for realtime communication and <a title="Joe Gegorio | BitWorking | Wave Protocol Thoughts" href="http://bitworking.org/news/431/wave-first-thoughts">Joe Gregorio addresses this technically with his thoughts in &#8220;Wave Protocol Thoughts&#8221;</a>:</p>
<blockquote><p>Now some people have commented that Wave reminds them of Lotus Notes, and I&#8217;m sure with a little thought you could extend that to Exchange and Groove. The difference is that the extension model with Wave is events over HTTP, which makes it language agnostic, a feature you get when you define things in terms of protocols. That is, as long as you can stand up an HTTP server and parse JSON, you can create robots for Wave, which is a huge leap forward compared to the extension models for Notes, Exchange and Groove&#8230;</p></blockquote>
<p>And speaking of these extensions, the opportunities are endless with an API that allows you to not only write &#8220;robots&#8221; in either Java or Python but host your own server to federate data (a huge enterprise feature).  And I actually thought the most impressive part of the demo was showing off a couple robots:</p>
<ul>
<li>&#8220;Rosy&#8221; a robot that translates text in realtime as you write, and </li>
<li>A spellchecker which also considered context before offering corrections.</li>
</ul>
<p>If this becomes successful in the enterprise there is potentially a very large market of paying customers that want and will need extensions in every discipline from logistics to finance to marketing to manufacturing and beyond, not to mention all the data conversion that will also be needed.</p>
<p>However enterprise adoption and enterprise extensions are still years away.  I think the major and more immediate takeaway from the demo is that it increases expectations in web development.  I personally don&#8217;t believe it is quite as large as say, the way Google Maps changed the web landscape, that was a game changer and I believe Wave is more like a logical next step and <a href="http://ironick.typepad.com/ironick/2009/06/my-2-on-google-wave-www-is-a-unidirectional-web-of-published-documents----wave-is-a-bidirectional-web-of-instant-messages.html">Nick Gall highlights this in &#8220;My 2¢ on Google Wave: WWW is a Unidirectional Web of Published Documents &#8212; Wave is a bidirectional Web of Instant Messages&#8221;</a>:</p>
<blockquote><p>Here are a couple of my major take aways:</p>
<ol>
<li>The Wave client is a major proof of concept (or pilot project) for HTML5. If the wave client becomes a killer app, it will have a major (negative) impact on other RIA architectures.</li>
<li>The Wave protocol is a major proof of concept for the extended use of XMPP. It transforms it from a IM/Presence protocol to a general purpose bidirectional streaming protocol.</li>
<li>Whether or not the Wave client succeeds, Wave is undoubtedly going to have a major impact on how application designers approach web applications. The analogy would be that even if Google Maps had &#8220;failed&#8221; to become the dominant map site/service, it still had major impact on web app design.</li>
</ol>
</blockquote>
<p>There are many passionate opinions on whether Wave will succeed or fail; but one thing is for sure, Google is gently pushing the envelope and therefore developers are expanding their knowledge of HTML5, ES5 and XMPP.  And, whether Google Wave succeeds, I think is irrelevant, because Google has demonstrated a glimpse of the future and when pursued with new technologies, everyone wins.  In that regard, Google Wave is already a success.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2009/06/05/google-wave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1234567890</title>
		<link>http://www.thirstymind.org/2009/02/13/1234567890/</link>
		<comments>http://www.thirstymind.org/2009/02/13/1234567890/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 14:46:36 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=450</guid>
		<description><![CDATA[Running in a terminal today:



#!/bin/bash


while&#40;true&#41; do


&#160; &#160; epoch=`date +%s`


&#160;


&#160; &#160; if &#91; 1234567890 = $epoch &#93;; then


&#160; &#160; &#160; &#160; echo &#39;HAPPY 1234567890 SECOND!&#39;


&#160; &#160; &#160; &#160; exit


&#160; &#160; else


&#160; &#160; &#160; &#160; let delta=1234567890-$epoch


&#160; &#160; &#160; &#160; time_left=`date -u -r $delta +%H:%M:%S`


&#160; &#160; &#160; &#160; echo $time_left


&#160; &#160; &#160; &#160; sleep 1


&#160; &#160; fi


done



Otherpaces [...]]]></description>
			<content:encoded><![CDATA[<p>Running in a terminal today:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="co0">#!/bin/bash</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">while</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span> <span class="kw1">do</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re2">epoch=</span>`<span class="kw2">date</span> +<span class="sy0">%</span>s`</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#91;</span> <span class="nu0">1234567890</span> = <span class="re1">$epoch</span> <span class="br0">&#93;</span>; <span class="kw1">then</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;HAPPY 1234567890 SECOND!&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">exit</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">let</span> <span class="re2">delta=</span><span class="nu0">1234567890</span>-<span class="re1">$epoch</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re2">time_left=</span>`<span class="kw2">date</span> -u -r <span class="re1">$delta</span> +<span class="sy0">%</span>H:<span class="sy0">%</span>M:<span class="sy0">%</span>S`</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="re1">$time_left</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sleep</span> <span class="nu0">1</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">fi</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">done</span></div>
</li>
</ol>
</div>
<p>Otherpaces monitoring the countdown <a href="http://coolepochcountdown.com/">http://coolepochcountdown.com/</a> and <a href="http://www.1234567890day.com/">http://www.1234567890day.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2009/02/13/1234567890/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>They haven&#8217;t paid enough attention</title>
		<link>http://www.thirstymind.org/2009/01/29/they-havent-paid-enough-attention/</link>
		<comments>http://www.thirstymind.org/2009/01/29/they-havent-paid-enough-attention/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 22:19:01 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=434</guid>
		<description><![CDATA[MF Bliki: FlaccidScrum:
What&#8217;s happened is that they haven&#8217;t paid enough attention to the internal quality of their software. If you make that mistake you&#8217;ll soon find your productivity dragged down because it&#8217;s much harder to add new features than you&#8217;d like.
and
I always like to point out that it isn&#8217;t methodologies that succeed or fail, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://martinfowler.com/bliki/FlaccidScrum.html">MF Bliki: FlaccidScrum</a>:</p>
<blockquote><p>What&#8217;s happened is that they haven&#8217;t paid enough attention to the internal quality of their software. If you make that mistake you&#8217;ll soon find your productivity dragged down because it&#8217;s much harder to add new features than you&#8217;d like.</p></blockquote>
<p>and</p>
<blockquote><p>I always like to point out that it isn&#8217;t methodologies that succeed or fail, it&#8217;s teams that succeed or fail.</p></blockquote>
<p>Both are true in everything, not only software developed with Scrum.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2009/01/29/they-havent-paid-enough-attention/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>converting mac plist files from binary to xml</title>
		<link>http://www.thirstymind.org/2009/01/23/converting-mac-plist-files-from-binary-to-xml/</link>
		<comments>http://www.thirstymind.org/2009/01/23/converting-mac-plist-files-from-binary-to-xml/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 15:53:41 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=427</guid>
		<description><![CDATA[If you have Xcode installed there is a nifty tool called plutil to convert plist files from binary to xml and vice versa.
Why do you care? 
Well if you are doing unadvertised things to your plist files you may want to verify the contents, and if its in binary form, then it&#8217;s a little hard [...]]]></description>
			<content:encoded><![CDATA[<p>If you have Xcode installed there is a nifty tool called <code>plutil</code> to convert plist files from binary to xml and vice versa.</p>
<p>Why do you care? </p>
<p>Well if you are doing unadvertised things to your plist files you may want to verify the contents, and if its in binary form, then it&#8217;s a little hard to figure out what is going on.  </p>
<p>So you can convert it to xml with </p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ plutil -convert xml1 path<span class="sy0">/</span>to<span class="sy0">/</span>plist<span class="sy0">/</span><span class="kw2">file</span></div>
</li>
</ol>
</div>
<p>and then to convert back to binary</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ plutil -convert binary1 path<span class="sy0">/</span>to<span class="sy0">/</span>plist<span class="sy0">/</span><span class="kw2">file</span></div>
</li>
</ol>
</div>
<p>In my case, I was setting Mail to use plain text by default</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">$ defaults <span class="kw2">write</span> com.apple.mail PreferPlainText -bool TRUE</div>
</li>
</ol>
</div>
<p>and wanted to verify the change.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2009/01/23/converting-mac-plist-files-from-binary-to-xml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Laptop Security System</title>
		<link>http://www.thirstymind.org/2008/11/24/a-laptop-security-syste/</link>
		<comments>http://www.thirstymind.org/2008/11/24/a-laptop-security-syste/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:28:27 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=423</guid>
		<description><![CDATA[Not sure why, but I&#8217;ve found myself thinking about securing a laptop in a public place.  And I don&#8217;t know, using a cable seems&#8230; uh tacky and more importantly not practical, especially since a small pair of cable cutters could free the laptop in an instant and be done rather discreetly with nobody noticing.
It [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure why, but I&#8217;ve found myself thinking about securing a laptop in a public place.  And I don&#8217;t know, using a cable seems&#8230; uh tacky and more importantly not practical, especially since a small pair of cable cutters could free the laptop in an instant and be done rather discreetly with nobody noticing.</p>
<p>It seems like their should be a simple solution or two to this.  While nothing will stop a determined thief, I would be happy with the following system:</p>
<ol>
<li>Security Software, that when enabled, monitors your laptop for triggered events:</li>
<ul>
<li>motion</li>
<li>keyboard / trackpad</li>
<li>power being removed</li>
<li>lid open/close</li>
</ul>
<li>Your iPhone could be used to enable the security in the following ways</li>
<ul>
<li>a UI interface that allows you to enable/disable/configure</li>
<li>proximity enable, the phone leaves the laptop&#8217;s proximity, auto enable.</li>
</ul>
<li>If an event occurs, the following things should happen</li>
<ul>
<li>notify via iphone, sms and email that an event occurred</li>
<li>take a photo and send with the message</li>
<li>make obnoxious noise</li>
</ul>
<li>The software would continue to do the following until recovered</li>
<ul>
<li>record ip address / hostname / service provider every time internet is accessed</li>
<li>take a photo every 2 minutes.</li>
<li>alert you with these details.</li>
</ul>
<li>5. Provide disk encryption and other miscellaneous features&#8230;</li>
</ol>
<p>The closest thing I have found to this is <a href="http://www.foozoodesign.com/lockdown.html">Lockdown</a>, but there is no integration with the iPhone or SMS, and there appears to be no continued monitoring after the laptop has been stolen.</p>
<p>Surely something better must exist, if not it&#8217;s an opportunity for an out of work engineer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2008/11/24/a-laptop-security-syste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking the Stock Market from the Command Line</title>
		<link>http://www.thirstymind.org/2008/10/08/checking-the-stock-market-from-the-command-line/</link>
		<comments>http://www.thirstymind.org/2008/10/08/checking-the-stock-market-from-the-command-line/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 01:51:57 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[market]]></category>
		<category><![CDATA[stocks]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=402</guid>
		<description><![CDATA[With all the financial trouble in the country I have been checking the market a lot lately, and I find it a little annoying to constantly switch to my web browser and refresh or check my dashboard or whatever.  Since I spend a lot of time in a terminal, I put a function together, [...]]]></description>
			<content:encoded><![CDATA[<p>With all the financial trouble in the country I have been checking the market a lot lately, and I find it a little annoying to constantly switch to my web browser and refresh or check my dashboard or whatever.  Since I spend a lot of time in a terminal, I put a function together, which will always display the latest market conditions for the Dow Jones Industrial Average, the Nasdaq and the S&#038;P 500 as well as any stocks you feed the function.</p>
<p>For example:</p>
<div class="geshi no term">
<ol>
<li class="li1">
<div class="de1">$ market
</div>
</li>
<li class="li1">
<div class="de1">Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Price &nbsp; &nbsp; Change &nbsp; Pct &nbsp; &nbsp; Day Lo &nbsp; &nbsp;Day Hi &nbsp;
</div>
</li>
<li class="li1">
<div class="de1">Dow Jones Industr &nbsp; &nbsp; &nbsp;9258.10 &nbsp;-189.01 &nbsp;-2.00% &nbsp; 9194.78 &nbsp; 9628.07
</div>
</li>
<li class="li1">
<div class="de1">NASDAQ COMPOSITE &nbsp; &nbsp; &nbsp; 1740.33 &nbsp; -14.55 &nbsp;-0.83% &nbsp; 1706.86 &nbsp; 1806.89
</div>
</li>
<li class="li1">
<div class="de1">S&amp;P 500 INDEX,RTH &nbsp; &nbsp; &nbsp; 984.94 &nbsp; -11.29 &nbsp;-1.13% &nbsp; &nbsp;970.97 &nbsp; 1021.06</div>
</li>
</ol>
</div>
<p>or</p>
<div class="geshi no term">
<ol>
<li class="li1">
<div class="de1">$ market GE XOM
</div>
</li>
<li class="li1">
<div class="de1">Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Price &nbsp; &nbsp; Change &nbsp; Pct &nbsp; &nbsp; Day Lo &nbsp; &nbsp;Day Hi &nbsp;
</div>
</li>
<li class="li1">
<div class="de1">Dow Jones Industr &nbsp; &nbsp; &nbsp;9258.10 &nbsp;-189.01 &nbsp;-2.00% &nbsp; 9194.78 &nbsp; 9628.07
</div>
</li>
<li class="li1">
<div class="de1">NASDAQ COMPOSITE &nbsp; &nbsp; &nbsp; 1740.33 &nbsp; -14.55 &nbsp;-0.83% &nbsp; 1706.86 &nbsp; 1806.89
</div>
</li>
<li class="li1">
<div class="de1">S&amp;P 500 INDEX,RTH &nbsp; &nbsp; &nbsp; 984.94 &nbsp; -11.29 &nbsp;-1.13% &nbsp; &nbsp;970.97 &nbsp; 1021.06
</div>
</li>
<li class="li1">
<div class="de1">GEN ELECTRIC CO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;20.65 &nbsp; &nbsp; 0.35 &nbsp;+1.72% &nbsp; &nbsp; 19.90 &nbsp; &nbsp; 21.99
</div>
</li>
<li class="li1">
<div class="de1">EXXON MOBIL CP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 77.00 &nbsp; &nbsp; 0.93 &nbsp;+1.22% &nbsp; &nbsp; 74.00 &nbsp; &nbsp; 79.39</div>
</li>
</ol>
</div>
<p>The key to making this work is a csv generated by a http request to Yahoo.  The request takes 2 arguments, the stocks and a string of tags.</p>
<p>For Example:<br />
<a href="http://download.finance.yahoo.com/d/quotes.csv?s=^DJI+GE&#038;f=nk1k2m2">http://download.finance.yahoo.com/d/quotes.csv?s=^DJI+GE&#038;f=nk1k2m2</a></p>
<p>Which says grab the name, last trade price, change percent, and the days range (all real time) for all the stocks defined by s.  There is a whole slew of tags that you can grab, the best resource of this information that I found is located at <a href="http://www.gummy-stuff.org/Yahoo-data.htm">Gummy Stuff&#8217;s Yahoo Data page</a>.</p>
<p>After some magic with sed and awk you get the above result.</p>
<p>And finally Here is the code, if anyone wants to add it to their bash profile.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">function</span> market <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="re2">stocks=</span><span class="st0">&quot;^DJI+^IXIC+^GSPC&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span> arg <span class="kw1">in</span> <span class="st0">&quot;$@&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">do</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; stocks+=<span class="st0">&quot;+${arg}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">done</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># Note the sed commands below do the following:</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># &nbsp; 1. Strip any html</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># &nbsp; 2. Replace the &#39;&quot;,&quot;&#39; delimeter with a #</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># &nbsp; 3. Replace the &#39; &#8211; &#39; delimeter with a #</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># &nbsp; 4. Strip the leading and trailing &quot; characters</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co0"># The awk command does some pretty printing on each record with # used for a delimeter</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; curl -s <span class="st0">&quot;http://download.finance.yahoo.com/d/quotes.csv?s=$stocks&amp;f=nk1k2m2&quot;</span> <span class="sy0">|</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">sed</span> <span class="st0">&#39;s/&lt; [^&gt;]*&gt;//g&#39;</span> <span class="sy0">|</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">sed</span> <span class="st0">&#39;s/&quot;,&quot;/#/g&#39;</span> <span class="sy0">|</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">sed</span> <span class="st0">&#39;s/ &#8211; /#/g&#39;</span> <span class="sy0">|</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">sed</span> <span class="st0">&#39;s/&quot;<span class="es0">\(</span>.*<span class="es0">\)</span>&quot;/<span class="es0">\1</span>/&#39;</span> <span class="sy0">|</span> \</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">awk</span> <span class="st0">&#39;BEGIN{FS=&quot;#&quot;; printf(&quot;%-20s &nbsp;%-8s &nbsp;%-7s &nbsp;%-6s &nbsp;%-8s &nbsp;%-9s<span class="es0">\n</span>&quot;, &quot;Name&quot;, &quot;Price&quot;, &quot;Change&quot;, &quot;Pct&quot;, &quot;Day Lo&quot;, &quot;Day Hi&quot;)} { printf(&quot;%-20s &nbsp;%8s &nbsp;%7s &nbsp;%6s &nbsp;%8s &nbsp;%9s<span class="es0">\n</span>&quot;, $1, $3, $4, $5, $6, $7) }&#39;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>I think some of the sed commands could be improved to reduce the number of them, but this is simple and works.  So I&#8217;m happy for now, or would be if I started see some numbers from the economy that looked better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2008/10/08/checking-the-stock-market-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Frank Lloyd Wright: The Mike Wallace Interview</title>
		<link>http://www.thirstymind.org/2008/09/29/frank-lloyd-wright-the-mike-wallace-interview/</link>
		<comments>http://www.thirstymind.org/2008/09/29/frank-lloyd-wright-the-mike-wallace-interview/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 01:00:35 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=400</guid>
		<description><![CDATA[Frank Lloyd Wright: The Mike Wallace Interview:
I&#8217;ve watched this interview twice now, I think it is a brilliant look at FLW, covering his social beliefs more so than architecture.  If you have just over an hour, do yourself a favor and watch it.
Also, why doesn&#8217;t the media today interview people the way Mike Wallace [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hrc.utexas.edu/multimedia/video/2008/wallace/wright_frank_lloyd.html">Frank Lloyd Wright: The Mike Wallace Interview</a>:<br />
I&#8217;ve watched this interview twice now, I think it is a brilliant look at FLW, covering his social beliefs more so than architecture.  If you have just over an hour, do yourself a favor and watch it.</p>
<p>Also, why doesn&#8217;t the media today interview people the way Mike Wallace interviewd FLW?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2008/09/29/frank-lloyd-wright-the-mike-wallace-interview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reflection &amp; Resignation</title>
		<link>http://www.thirstymind.org/2008/09/29/reflection-resignation/</link>
		<comments>http://www.thirstymind.org/2008/09/29/reflection-resignation/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 00:33:56 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[california]]></category>
		<category><![CDATA[career]]></category>
		<category><![CDATA[csc]]></category>
		<category><![CDATA[ohio]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[unemployment]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=391</guid>
		<description><![CDATA[If you haven&#8217;t heard Friday, September 26th, was my last day of employment, which ended 1 year, 5 months and 3 weeks at CSC.  The following are some random reflections and thoughts about my life and career.
What&#8217;s Next &#8211; I Honestly don&#8217;t know and am perfectly fine not knowing.  My career stalled during [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t heard Friday, September 26th, was my last day of employment, which ended 1 year, 5 months and 3 weeks at CSC.  The following are some random reflections and thoughts about my life and career.</p>
<p><strong>What&#8217;s Next</strong> &#8211; I Honestly don&#8217;t know and am perfectly fine not knowing.  My career stalled during my time at CSC, I don&#8217;t know why exactly and while I do have some strong thoughts about it I&#8217;m not prepared to elaborate in detail at this time.  However, I do know I need a change and it&#8217;s time to head a different direction.</p>
<p><strong>NGC</strong> &#8211; My career started fast and I&#8217;d like to think very successfully at TRW/Northrop Grumman and there are a couple lessons/ideas that I often think about regarding my time there.  </p>
<ol>
<li>I built a solid name for myself there and had total say in what I wanted to do, by in large I had escaped the corporate bureaucracy and wholly controlled my own destiny.  I greatly underestimated this benefit prior to my departure there.</li>
<li>6 months or so prior to my departure I was offered a position that would have made me responsible for a nice chunk of revenue.  I turned it down for many reasons, but the thing I did not really consider was how much the people who offered me the position believed in me.  I regret not believing more in those who believed in me.</li>
</ol>
<p><strong>Commoditizing Software Development</strong> &#8211; During my brief time at CSC, it became apparent that Corporate America (or at least CSCs clients) is interested in commoditizing software development, and doing it through offshore resources in India.  Personally I don&#8217;t believe it can be commoditized and doing so is a losing business strategy because not only does the quality of software suffer, but the &#8220;business&#8221; also suffers.  If the work can be done in India for cheaper, so be it, but in my experience the quality is so bad, it is not worth the cost savings.</p>
<p><strong>Fitness</strong> &#8211; I spent my 20s way overweight, I guess obese is the proper term.  In the last 15 months I&#8217;ve lost 75lbs or so, others seems to notice the physical change.  But, honestly I don&#8217;t so much.  However, I do notice a mental change, and it is a huge one.  It&#8217;s a major differentiator in why I am not nervous about being unemployed, I KNOW I am talented and I KNOW I will figure something out and be successful.</p>
<p><strong>California/Ohio</strong> &#8211; I think it is safe to say while some good things have come of me moving back to Ohio, I wouldn&#8217;t be one bit surprised if I end up back in California, in fact I&#8217;d probably me more surprised if I didn&#8217;t. I miss it a lot, not sure if I&#8217;ll go back to SoCal or look for something new  somewhere in the SF Bay area.  Time will tell.</p>
<p><strong>Python</strong> &#8211; I spent some time earlier this summer introducing myself to python.  As I have said before something about python just seems right, and now that I have unlimited free time, I&#8217;m going to use it to hack some of my ideas together.  I may also explore Scala.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2008/09/29/reflection-resignation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What election?</title>
		<link>http://www.thirstymind.org/2008/09/06/what-election/</link>
		<comments>http://www.thirstymind.org/2008/09/06/what-election/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 14:40:43 +0000</pubDate>
		<dc:creator>Andrew Watts</dc:creator>
				<category><![CDATA[tumble]]></category>

		<guid isPermaLink="false">http://www.thirstymind.org/?p=388</guid>
		<description><![CDATA[What election?:
The thing about Palin is that, disagree with her as I do on so much, I also think she’s kind of bad ass.
Summing up Palin fairly well I think.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jackiedanicki.com/http:/www.jackiedanicki.com/what-election">What election?</a>:</p>
<blockquote><p>The thing about Palin is that, disagree with her as I do on so much, I also think she’s kind of bad ass.</p></blockquote>
<p>Summing up Palin fairly well I think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thirstymind.org/2008/09/06/what-election/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
