Tim Hatch

Weblog | Photos | Projects | Panoramas | About

Links 2005-08-26 26 Aug, 2005

  • Ozy and Millie: Millie’s Binder
  • Best way to fix unencoded ampersands I’ve found yet — I’m just not quite “with it” on lookaheads and assertions yet. Ever pondered how PERL as a language is icky, but the regexps which are the core of it are used in almost every language quite productively?
  • dot-mobi got approved? What the? I can’t see how this is a good thing (cf. wg), but for me it’s the fact that mobi on my Ericsson T610 takes an extra click, without fixing any of the issues com has (namely, o, m are on the same button):
    • com = 3 taps, 2 taps, 1 tap (on two buttons total)
    • mobi = 1 tap, 2 taps, 2 taps, 3 taps (on three buttons total)
    How is an this better?
  • Learning Floats - a quite well-written article on one of the most confusing topics in the history of standards-based web design (which, admittedly, isn’t much).
  • Django - a “pretty much awesome” framework in Python which is good at what it does, namely, abstract databases and provide MVC separation. Try to avoid comparison with Rails, because they’re different.

    Although I’ve taken some cues from this to make PHP a little more hospitable, a lot of what Django, Rails, et al. are doing is really difficult in PHP due to things like the create_function memory leak.

  • Although documentation on PHP’s class inheritance and overloading is a bit sparse, there’s a little bit I found in the zend list archives.
  • Character Codes for use in GAIM on Windows (hold down Shift+Ctrl+HexChars)
  • TXP References
  • Ico export plugin for Photoshop to keep full alpha transparency, which I remembered was possible after seeing the favicon for SquareSpace
  • Gentoo <-> Debian conversion

Things Go Changin 26 Aug, 2005

It’s Friday. End of the week. And the last day Kate’s going to be at COBA for the next four months. We’ve hired three people to take her place (half-kidding, our expansion just happens to coincide) and things have been a bit interesting with five people in one 10-foot-square cubicle (read about it at Kate’s).

We’re sorry to see her go, but are looking forward to reading about all the crazy hijinks we’re told will ensue. To Kate: have a great trip! To everyone else: be sure to check <plug:shameless>http://thatonegirl.net/</plug:shameless> for updates.

We’ll definitely miss things like the Battle Hampster, everything French, and the mantra “Make it more pink!” (I know I’m going to be corrected momentarially, once Kate’s feeds refresh, but in my defense, I’m paraphrasing).

Tux typing on Kate’s behalf

I'm told that the penguin (another of the many promos brought back from Linuxworld by Dr. Mr. Conover also spoke with several departments on campus on behalf of J&K.

IMG_0464 IMG_0465

Office Stuff

Random stuff that happened to be photographed while at the office

IMG_0504 IMG_0505 IMG_0506 IMG_0509 IMG_0511 IMG_0514 IMG_0515

UNT DOS 18 Aug, 2005

UNT has a single-login system set up via LDAP so, in theory, for any online university resource, you should only need to remember one password. This system works pretty well, except for one major defect which keeps manifesting itself on my account.

There’s a DOS situation: once a valid username is discovered (not too difficult, /[a-z]{3}[0-9]{4}/ and the Account Management site validates it for you), you simply need to pretend to log in as that user a couple of times in order for their account to be locked. The password that user had may never be used again.

I’ve had this happen to me no fewer than 20 times over the last six months, and I begin to wonder if someone else thinks their username is the same as mine, and keeps trying to log in. The biggest issue is that this happens outside working hours, and usually at times when I also want to check my account status, like right before the semester starts. It’s to the point where I’d like to request a username change, but as far as I know, this is not an option the university provides. They also don’t keep logs sufficient to show whether or not I’m indeed being harassed by someone.

Now if I really wanted to mess someone up, I’d rig up a little one-liner to look up someone’s euid from either ldap://id.unt.edu/ or http://info.unt.edu/ and attempt to log in to any number of places such as http://ams.unt.edu/.

Too easy? It is.

QuakeCon Post #1 12 Aug, 2005

Okay, I lied. Turns out they do have intermittent Internet connectivity here.

