Archive for the 'Uncategorized' Category

Troubleshooting networking

2008-08-27-Wed

a.k.a. I F***ING HATE COMPUTERS WHEN THEY DON’T WORK RIGHT AND I CAN’T FIX THEM
Introduction
Up until now, I’ve almost always been running the DrProject server and the web browser to drive it on the same machine. For reasons I will not go into, I needed to run DrProject on an Ubuntu Linux installation on one [...]

Simplified admin menu and enhanced users/projects pages

2008-08-08-Fri

As per Liz’s suggestions (#0, #1, #2), I have simplifed the admin menu, and added statuses and actions to the list users page and the list projects pages. (Implemented in changeset 5663.) Screenshots:
The reduced admin menu:

Manage Users page:

Manage Projects page:

Manage Roles and Capabilities page:

Easy examples of redundancy

2008-07-29-Tue

The following are some examples of simple redundancies in procedural programming. They are given in Python. I typically run into these when I simplify my code after writing it for the first time or after making edits.
Using if-else to assign a Boolean:
if condition:
x = True
else:
x = False
Simplified:
x [...]

Department of redundancy department: Python lambdas

2008-07-29-Tue

A coworker recently pointed out the lambda (anonymous function) in this piece of code that I wrote was redundant:
project_key_regex = re.compile(r”^project(\d+)$”)
for key in filter(lambda k: project_key_regex.match(k), req.args.keys()):

It would be improved like this:
project_key_regex = re.compile(r”^project(\d+)$”)
for key in filter(project_key_regex.match, req.args.keys()):

Apparently, methods of an object can be thought of as [...]

The revised create users and create projects doublet

2008-07-28-Mon

A picture is worth a few hundred thousand bytes, so without further ado, this is what’s new:

Although it isn’t apparent from the screenshot, a new memberships row (with “select a user/project” and “select a role”) is added whenever the final row is filled.
Compare these to the interfaces that we had before:

Create Multiple Users: Error handling

2008-07-23-Wed

The new Create Multiple Users page has a back-end that gives information on all sorts of errors:

Great bug writers think alike

2008-07-10-Thu

a.k.a. “A subtle bug from a perfect storm of HTTP, HTML, JavaScript, and DOM“
My current work
I’m currently in the midst of implementing a new interface for creating new users. This is how it currently looks like:

The project membership table is created on the client side using JavaScript. The administrator adds and removes memberships (rows) without [...]

Final role editor (for now)

2008-07-09-Wed

This is the current state of the role editor. Development on it has wrapped up a few days ago. It is available at (SVN) https://drproject.org/svn/drproject/DrProject/branches/newadmin.
Initial screen:

Adding a role:

Role added:

Editing a role (click on pencil and paper icon):

Done editing a role:

Removing a role that is still in use (click red X, get redirected to this page):

Note [...]

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). [...]