A Little Webdriver Toss in Some Craigslist

A while ago I caught a wild hair to create a program to scrape CraigsList for tech jobs. Chris McMahon, fellow friend and creative QA extraordinaire is credited with turning me onto this idea. He created essentially the same script but in ruby, what a crazy simple notion. I tend to spend most of time in Python so I thought I’d jump ship back to my Java roots and try my hand at my own implementation. ...

August 3, 2010 · 2 min · Matt Brandt

A Kindle arrives at our house

Not so long ago I would have cringed a lot harder than I am right now at the thought of buying an eReader. I adore books, I love the smell, the feel, and the way they look decorating my book shelves. I’m also one of those offensive people who will write in the margins of my books… especially technical or science/math books. I will be that offensive person you see in the coffee shop marring his books with a pen. ...

July 1, 2010 · 2 min · Matt Brandt

Python Update Your Eggs

Quite awhile ago I needed an easy way to update all my Python eggs, this is tedious at best especially if you didn’t explicitly keep track of what you’ve installed over time. The script below isn’t mine (I’ve made a few subtle changes) but it is invaluable. I’ve been using it for the last 8-months without fail. Many thanks to Flávio Codeço Coelho for making his script available online. #!/usr/bin/env python from setuptools.command.easy_install import main as install from pkg_resources import Environment, working_set import sys #Packages managed by setuptools plist = [dist.key for dist in working_set] def autoUp(): for p in Environment(): try: install(['-U', '-v']+[p]) except: print "Update of %s failed!" %p print "Done!" def stepUp(): for p in Environment(): a = raw_input("updating %s, confirm? (y/n)" %p) if a.upper() =='Y': try: install(['-U']+[p]) except: print "Update of %s failed!"%p else: print "Skipping %s"%p print "Done!" print "You have %s packages currently managed through Easy_install"%len(plist) print plist ans = raw_input('Do you want to update them... (N)ot at all, (O)ne-by-one, (A)utomatically (without prompting)') if ans.upper() == 'N': sys.exit() elif ans.upper() == 'O': stepUp() elif ans.upper() == 'A': autoUp() else: print "Oops, you chose a non-existant option. Please run the script again."

April 12, 2010 · 1 min · Matt Brandt

MIPS

Spring is in the air (finally) in Colorado and it doesn’t look like we’re going to get huge amounts of snow anytime soon. I was dinking around my file system to see what files I’m willing to delete thinking to myself, “can I clear up any mind clutter?” Well I was able to delete quite a bit of my old adventures from the past. However, I came across a bit of MIPS code that I wrote, I almost deleted it until I remembered somewhat recently I was able to help some poor student with his homework on one of the Ubuntu forums. ...

April 5, 2010 · 3 min · Matt Brandt

Jython - How to install Python libs

This wasn’t immediately obvious to me even though in hindsight it makes sense. Without putting much thought into my first attempt I numbly typed python setup.py install. My goal, to use both the twitter and the simplejson (a dependency for the twitter api) apis from my Jython scripts. I quickly discovered that to explicitly install these libraries for use in Jython you need to run their setup.py scripts explicitly from Jython. To get started download the src code of the Python libraries that you want to install. ...

April 2, 2010 · 1 min · Matt Brandt