I write this from the floor of the BYOC area at QuakeCon 2005. Things have been mostly sane today, with the exception of Norah Jones playing on the giant speakers in a room whose walls are made of concrete so at the far end, we got only the sub-bass intact…

I arrived for checkin at 10:30 or so, and got to the checkin table just after noon. Not a bad wait, I suppose, but keep in mind I was lugging a computer, monitor, plastic bin, and keyboard through about 500 feet of 4-foot increments. I now know why people switch to SFF cases.

James showed up around 4 and had about a 5 minute wait in an ever-shortening line. Mental note.

Booth Info

I went over and talked to a forlorn Linksys wireless guy, who tells me SRX is a “buy” right now, that they won’t be coming out with anything better until a trade show several months down the road. It’s amazing how talkative people are when they aren’t just giving out shirts. Hrumph, nVidia.

nVidia had a bunch of “gaming laptops” set up which were quite impressive, and all the hardware vendors have something set up to show how their technology makes Quake 4 run better. I wish they were giving out the multiplayer demo that’s running on those machines.

Ghetto Con

There are a good 20-30 people from the Ghetto Lan here so far, with a few more yet saved. They’ve got “live video” of the room, but it only works in Winamp. The area we’re in is about the 6th row from being the furthest back possible, so we’ve got a walk to the main door, booths, etc. As a plus, though, whenever the organizers call out “swag!” we aren’t caught in the middle of the rush.

Various things have been blocked throughout the day, to include AIM, ICQ, and World of Warcraft. Yahoo and MSN messengers seem to work, and they’ll be blocking Steam in an hour or so. Maybe then people will be forced to play other games.

They really ought to implement something to reduce bandwidth usage (It’s a 10Mbps/5Mbps connection, I tested it this morning), and get a more reliable gateway, it’s gone out twice tonight. I bet that http-replicator could be used with almost no configuration to handle downloads from a good number of places (think Enemy Territory content dl’s), and for the rest, there’s Squid.

Headed To QuakeCon 11 Aug, 2005

I’ll be off at QuakeCon in the BYOC area with the others from the Ghetto Lan. I’ll bring back pictures, but be without Internet for several days.

Eric Moving In 09 Aug, 2005

IMG_0432f IMG_0435f IMG_0436f IMG_0437f IMG_0438f IMG_0440f

I took off from work today to help my cousin Eric move into his apartment at UTD.

Kate’s Artwork 04 Aug, 2005

Partially in celebration of Kate leaving later this month to have fun without us in D.C., partially because it’s been so long since I promised to put them up, and partially because I’ve been shamed into doing it, here are prime examples of Kate’s “Office Art” exhibition.

I shall be not held responsible for anything bad that should befall you after seeing these. Proceed at your own risk. Chances are, Kate’ll counter with the pictures of the horribly bad “art” which I, too, placed on the whiteboard.

Before we proceed, a note on the future: We no longer have a whiteboard in our area. We now have a window that kind of works, but it’s just not the same. Plus it’s the first thing that people walking in will see, so it has to stay basically, you know, sane.

Phew, I think that’s all for now. I’ve got some more of our prototype drawings, but I’m plumb out of “Kate’s Artwork”… until I offload the camera again.

Yes, you’re right, it’s a slow news day here.

Python? Say What? 03 Aug, 2005

I was first introduced to Python about three years ago by someone who worked at the College of Business with me, and fulfilled the much-disdained position of “Perl maintainer.” Moe was an advocate of doing things, basically, “the right way or not at all,” and this, he explained, was why we should rewrite Windows RegEdit in Python to make it scriptable. I’m not making this up, that was an actual project that came up at COBA.

Well, Python went on the back burner (relative to PHP, which was more applicable to business-type needs, and therefore useful to COBA) until the beginning of this summer when I started researching it further. Many projects I like to use I found out were written in Python (Gentoo’s emerge, Bittorrent, and more recently, Django), so I checked into it after advocating a number of smaller-platform languages, such as Ruby (which I got my brothers into, but without an appreciation of the complexity of C, the simplicity was lost), and Objective-C (which is a fun language, and I love the syntax, but the documentation is a little too lax for me to look things up).

