The Audacity of Hope

29. January, 2011

I’ve just started reading “The Audacity of Hope” by Barack Obama. In the first chapter, he talks about a change in how politics are being made. Before the change, people would reason which each other and seek compromise. With the change, they started to go for the jugular.

Which got me thinking: Yeah, I feel the same way. For some reason, people got more radical and absolute in their beliefs. More fanatical. Fundamental. Even here in Switzerland. But why?


We all have a growing feeling of helplessness. The flood of information that overwhelms us every day creates an illusion of “I know everything” and at the same time, our options to influence even the things at our fingertips seem to vanish. Bills are passed that make you weep because of their stupidity. A small group of people (several thousand) ruin the world economy for billions and get a bonus for it instead of 120’000 years of prison. Some art project is supported with millions of tax money but the street in front of our house keeps its holes. Companies announce billions in revenue while our bridges collapse.

So the desperation is a result of the feeling that the world is falling apart and can do nothing about it. The constant flood of useful information is fueling our own fears of insignificance.

It’s the same thing the politicians feel. When something comes up, even the worlds best expert can’t tell them anymore how to fix it. The world has become too complex to control and thanks to the many source of information we have today, we know it.

So what can we do about it?

Nothing. Accept it.

Or maybe you can stop reading newspapers and watch TV. Or at least stop watching the news casts and documentaries. Most of the information you receive this way will only make you mad or fuel your feelings of helplessness. So getting to know more doesn’t help. Focus. Get a local newspaper unless you can change things on a bigger scale. Take a hundred bucks, drive to your local do-it-yourself, buy a bag of gravel and fill the holes in your street yourself. Instead of shoveling your good money into a financial system that can ruin a medium-sized country like, say, America, search for local entrepreneurs and give your money to them. That way, you at least have a face to scream into when it’s gone. Or maybe it makes the place where you live a better one. Hollywood is already good enough.

Do you really need that 60″ LCD TC? How about taking a week off instead. To fix your house. So you smile when you return home instead of thinking about all the things that you can’t or should change.

The audacity of change.

Like SciFi and a good laugh?

14. January, 2011

Get both.

At last: Filing patents is been patented!

11. January, 2011

Just before the end of last year, a gaping hole has been closed in the struggle to turn the world in a lawyer’s playground: IBM has filed a patent that patents filing patents.

Whenever you apply for a new patent, you’ll have to pay royalties to IBM! It’s like the invention of the self-printing money! Well done! 🙂


Finally: Homebrew for PS3

10. January, 2011

As the last console, the PS3 has been opened for homebrew software. Fetch your SDK.

Kudos go to ~geohot.

PS3 was hacked

6. January, 2011
Tux, the Linux penguin

Image via Wikipedia

Like so many people, I was upset that Sony discontinued support for Linux. I understand that it was a security risk (people were dabbling with the encrypted hypervisor and the encryption) but no one really cared enough to actually invest the huge amount of time necessary to really break it. I also understand that supporting Linux was a cost issue for Sony while it didn’t bring that many customers. At the same time, I knew I could run Linux on my PS3 but never did.

So it wasn’t an actual issue for me either, it just upset me. I bought the PS3 for many reasons and being able to run Linux had been one of them. Not the major point but I still got mad when they took that from me.

At the 27C3, they showed how it was hacked but I was intrigued by short appearance of a guy who had analyzed the time it took to break a console and why it was hacked. While piracy is a side effect of hacking a console, it’s probably not the driving force. The statistics say that it took at most 12 months to hack a console make Linux run. The PS3 was unscathed for three years – until Sony stopped support for Linux. After that, the hackers really dug into it and – what surprise – they pwn3d it.

Made me wonder why Sony dropped support? As we know from the history of Microsoft, piracy is actually a major driving force for software sales. The calculation goes a bit like this: If you don’t want to pay for something, it’s hard to force you. But once you’re used to something, and you like it, you stick with it. A good example was Office 97. It wasn’t that great but companies were forced to buy it quickly because all people working at those companies had got free, time limited copies along with their PCs. I’ll let you assume how many people bought the product after the time was up.

