Fixed race condition brought to my attention by Tom Klaasen. His excellent analysis of the problem enabled me to not only fix the race condition but also increase the efficiency of the pool in some cases by 200%[BL]Wow. I didn't even know Berin told something like that about me. Kinda makes my day a bit better.
As promised, I've used XSL to transform my own blogroll format into OPML. This is the stylesheet, and here is the resulting OPML file. Not exactly rocket science, but a nice finger exercise to refresh my XSL knowledge a bit.
Some thoughts though: I don't understand why RSS readers like to export their directory as OPML. OPML is some weird mix of content and presentation (it even gives the possibility to define window positions), but has nothing to do with RSS feeds. The 'standard' is even not applied, since I couldn't find a spec of how the link to the HTML version and to the RSS version of a blog should be specified. Anyway, I derived my OPML 'format' from Steven's and Bertrand's XSLs, and added the 'author' attribute (since I put it in my 'title' attribute, you know, that cool little tooltip that appears when hovering a link).
Anyway, I also promised to develop a GUI in Jython, but since you need only one line to execute an XSL from the command line, this seems a bit overkill. Maybe I'll do it anyway, just for the fun of it.
From a not entirely unexpected corner: Outer Web Thought Log: Let's see how many lines Tom needs. Nice. Let's make one thing clear though: I didn't say one needs Java for converting XML, I said I would be faster in Java. Which actually made me think: I would do anything faster in Java. There are even things that I'm pretty sure that are doable in shell script, that I like to write in Java. Just because it's what I do and breathe day in day out. Time to broaden my language vision. Next project: create MyBlogrollFormat2Opml.xsl. If time left, create a GUI for that in Jython. That'll teach me.
What brings me to the following: anybody knows where to find the OPML specs? A quick Google only delivers some 'yeah, this is in OPML, I'm cool' links.
In this tension, I'm apparently on the Java side. I was fed up with constantly having to edit, re-edit and update my feed reader and my blogroll. So I decided to consolidate everything in one XML file, and use some XSLT to get the right format for the right files. After 2.3 seconds of trying this, I noticed that I didn't know where to start. I'm still not used to think in XSLT, and it was for personal use only, so I did everything in Java. Quick. Powerful. Elegant.
At least for me. I guess a real XSL-er could do the same quick, powerful, elegant stuff in XSL. Show me that you are one ;-)
Me: I used to work a lot with Cocoon. It is lots of fun to work with.Yep. I didn't realize this mismatch until somebody else told me, but this is how it is. Most frameworks/packages/.... aren't fun anymore once you get your hands dirty with it. Cocoon is. And that's why we love it.
He (amazed): You worked with it a lot, and you still think it's fun?
Wow. Now I know what they mean with "Blog pollution".
Everybody who wants to know something about the elections in Belgium yesterday, sees this blog now. Hi world!
For clarity: this was not my intention.
During lunch, I was talking with Koen about his successful Debian installation, which I still find quite impressive for somebody who never has even seen Linux until last week, and mentioned the cool talk utility that comes with it. And now I open Erik's Weblog, and see something about Jakarta Commons Codec. I'm not sure if I understand it, but is this some way to have the computer speak? Now that is stuff that I like to play with... Anybody happens to know some application that uses this? Or should I dig into the difference between Metaphone and Soundex myself? Comments as "you stupid woman, don't you see this has nothing to do with sound" are welcome, too.
BTW, Erik, The Matrix Reloaded opens in Belgium on a Thursday, too. It already struck me as odd...
My HEP server has started to drop items that I still didn't have a chance to read up on (it apparently does this after 14 days or so). So in an attempt to keep my valuable links, my to-read and to-steal-from list:
Now this entry gets aggregated into HEP again, and that will give me another 14 days to find some time...The term infoglut has been stolen from He Who Answers All Your Questions With An URL.
Mais c'est pas vrai, on dirait un projet informatique...chaque jour on se dit "c'est pour aujourd'hui", mais toujours rien...
I seem to be in a UI mood these days. If you're anything like me, you probably won't have noticed because you read this in an RSS reader, but I've changed the look of the blog a bit. Basically, I took the Gettysburg template from MT, and tweaked it a bit. And I've replaced my badges via these links. Todo: remove the search box (what's that doing there? I usually search sites with Google and the site:bla.com parameter.), get rid of the "recent entries" (these are showing anyway), and get the right div a bit more narrow. Add a blogroll (shame on me to not have this yet. I'm now in the painfully slow process of extracting everything from my HEP account, which has to be done manually).
And for work, I just had a chance to play with CSS, and more specifically these ideas. Fun stuff. I wasn't even aware that CSS had that many possiblities. Shiny and bright, and visible. Well, back to the bowels of back-end DAO and VO now...
I got a nice reaction on Composing Strings, from somebody who apparently wants to remain anonymous:
StringBuffer sb = new StringBuffer();This answers all the criteria of the problem. Alas, readability wasn't one of them (as noted by himself, BTW).
for (Iterator it = list.iterator(); it.hasNext(); sb.append(it.hasNext()?"and":"")) {
sb.append(it.next().toString());
}
So does atog's solution, which is more readable, but I still feel it as a waste of energy to add things, and then take them away again. Maybe I'm just being stubborn on this.
And no, Java has no String.join() operation as one kind soul suggested in the comments. Looks like something for Yet Another Util Package.
Seven tricks that Web users don't know. Interesting article. I especially liked the bio at the bottom of the page: "Upon discovering users,...": I'm afraid many of us still haven't reached that phase.
I’m amazed that this obvious premise seemily went over the heads of all the intelligent people that commented on your tabs.)