MOTD

Message Of The Day

Wed, 23 Mar 2005

22:53 [zork(~/sam/code)] cat totally-prologing-this.txt

We Will Embrace The Fifth Generation

| ?- append(First,Second,[a,b,c,d,e,f,g]).

First = []
Second = [a,b,c,d,e,f,g] ? n
Action (; for next solution, a for all solutions, RET to stop) ? a

First = [a]
Second = [b,c,d,e,f,g]

First = [a,b]
Second = [c,d,e,f,g]

First = [a,b,c]
Second = [d,e,f,g]

First = [a,b,c,d]
Second = [e,f,g]

First = [a,b,c,d,e]
Second = [f,g]

First = [a,b,c,d,e,f]
Second = [g]

First = [a,b,c,d,e,f,g]
Second = []

Sat, 19 Mar 2005

05:57 [zork(~/sam/admin-spotting)] cat real-time-hit-meter.txt

If You Care

Real time apache hit meter. Displays number of hits per second on each line. Could probably be made more pretty with ANSI codes and whatnot. It only has one second of resolution which is a bit of a shame. Using something other than date could help that. I wrote this on a BSD system so GNU date may be better for this. Tuning the -10 passed to head varies the frequency of updating the output, and resolution a bit. And if you want to just check a part of the site or certain clients toss a grep (or some other selector) in between the while loop and the tail.

Note

Beware of I/O buffering. This is really not an accurate counter I've found because head can end up blocking more than is needed for its 10 lines of data.

tail -f access_log |
    (while true; do
        echo "`date +%s` `head -10 | wc -l` `date +%s`"
     done) |
    awk '$3 != $1 { print $2 / ($3 - $1) }'

Thu, 17 Mar 2005

03:39 [zork(~/nutella/Waffle)] cat painbirds.txt

King of nails

The other fillum that Zhiwen gave me is 《生活秀》, the given anglicised title of which is Life Show. My inner Sparklehorse fan prefers the more literal translation, which would be more like Beautiful Life. This seems especially apt as I see that the lead, Tao Hong, also appeared in another piece called A Beautiful New World. Since tonight's offering is on a couple of VCDs with no subtitles I am reaching for my dictionary every few minutes. The plot is more attractive than 《大宅门》 so even though they are not speaking in beautifully enunciated standard Mandarin I feel obliged to do some translation just so I can understand what is going on. This is how language barriers are breached.

00:31 [zork(~/sam/code)] cat of-course-php-is-dongz.txt

MySQL + PHP Still Not a Real Choice

Ok it's really super dumb that PHP pretty much handles MySQL connections to a database server one at a time. No seriously. There are some ways around this, but they are supremely lame, and in the function calls completely optional. So if a person ends up using code that someone else wrote, and that person didn't feel they needed to pass this completely optional argument on their database calls then person A's day can be made very hard. Especially if person A needs to use a couple different databases from one page.

http://us3.php.net/manual/en/function.mysql-select-db.php

Mon, 14 Mar 2005

05:20 [zork(~/sam/code)] cat hacking-the-guhnome.txt

When in doubt...

...hack it yourself.

Since Warty came out I have become a much more hardcore gui desktop user. I've hacked up quite a few Nautilus Scripts to make my life a little easier, but after "losing" a hard drive on my laptop I'm back to basic Nautilus. Now I've hit an annoying missing feature in it yet again.

Nautilus has this nice context menu that pops up for certain file types and allows to do nice things like add a bunch of files to Rhythmbox, make a tarball, or what have you. What they've never had was a way to make an image your desktop background. I know that this a silly thing to get all crazy about, but it really bugs me that it doesn't support this out of the box.

I used to have a script that would do this for me, but it is kinda annoying to have to right click, wait for the menu, then go to the Scripts menu, and wait for it to come up, and then finally click on "Make this my background." Also since it was attached to the scripts menu it could come up for any filetype which seems a little strange since you could ask the system to make an text file your background. It wouldn't do it of course it just seems like a bit of UI there.

So now here's what I want. I want a context menu for images that says "Change Desktop Background to image..." And then does it. And I would prefer to learn as little as possible about the guts of Gnome and Nautilus in the process. And I don't want to have to do it in C, I'd rather do it in python.

So I whip out google and start to figure out how to do this "simple" task. There seems to be a few python-bonobo tutorials out there, mostly working with making panel applets. Bonobo adds this big maze to some of the Gnome stuff. There are a few tools to manipulate it, but it mostly works like a scary black box. And doesn't appear to like making any log messages at all.

So I start taking apart some apps that use the interface namely file-roller. The nautilus source package also has a pdf that contains some documentation on how to build some interfaces. So I start to learn about bonobo. For instance, did you know that bonobo can be used as a primitive medieval torture device? It's true. Also it has something to do with CORBA which accounts for it's rampant insanity. So I try randomly typing strings into vi and started to get some results. The bonobo query whatnot was telling me that yes it knew about my crazy extension, but nautilus still was not using it.

Why nautilus? Why do you hate me so?

Follows is some of the notes that I was taking:

Try some tricks. ltracing nautilus == crash.

Sure would be nice to find out how nautilus pulls these menu items out
of it's ass.  Apparently it doesn't use the bonobo activation the way we think
it should.  libeel.  More nautilus guts.  Also some eel guts.  Remember to wash
hands.

So in the end it looks like someone decided to extricate all of the bonobo bits out of nautilus. Great. No more bonobo. But now there is no easy python way (at least from what I see) to screw around with nautilus.

