Python Graphbin – A place to share graphs

A week ago I found out some strange stuff was going on when I searched for “aaaaaaaaaaa”. So I made a python script for gathering the search results and wanted to plot a nice graph. The problem was I couldn’t find a nice place to show and store the data. So I made a pastebin esque graphbin at and you can see the google search results:

I used “Paste-It” ( as the base for graphbin so I got a bit familiar with the “Paste”
( framework. Sadly, this wasn’t a pleasant journey. A lot of the connected things are just scattered all over the place and yet seem heavily entangled (ie uses
page/pasties/ which outputs the relevant template page in line 125 out of 342 after a flow that was no fun to follow). I’m not sure if this is a problem with “Paste” or a problem with the “Paste-It” implementation, but it got a bit ugly. Not to mention some bad naming (the “paste” folder holds the “web” framework folder and all the models, why not name the folder “models” and move the framework out? Why are pages “pasties”?).

Maybe some paste-lover can dazzle me with some info on how paste compares/differs to/from django. Drop a comment.


I don’t like wordpress taking ownership of links so I’m breaking off. I use wordpress partly as a link pastebin and archive so not being able to just copy-n-paste links is a real deal breaker for me.

I wonder which of these links will be replaced into go2 jacked links:

Hurrah for the export/import tool.

Installing extensions on google wave

Some tutorials proclaim to explain this but don’t. In order to install G**gle Wave extensions you have to go to your first wave named “Welcome to Google Wave” and click on the “Extensions Gallery” link. There you’ll find an extension named “Extension Installer”, install it, then when you’re editing waves it’s on the toolbar (yeah, where you change fonts is where you install wave extensions). This allows you to install any extension by url and not just those that are in the gallery.

What a self referential headache that caused.

I think this extension should be pre-installed by default just like the map gadget and yes/no/maybe. And it might be a good idea to just integrate the extension into the settings wave. I would tell google what I think but the forums on the subject don’t seem like the right place to post a suggestion, they’re more akin to tech support:

Javascript’s Global Scope and Google Wave

Dmitry Baranovskiy said something that bit me the other day:

JavaScript’s global scope is a public toilet. You can’t avoid going in there but try to limit your contact with surfaces when you do.

Google wave stops calling your gadget callback functions if you do the following in your javascript:

name = "something, anything really, it doesn't matter"

That’s it, that’s all it takes to break a gadget. This bug was very hard for me to find and fix. I now realize it’s noobish not to place ‘var’ before every local variable and that the most polite thing would be to always use var and fight the scoping with only one uniquely named global. Javascript did a big nono when it decided that by default a variable is global and the special ones are local. Really that’s just one insane design choice.

What’s in a “name” as one might ask is something like
“wgadget_iframe_8” for which I didn’t really care enough to dig any further. Just know that you can’t touch it when making a gadget for google wave.

Btw the gadget I made’s called “4 in a wave” which allows you to play the classic game face to face (thumbnail to thumbnail) with your opponent. A bot for playing alone is coming soon. To use this gadget in a wave just click the puzzle piece and paste this url:

Python Programmers Writing Javascript Beware

Call me silly for not reading the docs, but this bug was very hard to find. Dictionaries in python are NOT the same thing in javascript. The curly braces mean it’s an "object literal" and the keys don’t need the quotation marks. For example:

var x = { NAME: 123, Something: "ok"}

Is the same as the following code:

var x = {}
x['NAME'] = 123
x['Something'] = "ok"

Which means that if you had a variable named "NAME" and you expected it’s contents to be the key, then you’re going to have a royally hard to find bug (especially when developing for an already obfuscated framework such as Google Wave).

This is even worse because JSON causes you to believe the quotation marks are needed. If there’s a place to file a JS enhancement proposal, I would, but I doubt this inconsistency would annoy anyone but a pythonista.

Projects I’d Like To Do

I’ve got too many things on my mind, I was thinking of doing the following:

  1. Help improve 3to2, sounds like it could help bridge the PyPI gap and allow for writing “backwards compatible” libraries, using the newest of technologies (it’s alot better than imitating decorator behavior using the silly syntax it’s sugar for).
  2. Help port Numpy to py3k
  3. Help port Django to py3k
  4. Build a small script that’ll crawl and give points to developers. [update: ohloh did it]
  5. Build a python ascii art lib (not one that does the greyscale trick, one that actually tests for lines etc).
  6. Build a pinax captcha app
  7. Make a py2exe, Freeze, py2app mashup that can easily compile on all platforms.

I think that’s it. I wonder how much of the above I’ll be able to complete by next month considering I’m really not good enough in Rock Band 2 drums yet.

Dr. Jekyll And Mr. Hyde

Books are assembly and movies are python. To me, books are an outdated medium that’s just not worth the hassle. Movies on the other hand I enjoy watching and creating. Of course just like there will always be people optimizing assembly, there will always be the paper text lovers, they can enjoy their pretentious fun ride for all I care.

Of course I don’t dismiss text as a medium completely, but story books are just java bytecode that’s waiting to be JIT compiled into a movie if it’s worth the machine’s effort.

Now, concerning this anti-science borderline racist book Dr Jekyll And Mr. Hyde thing, I quote:
"""Why is one person blond and the other brunette? Why are some people tall and others short? There must be a similar reason to explain the good and bad parts of mankind.""". This Jekyll guy was so curious and into the science that he got defaced and destroyed by this inclination. He became a short, ugly and thus evil form of himself. The good guy’s last words are "May the good Lord take mercy on me", so he actually tries to repent, lovely.

May god have mercy on religious fud tactics.

Python Regular Expressions Evaluator

I wanted to try out Django over App Engine so I made an online regular expressions evaluator:

At first I thought it’s strange that there’s no online python regular expression checker. This might not be surprising considering how easy it is to test stuff with the python interpreter as opposed to php which can be a PITA for just testing one or two lines. Either way I thought this might be useful for quick checks and as a teaching tool.