January 2010
20 posts
3 tags
Python Bits: setdefault
You may have encountered the get method available to all dict instances before. Here’s an example: >>> d = {'a' = 1} >>> d.get('a') 1 That’s the same as d['a'], but it also provides an alternative value (None by default) if there is no such key. I’ve just discovered that there is another way to do this, and that’s the setdefault. In addition to...
Jan 27th
2 tags
Jan 24th
2 tags
Jan 23rd
2 tags
Jan 23rd
2 tags
Jan 23rd
2 tags
Jan 23rd
2 tags
Jan 23rd
2 tags
Hobbyist's Guide to Programming Python (part 5)
Great job getting through the part 4 of this Guide alive. It was deliberately designed to get you up to speed. I’ll stop here briefly to present you with some reading material to recap the things we have talked about before. First and foremost, let me introduce you to the Python documentation. The Python documentation is located at docs.python.org. Bookmark this. No, do it now....
Jan 23rd
1 tag
“In social psychology, the question is exactly the reverse: What is to be...”
–  Wilhelm Reich, Mass Psychology of Fascism
Jan 23rd
2 tags
Hobbyist's Guide to Programming Python (part 4)
In part 3 we were very successful in turning a potentially daunting task of generating initials for a hundred people into a programming challenge, and learned a lot from it. Now the we decide to share our success with someone else. But how? Thing is, we were writing our programs in the Python shell. It doesn’t really save any of it. So, once we’re done and close the shell, we no...
Jan 22nd
2 tags
Hobbyist's Guide to Programming Python (Part 3)
In the part 2 of this Guide, we covered variables and values. If you are unsure what these terms mean, please go back and have a look. This time, we’ll talk about making Python actually do something useful for us. Start the Python shell and follow along. >>> first_name = 'Graham' >>> last_name = 'Chapman' We’ve let Python know the name of one of the Monty...
Jan 22nd
2 tags
Hobbyist's Guide to Programming Python (Part 2)
Last time we talked about some general concepts in programming and the Python programming language. We’ve mentioned that programming means letting the computer know what it needs to know, and make it do what we need it to do. In this part of the guide, we will talk about how to talk to Python, and how to let it know what it needs to know. The first step to learning Python programming...
Jan 22nd
2 tags
Hobbyist's Guide to Programming Python (Part 1)
— dedicated to Suzana What is programming anyway? The act of programming is commonly perceived as one of the arcane arts that magically makes computer do stuff, a process that is itself understood by very few. Even those who actually associate with a live specimen Homo Sapiens involved in the art – commonly referred to as a programmer or software developer – may notice about them only the...
Jan 22nd
1 tag
Backspace and gVim on Windows
I installed gVim on Windows at work. It’s not such a terrific experience without all the other tools I’m using (and am used to), but I still get to do a thing or two in spare time. Not bad. I wrote a basic _vimrc file and started hacking at my latest project. Then I got stuck on the fact that the Backspace key doesn’t work. I can’t delete text in insert mode. After a bit...
Jan 21st
2 tags
What's a good URL?
I’m scratching the surface of REST (representational state transfer), and I’m beginning to form my opinion on what a good URL should look like. So far, I’ve figured this out: each URI should point to a single resource, or a collection thereof. Here’s an example. You have a collection of images. The URL of the collection is: http://www.example.com/images/ It’s...
Jan 14th
1 note
1 tag
People Without Borders
No, this is not the name of some fancy international organization. Nor is it a collective name for NGOs that end with “Without Borders”. It’s a name of an unfortunate patter in upbringing that causes so much trouble for those affected. Among affected, I include myself, my girlfriend, some of my friends, many of my colleagues, and practically every other person I know. Now,...
Jan 14th
“Fighting the system is the sure way to get stabbed in the back by the true...”
– Foxbunny in a Twitter post
Jan 11th
2 tags
Templetor Gotcha
web.py’s Templetor is an awesome templating language. Very flexible, very Pythonic, and it neatly gives you in it enough Python to get by but not as much as to compromise security if you let the kids play with it. Great stuff. But there’s one gotcha. I’m used to using templates for just about anything. Whether it’s e-mail messages or JavaScript code to return to jQuery so...
Jan 1st
1 tag
Gimp Studio 1.2 Released
This is a simple updated which switches Gimp Studio to file-ora.py from Gitorius rather than the one from Gimp Plugin Registry. You can get the PKGBUILD and the tarball from AUR.
Jan 1st
1 tag
Gimp Studio 1.1 Released
You can get your PKGBUILD from AUR (direct link to tarball). There are no major changes in 1.1 release. Gimp itself was updated to 2.6.8, and consequently, Gimp Studio 1.1 requires GEGL 0.1.1. Users reported issues with some Photoshop files inlcuded with the Gimp Paint Studio package, but fixing this issue is left to GPS developers. As soon as GPS itself is updated, Gimp Studio will be updated...
Jan 1st