loge.hixie.ch

Hixie's Natural Log

2003-09-29 15:28 UTC Naked girls, DHCP, GPRS, ART, and high notes

Through a set of circumstances that I won't go into, I'm currently sharing a four bedroom flat with another guy who also works at Opera, four girls, and sometimes even their various partners. I don't really know the girls that well since I'm hardly ever home, but they seem nice enough. So far the strangest events have been coming home late at night to find a naked girl in my bed, and, yesterday, losing a battle with the washing machine, coming home and finding someone had very kindly put all my clothes on the drying rack. No, the naked girl didn't stay in the bed. I think that might have gotten me into some trouble, anyway.

The girls got us internet access — currently it's just a Windows 98 box connected straight to the router or cable box or DSL box or whatever it is. I tried to plug my laptop into this router, but I couldn't get a DHCP response, presumably because the remote end is doing MAC address filtering or something. I ran out of time so didn't make any real attempt at spoofing my MAC address. I was also going to try and set my IP, net mask, gateway, DNS servers, etc, to the values the Windows box got, then plug myself in instead, and see if that worked, but I didn't have time to track down all the places you'd need to change in order to set all that up. While I understand the theory of why things like DNS addresses are distinct from IP addresses, etc, it would be nice if the documentation to (e.g.) ifconfig gave pointers to where you have to set other common settings, instead of forcing me to guess where I should look for the next configuration file.

It was pretty fun running tcpdump on the unbound adapter though and seeing all the broadcast BOOTP packets going back and forth. Not to mention a few ICMP echoes. Snooping is fun. ☺

Back at work, I'm doing some testing for our Symbian port of Opera on a Nokia 3650. The Web on a phone is remarkably useful. Being able to check whether your flight is cancelled from the train, for instance. Or catching up on your friends' Web logs while waiting for said flight. I'm telling you, this web thing is going to be popular one day.

"My" phone is actually owned by Opera, they just let me use it because I then go and file all these bugs. We use Ventelo as our network provider. Ventelo used to get their GPRS service from NetCom, but recently switched to Telenor. Because of this we all had to get new SIM cards. Strangely, though, while my new SIM card can do normal GSM stuff like SMS, it is totally unable to connect to any GPRS provider. Stranger still, while my old SIM card is naturally unable to do any kind of GSM stuff like SMS, it can still connect to the old Telenor service for GPRS!

Now, what we want to know, is, who is paying for my connections to Telenor? We only pay Ventelo, and Ventelo consider that SIM card to be dead, and have no contact with Telenor any more... so they presumably won't be charging us for that... but Telenor don't have a contract with us either, so they can't charge us directly... Seems like someone somewhere made a teeny weeny bit of a mistake in their configuration file! I wonder how many other people this affects.

In between testing, I've been writing a tool that I am calling ART. It stands for Automated Regression Testing. The principle of this tool is that we really don't want to have any regressions, so we're going to automatically compare the results of running a couple of thousand tests (including most of the 1396 tests I'm currently hosting on www.hixie.ch/tests) on every build we make from now on, instead of relying on manual QA for catching regressions like that.

The way it works is that for each build, ART downloads the installer, installs Opera, then takes a screen shot of Opera displaying each test. It then compares all these bitmaps to the bitmaps it took the previous time, and if any have changed, it flags them.

So far I've only implemented this on Windows, as that's the platform we create builds for the most frequently at the moment. It's such a hack. The core of the script is written in Perl, and it actually pokes a "print screen" press-and-release sequence straight into the keyboard driver to get the screen shot. It also uses some esoteric Win32 APIs to move the mouse out of the way so we don't get arbitrary tooltips. And it directly interfaces with the Windows NT Performance Monitoring APIs to determine whether Opera has started idling yet (in order to know when to take the screenshot). Such a hack. But it works reasonably well. I'm still shaking the last few bugs out, mostly with the Web front-end (the testing part works reasonably well).

If you have a particularily complex layout that you want us to make sure we don't screw up between releases, feel free to e-mail me self-contained attachments as tarballs and I'll see about adding them to our regression test suite. They don't have to be real tests, and it's fine for them to contain lots of JavaScript, even. The only requirements are that they have to be self-contained (not relying on absolute paths or pointing to files on remote servers), they have to be covered by a license that allows for editing and redistribution (such as the GPL, the MPL, or the public domain), and they must not be animated or have time-dependent layout (so no clocks, please). The more complex the better. Note that because of the way these tests run, only the top 1600×1200 pixels will be checked, so there's no point sending me, e.g., a 200-page document.

Over the weekend I spent about nine hours in total at a couple of extra extended rehearsals. I play the clarinet in a concert band based near Lillestrøm that Snorre (one of the guys on my team here) convinced me to join.

It's pretty fun, although at least one of the pieces has some notes that are so far up into the stratosphere that I think they may be too high even for dogs to hear, and are definitely too high for me to know their fingerings. In fact, even if you take them down an octave they are still too high for me to know the fingerings. That's how high they are. Pretty silly stuff if you ask me. What's wrong with the bottom register anyway? Oh and some of the pieces are so fast that I physically can't move my fingers fast enough to hit all the notes. I can usually hit them all if we play at about one-tenth normal tempo...

