StarCraft 2 on Linux: Sound problems

28. September, 2010
Wine Logo

WINE Logo

If you have sound issues in StarCraft 2 on Linux, open WINE config (winecfg) and select the “Audio” tab. Make sure that the correct sound driver is selected (use “Test sound”) and then switch “Hardware Acceleration” near the bottom to “Emulation”.


Thoughts on documentation

28. September, 2010

Software developers believe that documentation is just another way to say code is buggy. The reasoning is like this: If the code was easy to understand and/or did what you expected, then why document it?

While this is true at the level of a code line, there should be some documentation explaining your overall view of the world.

Next, we have end user documentation. End users have no idea how software works, they just know they have to get some work done. Stat. For them, good documentation can be the difference between a nice day and weeks of overtime.

In “The Value of Documentation in Open Source“,  Chris Aniszczyk explains why this is especially important for Open Source.  Good points.

Related articles:


Google Transparency Report

24. September, 2010

Google now shows usage data by country and service and how many requests it got from where to take items out of their search indexes, blogs, YouTube, etc.


Where do Most US Presidents Come From?

18. September, 2010

Every wondered where US Presidents come from (usually)? Freebase Parallax can answer that. Watch the video to get an idea. I was surprised that most presidents are from the East Coast.


When inheritance is not enough

16. September, 2010

Ever had the problem that inheritance just wasn’t enough? For example in this case:

package core;
public class Main {
    public static void main(String[] args) {
        sayHello();
    }
    private static void sayHello() {
        System.out.println("Hello World!");
    }
}

Say you need to override sayHello(). What are your options?

You could edit the source. But if you only have the bytecode?

You could decompile the bytecode. But what if you need the same change in several places?

Eventually, you’ll have to use copy more or less code around because Java just doesn’t offer enough ways to combine code. The solution? Object Teams. See this article for a solution of the problem above.

What is Object Teams?

In a nutshell, a team is a group of players which have roles. Usually, the roles are distributed by way of the strengths of your players. Slow and sturdy ones will be defense. Quick and agile players will attack. The calm ones will do tactics.

OT/J (the Java implementation of Object Teams) does just that: You define teams and roles and then apply those to existing Java code. Let’s take the Observer pattern (you know that design patterns are workarounds for flaws in the language’s design, yes?).

The problem with this pattern is that you can’t apply it retroactively. You must modify the involved classes to support the pattern even if they couldn’t care less. That leads to a lot of problems. Classes which don’t need it must still allocate resources for it. It clutters the API. You can’t add it to classes which don’t support it. If a class only allows you to observe some behavior, you can’t change that.

OT/J fixes all that. The OTExample Observer shows three classes which could make use of the Observer pattern but don’t. Instead, the pattern is retrofitted in all the places where it’s necessary. This allows for many optimizations. For example, you can create a single store for all your observers (instead of one per instance). The API isn’t cluttered. You can observe almost any change.


Java Project Lambda

10. September, 2010
Java (programming language)

Image via Wikipedia

It seems that someone came to reason and proposed an implementation for closures in Java that would not only work but also be useful without adding too much complexity to the language: Project Lambda.


Java development through Excel

7. September, 2010

When developing software, one pain is always the same: Getting valuable input from the customer. One solution is to use a tool that your customer probably understands: Excel.

“Oh, great, CSV files,” you think. No. I mean Excel work sheets, with colors and formatting and formulas. Let me explain two approaches to save you a lot of time and effort, pain and tears.

Jakarta POI Logo

Image via Wikipedia

Apache POI

Apache POI is the Swiss Army Knife for Java developers who have to deal with Excel. It basically allows you to access the content of an Excel document in a humane way: By book, sheet and then indexed by row and column. It doesn’t matter if the file is in the old binary format (*.xls) or the new XML one (*.xlsx).

Especially the XML format is suited perfectly to allow your customers to send you master data. Just write a small tool that reads the Excel file directly and dumps it into your database. No CSV conversion! You can use colors to mark rows/columns to ignore. You can define styles to ignore (like “Section” or “Heading”). That allows your customer to keep the table readable.

Formula Compiler

But the data in the spreadsheets is only half of the value. The guys at Abacus Research AG created a new project: Abacus Formula Compiler (AFC). This gem gives you access to the formulas in the cells. POI does that, too, but you will just get a string. AFC will convert the formulas into Java Code. That means your customer can not only send you master data but also how to process it.

They can send you a spreadsheet with an example what they are talking about. They can use the Excel sheets they have been using to drive their business for the last five years. If something changes, they can send you an updated version, you run AFC on that and get a new set of classes which replace the old ones and which do exactly what your customer wants.


Simple passwords

6. September, 2010
Credit card

Image via Wikipedia

How secure can a simple password be?

Well, that depends. What do you want to protect and against whom?

Today, there are two main attacks. The first one is by people who are close. Coworkers and relatives. The coworkers need some information or access to some function while you’re not around or because there wasn’t enough money to buy a software license for everyone. The relatives want to spy on you (for various reasons). If your password is something personal, they will figure it out easily enough.

The other attack is by spammers who want to gain access to your computer (to send more spam or to get access to more computers or to your bank account, your credit card number, etc) or your accounts. Credibility (as in Google ranking) can be worth money, so control over a well-known blog or a reputable website is not something a cracker would shun.

These people run professional attacks against logins, so they try words from dictionaries with a few numbers added (like cat123). They have tables with passwords and how often people use them (hint: don’t use 123456 as password).

For big sites, the question isn’t really how “secure” the passwords are but how often they are used. If every password was different, it would be much more effort for attackers to crack enough accounts to make the attempt worthwhile.

That means passwords could be simple enough to remember. As they should be. Or people will have to write them down somewhere — we’re not computers. Which remember everything perfectly. Unless the last backup didn’t work. Or a virus comes along. Or someone makes a mistake.

Related Articles


OSS vs. proprietary software

25. August, 2010

How was it ever possible that OSS overtook proprietary software? Microsoft is a 223 Billion Dollar company, RedHat is only worth $5 Billion. How can something “for free” be better than something that costs thousands of dollars?

Paul Ramsey gives a very nice explanation in his talk: Beyond Nerds Bearing Gifts


ORA-01461: can bind a LONG value only for insert into a LONG column tips

23. August, 2010

Should you ever encounter this message:

ORA-01461: can bind a LONG value only for insert into a LONG column tips

then chances are you tried to insert more than 4096 characters at once.

Again the price for useless error messages goes to … Oracle! 😉

To add insult to injury, I couldn’t find anything useful related to this error with Oracle’s own site search.