<?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>Tarotoast's Stuff &#187; python</title>
	<atom:link href="http://blog.tarotoast.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tarotoast.com</link>
	<description>Personal blog</description>
	<lastBuildDate>Tue, 04 May 2010 08:49:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>IP -&gt; Location</title>
		<link>http://blog.tarotoast.com/2009/05/25/495/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ip-location</link>
		<comments>http://blog.tarotoast.com/2009/05/25/495/#comments</comments>
		<pubDate>Mon, 25 May 2009 18:28:06 +0000</pubDate>
		<dc:creator>tarotoast</dc:creator>
				<category><![CDATA[Footprints + Diary]]></category>
		<category><![CDATA[geoip]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.tarotoast.com/?p=495</guid>
		<description><![CDATA[GeoLite City vs GeoIP City: GeoLite City GeoIP City Cost Free $370 initial, $90 per month updates Coverage Worldwide Worldwide Accuracy Over 99.5% on a country level and 79% on a city level for the US within a 25 mile radius. More details Over 99.8% on a country level and 83% on a city level [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.maxmind.com/app/geolitecity">GeoLite City</a> vs <a href="http://www.maxmind.com/app/city">GeoIP City</a>:</p>
<table border="0">
<tbody>
<tr>
<td></td>
<td>GeoLite City</td>
<td>GeoIP City</td>
</tr>
<tr>
<td>Cost</td>
<td>Free</td>
<td>$370 initial, $90 per month updates</td>
</tr>
<tr>
<td>Coverage</td>
<td>Worldwide</td>
<td>Worldwide</td>
</tr>
<tr>
<td>Accuracy</td>
<td>Over 99.5% on a country level and 79% on a city level for the US within a 25 mile radius. <a href="http://www.maxmind.com/app/geolite_city_accuracy">More details</a></td>
<td>Over 99.8% on a country level and 83% on a city level for the US within a 25 mile radius. <a href="http://www.maxmind.com/app/city_accuracy">More details</a></td>
</tr>
<tr>
<td>Redistribution</td>
<td>Free, subject to GPL/LGPL for APIs and <a href="http://geolite.maxmind.com/download/geoip/database/LICENSE.txt">database license</a>. <a href="http://www.maxmind.com/app/builder">Commercial redistribution licenses</a> are available</td>
<td>Please contact us</td>
</tr>
<tr>
<td>Updates</td>
<td>Updated monthly, at the beginning of each month</td>
<td>Updated monthly.  For binary format, weekly updates, automated updates available by using geoipupdate program included with <a href="http://www.maxmind.com/app/c">C API</a></td>
</tr>
</tbody>
</table>
<p>Very evil indeed.</p>
<ol>
<li>Download and install GeoIP C API from <a href="http://www.maxmind.com/app/c">here</a>.</li>
<li>Download and install GeoIP Python API from <a href="http://geolite.maxmind.com/download/geoip/api/python/">here</a>.</li>
<li>Download latest GeoLite City Binary Format from <a href="http://www.maxmind.com/app/geolitecity">here</a>.</li>
<li>Extract GeoLite City file to /usr/local/share/GeoIP/</li>
</ol>
<p>Example uses of API can be found in test*.py that comes with Python API.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tarotoast.com/2009/05/25/495/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python unescape javascript escapped UTF8 sequence</title>
		<link>http://blog.tarotoast.com/2008/03/16/425/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=python-unescape-javascript-escapped-utf-8-sequence</link>
		<comments>http://blog.tarotoast.com/2008/03/16/425/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 10:19:43 +0000</pubDate>
		<dc:creator>tarotoast</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.tarotoast.com/?p=425</guid>
		<description><![CDATA[尋找這種答案很浪費生命，記錄下來 print "".join([(len(i)&#62;0 and unichr(int(i,16)) or "") for i in url.split('%u')])]]></description>
			<content:encoded><![CDATA[<p>尋找這種答案很浪費生命，記錄下來</p>
<pre class="php">print "".join([(len(i)&gt;0 and unichr(int(i,16)) or "") for i in url.split('%u')])</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.tarotoast.com/2008/03/16/425/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>簡體 UTF8 -&gt; 繁體/正體 UTF8</title>
		<link>http://blog.tarotoast.com/2008/03/15/422/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=%25e7%25b0%25a1%25e9%25ab%2594-utf8-%25e7%25b9%2581%25e9%25ab%2594%25e6%25ad%25a3%25e9%25ab%2594-utf8</link>
		<comments>http://blog.tarotoast.com/2008/03/15/422/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 04:08:12 +0000</pubDate>
		<dc:creator>tarotoast</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[chinese]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://blog.tarotoast.com/?p=422</guid>
		<description><![CDATA[Encode-CNmap 是好朋友 雖然字表沒有完整，但是大部份都有轉換成功，而且使用上也不錯簡單 轉換文字檔案: cnmap -u2cb5 utf8.txt &#62; utf8-cntrad.txt 對於懶得在 Python 下面 implement 繁簡轉換的人(me?)實在很好用: import commands s = commands.getoutput("echo '简体中文' &#124; cnmap -ucb5") print s 說真的，這方法最好別用 XD]]></description>
			<content:encoded><![CDATA[<p><a href="http://search.cpan.org/~qjzhou/Encode-CNMap-0.32/">Encode-CNmap</a> 是好朋友<br />
雖然字表沒有完整，但是大部份都有轉換成功，而且使用上也不錯簡單<br />
轉換文字檔案:<br />
<code>cnmap -u2cb5 utf8.txt &gt; utf8-cntrad.txt</code></p>
<p>對於懶得在 Python 下面 implement 繁簡轉換的人(me?)實在很好用:</p>
<pre class="php">import commands
s = commands.getoutput("echo '简体中文' | cnmap -ucb5")
print s</pre>
<p>說真的，這方法最好別用 XD</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tarotoast.com/2008/03/15/422/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python-pycurl Note</title>
		<link>http://blog.tarotoast.com/2008/03/15/420/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=python-pycurl-note</link>
		<comments>http://blog.tarotoast.com/2008/03/15/420/#comments</comments>
		<pubDate>Sun, 16 Mar 2008 02:16:44 +0000</pubDate>
		<dc:creator>tarotoast</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[pycurl]]></category>

		<guid isPermaLink="false">http://blog.tarotoast.com/?p=420</guid>
		<description><![CDATA[import pycurl c = pycurl.Curl() c.setopt(pycurl.URL, "http://blog.tarotoast.com/") import StringIO b = StringIO.StringIO() c.setopt(pycurl.WRITEFUNCTION, b.write) c.setopt(pycurl.USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2)") c.setopt(pycurl.REFERER, "http://blog.tarotoast.com/") c.perform() print b.getvalue()]]></description>
			<content:encoded><![CDATA[<pre class="php">import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, "http://blog.tarotoast.com/")
import StringIO
b = StringIO.StringIO()
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.setopt(pycurl.USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506; InfoPath.2)")
c.setopt(pycurl.REFERER, "http://blog.tarotoast.com/")
c.perform()
print b.getvalue()</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.tarotoast.com/2008/03/15/420/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