The thing was: People took work home (good for the companies), work on it and then bring it back to work. Then, something happened: The “old” Office 95 did display a warning, about 90% the size of the screen “I can’t open this! You may lose your work! Help!” So suddenly, there was a strong pressure on the company to upgrade 95 to 97 – because everyone had got a free copy of Office 97!

The key here is to be able to balance sales with piracy. Microsoft knows the Spiel best: Really smack down on people selling pirate copies but leave the home users alone. C= (and the Amiga) couldn’t play it. In the end, piracy overtook sales and the platform died. The lesson we learn here: Piracy is something that must be managed carefully. No piracy and sales will be much lower than they could be; too much and you go bankrupt.

So here is my heretic thought: Maybe Sony didn’t have enough piracy. ^_^

References: Video of the 27C3 talk “”. Go to the documentation site and search the download links for “console_hacking_2010”. The statistics part is at 05:33.

Funny comic against racism

5. January, 2011

Imagine there was a place where animals were sentient. Cats, dogs, mice, pigs, lions, deer, sharks, mantis, bears, you name it. Imagine a family: Father is a rabbit, mother a wolf. They have three children: A hedgehog (adopted), a wolf (from a former marriage of the mother) and now a bunny.

Did I mention that predators eat their usual prey? As in “wolf eats hares.” And now, we even have a human toddler. Girlfriends with extremely good hearing. A cat that sells cars which run from static electricity produced as the driver rubs his/her fur against the seat. A wolf that acts as Easter Bunny. A carnivorous bunny. Safety rules when hugging hedgehogs. A company called “Herd Thinners” that does just that: Bring down prey for the impaired or lazy predators that hunt in a supermarket. There is yearly migration, a sentient tree, swapped princesses, hibernation. Mixed classes mean: Insects, birds, mammals – everything but fish. At least as long as you stay out of the sea. Natural job for a shark? Lawyer.

At least, if your wife doesn’t like the flowers, the husband can eat them.

And best of all: The comic is even better than my description. Say hello to Kevin & Kell. Start here.

pygments syntax highlighting

4. January, 2011

Need a good syntax highlighter? Check out Pygments.

Paul Bilnoski: On Exception Management

3. January, 2011

If you want to widen your understanding of exceptions and how to handle them, you should read Paul Bilnoski’s post “On Exception Management

Need something in SWT?

2. January, 2011

When the guys at SWT can’t be bothered, there is now an alternative: A little project to create drop in replacements for stuff that you want in SWT. Check it out here.

In the same place, you can find a slightly modified version of StyledText. When I say “slightly modified”, then I mean “at the API level”. I’m currently heavily refactoring the code inside to make it maintainable and more easily extendable.

Some achievements from the latest hacking session:

  • It’s now possible to write tests that verify the rendering of StyledText
  • Bullets are managed and rendered in their own special classes. Same goes for StyleRanges. That reduced the size from 1’700 lines to just about 1’100 lines – not that much but a good start. This also means I can write tests that just check the management of StyleRanges – without bothering with a main loop, resource management, etc.
  • There are a bunch of helper methods to debug the model behind your text. They can dump the text in readable form.

What’s next? I’m really starting to think about turning StyleRange and TextStyle into independent classes. Right now, the former inherits from the latter which means there is some really ugly code when it comes to reusing styles, merging styles, font handling, etc. One effect is that the current implementation violates the contract of equals() and hashCode(): equals() takes the range into account while hashCode() doesn’t. While that may not have an effect (StyleRanges with the same style just pile up in a hash map), it’s still a sign of a skewed API.

The API would be much more clean if there was a style manager (which you could dispose to free all fonts, colors, etc, at once) and when StyleRanges were just tiny classes that contain a range and a pointer to a style. That would allow to get rid of the ranges int array, we could use Set and List to manage style ranges, etc.

Something that I’ve been testing is hierarchical styles (i.e. styles that inherit from other styles). Works like in word processors where you define a basic style and then derive from that. I’m not happy with the performance right now but I’ve got some ideas.

How to use my version? Simple: Clone the StyledText project and install it. Check the POM to see which dependencies you need in your project. Now replace

import org.eclipse.swt.custom.*;


import de.pdark.styledtext.*;

That’s it.

%d bloggers like this: