Author Archives:
How to split a string csv-style in Python
So, this is easy:
>>> ‘foo,bar’.split(’,')
[’foo’, ‘bar’]
But here’s the problem:
>>> "foo,bar,’spam,eggs’".split(’,')
[’foo’, ‘bar’, "’spam", "eggs’"]
Sometimes you want a csv-style split without the hassle of actually using Python’s otherwise excellent full-blown csv parser module.
So I wrote something that lets you do this:
>>> from csvsplit import csvsplit
>>> csvsplit(’foo,bar,"spam,eggs"’)
[’foo’, ‘bar’, ’spam,eggs’]
>>> csvsplit(’foo,bar,"spam,eggs"’, delimiter=’\t’)
[’foo,bar,"spam,eggs"’]
>>> csvsplit(’foo\tbar\t"spam\t\teggs"’, delimiter=’\t’)
[’foo’, ‘bar’, ’spam\t\teggs’]
Download it here. Enjoy!
Thoughts on Steve Jobs’ Thoughts on Flash
It’s cute how Mac and Windows users hate Flash. They don’t know how good they have it. The Linux implementation of Flash is worse. It’s like a blink-tag plugin for your browser that crashes everything it touches and pegs your CPU to 100% only to deliver choppy, unsynchronized video. It just really blows. A lot. [...]
In search of the perfect HTC Dream/G1 Android ROM
I’m in search of the perfect ROM for my phone. A ROM not for hackers, but also not for people who don’t know what a ROM is. A ROM that doesn’t expand on the stock ROM besides adding what should have been there anyway, like root and tethering. Users like me don’t need third party [...]
WingIDE Colorpicker
Dun dun dun! This is a plugin for WingIDE. When editing code, I got tired of constantly googling “color picker” when I needed to make a hex color for my CSS.
Android, Google Maps, Navigation, and Open Source…
UPDATE: The details of this article are now moot, as the latest Google Maps application on the Android Market includes navigation on the G1.
OF COURSE when I saw that someone on the Interwebz managed to get the new Google Maps with navigation running on a G1, I almost wet myself with excitement. Normally this app [...]
How to fix NiftyCube IE 8 width problem
At work we use this tool called NiftyCube to round corners of elements (it even works with divs that have gradients in them). The problem, however, is that on Internet Explorer 8, 100% width divs are shrunk to the contents of the div.
CherryPy v. Pylons
Over various pints of beer, emails, and late-night twitter tweets, I’ve alone and with others wondered about whether a smart, well-adjusted programmer would use Pylons or CherryPy for all his web programming needs (and whether such a programmer would take the time to convert from CherryPy to Pylons). Pylons is newish to me, but I’ve [...]
Patch for meld to show multiple comparisons
I really like meld as a visual diff tool, but I wanted to have have it show multiple comparisons at once from the commandline. In the GUI, you can create multiple tabs for multiple comparisons, but there is (was) no way to do it directly from the command line. So, I wrote a patch that [...]
MySQL (MySQLdb) sessions on CherryPy
No such module existed, so I wrote one. Using it is pretty simple: