<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Gahooa Perspective &#187; Technique</title>
	<atom:link href="http://blog.gahooa.com/category/technique/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gahooa.com</link>
	<description>Thoughts on Life, Engineering, Technology, Business, and more...</description>
	<lastBuildDate>Fri, 23 Jul 2010 07:09:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.gahooa.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/167b7031b951e9f11655a8ef27c12d71?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Gahooa Perspective &#187; Technique</title>
		<link>http://blog.gahooa.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.gahooa.com/osd.xml" title="The Gahooa Perspective" />
	<atom:link rel='hub' href='http://blog.gahooa.com/?pushpress=hub'/>
		<item>
		<title>How to checkout and track a remote git branch</title>
		<link>http://blog.gahooa.com/2010/07/09/how-to-checkout-and-track-a-remote-git-branch/</link>
		<comments>http://blog.gahooa.com/2010/07/09/how-to-checkout-and-track-a-remote-git-branch/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 18:16:08 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git branch]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=239</guid>
		<description><![CDATA[One of those really handy things to remember&#8230;  When git &#8220;tracks&#8221; a branch, it basically sets up an entry in .git/config which tells git what to do with push and pull.  For example: I had a remote branch called Task/Round3.3. I wanted to work on it locally, but have push and pull work right. So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=239&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>One of those really handy things to remember&#8230;  When git &#8220;tracks&#8221; a branch, it basically sets up an entry in .git/config which tells git what to do with push and pull.  For example:</p>
<p>I had a remote branch called Task/Round3.3.</p>
<p><strong>I wanted to work on it locally, but have push and pull work right.</strong></p>
<p>So I ran this:</p>
<pre><span style="color:#0000ff;">git checkout -b Task/Round3.3 --track origin/Task/Round3.3</span></pre>
<p>To which git said:</p>
<pre><span style="color:#0000ff;">Branch Task/Round3.3 set up to track remote branch refs/remotes/origin/Task/Round3.3.
Switched to a new branch "Task/Round3.3"</span></pre>
<p>And in .git/config, these lines were added:</p>
<pre><span style="color:#0000ff;">[branch "Task/Round3.3"]
remote = origin
merge = refs/heads/Task/Round3.3</span></pre>
<p>Now, when I checkout Task/Round3.3, I am able to say `git pull` and `git push`, and it will do the &#8220;right thing&#8221;&#8230;</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/git/'>git</a>, <a href='http://blog.gahooa.com/tag/git-branch/'>git branch</a>, <a href='http://blog.gahooa.com/tag/version-control/'>version control</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=239&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/07/09/how-to-checkout-and-track-a-remote-git-branch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL, PostgreSQL, Oracle, SQL Server &#8212; Order by RAND ?</title>
		<link>http://blog.gahooa.com/2010/07/08/mysql-postgresql-oracle-sql-server-order-by-rand/</link>
		<comments>http://blog.gahooa.com/2010/07/08/mysql-postgresql-oracle-sql-server-order-by-rand/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 16:40:54 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Random Records]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=236</guid>
		<description><![CDATA[Great howto on grabbing a selection of random records from a few different databases here: http://www.petefreitag.com/item/466.cfm Tagged: Database, Random Records<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=236&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Great howto on grabbing a selection of random records from a few different databases here:</p>
<p><a href="http://www.petefreitag.com/item/466.cfm">http://www.petefreitag.com/item/466.cfm</a></p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/database/'>Database</a>, <a href='http://blog.gahooa.com/tag/random-records/'>Random Records</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=236&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/07/08/mysql-postgresql-oracle-sql-server-order-by-rand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Post-Install tips&#8230;</title>
		<link>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/</link>
		<comments>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 21:10:51 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Partner Repositories]]></category>
		<category><![CDATA[Ubuntu Setup]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=231</guid>
		<description><![CDATA[I received this from a friend, and thought I would post it here in case anyone would find it useful. After Installing Ubuntu, basically I do this: Go to: System -&#62; Administration -&#62; Software Sources -&#62; Other Sofware, and enable partner repository. After that, we can this on a Terminal: sudo apt-get update sudo apt-get dist-upgrade sudo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=231&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><strong>I received this from a friend, and thought I would post it here in case anyone would find it useful.</strong></p>
<blockquote><p>After Installing Ubuntu, basically I do this:</p>
<p>Go to:<br />
System -&gt; Administration -&gt; Software Sources -&gt; Other Sofware, and enable partner repository.</p>
<p>After that, we can this on a Terminal:</p>
<p>sudo apt-get update<br />
sudo apt-get dist-upgrade<br />
sudo apt-get install ubuntu-restricted-extras<br />
sudo /usr/share/doc/libdvdread4/install-css.sh</p></blockquote>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/ubuntu/'>Ubuntu</a>, <a href='http://blog.gahooa.com/tag/ubuntu-partner-repositories/'>Ubuntu Partner Repositories</a>, <a href='http://blog.gahooa.com/tag/ubuntu-setup/'>Ubuntu Setup</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/231/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=231&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>git add -u</title>
		<link>http://blog.gahooa.com/2010/05/16/git-add-u/</link>
		<comments>http://blog.gahooa.com/2010/05/16/git-add-u/#comments</comments>
		<pubDate>Mon, 17 May 2010 03:22:13 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version control]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[git add]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=228</guid>
		<description><![CDATA[Here is a nice little tidbit I ran across some time ago&#8230;  Ever delete a bunch of files from a git working copy, and then had to go in and tell git that you meant to delete them?  For example: [jason@dc40 AppStruct]$ git status # On branch master # Changed but not updated: # (use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=228&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a nice little tidbit I ran across some time ago&#8230;  Ever delete a bunch of files from a git working copy, and then had to go in and <strong>tell</strong> git that you meant to delete them?  For example:</p>
<pre>[jason@dc40 AppStruct]$ git status
# On branch master
# Changed but not updated:
#   (use "git add/rm ..." to update what will be committed)
#
#       deleted:    Python/AppStruct/Application.py
#       modified:   Python/AppStruct/Database/PostgreSQL.py
#       deleted:    Python/AppStruct/Date.py
#       deleted:    Python/AppStruct/JSON.py
#       deleted:    Python/AppStruct/Util.py
#       deleted:    Python/AppStruct/__init__.py
#
# Untracked files:
#   (use "git add ..." to include in what will be committed)
#
#       Python/AppStruct/NewFile.txt
no changes added to commit (use "git add" and/or "git commit -a")</pre>
<p>Previously, the way to handle this would be:</p>
<pre>   git rm ...
   git rm ...
   git rm ...
   git rm ...
   git rm ...
   git add ...
   git add ...</pre>
<p><strong>Rather, isn&#8217;t this easier?</strong></p>
<pre>   git add -u
   git add .</pre>
<hr />From the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html">man page for git-add</a>:</p>
<blockquote><p>&#8211;update | -u<br />
Only match  against already tracked files in the index rather than the working tree. That means that it will never stage new files, but that it will stage modified new contents of tracked files and that it will remove files from the index if the corresponding files in the working tree have been removed.</p></blockquote>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/git/'>git</a>, <a href='http://blog.gahooa.com/tag/git-add/'>git add</a>, <a href='http://blog.gahooa.com/tag/scm/'>scm</a>, <a href='http://blog.gahooa.com/tag/version-control/'>version control</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=228&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/05/16/git-add-u/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>PostgreSQL Dump and Restore Notes</title>
		<link>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/</link>
		<comments>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/#comments</comments>
		<pubDate>Mon, 17 May 2010 03:10:59 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[pg_dump]]></category>
		<category><![CDATA[pg_restore]]></category>
		<category><![CDATA[database backup]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=225</guid>
		<description><![CDATA[The pg_dump and pg_restore commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it. I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble. Unless you own all of the objects being restored, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=225&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.postgresql.org/docs/8.4/static/app-pgdump.html">pg_dump</a> and <a href="http://www.postgresql.org/docs/8.4/static/app-pgrestore.html">pg_restore</a> commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it.</p>
<p>I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble.</p>
<p>Unless you own all of the objects being restored, you may need to be SUPERUSER in order to have a successful restore.</p>
<p>The custom dump format is quite useful.  Unlike the normal sequence of SQL statements you may be used to from mysqldump (and pg_dump as well), the &#8211;format=custom option will create a compressed archive file (internally a tar file) that can be selectivly read with pg_restore.  That flexibility could come in handy if you *just* need the schema from 1 table, or *just* the data from another table.</p>
<p><strong>Dump:</strong><br />
pg_dump &#8211;format=custom -U jason_super MyDatabase &gt; MyDatabase.pgdump</p>
<p><strong>Restore</strong><br />
pg_restore &#8211;exit-on-error &#8211;clean &#8211;dbname=MyDatabase MyDatabase.pgdump</p>
<p><strong>Get all of the SQL</strong><br />
pg_restore TMTManage_2.pgdump | more</p>
<p><strong>Get some of the SQL</strong><br />
pg_restore &#8211;schema=ACRM &#8211;table=Admin TMTManage_2.pgdump | more</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/database-backup/'>database backup</a>, <a href='http://blog.gahooa.com/tag/pg_dump/'>pg_dump</a>, <a href='http://blog.gahooa.com/tag/pg_restore/'>pg_restore</a>, <a href='http://blog.gahooa.com/tag/postgresql/'>PostgreSQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=225&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>TypeError: list indices must be integers</title>
		<link>http://blog.gahooa.com/2010/03/08/211/</link>
		<comments>http://blog.gahooa.com/2010/03/08/211/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 22:50:46 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tuple]]></category>
		<category><![CDATA[TypeError]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[python error]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=211</guid>
		<description><![CDATA[You start your day, happily working with dictionaries&#8230;Life is good. &#62;&#62;&#62; mydict = {'key-a': 'value-a', 'key-b': 'value-b'} &#62;&#62;&#62; mydict['key-a'] 'value-a' All of a sudden, storm clouds appear. Your dictionary variable accidentally gets assigned a list, and life is no longer good! &#62;&#62;&#62; mydict = {'key-a': 'value-a', 'key-b': 'value-b'} &#62;&#62;&#62; mydict['key-a'] 'value-a' &#62;&#62;&#62; mydict = [] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=211&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>You start your day, happily working with dictionaries&#8230;Life is good.</p>
<pre class="brush: python;">
&gt;&gt;&gt; mydict = {'key-a': 'value-a', 'key-b': 'value-b'}
&gt;&gt;&gt; mydict['key-a']
'value-a'
</pre>
<p>All of a sudden, storm clouds appear.  Your dictionary variable <strong>accidentally </strong>gets assigned a list, and life is no longer good!</p>
<pre class="brush: python;">
&gt;&gt;&gt; mydict = {'key-a': 'value-a', 'key-b': 'value-b'}
&gt;&gt;&gt; mydict['key-a']
'value-a'
&gt;&gt;&gt; mydict = []
&gt;&gt;&gt; mydict['key-a']
Traceback (most recent call last):
  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
TypeError: list indices must be integers
</pre>
<p>The error message <strong>&quot;TypeError: list indices must be integers&quot;</strong> is generated when you attempt to use a non-int for a index inside the [] operator.</p>
<p>By the way, almost the same message is used if you do this with a tuple:</p>
<p><code>TypeError: tuple indices must be integers</code></p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/list/'>list</a>, <a href='http://blog.gahooa.com/tag/python/'>Python</a>, <a href='http://blog.gahooa.com/tag/python-error/'>python error</a>, <a href='http://blog.gahooa.com/tag/tuple/'>Tuple</a>, <a href='http://blog.gahooa.com/tag/typeerror/'>TypeError</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/211/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/211/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/211/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=211&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/03/08/211/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>nginx restart error</title>
		<link>http://blog.gahooa.com/2010/02/24/nginx-restart-error/</link>
		<comments>http://blog.gahooa.com/2010/02/24/nginx-restart-error/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 03:32:10 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx configuration]]></category>
		<category><![CDATA[nginx error]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=209</guid>
		<description><![CDATA[Was playing around with nginx on Centos 5 (EPEL package). Most of the time I ran: service nginx restart I would get this message in the /var/log/nginx/error.log file: panic: MUTEX_LOCK (22) [op.c:352]. After some hunting around, it appears to be a known bug in nginx (perhaps perl in nginx?)&#8230; Anyway, a simple workaround is to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=209&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Was playing around with nginx on Centos 5 (EPEL package).</p>
<p>Most of the time I ran:</p>
<pre class="brush: plain;">service nginx restart</pre>
<p>I would get this message in the /var/log/nginx/error.log file:</p>
<pre class="brush: plain;">panic: MUTEX_LOCK (22) [op.c:352].</pre>
<p>After some hunting around, it appears to be a known bug in nginx (perhaps perl in nginx?)&#8230; Anyway, a simple workaround is to do this:</p>
<pre class="brush: plain;">
service nginx stop
service nginx start
</pre>
<p>Or, simply edit <strong>/etc/init.d/nginx, and add the sleep 1 line:</strong></p>
<pre class="brush: plain;">
51 restart() {
52     configtest || return $?
53     stop
54     sleep 1
55     start
56 }
</pre>
<p>Nice workround!</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/nginx/'>nginx</a>, <a href='http://blog.gahooa.com/tag/nginx-configuration/'>nginx configuration</a>, <a href='http://blog.gahooa.com/tag/nginx-error/'>nginx error</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=209&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/02/24/nginx-restart-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Great article on Python super, __mro__, and attributes</title>
		<link>http://blog.gahooa.com/2010/02/20/great-article-on-python-super-__mro__-and-attributes/</link>
		<comments>http://blog.gahooa.com/2010/02/20/great-article-on-python-super-__mro__-and-attributes/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 21:59:33 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Perspective]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Python attributes]]></category>
		<category><![CDATA[Python super()]]></category>
		<category><![CDATA[Python __mro__]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=207</guid>
		<description><![CDATA[I highly recommend reading this excellent writeup on Python super(), python __mro__, python attributes, and more. It is Copyright © 2005-2009 Shalabh Chaturvedi http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#method-resolution-order Tagged: Python, Python attributes, Python super(), Python __mro__<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=207&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I highly recommend reading this excellent writeup on Python super(), python __mro__, python attributes, and more.</p>
<p>It is Copyright © 2005-2009 Shalabh Chaturvedi</p>
<p><a href="http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#method-resolution-order">http://www.cafepy.com/article/python_attributes_and_methods/python_attributes_and_methods.html#method-resolution-order</a></p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/python/'>Python</a>, <a href='http://blog.gahooa.com/tag/python-attributes/'>Python attributes</a>, <a href='http://blog.gahooa.com/tag/python-super/'>Python super()</a>, <a href='http://blog.gahooa.com/tag/python-__mro__/'>Python __mro__</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=207&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/02/20/great-article-on-python-super-__mro__-and-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>git scm tip</title>
		<link>http://blog.gahooa.com/2010/02/20/git-scm-tip/</link>
		<comments>http://blog.gahooa.com/2010/02/20/git-scm-tip/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 21:56:55 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Perspective]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[scm]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=204</guid>
		<description><![CDATA[You may be aware of git add . But did you know this: git add . adds all the files. Use with care (only after git status, for example). git add -u . adds and deletes all KNOWN files. This is great if you added and removed or renamed files. Tagged: git, scm, tip, version [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=204&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>You may be aware of <strong>git add .</strong></p>
<p>But did you know this:</p>
<pre class="brush: plain;">
git add .
</pre>
<p>adds all the files.  Use with care (only after git status, for example).</p>
<pre class="brush: plain;">
git add -u .
</pre>
<p>adds and deletes all KNOWN files.</p>
<p>This is great if you added and removed or renamed files.</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/git/'>git</a>, <a href='http://blog.gahooa.com/tag/scm/'>scm</a>, <a href='http://blog.gahooa.com/tag/tip/'>tip</a>, <a href='http://blog.gahooa.com/tag/version-control/'>version control</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=204&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/02/20/git-scm-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Python 3 bytes indexing returns integers!</title>
		<link>http://blog.gahooa.com/2009/12/31/python-3-bytes-indexing-returns-integers/</link>
		<comments>http://blog.gahooa.com/2009/12/31/python-3-bytes-indexing-returns-integers/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 17:22:04 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[bytes]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[python 3]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=196</guid>
		<description><![CDATA[While converting a bunch of werkzeug code to Python 3.1, I ran into an issue with one of the bytes objects that was previously a string. The line of code in question was originally this: if value and value[0] == value[-1] == b'&#34;': ... If value is something, and the first and last characters are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=196&subd=gahooa&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>While converting a bunch of <a href="http://werkzeug.pocoo.org/">werkzeug</a> code to  Python 3.1, I ran into an issue with one of the <strong>bytes</strong> objects that was previously a string.</p>
<p>The line of code in question was originally this:</p>
<pre>
<pre class="brush: python;">
if value and value[0] == value[-1] == b'&quot;':
   ...
</pre>
</pre>
<p>If value is something, and the first and last characters are a quote character, then&#8230;</p>
<p>However, as it turns out, the <strong><a href="http://docs.python.org/py3k/library/functions.html#bytes">bytes object</a></strong> is actually a list of integers in the range of 0-255.</p>
<p>So when you use an indexing operation on a byte, you actually get an integer back.  For example:</p>
<pre>
<pre class="brush: python;">
&gt;&gt;&gt; x = b'Hello World'
&gt;&gt;&gt; x[0]
72

&gt;&gt;&gt; x = 'Hello World'
&gt;&gt;&gt; x[0]
'H'
</pre>
</pre>
<p>Big difference, eh?</p>
<br /> Tagged: bytes, Python, python 3 <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&blog=6218261&post=196&subd=gahooa&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/12/31/python-3-bytes-indexing-returns-integers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
	</channel>
</rss>