Stand up for your freedom to install free software!

19. October, 2011

Read the truth behind so-called “Secure Boot” and sign the statement.


Unable to connect to the system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused [solved]

14. October, 2011

Oneiric is there but in my case, I hit a bug during the upgrade:

Unable to connect to the system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused

The bug is tracked on Launchpad. See comment #24 for a solution.


3D Scanning Using Kinect

7. October, 2011

3D modelling strains my patience. It just takes too long to get even simple models “right”.

There is a new project called surfacerecon which uses the Kinect 3D controller to create fully textured 3D models of real objects.  Seeing is believing:


Sonar

22. September, 2011

I just attended the Sonar presentation given by Olivier Gaudin of sonarsource. Some impressions.

A good definition of quality:

A well-written program is a program where the cost of implementing a feature is constant throughout the program’s lifetime

— Itay Maman

In Martin Fowler’s “Technical Debt Quadrant“, Sonar is in the upper right corner: It doesn’t solve your problems, it just helps you know what they are. Or as the guys at sonarsource put it: Sonar puts  your technical debt under control.

A good book which you may want to read in this area is “Clean Code – A Handbook of Agile Software Craftsmanship” by Robert C. Martin.

List of the 7 Deadly Sins:

  • Code duplication (cut&paste)
  • Bad distribution of complexity
  • Spaghetti design
  • Lack of unit tests
  • No coding standards
  • Potential bugs
  • Not enough or too many comments

Why Writing Software is Not Like Engineering

12. September, 2011

Excellent article by Terence ParrWhy writing software is not like engineering

Main points:

  • “Congress does not go to NASA halfway through a moonshot and ask them to go to Mars instead.”
  • When building a house, it’s pretty hard to make the toilet flush when you ring the doorbell. In languages like C++, it’s very hard to make 100% sure this can’t happen.
  • Is it science? No, science is about conducting experiments and accumulating knowledge.

I don’t agree with software == art. Art is meant to make emotions available to a larger audience. Maybe writing error messages at M$ is an art form but general coding isn’t.

Conclusion: Software development is a craft just like carpentry or masonry.

Related articles:


Push Button Builds

8. September, 2011

A few days ago, kingargyle posted about “Push Button Builds.” The idea is that building a software should be as simple as triggering a light switch.

A good example are Maven (mvn install) or most automake builds (configure && make && make install). They usually just work and if they fail, they give you some context to work from.

A good negative example are Eclipse PDE builds: Often there is no build script. If there is a build script, it will fail with an obscure error message in an Ant script that was recursively called by about 100 other Ant scripts. Each Eclipse project uses PDE but each build has different prerequisites (which you must know). If the build uses p2 repositories, there is no way of telling whether two subsequent builds will produce the same result. Some projects try really hard to help newcomers to build their stuff with a recipe that needs 100+ easy steps. In four words: It’s a mess.

Or a surefire way to attract only the most dedicated committers because everyone else will be utterly demotivated very quickly (and you don’t want those, do you? 😉

So like Dave Carver, I would like to spread the idea. Make builds more simple. Here is an example and following Dave’s advice, I’m going to make the build script even more simple.

Why a script and not, say, a web site with instructions? Several reasons:

  1. A script will make you more dedicated. It’s easy to be sloppy with a README. With a script, at least the syntax will be right.
  2. When a README fails, you won’t really know what to do next. With a script, you have a very precise starting point for a bug report: “The setup script failed in line 15” vs. “Install with Maven … and which version?”
  3. Scripts can prepare the environment. Since you don’t want to make anyone angry, create a new directory and put everything in there. Download what you need, unpack it, configure it. If you can’t do it with a script, why should a newcomer fare better?
  4. Can’t download something? You can always print an error message with exact instructions: Go to website … download xxx, version yyy … put it here. In a script, you can say ‘echo “Put download into $build_dir”‘ Try that in a README.
  5. You can prove that a script works. Good luck trying that with a README.
  6. You can run scripts on a CI server to make sure they work.
  7. A script always needs an interpreter. Bash scripts run on Mac and Linux. What about Windows users? Well, 100% of the Windows users build OSS software from .msi files. The tiny rest has three options: a) Read the bash script, b) install Cygwin/MinGW, c) install Linux.

No Software Can Be Better Than Its Worst Error Message

7. September, 2011

Kudos for this simple but oh so true proverb go to Stephan Herrmann.

Thank you.


Human-Readable File Sizes

6. September, 2011

Every now and then, you need to show a number to a human. In some cases, those numbers can range from very small to huge. File sizes are an example.

Here is a very short code sample how to get a nice file size for human consumption: How to convert byte size into human readable format in java?

Best of all: It’s four lines of code but it can handle SI and non-SI units.


Restoring a Corrupted Workspace in Eclipse

2. September, 2011

When Eclipse is starting to act weird or completely refuses to start, the .metadata probably got corrupted. Now what? You could delete the .metadata directory and waste a couple of hours to restore the IDE to a useful state.

Here are some tips to speed up the process a lot:

  1. If Eclipse still works, export your preferences.
  2. Try to start Eclipse with -clean. That flushes some caches which might have become corrupted.
  3. Start Eclipse, wait for all builds and background activity to stop and then kill it using your OS’ tools. When Eclipse restarts, it will notice it has crashed and do some more cleanup / distrust more caches.
  4. Install the Bulk Import plugin to save list of projects and their state.
  5. Instead of deleting .metadata/, rename it.
  6. Restore the folder “.metadata/.plugins/org.eclipse.core.runtime/.settings” from the backup. This is basically the same as the preferences. Kudos to Tomas Kramar for figuring that one out.
  7. Restart Eclipse. You should get an empty workspace but all your preferences should be there.
  8. Use the buttons in the toolbar to restore all your projects.

Another useful plugin is the “save UI state” which saves the workspace layout and open editors after every change (based on the code here).

With a way to preserve your preferences, saving the project state the workspace layout, you should be able to quickly restore the IDE.

Related articles:

  • Eclipse Dance Steps – “Sometime Eclipse fails to work as expected. The following ‘dances’, in increasing order of desperation, may help. Remember to maintain a fixed grin throughout and try not to tread on your own toes.”

Testing Requirements

30. August, 2011

When developing software, you’re constantly faced with two issues:

  1. Get all the requirements
  2. Make sure the requirements are correct

When writing code, we use tests to make sure we meet all the goals (completeness and correctness) but how do you test requirements?

By writing unit tests against a model of your requirements. There are two approaches to model requirements in a way useful for both the business and the development: Requirements Modeling Framework (RMF) and AlphaSimple.

See rafael.chaves’s blog post “Modeling requirements the pragmatic way (or When xUML meets xUnit)” for a more detailed introduction to the idea.