I guess sometimes when in doubt just keep doing it the lame crappy way. Ok, back to hacking pgscsh. Hacking the guhnome is too hard today.

03:41 [zork(~/nutella/Waffle)] cat GreeTeaAndCigarettes.txt

And Jesus was a sailor when he walked upon the water...

The recruiters are messing with my head at the moment. My plan for survival is just to push out the applications but to keep the hope level at a bare minimum. Work has its ups and downs. The new manager is actually trying to improve things but they are running into the intertia built up by the rest of management. As I mentioned before they are trying to placate me with a new job title but whenever they use it I am reminded of Andy Griffith being proud of the title "Permanent Latrine Orderly (PLO)" in No Time for Sergeants. I am tempted to try and acquire a Mc Donalds Happy Hat and inscribe it with my new moniker.

I was listening to a show on NPR and they used Take This Waltz as one of the tunes to support the piece. I was jogged into digging into my collection and listened to I'm Your Man for most of the week and then secured a Leonard Cohen compilation from the library.

My viewing has been quite diverse, Jim Jarmusch's Coffee and Cigarettes (what a cast!) and Elf (James Caan?). Zhiwen has also been bringing me some fillums to improve my listening comprehension. I had loaned her 《苏州河》 and she declared it weird and so has loaned me 《绿茶》. This has a similar theme but a completely different style. Still very intriguing. Although Jiang Wen has been in three other films that I have seen I didn't recognise him at all.

Despite my claim in a previous post I haven't been reading Shakespeare. However, while digging in one of my boxes of books I did come across an anthology of John Donne's work and so have been browsing that. "Rave on thy holy fool" indeed.

"...but he himself was broken long before the sky would open..."

Sun, 06 Mar 2005

08:10 [zork(~/nutella/Waffle)] cat PledgeAllegiance.txt

Orange is the new Lemon

I have to admit that it is a good while since I purchased furniture polish. However I was surprised to find that the local supermarket no longer stocks my favourite in the squeeze bottle. The only choices are aerosols or some kind of pre-soaked rag. Since my polish supply was running critically low I bought what I thought was the nearest alternative and today I put it to good use. What I hadn't anticpated was that the orangeness was something on the overwhelming side. I realise that associating lemon with polish is as arbitrary as linking pine scent with disinfectant but orange polish is too much of a reach. The other weird aspect is that it has oil in it. At first I thought that this was some kind of marketing ploy - the oil attracts more dust so you have to buy more oil etc. but then I realised it was a natural adaptation to the marked dustiness of the region (yes, crackmonkey, even more dusty than the peninsula) as the oil traps the dust on the furniture allowing it to be harvested. For that I am willing to forgive having the room smell like some kind of bizarre Mediterranean cocktail.

Curiosity bade me pay a fresh visit to the Expensive Tripods store across the street from me as, hidden among the Sliks in the window I had spotted what looked like a direct replacement for my old Quantaray that had been injured in my Welcome-to-Illinois car crash and had only survived Nigel's wedding by being strapped together with wire and a bootlace. The Promaster (which is clearly from the same factory as the Quantaray) was actually about $10 below the average web price so I snapped it up before they realised. Just to repay this affront to expensiveness I noticed that they had an old second-hand Pentax ME body on the shelf and when I asked how much they wanted for it the shopkeeper told me $160 (!). At least he had the decency to look sheepish.

I finished Choke in short order. "Weird" isn't the right word, but it's the first word that comes to mind. I have no idea (and probably don't want to know) where Mr. Palahniuk gets his ideas. Very good. Somewhat more like Fight Club than Lullaby. Same kind of rhythm. Ending still not as good as it could be. One aspect I like is that he isn't afraid of having a minor character enter from stage left and mess with the narrator's mind, in this case it was a monologue from Mrs. Tsunimitsu. It reminds me a little of Shakespeare. Maybe I'm actually ready for Shakespeare now. Having had the man's work ruined by being forced down my throat in English Lit classes maybe now's the time to check him out again. Ran is a great film but I should really get to know the actual Lear.

I watched 《一个都不能少》, a recent acquisition by the library. I had thought it was going to be like 《我的父亲母亲》 but it turned out to be a cross between 《凤凰琴》 and 《秋菊打官司》. Zhang Yimou raises it a little above yet another social study by basing it upon a true story and using the actual people instead of actors.

Time for a refreshing glass of fruit juice before bedtime...

Tue, 01 Mar 2005

04:32 [zork(~/nutella/Waffle)] cat AndTheresMore.txt

Sober reflection

So, I was trying to make an objective reappraisal of my previous post and started wondering if my mocking of creative writing courses was somewhat ironic considering some folk might consider online diaries to fall into much the same genre. Then I realised that this was just crazy thinking. The two formats are completely different and only the uninspired would think otherwise. Yeah. Definitely. Uh Huh.

The phone interview seemed to go okay. I always let myself down by not having prepared any canned questions for them and having to improvise wildly on the spot. Sooo... what's the food like in the cafeteria? Is the toilet tissue genuine two-ply? Can I surf the net for pr0n all day?

I managed to capture Palahniuk's Choke from the library but haven't started on it yet. I also grabbed a Zippy collection. Just scanning through it I can see that, a) Bill Griffith really really really really wants a film deal (really), and b) he becomes incensed when anyone else uses the phrase "Are we having fun yet?" (he spends an entire strip pounding on Garfield for doing this). This meta-theme is nearly as good as his general carping. I'm surprised he didn't explode when Coneheads came out.


[zork(~)] cal
[zork(~)] tree
[zork(~)] syndicate.py
[zork(~)] cat README