Het internet
February 20th, 2008
Soms vraag ik mij af hoe de wereld werkte, vroeger.
Je weet wel, voor het internet bestond. En voor 'gsm' een woord was.
Het vreemde is: ik was er toen al, ik heb dat meegemaakt. Een wereld zonder TV, nee, dat niet, maar internet en gsm? Ik heb het grootste deel van mijn leven zonder meegemaakt. En toch kan ik het me niet meer voor de geest halen, hoe dat was.
Vreemd.
Friend in Java
February 19th, 2008
Sometimes, you want to change behaviour of a method, depending on who the caller is. An example might be to throw an exception if the caller is a class you don't know. You want to make the method protected, but for some reason, you can't put all the callers in the same package as the callee.
In C++, you have the concept of 'friend', where a callee can define which callers are allowed. Or so it exists in my memory, but that doesn't matter.
To achieve the same thing in Java, you can inspect the stacktrace:
public boolean isFriend() {
new Exception().getStackTrace()[2].getClassName().startsWith(MY_PACKAGE_NAME);
}
And use it as follows:
public void something() { if (!isFriend()) { throw new NotFriendException(); else { // do nifty stuff here } }Now, while this works, I have a sneaky suspicion that this isn't the most performant solution: creating a stacktrace is said to be an expensive operation. But it's useful once in a while.
links for 2007-01-02
January 2nd, 2007
-
ZiYa is based on the most excellent XML/Swf charts charting tool. It allows you to render charts in your web app by leveraging Flash rendering. No worries mate, you won't need to learn Flash to use this plugin.
links for 2006-12-19
December 19th, 2006
Javapolis
December 11th, 2006
It's Javapolis again!
I'll be there Wednesday and Thursday, and I'll be the guy not wearing the official Javapolis t-shirt ;-)
links for 2006-12-08
December 8th, 2006
Pac-Man
December 8th, 2006
Strips online (2)
December 7th, 2006
Serge:
Dus als er iemand zocht naar een business idea…. je hebt al zeker één klant :-)Wie wil? Wie wil? Straks krijg ik zelf nog zin ;-)
links for 2006-12-06
December 6th, 2006
-
fax over the web
Online strips
December 6th, 2006
Toen ik Peters euforische aankondiging las, dacht ik even dat Dupuis eindelijk met een online winkel gestart was. Helaas. Om een strip te bemachtigen, moet je je blijkbaar nog altijd naar een baksteen-en-cementen gebouw begeven.
Hoe zou dat eigenlijk komen, dat de Azurs en de Proxissen van deze wereld geen strips aanbieden? Mijn Visa-kaart zou alleszins snel getrokken zijn.
links for 2006-12-04
December 4th, 2006
-
"high performing design teams might not follow a consistent process at all"
links for 2006-11-30
November 30th, 2006
-
Finally, somebody who actually explains what an em is ...
Bagel Belly Blog: That whole shutdown debate
November 30th, 2006
Andrew chimes in on "That whole shutdown debate". In fact, I have the opposite use case: when I close the lid of my laptop, I generally don't want it to go to sleep.
For starters, it takes way too long for my laptop to wake back up. My working place is often the living room, where I'm surrounded by 3 toddlers. When I get up to get a pacifier, it is not an option to keep the laptop open on the coffee table -- imagine toddles who start to hit a keyboard whenever they see one. So I close the lid. But I don't want to wait longer for my (windows) laptop to wake back up than I have time spent getting the pacifier.
Second, my laptop gets backed up at night. So I just leave the thing running. A lit screen is unnecessary at that time, so I close the lid. And it can't go to sleep, because the "scheduled task" will not run then.
So. Can you come up with even more scenarios to have all those options available? ;-)
links for 2006-11-28
November 28th, 2006
-
colorpicker
links for 2006-11-27
November 27th, 2006
-
Draw & share diagrams on the web
-
ScheduleWorld calendars, contacts, tasks and notes.