I'm currently waiting for ART to finish running the latest build through the tests so that I can fix the nine or so bugs I've discovered while demonstrating it to people here. I think I'll work on converting the CSS1 test suite to the CSS2.1 test suite format in the meantime.

Pingbacks: 1

2003-09-29 09:35 UTC Never send content in proprietary formats over the wire

This is why XSLT on the client side is a bad idea. Try opening that page in a UA that doesn't support XSLT: all you get is garbage, because the content is not in a language with well-known semantics (it is, in fact, in a proprietary encoding of something vaguely resembling HTML, with metadata encoded in a proprietary language written in XML).

Transformations should be done on the server side, so that what is sent over the wire is in a well-known format (HTML, MathML, etc). The UA can then decide whether to display the content using the author's styling hints (CSS) or to display the content using its own rules (as Lynx does, as Opera typically does on hand-held devices such my mobile phone, as voice-based browsers do, etc).

Accessibility is not just about blind people. It's about a growing set of devices with esoteric characteristics. Don't turn your readers away!

2003-09-23 13:49 UTC A crash course in UTF-8 mathematics

Imagine you have a file you know is in UTF-8, and that you are viewing the raw bytes of this file in a text editor which displays high-bit bytes as octal sequences. For example, you could have the string:

Escamillo\342\200\231s supporters

How can you work out what the corresponding Unicode codepoint is?

Write out each digit of each octal sequence like this:

342 200 231

Then, below each digit, write out the corresponding binary using the table below, remembering to pad the results so that the first digit corresponds to two bits and the second and third digits correspond to three bits each.

Octal Binary
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111

So now your notes look like:

342 200 231
11100010 10000000 10011001

Rewrite the binary string in groups of eight (i.e. in bytes):

11100010 10000000 10011001

Here, a vague understanding of how UTF-8 works helps. Count how many of the most-significant bits in your string are on. This tells you how many bytes your character takes. In this case, we have three:

11100010 10000000 10011001

...which is lucky since we do indeed have three bytes. The two other bytes start with a single high bit, which means they are continuation bytes. To get the actual bits that form your character, you take the least significant bits of each byte up to the zero before the most significant bits that are set.

11100010 10000000 10011001

Take these bits and stick them together:

0010000000011001

...and then group them in fours:

0010 0000 0001 1001

In this case we happen to have a multiple of four bits, but sometimes you don't have such a convenient number of bits, so start counting at the least significant end (the right hand side) and then pad the most significant end with zero bits.

Next, you convert each of these nibbles to hexidecimal:

0010000000011001
2 0 1 9

And finally you look up your character, in this case U+2019, in the Unicode names list, which in this case gives us "RIGHT SINGLE QUOTATION MARK".

2003-09-23 00:05 UTC Reopenings, green tints, and myths

I've been quite busy recently, mainly with stuff I'm not at liberty to talk about, and with other stuff that I don't really want to talk about. All in all, though, things are looking good at the moment. I might even rebind my F2 key at some point... last week I unbound it after bug 00002 was invalidated, but the bug was reopened and even reconfirmed, so who knows.

One of the things I've been working with is ImageMagick with ActivePerl on Windows. I have a large bitmap in memory (aquired through some Win32 APIs), I pass it to ImageMagick, and I tell it to save it to disk as a PNG file. For some strange reason, the PNG file comes out with a green tint, where it should be pure white. I've tried playing with the gamma settings, the rendering intent settings, and some other stuff, but nothing seems to have changed the result. I'll have to look at this more tomorrow.

I've also been occasionally updating test cases to match the new CSS2.1 text, and also doing some CSS2.1 test suite work. It's slow going. There comes a point where you have so many tests that before writing any new tests you have to first look at the existing ones to make sure you haven't covered it already... Otherwise you end up doing what I did the other day, which is write a test case which is almost byte-for-byte identical with an existing one. So I'm being careful when it comes to the 2.1 tests.

As part of the 2.1 test suite I'm going to have to write some scripts to help me name the files, as well as helping me import files from other tests suites and then converting them to the new format. I'm not going to be doing that any time soon, though. I have a TODO list the size of a small planetoid at the moment.

I've also been involved with some forms stuff recently, one example of which is a thread in www-international about what to do when the user has entered characters into a form that can't accept those characters. I'm hoping we can either get an errata into HTML4 for this or maybe we can get an all-out update to the HTML form controls.

While relaxing, I've been reading the MYTH series. So far I'm loving it. I've also started playing in a concert band, although I'm reserving judgement on that for now. Since I don't speak a word of Norwegian, it's a somewhat weird experience. Still, it gives me an excuse to do something else on the weekends, which I'm told is good for slowing life down and preventing panics. I hope it works; it's not something I know much about, really. Although I'm doing my best to learn as fast as I can.

2003-09-17 20:08 UTC Hm indeed.

REDO FROM START