<?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>Timblog</title>
	<atom:link href="http://timjoh.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://timjoh.com</link>
	<description>Code, games, chess and everything but the kitchen sink</description>
	<pubDate>Tue, 08 Jul 2008 23:52:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>How to Use CHMOD in Kasablanca</title>
		<link>http://timjoh.com/how-to-use-chmod-in-kasablanca/</link>
		<comments>http://timjoh.com/how-to-use-chmod-in-kasablanca/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 23:52:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[How-to]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://timjoh.com/?p=327</guid>
		<description><![CDATA[  Kasablanca is a GUI FTP client, which I regularly use. Today, I needed to change the permissions on a folder to allow writing by the web server. After trying for a long time to do it in kasablanca, I found the solution: At the command-line, write:

$ lftp -u tim ftp.example.com
Password:
lftp tim@ftp.example.com:~> cd the/directory
lftp tim@ftp.example.com:the/directory> [...] ]]></description>
			<content:encoded><![CDATA[<p> Kasablanca is a GUI FTP client, which I regularly use. Today, I needed to change the permissions on a folder to allow writing by the web server. After trying for a long time to do it in kasablanca, I found the solution: At the command-line, write:</p>
<pre>
$ lftp -u tim ftp.example.com
Password:
lftp tim@ftp.example.com:~> cd the/directory
lftp tim@ftp.example.com:the/directory> chmod 777 the_file
</pre>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/how-to-use-chmod-in-kasablanca/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to Drop All Tables in SQL Dump File</title>
		<link>http://timjoh.com/how-to-drop-all-tables-in-sql-dump-file/</link>
		<comments>http://timjoh.com/how-to-drop-all-tables-in-sql-dump-file/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 07:36:25 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[How-to]]></category>

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

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

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

		<category><![CDATA[command line]]></category>

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

		<guid isPermaLink="false">http://timjoh.com/?p=326</guid>
		<description><![CDATA[  I am currently moving a WordPress blog from one server to another. In the process, I messed up the MySQL database transportation, resulting in some tables being created, and some rows being inserted. It would not be possible to simply run the SQL dump files again, since that would result in duplicate rows. This [...] ]]></description>
			<content:encoded><![CDATA[<p> I am currently moving a WordPress blog from one server to another. In the process, I messed up the MySQL database transportation, resulting in <em>some</em> tables being created, and <em>some</em> rows being inserted. It would not be possible to simply run the SQL dump files again, since that would result in duplicate rows. This was easy to fix with some commandline and perl magic, though. The file containing all SQL statements is called wordpress-dump.sql (in this example).</p>
<p>First, find the names of all tables:</p>

<div class="wp_syntax"><div class="code"><pre class="perl">$ <span style="color: #000066;">grep</span> -E <span style="color: #ff0000;">'^CREATE TABLE'</span> wordpress-<span style="color: #000066;">dump</span>.sql
CREATE TABLE `cat_visibility` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `comments` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `links` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `movie_ratings` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `options` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `photopress` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `postmeta` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `posts` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `pp_cats` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `sk2_logs` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `sk2_spams` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `term_relationships` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `term_taxonomy` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `terms` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `usermeta` <span style="color: #66cc66;">&#40;</span>
CREATE TABLE `users` <span style="color: #66cc66;">&#40;</span></pre></div></div>

<p>Next, reformat those lines into DROP queries.</p>

<div class="wp_syntax"><div class="code"><pre class="perl">$ <span style="color: #000066;">grep</span> -E <span style="color: #ff0000;">'^CREATE TABLE'</span> wordpress-<span style="color: #000066;">dump</span>.sql | perl -pe <span style="color: #ff0000;">'s/CREATE/DROP/; s/ *\($/;/;'</span></pre></div></div>

<p>Now, you won&#8217;t have to change those by hand!</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/how-to-drop-all-tables-in-sql-dump-file/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Euler 10: Sum of First Primes</title>
		<link>http://timjoh.com/project-euler-10-sum-of-first-primes/</link>
		<comments>http://timjoh.com/project-euler-10-sum-of-first-primes/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 14:35:45 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Guides]]></category>

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

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

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://timjoh.com/?p=325</guid>
		<description><![CDATA[  In the post about Project Euler 7, I described how to obtain a list of primes. These are not enough: the last one is 1,299,827, and we need all up to 2,000,000. The first 1,000,000 prime numbers can be found at the same site. Here is a ZIP file of the 1,000,000 first primes. [...] ]]></description>
			<content:encoded><![CDATA[<p> In the post about <a href="http://timjoh.com/project-euler-7-the-10001st-prime-number/">Project Euler 7</a>, I described how to obtain a list of primes. These are not enough: the last one is 1,299,827, and we need all up to 2,000,000. The first 1,000,000 prime numbers can be found at the same site. Here is a <a href="http://primes.utm.edu/lists/small/millions/primes1.zip">ZIP file of the 1,000,000 first primes</a>. Download the file, unzip it and format it as in problem 7.</p>
<p>Summing the first ones is fast and simple. This Perl script does it well:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="perl"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sum</span> = <span style="color: #cc66cc;">0</span>;
<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> PRIMES, <span style="color: #ff0000;">'&lt;'</span>, <span style="color: #ff0000;">'dat/primes-1000000-first.txt'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> $!;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #009999;">&lt;PRIMES&gt;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">chomp</span>;
        <span style="color: #b1b100;">last</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$_</span> &gt;= <span style="color: #cc66cc;">2000000</span>;
        <span style="color: #0000ff;">$sum</span> += <span style="color: #0000ff;">$_</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> PRIMES <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$sum</span>, <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/project-euler-10-sum-of-first-primes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Euler 7: The 10001st Prime Number</title>
		<link>http://timjoh.com/project-euler-7-the-10001st-prime-number/</link>
		<comments>http://timjoh.com/project-euler-7-the-10001st-prime-number/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 14:14:21 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Guides]]></category>

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

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

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://timjoh.com/?p=324</guid>
		<description><![CDATA[  This mission can be solved by calculating lots of prime numbers. However, we do not want to put extra effort into our solutions, do we? After a bit of searching, I found a list of the 100000 first prime numbers (100008, actually). I saved this file. Unfortunately, it is not in an optimal format. [...] ]]></description>
			<content:encoded><![CDATA[<p> This mission can be solved by calculating lots of prime numbers. However, we do not want to put extra effort into our solutions, do we? After a bit of searching, I found a <a href="http://primes.utm.edu/lists/small/100000.txt">list of the 100000 first prime numbers</a> (100008, actually). I saved this file. Unfortunately, it is not in an optimal format. I wrote a short Perl script that creates a new file, in which each prime number is on a separate line:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="perl"><span style="color: #808080; font-style: italic;"># read the file from utm.edu</span>
<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> PRIMES, <span style="color: #ff0000;">'&lt;'</span>, <span style="color: #ff0000;">'dat/100000.txt'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> $!;
<span style="color: #808080; font-style: italic;"># this is the file that we will write to</span>
<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> TO, <span style="color: #ff0000;">'&gt;'</span>, <span style="color: #ff0000;">'dat/primes-100000-first.txt'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> $!;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #009999;">&lt;PRIMES&gt;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;"># for each line</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">split</span> / +/ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;"># split, separating by spaces, and for each piece</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">m</span>/^\d+$/ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;"># if it is a number</span>
                        <span style="color: #000066;">print</span> TO <span style="color: #ff0000;">&quot;$_<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>; <span style="color: #808080; font-style: italic;"># print the number to the file</span>
                <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> TO <span style="color: #66cc66;">&#41;</span>;
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> PRIMES <span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Of course, you need to replace the filenames.</p>
<p>Now, it is a piece of cake to find the 10001st prime number. Just do:</p>
<pre>
head -10001 dat/primes-100000-first.txt | tail -1
</pre>
<p>Which finds the 10001 first primes and outputs the last one of them.</p>
<p>Or you could open it in notepad and start counting rows.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/project-euler-7-the-10001st-prime-number/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Project Euler 9: Pythagorean Triplets, Sum=1000</title>
		<link>http://timjoh.com/project-euler-9-pythagorean-triplets-sum1000/</link>
		<comments>http://timjoh.com/project-euler-9-pythagorean-triplets-sum1000/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 13:45:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Guides]]></category>

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

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

		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://timjoh.com/?p=323</guid>
		<description><![CDATA[  There is exactly one Pythagorean triplet (a^2+b^2=c^2) in which a+b+c=1000. Since all terms are positive, we can try all alternatives for 0 &#60; a,b &#60; 1000, which is less than 1000^2. This Perl script does it all:

1
2
3
4
5
6
7
8
9
10
11
12
# first, generate pairs of a and b
for &#40; my $a = 1; $a &#60; 1000; $a++ &#41; [...] ]]></description>
			<content:encoded><![CDATA[<p> There is exactly one Pythagorean triplet (a^2+b^2=c^2) in which a+b+c=1000. Since all terms are positive, we can try all alternatives for 0 &lt; a,b &lt; 1000, which is less than 1000^2. This Perl script does it all:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="perl"><span style="color: #808080; font-style: italic;"># first, generate pairs of a and b</span>
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$a</span> = <span style="color: #cc66cc;">1</span>; <span style="color: #0000ff;">$a</span> &lt; <span style="color: #cc66cc;">1000</span>; <span style="color: #0000ff;">$a</span>++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$b</span> = <span style="color: #0000ff;">$a</span>; <span style="color: #0000ff;">$b</span> &lt; <span style="color: #cc66cc;">1000</span>; <span style="color: #0000ff;">$b</span>++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #808080; font-style: italic;"># c is then calculated from these</span>
                <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$c</span> = <span style="color: #000066;">sqrt</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$a</span>*<span style="color: #0000ff;">$a</span> + <span style="color: #0000ff;">$b</span>*<span style="color: #0000ff;">$b</span> <span style="color: #66cc66;">&#41;</span>;
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$a</span>+<span style="color: #0000ff;">$b</span>+<span style="color: #0000ff;">$c</span> == <span style="color: #cc66cc;">1000</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #808080; font-style: italic;"># print and exit if we found the answer</span>
                        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;%d*%d*%d=%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$a</span>, <span style="color: #0000ff;">$b</span>, <span style="color: #0000ff;">$c</span>, <span style="color: #0000ff;">$a</span>*<span style="color: #0000ff;">$b</span>*<span style="color: #0000ff;">$c</span>;
                        <span style="color: #000066;">exit</span>;
                <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>There is probably a faster solution without a square root, but this one is fast enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/project-euler-9-pythagorean-triplets-sum1000/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HBH Basic Web 7: Encrypt ASCII Cookie</title>
		<link>http://timjoh.com/hbh-basic-web-7-encrypt-ascii-cookie/</link>
		<comments>http://timjoh.com/hbh-basic-web-7-encrypt-ascii-cookie/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 13:08:43 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Guides]]></category>

		<category><![CDATA[Hellbound Hackers]]></category>

		<guid isPermaLink="false">http://timjoh.com/?p=322</guid>
		<description><![CDATA[  Basic web hacking mission 7 of the Hellbound Hacker series is a prime example of why I dislike their &#8220;hacking challenges&#8221;. Some of them are not about hacking!

This time Mr. Deitry decided to make a cookie login script and he said he decrypted it from ASCII encryption, and for you to login you need [...] ]]></description>
			<content:encoded><![CDATA[<p> Basic web hacking mission 7 of the Hellbound Hacker series is a prime example of why I dislike their &#8220;hacking challenges&#8221;. Some of them are not about hacking!</p>
<blockquote>
<p>This time Mr. Deitry decided to make a cookie login script and he said he decrypted it from ASCII encryption, and for you to login you need to encrypt it. And after you login there is another login but its a Login that uses SQL databases, but he thinks that the SQL login page is vulnerable to a simple SQL injection, and when he gets back from his vacation he would fix it.</p>
</blockquote>
<p>In this mission, whatever you do, don&#8217;t try to think by yourself! Instead, follow the instructions blindly. Upon inspecting the cookies set by this mission, for which I recommend the Firefox plugin <a href="https://addons.mozilla.org/firefox/573/">Add N Edit Cookies</a>, we find two of them:</p>
<pre>username=sam
password=jillisdead</pre>
<p>We are asked for the username. I tried a lot of methods on this one. I used the username &#8220;sam&#8221;, and I changed the value of the &#8220;username&#8221; cookie to my username. No matter what I tried, I could not solve it. So I read the mission description again. Mr. Deitry <cite>&#8220;decrypted it from ASCII encryption, and for you to login you need to encrypt it&#8221;</cite>.</p>
<p>For some reason, the value of the cookie set needs to be changed, <em>regardless of who was logging in</em>! Please disregard that this mission has no connection whatsoever to reality. What sane login system would require such actions from its users?</p>
<p>What is meant by &#8220;ASCII encryption&#8221; is the corresponding, <em>binary</em> ASCII values for each character. This would be the same as &#8220;Unicode encryption&#8221;, since the first 128 characters are the same for both ASCII and Unicode. To find what &#8220;sam&#8221; is when ASCII encrypted, google for things like <a href="http://www.google.com/search?q=ascii+to+binary">[ascii to binary]</a>. When you have found that, edit the &#8220;username&#8221; cookie to the encrypted value, e.g. 101010101010101010101010. When that has been done, you can login with the previous username.</p>
<p>To bypass the next field, you must only remember that the mission text talked about an SQL injection. First, check what error message you get when putting an apostrophe in the field.</p>
<p>Congratulations! The server-side check for successful SQL injections isn too advanced.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/hbh-basic-web-7-encrypt-ascii-cookie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading AdSense CSV in Perl (UTF-16 Problems)</title>
		<link>http://timjoh.com/adsense-csv-in-perl/</link>
		<comments>http://timjoh.com/adsense-csv-in-perl/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 18:10:56 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Perl]]></category>

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://timjoh.com/?p=321</guid>
		<description><![CDATA[  I was trying to write a Perl script for analyzing a CSV file. It was generated by Google AdSense and contained lots of statistics. Naturally, I started by reading the file:

open&#40; CSV, '&#60;', 'adsense-report.csv' &#41;;
while &#40; CSV &#41; &#123;
    # handle each line
&#125;
close&#40; CSV &#41;;

However, upon trying to match each line [...] ]]></description>
			<content:encoded><![CDATA[<p> I was trying to write a Perl script for analyzing a CSV file. It was generated by Google AdSense and contained lots of statistics. Naturally, I started by reading the file:</p>

<div class="wp_syntax"><div class="code"><pre class="perl"><span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> CSV, <span style="color: #ff0000;">'&lt;'</span>, <span style="color: #ff0000;">'adsense-report.csv'</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> CSV <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;"># handle each line</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> CSV <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>However, upon trying to match each line with a regular expression, I found that it was not possible to match several characters in a row. Only very simple regexps such as m/5/ worked! After some research, I found the problem:</p>
<pre>
$ file adsense-report.csv
adsense-report.csv: \012- Unicode text, UTF-16, little-endian
</pre>
<p>Apparently, Perl assumed some other encoding. I changed the second argument of <code>open()</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="perl"><span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> CSV, <span style="color: #ff0000;">'&lt;:encoding(utf-16)'</span>, <span style="color: #ff0000;">'adsense-report.csv'</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> CSV <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;"># handle each line</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> CSV <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>It now works well. Unfortunately, I receive two errors of &#8220;UTF-16:Partial character&#8221;, which I cannot seem to solve.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/adsense-csv-in-perl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Scrabble Analysis with Perl</title>
		<link>http://timjoh.com/scrabble-analysis-with-perl/</link>
		<comments>http://timjoh.com/scrabble-analysis-with-perl/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 10:48:38 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Perl]]></category>

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

		<guid isPermaLink="false">http://timjoh.com/?p=320</guid>
		<description><![CDATA[  A while ago, I started playing lots of scrabble. The scrabble game in the Ubuntu repository (by Brian White) records all games in the file ~/.scrabble-games. The following perl script analyzes the file and creates statistics for your games.

#!/usr/bin/perl
&#160;
use strict;
&#160;
my $mode = shift @ARGV;
unless &#40; $mode &#41; &#123;
       [...] ]]></description>
			<content:encoded><![CDATA[<p> A while ago, I started playing lots of scrabble. The scrabble game in the Ubuntu repository (by Brian White) records all games in the file <code>~/.scrabble-games</code>. The following perl script analyzes the file and creates statistics for your games.</p>

<div class="wp_syntax"><div class="code"><pre class="perl"><span style="color: #808080; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mode</span> = <span style="color: #000066;">shift</span> <span style="color: #0000ff;">@ARGV</span>;
<span style="color: #b1b100;">unless</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$mode</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;arg: (freq|gen|score|size)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
        <span style="color: #000066;">exit</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000066;">chdir</span>;  
<span style="color: #000066;">open</span><span style="color: #66cc66;">&#40;</span> LOG, <span style="color: #ff0000;">'&lt;scrabble-games'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> $!;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$yourwords</span> = <span style="color: #cc66cc;">0</span>; 
<span style="color: #b1b100;">my</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">%wfreq</span>, <span style="color: #0000ff;">%wscore</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$numgames</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #009999;">&lt;LOG&gt;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">chomp</span>;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">m</span>/^level <span style="color: #808080; font-style: italic;">#(\d); computer rack: &quot;([A-Z]*)&quot;; player rack: &quot;([A-Z]*)&quot;$/ ) {</span>
                <span style="color: #0000ff;">$numgames</span>++;
        <span style="color: #66cc66;">&#125;</span> 
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">m</span>/My Words/ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #0000ff;">$yourwords</span> = <span style="color: #cc66cc;">0</span>;
        <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">m</span>/Your Words/ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #0000ff;">$yourwords</span> = <span style="color: #cc66cc;">1</span>;
        <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$yourwords</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">m</span>/<span style="color: #66cc66;">&#91;</span>^a-z<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>a-z<span style="color: #66cc66;">&#93;</span>+<span style="color: #66cc66;">&#41;</span>\<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>\d+<span style="color: #66cc66;">&#41;</span>\<span style="color: #66cc66;">&#41;</span>/g <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                        <span style="color: #0000ff;">$wfreq</span><span style="color: #66cc66;">&#123;</span>$<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span>++ <span style="color: #b1b100;">if</span> <span style="color: #000066;">length</span> $<span style="color: #cc66cc;">1</span> &gt; <span style="color: #cc66cc;">2</span>;
                        <span style="color: #0000ff;">$wscore</span><span style="color: #66cc66;">&#123;</span>$<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#125;</span> = $<span style="color: #cc66cc;">2</span> <span style="color: #b1b100;">if</span> <span style="color: #000066;">length</span> $<span style="color: #cc66cc;">1</span> &gt; <span style="color: #cc66cc;">2</span>;
                <span style="color: #66cc66;">&#125;</span>
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #66cc66;">&#40;</span> LOG <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@freq</span> = <span style="color: #000066;">sort</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$wfreq</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$a</span><span style="color: #66cc66;">&#125;</span> &lt;=&gt; <span style="color: #0000ff;">$wfreq</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$b</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%wfreq</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@size</span> = <span style="color: #000066;">sort</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066;">length</span> <span style="color: #0000ff;">$a</span> &lt;=&gt; <span style="color: #000066;">length</span> <span style="color: #0000ff;">$b</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%wfreq</span>;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@score</span> = <span style="color: #000066;">sort</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #0000ff;">$wscore</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$a</span><span style="color: #66cc66;">&#125;</span> &lt;=&gt; <span style="color: #0000ff;">$wscore</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$b</span><span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #000066;">keys</span> <span style="color: #0000ff;">%wscore</span>;  <span style="color: #808080; font-style: italic;"># TODO: no hash needed; calculate score from word and ignore bonuses</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$mode</span> eq <span style="color: #ff0000;">'gen'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;No of games:<span style="color: #000099; font-weight: bold;">\t</span>%d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$numgames</span>;
        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;Longest:<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #000066;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">', '</span>, &amp;liststart<span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">reverse</span> <span style="color: #0000ff;">@size</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;Most used:<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #000066;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">', '</span>, &amp;liststart<span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">reverse</span> <span style="color: #0000ff;">@freq</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;Highest score:<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #000066;">join</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">', '</span>, &amp;liststart<span style="color: #66cc66;">&#40;</span> <span style="color: #000066;">reverse</span> <span style="color: #0000ff;">@score</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$mode</span> eq <span style="color: #ff0000;">'score'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">@score</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$wscore</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$_</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #0000ff;">$_</span>;
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$mode</span> eq <span style="color: #ff0000;">'freq'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">@freq</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$wfreq</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$_</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #0000ff;">$_</span>;
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$mode</span> eq <span style="color: #ff0000;">'size'</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">@size</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;%d<span style="color: #000099; font-weight: bold;">\t</span>%s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$wfreq</span><span style="color: #66cc66;">&#123;</span><span style="color: #0000ff;">$_</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #0000ff;">$_</span>;
        <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> liststart <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@t</span>;
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">1</span>..<span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #000066;">push</span> <span style="color: #0000ff;">@t</span>, <span style="color: #000066;">shift</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #000066;">return</span> <span style="color: #0000ff;">@t</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Call it with one of the arguments freq (for most frequently used words), score (for best-scoring words), size (for longest words) or gen (for a summary). Note that only your words are counted, not your opponent&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/scrabble-analysis-with-perl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Waking Up with Perl</title>
		<link>http://timjoh.com/waking-up-with-perl/</link>
		<comments>http://timjoh.com/waking-up-with-perl/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 06:34:37 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Perl]]></category>

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

		<guid isPermaLink="false">http://timjoh.com/waking-up-with-perl/</guid>
		<description><![CDATA[  While being in the Alps skiing (Argentiere), my cellphone broke due to a 55kg-weight dropping on it. Since I used to set my cellphone&#8217;s alarm clock to make me wake up, I had to come up with a better solution. I wrote this perl script:

use strict;
&#160;
my &#40; $t, $f &#41;;
if &#40; @ARGV == 1 [...] ]]></description>
			<content:encoded><![CDATA[<p> While being in the Alps skiing (Argentiere), my cellphone broke due to a 55kg-weight dropping on it. Since I used to set my cellphone&#8217;s alarm clock to make me wake up, I had to come up with a better solution. I wrote this perl script:</p>

<div class="wp_syntax"><div class="code"><pre class="perl"><span style="color: #000000; font-weight: bold;">use</span> strict;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span>, <span style="color: #0000ff;">$f</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">@ARGV</span> == <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #0000ff;">$t</span> = <span style="color: #0000ff;">$ARGV</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
        <span style="color: #0000ff;">$f</span> = <span style="color: #ff0000;">'~/wakeup.mp3'</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elsif</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">@ARGV</span> == <span style="color: #cc66cc;">2</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span>, <span style="color: #0000ff;">$f</span> <span style="color: #66cc66;">&#41;</span> = <span style="color: #0000ff;">@ARGV</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">die</span> <span style="color: #ff0000;">'args: sec, file'</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span> &gt; <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #000066;">sleep</span> <span style="color: #cc66cc;">1</span>;
        <span style="color: #0000ff;">$t</span>--;
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$h</span> = <span style="color: #000066;">int</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span> / <span style="color: #cc66cc;">3600</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$m</span> = <span style="color: #000066;">int</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span> / <span style="color: #cc66cc;">60</span> - <span style="color: #0000ff;">$h</span> * <span style="color: #cc66cc;">60</span> <span style="color: #66cc66;">&#41;</span>  ;
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$s</span> = <span style="color: #000066;">int</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$t</span> - <span style="color: #0000ff;">$h</span> * <span style="color: #cc66cc;">3600</span> - <span style="color: #0000ff;">$m</span> * <span style="color: #cc66cc;">60</span> <span style="color: #66cc66;">&#41;</span>  ;
        <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$h:$m:$s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;BEEP BEEP BEEP<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
`mplayer <span style="color: #0000ff;">$f</span>`;</pre></div></div>

<p>The script counts down $t seconds. When it reaches zero, $f will start playing. Eight hours equal 28800 seconds.</p>
<p>Unfortunately, writing this script kept me from sleeping anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/waking-up-with-perl/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;No module named _dbus&#8221; in Deluge Torrent</title>
		<link>http://timjoh.com/no-module-named-_dbus-in-deluge-torrent/</link>
		<comments>http://timjoh.com/no-module-named-_dbus-in-deluge-torrent/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 17:52:38 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
		
		<category><![CDATA[Deluge BitTorrent Client]]></category>

		<category><![CDATA[How-to]]></category>

		<guid isPermaLink="false">http://timjoh.com/no-module-named-_dbus-in-deluge-torrent/</guid>
		<description><![CDATA[  I decided to upgrade from my current deluge-torrent (a BitTorrent client) to the latest version 0.5.7.1, as I just got a what.cd invite. Unfortunately, the .deb package from the Deluge site didn&#8217;t work instantly.

tim@royalgala:~/Desktop$ sudo dpkg -i deluge-torrent_0.5.7-1_i386.feisty.deb 
Selecting previously deselected package deluge-torrent.
(Reading database ... 158322 files and directories currently installed.)
Unpacking deluge-torrent (from deluge-torrent_0.5.7-1_i386.feisty.deb) [...] ]]></description>
			<content:encoded><![CDATA[<p> I decided to upgrade from my current deluge-torrent (a BitTorrent client) to the latest version 0.5.7.1, as I just got a <a href="http://what.cd/">what.cd</a> invite. Unfortunately, the .deb package from the Deluge site didn&#8217;t work instantly.</p>

<div class="wp_syntax"><div class="code"><pre>tim@royalgala:~/Desktop$ sudo dpkg -i deluge-torrent_0.5.7-1_i386.feisty.deb 
Selecting previously deselected package deluge-torrent.
(Reading database ... 158322 files and directories currently installed.)
Unpacking deluge-torrent (from deluge-torrent_0.5.7-1_i386.feisty.deb) ...
Setting up deluge-torrent (0.5.7-1) ...
&nbsp;
tim@royalgala:~/Desktop$ deluge
Traceback (most recent call last):
  File &quot;/usr/bin/deluge&quot;, line 45, in &lt;module&gt;
    import deluge._dbus as dbus
ImportError: No module named _dbus</pre></div></div>

<p>Googling for &#8220;No module named _dbus&#8221; gave me only two results, both Deluge-related. The <a href="http://forum.deluge-torrent.org/viewtopic.php?f=7&#038;t=418">first forum thread</a> had no solution. dpkg purging the system from deluge-torrent did not solve the problem. In the <a href="http://forum.deluge-torrent.org/viewtopic.php?f=7&#038;t=428&#038;p=1994">second thread</a>, the problem was solved through manually deleting all files from the previous installation, which is what I did, using slocate. Deluge 0.5.7.1 would then install nicely.</p>
]]></content:encoded>
			<wfw:commentRss>http://timjoh.com/no-module-named-_dbus-in-deluge-torrent/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
