Friday, April 29, 2011

more ubuntu fights

so I know I thought I fixed my virtualenv and virtualenvwrapper problems recently, but apt-get wasn't letting me install anything! This error:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named virtualenvwrapper.hook_loader
dpkg: error processing install-info (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:

So it seemed like it had something to do with install-info, whatever that is, but NO - I'd forgotten about some lines in my /etc/environment file that had to do with virtualenv, before I started using .bashrc. took em out, all better.
facepalms: 2

Thursday, April 28, 2011

event data in jquery

this one stumped me for quite a bit. If you want to bind a click event to a div id in jquery to a preexisting function which takes arguments, you need:
$('#id').click({param: param}, function_to_run );

to bind it. Here, id is the id of the div or whatnot, param (the second one, the first one could be anything) is the variable you want to send, and the function_to_run is already written. No parens after the name, you're sending it as an object.

The tricky part is in the function itself:
function function_to_run(event) {
param =;

get it? The click event sends the event itself as the one argument to function_to_run, and the parameters you give it are stored in data. just so you know.

around a 6 on the facepalm scale.

upgrading to ubuntu natty

annoyingness right off the bat. maybe a 7 on the facepalm scale.
1. the login screen allows you to choose between unity and classic, but only after you click the login name to get the password box out. before then, no indication of any possible choices on the bottom bar.
2. loaded up classic, but compiz settings were off.
3. my ATI graphics seem choppy (ouch).
4. virtualenvwrapper acting funky - specifically,
ImportError: No module named virtualenvwrapper.hook_loader
even though things generally seemed to work. Wow, I'm going to have to figure out how to inline code on blogspot here.
Anyways, the problem turned out to be that natty installed python 2.7.1 as default. Nobody warned me! I added the line
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.6
To send everybody back to python2.6. Problem solved.

Unity isn't super annoying or buggy yet, but I'll give a shoutout if it becomes so.

Welcome to creature feature

yes, it's Yet Another Programming Blog.
I'll also throw in some deep thoughts once in a while.