20 November 2009

Python Sequence Generator

I was looking for Python "sequence generator" code earlier today. By that, I'm thinking of a method to increment an arbitrary string of letters and numbers in an orderly way.
I figured there should be code samples out there to make quick work of it, but it was more challenging to find something than expected. Part [...]

15 November 2009

Python CSS Shrinker for WordPress

This isn't really specific to WordPress, but it preserves the first comment for WordPress theme management, WordPress is awesome, and I'm specifically using this for WordPress style sheets, so I'm making the connection.
I wrote this script to condense my style sheets into smaller files for faster download times. I'm all about customer service here.
And [...]

27 June 2009

Python script: Extract slashdot user names and ID numbers from a story discussion

I was reading slashdot yesterday and some (inane) comments about people's user ID numbers made me curious about the overall distribution of IDs in slashdot discussions. It didn't take long to take what I'd learned about the Beautiful Soup screen-scraping library from writing my Twitter status backup script to get some simple information.
Here's a quick [...]

29 March 2008

Python: Regex Test Function

 
More fun with Python and regular expressions. Following up on a previous post, I wanted to share a little test regex function I wrote in Python to help me as I work through the regular expression book.
I'm mostly working at the interactive prompt and had been running commands from Python re (the regex module) [...]

14 September 2007

Celebrating Software Freedom Day: Check out some newly emancipated AI Java example code

An objection I've had to many programming books and web sites is that they don't make sample code available under a free software license. This is within the rights of the author, of course, but it seems counter to the spirit of teaching and sharing knowledge to restrict the use of example code.
A writer [...]

29 June 2007

PermutationIterator.java (in honor of GPLv3)

To celebrate this great day, here's a little bit of free software, released under the terms of the GNU General Public License, version 3: a Java class I wrote to find all permutations for a given string. I may later post some more in the way of documentation, but for now, por ejemplo:
PermutationIterator p [...]

15 April 2007

bash shell script: copy only files modifed after specified date

Or maybe you just want to tar up only directories and subdirectories, excluding files...
I've mentioned a few times lately that I'm working on my backup plan for GNU/Linux. I started by looking at great free software tools like Samba's rsync and GNU Tar, and I don't think I need to look much further than [...]