Git Command Aliases

This is kind of a tip of the day, but I just think its cool so I am sharing it with everyone. And being a recent convert to Git and the fact that I have to use Subversion at my place of work, I find myself constantly doing things like this out of habit.

$ git st  && git ci

Well now I can do that (although it may not be a good idea) with git alias:

elubow@beacon (master) supportskydivers$ git config --global alias.st status
elubow@beacon (master) supportskydivers$ git config --global alias.ci commit
elubow@beacon (master) supportskydivers$ git st && git ci
# On branch master
nothing to commit (working directory clean)

Now st and ci are git aliases for status and commit respectively.

Posted in Tips. Tags: , . 2 Comments »

What Does Web 2.0 Mean To You?

I have been doing a lot of reading and a lot of thinking and trying to decide what exactly Web 2.0 means. What massive advancement in an emerging technology called the internet advocates an increment in major version number?

Some people say its the looks. The new feel of the internet with crazy CSS and rounded corners and a lighter more airy feeling. I don’t think that’s it.

Some people say that its the AJAX layer that has been added to the internet. This refers to the layer of interactivity a page web page can give you. I don’t think it’s this either.
Read the rest of this entry »

Posted in Musings. Tags: , . 4 Comments »

Python Multiprocessing Pools and MySQL

There really isn’t a solid Python module for multiprocessing and MySQL. Now this may be because MySQL on a single server is disk bound and therefore limited in speed or just because no one has written it. So here is a quick and dirty example using the Pool module in multiprocessing in Python 2.6 and MySQLdb.

I also tried using PySQLPool. This was designed for threading and not forking as I am doing with Pool method. Although I am sure it is possible to use PySQLPool with forking by passing the connection (pool) object down to the child process or possibly doing something with IPC, I decided to keep it simple (although slightly more expensive) and instantiate MySQLdb connections upon fork.
Read the rest of this entry »

Python’s MySQLdb 2014 Error – Commands out of sync

While writing a simple Python script to access and process data in a database, I came across an error that said:

Error 2014: Commands out of sync; you can't run this command now

After quite a bit of Googling and with very little findings, I had to dive in a little and try to figure out what was going on. The whole error looked like this:
Read the rest of this entry »

Posted in python. Tags: , . 6 Comments »