• Jekyll!?

    Just moved over to Github Pages and Jekyll. Hopefully this simplification will encourage future blogging ;-)

  • Software Illustrated: I'm just trying to change this lightbulb

    The GIF

  • Twisted python development server with restart on code change

    I really enjoy working with the Twisted framework because it allows me to easily and cleanly blend multiple protocols and services together in a single application.  However, when I’m developing and testing a Twisted-based server it is sometimes inconvenient to have to manually restart the server after each change.

  • Starcraft Emacs Mode (Or How to make an Emacs Minor-mode)
    A friend of mine once said that he was terrible at Starcraft because his "APM" was too low.  APM, if you're not familiar with the acronym stands for  "Actions Per Minute" and refers to keypresses or mouse clicks per minute while playing the RTS turned sport, Starcraft.

    My friend continued saying that he actually thought his APM while programming was quite high, certainly higher than anything he could manage playing Starcraft.  Of course, having nothing better to, I hacked up an Emacs minor mode that would track all your key presses within Emacs and total up an APM score for you.

    starcraft.el in 'action'

    Yes, that "sc" in the modeline stands for Starcraft.  Install starcraft.el in your emacs configuration and find how hard it is to inflate your actions per minute while writing code in emacs compared to spaming hotkeys in Starcraft 2.

    Really, I just wanted to do a more substantive bit of Emacs Lisp and this was a fun excuse to do so.

    You can download and play with the mode here on Github.


    Nice. I think I will install this as a "productivity measuring tool" for all my developers.
  • Diablo 3 Beta Impressions

    I recently got access to the Diablo 3 Beta test and have now logged upwards of 30 hours across two builds of the game (Patches 12 and 13).

  • Using Jinja2 from Twisted
    txTemplate is simply a set of adapters for some popular templating engines like Clearsilver, Genshi and Jinja2 to give them a consistent deferred-returning API.  I originally hacked this up because I used Twisted and Genshi to replace a Webware and Kid application.

    You can find the package here:


    And the source for anyone interested in hacking on it is hosted on Github.


    Assuming I remain interested in hacking on this future enhancements will be a better incremental interface for large template rendering.  The current API generates the template asynchronously but doesn't provide a good way to write the response to clients in chunks, the assumption being that as long as you can buffer the template in memory you can chunk the response to the clients.  Also, if you don't finish rendering the template before beginning to send it to the client it's possible that the you'll hit an error while rendering and send only a partial response.

  • Playing Words with Friends
    Words with Friends
    Words with Friends, if you're not already familiar, is a game of Scrabble that lets you play asynchronously with friends over the internet.

    I recently started playing WoF because I like to think I have a large vocabulary and rarely get the opportunity to use it.  I also enjoy playing boardgames like Scrabble but between work and ... sleep... I don't often get the chance to get together with my friends and play Taluva into the wee hours.

    Anyway, I have a confession to make.

    I'm terrible at Words with Friends
    Whenever it is my turn I look at my hand of letters:  ILNIREE
    And think:  ILNIREE is not a word.  Darn.
    And then I start to mentally rearrange letters to see if I can make other words.  WoF's conveniently includes a "Shuffle" button so I hit that a few times...  And while given enough time I do come up with a word a few things bug me about this process.
    First of all, years of Google and Wikipedia use have atrophied important muscles like "memory".  Second, i'm a programmer and that means:

    Basically shuffling letters and checking or guessing that they are words is a perfectly straightforward although not terribly efficient way to try to optimize your scrabble game.  Of course, it's got a lot of drawbacks if you try to do it by hand.  It's slow and it's uninteresting.  To try to find every word possible with any of your 7 letters you'd need to try all permutations and there are over 10,000 permutations of 7 letters.  

    Anyway, I'm bad at Words with Friends but I like programming so once I started playing WoF of course I gravitated towards...

    Solving Words with Friends2
    Boring and repetitive work is exactly what computers are good at it!  In fact the Python program to generate all possible permutations of 7 letters (1 letter words, 2 letter words, 3 letter words, etc) is pretty straightforward especially with a little help from our friend itertools.
    My first and simplest attempt involved putting the contents of the standard unix dictionary (/usr/share/dict/words) into a python dictionary (an excellent hash table implementation). 
    This isn't exactly what I came up with first but it should illustrate what I'm talking about:

    Of course you end up looking at a lot of permutations for 7 letters (~13 thousand) so this can take a little while. It's still not slow on any reasonable computer but when you start adding in other letters to try and find words that might fit in with available spots on the board things can slow down. For example, say you could play words that begin with t, l, or r. Running the above getScrabbleLetters function for 10 letters requires you to check 9,864,101 permutations.

    Worse still, if you add in the notion of wildcards (9 letters plus some character like '*' to represent a wildcard) you end up repeating those over 9 million lookups 26 times to check all the other possible letters of the alphabet in the wildcard slot.  That's over 250 million dictionary lookups to find a fairly small list of unique words.

    However, if we step back for a moment and think about anagrams, a simple tweak can help process larger strings (and strings with wildcards) much more quickly.

    Imagine you've got a couple anagrams like "was" and "saw".  They've got the same letters but count as two different words in our dictionary and require two separate lookups.  If we shift our perspective a little bit and start thinking about the letters as what's important we get some very nice performance improvements.

    We still use a hash table as our primary data structure but instead of using the words as the keys we use the sorted letters of a word as the key.  The values become lists of all the words which include those same letters.  It's a little bit more work to insert, as we first have to calculate what the key would be, and it's a little more work to lookup, as we have to iterate over the list of possible words.  But it's great any time we care just about anagrams and it's much more efficient in terms of the number of lookups required to find all the scrabble words.  For example, for the same 10 letter case from earlier we now need only 1024 lookups.  ~26 thousand lookups for the wildcard case.

    Without further ado that solution looks like this:

    One other really useful bit is a quick way to look for all the words that have a given suffix or prefix. This is a little trickier than the anagram case but it's also more interesting because I got to spend a little time reading about a new data structure, a Trie. A Trie is a tree-like structure optimized for storing strings.  The root node of the tree represents the empty string and each of its children represents the first letter of a word.  Every child of these nodes is the next letter in a word starting with that substring.  

    For example, a trie of nodes for the words "an apple yum" would look like:

    So the trie solution for finding words that begin with a certain prefix is:

    The suffix version is just a couple more lines with judicious use of the reversed function.

    Conclusion and Next Steps
    I think that Words with Friends is a lot more fun now that I have my computer as a crutch.  I've enjoyed playing with some simple algorithms for finding algorithms and looking up strings.

    My next steps after today are going to be putting up my utilities here on my website so that I can share them with my non-programmer friends.  Building a simple web service for solving/cheating at scrabble is a hopefully interesting topic in its own right so building that will probably be my next blog post.

    After that I'm interested in taking this to its logical conclusion and actually building (and blogging about) a scrabble solver where you can enter in the whole state of the scrabble board and your hand and have it tell you all your possible moves (or at least the subset of moves that give you higher scores).

    If you made it this far you might be interested in the actual tested source code here on github.

    Larry Wall calls this the first great virtue of a programmer.  
    Perhaps a more honest heading here would be "Cheating at Words With Friends" :-)
  • Emacs Archaeology

    Recently a friend asked me for my Emacs configuration. RMS would excommunicate me from the church if I didn't make my configuration available to any who asked so, of course, I started packaging it up and shipping it off to my friend. However, to help my friend it seemed reasonable to explain what all I've accumulated over the last few years, highlight some areas she might want to customize differently, and to point out some modes and tools I find particularly helpful in my day to day work.

    After opening up a terminal and poking around in my ~/etc/emacs.d directory I started to realize that after all this time I wasn't entirely familiar with my Emacs configuration either. Of course, no one has any geek cred at all if they can't explain how their editors configured so I started digging in to remind myself what the heck all this stuff does.  
    Here's a few numbers. Over the years I've written ~1500 lines of elisp code spread across 27 *.el files and accumulated another ~60,000 lines of dependencies (mostly downloaded from EmacsWiki and/or Emacs Fu).

    In any event, over the next few weeks I'll be cleaning things up a bit and posting more about some of the things about Emacs I really love.

    If anyone's interested in my current configuration I have a bitbucket repo (maybe I should move it to
    github?) here (https://bitbucket.org/steder/dotfiles) with all of my
    dotfiles including the emacs stuff if you'd like to take a look.

  • Recipe: Programmatically Creating and Updating AWS security groups
    I think I've rewritten this code 3 times now in the last year so it seems prudent to save it somewhere.  If other folks find it useful that'd be great.

    The problem is a simple one.  You're looking to setup and install of a few machines on EC2, perhaps to run something fun like a Cassandra cluster.

    Typically it's really tempting to just setup the security group once and never ever touch it again.  I'd log into the the AWS console, and following along with this datastax guide I would manually setup the group, launch instances, etc.

    However, without automation there's some duplication of effort whenever someone on your team sets up a cluster and possibility for user error setting up security groups.  And of course we're already automating the other important bits like "launch a new instance" or "run a backup" already so why not manage security groups with the same scripts?

    I'm currently working with Fabric to automate EC2 stuff so I pulled out the Python code I'm using to handle creation of security groups and permission rules within those groups.

    The script attempts to be idempotent.  The idea here is that simply rerunning the script will, only if necessary, create groups, revoke old rules and authorize any new ones.

    Anyway, without further ado here's the script:

  • Simple Nosy Script: Personal Continuous Integration for TDD
    I recently cleaned up and resurrected my old nosy script.  These days there are a few alternatives on PyPI as well though I prefer mine.  The whole concept of nosy is simply to rerun the tests whenever the code changes.  Personally, I find a script like this is really helpful for maintaining flow while doing test driven development.

    What I like about this nosy script is that it allows me to basically just say "run this nosetests / trial command every time the code changes" and nothing else.  There's no config file to setup or any tool specific arguments.  You just need to know how to use your test runner.

    Here's the code in case anyone is interested: https://gist.github.com/1220683

    Oh, and despite the name I've used it successfully to work on twisted projects with trial.  I'm also willing to bet that it would work just fine with py.test.

    Edit:  The polling loop with a time.sleep(1) is eating away at me now that I've posted this.  I'm thinking that the only way to live with myself is to replace that with listening for real filesystem events ala inotify... So do ease my conscience I'll see about doing a followup post to show what the script would look like with filesystem events instead of the polling loop..

  • Git Pre-commit Hook For Python now with extra Python!

    After reading a post by Bryce Verdier, and inspired by comments that suggested the Python version of said hook script would not be as nice as the bash version I decided to hack up a quick python version of the same script using pyflakes instead of pylint.

  • Installing Xcode 3 on Lion

    Much thanks to AnatomicWax!

  • Setting up a new macbook for work
    First day at the new job and I'm setting up a new macbook pro (macbookpro 8,2) for work.

    Here's a list of things I'm doing to setup this machine as a reference for future installations:

    * Ran "Software Update"
    * Installed XCode (3.x because it's free and is included on your install media) and X11
    * Installed Chrome
    * Installed Firefox
    * Installed Opera

    Break for lunch, frustrating phone call with fifth third bank, and reset my MCS account passwords...

    * After debating using macports, fink, or homebrew decided to give homebrew a try.
    * brew install python (which installs readline, gdbm, and python2.7.1).
    * Added /usr/local/share/python to PATH
    * easy_install pip
    * pip install virtualenv virtualenvwrapper mercurial
    * hg clone https://bitbucket.org/steder/dotfiles etc
    * cd etc && ./setup_links_mac.sh
    * Added path customizations for homebrew to ~/.bashrc
    * brew install emacs --cocoa --with-x
    * ln -s /usr/local/Cellar/emacs/23.3/Emacs.app /Applications/
    * brew install subversion
    * Didn't find grep in the default homebrew (they include system duplicates by default) but apparently you can just point homebrew at a recipe on some random site and it'll install it... Not sure I'm happy with this but that's probably the reason homebrew runs as a non-root user... Basically you can do: sudo brew install https://github.com/adamv/homebrew/raw/duplicates/Library/Formula/grep.rb
    * generated an ssh key: ssh-keygen -t rsa -b 4096
    * brew install ssh-copy-id
    * enabled sshd in the sharing control panel
    * ssh-copy-id msteder@localhost
    * sent authorized keys files to systems guys for setup on the MCS resources.
    * brew install wget
    * brew install proctools
    * brew install openssl
    * Installed Dropbox
    * Installed http://www.levien.com/type/myfonts/inconsolata.html

    I think that may be just about enough setup for today. I'm thinking next steps are going to be installing AWS tools like s3cmd, boto, etc.


    I'm not sure if this is sarcastic or not. :-) I didn't expect it myself obviously. And I think if it were a more publish or perish driven group I wouldn't be here. The team here is responsible for www.globusonline.org.
    Michael Tobis
    Back at UC - now there's a surprise...
  • While editing a source file in Emacs with DOS line endings I've got a little voice in the back of my head buzzing that I should really convert those line endings...

    Anyway, I found a painless way to do that conversion within Emacs:

    M-x set-buffer-file-coding-system
    At the prompt enter: "unix" 

  • Whoa, Whey Bread!
    After making yogurt (or cheese) you're going to have a bunch of a golden liquid called whey.  I'm a big fan of homemade bread so when I heard that you could use whey to enhance bread I decided I needed to try it the next time I made yogurt.

    The benefits of using whey for making bread are a better rising time, better crusts and flavor, and a firmer texture.

    I made my first batch earlier in the week and we ate it so quickly that I didn't get a chance to take pictures.  I'll try to make some more later on and post pictures this time.

    I found that the crust and texture of this bread was excellent and it rose very nicely in a fairly short period of time.

    Here's the recipe I'm trying this time:

    • 3/4 cup whey
    • 1 packets dry active yeast (3 teaspoons)
    • 3 tablespoons sugar
    • 3 tablespoons butter, melted
    • 2 teaspoons salt
    • 1 egg
    • 2-3 cups all-purpose flour (approximately)
    The above makes one loaf.  Simply scale things up by the number of loaves you'd like to make.  (2 loaves would be 1 and 1/2 cups whey, 2 packets yeast, etc).

    1. Proof the yeast:  Heat the your whey to 110 F and add your yeast.  Cover with a cloth and let sit while you prep the other ingredients.
    2. In a mixing bowl add half of your flour, the butter, sugar, and salt.
    3. Add the eggs
    4. Add the warm proofed yeast
    5. Mix until it forms a dough ball.  If the mixture is too wet to form a ball add a little flour until things start to stay together.
    6. Flour a cutting board or some other surface and turn the dough ball out onto it.
    7. Knead the dough for 5-10 minutes
    8. Grease a large bowl with butter or oil and place the dough in the bowl.  Turn it a few times to cover in oil.
    9. Cover the bowl with a cloth and set the bowl in a warm place to rise for 1 to 2 hours.
    10. Punch the dough down and divide into loaves. 
    11. Cover loaves and allow them to rise for another hour.
    12. Heat oven to 425 F and cook for 20-25 minutes.
    13. Remove from the oven and turn out onto backing rack to cool
    14. Enjoy!


    I too have had a good experience adding yogurt bacteria to the dough. A great way of getting a faux sourdough without having to keep a pet alive.

    For an extra bold flavor, you can leave double ferment dough overnight. Then just pound down the resulting swollen bubbly mass one more time and rise once more. Maybe even slow rise over a day or so in the fridge or someplace cool.

    Once, I think one of my overnight batches started going alcoholic. It had very strong fumes coming from it in the morning. Once I baked it, it had an earthy, molasses tasting type of character. Held its moisture almost as good as a sourdough.
  • French Press Coffee Recipe
    I figured I'd just post this as a reminder to myself.

    Today I tried this french press recipe and I thought it turned out pretty well.

    Ratio of coffee to water: 1/16

    So that's:

    • 64 grams coffee to 32 oz water
    • 2 oz coffee to 32 oz water
    • 1/2 oz coffee to 8oz water

    And then it's a very simple procedure:

    1. Boil water.
    2. Grind beans.
    3. Throw beans in french press
    4. Steadily pour in hot water (you're looking for a temp between 195F and 205F)
    5. Allow to steep 3-4 minutes


    It was quite strong :-) I think maybe the water was a little too hot and draw out too much of the harsher coffee flavors. However, since I don't mind a little extra bitter coffee (I like Starbucks :-P) it was still pretty good imo.
    Carolyn Van Slyck
    So how strong does this coffee turn out? You mentioned that it was pretty strong this morning... :-)
  • Homemade Yogurt
    I love yogurt. In an effort to prove my devotion to the creamy and tangy Greek yogurt that I adore I've started to make my own.

    Aside from some time and attention, yogurt is not that difficult to make and the homemade stuff is quite delicious and the leftover whey is very useful in bread making as I'll try to show later on.

    First here's what you need:

    Yogurt making stuff!

    • 1 Gallon Milk (Any kind of real milk, skim to whole, the fat percentage matters but you'll be able to make reasonable yogurt with any of them).
    • 1 container yogurt with active live cultures (6 to 8oz)
    • 1 6-8 quart pot
    • 1 metal or plastic spoon
    • instant read probe thermometer with an operating range between 80 and 200 degrees F.
    • 1 6-8 quart plastic container with lid
    Prep time:

    You'll need to be actively involved in the yogurt making for about an hour but then you'll pitch the yogurt and setup a nice warm place and let it sit for anywhere from 6 - 12 hours. 

    1. At milk to your pot and add your thermometer.  Turn on your stove to medium high heat and stir occasionally (every 5 - 10 minutes) until the temperature reaches 180 degrees F.
    2. While the milk is heating you'll want to prepare your sink with a couple inches of water and ice so that you can quickly cool the milk and prevent the milk from continuing to heat to much past 180 F on the stove.
    3. After the milk reaches 180F pour the milk into your plastic container.  Transfer your probe and loosely cover the container with your lid.
    4. Place the plastic container in your sink to cool to around 112F.  The milk can be hotter or cooler (90 - 120F) but staying close to this number and keeping your mixture around this temperature will ensure your yogurt bacteria stay happy.  If the milk is too hot when you add your starter there is a good chance you'll kill the yogurt so you should err on the cool side.
    5. Once you've reached a reasonably cool temp around 112F, go ahead and add the container of yogurt.  Stir the yogurt into the milk.
    6. Once again cover the plastic container with the lid and insert your probe thermometer.
    7. Find a warm place to keep the yogurt and place it there.  Cover with a towel or blanket to help keep it's temperature consistent.
    8. Allow the yogurt bacteria to incubate in a warm environment (again, around 112F) for anywhere from 4 to 12 hours (yes, you can leave it overnight).  I turn on my stove to it's lowest setting and place the yogurt on top covered in a towel which seems to work quite nicely and maintains a reasonable temp of 110 F
    9. You can taste test the yogurt to see how tangy it is and the longer you let the yogurt ferment the tangier it will be.  Remember that the texture will be somewhat off until the yogurt is allowed to set in the refrigerator.  
    10. I prefer really tangy yogurt so I will most likely let the yogurt sit 10-12 hours.
    11. At the end of this period, stir the yogurt, cover, and place in the refrigerator until cool.  The stirring and refrigeration help to put the bacteria back to sleep and puts the fermentation process on hold.  And of course I should mention that this is the perfect time to add vanilla or agave nectar to sweeten or flavor your yogurt.  
    12. Once the yogurt has cooled enjoy the yogurt or strain the hell out of it to make thick and delicious Greek style yogurt or, if you prefer, cream cheese. 
    I plan to strain this next batch so I'll cover that simple process next.  I strongly suggest that you strain your yogurt.  While the yogurt you have above is tasty, it'll be much more decadent if you go ahead and strain it.

    On the stove, notice the nice froth here at 180F

    Cooling down in the sink

    Fermenting on the stove warm and cozy under a towel


    Thanks!! :)
    Thanks for the tips, KoI. I really like the idea of not using such high heat and since I really prefer strained yogurt I'll have to give straining without cooling a try.

    I find it really quite cool how many different techniques people can use to produce yogurt. I appreciate your ideas because I am hoping to find a recipe that is minimal effort and produces awesome yogurt.
    I don't have a thermometer so I inoculate at the maximum temperature I can indefinitely immerse my finger in the milk.

    I started out heating the milk to high temperatures and then trying to cool it down with ice before it started scorching.
    I found you can skip this step.

    The milk bacteria seem to work just fine with the yogurt culture. Furthermore, milk loses most of its flavor when it's heated to high temperature. I think a lot more stuff than just the bacteria gets broken down.
    Works well to heat the milk up very gently and only to inoculation temperature.
    This can take an hour or longer with a two gallon batch, but I just do other things while checking back on it periodically.

    Since even whole milk is a bit lacking in character, I find yogurt also benefits from some heavy cream. About a half pint to a pint per gallon makes it extra rich.

    I find a grainy texture usually results only when the yogurt is strained a bit prematurely, before curd and whey have completely separated. I find it comes out a bit grainy like a farmers cheese at less than 7 hours. I've fermented for as long as 24 hours and still gotten decent batches. Best to err on the side of tartness.

    No need to cool the yogurt before straining. Just as well to let it continue developing even in your strainer. Not to mention it will strain faster when warm.

    The yogurt doesn't go completely dormant when refrigerated. The bacteria still slowly does its work. Probably best to wait until serving before adding sweeteners. Easily digestible, naked sugars make it easy for new organisms to move in or ones already there to proliferate out of control.
  • Posting with Apache Bench
    Because it took me a disproportionate amount of time to figure this out the second time I'm writing it down:

    ab -n 1000 -c 25 -p sessionkey2.post -T "application/x-www-form-urlencoded" "https:/

    The trick is specifying -p <postfile> and -T <content-type for post file data>.

    The postfile above looks like:


    All as one long url encoded line.

    Encoding the post data is really quite easy to do in python:

    import urllib
    pv = {"key1":"value",
          "key2":"another value"}
    print urllib.urlencode(pv)


    super thanks, saved my day !
  • Tutorial Correction: File IO
    8 years ago, thinking I knew a lot about Python, I wrote up this Python tutorial and presented it to some folks at my school in an effort to learn Python better and evangelize my favorite programming language.

    After all this time I think I've learned a lot more about Python but the more I learn the more I realize how unprepared I was to write this tutorial.  Basically, what I'm saying is that I made some mistakes.

    Since making mistakes is the way software gets done I suppose it isn't the end of the world but I digress...

    Today I'm correcting a mistake in the Python tutorial about buffered / non-buffered IO.

    Basically, 2002-me made the mistake of assuming that all file operations were unbuffered because the heavily customized gentoo environment he was writing all the tutorial stuff on at the time was defaulting to unbuffered IO.  This is a pretty big oversight that makes some tutorial examples non-functional for folks out there with an operating system that buffers IO by default (Mac OS X, probably other BSDs, I'm sure some flavors of Linux, etc).

    Anyway, I've updated the tutorial page here with better info about why that example works the way it does, the way to make it work if your platform defaults to buffered IO, and the right way (hint: with keyword) to write your program so that it doesn't rely on the corner case my linux platform example relies on.
  • Asynchronous Access to My Desktop Pictures

    I’ve been working a lot with Twisted lately so I thought people might appreciate a fun example of how one could download a bunch of files quickly using asynchronous IO.

  • Emacs on Centos 5
    Attempting to follow my install directions on a centos VM I found I was missing a bunch of things.  So here's a quick brain dump of packages you can install to make emacs compile without too much trouble.
    • yum -y groupinstall "Development Tools"
    • yum -y install gtk+-devel gtk2-devel
    • yum -y install libXpm-devel
    • yum -y install libpng-devel
    • yum -y install giflib-devel
    • yum -y install libtiff-devel libjpeg-devel
    • yum -y install ncurses-devel
    • yum -y install gpm-devel dbus-devel dbus-glib-devel dbus-python
    • yum -y install GConf2-devel pkgconfig
    • yum -y install libXft-devel
    • cd ~/Emacs/emacs-build
    • ~/Emacs/emacs-bzr/configure --prefix=/usr/local --without-selinux --with-x-toolkit=gtk
    You may not need to build without selinux, YMMV.
  • Changing Passwords on Mac OS X (Single User Mode)
    Say you have a new macbook and you don't know the password for a user account you can do the following to reset the password:

    1. Reboot
    2. After the apple boot beep, hold down Command-S
    3. Wait for command prompt
    4. $ mount -uaw
    5. $ passwd <yourusername>
  • Centos VM and Parallels Tools
    I'm currently installing a Centos 5.5 VM for work purposes and I recently ran into the following error:

    "Required GNU/Linux Components Missing: Some Components needed for Parallels Tools installation are missing in your system.  Do you want to download these components automatically?"

    The following packages can be installed first to avoid having parallels do it for you:
    • kernel-headers
    • kernel-devel
    • gcc
    $ sudo su -
    $ yum install
    $ yum install kernel-headers kernel-devel gcc

    And then of course, you still get the error message....   But if you click through it after installing those packages it seems to go a hell of a lot faster, so I think I might have accomplished something.

    The other weird thing is the permissions on the files when mounted automatically (for instance, while logged into gnome).  If you get permission denied errors running the installer script you can copy the contents of the cdrom to ~/parallels, chmod -R +x ~/parallels, and then run "sudo bash ~/parallels/install".

  • Garlic Citrus Cashews
    Pre-heat oven to 300 degrees.

    In a large pool add:

    • 2 teaspoons lemon juice
    • 1 teaspoon lime juice
    • 2 cloves garlic, minced
    • 2 teaspoons sesame oil
    • 1 tablespoon melted butter
    • 2 teaspoons garlic salt
    • 2 teaspoons ground black pepper
    Combine the above ingredients and add 1lb raw cashews.  Stir to coat the cashews.  Add additional salt to taste.

    Allow nuts to marinade for 15-20 minutes and then spread into a single layer on to foil-lined roasting pan .

    Bake 15 minutes, turn / stir the nuts, and finish with another 30 minutes.

    Taste test, bearing in mind that they won't crisp up until they cool.  Add any additional salt or seasoning now before the nuts cool / dry completely.

    Allow to cool and enjoy!


    This recipe sounds rather delicious. Ever used 'em in a salad? They sound ideal for counterbalancing cooling foods. Sizzling hot out of the oven, I could imagine eating them along with chunks of canteloupe or honeydew.

    -Do you put on the lemon juice after baking? Ascorbic acid and vinegar both break down at high temperatures.

    -What kind of sesame oil do you use? The best, most flavorful stuff is the dark colored roasted sesame oil, but it can be tough to find outside of Asian(especially Korean) grocery stores.
  • Python template language performance (Chameleon is cool!)

    I really like the Genshi templating library. However, it really doesn’t perform nearly as well as something like ClearSilver. Out of curiosity I updated the benchmarks included with Genshi to include the chameleon.genshi package. It performs amazingly well.

  • Messing with google wave

  • New Tutorial Toolchain
    Previously I generated my tutorial pages (Python Tutorial) by hand writing *.shtml files.  I used Apache SSI (server side includes) as a very basic templating system to construct pages from basic building blocks.  For each code sample I create a *py file.

    A makefile ties everything together by running a perl utility, code2html over all the python files to create *.py.html files.  These code snippets are then inserted into the tutorial pages with include directives.

    I'm currently in the process of migration to a scheme that uses a real templating system (Genshi) and the Pygments library to build the complete tutorial.  The finished scripts should allow me to work directly with HTML and Python files on disk and compile the whole thing into a complete document.

    Reasons for migration:
    • The toolchain will be all python eases migration to Django/Twisted web layer
    • Genshi templates will help ensure that the markup is correct and make it considerably easier to modify the entire tutorials look and feel going forward.  (Or reuse these work for other tutorials I'd like to work on in the future).  
    • Pygments is an excellent syntax highligher with support for a ton of languages.
    • There is still a build step
    • Creating tutorials still involves writing html by hand
    • No web interface to edit pages or create new ones

  • Emacs 23 On Leopard

    Just a quick note on building emacs-cvs (emacs23+) on Mac OS 10.6.

    First, check emacs out:

    $ mkdir Emacs; cd Emacs  
    $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/cvsroot/emacs co emacs-cvs
    Or check it out via Bazaar:

    $ bzr branch http://bzr.savannah.gnu.org/r/emacs/trunk emacs-bzr 

     Now create a scratch directory:
    $ mkdir emacs-build
    $ cd emacs-build

    To build the mac App bundle of emacs:

    $ ../emacs-cvs/configure --with-ns
    $ make install 
    $ open nextstep/Emacs.app # just a test to confirm it works before installing
    $ sudo cp -r src/Emacs.app /Applications

    To build a more old school x11/commandline emacs as well as replacing the emacs22 that ships as the
    default on Snow Leopard.  This is my preferred install as I tend to stick to the commandline whenever possible:

    $ ../emacs-cvs/configure --prefix=/usr --with-x-toolkit=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no
    $ make
    $ ./src/emacs -q # just a test to confirm it's working before installing
    $ sudo make install



    Sorry for the late reply, I had comment moderation on and no notifications setup so it languished for a while.

    Hopefully you've already sorted out your issues but I think you'll want to look into grabbing Fink and installing it.


    Then you should be able to do:

    $ fink install ncurses-dev
    Under OSX 10.6.5, I get the following:
    configure: error: I couldn't find termcap functions (tputs and friends).
    Maybe some development libraries/packages are missing? Try installing
    libncurses-dev(el), libterminfo-dev(el) or similar.

    Where would I get these?
    Ah, just do ./src/emacs -nw.

    -nw stands for "no window" I think.

    Hope you're enjoying Emacs!
    Thanks for this!

    When I run the generated binary ./src/emacs, it launches a separate X11 instance. Is there any way to have emacs launch in the Terminal itself?
  • Favicon!
    Check out my new penguin/dino favicon!
  • (Belated) Spring Cleaning
    I appreciate all the e-mails from folks who've found the Python tutorials useful.  I'm finally starting to clean up the site as it's kind of a mess at the moment.

    There's a long todo list and cleaning up the main page of the site is just the logical place to start.

    I'll be updating minor problems in the simple HTML tutorials but will I don't plan on making significant changes or additions until I've got a better way to edit and update that content.  Most likely this means that I'll be plugging in a real CMS to better manage it.  I've some interest in creating a custom engine in Django or Twisted, which might be a really nice example for the tutorials as well as an improvement for me in terms of easy editing and improving the quality of the code running the site currently.

    Thanks again for all the encouragement to get back to work on the site.

    I'll keep you posted.
  • Penzilla Project on Google Code
    Anyone interested in my Python tutorials (penzilla.net/tutorials/python) can now check out the mercurial repository including the code and HTML here at google code.
  • Penzilla crushes Hello, World
    Hello, World!