The boring rants of a lazy nerd

Saturday, July 30, 2005

Found on The Web - Bad Writing

It's so bad, it's good. Better than reading FFN! The Bulwer-Lytton Fiction Contest, 2005 Results.

Pop Culture - Serenity

Ooh, I've seen the trailer for Serenity (a.k.a "Firefly - The Movie"). I wanna go see it!

Friday, July 29, 2005

Coding - Topological Sort and Depth-First Search

So, I've actually stumbled into some code at work where I need to implement a topological sort for dependencies. And I've read about DFS and stuff, googled a bit and even opened a real comp-sci textbook we have at the office. While all I really needed was Wikipedia! And I'm prototyping in JavaScript like some microsoftie instead of in Python like real l33t h4x0rz! Oh, the shame!

Anyway, this is what I've come up so far:

Array.prototype.shuffle = function(p_nTimes) {
    if (isNaN(p_nTimes) || (p_nTimes <= 0) || (this.length < 2)) return;
    while (p_nTimes--) {
        var i = Math.floor(Math.random() * this.length);
        var j = Math.floor(Math.random() * this.length);
        var t = this[i];
        this[i] = this[j];
        this[j] = t;

function item(p_strName, p_arrDeps) {
    this.Name = p_strName;
    this.arrDeps = p_arrDeps;
    this.bIsInStack = false;
    this.bHasBeenVisited = false;

function create_deps(p, k) {
    var deps = {};
    for (var i = 0; i < p; i++) {
        var curr = new item(i, []);
        for (var j = 0; j < i; j++)
            if (Math.floor(Math.random() * 100) % k == 0)
        deps[curr.Name] = curr;
    return deps;

function print_deps(deps) {
    for (var i in deps) {
        document.write(deps[i].Name + ': ');
        for (var j = 0; j < deps[i].arrDeps.length; j++)
            document.write(deps[i].arrDeps[j] + ', ');

function topo_sort_dfs_short_circuit_on_cycle(o) {
    var list = [];
    var cycle = null;

    for (var i in o) {
        (function(p) {
            if (p.bIsInStack) cycle = p.Name;
            if (cycle != null) return;
            p.bIsInStack = true;
            if (!p.bHasBeenVisited) {
                p.bHasBeenVisited = true;
                for (var idxDep = 0; idxDep < p.arrDeps.length; idxDep++)
            p.bIsInStack = false;
        if (cycle != null) break;

    return [cycle, list];

Next step is trying to see whether a non-recursive implementation is faster (yes, I benchmark JavaScript) and then STL. C# I'll do on company time (haven't installed mono yet).

Saturday, July 23, 2005

HP Fandom - HBP

Warning: Spoilers ahead. Obviously.

So. Canon. At last. Again. It was kind of a disappointment, how "in character" everything was. Dumbledore is a secretive, overbearing, scheming old fool. Snape, no matter what his true motives are, is a right bastard with a flare for hating incompetence. Hermione is big-headed, Ron is a five year-old, Ginny is a smaller, though by no means less dangerous, version of Gred & Forge, and Harry is Conan The Barbarian in training. Oh, and Voldemort is Koschei the Immortal (if Jo hasn't read some Slavic mythology or folk tales, I'll eat my hat).

Compared to the good fic I've read, it was positively dull. Harry getting together with Ginny? Boring. Harry wants to split with Ginny? Boring. New Minister for Magic is a politician? Boring. The tiny magical community is unashamedly nepotistic? Boring. Most teenage girls, like most teenage boys, are stupid? Boring.
The only marginally interesting character in the whole bunch was Draco Malfoy, and seeing him only through Harry's twisted perception of the universe we don't know anything (good for fanfic, I guess). I'm willing to buy RJA's theory, but in any case I've lost my sympathies for the main characters.
Oh, self appointed Champions-Of-JKR: Tonks r0x, Lupin r0x, and together they snog, not fall asleep! BTW, I still wish for Honks as it makes for more interesting stories.

ETA: Seeing as this is the only negative review I've read, I feel I must say I don't think the book was bad, just that the anticipation was better than the thing itself, which is a known effect. Also, I probably wasn't in the best mood when reading it (on guard duty), so I'll re-read it and see how I feel then. I can only remember two times I've laughed (though not why, in either case), does it seem right?

Friday, July 22, 2005

Personal - Reading

Here I'll write what I thought about "A Mote In God's Eye".

Thanks to wikipedia I've found out I'm a straight-edge (the abstinence, not the music) slacker. Isn't being an over-educated underachieving web surfer fun?

Saturday, July 16, 2005

Personal - Beat [adj. informal]

I've had a difficult few days (and nights) at work (my fault, but still) and friday I had a checkup with my orthodontist. Anyway, while reading a book I had this "I'm too tired to follow what's going on" feeling, turned off the PC and went to sleep. I don't usually turn off the PC, but sometimes when it's not doing anything I want silence at nights. I woke up at 15:02, looked at the watch and thought "No wonder I was so tired, I probably stayed up till morning…" and then "No way! The light was still up in the living room!" so this is from /var/log/messages:

Jul 15 23:56:50 tux syslog-ng[8579]: syslog-ng version 1.6.8 going down
Jul 16 15:09:56 tux syslog-ng[8820]: syslog-ng version 1.6.8 starting

Friday, July 15, 2005

Personal - On and Off line

Items dispatched on 15 Jul 2005:
Delivery estimate: 22 Jul 2005

    * 1 of: Harry Potter and the Half-Blood Prince (Harry Potter 6) [Children's Edition]

It's going to be a busy week at work, so I might just survive being offline and spoiler-free. I wasn't really nervous about the book at all, up until today. Now I can't wait. Brushing up on classic SF instead.

Saturday, July 09, 2005

Personal/Tech - Developer vs. Secretary mode

The first thing I do when I sit in front of (or connect remotely to) a Windows box with intention to accomplish some work, I:

  1. Disable intrusive themes, sounds, animated mouse cursors, heavy wallpapers.
  2. Enable showing folder path in title and statusbar, showing file extensions, showing hidden and system files, and managing html files and associated folders independently of each other.
  3. Set file name and folder name completion key to tab (9) in command processor settings in the registry, so I can use the command line interface.
  4. Disable all shortcut keys to accessibility options.

Only then can I get to getting things done. If I happen to be logged as someone else, I usually take care to make sure the person knows what I've done and can reverse it (if they so choose). But sometimes, I just say I refuse to work for free on such a hideously misconfigured computer.
For some reason, people who've observed me doing it (and heard what I had to say about the machine's users while I was doing it) think I'm not just condescending but weird.

Why do I call a cutesy configured computer, optimized for avoiding work "secretary mode"? To explain that, I'll have to go into the realities of universal conscription. That will wait for a later date, but be sure I'm not a chauvinist - it's just life's harsh realities.

Friday, July 08, 2005

Personal - General Update

  • Got a very much overdue haircut at the new local barber (he couldn't believe I was in the military, my hair got so long). I gather the haircutting business is very competitive here and now because he treats his customers very well, looking to score recommendations. Very reasonably priced, too. This should get my chain of command off my back for a couple of months. BTW, don't worry - I won't be blogging about shopping for underwear.

  • Have been reading John Cowan's blog (recommended by Tim Bray). I envy his linguistics skills (I know more people who are gifted like that, namely Eli Bar-Yahalom). The entire xml-dev crowd seems fascinating, from where I stand.

    I have added some of his signatures to the sig DB I use at work. It's some Outlook VBA code that appends a random sig from an Access file upon sending an email. I've found it's a great conversation starter to draw the attention of geeks, because the people who can understand and comment my sigs are the ones I want to talk to. Also, I feel the need to show off.

  • I haven't yet blogged about attending Adi Gigi's graduation ceremony on June 23d. We were, for a few months, together in programming training when she passed the "gibush" for naval officer training and was forced to choose (it's not cost-effective to let people do two costly voluntary training programs when they'll only serve in one post). She wisely chose the harder one and now, two years later, she's an officer on a Israel Navy ship.

    BTW, Israeli naval ranks are exactly the same as for the land services, so although it's called second lieutenant, actually she's an ensign.

    Letting women into the elite combat officer training programs is quite new - she's like the 10th (give or take) female to successfully complete the training, the first with her specialty, the only in her class (and with no females in the recent flight school batch at all, situation is not that good for women in combat).

    I have to mention the enlisted and commissioned crowd at the ceremony (Dani himself arrived to give them their insignia and ranks) was from a very different IDF than the one I serve in. The people I know from "the army" are IT types: analysts, application designers and coders, DBAs, systems people, tech support of various types, comms techs, etc. while the people there were boat crews, harbor defense, infantry, search and rescue, field intelligence, etc. Very little in common, except for the age and uniform (and not even that, with the navy). I felt like the geek that I am.

Thursday, July 07, 2005

World News - London Bombings

I, my family, and I'm sure most of Israel's thoughts are with the victims' families and other Londoners and tourists. My country knows this pain. I hope this will not scare the British people off of the fight against terror caused by radical Islam, like it did in Spain (they have forgotten how they fought off the Moors…).

Context: Wikinews article "Four bombs rock London".

Friday, July 01, 2005

Book Review - David Weber - Honor Harrington series

So, a friend recommended this sci-fi series. He said it was good space opera and technology and tactics were not only self-consistent but even ground in actual physics (read: pretentiously "hard" military sci-fi). He also said the first two (out of at least ten) books are fully and freely available from the publisher's website. The following is what I have to say about "On Basilisk Station" & "The Honor of the Queen".

It's not given away for free because it's so addicting you'll immediately go and buy the rest of the books from Amazon. It's given away for free because of fierce competition from FFN. Seriously.

The only criticism I had for Lois McMaster Bujold's excellent Vorkosigan Saga was that it was too soft to be read by the hard core sci-fi audience (read: boys). That's how I explain it being so unknown among the sci-fi readers I talk to — it's treated like romance fiction, sometimes legitimately and justifiably so. Lois only mentions how spaceships, weapons, propulsion systems, communications, etc. work when necessary. And now I'm sure she's doing the right thing, too: Weber spews (besides too many characters' names and titles) accelerations, orbits, vectors, relative velocities, ranges and all kind of numbers and units all the time, but I'm not going to sit down with Mathematica and my high school physics textbook to run his numbers. It's dull, and it's the only thing he has working for him. The rest of the stuff that make up a good book, like: plot, characters, dialogue, subtlety, style - he has none of those.

The books have a girl-power feeling to them, which is forced and thus counter-productive. The heroine is not Cordelia Naismith by a long shot. In fact, and I ask to forgive my slight here, I think the future Admiral Lady Dame Duchess Honor Harrington is a butch. Also, she enjoys eating the cake and having it too a bit too often: She has forty-five years of experience, but she looks like a college student. She is from a high-gravity planet making her very strong, but she's also tall and graceful. She is self-consciously not pretty, but she possesses a unique beauty that makes her attractive to interesting men. She's bad at math, but is a gifted 3D tactician who can plot intricate trajectories by instinct.

The author's excuse for Regency-era social and political structure in a well-into-the-future galactic empire (which has never had a Time Of Isolation) is as plausible as any other, and the introduction of a six-legged empathic killer cat of plot-device a reasonably original twist (though she appears to love her kitty more than people), but I don't even know what to think of the heroine's naval career closely resembling Admiral Nelson's (I noticed that by myself).

Had it been published as a fanfic, I'd have said "nice try" and "props for having it proofread", but really, it feels like the bad Hollywood-movie version of some good books I've read. Don't waste your time.

Blog Archive

About Me

GCS d- s-: a-- C++$ UL++ P+++ L+++ E--- W+++ N o? K? w++$ !O !M !V PS-(+) PE Y+ PGP+(-) t--@ 5++(+++) !X R-- tv-- b+>++ DI+++ D+ G e h! r* y--(-)>+++