In fact, Obj-C is proably the closest I’ve seen in terms of languages to compare Python to. In a way, it’s similar to most C-derivative scripting-type languages, like Perl and PHP, but in Python, everything is an object, or at least looks like it’s in an object due to the way modules are imported.

In PHP, I felt like the syntax for classes didn’t really encourage people to use them. In Python, classes are almost like mini-namespaces which allow grouping of related functions (while I do dislike the verbose self parameter in class functions, it’s something I got used to, and not nearly as annoying as Perl’s “parameter passing” (hrumph) scheme).

Why switch?

Lately, I’ve been writing a lot of console scripts to do various things. The language I’ve used for most of them is PHP, and for the most part, it’s a severe case of everything looking like a nail. Some things are a bit difficult in PHP (for example, you need to explicitly open stdin, and zipping arrays — alternating elements from two different arrays to fill a new one — is hard). It also occasionally has some really stupid warnings (fread throws a warning with bs=0? cut me some slack!) and some things are coded (IMnshO) wrong (feof(invalidhandle) returns false? And false==0?). One of the great things I loved in Obj-C was the fact that there’s a thing like null, except it’s not (in Obj-C, that was Nil), which exists in Python as None (with implementation differences, like you can send messages to Nil, and they’ll return Nil, which perpetuates what’s likely an error, whereas Python will toss an exception ASAP).

Python is the most perfect prototyping tool I’ve found so far for the commandline. Perl is a mess, unmaintanable, BASH is difficult to work with (2d arrays anyone?) and PHP is, to be honest, the wrong tool for the job.

I was able to develop a quick script to parse through PNG files this morning, which I refactored into a class in about five minutes, counting design time. Documentation? It’s actually fun to add in docstrings in Python, for some weird reason. I can’t explain it, but I feel compelled to add in a string to each function just for the heck of it. And rather than remembering some obscure syntax, it’s a human-readable string, which is auto-parsed out into the special doc member.

I then tried to translate the code to PHP after it became apparent that this script was useful to other people (who might not have Python), and probably spent longer dealing with PHP issues than it took me to write it in Python, period. This was even with my previous port of argparse to simplify commandline handling.

Python is my friend. And, another added bonus, it aint’ Perl.

Making PNGs Less Bad in IE 03 Aug, 2005

On a whim earlier today, I started checking into png transparency in IE. Yes, again. I originally gave up on it, given that the behavior slowed down the browser immensely last time I tried it, and binary transparency just doesn’t seem worth it.

Earlier this week, I had made a discovery: there was a png file that displayed correctly in IE. I was astonished, until I saw exactly how it was displaying correctly. It had a solid background which matched the background it was placed against. Instead of being fully alpha transparent, it was simply being alpha-transparent on top of that color. Of course, we couldn’t tell the difference, as long as that background color stays the same.

So, in the interest of making PNGs “less bad” in IE, I made a quick prototype program in Python to dissect the files and show me the contents of the chunks of the png (which, of course, required lots of spec-reading). There’s one chunk ID (bKGD) which contains an RGB value (at least for truecolor RGBA images) that is the “standalone” background color. IE, as it turns out, is incorrectly reading this.

Chunk Types in a File That Doesn’t Work

IHDR (Image Header)
gAMA (Gamma Value)
tEXt (Photoshop taking credit, comment basically)
IDAT (Image Data)
IEND (EOF)

Chunk Types in a File That Works

IHDR (Image Header)
bKGD (Standalone Background Color)
pHYs (Physical Dimensions)
tIME (Modification Date)
IDAT (Image Data)
IDAT (Image Data, Continued)
IEND (EOF)

I don’t know why this is not better-known, as I’ve only found a couple of references to it, the better one being http://www.phoenity.com/newtedge/png_degradability/.

The version which works best at the moment is also the ugliest, a php script which will modify a file for you to edit/add the background color of your choosing. It’s in subversion at /lab/trunk/png/changebg.php, and will be soon replaced with a Python version. Already, the Python reader for PNGs at /lab/trunk/png/pngfile.py is shaping up nicely, and (including one previous iteration) helped me solve a couple of bugs before they got out of hand. (Among those being that I initially misread the parargaph on generating crc’s in the spec!)