Sweet video of the new Quantum Racing TP52. Its too bad that Terry Hutchinson moved over to Artemis, but this season’s Med Cup is going to be awesome.
I bet this has been done a million times before, but I just figured it out so I thought I would share it anyway.
You would think having a source code highlighter would be part built into Tumblr, but for whatever reason its not. But its quite simple to get working.
Click the Customize button in the top right corner
. Under Theme you will need to allow custom HTML, and then add the following to the bottom of the <head>(replacing the </head> and <body> tags :
<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" type="text/css" rel="stylesheet"/>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript"></script>
<style>
pre.prettyprint {
overflow-x: auto;
margin: 5px 20px 20px;
}
</style>
</head>
<body onload="prettyPrint()">
Now just make sure you encode all of your greater-than and less-than tags (angle brackets….< and >) and put your code inside the following tags:
<pre class="prettyprint"><code>
CODE GOES HERE
</code></pre>
Hearing Salman Khan speak always motivates me. I hope that someday I will be in a position I can make a difference like he has.
Spending the day fixing bugs. I have a horrible DB schema currently (column delimited string in a DB field), but don’t have the time to fix it right now. So here is my impressive (well sort of) work around:
$where = '';
foreach($ids as $id){
if($i == $numItems) {
$where .= '(FIND_IN_SET('.$id.', activity.class) <> 0)';
}
else {
$where .= '(FIND_IN_SET('.$id.', activity.class) <> 0) OR ';
}
$i++;
}
…but it sure feels good to get it working
$('.picksubject').live("change", function () {
var subject = $(this).val();
var url = 'ajax/regClass/'+subject;
var parent = $(this).parent();
if(subject != 'nosub'){
$.post(url, function(data){
$(parent).children('.pickclass').children().remove();
$(parent).children('.pickclass').append(data);
});
}
});
I’ve been struggling for the last few hours to get the Natural Language Toolkit (nltk) running on my mac, so I thought I would do a quick write up for anyone else who might be having similar problems. For those who don’t know, the nltk is:
“Open source Python modules, linguistic data and documentation for research and development in natural language processing and text analytics, with distributions for Windows, Mac OSX and Linux.”
Macs come with python preinstalled (mine had 2.6.x) on it. One would think this is a good thing (less work!) but you’d be wrong. After doing a bit of read, Apple’s python is out of date and many libraries don’t support it. That means we need to install another version of Python. This is what caused me the biggest headache and an hour or so of my time. You need the 32bit version of Python in order to run the nltk’s dependancies. As of writing this the most current version is 2.7.1 and can be found here.
Once you have installed Python you can install the nltk and its dependencies. Once I figured out the 64bit problem the rest is quick and simple. I started by installing PyYAML. Download and unpack the PyYAML folder, and move it to your desktop. Fire up the Terminal (Applications > Utilities > Terminal) and use the following commands:
cd Desktop/PyYAML-3.09
sudo python setup.py install
No big deal. Now we need to install NumPy and MatPlotLib. They both have binaries that can be downloaded and are quick and easy to install (as long as you have the 32 bit version of Python :P).
The last step is to install the nltk. The latest version can be found here. The nltk also comes in a binary form for OS X, but for some reason it doesn’t install in the proper location (it wants to install in Apple’s python location, not the location of our new install). To fix this, we need to use the terminal and run the following commands:
cd /tmp/nltk-installer
sudo python setup.py install
That will install the nltk in the proper location for us. To test and make sure that all of the dependencies are working, you can fire up the terminal again and do the following:
$ python
>>> import nltk
>>> import numpy
>>> import matplotlib
If nothing is returned in the prompt everything was installed correctly, and you can move onto learning more about the nltk.
My friend chris created this song in under 5 minutes. Follow him on soundcloud to see what he can come up with next.


