Now blogging at diego's weblog. See you over there!

Karlin on AdSense

Karlin writes about Google AdSense in yesterday's Guardian:

I don't understand this smoked-salmon-socialist approach to personal websites. Many, if not most, of these people are the same ones who, until Adsense, loathed banner ads, not to mention the dreaded pop-up.

Now that they have caught the scent of cash, bloggers are more than happy to slap the damn things prominently on their webpages in the hope that their readers will do what they never do - click on through. As one blogger confessed on his blog, he hopes others don't use the banner-ad blocking software he uses, the faster to bring him his Google dosh.

I must admit that my immediate gut-reaction was similar, but it didn't last. I ended up taking the more err... capitalist approach of saying that, well, if people accept the ads on weblogs they read, then so be it. I also disagree with the blanket statement "ads are bad for weblogs". Her note of people that have turned around 180 degrees (people that previously derided news sites and such that used ads, to suddenly getting ad-religion) is good though. Ah, the ironies of technology.

Ads are appropriate in some contexts, and they do help people pay for their hosting and maybe make a little money on the side too. After all writing a weblog can take its effort. And if people are making some money with their ads, then it follows that readers must be interested in them, no?

Categories: technology
Posted by diego on September 19, 2003 at 6:17 PM

what's the solution again?

I was just watching this video of Steve Ballmer talking (supposedly) about how Microsoft is going to solve their security problems.

The summary goes something like this:

