February 2005

My crusade against redundant pages continues, and the poor victim this time is the Test Page. I also updated the 404 page to list deceased pages, so now, hopefully, the 404 page is even more helpful.

I offloaded the random stuff I had on Index & News and put them in the newly created Random page.

If you use a monitor with a physical 4:3 ratio, you should use the 1280x960 resolution and not 1280x1024, as the former has a 4:3 display ratio and the latter has a 5:4 display ratio.

So. I finally finish NaI. Enjoy! New stuff includes:

  • The easily navigable Archive I've always wanted (and, by extension, permalinks). I might add more functionality to it in the future (like the ability to show a specified range of news items instead of just one at a time), but right now I'm just happy to have pushed this thing out the door.
  • The Full Archive, completely equivalent with the old Archived News so as to not break links (and not having to do rewrite magic).

    "With a warning label this big, you know they gotta be fun!"

  • The Articles page has been culled.
  • Internal cleanup to make my life even easier.

Big thanks go to Alexander, of course, for giving me tons of help. :-)

In sadder news, I have been very confused lately about my feelings for The Girl. I'm simply not sure if I really want her or not. On one hand, she is an extremely sweet, intelligent, independent, and idiosyncratic girl. On the other hand, I think that we may be too different to be a good couple. Yes, that is vague and yes, that is intentional; first of all, I'm not at all sure she'd like it if I put "sensitive" information about her on the Internet (as far as I know she doesn't even know I have a site) and secondly, most of the stuff that I think makes us incompatible wouldn't really interest most of you anyway. I don't know. I'm really confused about all this. Remember, I haven't been in love, much less been going steady with anyone, for approximately four years. Call me rusty.

Oh well. I guess I'll figure it out sooner or later.

In happier news, I have reserved The Caves of Steel, The Naked Sun, The Robots of Dawn, and Robots and Empire from my local library, all by Isaac Asimov, and will be picking them up tomorrow. I'm excited.

