zengun

weblog » archives

2002 11 07

can you increment i?

Consider the following code (from this thread on SPF):

$i = 1;
$i += ++$i + $i++;
print $i;

What will this code output?
Make a guess, and then go on reading the rest of this post.

[ this space left blank, take your time to guess :) ]

The answer is: it depends on the language that processes the code!
In PHP, it would output 7. In Perl, the same code would output 8. In Java, it would output 5.

What was your guess?

2002 11 05

hide Flash banner ads in Mozilla

So you restlessly clicked on ‘Block images from this server’ until no more banner ads would show up, but never found a way to get rid of these annoying Flash banner ads?

CSS2 selectors to the rescue!
Just copy the following rules in your userContent.css file (you’ll find it in your profile’s chrome/ directory), and say goodbye to Flash advertising.

/* this hides the usual 468x60 Flash banner ads */
embed[type=”application/x-shockwave-flash”][width=”468″][height=”60″] {
  display: none !important;
  visibility: hidden !important;
}
/* this hides the not so usual but very annoying 728×90 Flash banner ads */
embed[type=”application/x-shockwave-flash”][width=”728″][height=”90″] {
  display: none !important;
  visibility: hidden !important;
}

You can easily extend these rules to cope with other banner sizes by copying a rule and changing the width and size attributes.
This was in response to this thread on Mozillazine forums.

2002 11 04

sortin’ and scratching

I spent some big 4 hours yesterday sorting a bookmarks folder of about 300 blogs powered by b2, in order to add those that were still updated to this list. When I was done, I had added around 240 blogs.
The goal is to eventually merge the powered-by and updates lists, something I should have done from the start and that’s coming back scratching my hands to take my attention now that both lists have reached the hundreds. Oh yes, I’ll have fun merging these lists into a single table… If you see me idle for a few days, there you’ll know one of the things that keep me busy.

2002 11 02

the semantic web for dummies

If you ever wondered just what all those pseudo-geeks are talking about when they refer to “the semantic web” (don’t be ashamed, I used to wonder about that too), here’s a dummie-proof definition of the semantic web by l.m.orchard.

highlight just like Google

I like searchhi, but it highlights keywords in only one color. So I did a very little modification to make it use different colors, and here’s the resulting code.
To effectively highlight keywords with different colors, you’ll need to create 10 classes, named ’searchword1′, ’searchword2′, […], ’searchword9′, ’searchword0′. Though if you don’t define one or more of these classes, the word will still be highlighted using the class ’searchword’. That’s the beauty of CSS.

2002 11 01

delusion, taken to the highest level

Two Towers Protest Organization is made up of a group of like minded individuals who were greatly affected by the events that transpired on Sept 11th 2001. The owner of this website considers himself to be a facilitator for the sentiments which have already been expressed by people such as Kevin Klerck who set up the two towers petition on petitiononline.com.

It only takes an idiot or two, to still believe that Kevin Klerck’s petition wasn’t a troll, even after Klerck himself declared it was.
Then again, with the movie coming in theatres next month, one could see the trolling coming back from afar.

The movie is intentionally being named The Two Towers in order to capitalize on the tragedy of September 11. Clearly, you cannot deny the fact that this falls under hate speech.

I’m not fond of using laughing abbreviations such as LOL or ROFLMAO, but I’ll make an exception here: ROFLMAO!!!!! I swear, we should start an humanitarian organisation to give these deluded people a free clue, they desperately need it.

K-Meleon 0.7

If you’d like to run a Gecko-based browser, but you think Mozilla is a bit too heavy because of it being “everything and the kitchen sink“, then you’ll welcome K-Meleon 0.7 with open arms! It’s lightweight, fast, has a native GUI and is still skinnable. Did I say it’s incredibly fast?

hiding stylesheets from older browsers

Yesterday’s funky mishaps with multiple stylesheets made me wonder how one is supposed to hide multiple stylesheets to older browsers.
While it is possible to have alternate stylesheet with <link> tags, it doesn’t seem to work that well with two <style> tags that @import stylesheets, when in fact both @import statements are executed and used as default style.
So in the end I’m forced to use <link> tags and present Netscape 4 & co. some style that it’ll choke on. Or I could make my stylesheets @import other stylesheets. I’m not fond of russian nesting dolls when it comes to CSS, so if you know another method, there’s a comment form waiting for your wiser input.