April 30, 2003

Pushd

I wonder who knew this? Apparently it's possible to use UNC names in your command prompt, only the MS Gods have decided that you should use pushd instead of cd. Mysterious ways.

In case you're wondering why I should need this: I've just finished working on some utility that accesses the Windows registry via regedit, which only accepts files, and that file comes from an UNC location. After that, an .exe on your local machine is started. And that all from within your browser. I do feel a bit dirty now...

Posted by tomk at 02:47 PM | TrackBack

April 29, 2003

Re: dumb-ass

Seems like I have some explaining to do: Outer Web Thought Log: False modesty. I didn't say that I felt a dumb-ass, I only meant that by the other guy, and any occasional innocent bystanders for that matter, I must have been perceived that way. Moreover, the time nor the context didn't allow us to go into an intellectual arm-wrestling to see who actually was more knowing, it only went "Hmm, yeah, Cocoon was hard to learn in those days." "No it isn't." "Yeah it was." "No it isn't." "See ya."

Now is this "Java" or "Personal"? Or "XML"?

Later: Oops, almost forgot: Thanks for the compliment, Steven!

Posted by tomk at 03:55 PM | TrackBack

Apple and its tune

Funny funny: all the Americans hail Apple with its iTunes service, but as always, they forget that they're not alone on the world. Accepting non-US credit cards shouldn't be any harder than accepting US ones. In fact, that's the added value of credit card companies. And it's not that there are extra transportation costs involved.

Conclusion: Apple gets a tiny bit of it. But that's still more than one can say of most other "internet-minded" companies.

Posted by tomk at 11:52 AM | Comments (2) | TrackBack

April 26, 2003

Cocoon flow

To read: CocoonWiki: GettingStartedWithFlow (via various blogs). To hope: get a chance to do something with Cocoon again. It's been over a year and a half that I haven't been doing any real development in Cocoon. I'm still trying to keep up though. Pure love.

Side note: on a recent conversation, I mentioned the fact that Cocoon was hard to learn when I learnt it (somewhere in 2000, I think). The other guy didn't agree, and thought it was easy. He probably stepped in recently, and had tons of Wiki at his disposal. Anyway, I came out as a complete dumb-ass. Good news for Cocoon.

Posted by tomk at 11:04 AM | TrackBack

April 25, 2003

java.blogs going berzerk?

My exercise entry generated a reaction from a java.blogs user:
Could you either categorize your blog, or remove it from javablogs. When I go to javablogs, I'm not interested in your exercise postings. :p
Well, first off: maybe most Java hackers can do with some more exercise :p Second: I agree. That's why I categorized my blog some time ago, during the first stir in the java.blogs community about just this issue. My first conclusion was that I made a mistake, so I checked my java.blogs profile. And what do you know? The URL provided for the feed is this one. As you see, this doesn't contain the exercise entry. But it got picked up nevertheless by java.blogs. So I'm guessing java.blogs is still using the old URL... Anybody knows about a solution to this? Is there a "flush cache" button somewhere I can press, or should I delete the blog profile alltogether, and create a new one?
Posted by tomk at 10:08 AM | Comments (3) | TrackBack

April 24, 2003

Exercise

