fogbound.net




Sun, 30 Nov 2008

Viriconium Nights

— SjG @ 9:26 pm

By M. John Harrison, Ace Books, 1984

As Peter documents, this has a certain amount of overlap with the short stories included in 2005’s Viriconium, but there are some interesting differences; for example, Viriconium Nights’ story “The Lamia and Lord Cromis” and Viriconium‘s “The Lamia & Lord Cromis” are related yet different stories. It’s an interesting exercise reading both of them and seeing how the vision changed — or contemplating that perhaps the vision didn’t change at all. With so much in Viriconium, similar places or events may really be parallels in place or the cycles of history, or contrariwise, the differences may be entirely illusory.

What else can I say except that this is more Viriconium, which is a weak, pathetic summation of something very complex and subtle!

(Just catching up here… It’s been nine months since I read this).

Filed in:

Wed, 5 Nov 2008

Irony

— SjG @ 9:00 am

The country takes a big step forward, and California takes a big step backward.

Filed in:

Mon, 3 Nov 2008

“Yes on 8” Ads seen here

— SjG @ 11:55 pm

So the “Yes on 8” bigots are spending a lot on advertising, and Google ads for “Yes on 8” are evidently showing up here.

All I can say is ignore ’em. I think I’m forbidden by Google to say anything that would encourage you to click on them to cost the bastards more money. If that were to somehow happen, I’ll donate any click revenue from those ads to an appropriate organization like GLAAD. Not that I’ve ever seen any click revenue… But the “Yes on 8” people are evidently bidding high, so maybe it’s possible. Or maybe I just need to get rid of the Google ads. They ain’t doing me any good, except for sometimes their humorous juxtaposition.

Filed in:

Tue, 28 Oct 2008

Cats

— SjG @ 6:13 pm

Today is the 2nd anniversary of the day my poor sweet beast died, or rather, that we put her out of her misery. That’s a lot more complicated to say than, simply, it’s her jahrzeit.

Kina in the Garden

Kina in the Garden

When I was walking home this evening, who should run out and greet me but the elusive Buddy (aka Snowball aka Princess). I have seen him maybe once or twice in the last six months (there’s been construction nearby, and I figure he’s just been hiding and keeping a low profile).

He got his petting and I got my temporary pet.

Filed in:

Mon, 20 Oct 2008

Fixing crap PHP applications

— SjG @ 1:18 pm

I regularly end up in the situation where I have to fix a crap PHP application.

The latest one has lots and lots of PHP 3.x-era code, that references hashes without quoting the index, e.g.,


$foo = $bar[baz]

Now, the PHP interpreter understands this in actuality. It figures out that since the constant is not defined, the programmer probably meant that the index should be ‘baz’. It does, however, throw a well-deserved warning.

The code I’m trying to fix throws lots and lots of warnings. Rather than wade through all the warnings to find which ones are important, I started with the following:


find . -name \*.php -exec grep -ne '\[[^\$0-9\'\''\"]' {} \;

The thousands of lines of output convinced me bigger guns were needed.

So we got ugly.

find . -name \*.php -exec perl -p -i.bak -e 's/\[([^\$\d\'\''\"]+)\]/\[\'\''$1\'\''\]/g' {} \;

Note that that’s one line, and that WordPress seems to want to change some single quotes into back-ticks. Don’t be fooled!

All those extra backslashes and single quotes are to allow passing single-quotes within the regex, and not have bash consider them problematic.

Also note that this could be catastrophic if you have regular expressions in the code you’re operating on — do a diff with the backup version, and merge back the regexes.

I’m sure there are far more elegant solutions… primary among them, not using crap PHP apps in the first place!