December 2009
38 posts
1 tag
migration.py 0.1 Released
migration.py is a Python script for migrating database schema. It uses web.py’s db module to access and manipulate databases, but it can be used independently of web.py. However, you still need web.py installed on your system.
Unlike django-evolution, which reads the model files to determine how to execute the migrations, or Ruby on Rails migrations which are written in separate files,...
2 tags
authentication.py 0.1 Ready for Beta Testing
The tarball and the zip archive of authentication.py 0.1beta are ready for download. The basic user management facilities as outlined in the README docs are now equipped with the test suite and ready for testing on a concrete project.
I intend to write a small blogging application for my personal use, and once that works, I will mark 0.1 as released. Further development of the 0.1 release will...
2 tags
Hitting a Moving Target
Developing a framework because ‘you may need it’ is not a very pleasant experience. It’s a solution waiting for a problem, and it’s certainly not easy to do. But I decided I had to do it. There are a few reasons why I opted to design a framework before I knew the actual use case.
I know it will be used in more than one project
I didn’t want to spend too much time...
1 tag
Art Strike and All Other Strikes
I went over to my parents’ home. Both my brothers still live there. I must admit I was more in tune with the younger of my two brothers, and I used to enjoy having conversations of all kinds with him in the past. We would talk about psychology, politics, and various other topics. He wasn’t at home, so I went into his room to have a cigarette. It’s the sanctuary in a non-smoker...
4 tags
authentication.py Summary of the 1st Week
It’s late Saturday night (actually closer to Sunday morning), and it’s time to summarize the development of authentication.py this week.
A short intro is in order. authentication.py is a microframework for user/group/permission management for web.py. It’s meant to cover a wide range of scenarios involving user authentication, user account and group management, and permissions....
3 tags
Welcome, nVidia GT220
I don’t want to talk much. Installation? A breeze. Insert the card, power up the PC, install nvidia and nvidia-utils packages, run nvidia-xconfig once. What could be simpler?
Performance? Another no-brainer. The new generation GT220 gets 11k+ frames on glxgears, compared to modest 2k+ fps on admittedly underpowered ATI Radeon HD 2400XT. But that was expected. GT220 is a whole year younger...
4 tags
Goodbye AMD/ATi
The ATi driver situation is driving me nuts. I’ve just loaded Blender, and as soon as I try to resize any of its panels, it just dies on me. Of course, with open-source Radeon drivers, it’s no wonder. Point is, AMD had decided it’d put us on hold with Linux drivers for the next couple of months. If you’re running the latest X server, you’re fucked in other words.
So...
4 tags
Tornado Web Server and Framework
There’s an interesting thingy powering FriendFeed, and it’s called Tornado. It’s a non-blocking web server and a web development framework similar to web.py.
Interesting thing about Tornado is that’s it’s a Facebook project (FF was acquired by FB apparently), hosted as open-source on Github.
The framework itself has Django-like template system, and web.py-like...
2 tags
Flattening Nested Code by Short-Circuiting
Nested code is ugly. It’s not just ugly, it is also bad for your health. Imagine having to deal with dozes of binary if blocks nested into each other. It can drive you crazy just imagining it. But there is hope. Using short-circuiting, you can flatten your nested blocks, and write some very nice code.
Here’s a simplified example:
if x > 1:
if y < 5:
return a
...
import this
The Zen of Python, by Tim Peters
Beautiful is better than...
– From Python console
2 tags
Windows Files on Linux
No, I’m not talking about DLLs here. I’m talking about source code. It’s unbelievable how much difference CR/LF makes, and subsequently, how much headache (until you’ve figured out how easy it really is to convert the files, that is). To save you some trouble, here’s what you can do to convert Windows files into Unix format.
First get the dos2unix tool (part of...
2 tags
Untangling Commits with Git GUI
If you are anything like me (and I hope, for your own well being, you’re not),
you’re probably constantly changing frameworks, even programming languages, and
you’re writing code as if every line’s an experiment. Sometimes it’s just
curiosity, sometimes it’s just ‘being noob’, but I’m always writing more lines
of code than the atomicity...
At the heart of software architecture is the principle of abstraction: hiding...
– from R. Fielding’s Dissertation (p. 5) http://www.ics.uci.edu/~fielding/pubs/dissertation/fielding_dissertation.pdf
5 tags
Subselect that Broke the Camel's Back
Nope, this post has nothing to do with camels, really. It’s got to do with Django, and remembering why I ditched it before in favour of web.py.
I’ve been coding the Django permalink app for a while now and decided to do some premature optimization (something that’s frowned upon, but I simply can’t resist it). Using django.contrib.contenttypes, it takes about three queries...
2 tags
Testing Django Standalone Apps with Fake Models
If you’ve needed to test a standalone django app that relies on presence of arbitrary models, you may have wondered how it’s done. Although it’s very easy, it’s not too obvious. As with many people, I was considering (a) setting up a whole testing project just for testing, and (b) creating a mock class that would mimic a model. But depending on what you want, there is a...
2 tags
PermaLib is Now Sluggy
Preparing for upcoming Django development, I’ve decided to completely rewrite another component. The PermaLib library for Django was actually a solid piece of code. Unlike the Site Assets, it was simple, elegant, and it worked well. However, I’ve noticed some redundancy in the concept, and decided to rewrite it.
PermaLib worked like this:
* Request comes in
* View code processes the...
2 tags
Separate+ for Gimp in AUR
Arch Linux users can now get the updated and revamped Separate+ 0.5.5 from AUR. I must say I love the new Separate+. Much more streamlined, and has a few extras, like the ability to actually open CMYK TIFFs, and its own tools for converting images from one RGB profile to another.
Unlike the old gimp-plugin-separate package, this package does not include any ICC profiles. Bud don’t worry....
2 tags
Djassets 0.1 Released
Djassets 0.1 is the first fully functional and tested version of Djassets. It is also considered a sound foundation for further development. It’s behavior and API should not change dramatically until 1.0 release, but new features and functionality may be introduced.
Changes from 0.1beta release:
Implemented srcdir and ASSETS_DEBUG functionality
Reversed the semantics of ASSETS_DEBUG
...
1 tag
Djassets 0.1beta Released
Finally. After exactly a week in development, Djassets have been released. Djassets are a major improvement over Django Site Assets.
Some of the changes include:
completely object-oriented code
plug-in system for code minifiers
complete test suite
Unfortunately, I didn’t follow up on my decision to keep docs-test-driving my project, so I’m behind schedule on docs. But they are...
3 tags
Super-simple Caching of Class Properties
If you have a class (as in Python class), and you have a property whose value is not likely to change during the instance’s life, but very likely to be accessed multiple times, it helps if you can somehow cache the value so that it is only calculated the first time you access it. This is very simple to do, and here’s how.
In my Djassets project, I have a class called AssetNode....
3 tags
Bus artwork in Gimp and 600+ MB Images
I got an assignment to do vehicle art for Denistar. The bus is 21m long (approx 69ft), and 2.5m tall (about 8.2ft). It’s a huge file, let me tell you. Gimp says it’s over 600MB raw, and it gets even larger as I add layers to the file. When one side of the vehicle is loaded into Gimp, it takes about 1.4GB memory (including the app itself). Painting is as slow as it gets, and hard-core...
4 tags
Developing Standalone Django Template Tag App...
Yesterday, I’ve discovered that OOP was not really my forte. The previous version of site assets app was an example of poor OOP, to say the least. It was an ugly piece of procedural programming bolted onto a class. So, this time I looked at some good examples of OOP, and decided to follow the proper pattern. As for test-driven development, it didn’t go so well. I have the complete test...
2 tags
Removing Blogger.com Navbar
You are using Blogger.com services and you find the Blogger.com toolbar at the top of your blog somewhat annoying. And you want to remove it. Well, it’s easier than you might think.
Pay a visit to the Layout page, and click the Edit HTML link. You will see a text box below and in it a lot of mumbo-jumbo (or you might already know that it’s actually what HTML, CSS, and a bit of...
4 tags
Developing Standalone Django Template Tag App...
If you’re following this blog, you know I’m working on Djassets app for Django. I was having a bit of a headache trying to figure out how to test-drive development of a decoupled app (with no proper Django environment setup). I’ve found a script written by Brian Rosner that handles setting up the environment and running tests, and I’ve finally managed to run the test...
3 tags
Testing Standalone Django Apps →
3 tags
Testing Django Template Tags
Writing custom template tags for Django is fun. But testing the tags is a conceptual challenge for me. As Ironfroggy says in one of his blog posts:
So how do you test something that is so entrenched in the Django processing pipeline as a template tag?
I’m used to test-driven development since my web.py days, but now that I’m back on Django, the complexity of the beast seems...
1 tag
Set Font for gVim Using gfn? Command →
1 tag
Getting the Working Directory in Python
Sometimes you need to get the current working directory for your script. There is a nice little function that gets you just that, and it’s called getcwd. Here’s a small example:
Create a file called getcwd.py and put the following in there:
#!/bin/env python
import os
print os.getcwd()
Now you run it like this:
$ python getcwd.py
/home/foxbunny
$ cd Video
$ python ~/getcwd.py...
2 tags
Mcabber Sound Effects
So yo love Mcabber, that little ncurses Jabber client, the most handsome of them all? Sure you do.
Here’s a handy script to get you the sound going.
#!/usr/bin/python
# Version 0.05-sound
#
# Copyright (C) 2007 Adam Wolk "Mulander" <netprobe@gmail.com>
# Slightly updated by Mikael Berthe
# Hacked apart by Branko "Foxbunny" Vukelic <bg.branko@gmail.com>
#
# To use this...
1 tag
Grabljivica.com Finally Live
It’s been a while since I did web project after the nervous breakdown I had a few months ago. Since those times, I thought I’d never touch a code editor again. But there I was sitting in front of Vim since about a week ago. Today, I can finally show you the results.
I don’t really like the topic, but that never stopped me from doing a decent job. I even had an idea or two to...
1 tag
Baby-Related Surnames
Bebironni
Bebevich
Bebirez
Bebasaki
Bebesku
Bebisku
Bebimirov
Babs
Bebsky
Bebovich
Baber
Bebinho
Bebamoto
Bebimir
Bebovanni
Of course, all of these are made up for entertainment purposes. Any similarity to real surnames is conincidental.
3 tags
Open-Source Challenge: The Conclusion
Today I’ve received my copies of the Denistar catalog, hot right from under the printing press. Let me first tell you, they look truly amazing. Well, not just the look. The touch as well. I’ve asked for two layers of lacquer varnish on the cover, and it was a major hit. The cover not only looks like denim texture, it also feels like one.
Color rendition is not perfect, but it...
1 tag
Inkscape woes
I was so excited that Inkscape 0.47 was released, but it has now become apparent that it will not compile on Arch Linux. In fact, it will not compile anywhere where latest and greatest poppler 0.12.2 is installed instead of the slightly older poppler 0.12.1. There was even a patch, but it’s not a good one. The bug report says it all:
From what I can tell, that patch is horrendously...
1 tag
IE at 5am
me: that's how I used to work
but if I did that now
I would end up
feeling like the world is crumbling in front of my eyes
: D
Branko: for me it's easier than staring into IE's crap
me: getting everything just right and then opening IE is so disappointing
I don't think I could take it
: D
especially at 5am
Branko: :D
luckily, it's 4AM now
: )
1 tag
1 tag
Happy Customs
As someone who regularly orders books from Amazon, I was a bit shocked to hear that the latest shipment was taxed by Serbian customs. I know this is a poor country and that an odd customs officer might do something unexpected (well, actually, most of them do), but this time it’s the law that says books are to be taxed. It’s a sad day for the exchange of knowledge, and a happy day for...
3 tags
Open-Source Challenge: Last day?
Yesterday seemed like a great win for open-source setup I’ve got here. PDF 1.4 files passed the RIP mostly successfully, and an odd page had to be exported as PDF 1.3 (thankfully, I wasn’t using transparency on them). But today, things have changed. First the ink covrage turned out to be a lot more on most pages than what I saw on the screen (and frankly, not even the printers saw it...
1 tag
The League of Movable Type →
Freebies are great. But if you’re looking for free with style (as in freedom), you absolutely must check out the League of Movable Type.
Here’s what they say about themselves:
We’re done with the tired old fontstacks of yesteryear. Enough with the limitations of the web, we won’t have it. It’s time to raise our standards. Here, you’ll find only the most...
November 2009
70 posts
3 tags
Open-Source Challenge: Day 5
All done. As usual, last minute changes took me a few hours more than I’ve planned. Client has no intention to compensate. Sigh.
The project is finally finished, and I’m looking forward to a good night’s sleep. Meanwhile, I’m behind schedule on another project that’s been begging for attention for a few days now, but I can’t blog about it (yet).
To all of...