This sounds like something I might want to try. I've been trying to figure out how to get some exercise into my life, but with a 1-hour commute, a baby son, and a girlfriend who works irregular hours, it isn't so easy. But I know I feel better when I exercise (from the few times I've tried it), so I dearly long to do it. If you exercise in the morning, you get all this stuff they call oxygen in your blood, and that gives you a multi-hour rush. It surely beats caffeine.

Via Keith via Erik.

Posted by tomk at 02:12 PM | Comments (3) | TrackBack

April 22, 2003

Composing Strings

An entirely non-issue, but I'm curious nevertheless: What do you, Java programmer, use to create sentences while looping through a list? Often, you have to generate some String based on the contents of some Iterator (to generate output, or an error message, or whatever). In most cases, this asks for some kind of separator, which should be between two elements, but not in the beginning nor the end of the resulting String.

The construct I like most till now, is

StringBuffer sb = new StringBuffer();
String and = "";
for (Iterator iter = myList.iterator(); iter.hasNext();) {
  sb.append(and);
  sb.append(iter.next().toString());
  and = " and ";
}

I've also seen boolean to keep track of whether you're handling the first element or not, and I've seen StringBuffers loosing their tails after the loop... The above is quite nice, but the scope of the and String is too large.

Anyway, consider this an exchange of taste: what construct do you usually use to achieve this?

Posted by tomk at 03:53 PM | Comments (1) | TrackBack

PHPer goes Java

This is the first of a kind I've ever read. I've seen many Java developers suddenly going crazy about Perl, PHP, Python, Jython, and the likes, but never the other way around. Nice. Feel the love, man.
Posted by tomk at 03:27 PM | Comments (1) | TrackBack

Record locking

Matt Raible asks how to lock a DB record in a webapp. A method that always works (I learnt it from a VB guru (yes, those do exist)), is a very bare-bones optimistic locking. On each table, add a column LAST_EDITED, of date type. Now, whenever you do an update, include the LAST_EDITED in your WHERE clause, and fill in the local time. So you get:

UPDATE my_table SET blah='bluh', LAST_EDITED=now WHERE blah='bleh' AND LAST_EDITED=time-you-got-from-your-select-query
IIRC, the "now" is a function in Oracle. The alternative is to provide another time (System.getTimeInMillis()), but this will only work for 99.99% of the cases (granted, if you happen to have 2 updates on the same split millisecond (according to 2 different machines), you'll probably get gray hair trying to solve it anyways).

As always, I'm not sure if I made myself clear. Drop a comment if I didn't.

Posted by tomk at 09:52 AM | TrackBack

April 18, 2003

USB Tootbrush

Gizmodo : A USB toothbrush. And I thought I was geek with my USB Light. (Coming to think of it, that light has already proven its value during a power outage in our house. Replacing fuses by the light of a laptop powered USB light... who said I was losing my geekiness?)

Via Alan via atog

Posted by tomk at 10:42 AM | TrackBack

April 17, 2003

They put everything on the net these days...

During college, I've spent quite some hours playing Frozen Bubble. IIRC, it's even one of the first games I've played over a network. And now, it's an applet. Enjoy :-)

Thanks to atog for mailing me the link. Apparently, he believes I don't read his blog.

Posted by tomk at 02:35 PM | Comments (1) | TrackBack

Damn the spam!

Apparently, one or the other spam tycoon has finally developed a program to send MSN Messenger messages automatically. This day alone, I've gotten one invitation to visit big tits, one to visit teens, and one to visit something I don't even remember. On one hand, I'm astonished that it has taken them so long to catch on. On the other hand, I wish them very short arms and lots of itches.

So much for trust. Now where can I turn the "allow everybody to send you a message" feature off....

Posted by tomk at 02:12 PM | TrackBack

Mind games

These are fun mind games. Read it before you continue here. I'll wait.

Have you read it? Now, extra game: produce an example that demonstrates the same issue(s). Really, try it. I'll wait again. I've got time.

Not as easy as you thought, hein? Thàt ability, my friend, is what makes a good engineer a great teacher...

Posted by tomk at 02:06 PM | TrackBack

Various bloggies

I feel a strong urge to do a "me too" on various blogs today. So let's get on with it:
  • Compress your data: Seems like a good idea. Every browsers supports compression AFAIK, and the client machines usually have CPU to spare to do some decompression. What I'm not entirely sure of, is that every RSS aggregator supports zipped streams. Well, they should, of course. People are kind enough to provide you with free content, you could be at least so polite to not drain their bandwidth. And CPU usage (to do their compression) is not billed.
  • Classifying programmers, or how terminology gets obfuscated over time. I've read the same discussion about "programmer" vs "architect" not so long ago (sorry, I don't think I can Google the link back up). A related issue: should you present yourself as "Software Engineer" or as "Senior Software Engineer", with "senior" in the meaning of "knowledgeable"? It sounds weird to be active in a field for 5 years, and call yourself "senior" already. OTOH, 5 years experience in one specific IT domain is very likely to make you the oldest one in that domain ;-)
  • Vera, a New Free Font Family From Bitstream: cool. Looks like a clean font (to somebody who can hardly make the distinction between Serif and Sans Serif). The only problem of course: how an I use fonts? When I think "font", I think "improve the look of a web page", but I don't know of any method to force a user to download a font to look at your page. (I might be wrong about this -- tips&hints as always welcome). As a side thought: nice to see that an open source community can convince a commercial entity to release something under a *PL. Even nicer to see that a commercial entity lets itself be convinced to release something under a *PL.
Have fun!
Posted by tomk at 10:28 AM | TrackBack

Mit

Another Bridge joins the world: Mit. Congratulations to you and your wife, Rik! Enjoy her as much as I do this little chap!
Posted by tomk at 09:48 AM | TrackBack

April 16, 2003

JUI

To whom it concerns: JUI 0.6

Thanks Erik.

Posted by tomk at 02:02 PM | Comments (1) | TrackBack

April 08, 2003

Blogging is popular

Blogging is more popular than I thought. I've just discovered that an intelligent collegue of mine also maintains a blog: atog. (his previous blog was on blog-city) Java and Movies. Entertaining :-)
Posted by tomk at 10:00 AM | TrackBack

April 04, 2003

Shower thought

Shower thought: first, I wrote

I basically suck at programming.
A few weeks later, I write
The more you know, the more you know what you don't know.
Wow. I must be a great programmer.

Hey, it's Friday, gimme a break!

Posted by tomk at 04:17 PM | TrackBack

April 02, 2003

Scary referers

This kind of scares me: my referers sometimes include my so-called homepage. This means that people who have been searching for "Tom Klaasen" (presumably) are reading my thoughts. I wonder who those people are.

Posted by tomk at 05:01 PM | TrackBack

April 01, 2003

Blog overload

Blogs are very interesting, and provide lots of information. However, one needs time to digest this information into knowledge. And I seem to be missing that. So in an effort to remind myself of what I still need to look at to improve my knowledge, a list of not-yet-digested blog entries:
Posted by tomk at 01:14 PM | Comments (1) | TrackBack