<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Matt Harrison&apos;s blog</title><link>http://panela.blog-city.com/</link><description>Discussion of python, open source, linux, wiimotes, development, ajax, etc.</description><copyright>Copyright 2010 panela.blog-city.com</copyright><generator>Matt Harrison</generator><lastBuildDate>Mon, 08 Feb 2010 22:13:00 GMT</lastBuildDate><image><title>Matt Harrison&apos;s blog</title><url>http://server1.blog-city.com/images/bc_v5_logo_small.gif</url><link>http://panela.blog-city.com/</link></image><ttl>360</ttl><docs>http://backend.userland.com/rss</docs><item><title>Baby steps....</title><guid isPermaLink="true">http://panela.blog-city.com/baby_steps.htm</guid><link>http://panela.blog-city.com/baby_steps.htm</link><pubDate>Tue, 02 Feb 2010 06:02:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=baby%5Fsteps</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>After figuring out that I should use <a href="http://www.emacswiki.org/emacs/LineNumbers">linum</a>, I started the lisp code for emacs support for python code coverage from scratch.  It felt a little like chaining generators.  Write a small function, test it in the scratch window....</p>
<a href="http://www.flickr.com/photos/95273892@N00/4323922581/" title="pycov by matt_harrison, on Flickr"><img src="http://farm3.static.flickr.com/2682/4323922581_5f1f997419_o.png" width="531" height="474" alt="pycov" /></a>
<p>Notice the pretty red, and the *pycov* in the lower right.  <a href="http://github.com/mattharrison/pycoverage.el">Code here</a>]]></description><category>python</category><category>emacs</category><category>pycoverageel</category></item><item><title>How to set up a Goaltimate field</title><guid isPermaLink="true">http://panela.blog-city.com/how_to_set_up_a_goaltimate_field.htm</guid><link>http://panela.blog-city.com/how_to_set_up_a_goaltimate_field.htm</link><pubDate>Thu, 14 Jan 2010 17:32:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=how%5Fto%5Fset%5Fup%5Fa%5Fgoaltimate%5Ffield</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I continue to prefer Goaltimate for groups of 13 or less.  It's a great game, one gets lots of touches and newbies, seasoned folks can play together.  I think it improves new ultimate players throws better than ultimate does.  It's great for warming up.  We usually play until we have enough for ultimate.  People continue to be skeptical before playing, and the majority comment something like this after playing:</p>
<ul>
<li>"That's a lot more fun than I thought it would be"</li>
<li>"That's cool.  Where did you get the hoop?"</li>
<li>"I prefer this to ultimate"</li>
</ul>
<p>Ok, only a few say the last one, but they have said it.  Then there's the group of people who won't give goaltimate a chance.  They'll either sit out and wait til there's 10 people and then want to jump to full field 5 on 5 ultimate, or they'll play grudgingly.  There seems to be another small group of people who believe that goaltimate is too hard on their bodies (knees and ankles) who also won't play unless they've got 5 other people begging them to.  But I'm digressing.</p>
<p>A complaint I've heard is that it takes too long to set up goaltimate.  I don't think that's valid.  (With the aluminum hoops it's even quicker).  A field can be set up in about 2 minutes.  Here's how:</p>
<h2>How to set up a Goaltimate field</h2>
<h3>Step 1: Find a good field</h3>
<p>A benefit of goaltimate is that it can be played in smaller areas.  I've played inside in basketball courts.  Can't do that with ultimate.  Also, nice large grassy areas tend to get chewed up quickly.  But smaller ones not so much.  So you can usually play goaltimate on a better field (often it's right next to the ultimate field).</p>
<h3>Step 2: Step up the hoop stakes</h3>
<p>Because the hoop is fixed in size, it's important that it be set up the correct distance of 18 feet.  Here's an easy way to do it.  If you got a pvc set (with 8 pieces) connect 4 of them.  That will be 16 feet long, so stick a foot on each side and you've pretty much got 18 feet.  If you've got the nicer aluminum poles, find the middle and mark it with a sharpie.  Here's an illustration that should make it pretty clear.</p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step1.png' title='step1.png'/>
<p>Setting up the pole is a two person job.  (As is taking it down).  Have a person on both ends of the pole and put both ends on the stakes at the same time.  People seem to be wary of making the pole bend, but it will do it.</p>
<h3>Step 3: Goal line cones</h3> 
<p>The goal line cones are set inline with the hoop, 3 feet away from each stake, making them 24 feet apart from each other.<p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step2.png' title='step2.png'/>
<h3>Step 4: Back goal cone</h3>
<p>From the hoop take 8 paces back (I'm assuming your paces are 3 feet), and drop a cone.  Note that the depth of the goal is the same as the width of the front cones.  It seems that some like shallow endzones (perhaps the intent is to make the goal actually be a semi circle, which it is not).  The full endzone opens things up a little and allows for more endzone throw possibilities.  Here's an image:(The rest of the images are top down)  (Note that the regulation field image (the circular one) doesn't have the endzone scaled correctly)</p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step3.png' title='step3.png'/>
<h3>Step 5: Finish the goal cones</h3>
<p>From the back cone I work my way around with 3 more cones on each side.</p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step4.png' title='step4.png'/>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step5.png' title='step5.png'/>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step6.png' title='step6.png'/>
<h3>Step 6: Make the "crease" (optional)</h3>
<p>If your players tend to goaltend a lot and don't like the 3 second rule (or just step out if front of the hoop and poach there), you can make the crease in front.  The rules specify that you can't hang out in the area 1 yard in front of the goal either.</p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step7.png' title='step7.png'/>
<h3>Step 7: Set up clear/2 point line</h3>
<p>From here on out I'm no longer "regulation".  I've never seen a circular field in the different games I've played at.  Most are either rectangular or boundless.  When we play indoors, we play rectangular (obviously), and we play without boundaries outside.<p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step8.png' title='step8.png'/>
<p>Regulation calls for a clear line of 30 yards that arcs out from the hoop.  And then a 2 point line (that is parallel to the goal line) at 20 yards out.  Again we normally just set up four cones about 20 yards back for a clear/2 point line.  The distance of 20 yards can be tweaked depending on energy levels, number of players or field size.</p>
<img src='http://www.goaltimate.com/images/FieldDimensions.gif'/>
<p>Another (non-regulation) tweak that we add is a cone about 10 feet behind the endzone.  This is the "no-clear" area.  If the disc ends up behind it on a turnover, you don't need to clear.  Some people are confused in that they think they can clear it there as well.  NO!  If they pick it up behind the cone, then they are cleared, otherwise the only way to clear is the normal clear line.</p>
<p>Here's another illustration with dashed lines indicating what the cones are meant to<p>
<img src='http://files.blog-city.com/files/F05/96843/p/f/step9.png' title='step9.png'/>
<h3>Other tweaks</h3>
<p>We normally play 3 on 3 or 4 on 4.  If we've got more people, then we'll sub on error.  What that means is if you throw an uncatcheable throw, or you drop a catcheable throw, you sub out.  This tends to give everyone a pretty fair playing time.</p>
<p><a href="http://panela.blog-city.com/howto_make_hoops_for_goaltimate_goaltimate_kit.htm">I've posted previously about how to make hoops</a>.  My original PVC set got a crack yesterday as a player collided with the hoop (must have blended in with the white snow).  I'm a fan of the aluminum hoops (which I also have).  They are better in every way; lighter, smaller, easier to store, easier to setup, easier to take down, and more durable.  Why weren't we using them yesterday you ask?  Because my friend who has (permanently borrowed) my PVC set arrived first....</p>]]></description><category>goaltimate</category><category>ultimate</category><category>frisbee</category><category>disc</category></item><item><title>On the importance of standards</title><guid isPermaLink="true">http://panela.blog-city.com/on_the_importance_of_standards.htm</guid><link>http://panela.blog-city.com/on_the_importance_of_standards.htm</link><pubDate>Wed, 13 Jan 2010 06:14:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=on%5Fthe%5Fimportance%5Fof%5Fstandards</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p><a href="http://blog.insightvr.com/?p=209">My brother has a good anecdote about using OpenGL</a>.  It allowed him to take software that he had written 12 years ago and easily port it to both the <a href="http://www.battleforvesta.com/">iphone</a> and python in about 2 days (1 day each).  This would have been impossible had he used DirectX (not that it existed then, but you get the point).</p>]]></description><category>opengl</category><category>iphone</category><category>python</category></item><item><title>The &quot;promise&quot; of faster Python</title><guid isPermaLink="true">http://panela.blog-city.com/the_promise_of_faster_python_1.htm</guid><link>http://panela.blog-city.com/the_promise_of_faster_python_1.htm</link><pubDate>Tue, 05 Jan 2010 21:55:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=the%5Fpromise%5Fof%5Ffaster%5Fpython%5F1</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I spent this morning trying out <a href="http://github.com/rfk/promise">promise</a>.  Promise is a project that hints at speeding up native python by decorating functions.  From the README:</p>
<q>This is a module for applying some simple optimisations to function bytecode.
By promising that a function doesn't do certain things at run-time, it's
possible to apply optimisations that are not legal in the general case.</q>
<p>That seems like a quite a novel idea for dynamic languages.  So I figured I'd try it out on some work that pulls a bunch of numbers from a db and runs some calculations on then.  To get rid of the db overhead of querying, I cached all the db results during a "pump prime" initial query.  Then I timed the calculation 4 times and stored the result.  I then used <a href="http://codespeak.net/pypy/dist/pypy/tool/lsprofcalltree.py">lsprofcalltree.py</a> and kcachegrind to find out which of my functions were taking the most time.</p>
<p>Now how to invoke promise?  The docs are sparse, basically there is a readme and a few testcases.  Luckily the <a href="http://www.reddit.com/r/Python/comments/almdf/optimize_python_functions_by_marking_certain/">folks on reddit</a> had <a href="http://wiki.python.org/moin/MelbournePUG?action=AttachFile&do=get&target=promise.odp">pointed to an .odp slideshow</a>.  In the slideshow functions are decorated with the following decorators:</p>
<table>
<tr>
<td><em>Decorator</em></td>
<td><em>Docstring</em></td>
</tr>
<tr>
<td>invariant</td>
<td>Promise that the given names are invariant during the function call.

    This promise allows the names to be loaded once, at the beginning of the
    function, and accessed through local variables from there on out.</td>
</tr>
<tr>
<td>constant</td>
<td>Promise that the given names are constant

    This promise allows the objects referred to by the names to be stored
    directly in the code as constants, eliminating name lookups.  We try
    to resolve all constants at decoration time, but any that are missing
    will be deferred until the function first executes.</td>
</tr>
<tr>
<td>pure</td>
<td>Promise that a function is pure.

    A pure function has no side-effects or internal state; it is simply
    a mapping from input values to output values.

    Currently the only optimisation this enables is inlining of constant
    pure functions; other optimisations may be added in the future.</td>
</tr><tr>
<td>sensible</td>
<td>Promise that a function is sensibly behaved.  Basically:

        * all builtins are constant
        * all global functions are constant
        * all other globals are invariant</td>
</tr>
</table>

<p>Since I was writing a testcase for speed measurements (and I wasn't quite sure which decorator to use for my functions) I just did the following (sensible_func names have been changed):
<pre>
def promisize():
    import promise
    sensible_funcs = [slow_func1, slow_func2, slow_func3]
    for sensible in sensible_funcs:
        try:
            sensible = promise.pure()(sensible)
        except TypeError:
            sensible = promise.sensible()(sensible)
        except AttributeError:
            pass
    promise.sensible()(globals())
</pre>
<p>Promise does some checking on your code and complains for various reasons.  I hit an issue with **kw in one of my functions  (pure functions can't contain them for some reason, seems like a lack of implementation rather than a theoretical reason.  But I use **kw a bit so hopefully this is resolved).  So now that my code is "promisized", I loop over the same calculation and time it as well as compare it to the normal version (to make sure that promise isn't breaking anything).  One function was "sensible", all the rest came out as "pure".</P>
<p>The good news?  Promise didn't break anything!  The bad news?  There aren't any nice charts!  That's because the lines would overlap each other.  Promise appears to have no effect on the speed of my code.  When I run the same code with psyco, I get 10-15% improvement.</p>
<p>While, the promise of promise was good, either I'm doing something wrong, or my code isn't amenable to their speed tweeks.  I'd like some more examples on when/why to use which decorators.  Also, some speedup.  Alas, I guess I'll need to keep waiting for PyPy to deliver...</p>]]></description><category>python</category><category>promise</category><category>pypy</category></item><item><title>2009 Year in review</title><guid isPermaLink="true">http://panela.blog-city.com/2009_year_in_review.htm</guid><link>http://panela.blog-city.com/2009_year_in_review.htm</link><pubDate>Fri, 01 Jan 2010 20:54:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=2009%5Fyear%5Fin%5Freview</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>In the spirit of the Planet Python 2009 meme, I'm doing a more general review (that still includes Python).</p>
<h2>Work</h2>
<p>Work was pretty busy this year, which is good, things are looking well for 2010.  In the spirit of Google's 20% projects, we <a href="http://battleforvesta.com/?pan">just released, Battle for Vesta.</a>  I only had a minor role in this, but it has been fun to see it progress.  There was even a Python port done along the way (perhaps a post on that later).  If you've got an iphone and like 3d space shooters, give it a try.</p>
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/pxhd-5D6QVQ&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/pxhd-5D6QVQ&rel=0&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object>
<p>I had some fun with some smaller contracts.  Implementing a youtube-lite site in Django.  I've also been doing some really cool prototyping work for next-gen smart phone interfaces, using Pylons.  In addition our flagship product appears to be gaining attention, we'll see how it fares in the new year.</p>
<p>The main technologies used this year have been Pylons, django, YUI, <a href="http://blog.insightvr.com/?p=30">hacked xlwt</a>, postgres, and matplotlib (plus the iphone project).  I've dabbled a tiny bit in <a href="http://code.google.com/p/iui/">iui</a> and <a href="http://www.jqtouch.com/">jqtouch</a>.  I keep wanting to use jquery, but am pretty heavily invested in yui (have a custom widget that isn't available elsewhere), and hence am reticent to mix toolkits.  I should overcome this fear though, cause I think jquery will be more succinct for a lot of my js stuff.</p> 
<p>Though I program heavily in both JavaScript and Python, I still find myself getting annoyed with JavaScript.  The closure soup mess that hacks everything together just gets to me.  Couple that with everyone doing things differently, browser incompatibilities and poor environments leaves me scratching my head...</p>
<h2>Side projects</h2>
<p>I <a href="http://github.com/mattharrison">got a github account this year</a>, and have been putting some projects on it.  <a href="http://github.com/mattharrison/pykeyview">Pykeyview</a> is a nice little OSD for showing keystrokes during presentations/screencasts.  Sadly <a href="http://bugs.freedesktop.org/show_bug.cgi?id=20500">recent versions of X have borked the RECORD extension</a>.  Once that gets fixed and I have some time I'd like to do some emacs screencasts.</p>
<p><a href="http://github.com/mattharrison/Inkscape-Slicer-Extension">Inkscape Image Slicer</a> is an Inkscape plugin that allows for slicing of images.  I made it a while ago, but I've been fixing it up, hoping for inclusion in .48.  I use it almost weekly for work and also when doing graphics for presentations.  Give it a try if you're interested in that sort of stuff and <a href="https://bugs.launchpad.net/inkscape/+bug/169985">comment on the bug</a> to see if we can get it included in Inkscape proper.</p>
<p><a href="http://docutils.sourceforge.net/sandbox/rst2odp/">rst2odp</a> is another project that I continually hack as needed.  It converts restructured text to open office slides.  2009 saw some external patches!  Damian Conway reviewed my slides at OSCON and commented that they were quite beautiful.  I didn't tell him that they were computer generated.  I'll probably hack as needed again this year.  Perhaps use github and push patches back to the docutils svn.  Though I've also been thinking about rst2emacs.... (there's not enough time), which I think would be cool for demoing/live coding/etc.  <a href="http://www.mechanicalcat.net/richard/log/Python/python__m_bruce_presentation_rst">Bruce</a> has an inline Python interpreter, but to me it just makes sense to go all out if you want that and use emacs.  With ttf support in 23 it couldn't be too much uglier than s5.</p>
<p>I've started <a href="http://github.com/mattharrison/pycoverage.el">hacking on emacs code coverage support for Python</a>.  It needs help, my elisp is poor, and there isn't enough time.  Perhaps, I'll sprint on this at PyCon.  I'd also like to get Python support into <a href="http://github.com/mattharrison/emacs-starter-kit">Emacs Starter Kit</a>, hence my fork of the project.</p>
<p><a href="http://code.google.com/p/argparse/issues/detail?id=35">Pushed a patch to argparse</a> for support of unix hierarchy (ie pulling configuration information from env and config files).  Hopefully its status moves from accepted to closed ;)</p>
<p>Wrote a simple math program for my daughter's XO.  Need to post the code as well as make it harder for her now...</p>
<h2>Conferences</h2>
<p>Presented at SCALE, PyCON, OSCON and UTOSC on Python Scripting, Wiimotes and Code Coverage.</p>
<a href="http://www.flickr.com/photos/pinarozger/3769516620/in/set-72157621652734691/"><img alt="Mitch Altman saves the lightsaber" src="http://farm4.static.flickr.com/3563/3769516620_3fcce9ff4b.jpg" title="Make Booth at OSCON 2009" width="500" height="334" /></a><p class="wp-caption-text">Mitch Altman saves the lightsaber.  Photo by Pınar Özger</p>
<h2>Books read</h2>
<p>Read a few technical books this year:</p>
<ul>
<li><em><a href="http://oreilly.com/catalog/9780596526870">CSS: The Missing Manual</a></em>  This might be one of the best technical books I've read.  Perhaps it was because McFarland so clearly explained concepts that I've struggled with.  I've read other CSS books, and they made me want to pull my hair out.  This was a great read.  If you are interested in CSS this is the book for you.  My only complaints are lack of explaining css manipulation with javascript (I think it's relevant coming from a developer, perhaps not so much from a designer), no coverage on css sprites (again my inkscape slicer works well for making these :), and perhaps it's getting outdated with CSS3 support coming out in many browsers.  (Though it does cover some CSS3 stuff).  (Yeah I know, I need to apply this book to my blog....)</li>
<li><em><a href="http://www.amazon.com/Physical-Database-Design-professionals-exploiting/dp/0123693896">Physical Database Design</a></em>  I got this book from the <a href="http://www.datascaler.com/">folks at Datascaler</a>.  It talks about Indexes, Materialized View, Query Plans, Clustering, Range Partitioning, OS Tweaking, OLAP and Denormalization.  It has good introductory coverage of these topics.  My only complaint is that it focuses on commercial db's, Oracle, DB2 and SQL Server.  It be nice to get Postgres in there, but much of the information is platform agnostic.  A NOSQL version of this book might be interesting, as it seems to be the fad of the day.</li>
<li><em><a href="http://oreilly.com/catalog/9780596006488">Learning Emacs</a></em>  In my quest to become more proficient at emacs I read this book.  I picked up a few keystrokes along the way.  It seems a little dated and it's coverage of elisp was a little lighter than I would have liked.</li>
</ul>
<h2>Hardware/Software</h2>
<p>My main system is a ThinkPad T61p running Gentoo.  I've got 4gb and am running 64bit.  Wow, I've been using Gentoo since 2002 (or 2001?).  For the most part it works well.  My biggest complaint is flakiness of flash on 64 bits (blame pandora).  I run windows in a VirtualBox because I've yet to get L2TP vpn working in Linux.  I also run the Android live cd in VirtualBox (much faster than the emulator).</p>
<p>People complain about linux hardware support, but I've been very happy with my ThinkPads (knock on wood).  Suspend works, wifi, graphics, external monitors just work.</p>
<p>I'm connected to a 24 inch Dell that seems to work well, except for the occasional horizontal ghosting (tweaking the VGA cable seems to help).  I'm been running the Awesome tiling window manager all year, and have few complaints with it.  (It makes my computer harder for others to use which I guess is a mixed blessing).</p>
<p>I also traded in my Microsoft ergonomic keyboard for a <a href="http://pckeyboards.stores.yahoo.net/en104wh.html">Unicomp Endurapro buckling spring keyboard</a>.  I'm quite pleased with it, as are most people who try it out.  Though it is loud, which complicates the occasional early/late work hours.</p>
<p>An Intel Solid State harddrive was in my laptop for a while this year.  I was very happy with that.  If your application is seek heavy (which many db's are), you will love the order or two magnitude of improvement in seek times.</p>
<p>As far as software, I'm running konsole, akregator, emacs, firefox, chromium, VirtualBox, OpenOffice, okular, and exhaile.</p>
<p>Am running Ubuntu on servers and other laptops.  I like the flexibility of gentoo, though it has an overhead with it that I don't want on other computers.</p>
<h2>Blogs/Sites</h2>
<p>I'm contemplated signing up for twitter various times this year.  I feel like it could be useful but also a distraction.  How do people deal with this?  I've already got 60+ blogs on my feed reader (about 12 planets).  Couple that with surfing reddit (which doesn't support feeds very well) and you can sink a lot of time into following others.  Facebook is less of a temptation, since I view it as a bigger time sink with less value.  (Though it would have come in useful a handful of times...)</p>]]></description><category>emacs</category><category>python</category><category>rst2odp</category><category>awesomewm</category><category>vesta</category><category>iphone</category></item><item><title>[ANN] ScriptMachine</title><guid isPermaLink="true">http://panela.blog-city.com/ann_scriptmachine.htm</guid><link>http://panela.blog-city.com/ann_scriptmachine.htm</link><pubDate>Tue, 22 Dec 2009 21:45:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=ann%5Fscriptmachine</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I've got a few scripts at work that I think are getting hairy.  Not in the code smell sense, but rather in the maintenance of forking sense.  They are batch scripts (run on weekly/daily intervals) customized to a users environment.  They work but as I get more users I don't want to have to deal with customized forks of the master script.  I want to abstract out this customization to a higher level.  Plus some users will need different scripts executed at pre/post intervals depending on their situation.</p>
<p>In thinking about this a little, I think what I what is a library of (python) functions and scripts (bash/executable/etc).  Then for each user I want to compose these scripts/functions in a state machine specific to them.  Each user will have a smaller, hopefully legible (hacking graphviz visualization will be simple) definition file that creates the master script (or state machine).  I should be able to 'run' the state machine, or subgraphs of it.  This is probably overkill for simple scripts or one-offs, but I'm not really dealing with that now.</p>
<p>I'm calling this <a href="http://github.com/mattharrison/ScriptMachine">ScriptMachine</a>.</p>
<p>Comments/questions welcomed</p>]]></description><category>python</category><category>scripts</category></item><item><title>OpenOffice label mail merge from a spreadsheet</title><guid isPermaLink="true">http://panela.blog-city.com/openoffice_label_mail_merge_from_a_spreadsheet.htm</guid><link>http://panela.blog-city.com/openoffice_label_mail_merge_from_a_spreadsheet.htm</link><pubDate>Tue, 15 Dec 2009 07:58:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=openoffice%5Flabel%5Fmail%5Fmerge%5Ffrom%5Fa%5Fspreadsheet</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>Spent a while this morning trying to print out xmas labels from a spreadsheet.  If you have a spreadsheet containing address information, the first thing to do is <a href="http://openoffice.blogs.com/openoffice/2007/12/how-to-turn-you.html">create an odb database from it</a>.  My wife's Ubuntu Karmic didn't have the ability to create dbs, so I did it on my gentoo machine.  The previous instructions lack one small detail that was necessary for me.  They don't tell you how to "register" the new db.  If the db isn't registered it won't show up on the New->Labels db selection dropdown.</p>
<p>Ok, a confession, the db creation wizard offers to register the db when you create it.  It asks "Do you want to register the database in OpenOffice.org?"  I figured that was a phone-home type registration so being a semi-privacy wary user I unchecked it.  In reality I should have kept this checked.</p>
<p>To "register" the database you created from the spreadsheet (after the fact), use View->Data Sources (on a normal document), then right click "Registered databases ..." and add the new db you just created.  Pretty straightforward.</p>
<p><a href="http://openoffice.blogs.com/openoffice/2006/07/mail_merge_labe.html">Perform a mail merge using that db</a>.  Again this was pretty easy but I had alignment issues.   After printing test pages (and going through the label creation process many times), the easiest was to get the labels aligned, was to edit the "Label text" (note I did this within the Label wizard and not on the "document" that it produces) and add a black space before the text and indent each line by 4 spaces (YMMV, I was using 8160 labels and printing on linux).  Adjusting the margins messed up the label columns (got 2 instead of 3).</p>
<p>The last issue was printer jamming.  Using more than one Office Depot 8160 Inkjet Mailing Label jammed my <a href="http://panela.blog-city.com/using_the_samsung_ml2010_laser_printer_with_linux.htm">Samsung ML-2010</a>.  So feed them individually.</p>
<p>And print them on the correct side, duh!</p>
<p>When I do this next year, it should be a breeze now!</p>]]></description><category>ooo</category><category>mail_merge</category><category>odb</category><category>register</category></item><item><title>New insight on 100% coverage</title><guid isPermaLink="true">http://panela.blog-city.com/new_insight_on_100_coverage.htm</guid><link>http://panela.blog-city.com/new_insight_on_100_coverage.htm</link><pubDate>Wed, 18 Nov 2009 16:56:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=new%5Finsight%5Fon%5F100%5Fcoverage</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>Code coverage gets a bad rap.  People say it's meaningless.  In my "Managing Complexity" talk at <a href="http://panela.blog-city.com/pycon_2008_managing_complexity_slides.htm">PyCon 2008</a>, I made the analogy that code coverage was like a shield.  One is exposed where the shield doesn't cover.  But just because you have shield doesn't mean that your shield is any good.  You could be battling against a fire breathing dragon with a WOODEN shield (smart one Wiglaf).  Your exposed areas could be dead code (which the literature says is more likely to cause bugs) or code that is hard to test.</p>
<p>This last point, code that is hard to test was hit home to me over the weekend when I spent some time going over <a href="http://misko.hevery.com/">Miško Hevery's blog about testability</a>.  While perusing the site and some of his presos, it hit me that 100% code coverage (and I'm talking about the line/statement variety here) indicates something else. That your code is testable.  If you can't get 100% coverage, then you are probably violating some of the <a href="http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/">10 things that make code hard to test</a>.  I especially appreciate the Law of Demeter analogy he uses, (paraphrasing) "You don't give the cashier your wallet when they tell your lunch costs $5.98.  You give them the money (or the credit card)".  So if you are struggling getting the coverage numbers you want, you probably need to use dependency injection to get rid of that Law of Demeter violation....</p>
<p>Of course, <a href="http://nedbatchelder.com/blog/200911/coverage_v32b1_branch_coverage.html">now that Python has branch coverage</a>. we can get to work on some of the interesting things that you get from path coverage.  Oh yeah, <a href="http://github.com/mattharrison/pycoverage.el">editor support</a> would be nice too.</p>]]></description></item><item><title>Dear Intarwebs, what is the deal with Javascript?</title><guid isPermaLink="true">http://panela.blog-city.com/dear_intarwebs_what_is_the_deal_with_javascript_1.htm</guid><link>http://panela.blog-city.com/dear_intarwebs_what_is_the_deal_with_javascript_1.htm</link><pubDate>Thu, 12 Nov 2009 07:10:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=dear%5Fintarwebs%5Fwhat%5Fis%5Fthe%5Fdeal%5Fwith%5Fjavascript%5F1</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>Why does firefox (yeah, it has Firebug so I develop against it) silently ignore errors?  Everytime I think I might like some of Javascript, I'm reminded that I hate the runtime environment (development is slightly less painful with js2-mode and strict use of jslint).  Sure it's a scripting language so it doesn't fail as early as some other languages, but please tell me about the error rather than just siliently doing nothing....</p>
<p>Here's an example, that both firefox and <strike>chromium</strike> (chromium->developer tools->scripts actually tells me whats wrong!) silently ignore (jslint and js2-mode as well).  Python would at least tell me what an idiot I am (or a line number nearby):</p>
<pre>
<div class="highlight"><pre><span class="nt">&lt;html&gt;</span>
<span class="nt">&lt;script&gt;</span>
  <span class="kd">var</span> <span class="nx">frobnicate</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sb</span><span class="o">,</span> <span class="nx">content</span><span class="o">;</span>
    <span class="nx">sb</span><span class="p">[</span><span class="nx">sb</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;foo&quot;</span><span class="o">;</span>
    <span class="nx">sb</span><span class="p">[</span><span class="nx">sb</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;bar&quot;</span><span class="o">;</span>
    <span class="nx">content</span> <span class="o">=</span> <span class="nx">sb</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">);</span>
    <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">&#39;FOO&#39;</span><span class="p">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">content</span><span class="o">;</span>
    <span class="p">};</span>

<span class="nt">&lt;/script&gt;</span>
<span class="nt">&lt;body</span> <span class="na">onload=</span><span class="s">&quot;frobnicate()&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;FOO&quot;</span><span class="nt">&gt;&lt;/div&gt;</span>
<span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span>
</pre></div>
<p>&lt;/End Rant&gt;</p>]]></description><category>js</category><category>javascript missing errors</category><category>firefox</category><category>chromium</category></item><item><title>Veterans Day</title><guid isPermaLink="true">http://panela.blog-city.com/veterans_day.htm</guid><link>http://panela.blog-city.com/veterans_day.htm</link><pubDate>Wed, 11 Nov 2009 16:44:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=veterans%5Fday</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I would be remiss if I didn't thank my grandfather, Paul Huber, for his courage and bravery as he served his country during WWII.  He's being <a href="http://www.veteransday.utah.edu/honorees/index.html">honored today at the U</a>.  For almost 5 years he served his country in Algiers, Sicily, Utah Beach (D-Day), France and Germany.  <a href="http://www.veteransday.utah.edu/honorees/2009/Huber_P/huber_popup.html">A short bio is here</a>, from one of the "Greatest Generation".</p>]]></description><category>wwii</category><category>veterans_day</category></item><item><title>11 essential commands for a tiling window manager</title><guid isPermaLink="true">http://panela.blog-city.com/11_essentials_commands_for_a_tiling_window_manager.htm</guid><link>http://panela.blog-city.com/11_essentials_commands_for_a_tiling_window_manager.htm</link><pubDate>Mon, 26 Oct 2009 17:26:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=11%5Fessentials%5Fcommands%5Ffor%5Fa%5Ftiling%5Fwindow%5Fmanager</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I'm a visual person.  A nice chart or graph somehow fits my brain better than lots of text.  Here's an image I wish I had when I first installed <a href="http://awesome.naquadah.org/">awesome</a>.  I wish I had it a few weeks back when asked about tiling window managers at <a href="http://2009.utosc.com/">UTOSC</a>.  Now I'm thinking about giving the latest version of <a href="http://www.xmonad.org/">xmonad</a> a try (maybe I'll make an xmonad version).  (And if I had more time, I'd hack on the Python tiling wm, <a href="http://www.qtile.org/">qtile</a>).</p>
<center><img src='http://files.blog-city.com/files/F05/96843/p/f/awesomecheat.png' title='awesomecheat.png'/></center>
<p>This covers the default configuration for awesome.  And really that's about all you need to know.  Once you know how to start a terminal, and kill clients, the other basic commands are for navigation and changing layout/float/maximize.</p>
<p>So if you've been thinking about trying tiling wm's, give the recent awesome 3.4 a try.  Your hands and wrists might thank you.</p>]]></description><category>qtile</category><category>awesome</category><category>xmonad</category></item><item><title>Great post about what to do in Python module scope</title><guid isPermaLink="true">http://panela.blog-city.com/great_post_about_what_to_do_in_python_module_scope.htm</guid><link>http://panela.blog-city.com/great_post_about_what_to_do_in_python_module_scope.htm</link><pubDate>Mon, 19 Oct 2009 14:51:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=great%5Fpost%5Fabout%5Fwhat%5Fto%5Fdo%5Fin%5Fpython%5Fmodule%5Fscope</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p><a href="http://plope.com/Members/chrism/import_time_side_effects">Chris McDonough clearly explains what code is appropriate at the module level</a>.  In the spirit of "importing code shouldn't have weird side effects", here's his list:</p>
<ul>
<li>An import of another module or global.
<li>Assignment of a variable name in the module to some constant value.
<li>The addition of a function via a def statement.
<li>The addition of a class via a class statement.
<li>Control flow which may handles conditionals for platform-specific handling or failure handling of the above.
</ul>
<p>And then this great quote: <em>Any other sort of logic inside the top level execution path of a Python module (any code that would be executed during "import") should be regarded with great suspicion and perhaps even loathing.</em></p>
<p>Here here Chris!  Perhaps you should start a Foundation, Crusaders against Suspicious (Python) code.<p>
<p>(I guess this is sort of a retweet, since I didn't want to login to comment)  </p>]]></description></item><item><title>UTOS 2009 Review</title><guid isPermaLink="true">http://panela.blog-city.com/utos_2009_review_1.htm</guid><link>http://panela.blog-city.com/utos_2009_review_1.htm</link><pubDate>Mon, 12 Oct 2009 16:12:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=utos%5F2009%5Freview%5F1</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I had a good time at UTOS.  The first day was mostly spent in my Intermediate Python workshop.  For those who attended I apologize for not having a break!  2.5 hours is a long time to listen to me spout off.  I think the workshop went well though.  We discussed testing (unittest/doctest), functional programming, functions, decorators, iterations, list comprehensions and generators.  After the speaking was the hands on portion.  The room was packed for the first part (some people stood for most of the time).  For the next hour or so people stayed around and hacked on python.  It was really cool to see people who had "only written 3 python programs", write a generator and understand what is happening.</p>
<p>That night we had a Utah Python group meeting.  Stephen McQuay did a great job of introducing Python.  One interesting fact, is that he said the main impetus for him learning python was the <a href="http://xkcd.com/353/">"import antigravity" xkcd cartoon</a>.  I've never heard that one before!</p>
<p>I also talked about coverage and that went well.  I had a little technical glitch at the start as OOo seemed to have problems with the projector.  (I've never seen it before but my presentation would open just fine when the projector was not plugged but would hang when it was.  Very weird and frustrating.  I finally opened OOo and then connected the projector and it worked.  For my workshop I made pdf backups of my preso in case this happened, but didn't bother for this since I had no problem the with the workshop preso.  Live and learn.  Always make a pdf backup on a thumbdrive!)</p>
<p>The other sessions I attended were pretty good.  One note, when you are demoing on a console there are two problems.  One is font size.  The other is that terminals show the input at the bottom of the screen (unless you are ctrl-l'ing all day long), which can be hard to see unless the screen is pretty high.  A tool like <a href="http://github.com/mattharrison/pykeyview">pykeyview</a> can go a long way towards helping with the latter problem (which came up in 2 sessions I attended).</p>]]></description><category>utos</category><category>xkcd</category><category>pykeyview</category></item><item><title>Looking for iphone beta testers</title><guid isPermaLink="true">http://panela.blog-city.com/looking_for_iphone_beta_testers.htm</guid><link>http://panela.blog-city.com/looking_for_iphone_beta_testers.htm</link><pubDate>Thu, 08 Oct 2009 06:13:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=looking%5Ffor%5Fiphone%5Fbeta%5Ftesters</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>My brother has a pretty cool iphone game in the works.  If anyone is <a href="http://blog.insightvr.com/?p=148">interested in beta testing and providing feedback, please get in touch with him!</p>]]></description><category>iphone</category><category>beta</category><category>3d</category><category>game</category></item><item><title>Cheatsheets/Handouts/Slides for Intermediate Python (and Testing)</title><guid isPermaLink="true">http://panela.blog-city.com/cheatsheetshandoutsslides_for_intermediate_python_and_tes.htm</guid><link>http://panela.blog-city.com/cheatsheetshandoutsslides_for_intermediate_python_and_tes.htm</link><pubDate>Thu, 08 Oct 2009 06:06:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=cheatsheetshandoutsslides%5Ffor%5Fintermediate%5Fpython%5Fand%5Ftes</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>Tomorrow I'm giving <a href="http://2009.utosc.com/presentation/119/">a workshop on Intermediate Python at the UTOS</a>.  In the session I'll discuss testing with the unittest and doctest modules for Python.  Then I discuss a bunch of what I consider to be intermediate Python constructs.  Included are decorators, list comprehensions, generators, generator expressions, functional constructs and function arguments.  Included when possible are explanations of why stuff works (such as generators and decorators) rather than just throwing out examples.  Hopefully the theory helps with understanding how to apply this knowledge later.</p>
<center><a href="http://attend.utosc.com"><img src="http://dl.utosc.com/09/badges/utosc2009_Speaker.png" /></a></center>
<p>One might wonder why I'm bundling testing in with the talk?  I guess it's excusable for beginners to neglect testing ;)</p>
<p>I created two handouts (generated with rst2odt) for the workshop, one on testing and another on the intermediate stuff.  I've also generated my slides (via rst2odp of course). <a href='http://files.blog-city.com/files/F05/96843/b/intermediatepython.tar.gz'>A tarball containing said materials is here.</a></p> 
<p>Are people interested in handouts/cheatsheets?  Should I throw the source up to <a href="http://github.com/mattharrison">github</a> if anyone wants to collaborate?</p>]]></description><category>python</category><category>rst2odp</category><category>testing</category><category>intermediate</category><category>list comprehension</category><category>generator</category><category>decorator</category></item><item><title>PyCon rst2odp offer</title><guid isPermaLink="true">http://panela.blog-city.com/pycon_rst2odp_offer.htm</guid><link>http://panela.blog-city.com/pycon_rst2odp_offer.htm</link><pubDate>Wed, 23 Sep 2009 17:22:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=pycon%5Frst2odp%5Foffer</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>If anyone is considering using rst2s5, please give rst2odp (odp is the format that OOo uses) a try.  If your slides work on rst2s5 but not on rst2odp, let me know and I'll try to address that.  I've been using it for a while now, but I got some feedback that others have had issues, so I'd like to address those.</p>
<p>Why rst2odp?  Template support, console presenter mode (supports presenter only notes), export to pdf/html/ppt, great fonts, no reloading firefox, tweak final output in OOo (though I never do this), beautiful code highlighting (via pygments).  <a href='http://assets.en.oreilly.com/1/event/27/Best%20practices%20for%20%27scripting%27%20with%20Python%203%20Presentation%201.pdf'>Here's a sample of rst2odp output (exported to pdf)</a>.</p>
<p>ps - Preliminary table support just landed in svn!</p>]]></description><category>rst2s5</category><category>rst2odp</category><category>ooo</category></item><item><title>Python and emacs (6): (exuberant) tags and Python</title><guid isPermaLink="true">http://panela.blog-city.com/python_and_emacs_6_exuberant_tags_and_python.htm</guid><link>http://panela.blog-city.com/python_and_emacs_6_exuberant_tags_and_python.htm</link><pubDate>Wed, 16 Sep 2009 05:39:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=python%5Fand%5Femacs%5F6%5Fexuberant%5Ftags%5Fand%5Fpython</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>Since ctags is somewhat language agnostic, this isn't really Python specific.  Neither python.el nor python-mode.el do anything with tags that I can tell.</p>
<p>Welcome to 80's style code navigation!  <a href="http://en.wikipedia.org/wiki/Ctags">Ctags</a> is a program the analyzes code and creates an index (called a TAGS file).  Unlike a compiler that knows what's going on in your code, the index makes best guesses (using advanced technology such as regexes).  The basic idea is that with this index in hand one can quickly navigate to the definition of a function or class.  (Although it may be ancient tech, there are quite a few editors that support this old school technology, including emacs, jedit, kate, notepad++, vi and even Textmate)</p>
<p>I've been reading through <a href="http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/index.html">Programming in Emacs Lisp</a>, and in section <a href="">4.1</a> it talks about using TAGS files for navigation of elisp files.  So I thought I'd mess around with it in Python.</p>
<p>One way to <a href="http://www.emacswiki.org/emacs/BuildTags">build a TAGS file</a> is to use the <tt>etags</tt> command included in emacs.  I used <a href="http://www.emacswiki.org/emacs/ExuberantCtags">exuberant tags</a>, a more featureful etags replacement (though I'm not really using too many features just the recurse feature (rather than find/pipe/xargs to normal etags)).</p>
<p>Apparently, <a href="http://mg.pov.lt/blog/pylons-with-buildout-2">buildout has support for creating TAG files</a>.  Since I've never used buildout, I can't comment more on that, but it looks straightforward enough for buildout users.</p>
<p>Another way as suggested in <a href="http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/etags.html#etags">section 12.5 "Creating Your Own TAGS File</a> (of the lisp intro book), is to run the command from <tt>M-x compile</tt>.  (Though first you might want to <tt>M-x cd</tt> to get to the root of your project if your current python buffer isn't at the root.  Then instead of running the normal compile command, you'll give something like this (note --recurse is an exuberant feature, also note that "src" should be a directory containing python modules)<pre>etags --recurse=yes src</pre>.  Note, another binary is included with exuberant called <tt>ctags</tt>.  Don't use that one, as emacs will complain about an invalid tag file.</p>
<p>That's all there is to creating TAGS.  Of course, once you edit your files, you need to recreate the TAGS file, as it will be out of date.  (If I find a good way to automate that, I'll post here).</p>
<p>How to use tags?  Well <a href="http://www.emacswiki.org/emacs/EmacsTags">emacswiki has some suggestions for using tags</a>.  The main one is <tt>M-. (find-tag)</tt> which should take you to the definition of said tag (after you point it to the TAGS file you just created).  There's also <tt>tags-search</tt> which is a little like <tt>C-s</tt> but if you follow it with <tt>M-,</tt>, it takes you to all references of a tag which includes going to other files as well.  Quite handy.</p>
<p>If anyone has any more suggestions for tags, I'd love to hear them.  I'd like to look into js/html/css support.  I'll update this post as I use tags more.</p>]]></description><category>emacs</category><category>tags</category><category>ctags</category><category>exuberant tags</category><category>python</category></item><item><title>[ANN] pykeyview</title><guid isPermaLink="true">http://panela.blog-city.com/ann_pykeyview.htm</guid><link>http://panela.blog-city.com/ann_pykeyview.htm</link><pubDate>Mon, 14 Sep 2009 18:28:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=ann%5Fpykeyview</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>In preparation for <a href="http://2009.utosc.com/presentation/119/">my Python Workshop at UTOSC</a>, I thought it might be nice to have a little <a href="http://en.wikipedia.org/wiki/On-screen_display ">OSD</a> widget for showing keystrokes.  (ie if I'm typing an Emacs command, that keystrokes I've typed will show up in big letters)  I've seen something similar in a screencast made on OSX a while back.  So after playing around with glade for a bit and thanks to the existing code in <a href="http://pykeylogger.sourceforge.net/">pykeylogger</a> I've got a little alpha code out that works on my <a href="http://awesome.naquadah.org/">tiling window manager</a> (read floats and moves around and is always on top).  Perhaps when it's prettier and I've implemented some of the stuff on the TODO, I'll post a screencast.</p>
<p>In the meantime if any linux/X users out there are interested in this and want to hack/tweak it feel free.  The code is <a href="http://github.com/mattharrison/pykeyview">up on github</a>.</p>]]></description><category>python</category><category>osd</category><category>pykeyview</category></item><item><title>Countdown to UTOSC 2009</title><guid isPermaLink="true">http://panela.blog-city.com/countdown_to_utosc_2009.htm</guid><link>http://panela.blog-city.com/countdown_to_utosc_2009.htm</link><pubDate>Mon, 14 Sep 2009 18:15:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=countdown%5Fto%5Futosc%5F2009</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p><a href="http://2009.utosc.com/pages/home/">The Utah Open Source Conference</a> is coming up soon.  This a regional community run conference that is now in its 3rd year.  <a href="http://sexysexypenguins.com/">Clint</a> and crew do a bang up job organizing, soliciting participation and generally making sure things run smoothly.  Talks run the gamut from Blender, Cooking, Photography, to FreeBSD and more.  I'll be presenting two times.</p>
<p>I'll be <a href="http://2009.utosc.com/presentation/119/">giving an Intermediate Python Workshop</a> for two hours.  The first half will be lecture and the second half will be a short hands on programming assignment to drill in the material.  If you want to participate in the workshop and would like to learn something not on the current plan, drop me a note.</p>
<p>I'm also giving a <a href="http://2009.utosc.com/presentation/92/">What Every Programmer Should Know About Code Coverage</a> talk later.  This one is more language agnostic, but examples will probably be in Python.</p>
<p>If you are interested in attending the conference, the earlier you sign up the cheaper it is.  Though you should probably find some way of convincing your boss to pay for it.  If you are using Open Source at work, there's bound to be something relevant to your job.</p>]]></description><category>utosc</category><category>python</category><category>code coverage</category></item><item><title>Tornado: Another Python web framework</title><guid isPermaLink="true">http://panela.blog-city.com/tornado_another_python_web_framework.htm</guid><link>http://panela.blog-city.com/tornado_another_python_web_framework.htm</link><pubDate>Thu, 10 Sep 2009 20:03:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=tornado%5Fanother%5Fpython%5Fweb%5Fframework</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>It's cool that Facebook is open sourcing a Python webframework as part of the FriendFeed acquisition.  <a href="http://panela.blog-city.com/python_web_framework_rewrite_take_two.htm">I've blogged about the ease of developing a web framework in Python</a> before.  (Apparently FriendFeed (coming from the Google world) liked Python but not the <a href="http://panela.blog-city.com/python_web_framework_shootout_take_3__petitioning_guido_goog.htm">Googly/Guido/AppEngine Django</a> stuff enough to continue with Django).  <a href="http://www.tornadoweb.org/">Tornado</a> is an part of an effort to open source some Facebook technologies (ala <a href="http://incubator.apache.org/cassandra/">Cassandra</a>?).</p>  
<p>What does Tornado buy you that isn't already available in the many Python frameworks?  The main feature is asynchronous, non-blocking support.  Why not just use <a href="http://twistedmatrix.com/">Twisted</a>?  <a href="http://bret.appspot.com/entry/tornado-web-server">According to co-founder Bret Taylor</a>, they tried Twisted, but <em>"Twisted is very chaotic (see http://twistedmatrix.com/trac/wiki/WebDevelopme... - even they acknowledge this). In general, it seems like Twisted is full of demo-quality stuff, but most of the protocols have tons of bugs."</em>  The Tornado docs claim 4X performance increases over standard (blocking) servers on quad cpu machines (lacking any Twisted benchmarks).</p>
<p>I haven't messed with Tornado, just <a href="http://www.tornadoweb.org/documentation">reviewed the documentation</a>.  Looks pretty straightforward, similar to <a href="http://www.pylonshq.com/">Pylons</a> in that it has no ORM builtin.  There also seems to be much attention placed on security, with easy support for secure cookies and <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">XSRF</a>.  Also the auth mechanism seems to be well thought out with support for Google, Facebook, Yahoo, Twitter.  All of these features are somewhat obvious considering the roots in social networking.<p>
<p>In short it looks like a great start.  Also it's good to know that it has been around that block in that it's been driving FriendFeed. Hopefully this will kick WSGI 2 to have some support for asynchronous servers.  If you are looking for non-blocking support in Python it looks like Tornado should be a top contender.</p>]]></description><category>python</category><category>asynchronous</category><category>friendfeed</category><category>wsgi</category><category>server</category><category>tornado</category></item><item><title>Python and emacs: Articles</title><guid isPermaLink="true">http://panela.blog-city.com/python_and_emacs_articles.htm</guid><link>http://panela.blog-city.com/python_and_emacs_articles.htm</link><pubDate>Sat, 29 Aug 2009 05:13:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=python%5Fand%5Femacs%5Farticles</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>In an attempt to be more proficient at emacs, I've written some articles discussing my adventures.  There seems to be confusing sources of information floating around on the intertubes regarding this subject.  The most authoritative seems to be <a href="http://www.emacswiki.org/emacs/PythonMode">the PythonMode entry on emacswiki</a>.  The <a href="http://wiki.python.org/moin/EmacsEditor">Python wiki entry for emacs</a> seems lacking in much utility.  Then there's the whole python-mode.el (part of the Python distibution), being developed (forked?)<a href="https://launchpad.net/python-mode">on launchpad</a> (and it's accompanying <a href="http://mail.python.org/mailman/listinfo/python-mode">mailing list</a>), and the python.el that ships with emacs.  So, I'll further muddy the waters by providing more information on my blog.</p>
<p>Here's a list of my posts:
<ul><li><a href="http://panela.blog-city.com/python_and_emacs_1_keyboard_macros.htm">Keyboard macros</a></li>
<li><a href="http://panela.blog-city.com/python_and_emacs_2_color_themes.htm">Color Themes (making emacs purty)</a></li>
<li><a href="http://panela.blog-city.com/python_and_emacs_3_balancing_parentheses_and_others.htm">Dealing with parenthesis and "electric" keys and deletes</a></li>
<li><a href="http://panela.blog-city.com/python_and_emacs_4_whitespace_tabs_tabwidth_visualizi.htm">Whitespace - The bane of Python newbies!</a></li>
<li><a href="http://panela.blog-city.com/python_and_emacs_5_pdb_and_emacs.htm">Pdb - Debugging in emacs</a></li>
<li><a href="http://panela.blog-city.com/python_and_emacs_6_exuberant_tags_and_python.htm">Creating/Using TAGS files</a></li>
</ul>
</p>
<p>As I continue to learn and tweak my emacs environment, I'll update this list.  As always, comments, corrections and suggestions are welcome.</p>]]></description><category>emacs</category><category>python</category></item><item><title>[ANN] pycoverage.el</title><guid isPermaLink="true">http://panela.blog-city.com/ann_pycoverageel.htm</guid><link>http://panela.blog-city.com/ann_pycoverageel.htm</link><pubDate>Fri, 28 Aug 2009 06:55:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=ann%5Fpycoverageel</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>I thought it might be nice to have code coverage support for Python in emacs.  So I started hacking pycoverage.el tonight.  The beginnings of the <a href="http://github.com/mattharrison/pycoverage.el/tree">project is on github</a>.  This is just a few hours of hacking, and is in a really nascent state.  Right now there's a hardcoded value for the location of the <tt>.coverage</tt> file (supporting coverage.py initially, I figure figleaf will be easy later).</p>
<p>I've not messed around with git much, but since I figure others might find this useful (and since my lisp skills are lacking (haven't used it since college)) (somehow my parens are pretty good for adding parenthetical information though), I figured I'd throw it out into the social coding scene.  I figure others might want it (and want to help scratch this itch) and since I might be incognito for a bit here anytime now I'm putting it out in a the paint is still wet state....</p>
<p>Props to the <a href="http://eigenclass.org/hiki.rb?rcov">rcov</a> guys for giving me some elisp code to start off with....</p>]]></description><category>coverage</category><category>coveragepy</category><category>figleaf</category><category>python</category><category>emacs</category><category>elisp</category></item><item><title>Python and emacs (5): pdb and emacs</title><guid isPermaLink="true">http://panela.blog-city.com/python_and_emacs_5_pdb_and_emacs.htm</guid><link>http://panela.blog-city.com/python_and_emacs_5_pdb_and_emacs.htm</link><pubDate>Thu, 13 Aug 2009 23:27:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=python%5Fand%5Femacs%5F5%5Fpdb%5Fand%5Femacs</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p><a href="http://docs.python.org/library/pdb.html"><tt>pdb</tt></a> is the interactive debugger the ships with Python (much like gdb).  Though <a href="/a_talk_by_guido_van_rossum.htm">I've heard that many prominent programmers do 90% of their debugging with the <tt>print</tt> statement</a>, sometimes <tt>pdb</tt> is useful for that other 10%.  (Besides that I'm coming to the realization that most production code shouldn't have <tt>print</tt> statements, and if you are using <tt>print</tt> to debug, you should be using <tt>logging</tt> instead, but I digress.)</p>
<center><img src='http://files.blog-city.com/files/F05/96843/p/f/emacspdb.png' title='emacspdb.png'/></center>
<p><tt>pdb</tt> works from the command line like a charm.  So why integrate it with emacs instead of just running it from a terminal?  Or if you live in emacs, from a terminal inside emacs?  For me the main reason is to have another window that shows me where I am in the debugging process.  Sure <tt>pdb</tt> has the <tt>w(here)</tt> command that prints out some lines before and after, but it's so much nicer to have your highlighted code being tracked automagically for you.  See that little triangle in the screenshot above?  So what's the problem with running from within emacs?  Out of the box (gentoo, python 2.5, emacs 22-23) integration with <tt>pdb</tt> doesn't work for me.  There <a href="http://page.sourceforge.net/tricks.html">appears</a> to <a href="http://twistedmatrix.com/projects/core/documentation/howto/debug-with-emacs.html">be</a> a <a href="http://gunnarwrobel.de/wiki/Python.html">few</a> ways of getting <tt>pdb</tt> to work under emacs.  I have my own.</p>
<p>I <a href="http://bugs.python.org/issue1429539">needed to apply this patch</a> and I also need to get around an emacs nicety that turns into an annoyance for me.  See I put all my test files under a <tt>test</tt> directory that sits alongside my main module/package (also the same directory that setup.py is in).  If I have test data I usually reference it using a relative path from that base directory and not the directory that the test code lives in (usually a level down).  But by default whenever emacs enter gud mode it kindly changes to the directory that the file lives in when you invoke <tt>pdb</tt>.  Rather than delving into emacs, I patched my <tt>pdb</tt> again to add <tt>--cwd</tt> support (similar to nose's <tt>-w</tt>).  The result is <a href='http://files.blog-city.com/files/F05/96843/b/pdb'>here (for 2.5)</a>.  For 2.6 I've written a <a href='http://files.blog-city.com/files/F05/96843/b/mypdb.py'>wrapper (<tt>mypdb.py</tt>)</a>(since the aforementioned patch is applied) that gives me my desired <tt>-w/--cwd</tt> support.</p>
<p>To run <tt>pdb</tt> with these scripts, make sure they are executable and in the <tt>PATH</tt>.  Then type <tt>M-x pdb</tt>, when it asks for the command to run type <tt>pdb --cwd /current/directory/you/want/to/use /file/to/debug.py</tt> (make sure pdb points to the 2.5 pdb I provided or change it to mypdb.py for 2.6).  Cheers!</p>]]></description><category>python</category><category>pdb</category><category>emacs</category><category>gud</category><category>gdb</category></item><item><title>rst2odp - &quot;I&apos;m not dead yet&quot;</title><guid isPermaLink="true">http://panela.blog-city.com/rst2odp__im_not_dead_yet.htm</guid><link>http://panela.blog-city.com/rst2odp__im_not_dead_yet.htm</link><pubDate>Wed, 12 Aug 2009 18:07:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=rst2odp%5F%5Fim%5Fnot%5Fdead%5Fyet</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>While I was off at OSCON, it turns out that some people at the PyOhio conference had just found out about rst2odp.  Sadly it didn't work for them.  <a href="http://catherinedevlin.blogspot.com/2009/07/now-thats-agile.html">Happily they had a sprint to fix their issues.</a>  Then they even gave a <a href="http://www.slideshare.net/wamcvey/restructuredtext-to-odp-ooimpress">lightning talk on rst2dop</a>.  And being the good open source citizens they were, they've sent patches back upstream!  I've pushed out a release containing their fixes to <a href="http://pypi.python.org/pypi/rst2odp">PyPI</a>.</p>
<p>So if you are in the business of using <tt>rst2s5</tt> give <tt>rst2odp</tt> a shot.  it includes a sample slide show and instructions for generating it.</p>
<p>(side notes)  I had a lightning talk prepared for PyCon to talk about rst2odp, but figured no one else really cared, and I was scratching my own itch.  I guess I'm a poor marketer.  While at OSCON, I got presenter extraordinaire Damian Conway to review my slides.  He was actually pretty complementary about them (wish I could say the same for other slide decks he reviewed).  I didn't tell him that the slides were programmatically generated....;)<p>]]></description><category>rst2odp</category><category>impress</category><category>ooo</category><category>rest</category><category>rst</category><category>rst2s5</category><category>powerpoint</category></item><item><title>OSCON Scripting with Python Handout</title><guid isPermaLink="true">http://panela.blog-city.com/oscon_scripting_with_python_handout.htm</guid><link>http://panela.blog-city.com/oscon_scripting_with_python_handout.htm</link><pubDate>Thu, 23 Jul 2009 18:57:00 GMT</pubDate><comments>http://panela.blog-city.com/console/comments/popup/?f=oscon%5Fscripting%5Fwith%5Fpython%5Fhandout</comments><dc:creator>Matt</dc:creator><description><![CDATA[<p>As promised, <a href='http://files.blog-city.com/files/F05/96843/b/scripting.tgz'>here's the slides and handout</a> from my recent <a href="http://en.oreilly.com/oscon2009/public/schedule/detail/8317">OSCON talk, Best Practices for Scripting With Python</a>.</p>]]></description><category>python</category><category>scripting</category><category>cheatsheet</category><category>handout</category><category>best practices</category></item></channel></rss>