Blahblah blah security problems ... blahblah blah hackers get the information from our patches [yeah right!] ... blahblah blah to solve this we need innovation blahblah blah ... and customer education... blahblah blah ... innovation blahblah blah we believe viruses should be stopped before they get to the computer [read: we are not going to fix those memory overflows or our engineering processes, we are just going to give you chain and a couple of locks to put around your house... and if you don't like living in a cage, well, too bad.] blahblah blah ... innovation blahblah blah the whole industry needs to innovate blahblah the solution is innovation... blahblah blah innovation blah blah .... innovation [and it goes on like this]...

So, that's great! Apparently the solution to insecure runtime environments is innovation!

What's the URL for that? Or do I get it on a CD or what?

Seriously, though, I thought it was the performance of a spin-addicted politician, rather than a CEO of a technology company.

I would challenge anyone to explain in two short sentences what, exactly, Ballmer said.

You can't, because he didn't say anything. Pure rethoric. Lots of obvious points ("we need to improve the entire patch management process [...] we have to continue to improve". Yeah, no kidding, Steve). Again, pure rethoric. No content.

I suddenly remembered this excellent, excellent article by Cringely from a couple of weeks ago: The Innovator's Ball. Note this quote:

[...] there is another issue here, one that is hardly ever mentioned and that's the coining of the term "innovation." This word, which was hardly used at all until two or three years ago, feels to me like a propaganda campaign and a successful one at that, dominating discussion in the computer industry. I think Microsoft did this intentionally, for they are the ones who seem to continually use the word. But what does it mean? And how is it different from what we might have said before? I think the word they are replacing is "invention." Bill Shockley invented the transistor, Gordon Moore and Bob Noyce invented the integrated circuit, Ted Hof invented the microprocessor. Of course others claimed to have done those same three things, but the goal was always invention. Only now we innovate, which is deliberately vague but seems to stop somewhere short of invention. Innovators have wiggle room. They can steal ideas, for example, and pawn them off as their own. That's the intersection of innovation and sharp business.

Yes, Microsoft is an innovator and I don't think that is good.

Exactly.

I can't help but compare it to McNealy's keynote the other day. While McNealy is a bit dry as a speaker, he actually talks about solutions. He doesn't descend into useless generalities (I can imagine see Ballmer talking about famine problems in Africa: "eating some food every day is good to stay alive... we need more innovation... people shouldn't have problems to get food.... innovation... we need to improve things ... innovation..."). McNealy doesn't say "let's get more customer education." He doesn't imply that "the way to fix viruses is to hide your computer in the closet and disconnect it from the Internet". He doesn't utter the word innovation every two milliseconds.

It's sad that Microsoft, instead of using their tremendous resources (both human and financial) to actually fix problems and invent new stuff and create new ways of thinking, are more interested in spinning the situation and proposing that somehow the best way to create security is not to fix the obvious and widespread problems in the architecture of Windows, but rather to "not fix the backdoor, but secure the front door" (whatever that means--If the "front door" is also running Windows we'd have a problem again, wouldn't we?).

What's next? Force everyone to stand heavy weaponry next to their Ethernet cards, you know, just in case? (With "customer education" of course: "if your PC is attacked, shoot the cable immediately!" and so on...)

Anyway.

Categories: technology
Posted by diego on September 19, 2003 at 12:54 PM

java xml pull and push: a comparison

Yesterday Russ pointed to an article at O'Reilly's XML.com about StAX (XML Streaming API), a Java API that allows parsing of XML through a pull-mechanism, currently in the final laps of the JSR process as JSR 173. I was immediately intrigued. While many find it common to use additional APIs to solve some problems, I tend to prefer removing layers of complexity and abstraction that aren't absolutely necessary, using only JDK-standard (or standard extension) classes as much as possible. Since this API appears to be not only frozen, but also on track to be a standard extension (and hopefully it will be included in the next JDK release!), I decided to give it a try.

While the benefits in simplicity of parsing are quite obvious, I was a little weary of the performance of this package, since it's a reference implementation and it is almost certainly not fully optimized (one of the main uses that I'd give it is to parse RSS, and I was already looking at how to improve performance of RSS checking--but that's another story). So I created two parsers, one using StAX and one using plain SAX, and compared them in terms of usability and performance.

I ran the tests agains an RSS 2 feed of 500 KB, essentially 20 copies of this morning's RSS feed for my weblog.

The results are pretty surprising. StAX wins by a mile. Check out the results:

SAX results

-----------------------------------------------
Start element count = 2109
Characters event count = 4303
-----------------------------------------------
Time elapsed = 140 (msec)
-----------------------------------------------
StAX (Streaming) results
-----------------------------------------------
Start element count = 2109
Characters event count = 4236
-----------------------------------------------
Time elapsed = 63 (msec)
-----------------------------------------------
A couple of notes: "characters event" count refers to the time that an element is of type characters in StAX or when the characters method is called in SAX by the parser. For an entry that contains text (e.g., CDATA), multiple character calls may be received, depending on new lines, etc. Apparently StAX splits the text a bit differently than plain SAX, since it finds more character elements, but that's ok (to parse those you only need to keep state and append the new characters value to the current element you're parsing). Both element counts are the same, which only proves that both are parsing the same structure properly. The results, are, of course, consistent over several runs, with the expected slight differences. (And, btw, I tried testing memory usage but the variability in initial free memory, etc, was too big to be able to measure which one is better. At a minimum, they appear to be equivalent in that sense).

Here is the code used in the tests: for the TestSAXParser class and the TestXMLStream class. Note: to run the code you'll need to download the current specification of the JSR. In that ZIP file there's the spec itself (a PDF) and a JAR file, jsr173.jar, which contains a number of classes, API docs and such. Of those jars, the only ones necessary to run the example (ie., that must be added to the classpath) are jsr173_07_api.jar and jsr173_07_ri.jar, that is, the API and the reference implementation respectively.

As it is plain to see, the StAX code is a lot simpler than the SAX code, because it doesn't require a wrapper to make it look more event-based. Add to that the fact that StAX code runs at more than twice the speed of SAX, and, as I said, StAX wins hands down. No contest.

Cool eh?

Categories: soft.dev
Posted by diego on September 19, 2003 at 10:40 AM

Copyright © Diego Doval 2002-2011.