Skip to content

{ Category Archives } code

One bit of Python I’ll never get…

>>> “hello”[2:4]
‘ll’
>>> “hello”[2:]
‘llo’
>>> “hello”[:4]
‘hell’
Do any of those not make sense to you? Here’s how I see it, and my confusion;
“hello” represents a 5 character string… and indexing starts at 0, something most programmers are all familiar with. The “[" "]” characters are used to subscript (or index) the string (which is actually a list of [...]

What if stocks were movies?

As you’ve seen from my previous posts, I’ve been playing with python, couchdb and been working my way through the “Programming Collective Intelligence” book. However, what I haven’t been talking about much is what I’ve actually been doing with it!
When learning something, I’m at a disadvantage unless I can relate the technique toward an application, [...]

python & couchdb sample

Lacking any good examples of how to use python’s couchdb module, I’ve managed to make pretty impressive progress (for me) on a 4th of July holiday.
I’ll try to recreated it here for others although I know it’ll be incomplete.
Consider it a syntactical example;
import couchdb
s = couchdb.Server(’http://localhost:5984/’) ##why can’t it default to this?
db = s['stock_values']
ids [...]

O’Reilly Make me an Offer!

I’m a big fan of O’Reilly books, as I’m sure most of you are. They’re great technical resources for me and have cute animals my wife can really enjoy!
A friend of mine got Programming Collective Intelligence and recomended it to me, so my mother-in-law gave it to me for my birthday (yay, I’m old!). I’m [...]

Even the real geeks at google can’t get it right all the time…

Having a “systems programming” background I’m a little green to this web programming stuff. It’s not that it’s incomprehensible, I’ve designed for these applications but I want to ensure I can implement some of the software components as well.
I’m beginning to really appreciate it, in part because the frameworks are so polished that I don’t [...]

Back in Bash

Quick little post today,
Using my previous two scripts you’ve (1) been able to separate a massive photo directory into 3rds (2) been able to take one of those directories and identify matching photos and move them into directories of their own, to make it easier to compare the results.
Now you’ve got a bunch of directories, [...]

Continuing to Code

Well, my python’s not exactly getting prettier but I’ve been able to make it more functional, may I present “find_image_dups.py”!
Although I’m learning this 4G language (is it truly?) I still tend towards a shell scripting approach so I write small bits of code rather then trying to write one script that will both subdivide [...]

Progress in the New Year

Welcome to the New Year! A lot has happened already, between Google changing their page rank, Apple’s numerous announcements and tons of other cool stuff. I’ve been getting back into the swing of things and mostly trying to figure out how to start off the new year right, i.e. if there was some great “first [...]

My bad old-time-y-ness

I wanted to post something relatively quick tonight, so here’s a bit of poking I’ve been doing. I’ve yet to get anything interesting with bluetooth between my laptop and my iPhone. That and I’m a pretty paranoid person so I keep the bluetooth turned off. However, I decided to leverage my paranoia to give me [...]