Category Archives: Programming

Post-transaction events in Django

So, at work I’m using Django quite a bit, and I ran into a problem where I need the database transaction to be committed, and then I need to trigger additional server-side code that will act on that data. Putting all of this into the view function with a manually managed transaction sucks, far too [...]

Eclipse is still mean to me

So in working on Android programming I’ve been working through O’Reilly’s book on the subject, or one of them at least, and I’m at the stage of including the jtwitter library to talk to twitter. So, I add it as a library in eclipse, and everything builds, and then when the app runs I get [...]

Eclipse, you could be nicer to me

So I’m playing in Eclipse going through Android development HOWTOs. Yes, I know. Java. Thankfully there’s a scripting layer for Android, but I want to learn it all before I choose a toolset for a particular problem. Besides, Java ain’t all bad, just mostly. Anywho, I fired up the HelloWorld tutorial, made my project, and [...]

Some languages make you work too hard

Disclaimer: Python is my language of choice for programming, but I have a long Perl history as well. Coming from Perl, when I find that I must do something simple like taking a string, delimited by pipes, and split it into a hash/dict/associative array/whatever. mystring = foo|1|bar|2 So I want to take that, and split [...]

DBUS, an interface only Java programmers could love

I decided to move away from Gnome on my netbook desktop, as recent Ubuntu updates caused more problems than they solved, and now I’m back to running my beloved Fluxbox. Of course, doing so means that I lose some conveniences in the Gnome desktop. For example, when I close my laptop lid, the netbook no [...]

Twisted Python and Chunked Encoding

When I was first writing a little web service in Twisted Python that would return JSON encoded data, and I was having some issues with loading it up using Javascript, I used Wireshark to trace the whole thing and was surprised at how the response looked. There were delimiters around the data, and the response [...]

Cross-Origin Requests in Twisted

I’ve just been learning about Cross-Origin Resource Sharing, to permit javascript downloaded from one domain to make Ajax requests out to another domain. I started learning this because I was writing a Google Maps client to test some back-end code and it wasn’t working for some reason. Thanks to the help of someone on the [...]

Where Django signals aren’t enough

So, I’ve been trying to solve an issue in some Django code at work where Django’s insistence on cascading deletions across foreign keys (not necessarily a bad thing) has resulted in unintended deletion. I have a model, Client. Client has a ForeignKey to Zone. When Zone is deleted I would like to intercept and move [...]

Java sucks

Well yes, we know this already from the way that it makes easy things hard, and hard things nearly impossible, but it’s rarely been captured with the eloquence that I find in these wonderful quotes on the topic. And yet, as cockroaches are to humans this technology/language/marketing campaign continues unabated until having java on one’s [...]

Dijkstra’s Shunting-Yard Algorithm in Python

For work purposes I had the need to implement a query parser for a simple query grammar on a product that I work on. I wanted the query to be provided in infix notation, something like foo and not bar To compute the answer, the simplest thing to do seemed to be to convert it [...]

Follow

Get every new post delivered to your Inbox.