<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">EnigmaCurry</title>
  <subtitle type="text">The Curry Enigma</subtitle>

  <updated>2013-02-07T01:43:41Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/" />
  <id>http://www.enigmacurry.com//feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://www.enigmacurry.com//feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[PHP Code Compliance In Emacs]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2011/07/01/php-code-compliance-in-emacs" />
    <id>http://www.enigmacurry.com/2011/07/01/php-code-compliance-in-emacs</id>
    <updated>2011-07-01T09:00:00Z</updated>
    <published>2011-07-01T09:00:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="php" />
    <category scheme="http://www.enigmacurry.com/" term="emacs" />
    <summary type="html"><![CDATA[PHP Code Compliance In Emacs]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2011/07/01/php-code-compliance-in-emacs"><![CDATA[<p>My job has me working on a project in PHP right now -- it sure isn't
Python, but PHP has grown up considerably since the last time I used
it, which has been <em>awhile</em>. Consequently, I have no Emacs config for
PHP setup, other than vanilla php-mode, so I went in search of
one. Of course, I knew <a href="http://sachachua.com/blog/2008/07/emacs-and-php-on-the-fly-syntax-checking-with-flymake/">Sacha Chua would have a great
one</a>, so
that's where I've started.</p>
<p>My code is required to conform to the <a href="http://pear.php.net/manual/en/standards.php">PEAR coding
standards</a> which is a bit
pedantic in places, but it's generally a good reference to make clean
and readable code. The only real pain in conforming to a coding
standard is if your editor doesn't pick up on your mistakes right
away, you get no automatic feedback and you're left with the task of
cleaning up your code later at an inconvenient time. In my case, a
subversion pre-commit hook checks for compliance and prevents me from
checking in non-conforming code just when I thought I was ready to go
home!</p>
<p>Sacha's configuration only checks for general syntax errors, it
doesn't check for code compliance. For that, I'm using
<a href="http://pear.php.net/package/PHP_CodeSniffer/redirected">PHP_CodeSniffer</a>
which performs a static analysis of a PHP file and notes any
deviations for a given standard. They even <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php">support Emacs compile
mode</a>
out of the box. Compile mode still doesn't give me automatic feedback
though, for that I still wanted to use flymake like Sacha has.</p>
<p>So here's my elisp for configuring Emacs to automatically highlight
both syntax errors and coding standard deviations for PHP:</p>
<div class="pygments_murphy"><pre><span class="p">(</span><span class="nb">require</span> <span class="ss">&#39;php-mode</span><span class="p">)</span>
<span class="p">(</span><span class="nb">require</span> <span class="ss">&#39;flymake</span><span class="p">)</span>

<span class="c1">;; Pear coding standards : http://pear.php.net/manual/en/standards.indenting.php</span>
<span class="p">(</span><span class="nb">defun</span> <span class="nv">pear/php-mode-init</span> <span class="p">()</span>
  <span class="s">&quot;Set some buffer-local variables.&quot;</span>
  <span class="p">(</span><span class="k">setq</span> <span class="nv">case-fold-search</span> <span class="no">t</span><span class="p">)</span>
  <span class="p">(</span><span class="k">setq</span> <span class="nv">indent-tabs-mode</span> <span class="no">nil</span><span class="p">)</span>
  <span class="p">(</span><span class="k">setq</span> <span class="nv">fill-column</span> <span class="mi">78</span><span class="p">)</span>
  <span class="p">(</span><span class="k">setq</span> <span class="nv">c-basic-offset</span> <span class="mi">4</span><span class="p">)</span>
  <span class="p">(</span><span class="nv">c-set-offset</span> <span class="ss">&#39;arglist-cont</span> <span class="mi">0</span><span class="p">)</span>
  <span class="p">(</span><span class="nv">c-set-offset</span> <span class="ss">&#39;arglist-intro</span> <span class="ss">&#39;+</span><span class="p">)</span>
  <span class="p">(</span><span class="nv">c-set-offset</span> <span class="ss">&#39;case-label</span> <span class="mi">2</span><span class="p">)</span>
  <span class="p">(</span><span class="nv">c-set-offset</span> <span class="ss">&#39;arglist-close</span> <span class="mi">0</span><span class="p">))</span>
<span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;php-mode-hook</span> <span class="ss">&#39;pear/php-mode-init</span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span> <span class="nv">my-php-hook-function</span> <span class="p">()</span>
  <span class="p">(</span><span class="nb">set</span> <span class="p">(</span><span class="nv">make-local-variable</span> <span class="ss">&#39;compile-command</span><span class="p">)</span> <span class="p">(</span><span class="nb">format</span> <span class="s">&quot;php_lint %s&quot;</span> <span class="p">(</span><span class="nv">buffer-file-name</span><span class="p">))))</span>
<span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;php-mode-hook</span> <span class="ss">&#39;my-php-hook-function</span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span> <span class="nv">flymake-php-init</span> <span class="p">()</span>
  <span class="s">&quot;Use php and phpcs to check the syntax and code compliance of the current file.&quot;</span>
  <span class="p">(</span><span class="k">let*</span> <span class="p">((</span><span class="nv">temp</span> <span class="p">(</span><span class="nv">flymake-init-create-temp-buffer-copy</span> <span class="ss">&#39;flymake-create-temp-inplace</span><span class="p">))</span>
     <span class="p">(</span><span class="nv">local</span> <span class="p">(</span><span class="nv">file-relative-name</span> <span class="nv">temp</span> <span class="p">(</span><span class="nv">file-name-directory</span> <span class="nv">buffer-file-name</span><span class="p">))))</span>
    <span class="p">(</span><span class="nb">list</span> <span class="s">&quot;php_lint&quot;</span> <span class="p">(</span><span class="nb">list</span> <span class="nv">local</span><span class="p">))))</span>

<span class="c1">;;This is the error format for : php -f somefile.php -l </span>
<span class="p">(</span><span class="nv">add-to-list</span> <span class="ss">&#39;flymake-err-line-patterns</span>
  <span class="o">&#39;</span><span class="p">(</span><span class="s">&quot;\\(Parse\\|Fatal\\) error: +\\(.*?\\) in \\(.*?\\) on line \\([0-9]+\\)$&quot;</span> <span class="mi">3</span> <span class="mi">4</span> <span class="no">nil</span> <span class="mi">2</span><span class="p">))</span>

<span class="p">(</span><span class="nv">add-to-list</span> <span class="ss">&#39;flymake-allowed-file-name-masks</span> <span class="o">&#39;</span><span class="p">(</span><span class="s">&quot;\\.php$&quot;</span> <span class="nv">flymake-php-init</span><span class="p">))</span>
<span class="p">(</span><span class="nv">add-hook</span> <span class="ss">&#39;php-mode-hook</span> <span class="p">(</span><span class="k">lambda</span> <span class="p">()</span> <span class="p">(</span><span class="nv">flymake-mode</span> <span class="mi">1</span><span class="p">)))</span>
</pre></div>

<p>This depends on a small BASH helper script which I have stored in my
$HOME/bin directory (which is on my PATH by default):</p>
<div class="pygments_murphy"><pre>!/bin/bash
<span class="c">#This does standard PHP syntax checking</span>
php -f <span class="nv">$1</span> -l
<span class="c">#This does coding standard checking</span>
phpcs --standard<span class="o">=</span>PEAR --report<span class="o">=</span>emacs <span class="nv">$1</span>
<span class="c">#Always exit with status code 0 otherwise flymake complains</span>
<span class="nb">exit </span>0
</pre></div>

<p>Now I get nice red highlighting for when I forget a doc tag or to put a space
between parens and brackets. Isn't pedantry great? :/ </p>
<p><center><img src="/blog-post-images/PHP Code Compliance.png"></center></p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Searching GameFAQs within Steam games]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2010/09/22/searching-gamefaqs-within-steam-games" />
    <id>http://www.enigmacurry.com/2010/09/22/searching-gamefaqs-within-steam-games</id>
    <updated>2010-09-22T20:30:00Z</updated>
    <published>2010-09-22T20:30:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="python" />
    <category scheme="http://www.enigmacurry.com/" term="games" />
    <summary type="html"><![CDATA[Searching GameFAQs within Steam games]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2010/09/22/searching-gamefaqs-within-steam-games"><![CDATA[<p>To take the edge off work, I've been playing Fallout 3 this week. Let me just say this: post apocalyptic Washington DC is huge! Thankfully, there's <a href="http://www.gamefaqs.com">GameFAQs</a>, because I don't have 40 hours a week to devote to playing games the hard way. </p>
<p>The problem is, 3D games are notoriously bad at recovering after you Alt-Tab out of the game to use your web browser. Luckily, <a href="http://store.steampowered.com/about/">Steam</a> has a built in web browser, so that you don't need to leave the game in order to check GameFAQs, which is great... <strong>except for the fact that the Steam browser is totally lame</strong>.</p>
<p>See, GameFAQs are plain text files. I think that's cool; plain text is an <a href="http://www.textfiles.com/">age old geek tradition</a>, plus it's the ultimate portable file format. However, that also makes things difficult when you're talking about a guide that is over 1MB and broken into hundreds of sections with no hyperlinks to help navigate. GameFAQ authors are a smart bunch though, they have the habit of creating unique codes for each section, essentially creating ad-hoc hyperlinks. You just use your browser's search feature to search for the code and you go right to the section you want.</p>
<p>And what browser doesn't have a search feature?</p>
<p>Oh... right, the Steam browser.</p>
<p>Seriously?</p>
<p><em>Seriously!?</em></p>
<p>Alright fine, I'm a <a href="http://catb.org/~esr/faqs/hacker-howto.html">hacker</a>, I can get around this. My solution was to write a GameFAQs proxy that downloads FAQs and injects them into a page that uses the <a href="http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html">jQuery highlight plugin</a>. Slapping on a header to every page for easy navigation, gives us our very own search-in-the-browser add-on for the feature-gimped Steam browser.</p>
<p>Download a <a href="http://static.enigmacurry.com/apps/steam_gamefaqs/steam_gamefaqs_1.0.exe">standalone executable</a> and try it yourself. Yea, I probably could have made a public server, but I didn't want to get into a copyright hassle, so for now you'll just need to run it yourself on your own computer. I've tried to make it as easy as possible. If you're a Python geek and want to check out the source (or just paranoid about running a pre-compiled exe), <a href="http://github.com/EnigmaCurry/Steam-GameFAQs">it's over on github</a>. If you're interested in how I compiled the Pylons application into a standalone executable with <a href="http://pypi.python.org/pypi/bbfreeze/">bbfreeze</a>, checkout <a href="http://github.com/EnigmaCurry/Steam-GameFAQs/blob/master/make.py">make.py</a> (although it's pretty cludgy).</p>
<p>One more thing, this proxy is essentially scraping the GameFAQs.com website, so it's possible things could break if they change their site too much. Let me know in the comments if this thing doesn't work anymore.</p>
<p>Instructions for the standalone executable:</p>
<ul>
<li><a href="http://static.enigmacurry.com/apps/steam_gamefaqs/steam_gamefaqs_1.0.exe">Download the exe</a> (Tested on Windows 7, 32 &amp; 64 bit)</li>
<li>Run the application. It's a self extracting archive, extract it wherever you want. The desktop is fine (it's just one .bat file and a directory.)</li>
<li>Run start_steam_gamefaqs.bat and wait for the window to pop up.</li>
<li>Leaving that window open, start your steam game.</li>
<li>In the game, press Shift-Tab to bring up the Steam community page.</li>
<li>Click on the web browser.</li>
<li>Enter the URL : http://localhost:5000</li>
<li>Search for your desired game and FAQ.</li>
<li>Search the page by pressing Ctrl-F and typing in the "Search This Page" box. Pressing Enter multiple times in that box will find the next match for that search term.</li>
</ul>
<p><center><a href="/blog-post-images/steam_gamefaqs_fallout3.png"><img src="/blog-post-images/steam_gamefaqs_fallout3_small.jpg"></a></center></p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[My Model M Keyboard Dyed]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2010/07/17/my-model-m-keyboard-dyed" />
    <id>http://www.enigmacurry.com/2010/07/17/my-model-m-keyboard-dyed</id>
    <updated>2010-07-17T19:13:00Z</updated>
    <published>2010-07-17T19:13:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="cool stuff" />
    <summary type="html"><![CDATA[My Model M Keyboard Dyed]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2010/07/17/my-model-m-keyboard-dyed"><![CDATA[<p>I've been using the same IBM Model M keyboard for about 6 years now. I never thought I would see the day when it would quit working. I love this keyboard -- the buckling springs deliberately and assuredly clicking and clacking beneath my fingers blow the pants off any cheap-ass keyboard you get for "free" with your factory Dell PC. It's amazing that the best keyboard ever made was actually one of the very first. Created in 1985, the Model M set the standard to beat, but the quality of PC keyboards over the years has only gone downhill. Thank goodness Unicomp <a href="http://pckeyboards.stores.yahoo.net/keyboards.html">still makes these things</a>. Otherwise, I'm not sure what I would ever replace this keyboard with... maybe a <a href="http://www.daskeyboard.com/">Das</a> or a <a href="http://www.deckkeyboards.com/">Deck</a>.</p>
<p>Luckily, I don't have to replace it. It hasn't died yet, and probably never will. </p>
<p>Chris McDonough recently wrote an excellent article on the <a href="http://plope.com/Members/chrism/25_years_of_the_model_m">25 years of the Model M</a>. Since reading it, I've been thinking quite a bit about my trusty Model M and I decided to give it an early 25th birthday present: some new colors!</p>
<p><center>
<a href="http://picasaweb.google.com/lh/photo/j7H36AHt2BuTWl4x3ujl8Q?feat=embedwebsite"><img src="http://lh6.ggpht.com/_UBvHStWkL-U/TEI5ieKyKsI/AAAAAAAAAMo/RmAlM4EcQNs/s400/IMG_20100717_180435.jpg" /></a><br/>
<a href="http://picasaweb.google.com/lh/photo/uJEI-OWjou0259ArOOKZbg?feat=embedwebsite"><img src="http://lh3.ggpht.com/_UBvHStWkL-U/TEI-wMMQrPI/AAAAAAAAANQ/2aq8iSlKGAs/s400/IMG_20100717_180238.jpg" /></a>
<a href="http://picasaweb.google.com/lh/photo/g8bcfhutWfZTVEgmnN4saw?feat=embedwebsite"><img src="http://lh6.ggpht.com/_UBvHStWkL-U/TEI-i6MMysI/AAAAAAAAANM/raFen8msm7U/s400/IMG_20100717_180301.jpg" /></a><br/>
<a href="http://picasaweb.google.com/lh/photo/LKEK0lhwjcrIPjegCd4Djg?feat=embedwebsite"><img src="http://lh5.ggpht.com/_UBvHStWkL-U/TEI5Hgnk2MI/AAAAAAAAAMk/D0ATPBKjqPw/s400/IMG_20100717_185806.jpg" /></a><br/>
<a href="http://picasaweb.google.com/lh/photo/QG6CMdMxkeJfarDkl-PQEg?feat=embedwebsite"><img src="http://lh3.ggpht.com/_UBvHStWkL-U/TEI-UOHklmI/AAAAAAAAANI/I9hid0nEtZI/s400/IMG_20100717_185750.jpg" /></a><br/>
<a href="http://picasaweb.google.com/lh/photo/A5I3Vg7mwMRD1yPIYwEgzQ?feat=embedwebsite"><img src="http://lh4.ggpht.com/_UBvHStWkL-U/TEI4gONRtPI/AAAAAAAAAMc/Uw870nheiOg/s400/IMG_20100717_185826.jpg" /></a><br/>
</center></p>
<p>I followed <a href="http://www.overclock.net/computer-peripherals/551389-keyboard-dye-customization-guide.html">a guide from Overclock.net</a> describing the process of applying rit dye to the keys. I've used other keyboards that had paint jobs on them before, but the rit dye process is soo much nicer. With paint, you always get a sticky paint feel on the keys and of course it also covers up the letters on the keys permanently. The rit dye, on the other hand, permeates the plastic and leaves no residue on the surface at all. In fact, you can still see the letters quite well.</p>
<p>I liked the red and brown combination used in the Overclock.net guide, although I left the original color differentiation of the model M intact: letters and numbers red, and the meta keys and some of the F keys brown. The red keys turned out fantastic, the letters on them are very distinctive. However, the brown turned out a bit differently; being much darker, almost black, it all but obscures the markings on the keys.  No big deal though, I guess my new Model M is half-way to a <a href="http://www.daskeyboard.com/model-s-ultimate/">Das Ultimate</a> after all. :)</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Audacious Dynamic Playlist powered by inotify]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2010/07/13/audacious-dynamic-playlist-powered-by-inotify" />
    <id>http://www.enigmacurry.com/2010/07/13/audacious-dynamic-playlist-powered-by-inotify</id>
    <updated>2010-07-13T00:22:00Z</updated>
    <published>2010-07-13T00:22:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="python" />
    <category scheme="http://www.enigmacurry.com/" term="linux" />
    <summary type="html"><![CDATA[Audacious Dynamic Playlist powered by inotify]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2010/07/13/audacious-dynamic-playlist-powered-by-inotify"><![CDATA[<p>I was playing around with <a href="http://streamripper.sourceforge.net/">StreamRipper</a> today to record a shoutcast stream I enjoy, and I thought to myself: wouldn't it be nice to be able to continuously play all the files I've downloaded without having to manually queue the new files in <a href="http://audacious-media-player.org/">Audacious</a>?</p>
<p>So, I scratched an itch. With a little DBUS, pyinotify, and an optparse wrapper, I now have a tool to automatically add the tracks to my Audacious playlist. You can grab the <a href="http://github.com/EnigmaCurry/audacious-plugins">latest version on github</a>.</p>
<p>Streamripper does have a relay option (-r) to allow you to listen to the same stream as you're ripping it, and if that's what you want, the following script is superfluous. However, what I wanted was something slightly different: I didn't necessarily want to just listen to the stream live, instead, I wanted the ability to jump around between the tracks already downloaded, exploring different songs, but with the list of tracks ever expanding. That's what this script allows.</p>
<p>You'll need python-dbus and setuptools installed, then just install with:</p>
<div class="pygments_murphy"><pre>easy_install http://github.com/EnigmaCurry/audacious-plugins/zipball/master
</pre></div>

<p>Startup <a href="http://streamripper.sourceforge.net/">StreamRipper</a> with your favorite audio stream and point the tool at your target directory:</p>
<div class="pygments_murphy"><pre>python -m ec_audacious.dynamic_filesystem_playlist /path/to/your/streamripper_location
</pre></div>

<p>Now when StreamRipper creates a new file, it will get automatically (instantaeneously actually, thanks to inotify!) to your Audacious playlist.</p>
<p>Alternatively, you can use the streamripper wrapper script that I've included to start both the filesystem monitor as well as streamripper in one go:</p>
<p>Put the following in your .bashrc file or somewhere equivalent:</p>
<div class="pygments_murphy"><pre><span class="nb">alias </span><span class="nv">streamripper</span><span class="o">=</span><span class="s2">&quot;python -m ec_audacious.streamripper&quot;</span>
</pre></div>

<p>Then whenever you run streamripper, you'll actually be running the wrapper script instead:</p>
<div class="pygments_murphy"><pre>streamripper http://your-cool-stream.com:8000 --audacious
</pre></div>

<p>By aliasing streamripper to point to the ec_audacious.streamripper wrapper script, we're effectively adding a new option to streamripper called --audacious which spawns our filesystem monitor.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Bill of Responsibilities]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2010/04/18/bill-of-responsibilities" />
    <id>http://www.enigmacurry.com/2010/04/18/bill-of-responsibilities</id>
    <updated>2010-04-18T11:55:00Z</updated>
    <published>2010-04-18T11:55:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="liberty rants" />
    <summary type="html"><![CDATA[Bill of Responsibilities]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2010/04/18/bill-of-responsibilities"><![CDATA[<p>George Donnelly recently blogged about his <a href="http://georgedonnelly.com/libertarian/your-bill-of-responsibilities">personal Bill of
Responsibilites</a>.
I think his approach to crafting a message of liberty, through the
lens of personal responsibility, is a creatively powerful one. It is
his post that has inspired this one.</p>
<p>I've tried in the past to formulate a consistent approach to
describing to people what true liberty is, but I think quite often
that message resorts to telling people that they are doing something
wrong and/or immoral. While I might be correct, focusing on someone
else's faults is often not very constructive. Instead, why not focus
on how I choose to live my life and my justification for doing so?</p>
<p>This Bill of Responsibilities is essentially a contract with
myself. These are things that I believe are central to my being a good
and productive person. However, if I fail to do these things, I not
only fail myself but also the rest of mankind. My hope is that by
living up to my own expectations, I can provide a framework for others
to emulate and improve upon.</p>
<p>So here goes, my own personal Bill of Responsibilities:</p>
<h2>Preamble</h2>
<p>I have the ultimate responsibility for my own survival. The division
of labor that has evolved within mutual societies is wondrously
beneficial to the progress of mankind and it should be taken advantage
of in order to increase one's quality of life. However, the existence
of such developed societies does not relieve my own personal
responsibility to provide for my own needs and desires. In addition,
every action I take in life will have some impact upon others. A free
and prosperous society requires that I take responsibility to never
use unjustified force or fraud against my fellow man.</p>
<h2>Responsibilities</h2>
<ol>
<li>
<p>I have the responsibility to take care of myself. I cannot rely on
   anyone else to provide for my shelter, sustenance, education,
   livelihood, security, health care, entertainment, retirement, or any
   other thing.</p>
</li>
<li>
<p>I have the responsibility, as a civil member of a society, to only
   engage others in a voluntary and mutually-agreeable fashion. I have
   the responsibility to never force an individual to do what they do
   not want to do, unless that force is a justifiable reaction to
   their own aggression.</p>
</li>
<li>
<p>I have the responsibility to keep my word in my dealings with
   others. If I fail to honor my agreements, I have the
   responsibility to make full restitution in as timely a fashion as
   possible. To do otherwise is fraudulent and manipulative.</p>
</li>
<li>
<p>I have the responsibility for my mistakes. If my actions
   unjustifiably harm or endanger another person, I am responsible for
   making full restitution in as timely a fashion as possible. To do
   otherwise is reckless and violent.</p>
</li>
<li>
<p>I have the responsibility to defend myself and my family from those
   that would hurt us. I cannot rely on any other individual to risk
   their own life or livelihood to protect me.</p>
</li>
<li>
<p>I have the responsibility to educate myself. Schooling is
   insufficient, and in many cases, destructive of the cognitive
   abilities of the mind. Information, derived from any source, must
   be processed by an engaged, observant, and critical mind.</p>
</li>
<li>
<p>I have the responsibility to resist cooperating with people that
   choose to conduct themselves in violent ways. To cooperate with such
   evil, would immediately endanger myself and my family. To be idle
   and complicit in any crime against myself, strengthens the aggressor
   and provides the potential of harming my fellow man.</p>
</li>
<li>
<p>I have the responsibility to question authority. Does an authority
   conduct themselves in a responsible manner? Do their claims of
   authority stem from actual property rights, or do they stem from
   fraud or force to acquire your compliance for their own gain? To
   leave these questions unanswered, or worse, <em>unquestioned</em>, is to
   allow one's mind to degenerate into a state of <a href="http://en.wikipedia.org/wiki/Stockholm_syndrome">Stockholm
   syndrome</a>.</p>
</li>
<li>
<p>I have the responsibility to speak out against injustice and to
   support others that do as well. In order to live in a free and
   prosperous society, justice must be served.</p>
</li>
<li>
<p>I have the responsibility to continuously exercise my liberties,
   for they are precariously positioned to be lost if I am not
   practiced in defending them. I have the responsibility to
   continuously work to assert my retention of lost liberties, for the
   longer I wait and do nothing, the more unrecoverable they become.</p>
</li>
</ol>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Initial Nexus One Impressions]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2010/01/06/initial-nexus-one-impressions" />
    <id>http://www.enigmacurry.com/2010/01/06/initial-nexus-one-impressions</id>
    <updated>2010-01-06T18:39:00Z</updated>
    <published>2010-01-06T18:39:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="android" />
    <summary type="html"><![CDATA[Initial Nexus One Impressions]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2010/01/06/initial-nexus-one-impressions"><![CDATA[<p>Just got my Nexus One delivered :)</p>
<p>Although I had a company issued Blackberry (7100t) several years ago, I've never owned a smart phone of my own. I've certainly watched the technology progress over the years, but for the last several of those years I've been content to own a generic 3g slider phone (Samsung A737) and just tethering it to my Nokia N800.</p>
<p>Recently, smartphones have seemingly gotten a lot more powerful and I decided it was time for me to get one. Having loved my N800, I certainly had my eyes on the N900, not only because it adds a phone feature, but maemo 5 looks fscking awesome. However, I did my due dilligence and researched the other options available, and here are my thoughts on what's out there right now:</p>
<ul>
<li>
<p>iPhone 3Gs: I've played with it several times at the Apple store, and held several owned by friends. It runs on fantastic hardware and even better core software. The iPhone is seriously stable and runs smoothly as far as I can tell. It only has one problem: Apple designed the software to be completely locked down. As a software developer (who wants to program for whatever phone he gets) I can't bring myself to become a slave to Apple, not being able to develop on anything but a mac, using a language that seemingly is only used to build Apple software, having to pay a large license fee to put applications on the only available method of distributing applications (THE app store), and to top all that off, I have absolutely no guarantee whatsoever that Apple will even accept my application, let alone in a timely fashion. No thanks.</p>
</li>
<li>
<p>Nokia N900: Oh, this phone has everything I want. Everything the N800 had and more. Completely open-source, completely unlocked device, surrounded by a (small by comparison) community that <strong>wants</strong> me to hack this device. Yea, this is my kind of phone. The idealist in me knows that this is the best phone on the market right now, and if adopted en masse, would shake the telecom industry to its core. A powerful phone like this, giving me as much freedom as it does, has the potential to force the telecom providers to compete solely on terms of network quality as opposed to competing over who has the coolest (locked down) phone. However, like with Betamax, there's more to winning than just superior technology. Nokia just doesn't have that something. This phone will serve geeks and enthusiasts well, but it just doesn't have the character to be adopted widely, and as a developer, I'd like to see the programs I write, as well as the skills that I will develop, still have relevance several years from now.</p>
</li>
<li>
<p>Android: Android is this happy medium between the two. The Android platform is open source. The phones... well, not so much. While they all run more or less the same open source android OS, they are still chained to the whims and pleasure of the manufacturer and telecom carrier, not the consumer. The recent Motorola Cliq is a perfect example of this. This is a new phone, having only been released since last November. But already the OS is quite outdated, running android 1.5, it's now three versions behind the latest that the Nexus One is running (2.1). I certainly understand that there are complications in upgrading the device, but it's the fact that Motorola/Tmobile has delivered a device that although is running an open source OS, is completely locked down disallowing the user to upgrade the phone himself. Ingenious hackers have <a href="http://www.redmondpie.com/how-to-root-motorola-cliq-for-full-android-access-9140260/">rooted the device</a> (without motorola's help mind you) but there is still trouble in installing new OS images. The Motorola Cliq is NOT an open source friendly phone and is defeinitly not the phone for me.</p>
</li>
</ul>
<p>So a few weeks ago I was reading Android developer docs and was becoming really impressed with the platform. Even though it's all Java based, and not my beloved Python, at least it wasn't Objective C. And even though there are some closed source google APIs included, the great majority of android is open source. I was starting to the get feeling that this was a platform I could roll with. But the most modern phone available on a carrier I can afford (have you seen the prices for family plans on Verizon, sheesh) was the Motorola Cliq, and that phone deeply depresses me. So, did I want one of the older Android phones, the MyTouch or the G1? Hell no, I wanted something at least as powerful as the droid, if not as powerful as the N900 itself. Ah, but then all the rumors of the Nexus One starting cropping up all over the web.</p>
<ul>
<li>Nexus One: A brand new, modern android phone, more powerful than the droid, hell more powerful than the N900 (at least on paper), not running any proprietary Motorola firmware, made by google who has an interest in making this the flagship android offering and playing nicely with developers, they made it <a href="http://android.modaco.com/content/google-nexus-one-nexusone-modaco-com/299078/how-to-unlock-the-bootloader-on-your-nexus-one/">easy to unlock the bootlader</a> (literally just reboot holding down the trackball and entering a special command).. the list goes on. <strong>This phone is still no N900, but this just might be the first mainstream, truley open-source phone, that has the gumption to compete directly with the iPhone.</strong></li>
</ul>
<p>So I bought one :)</p>
<p>Here's my initial impressions:</p>
<ul>
<li>
<p>Fedex is soo good at what they do. I set firefox to continuously reload <a href="http://www.google.com/phone">http://www.google.com/phone</a> during the Nexus One press launch, and as soon as the page went live I purchased the phone. Google paid the shipping and HTC sent it Fedex overnight. Less than 24 hours later, it was in my mailbox. Nice!</p>
</li>
<li>
<p>It's going to take me a while to get used to the keyboard. I have zero experience with touchscreen keyboards without the aid of a stylus.</p>
</li>
<li>
<p>Dictation works pretty well, kinda alleviates the problem above, although I probably would feel awkward using it in public.</p>
</li>
<li>
<p>The software keys at the bottom of the phone are very finicky. Although having used the phone for a few hours now, I think I got the handle of them now.</p>
</li>
<li>
<p>Navigation is fantastic. The GPS lockon was instantaneous, using dicatation to give the desired address worked flawlessly, the turn by turn speech is understandable, and the map displayed is updated quickly (even over EDGE) and looks great.</p>
</li>
<li>
<p>Just got Sipdroid setup and I can make VoIP calls for practically nothing :) (I have only tested it on WiFi so far, don't have 3G yet)</p>
</li>
<li>
<p>I can't connect to my home router that's only 8 feet away, even though it sees it, no idea why. I'm using WPA2 PSK AES, maybe it doesn't like AES? Can connect to the neighbors unprotected wifi ("linksys") no problem though ;)</p>
</li>
<li>
<p>The web browser works great and is speedy even on EDGE. I think something was terribly wrong in <a href="http://www.engadget.com/2010/01/04/nexus-one-review/">the Edgadget browser test</a> because when I tried the same test (on WiFi), I got the page to load up at the exact same time the iphone did in the video, and seriously, why wouldn't it? Both the iphone and the Nexus One use webkit.</p>
</li>
</ul>
<p>I'll update this list if anything else hits me.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Writing an OpenOffice.org Calc extension in Python]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2009/12/13/writing-an-openoffice.org-calc-extension-in-python" />
    <id>http://www.enigmacurry.com/2009/12/13/writing-an-openoffice.org-calc-extension-in-python</id>
    <updated>2009-12-13T10:08:00Z</updated>
    <published>2009-12-13T10:08:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="python" />
    <category scheme="http://www.enigmacurry.com/" term="openoffice.org" />
    <summary type="html"><![CDATA[Writing an OpenOffice.org Calc extension in Python]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2009/12/13/writing-an-openoffice.org-calc-extension-in-python"><![CDATA[<p>A very well organized group of thugs steals my money every day. I'm getting really tired of it, but I found a way to save at least some of my money so they don't steal nearly as much of it, nearly as often. For whatever reason, this gang hasn't devised a way to steal gold and silver nearly as efficiently as these little green pieces of paper that they call money. So I buy gold and silver whenever I can as a hedge against 'inflation' (which is really just their gang-speak for the wholesale-theft of my money.)</p>
<p>I want to keep track of how much gold and silver I've bought, when I bought it, and inevitably I'll still want to know how many green pieces of paper I could theoretically trade it all in for.</p>
<p>The easiest way to track all this information was to create a spreadsheet in OpenOffice.org's Calc. I created a sheet for gold purchases and another sheet for silver purchases. Everytime I make a purchase, I record the number of ounces, what form it is in (coins, bars, junk etc), who I bought it from, when I bought it, and the price I paid in FRNs (Federal Reserve Notes, aka green pieces of paper.) On another sheet I total the number of ounces I own and multiply it by the current spot price for the metal, which gives me the current price I could get if I sold it for FRNs. When tallying this total, I reference a special cell on the sheet, one that has the current spot price for gold, and another for silver.</p>
<p>But checking the spot price myself and manually updating those cells was just too tedious for my programmer's heart. I wanted OpenOffice.org to automatically retrieve this information for me. So, I started researching OpenOffice.org extensions (plugins).</p>
<p>Turns out, OpenOffice.org extensions can be written in my favorite programming language, Python (yea!), so I wrote the following extension a few weekends ago. It's <a href="http://github.com/EnigmaCurry/SpotMetal">on github</a> and can be downloaded with git:</p>
<div class="pygments_murphy"><pre>  git clone git://github.com/EnigmaCurry/SpotMetal.git
</pre></div>

<p>If you just want the pre-compiled extension, it can be downloaded here locally:</p>
<p><a href="/blog-post-files/SpotMetal-0.1.oxt">SpotMetal-0.1.oxt</a></p>
<p>You install it inside OpenOffice.org by going to <code>Tools -&gt; Extension Manager</code> and clicking on <code>Add</code> and browsing to the <code>SpotMetal-0.1.oxt</code> file you downloaded or built yourself.</p>
<p>Once you have it installed, you now have a new Calc function available called <code>SPOTMETAL</code> which takes two arguments:</p>
<ul>
<li><em>metal</em> - Which metal you want to look up. Can be one of <code>"gold", "silver", "platinum",</code> or <code>"palladium"</code></li>
<li><em>bidAsk</em> - Whether you want the bid or the ask price. Can be either <code>"bid"</code> or <code>"ask"</code>.</li>
</ul>
<p>The price will automatically be refreshed every 5 minutes by default, but you can also force a refresh with the Calc function called <code>SPOTMETALREFRESH</code>.</p>
<p>Here's an <a href="/blog-post-files/MetalTrackerExample.ods">example OpenOffice.org spreadhseet</a> that shows how you might track your own precious metal investment portfolio. The big button labeled "Refresh Spot Price" does what it says it does, but requires a bit more boiler-plate code in order for it to actually display on screen. In OpenOffice.org, you can see another macro called doReCalculate:</p>
<ul>
<li><code>Tools-&gt;Macros-&gt;Organize Macros-&gt;OpenOffice.org Basic</code> </li>
<li><code>MetalTrackerExample.ods-&gt;Standard-&gt;SpotMetal-&gt;doReCalculate</code>. </li>
</ul>
<p>This extra macro is necessary to actually force the spreadsheet to request new data from the extension when you click the "Refresh Spot Price" button.</p>
<p>While this extension might be of use to you if you also invest in precious metals, I guess the main reason I posted this is because it took a good deal of time researching how to write a Python extension for OpenOffice.org. Check out <a href="http://github.com/EnigmaCurry/SpotMetal">the source code on github</a> if you're looking to write your own extension, it's got it's own Makefile and hopefully it's documented well enough for it be useful for someone in the future.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[EnigmaCurry.com now powered by Blogofile]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2009/07/20/enigmacurry.com-now-powered-by-blogofile" />
    <id>http://www.enigmacurry.com/2009/07/20/enigmacurry.com-now-powered-by-blogofile</id>
    <updated>2009-07-20T22:04:00Z</updated>
    <published>2009-07-20T22:04:00Z</published>
    <category scheme="http://www.enigmacurry.com/" term="blogofile" />
    <category scheme="http://www.enigmacurry.com/" term="enigmacurry.com" />
    <summary type="html"><![CDATA[EnigmaCurry.com now powered by Blogofile]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2009/07/20/enigmacurry.com-now-powered-by-blogofile"><![CDATA[<p>Phew! </p>
<p>I've just finished porting this entire site over to my new blog engine, <a href="http://www.blogofile.com">Blogofile</a>. Blogofile is something I've been working on for the last several months, and really it's been pretty much complete for the last two of those months; it turns out that transferring the 100+ posts that I've made on this blog since 2005, first using TikiWiki, then Wordpress (using a myriad of different plugins over the years) was a much larger task than writing Blogofile itself. Or, at least writing Blogofile was a lot more fun, which is why it probably took me so long to do the relatively mundane task of porting EnigmaCurry to the new platform.</p>
<p>Blogofile is best described as a Blog Compiler -- just as a programmer's compiler takes source code and spits out a running program, a blog compiler takes a special blog source code language and spits out raw HTML, the native format of all blogs everywhere. What this means is that any webserver can host the Blogofile based blog, without having to install any special software, not even Blogofile, it's just HTML. You can run Blogofile on any computer that has Python installed, upload the HTML it generates to your webserver, and your webserver remains lean and fast.</p>
<p>You can read more of the great features of Blogofile <a href="http://www.blogofile.com">on it's own site</a>.</p>
<p>One of the biggest motivators in my finishing up moving EnigmaCurry.com over to Blogofile is because, quite frankly, MySQL 5.x blows chunks. It consumes ridiculous amounts of RAM for my pitifully small wordpress database, and when it eventually overwhelms my VPS and forces a restart, the tables are corrupted, especially the mysql user table which requires running "mysqld --skip-grant-tables" in order to get running again just so I can get in to repair the damage. I've seen this happen on two different (but pretty much stock configured) Ubuntu 9.04 servers, so I know it's not an isolated case. I've pledged to myself to never use MySQL in future projects. Do yourself a favor:</p>
<div class="pygments_murphy"><pre>sudo apt-get remove mysql-server-5.0
</pre></div>

<p>Please don't hesitate to <a href="http://mailhide.recaptcha.net/d?k=01VHGYFI7WE9jB_dHebD-0JQ==&amp;c=3qCKNvkRgZtCa5B5PJcptJVgaDI5-xiMjUjHgQi3vIw=">let me know</a> if you see something awry with the site, there's bound to still be a few things missing/corrupted from the transfer.</p>]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Ambient Composition 1]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2009/05/31/ambient-composition-1/" />
    <id>http://www.enigmacurry.com/2009/05/31/ambient-composition-1/</id>
    <updated>2009-05-31T15:24:07Z</updated>
    <published>2009-05-31T15:24:07Z</published>
    <category scheme="http://www.enigmacurry.com/" term="music" />
    <summary type="html"><![CDATA[Ambient Composition 1]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2009/05/31/ambient-composition-1/"><![CDATA[
<p>I've always wished that I was a musician, I love music. When I was young, my parents even paid for piano lessons, although I gave that up shortly after. Back then I saw it as tedious, and I never saw any real improvement.</p>

<p>I'm hoping to change direction. I seem to always have a tune inside my head and it needs to get out!</p>

<p>I recently bought a new computer powerful enough to run some pretty amazing software synthesizers, so I've started composing some music. Here's a pretty basic one I wrote today:</p>

<object type="application/x-shockwave-flash" data="/flash/mp3player.swf" id="audioplayer1" height="24" width="290"><param name="movie" value="/flash/mp3player.swf"><param name="FlashVars" value="playerID=1&amp;bg=0xf8f8f8&amp;leftbg=0xeeeeee&amp;lefticon=0x666666&amp;rightbg=0xcccccc&amp;rightbghover=0x999999&amp;righticon=0x666666&amp;righticonhover=0xffffff&amp;text=0x666666&amp;slider=0x666666&amp;track=0xFFFFFF&amp;border=0x666666&amp;loader=0x9FFFB8&amp;soundFile=http%3A%2F%2Fenigmacurryweb.s3.amazonaws.com%2FRyan_McGuire_-_Ambient_Composition_1_-_May_31_2009.mp3%3FAWSAccessKeyId%3D0JN1QB6N50D9MPHAQ8R2%26%23038%3B"><param name="quality" value="high"><param name="menu" value="false"><param name="bgcolor" value="#FFFFFF"></object><br/>
(press play or <a href="http://enigmacurryweb.s3.amazonaws.com/Ryan_McGuire_-_Ambient_Composition_1_-_May_31_2009.mp3?AWSAccessKeyId=0JN1QB6N50D9MPHAQ8R2&">right click here to download</a>)

<p>It's pretty ambient. This is for two reasons:</p>
<ol>
	<li>I actually <em>like</em> ambient music, eg. Harold Budd or The Dead Texan.</li>
	<li>It's got a low barrier to entry, nice long whole notes. :)</li>
</ol>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://www.enigmacurry.com/</uri>
    </author>
    <title type="html"><![CDATA[Distributing Jython Apps in a Single JAR file]]></title>
    <link rel="alternate" type="text/html" href="http://www.enigmacurry.com/2009/05/20/distributing-jython-apps-in-a-single-jar-file/" />
    <id>http://www.enigmacurry.com/2009/05/20/distributing-jython-apps-in-a-single-jar-file/</id>
    <updated>2009-05-20T14:20:51Z</updated>
    <published>2009-05-20T14:20:51Z</published>
    <category scheme="http://www.enigmacurry.com/" term="python" />
    <category scheme="http://www.enigmacurry.com/" term="java" />
    <summary type="html"><![CDATA[Distributing Jython Apps in a Single JAR file]]></summary>
    <content type="html" xml:base="http://www.enigmacurry.com/2009/05/20/distributing-jython-apps-in-a-single-jar-file/"><![CDATA[
<p>I've been writing a lot of one-off type applications at work lately, which is always kind of a joy for me because these sorts of applications don't need to be maintained or supported in any way, which means I can write them however I want.</p>

<p>So I write them in Python :)</p>

<p>Jython allows me to interface with all the plethora of Java libraries that we use at work, and it lets me program in a language that not only I can tolerate, but one that I respect and love.</p>

<p>But even though these are one-off applications, they still need to be easy to use, and in some cases I won't even be the one running the application. I want these applications to just work damnit.</p>

<p>So, packaging my Jython application into a single executable jar file that contains all of the third party dependancies inside is my goal. I want to send the user the jar file, have them double click on it, and have it immediately start running. It can't get a whole lot easier than that.</p>

<p>The <a href="http://wiki.python.org/jython/JythonFaq/DistributingJythonScripts">Jython wiki has a page</a> about doing something along these lines. The recipe there called the <a href="http://wiki.python.org/jython/JythonFaq/DistributingJythonScripts#UsingtheJarMethod">Jar Method</a> works quite well. The one drawback that it has is that all of the Java dependancies need to be exploded into the main jar root, which when you're dealing with dozens of jar dependancies, it can start to get tedious, messy, and in some cases will even violate the license of a particular library.</p>

<p><a href="http://one-jar.sourceforge.net/">One-Jar</a> is a special class loader that can load a jar file that is inside of another jar file, something that the regular class loader from Sun is incapable of doing. Using One-Jar lets my application reside inside of a jar file and contain all my dependancies as seperate jar files inside the main jar file.</p>

<p>I've created a sample project that shows how I normally create a new Jython project hosted inside a single jar file with One-Jar. You'll need the following tools to check out the project:</p>

<ul>
    <li>A Java SDK (tested with <a href="http://openjdk.java.net/">OpenJDK 1.6</a>)</li>
    <li><a href="http://ant.apache.org/">Apache Ant</a> (tested with version 1.7)</li>
    <li><a href="http://git-scm.com/">Git</a> (to checkout the project)</li>
</ul>
<p>Check out the project like so:</p>

<div class="pygments_murphy"><pre> git clone git://github.com/EnigmaCurry/Single-JAR-Jython-Example.git
</pre></div>



<p>Build the project:</p>

<div class="pygments_murphy"><pre><span class="nb">cd </span>single-jar-jython-example

ant
</pre></div>



<p> Run the example by double clicking it or via the command line:</p>

<div class="pygments_murphy"><pre> java -jar JythonExcelExample.jar
</pre></div>



<p>This is just a demonstration app, it doesn't do a whole lot, it outputs an excel file in the current directory listing some computer parts. The point of the application is to show how Jython can integrate with existing Java third-party libraries (in this case Apache POI.)</p>

<p>Instructions for basing your own application on this example are contained inside the README.txt file.</p>
]]></content>
  </entry>
</feed>
