<?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>Chris&#039;s Weblog</title>
	<atom:link href="http://www.logicalprogressions.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logicalprogressions.net/blog</link>
	<description></description>
	<lastBuildDate>Thu, 03 Jun 2010 22:34:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A(nother) duplicate file finder</title>
		<link>http://www.logicalprogressions.net/blog/2010/06/another-duplicate-file-finder/</link>
		<comments>http://www.logicalprogressions.net/blog/2010/06/another-duplicate-file-finder/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 22:13:29 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=76</guid>
		<description><![CDATA[Goodness knows the world doesn’t need another duplicate file finder… but here one is!
Download find_duplicates-1.0.tar.gz
This should run on Python 2.6 and up. Usage is python find_duplicates.py DIRECTORY. If you just want to copy-paste or ogle the source, here it is:

#! /bin/env python
&#34;&#34;&#34;This program finds files under a given directory which share the same
contents.
&#160;
This program works [...]]]></description>
			<content:encoded><![CDATA[<p>Goodness knows the world doesn’t need another duplicate file finder… but here one is!</p>
<p><a href='http://www.logicalprogressions.net/blog/wp-content/find_duplicates-1.0.tar.gz'>Download find_duplicates-1.0.tar.gz</a></p>
<p>This should run on Python 2.6 and up. Usage is <code>python find_duplicates.py DIRECTORY</code>. If you just want to copy-paste or ogle the source, here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#! /bin/env python</span>
<span style="color: #483d8b;">&quot;&quot;&quot;This program finds files under a given directory which share the same
contents.
&nbsp;
This program works by forming a list of one group containing the filepaths of
the files the user want to inspect for duplicates. This list is examined and
pruned multiple times; each time the groups are partitioned into subgroups
using progressively more accurate (and slower) duplicate-checking strategies
until the remaining groups represent sets of duplicate files.
&quot;&quot;&quot;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">collections</span>
<span style="color: #ff7700;font-weight:bold;">import</span> hashlib
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> make_initial_group<span style="color: black;">&#40;</span>base_dir<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Recurse into the directory at base_dir, returning all the file's
    filepaths as a list within a list.&quot;&quot;&quot;</span>
    groups = <span style="color: black;">&#91;</span><span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> dirpath, _, filenames <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">walk</span><span style="color: black;">&#40;</span>base_dir<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">for</span> filename <span style="color: #ff7700;font-weight:bold;">in</span> filenames:
            filepath = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>dirpath, filename<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">islink</span><span style="color: black;">&#40;</span>filepath<span style="color: black;">&#41;</span>:
                groups<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>filepath<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> groups
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> regroup_using_strategy<span style="color: black;">&#40;</span>groups, strategy_func<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Refines the groups by using the output of strategy_func(filepath) as a
    key for regrouping the files. (which must be equal for duplicate files). 
&nbsp;
    The keys returned by strategy_func(filepath) for duplicate files must be
    equal. Equivalently, keys must only differ for files that are different. An
    example strategy_func returns the filesize for the file located at
    filepath.
    &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> group <span style="color: #ff7700;font-weight:bold;">in</span> groups:
        files_by_key = <span style="color: #dc143c;">collections</span>.<span style="color: black;">defaultdict</span><span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> filepath <span style="color: #ff7700;font-weight:bold;">in</span> group:
            <span style="color: #ff7700;font-weight:bold;">try</span>:
                key = strategy_func<span style="color: black;">&#40;</span>filepath<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IOError</span>:
                <span style="color: #ff7700;font-weight:bold;">continue</span>
            files_by_key<span style="color: black;">&#91;</span>key<span style="color: black;">&#93;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>filepath<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> group <span style="color: #ff7700;font-weight:bold;">in</span> files_by_key.<span style="color: black;">itervalues</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">yield</span> group
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> prune_groups<span style="color: black;">&#40;</span>groups<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Remove groups whose size is too small to contain duplicates.&quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#40;</span>group <span style="color: #ff7700;font-weight:bold;">for</span> group <span style="color: #ff7700;font-weight:bold;">in</span> groups <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #008000;">list</span><span style="color: black;">&#40;</span>group<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span>= <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> print_groups<span style="color: black;">&#40;</span>groups<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Print the filepaths in each group, separating each group by a blank
    line.
    &quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> group <span style="color: #ff7700;font-weight:bold;">in</span> groups:
        <span style="color: #ff7700;font-weight:bold;">for</span> filepath <span style="color: #ff7700;font-weight:bold;">in</span> group:
            <span style="color: #ff7700;font-weight:bold;">print</span> filepath
        <span style="color: #ff7700;font-weight:bold;">print</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> hash_file<span style="color: black;">&#40;</span>filepath<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Compute and return the hash for the file located at filepath.&quot;&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>filepath, <span style="color: #483d8b;">&quot;rb&quot;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> file_:
        <span style="color: #ff7700;font-weight:bold;">return</span> hashlib.<span style="color: #dc143c;">md5</span><span style="color: black;">&#40;</span>file_.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">digest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">2</span>:
        <span style="color: #dc143c;">sys</span>.__stderr__.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;{0}: Usage: {0} directory<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>
                .<span style="color: black;">format</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    base_dir = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
    groups = make_initial_group<span style="color: black;">&#40;</span>base_dir<span style="color: black;">&#41;</span>
    groups = prune_groups<span style="color: black;">&#40;</span>regroup_using_strategy<span style="color: black;">&#40;</span>groups, <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">getsize</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    groups = prune_groups<span style="color: black;">&#40;</span>regroup_using_strategy<span style="color: black;">&#40;</span>groups, hash_file<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    print_groups<span style="color: black;">&#40;</span>groups<span style="color: black;">&#41;</span></pre></div></div>

<p>This program runs quickly—it is in league with other popular tools of it’s kind, but it is still somewhat naive. I have plans for a faster algorithm which does not use hash algorithms and mitigates risk of false positives due to hash collisions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2010/06/another-duplicate-file-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Riemann Sums with Python</title>
		<link>http://www.logicalprogressions.net/blog/2010/05/riemann-sums-with-python/</link>
		<comments>http://www.logicalprogressions.net/blog/2010/05/riemann-sums-with-python/#comments</comments>
		<pubDate>Sun, 09 May 2010 19:47:51 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=68</guid>
		<description><![CDATA[I use this when I don’t feel like symbolically integrating (or am unable to).

def riemann_sum&#40;function, interval, n, rule=&#34;middle&#34;&#41;:
    start = float&#40;interval&#91;0&#93;&#41;
    end = float&#40;interval&#91;1&#93;&#41;
    dx = &#40;end - start&#41;/n
    if rule == &#34;middle&#34;:
        x_values = &#40;start [...]]]></description>
			<content:encoded><![CDATA[<p>I use this when I don’t feel like symbolically integrating (or am unable to).</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> riemann_sum<span style="color: black;">&#40;</span>function, interval, n, rule=<span style="color: #483d8b;">&quot;middle&quot;</span><span style="color: black;">&#41;</span>:
    start = <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>interval<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    end = <span style="color: #008000;">float</span><span style="color: black;">&#40;</span>interval<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    dx = <span style="color: black;">&#40;</span>end - start<span style="color: black;">&#41;</span>/n
    <span style="color: #ff7700;font-weight:bold;">if</span> rule == <span style="color: #483d8b;">&quot;middle&quot;</span>:
        x_values = <span style="color: black;">&#40;</span>start + i<span style="color: #66cc66;">*</span>dx + dx/<span style="color: #ff4500;">2</span> <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> rule == <span style="color: #483d8b;">&quot;left&quot;</span>:
        x_values = <span style="color: black;">&#40;</span>start + i<span style="color: #66cc66;">*</span>dx <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">elif</span> rule == <span style="color: #483d8b;">&quot;right&quot;</span>:
        x_values = <span style="color: black;">&#40;</span>start + <span style="color: black;">&#40;</span>i+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">*</span>dx <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>n<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> dx <span style="color: #66cc66;">*</span> <span style="color: #008000;">sum</span><span style="color: black;">&#40;</span>function<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> x <span style="color: #ff7700;font-weight:bold;">in</span> x_values<span style="color: black;">&#41;</span></pre></div></div>

<p>Here’s a usage example:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;font-weight:bold;">import</span> sqrt
<span style="color: #ff7700;font-weight:bold;">def</span> func<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> sqrt<span style="color: black;">&#40;</span>x+<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Interval: (1, 4), Sections: 16&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Left: {0}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span>riemann_sum<span style="color: black;">&#40;</span>func, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">16</span>, rule=<span style="color: #483d8b;">&quot;left&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Midpoint: {0}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span>riemann_sum<span style="color: black;">&#40;</span>func, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">16</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Right: {0}&quot;</span>.<span style="color: black;">format</span><span style="color: black;">&#40;</span>riemann_sum<span style="color: black;">&#40;</span>func, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">4</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">16</span>, rule=<span style="color: #483d8b;">&quot;right&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2010/05/riemann-sums-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiplication in Python ― without actually multiplying!</title>
		<link>http://www.logicalprogressions.net/blog/2010/01/multiplication-in-python-%e2%80%95-without-actually-multiplying/</link>
		<comments>http://www.logicalprogressions.net/blog/2010/01/multiplication-in-python-%e2%80%95-without-actually-multiplying/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 21:20:44 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=19</guid>
		<description><![CDATA[This is just something interesting I wrote last year. It will multiply two integers using an algorithm which is sometimes called &#8220;russian peasant multiplication&#8221;.

def peasant_multiply&#40;a, b&#41;:
    '''Multiply the floor of 'a' and 'b' using only addition, bitshifts, and the binary AND operator.'''
    a = int&#40;a&#41;
    b [...]]]></description>
			<content:encoded><![CDATA[<p>This is just something interesting I wrote last year. It will multiply two integers using an algorithm which is sometimes called &#8220;russian peasant multiplication&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> peasant_multiply<span style="color: black;">&#40;</span>a, b<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Multiply the floor of '</span>a<span style="color: #483d8b;">' and '</span>b<span style="color: #483d8b;">' using only addition, bitshifts, and the binary AND operator.'</span><span style="color: #483d8b;">''</span>
    a = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
    b = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>b<span style="color: black;">&#41;</span>
    product = <span style="color: #ff4500;">0</span>
    <span style="color: #ff7700;font-weight:bold;">while</span> a <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">0</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> a <span style="color: #66cc66;">&amp;</span> <span style="color: #ff4500;">1</span>:
            product = product + b
        a = a <span style="color: #66cc66;">&gt;&gt;</span> <span style="color: #ff4500;">1</span>
        b = b <span style="color: #66cc66;">&lt;&lt;</span> <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> product</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2010/01/multiplication-in-python-%e2%80%95-without-actually-multiplying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DiceGen ― Automatic generation of Diceware- passphrases</title>
		<link>http://www.logicalprogressions.net/blog/2009/08/dicegen/</link>
		<comments>http://www.logicalprogressions.net/blog/2009/08/dicegen/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 23:25:28 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[DiceGen]]></category>
		<category><![CDATA[Diceware]]></category>
		<category><![CDATA[passphrases]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=22</guid>
		<description><![CDATA[Diceware is a system for generating secure, word-based passphrases by using dice rolls as a source of randomness. There comes a point however, when you realize that enemy intelligence isn’t actually trying to break your encryption, and all you want is to make a strong and memorable passphrase without the fuss of rolling around small [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://world.std.com/~reinhold/diceware.html">Diceware</a> is a system for generating secure, word-based passphrases by using dice rolls as a source of randomness. There comes a point however, when you realize that enemy intelligence isn’t actually trying to break your encryption, and all you want is to make a strong and memorable passphrase without the fuss of rolling around small cubes.</p>
<p>That’s where DiceGen comes in. DiceGen is a command line program that does all the work for you. Run <code>dicegen.py</code> and it spits out a five word Diceware passphrase.</p>
<p>DiceGen is flexible: by default it uses the original Diceware wordlist to make passphrases, but it can also take simple, one-word-per-line (newline delimited) wordlists―not just Diceware wordlists. To do this, use <code>--word-list-format=simple</code> and <code>--word-list-file=FILE</code> to tell <code>dicegen</code> to use the wordlist at file FILE.</p>
<h3>Download</h3>
<ul>
<li><a href='http://www.logicalprogressions.net/blog/wp-content/DiceGen-1.2.tar.gz'>DiceGen-1.2 (with Diceware wordlist)</a></li>
</ul>
<h3>Instructions</h3>
<p>DiceGen is very easy to use. To generate five passphrases with ten words each, run <code>python dicegen.py -n5 -w10</code>. Running <code>python dicegen.py --help</code> gives you some more detailed usage information:</p>
<pre>
Usage: dicegen [-n] [-w]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -n NUM, --number=NUM  number of passphrases to generate [default: 1]
  -w NUM, --words=NUM   number of words to use in passphrase [default: 5]
  --no-spaces           do not add spaces between words
  --word-list-file=FILE
                        location of a complete Diceware wordlist [default: /path/to/diceware.wordlist.asc]
  --word-list-format=FORMAT
                        how the wordlist is formatted [possible values:
                        diceware, simple] [default: diceware]
</pre>
<h3>Caveots</h3>
<p>DiceGen uses python’s random library, which uses the Mersenne twister generator. This generator is not cryptographically secure. Don’t use DiceGen if you happen to be enemies with the NSA or really, really smart people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2009/08/dicegen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Touching up a breakaway wand</title>
		<link>http://www.logicalprogressions.net/blog/2008/08/touching-up-a-breakaway-wand/</link>
		<comments>http://www.logicalprogressions.net/blog/2008/08/touching-up-a-breakaway-wand/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 01:22:49 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[magic]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=11</guid>
		<description><![CDATA[
Almost any magician who uses a wand and some comedy bits is familiar with a breakaway wand. Certain plastic breakaway wands will develop unsightly chipped edges. Even though these chips are small, they stress the plastic and turn those edges into a color that is significantly more white than the desired black. The result of [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.logicalprogressions.net/blog/wp-content/img_8517.jpg'><img src="http://www.logicalprogressions.net/blog/wp-content/img_8517-300x199.jpg" alt="" title="Touching up a breakaway wand" width="300" height="199" class="alignright size-medium wp-image-12" /></a></p>
<p>Almost any magician who uses a wand and some comedy bits is familiar with a breakaway wand. Certain plastic breakaway wands will develop unsightly chipped edges. Even though these chips are small, they stress the plastic and turn those edges into a color that is significantly more white than the desired black. The result of this wear are visible rings on the wand.</p>
<p>There is however, a very easy and effective touch-up. Grab a black permanent marker and run the tip across all of the chipped edges on your wand and then… Alakazam! Your wand has been returned to a near-new looking status.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2008/08/touching-up-a-breakaway-wand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File carving OpenDocument text files (.odt)</title>
		<link>http://www.logicalprogressions.net/blog/2008/07/file-carving-opendocument-text-files-odt/</link>
		<comments>http://www.logicalprogressions.net/blog/2008/07/file-carving-opendocument-text-files-odt/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 00:40:07 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[.odt]]></category>
		<category><![CDATA[file carving]]></category>
		<category><![CDATA[Foremost]]></category>
		<category><![CDATA[OpenDocument]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[Scalpel]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=9</guid>
		<description><![CDATA[I recently destroyed (on accident, of course) someone’s file-system. Big time bummer. I needed to recover some files that were made with OpenOffice. The file carving route made the most sense, so I used Bless to inspect a collection of OpenOffice files I had around and made these definitions to work with Foremost and Scalpel. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently destroyed (on accident, of course) someone’s file-system. Big time bummer. I needed to recover some files that were made with OpenOffice. The file carving route made the most sense, so I used <a href="http://home.gna.org/bless/">Bless</a> to inspect a collection of OpenOffice files I had around and made these definitions to work with Foremost and <a href="http://www.digitalforensicssolutions.com/Scalpel/">Scalpel</a>. They worked like a charm! Here they are for your benefit:</p>
<pre style="overflow: auto">
#---------------------------------------------------------------------
# OPENOFFICE FILES
#---------------------------------------------------------------------
	odt	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.textPK	META-INF/manifest.xmlPK????????????????????
	ods	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.spreadsheetPK	META-INF/manifest.xmlPK????????????????????
	odp	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.presentationPK	META-INF/manifest.xmlPK????????????????????
	odg	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.graphicsPK	META-INF/manifest.xmlPK????????????????????
	odc	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.chartPK	META-INF/manifest.xmlPK????????????????????
	odf	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.formulaPK	META-INF/manifest.xmlPK????????????????????
	odi	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.imagePK	META-INF/manifest.xmlPK????????????????????
	odm	y	10000000	PK????????????????????????????mimetypeapplication/vnd.oasis.opendocument.text-masterPK	META-INF/manifest.xmlPK????????????????????
	sxw	y	10000000	PK????????????????????????????mimetypeapplication/vnd.sun.xml.writerPK	META-INF/manifest.xmlPK????????????????????
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2008/07/file-carving-opendocument-text-files-odt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Character Entities Cheat Sheet</title>
		<link>http://www.logicalprogressions.net/blog/2007/09/xml-character-entities-cheat-sheet/</link>
		<comments>http://www.logicalprogressions.net/blog/2007/09/xml-character-entities-cheat-sheet/#comments</comments>
		<pubDate>Sun, 23 Sep 2007 08:07:56 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=7</guid>
		<description><![CDATA[That key on your keyboard that you probably use for quotations and apostrophes isn’t actually a quotation or an apostrophe key! It’s a remnant from the typewriter era where typewriters had only a small subset of characters that were normally available in a printer’s type case. With computers and the era of desktop publishing, we’ve [...]]]></description>
			<content:encoded><![CDATA[<p>That key on your keyboard that you probably use for quotations and apostrophes isn’t actually a quotation or an apostrophe key! It’s a remnant from the typewriter era where typewriters had only a small subset of characters that were normally available in a printer’s type case. With computers and the era of desktop publishing, we’ve gone far beyond typewriters and can now be our own typesetters—you just have to know when and how to use the right characters. And trust me, your pages will look a lot spicier and much more professional when you get these down.</p>
<p>When writing your XML/XHTML documents you’ll want to type in these codes to get the character you want to display properly. These are called XML decimal character entities. It&#8217;s quite a mouthful, but I&#8217;ve found that they have greater support in the wild when compared to the named entities you might be familiar with such as  &amp;#ldquo;. Keep in mind that a lot of the especially tricky characters outlined below have important rules. Don’t be intimidated, just do it! Using the proper characters will spice up your documents!</p>
<p>Here’s a helpful little reference that I use all the time!</p>
<p>[—] em dash (&amp;#8212;)<br />
• breaks in thought<br />
• to enclose a clause like with parentheses<br />
• open ranges<br />
• century vague years<br />
• two em dashes for missing letters<br />
• three em dashes for missing words</p>
<p>[–] en dash (&amp;#8211;)<br />
• closed numerical ranges<br />
• indicating a connection<br />
• showing joint authors<br />
• compounding a hyphenation with an adjective</p>
<p>[‒] figure dash (&amp;#8210;)<br />
• linking numbers together which are not a range<br />
• telephone numbers</p>
<p>[−] minus sign (&amp;#8722;)<br />
• subtraction</p>
<p>[‐] hyphen (&amp;#8208;)<br />
• joining compound words</p>
<p>[“] left double quotation mark (&amp;#8220;)<br />
• exact quotations</p>
<p>[”] right double quotation mark (&amp;#8221;)<br />
• exact quotations</p>
<p>[‘] left single quotation mark (&amp;#8216;)</p>
<p>[’] right single quotation mark (&amp;#8217;)<br />
• preferred character for use as an apostrophe</p>
<p>[…] ellipsis (&amp;#8230;)<br />
• before periods for one or more missing words<br />
• after periods for one or more missing sentences<br />
• with no periods for trailing thought</p>
<p>A lot of this information came from a great A List Apart article titled “<a href="http://www.alistapart.com/articles/emen">The Trouble With EM ’n EN (and Other Shady Characters)</a>” by <a href="http://www.alistapart.com/authors/s/peterksheerin">Peter Sheerin</a> as well as from a Wikipedia page on <a href="http://en.wikipedia.org/wiki/Dash">Dashes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2007/09/xml-character-entities-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solution to error adding Sensors Applet</title>
		<link>http://www.logicalprogressions.net/blog/2007/09/solution-to-error-adding-sensors-applet/</link>
		<comments>http://www.logicalprogressions.net/blog/2007/09/solution-to-error-adding-sensors-applet/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 09:46:37 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.logicalprogressions.net/blog/?p=4</guid>
		<description><![CDATA[I&#8217;m running Fedora 7 with the proprietary Nvidia drivers. After an upgrade to the Sensors Applet, I found that I could no longer add it to my panel. It gave me this error:
The panel encountered a problem while loading “OAFIID:SensorsApplet”.
Little did I know that an awesome new feature had been added and broke the applet. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running Fedora 7 with the proprietary Nvidia drivers. After an upgrade to the Sensors Applet, I found that I could no longer add it to my panel. It gave me this error:</p>
<blockquote><p>The panel encountered a problem while loading “OAFIID:SensorsApplet”.</p></blockquote>
<p>Little did I know that an awesome new feature had been added and broke the applet. This feature was temperature monitoring for Nvidia graphics cards! When I was trying to add the applet to the panel, the sensor applet attempted to find out my GPU temperature, but failed because of a missing package. By installing the “libXNVCTRL” package, I was able to give the sensors applet the API it wanted and get things working just fine.<br />
<span id="more-4"></span></p>
<p>For the record, I was able to get more detailed debugging information to solve this problem by trying to run the applet from the command line using the command “/usr/libexec/sensors-applet”. This returned:</p>
<blockquote><p>/usr/libexec/sensors-applet: error while loading shared libraries: libXNVCtrl.so.0: cannot open shared object file: No such file or directory</p></blockquote>
<p>That kind of error is usually a sign of a missing package, so I searched the repos, and found “libXNVCtrl”. My problem was solved. And here&#8217;s something I didn&#8217;t notice: the <a href="http://sensors-applet.sourceforge.net/">GNOME Sensors Applet site</a> gives a “requirements” page, and lists “libXNVCtrl” as a requirement for Nvidia cards. I wish I checked that out sooner.</p>
<p>I am presently using version 1.8.1 of GNOME Sensors Applet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logicalprogressions.net/blog/2007/09/solution-to-error-adding-sensors-applet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
