<?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>Gray&#039;s blog &#187; updates</title>
	<atom:link href="http://graysblog.org/tag/updates/feed/" rel="self" type="application/rss+xml" />
	<link>http://graysblog.org</link>
	<description>Web Developer, Platform Coder, Coding Samurai, Person.</description>
	<lastBuildDate>Sat, 31 Jul 2010 08:54:29 +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>Python</title>
		<link>http://graysblog.org/2009/08/30/python/</link>
		<comments>http://graysblog.org/2009/08/30/python/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 06:09:23 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://graysblog.org/?p=224</guid>
		<description><![CDATA[Alright so it&#8217;s been a while since I posted anything and I wanted to put something out there, while I have been working a lot on many projects I couldn&#8217;t really speak of, I have a few quick things to update you on before I get on to the main content:
First thing, the staff of [...]]]></description>
			<content:encoded><![CDATA[<p>Alright so it&#8217;s been a while since I posted anything and I wanted to put something out there, while I have been working a lot on many projects I couldn&#8217;t really speak of, I have a few quick things to update you on before I get on to the main content:</p>
<p>First thing, the staff of Opensock have acquired MMOCCForum, this is pretty exciting and we are going to help get that place in shape.<br />
Second, Axcid.org has had a complete rewrite of it&#8217;s API, now including keyword search. <a href="http://tunebin.info">http://tunebin.info/</a> does a great job showing this.</p>
<p>Alright now onto the main content of the post:</p>
<p>After hating python and it&#8217;s syntax for a few years, I got the push of actually LEARNING the language, including some of it&#8217;s many libraries and functions. Once you get used to it, the syntax isn&#8217;t too bad actually. It&#8217;s actually pretty easy, for example:</p>
<pre>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="kw1">import</span> system, <span class="kw3">string</span>

<span class="st0">&quot;&quot;&quot; Python block style comments &quot;&quot;&quot;</span>
<span class="co1"># Python one line bash-style comments</span>

<span class="co1"># Rather then braces for syntax blocking, python uses whitespace</span>

<span class="co1">#Functions in python must be declared before use, unlike in javascript.</span>

<span class="co1"># The Syntax for this is def</span>

<span class="co1"># e.g.</span>

<span class="kw1">def</span> SayHello<span class="br0">&#40;</span>text<span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># This is the body of the function</span>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span><span class="br0">&#40;</span>text<span class="br0">&#41;</span>

<span class="co1"># Say Hello would be considered a 'function alias', and would be used like this:</span>

SayHello<span class="br0">&#40;</span><span class="st0">&quot;test&quot;</span><span class="br0">&#41;</span>

<span class="co1"># Some built in python functions</span>
<span class="kw3">string</span> = <span class="st0">&quot;123&quot;</span> <span class="co1"># set a variable</span>
integer = <span class="kw2">int</span><span class="br0">&#40;</span><span class="kw3">string</span><span class="br0">&#41;</span> <span class="co1"># Convert string to integer</span>
<span class="kw3">string</span> = <span class="kw2">str</span><span class="br0">&#40;</span>integer<span class="br0">&#41;</span> <span class="co1"># Convert integer to string</span>

<span class="co1"># And block statements use : to start the block, e.g.</span>

<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">string</span> = <span class="kw2">str</span><span class="br0">&#40;</span>integer<span class="br0">&#41;</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; SayHello<span class="br0">&#40;</span><span class="kw2">str</span><span class="br0">&#40;</span>integer<span class="br0">&#41;</span><span class="br0">&#41;</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Else if is elif</span>
&nbsp; &nbsp; &nbsp; &nbsp; 
<span class="kw1">elif</span> <span class="br0">&#40;</span><span class="kw3">string</span> = <span class="kw2">int</span><span class="br0">&#40;</span><span class="kw3">string</span><span class="br0">&#41;</span><span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; SayHello<span class="br0">&#40;</span><span class="st0">&quot;Oh..&quot;</span><span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1"># Not gonna reach this</span>

<span class="kw1">else</span>:
&nbsp; &nbsp; &nbsp; &nbsp; SayHello<span class="br0">&#40;</span><span class="st0">&quot;Else reached, so none of them was correct&quot;</span><span class="br0">&#41;</span></div>
</div>
</pre>
<p>Just for an example of python, Axcid&#8217;s new JSON api can be used like this:</p>
<pre>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;"><span class="co1"># axcid</span>
<span class="kw1">import</span> <span class="kw3">sys</span>, <span class="kw3">string</span>, <span class="kw3">urllib</span>
<span class="kw1">import</span> simplejson <span class="kw1">as</span> json

AXCID_URL=<span class="st0">&quot;http://two.axcid.org/new/api/?method=search.keyword&amp;format=json&amp;allpages=1&amp;q=&quot;</span>

<span class="kw1">def</span> GetResults<span class="br0">&#40;</span>query<span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; query = query.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&quot; &quot;</span>, <span class="st0">&quot;%20&quot;</span><span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; url = AXCID_URL+query
&nbsp; &nbsp; &nbsp; &nbsp; f = <span class="kw3">urllib</span>.<span class="me1">urlopen</span><span class="br0">&#40;</span>url<span class="br0">&#41;</span>
&nbsp; &nbsp; &nbsp; &nbsp; obj = json.<span class="me1">load</span><span class="br0">&#40;</span>f<span class="br0">&#41;</span>

&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span><span class="br0">&#40;</span>obj<span class="br0">&#91;</span><span class="st0">&quot;track&quot;</span><span class="br0">&#93;</span><span class="br0">&#41;</span></div>
</div>
</pre>
<p>And the result from that:</p>
<pre>
<div class="codesnip-container" >
<div class="python codesnip" style="font-family:monospace;">results = GetResults<span class="br0">&#40;</span><span class="st0">&quot;sublime&quot;</span><span class="br0">&#41;</span>

<span class="kw1">if</span> <span class="br0">&#40;</span>results<span class="br0">&#41;</span>:
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> track <span class="kw1">in</span> results:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span><span class="br0">&#40;</span>track<span class="br0">&#91;</span><span class="st0">&quot;title&quot;</span><span class="br0">&#93;</span>+<span class="st0">&quot; - &quot;</span> + track<span class="br0">&#91;</span><span class="st0">&quot;artist&quot;</span><span class="br0">&#93;</span></div>
</div>
</pre>
<p>Writing a IRC bot in python the other day was simple as well. And a python-spidermonkey binding exists so it would be possible to bind the syntax of JS to python, <a href="http://github.com/davisp/python-spidermonkey/tree/master">Python-Spidermoney</a></p>
<p>Anyways, that&#8217;s all for my update. Hope it was useful to someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://graysblog.org/2009/08/30/python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updates on TapShirt, imgBox and Axcid!</title>
		<link>http://graysblog.org/2009/01/12/updates-on-tapshirt-imgbox-and-axcid/</link>
		<comments>http://graysblog.org/2009/01/12/updates-on-tapshirt-imgbox-and-axcid/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 00:46:32 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[axcid]]></category>
		<category><![CDATA[ego]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[imgbox]]></category>
		<category><![CDATA[tapshirt]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://graysblog.org/?p=44</guid>
		<description><![CDATA[Well, some people may think I am starting a lot of projects. But the good news is I have people to help and the more projects the better the chance a couple will turn up the cash flow! As for TapShirt, a layout design is in the works. The EGO Framework is being created to [...]]]></description>
			<content:encoded><![CDATA[<p>Well, some people may think I am starting a lot of projects. But the good news is I have people to help and the more projects the better the chance a couple will turn up the cash flow! As for TapShirt, a layout design is in the works. The EGO Framework is being created to drive these sites and work will go full steam ahead on that when new laptop arrives. imgBox will be completely rewritten using the EGO Framework.</p>
<p>Axcid Updates deserve a second paragraph, as that&#8217;s a big project. After some refinement to the Mac version of the software &amp; the Windows version we will be slowly proceeding into public release of our Lite version. Beginning marketing plans, and completion of the full version of the software, &#8216;Axcid &#8211; Social Music Sharing&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://graysblog.org/2009/01/12/updates-on-tapshirt-imgbox-and-axcid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>morning updates.</title>
		<link>http://graysblog.org/2009/01/06/morning-updates/</link>
		<comments>http://graysblog.org/2009/01/06/morning-updates/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 08:55:36 +0000</pubDate>
		<dc:creator>Gray</dc:creator>
				<category><![CDATA[Archived]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[disco]]></category>
		<category><![CDATA[hostkiwi]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[morning]]></category>
		<category><![CDATA[schedule]]></category>
		<category><![CDATA[truant tower]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://graysblog.org/?p=5</guid>
		<description><![CDATA[Since I will be busy most of today, I can give out some updates:
my current schedule:
-hair dye
-fix ipod
-HostKiwi layout http://graymatter.hostkiwi.co.uk/hostkiwi%20copy.png needs to get finished.
-Theme blog.. Somebody help PLEASE D:.
-Work on clients I was making.
-she know&#8217;s who she is&#8217;s homework.. lol
I&#8217;m gonna be out pretty much all day today so my cell will be the only [...]]]></description>
			<content:encoded><![CDATA[<p>Since I will be busy most of today, I can give out some updates:</p>
<p>my current schedule:<br />
-hair dye</p>
<p>-fix ipod</p>
<p>-HostKiwi layout <a title="HostKiwi Layout" href="http://graymatter.hostkiwi.co.uk/hostkiwi%20copy.png">http://graymatter.hostkiwi.co.uk/hostkiwi%20copy.png</a> needs to get finished.</p>
<p>-Theme blog.. Somebody help PLEASE D:.</p>
<p>-Work on clients I was making.</p>
<p>-she know&#8217;s who she is&#8217;s homework.. lol</p>
<p>I&#8217;m gonna be out pretty much all day today so my cell will be the only way to reach me.</p>
<p>For HostKiwi updates I have all the hosting plans drawn up http://graymatter.hostkiwi.co.uk/stem.txt .. They are in the text file. I was playing with the original truant tower client and put it up earlier: <a title="Truant Tower" href="http://graymatter.hostkiwi.co.uk/trippin.png">http://graymatter.hostkiwi.co.uk/trippin.png</a></p>
<p>And on the request of somebody, the disco server project is slowly starting again:</p>
<p><a title="Disco Server" href="http://graymatter.hostkiwi.co.uk/site/disco/">http://graymatter.hostkiwi.co.uk/site/disco/</a></p>
<p>as always, recommend everybody visit:</p>
<p>imcedev.com and retrohotel.cn , a couple cool new sites and</p>
<p>axcid.org &amp; m.axcid.org <img src='http://graysblog.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Laters.</p>
]]></content:encoded>
			<wfw:commentRss>http://graysblog.org/2009/01/06/morning-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