My personal hell begins; we've started using FrontPage in my IT class now. For our first try at messing around with it, we were copying a little information sheet for an imaginary sports shop. The thing was written in a completely monotonal way: Same font, same size, same lack of bolding and italicizing. That thing would have been a great way to teach us about headings (though everyone probably knows what they are, they need to learn to use them properly), paragraphs (everyone knows this and FrontPage even inserts them every time you hit return), unordered lists (they were pure paragraphs in the text), and definition lists, but no, we wrote it like we would have written it in Word. There are even options from a pull-down menu for most of these elements, but our incompetent teacher didn't even tell us about them. While writing the thing in the code view panel (or whatever it's called), I noticed that FrontPage doesn't wrap long lines. I looked around for a while for an option to turn that on, and when I couldn't find it, I asked my teacher for help. She refused to help me on the grounds that I used the code view. Discriminatory bastard.

Here's a semi-random thought. The correct phrase is "you and I", not "you and me" and by this fact alone most songs today are rendered grammatically wrong. Heh.

Yesterday I dreamt that The Girl and I featured in Shaolin Soccer 2. Yes, I am going insane.

A thing that has slightly annoyed me lately is the fact that Norwegians say, for instance, "this was good" while still eating the food. You don't use past tense until after the event, damn it.

I no longer underline my book titles. I have to think of the monochromats.

Listen to Shadow of the Beat now, or forever be sorry. Sahara 7 and Another Sin are magical.

Up until very recently, I have been using mIRC for all my IRC needs, but I've come to realize that XChat is very good. Not in the same way as having CSS3 readily available and supported everywhere would be very good, but in the same way as having CSS2.1 half-decently supported everywhere would be very good. The only complaints I have about the program is that there doesn't seem to be an option to turn angle brackets around nicks on (you have to hack them in yourself), and that there doesn't seem to be a way to remove the redundant space it appends to tab-completed nicks. And now for the good stuff. Something I've always wanted is for the logs to have a different timestamp format than the channel windows (or the private message windows, for that matter). XChat does that. Another pretty genius thing it does is grey out the nicks who are /away. And the logs are in UTF-8! Hooray! And finally, a client where marking text doesn't automatically copy it to the clipboard.

I finally managed to write some PHP code that extracts all occurrences of PHP code in a string (in particular, a string from a database), returns the evaluated code, and plugs it in at the right places. I love it when stuff works, especially when you've spent a lot of time on it and finally reach an epiphany where you understand the whole thing. Would you like to see it? I knew you would. :-)

function return_eval($code) {
  ob_start();
  eval($code);
  return ob_get_clean();
}

function return_php_output($arg) {
  $pattern = "/<?php ([^?]+) ?>/";
  preg_match($pattern, $arg, $matches);
  while ($matches) {
    $arg = preg_replace($pattern, return_eval($matches[1]), $arg, 1);
    preg_match($pattern, $arg, $matches);
  }
  return $arg;
}

Here, have a go at this puzzle. Just read the instructions, click around, and experiment. Don't worry. You'll figure it out eventually.

I have managed to muster seven Wilburers. Keep them coming.

I got a hold of another Douglas Adams omnibus, The Ultimate Hitchhiker's Guide, which, to my delight, contains Mostly Harmless, as well as all the others that are already in The More Than Complete Hitchhiker's Guide. If this book-reading thing turns into an obsession, I might make a book reviews page. Hmmm...

I spent about an hour and a half yesterday making a text file of all my news entries for use with LOAD DATA LOCAL INFILE, and actually managed to write some PHP code that extracts them and displays them all on a page! Yay! I got tons of help from Mr. Schrøder, of course, where I should have RTFM; incidentally, he needs to be less helpful, or else I won't learn anything properly myself. ;-) All of this back-end stuff is pretty new to me, and compared to this stuff, HTML and CSS is easy.

NaI is coming along pretty well; I have managed to successfully (although after serious fiddling) implement a working database, and the things I can do now are amazing. I could not have made it without the perpetual help from Mr. Schrøder, though. Well, I could, but it would have taken far longer. The rudimentaries of the database are more or less set up; the only thing remaining is getting to know SQL better (and thus be more, uh, efficient with it) and getting various features I want in place. In related news, allow me to explain a pretty cool thing you can do with PHP and while loops. Check this out:

$query = mysql_query('SELECT * FROM foo');

while ($current_row = mysql_fetch_row($query)) {
  [...]
}

What's going on here is actually pretty ingenious, and beats my old method (which is not even worth mentioning). For each iteration through the while loop, it both assigns mysql_fetch_row() to the variable and checks that mysql_fetch_row() returns evaluates to TRUE (it will return FALSE when there are no more rows, which is the ingenious part of it), enabling you to simply choose which key you want from the array that mysql_fetch_row() returns. Of course, this works essentially the same way for mysql_fetch_array() and mysql_fetch_assoc(), too. I can't take credit for this, of course; that belongs to Mr. Schrøder, whom I've dubbed The Efficiency Whore.

I'm almost finished with my omnibus collection The More Than Complete Hitchhiker's Guide; I have a little left on So Long, and Thanks for All the Fish, and the entirety of Young Zaphod Plays It Safe. I found another collection (by searching my local library) which contains Mostly Harmless, but unfortunately the person borrowing it hasn't returned it yet. Blast. Also, the librarian at my school ordered the third and fourth Planetes books over a month ago, and they still haven't arrived. Oh well. It's not like I'm going to run out of stuff to read.

I have been playing a fair amount of StepMania lately, and it is, contrary to the proclamations of my more testosterone-filled friends, insanely fun. It's an emulation of Dance Dance Revolution for the computer and is played by hitting the right arrow keys in synchronization with the arrows popping up on the screen. You can also, if you feel like it, buy dance mats that you can connect to the computer for a more authentic experience. Don't worry, I won't go that far.

There are 6 posts for February 2005.