Mark the line, press TAB or Shift-TAB!
Indenting in PyDev
January 31st, 2010Counting PDF pages with python only
January 30th, 2010Found this recipe – nice and lightweight:
import re
rxcountpages = re.compile(r"$\s*/Type\s*/Page[/\s]", re.MULTILINE|re.DOTALL)
def countPages(filename):
data = file(filename,"rb").read()
return len(rxcountpages.findall(data))
if __name__=="__main__":
print "Number of pages in PDF File:", countPages("test.pdf")
Nice for learning reStructuredText
January 7th, 2010An online reST-Editor – give it a try.
Django Developer Toolbar
January 7th, 2010A really nice tool for everyone developing Django. Together with virtual-env, django-evolution, fabric, pip and pydev it’s a pretty nice development environment. Get it here.
Well – pydev is currently living a dangerous life – spent my whole afternoon hunting down some well hidden problems – might be I’ll switch to vim for python development really soon … well normally pydev is great – eclipse just isn’t.
Google AJAX Libraries API (good or evil)
January 4th, 2010Just stumbled across Google AJAX Libraries API and I’m really tempted to use it.
This leaves me with the question: Should I?
At first it’s a really nice thing to be able to host less “stuff” – hosting less is (almost) always a good thing. But do I really want to delegate this stuff to Google? Of course it would be great to have a central instance for JS-libraries – as Google says you gain: correctly set cache headers, up to date bug fixes.
As often there are two sides – if using such a service, it should be highly reliable and available for ever – which makes Google a good candidate. On the other side, do I really want to make the functioning of my websites dependend on a third party – do I want them to know about my visitors?
Google is everywhere – besides GoogleAnalytics this is a second way for them to know about movement in the web.
If I find the time, I’ll take a closer look at this whole complex.
SOHO – Windows Backup of Choice
December 30th, 2009Whenever having to backup a SOHO-Grade Windows-Box I choose the C’ts VBS-rsync-Hardlink-Backupscript
.
FlexFormatter
December 10th, 2009Just decided to give the FlexFormatter a try – the google-code-SVN repository can be used as an update-site for Eclipse:
http://flexformatter.googlecode.com/svn/trunk/FlexFormatter/FlexPrettyPrintCommandUpdateSite/
CouchDB-mistake
November 11th, 2009A few weeks ago I made a mistake. While working on something else (which I did not enjoy), I watched a video about CouchDB – and now I’m hooked.
The concept of CouchDB seemed strange to me at first sight (and part of me still thinks it is). Having an Erlang implemented document oriented database which uses a map-reduce concept to get the data. There are plenty of ways to use CouchDB (which offers an http-, rest-oriented interface), libraries for almost every civilized programming language exist – but in my eyes the most beautiful thing about CouchDB is the possibility to write self-contained applications in JavaScript. Paired with CouchDBs brilliant replication features some very interesting ideas come to my mind – you will read about my learnings from Couchland here (btw I don’t like Borat).
And now I’m going to enjoy my brilliant breakfast.
OpenRheinRuhr
November 9th, 2009Been there, liked it.
Nice small event – giving kudos to the organizers. Definitive recommendation.
.local is the Shit
September 9th, 2009… accidentally I stumbled about something I really wished for. User-specific site-packages (python-talk). As specified in “PEP 370 — Per user site-packages directory” a user’s home directory might now have a directory called .local which contains lib/python<version>/site-packages and also bin/.
For this sweetness of course no python PEP is needed, but here comes the beauty:
~/.local is kind of a new standard directory which is a “standard” suggested by freedesktop.org and already used by some other applications and
python ./setup.py install –user
will automatically install the required package there – which again is no big thing and could be archived via PREFIX=~/.local/ but this is feels natural, pythonic, good. All now left to do is to add ~/.local/bin to the PATH-variable and ~/.local/lib/python<version>/site-packages/ to the PYTHONPATH (you should imo do this in ~/.profile).
So, using this, your virtualenv-usage might significantly decrease (though it does not make virtual environments useless).