Archive for June, 2008

Dumb redirects interact poorly with forms

2008-06-23-Mon

The current design for an improved role editor is still in prototype, but this is what it looks like:

The implementation of role removal is problematic, which I will be illustrating.
Upon pressing the Remove button, this confirmation form is unhidden using JavaScript:

After pressing OK, the form is submitted back onto the same page. The user is [...]

HTML ought to have nested forms

2008-06-23-Mon

So far, the redesign of the role editor has been done like this:

The selection box on the left is a list of all the existing roles. It is an necessary piece of information that needs to be submitted for the copy, rename, and remove operations.
The four panels on the right are initially hidden (using CSS). [...]

My misinterpretation of Python decorators

2008-06-22-Sun

DrProject is written in Python, but I had only a little experience with Python when I first started. So I had to learn many things along the way, sometimes in the hard way.
Today’s topic is the semantics of decorators in Python (PEP 318). I used to think I knew how they worked, but I was [...]

A simplified overview of HTML forms

2008-06-22-Sun

A form is an element that can be added to an HTML page. It consists of named fields, with each field having a value. Through forms, a user can send information back to a web server.
Suppose we have a simple HTML form on the page alpha.php:
<form action=”beta.php” method=”post”>
<p>
[...]

Miscellaneous humour pages

2008-06-17-Tue

Well, it seems like at least one coworker thoroughly enjoyed the link to a “Shoot Yourself in the Foot” joke page. So I’m going to post more humour pages that I can think of, to lighten the mood around here. (As if it wasn’t light enough already.)
The “shoot yourself in the foot” comes in many [...]

More reading books

2008-06-16-Mon

These are the books that I’ve been reading lately:

“Working Effectively with Legacy Code“, by Michael Feathers, ISBN 0131177052
“Secure Coding: Principles and Practices“, by Mark G. Graff and Kenneth R. van Wyk, ISBN 0-596-00242-4.
“Mind Hacks: Tips & Tools for Using Your Brain“, by Tom Stafford and Matt Webb, ISBN 0-596-00779-5.

Default behaviour of comparisons in Python

2008-06-09-Mon

Browsing DrProject’s code base a moment ago, I came across this piece of code in drproject.project.Project: (I abbreviated the long expression a bit)
def get_members(self):
members = [m.user for m in Membership.query.filter_by(...)]
members.sort()
[...]

Work plans

2008-06-06-Fri

Four weeks have come and gone. I spent the first few weeks setting up software, familiarizing myself with the DrProject codebase (particularly its core components) and with SQLAlchemy and Elixir, and discussing with our HCI expert Liz Blankenship. Other than that, my major accomplishment to date is the successful creation of a web interface for [...]

Roles and capabilities web editor

2008-06-04-Wed

In goes a week of work, and presto: out comes the first working version of the web editor for roles and capabilities, being completed as of revision 4971 (changeset). Here is a screenshot for the visually inclined:

Features:

Viewing the table (with real contents taken from the database, of course)
Adding a role based on an existing role
Updating [...]

Optimizing PNGs with optipng

2008-06-04-Wed

OptiPNG is a command-line program that losslessly recompresses PNG images. It does so by trying various zlib parameters (compression, memory, strategy, window size) and PNG filters (none, up, paeth, adaptive, etc.). It also reduces images with 256 or fewer colours to 8-bit paletted mode.
Here is an example of its operation:
me@computer:~$ optipng -zc 9 -zm 5-9 [...]