<?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"
	>

<channel>
	<title>Technology DB</title>
	<atom:link href="http://www.technologydb.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technologydb.com</link>
	<description>Blogs on web technologies</description>
	<pubDate>Sat, 17 May 2008 09:38:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>how to get column names in python mysql/sql query</title>
		<link>http://www.technologydb.com/how-to-get-column-names-in-python-mysqlsql-query/</link>
		<comments>http://www.technologydb.com/how-to-get-column-names-in-python-mysqlsql-query/#comments</comments>
		<pubDate>Sat, 17 May 2008 09:33:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[python]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=12</guid>
		<description><![CDATA[First obtain a cursor
import MySQLdb
conn = MySQLdb.connect (host = &#8220;localhost&#8221;, user = &#8220;root&#8221;, passwd = &#8220;&#8221;, db = &#8220;dbname&#8221;)
cursor = conn.cursor()
Now execute mysql sql query
sql = &#8220;select COLA, COLB from T1 where COLC=%&#8221;
colc_value = &#8220;something&#8221;
cursor.execute(sql, [colc_value])
Now iterate over results
while(1):
data = cursor.fetchone()
if data == None: break
desc = cursor.description
dict = {}
for (name, value) in zip(desc, data):
dict[str(name[0])] = [...]]]></description>
		<wfw:commentRss>http://www.technologydb.com/how-to-get-column-names-in-python-mysqlsql-query/feed/</wfw:commentRss>
		</item>
		<item>
		<title>how to get hostname in python</title>
		<link>http://www.technologydb.com/how-to-get-hostname-in-python/</link>
		<comments>http://www.technologydb.com/how-to-get-hostname-in-python/#comments</comments>
		<pubDate>Sat, 17 May 2008 07:35:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cookbook]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=11</guid>
		<description><![CDATA[import socket
host = socket.gethostname()
print host
]]></description>
		<wfw:commentRss>http://www.technologydb.com/how-to-get-hostname-in-python/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to iterate a dictionary in sorted order of values</title>
		<link>http://www.technologydb.com/how-to-iterate-a-dictionary-in-sorted-order-of-values/</link>
		<comments>http://www.technologydb.com/how-to-iterate-a-dictionary-in-sorted-order-of-values/#comments</comments>
		<pubDate>Sun, 04 May 2008 17:17:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[cookbook]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=10</guid>
		<description><![CDATA[Sometimes we want to iterate over a dictionary in sorted order of value. Here is the code:
d = {&#8221;a&#8221;:1, &#8220;b&#8221;:5, &#8220;c&#8221;:2, &#8220;be&#8221;:30}
for k in sorted(d.keys(), lambda x,y:d[x]-d[y]):
print &#8220;%s=%s&#8221; % (k, d[k])
# output is:
 a=1
c=2
b=5
be=30
]]></description>
		<wfw:commentRss>http://www.technologydb.com/how-to-iterate-a-dictionary-in-sorted-order-of-values/feed/</wfw:commentRss>
		</item>
		<item>
		<title>python/perl/unix one liners</title>
		<link>http://www.technologydb.com/pythonperlunix-one-liners/</link>
		<comments>http://www.technologydb.com/pythonperlunix-one-liners/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:01:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[web technology]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[cheat sheet]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=4</guid>
		<description><![CDATA[Here are some cool python one liners.

Parse apache log using python: print 5th field
 python -c &#8220;import csv,sys;f=csv.reader(sys.stdin, delimiter=&#8217; &#8216;); print &#8216;\n&#8217;.join([r[5] for r in f])
Generate frequency histogram from a text files of terms
 cat file.txt &#124; sort &#124; uniq -c &#124; sort -rn
print 2nd column of a tab separated file
 awk -F&#8221;\t&#8221; &#8216;{print $2}&#8217;
perl [...]]]></description>
		<wfw:commentRss>http://www.technologydb.com/pythonperlunix-one-liners/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Website performance</title>
		<link>http://www.technologydb.com/website-performance/</link>
		<comments>http://www.technologydb.com/website-performance/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 20:08:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[web technology]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=3</guid>
		<description><![CDATA[These are some quick apache tips to improve the performance of your web site:

compress your html/css/js content by making these changes to your httpd.conf
 SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript
To see it working, install livehttpheaders addon in firefox, open Tools-&#62;Live HTTP headers, and fetch http://www.technologydb.com/. In case some headers are missing, clear your firefox cache. [...]]]></description>
		<wfw:commentRss>http://www.technologydb.com/website-performance/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.technologydb.com/hello-world/</link>
		<comments>http://www.technologydb.com/hello-world/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 18:09:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.technologydb.com/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
]]></description>
		<wfw:commentRss>http://www.technologydb.com/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
