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!
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. I hate Flash. A lot. It’s not just that I think it’s bad technology, it’s weirdly personal. And yet, as much as I hate Flash, I was a little annoyed by Steve Jobs’ pithy defense of Apple keeping Flash off the iPhone. Here’s why:
Read more »
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 multi-touch modules, support for extra filesystems, or ipv6 before the stock ROM has those features. But we do prefer to own our phones with root, instead of “borrowing” phones from the manufacturer. (If you don’t have root, you don’t really own the device.)
Most of the ROMs on xda-developers are one-off builds from hackers who are experimenting. I don’t want to experiment — I’m looking for less Slackware, more Ubuntu on my phone. Over a year ago, I installed CyanogenMod, as it seemed like the most consumer-friendly ROM out there. For one, instead of a poorly formatted posting on xda-developers, it has an actual website. It also boasts an automatic updater, lots of nice features like tethering and a caller blacklist, and even a stable-v-unstable build schedule.
Unfortunately, CyanogenMod has become increasingly unstable for me. That’s probably due to a combination of things, including Cyanogen’s unfortunate proclivity to bloat-up the stock firmware with features and experimental kernel improvements. Another cause for the problem is likely attributable to Google’s position of only half open sourcing Android.
What I’m looking for is something like the stock ROM, with root, tethering, auto-update, and not much else. I don’t think it’s out there. Maybe I should figure out how hard it is to do it myself.
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.
Read more »
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 only runs on the new Android 2.0 phones (namely, Droid from Verizon) and even rooted G1 are still only running Android 1.6. The instructions call for basically replacing the entire build properties on your phone with the Droid ones.
Read more »
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.
Read more »
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 been using CherryPy (on and off) for years now. What troubles me about CherryPy is that despite all those years of experience, there are still parts of CherryPy I struggle with (and not just this horrible while-true-except-pass loop). Here are my partially collected thoughts. I’ll start with what bugs me enough about CherryPy for me to seek alternatives.
Read more »
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 lets you use it like this:
meld spam.orig spam.mine - eggs.orig eggs.mine - pants.orig pants.mine
The usage is the same as it was before, but now you can specify multiple comparisons, separated by “-”. We’ll see if the patch is accepted; I posted it to the mailing list. In the meantime, you can download it here.
No such module existed, so I wrote one. Using it is pretty simple:
Read more »