Using Django transactions to do bulk insert query
I recently came across this simple solution of doing bulk queries in django using transaction management trick –>
http://techguyinmidtown.com/2009/01/28/manage-your-django-transactions/
Language showdown: stackoverflow
This was a very simple post of language showdown. The problem is very trivial, so this in no way indicates what language is better or worse. It’s just about looking how it’s done elsewhere.
Redundant to say, python is clean and elegant as always. Just go through the link below and check out. I am thankful for coming across python.
Django efficient reverse lookup
Nice post on how not to query the crap out of your database –>
http://blog.roseman.org.uk/2010/01/11/django-patterns-part-2-efficient-reverse-lookups/
Eventlet pycon 2010
Nice introductory video –>
http://python.mirocommunity.org/video/1629/pycon-2010-eventlet-asynchrono
UnicodeEncodeError: ‘ascii’ codec can’t encode character
Clean solution using django –>
http://www.saltycrane.com/blog/2008/11/python-unicodeencodeerror-ascii-codec-cant-encode-character/
easy_install vs pip
After reading the following posts it was pretty clear why pip should be preferred over easy_install –>
http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install
After reading this i tried looking at — http://www.pip-installer.org/en/latest/index.html
Yes, it’s right, you have an uninstall option and things are cleaner.
I had pip installed. When I started using the pip search it said it doesn’t recognize search. I got –
pip: error: No command by the name pip search
I realized, I was using pip version 0.32 and the world had advanced too much since this was installed! pip search wasn’t available back then. This older version was due to the pip I had installed using apt-get and it would take ages for them to realize there is a new version of a particular package there(no offence, i love apt). So i removed the python-pip package and then did a
sudo easy_install pip
(probably for the last time) It reminds me my earlier days when the first thing I would do after installing windows was to open IE and download firefox!
Anyhow, so now I have pip 1.0.2 installed and it is great to search python packages, install (obviously) and uninstall (not so obvious Mr. Easy_installer) and be happy from now on!
Better git diff
git diff is very good and crisp to see quickly what changed, but if you are reviewing a big non-trivial change across many files it gets a bit tedious and irritating.
So I found this post –> http://jeetworks.org/node/90 which basically suggests using “git difftool” instead of just “git diff”. git difftool will have some default editor as the diffing agent.
Alternatively you can also set it yourself in the gitconfig to mayber soemthing like vimdiff.
.gitignore not working
A very common problem with gitignore when you just setup is the memory it has of the files already being watched by it which you want to be ignored now on. So basically, you need to clean everything from git’s index and then add it back! Super.
Source: http://www.randallkent.com/development/gitignore-not-working
Taskwarrior – task
After looking for many simple task managers around I have finally settled with Taskwarrior
It is simple, runs on the terminal, extremely lightweight as it is just a text data file which gets created. Also you can do some pretty complicated things with this. Along with simplicity of using it and having used it, it allows for a multitude of options. It has both simple and advanced features and a developers guide to create cool/useful plugins for linking it with something else you are comfortable using.
Also, I am using Git along with it to keep my task lists in sync. Also there are tons of features along with this. It’s simply elegant. I will be trying to sync some required tasks out of these with my google calendar in case I like to be buzzed. And with googlecl this is very easily possible.
Never have my todos looked so clean! Try it for yourself!