<?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>emtek.net.nz</title>
	<atom:link href="http://www.emtek.net.nz/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emtek.net.nz/blog</link>
	<description></description>
	<lastBuildDate>Fri, 22 Jan 2010 08:30:25 +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 print_r or var_dump</title>
		<link>http://www.emtek.net.nz/blog/2010/01/22/python-print_r-or-var_dump/</link>
		<comments>http://www.emtek.net.nz/blog/2010/01/22/python-print_r-or-var_dump/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 08:30:25 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=142</guid>
		<description><![CDATA[If you&#8217;re coming from PHP, you may be wondering how to do a print_r or var_dump.
import pprint
pprint.pprint(myobj)

]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re coming from PHP, you may be wondering how to do a print_r or var_dump.</p>
<p>import pprint<br />
pprint.pprint(myobj)</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2010/01/22/python-print_r-or-var_dump/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix loud or stiff space-bar Microsoft Ergonomic Keyboard 4000</title>
		<link>http://www.emtek.net.nz/blog/2009/12/27/fix-loud-or-stiff-space-bar-microsoft-ergonomic-keyboard-4000/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/27/fix-loud-or-stiff-space-bar-microsoft-ergonomic-keyboard-4000/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 04:11:56 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=135</guid>
		<description><![CDATA[The Microsoft Natural Ergonomic Keyboard 4000 is an excellent product, no other keyboard really comes close to it for touch typing in my opinion.
However there can be one very annoying bit &#8211; the spacebar.  It can be excessively loud and/or stiff to press.  Fortunately though you can easily fix it yourself!
Loudness:
The problem is that the [...]]]></description>
			<content:encoded><![CDATA[<p>The Microsoft Natural Ergonomic Keyboard 4000 is an excellent product, no other keyboard really comes close to it for touch typing in my opinion.</p>
<p>However there can be one very annoying bit &#8211; the spacebar.  It can be excessively loud and/or stiff to press.  Fortunately though you can easily fix it yourself!</p>
<h2>Loudness:</h2>
<p>The problem is that the bottom of the plastic space bar connects with some plastic on the keyboard base.  To fix this you&#8217;ll want to add some cushioning to the base of the keyboard which you&#8217;ll find easy to do yourself.</p>
<p>First of all, you need to pull the spacebar off the keyboard, which is easiest if you pull from the top.  You&#8217;ll need to use a bit of force, though don&#8217;t worry your keyboard will be ok <img src='http://www.emtek.net.nz/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  Once the space bar is off you can put in your cushioning.  The image below shows where you&#8217;ll be attaching your cushions.</p>
<p><img class="alignnone size-full wp-image-136" title="base-bits" src="http://www.emtek.net.nz/blog/wp-content/uploads/2009/12/base-bits.jpg" alt="base-bits" width="400" height="300" /></p>
<p>I made my cushions from inexpensive heat-shrink tubing filled with some cotton wool and attached it to the keyboard with some double-sided tape, though you could easily substitute this with whatever else you have around, just as long as it is nice and squishy.  The image below show what it should it looks likes with one of the cushions.</p>
<p><img class="alignnone size-full wp-image-137" title="cushion" src="http://www.emtek.net.nz/blog/wp-content/uploads/2009/12/cushion.jpg" alt="cushion" width="400" height="300" /></p>
<p>Once the cushioning is in, remount the space bar and you should be good to go!</p>
<h2>Stiffness:</h2>
<p>The space-bar can sometimes be stiff to press, particularly on its side-edges.  The stiffness will usually go away after a period of normal use, though you can speed this natural process up a bit by simply tapping it a couple of thousand times where your thumbs normally press it.  For me this spot is underneath the &#8216;V&#8217; key on the left and about halfway across the &#8216;N&#8217; key on the right.  Just sit there and tap these spots really fast for several minutes.  You can also try pressing  with very little pressure in order to get the key to stick, and then apply more pressure so that it rubs really hard inside the keyboard.  Press on the top corners of the space bar to get even more resistance.</p>
<p>If this doesn&#8217;t work, this you&#8217;ve basically got a dud that will only frustrate you, so return it to the shop and get another one!</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/27/fix-loud-or-stiff-space-bar-microsoft-ergonomic-keyboard-4000/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl in_array()</title>
		<link>http://www.emtek.net.nz/blog/2009/12/17/perl-in_array/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/17/perl-in_array/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:29:39 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=133</guid>
		<description><![CDATA[Perl can use the grep function as the equivalent of PHP&#8217;s in_array() function.  Essentially
$found = grep $_ eq $my_value, @my_array
Note, the grep() function is world unto its own, it can do quite a bit more than just this.  $found is actually $my_value if it finds it, which tends to evaluate to &#8216;True&#8217; in Perl.
You can [...]]]></description>
			<content:encoded><![CDATA[<p>Perl can use the grep function as the equivalent of PHP&#8217;s in_array() function.  Essentially</p>
<p>$found = grep $_ eq $my_value, @my_array</p>
<p>Note, the grep() function is world unto its own, it can do quite a bit more than just this.  $found is actually $my_value if it finds it, which tends to evaluate to &#8216;True&#8217; in Perl.</p>
<p>You can view more PHP-Perl statements <a href="/language-reference">here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/17/perl-in_array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python in_array()</title>
		<link>http://www.emtek.net.nz/blog/2009/12/17/python-in_array/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/17/python-in_array/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:26:33 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=131</guid>
		<description><![CDATA[Python uses the &#8220;in&#8221; statement as the equivalent to PHP&#8217;s in_array()
my_boolean = my_value in my_list
You can view more PHP-Python statements here.

]]></description>
			<content:encoded><![CDATA[<p>Python uses the &#8220;in&#8221; statement as the equivalent to PHP&#8217;s in_array()</p>
<p>my_boolean = my_value in my_list</p>
<p>You can view more PHP-Python statements <a href="/language-reference">here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/17/python-in_array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python str_replace()</title>
		<link>http://www.emtek.net.nz/blog/2009/12/17/python-str_replace/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/17/python-str_replace/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:20:43 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=127</guid>
		<description><![CDATA[Python uses a function on the str/unicode object instead of a standalone function
new_s = s.replace(match, replacement)
You can view more PHP-Python statements here.

]]></description>
			<content:encoded><![CDATA[<p>Python uses a function on the str/unicode object instead of a standalone function</p>
<p>new_s = s.replace(match, replacement)</p>
<p>You can view more PHP-Python statements <a href="/language-reference">here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/17/python-str_replace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python sprintf()</title>
		<link>http://www.emtek.net.nz/blog/2009/12/17/python-sprintf/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/17/python-sprintf/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 22:18:32 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=125</guid>
		<description><![CDATA[Python uses the % operator to do a sprintf() function.
&#8220;The %s brown %s&#8221; % (&#8220;quick&#8221;, &#8220;fox&#8221;)
Brackets can be omitted if there for single arguments
&#8220;The %s brown fox&#8221; % &#8220;fast&#8221;
You can view more PHP-Python statements here.

]]></description>
			<content:encoded><![CDATA[<p>Python uses the % operator to do a sprintf() function.</p>
<p>&#8220;The %s brown %s&#8221; % (&#8220;quick&#8221;, &#8220;fox&#8221;)</p>
<p>Brackets can be omitted if there for single arguments</p>
<p>&#8220;The %s brown fox&#8221; % &#8220;fast&#8221;</p>
<p>You can view more PHP-Python statements <a href="/language-reference">here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/17/python-sprintf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python error/exception handling</title>
		<link>http://www.emtek.net.nz/blog/2009/12/09/python-errorexception-handling/</link>
		<comments>http://www.emtek.net.nz/blog/2009/12/09/python-errorexception-handling/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 05:19:01 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/?p=115</guid>
		<description><![CDATA[This code quickly shows how to do basic error handling in python
try:
  # None + 1
  raise ZeroDivisionError
except ZeroDivisionError:
  print 'You cannot divide by zero!'
except:
  print sys.exc_info()[0]
else:
 print 'No errors raised'
finally:
 print 'Run Clean up actions'

]]></description>
			<content:encoded><![CDATA[<p>This code quickly shows how to do basic error handling in python</p>
<pre>try:
  # None + 1
  raise ZeroDivisionError
except ZeroDivisionError:
  print 'You cannot divide by zero!'
except:
  print sys.exc_info()[0]
else:
 print 'No errors raised'
finally:
 print 'Run Clean up actions'</pre>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/12/09/python-errorexception-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash ActionScript 3.0 &#8211; TextField buttonMode</title>
		<link>http://www.emtek.net.nz/blog/2009/11/17/flash-actionscript-3-0-textfield-buttonmode/</link>
		<comments>http://www.emtek.net.nz/blog/2009/11/17/flash-actionscript-3-0-textfield-buttonmode/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 18:24:49 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.emtek.net.nz/blog/2009/11/17/flash-actionscript-3-0-textfield-buttonmode/</guid>
		<description><![CDATA[Normally you use Sprite.buttonMode = true.  Mousing over a TextFields brings up a potentially annoying caret. To get the buttonMode working on a TextField, place the TextField into a Sprite and:
Sprite.buttonMode = true;
Sprite.mouseChildren = false;

]]></description>
			<content:encoded><![CDATA[<p>Normally you use Sprite.buttonMode = true.  Mousing over a TextFields brings up a potentially annoying caret. To get the buttonMode working on a TextField, place the TextField into a Sprite and:</p>
<p>Sprite.buttonMode = true;<br />
Sprite.mouseChildren = false;</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/11/17/flash-actionscript-3-0-textfield-buttonmode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; array_map + create_function</title>
		<link>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/</link>
		<comments>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 21:59:12 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/blog/?p=77</guid>
		<description><![CDATA[For use with php < 5.3.  If you're using 5.3 just use a proper anonymous function.
array_map(create_function(&#8216;$v&#8217;, &#8216;return strtolower($v).&#8221;s&#8221;;&#8217;), $a);

]]></description>
			<content:encoded><![CDATA[<p>For use with php < 5.3.  If you're using 5.3 just use a proper anonymous function.</p>
<p><code>array_map(create_function(&#8216;$v&#8217;, &#8216;return strtolower($v).&#8221;s&#8221;;&#8217;), $a);</code></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/09/20/php-array_map-create_function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python eval</title>
		<link>http://www.emtek.net.nz/blog/2009/09/07/python-eval/</link>
		<comments>http://www.emtek.net.nz/blog/2009/09/07/python-eval/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 05:08:11 +0000</pubDate>
		<dc:creator>Steve Boyd</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://emtek.net.nz/blog/?p=72</guid>
		<description><![CDATA[Generally, just use &#8216;exec&#8217; statement instead of the &#8216;eval&#8217; function
v = 1
exec 'v = 2'
print v
Python eval is a function meaning it doesn&#8217;t allow setting of variables.  Usage is:
x = 1
print eval(&#8216;x+1&#8242;)

]]></description>
			<content:encoded><![CDATA[<p>Generally, just use &#8216;exec&#8217; statement instead of the &#8216;eval&#8217; function</p>
<p><code>v = 1<br />
exec 'v = 2'<br />
print v</code></p>
<p>Python eval is a function meaning it doesn&#8217;t allow setting of variables.  Usage is:<br />
x = 1<br />
print eval(&#8216;x+1&#8242;)</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://www.emtek.net.nz/blog/2009/09/07/python-eval/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
