You are here

Benjamin's Personal Blog

Benjamin's Personal Blog
Checked: 57 min 58 sec ago
Updated: 8 months 1 week ago
Update every: 2 hours

A software development blog
Subscribe to Benjamin's Personal Blog

Pick the transformer

Benjamin's Personal Blog - Wed, 20/08/2008 - 5:32pm
I finally got around to making a fun little website where you are shown two classic Transformer toys from the 80's and you have to pick which one you get to keep and which one ends up getting traded away. The site is called called Pick the transformer.

Three years in Europe with Trolltech

Benjamin's Personal Blog - Fri, 15/08/2008 - 11:53am
After three years at Trolltech today was a sad day as it was my last day. When my wife and I originally decided to move to Norway we wanted to stay for three years and it is satisfying that we were able to reach that goal. The time here has been wonderful, sometimes stressful, but something I will always remember.

Code Review Should Be Free

Benjamin's Personal Blog - Thu, 07/08/2008 - 6:52pm
Depending on the definition "code review" can mean a wide variety of things such as formal code review or automated code analysis. For this article I am talking about when a developer has a patch to some code base and would like someone else to review it before it goes into the main repository.

Just the though of having a code review will frequently cause developers to spend extra time making sure a patch is as good as it can be. Code reviews typically catch bugs, design flaws, missed edge cases, inconsistent or confusing code style, and more.

An adventure to Trolltunga

Benjamin's Personal Blog - Wed, 30/07/2008 - 7:54pm
A little over a year ago on reddit I saw a picture of a guy sitting on the edge of a rock. Not just any rock, but a clip of a rock that jets out of a vertical side of a mountain with a 350 meter drop. In the comments I discovered that the photo was of Trolltunga and is right near by in Odda Norway. Along with some other trolls from Trolltech we rented a car and drove to Odda for a little camping trip.

Upgrading the iBook hard drive

Benjamin's Personal Blog - Sat, 12/07/2008 - 9:25pm
A few weeks ago I picked up some new laptop hard drives to replace both the one in my MacBook and the one in my wife's iBook. The MacBook's hard drive upgrade process is a very easy five minutes process.

  1. Pop out the battery

  2. Unscrew cover

  3. Pull out hard drive

Cast off

Benjamin's Personal Blog - Wed, 02/07/2008 - 9:10pm
Well after three weeks I got my cast off on Friday and I can use both hands again. It has been an incredibly interesting experience. I took down notes of events throughout the three weeks that were interesting so I could write this blog entry once I could type again.

Screenie

Benjamin's Personal Blog - Mon, 02/06/2008 - 3:15pm
Ariya Hidayat has put up a very cool little Qt4 tool called Screenie that helps you create cool screenshots of your applications for your website. Here is some screenshots of Arora made by screenie:

Italy

Benjamin's Personal Blog - Thu, 15/05/2008 - 8:29pm
My wife and I spent the past two weeks in Italy for our wedding anniversary. Flying into Rome we stayed in a nice bed and breakfast that was near to the main train station.

Demo browser update

Benjamin's Personal Blog - Sat, 05/04/2008 - 8:34pm

As Thiago has recently blogged about the Qt 4.4 release candidate is now out. Since beta1 I have been spending a most my weekends hacking on the demo browser and there are many improvements in this release.

Exporting History from Konqueror

Benjamin's Personal Blog - Thu, 27/12/2007 - 8:59pm
In my Konqueror settings I have had it retain my history sense August 2006. This has resulted in a history file that contains over eighteen thousand entries. As you can guess Konqueror has some trouble with a history of this size. A dataset of this size is a good way to test any history managers memory usage and performance. I was hoping to be able to export the data with dcop, but unfortunately the only function available is allUrls which doesn't make that much sense because the dates are just as important as the urls.

Valgrind callgrind tools Part 3: Code coverage

Benjamin's Personal Blog - Sat, 22/12/2007 - 7:41pm
In the Valgrind manual they list some tools you could write for Valgrind. One of the suggestions is to write a coverage tool. So a few months ago I sat down and did exactly that. It was a nice little tool and I happily posted it to the Valgrind developer mailing list only to discover that I was not the first person to do this nor was any of our solutions that good in the end. The easy part of the project is obtaining a recored of what was executed.

Valgrind callgrind tools Part 2: accessing information inside a callgrind files

Benjamin's Personal Blog - Mon, 10/12/2007 - 8:54pm
From Valgrind's callgrind manual:

Callgrind is a Valgrind tool for profiling programs. The collected data consists of the number of instructions executed on a run, their relationship to source lines, and call relationship among functions together with call counts. Optionally, a cache simulator (similar to cachegrind) can produce further information about the memory access behavior of the application.

Valgrind callgrind tools Part 1: decompressing callgrind files

Benjamin's Personal Blog - Sun, 09/12/2007 - 7:37pm
If you have ever used the Vallgrind tool callgrind you will find that it generates a file "callgrind.out.pid". Looking inside of this file you will find a compressed version of the execution of the program. Here is a snippet from a callgrind file I generated last night:
fn=(43726) tst_QListView::indexAt()
463 4
+2 4
cfn=(24288)
calls=1 148
* 3399
+1 1
+1 1
+2 4
cob=(26)
cfi=(265)
cfn=(21860)
calls=1 150
* 320655
+1 5
...

Limiting the runtime of a program

Benjamin's Personal Blog - Wed, 28/11/2007 - 3:47pm
I have some programs that run in a cron job at night and occasionally they hang and don't exit which means that anything scheduled after them doesn't run and the next day I have processes hanging around. To solve that I made a twelve line program that uses features in QProcess to automatically kill a process that is taking longer then five minutes. Here is the slightly bigger version that lets you specify the timeout if you want and has a help.
timelimit -l 60000 ./reallyLongrunningapp

#include QtCore
int main(int argc, char **argv)
{

QtScript profiling

Benjamin's Personal Blog - Fri, 09/11/2007 - 9:31am
Working on some QtScript code a little bit ago I wanted to profile the code. There didn't exists a profiler to I wrote one. It uses QScriptEngineAgent which is part of Qt 4.4.

Auto test stub generator

Benjamin's Personal Blog - Thu, 08/11/2007 - 5:24pm
When writing auto tests for Qt code one of the more annoying parts of the task is getting the initial test file up and running. The basic makeup of the test files are about the same so I wrote a little tool that helps by automatically creating stub code for the class you are writing a test for. Then it is just a task of going through the file filling it in with the actual tests.

Some features include:
- Creates a stub tests for each non private function in the class.
- Creates a subclass for the class to expose any protected functions for testing.

Quickies

Benjamin's Personal Blog - Mon, 29/10/2007 - 7:31pm
I have a number of presents for you all.

First off is a little file manager that I wrote several months ago. It is called Ambit and is pretty much a weekend clone of OS X's Finder.
http://repo.or.cz/w/ambit.git

What I learned from Qt that made me a better programmer in C++

Benjamin's Personal Blog - Mon, 08/10/2007 - 4:50am
Reginald Braithwaite says he would love to hear stories about how programmers learned from X that makes me a better programmer in Y. So here are a few quick thoughts on how the Qt library made me a better C++ programmer.

1) The API matters, a lot

Javascript Genetic Algorithm

Benjamin's Personal Blog - Tue, 07/08/2007 - 2:58am
The other evening I was looking to play around with QScript. I have done a handful of JavaScript and know that there are a number of very interesting features that the language possesses. I have also been looking to hack on a Genetic Algorithm project. Putting the two together I made a Genetic Algorithm example written in JavaScript. It was quite a lot of fun to make and is quite a small amount of code in the end.

Extend your MacBook battery life

Benjamin's Personal Blog - Thu, 24/05/2007 - 1:16am
The PowerTOP project inspired me to take a quick look at what was running on my MacBook under OS X. Just by using the activity monitor (and top) I could very quickly spot some obvious issues.

- The world clock in dashboard (which is one of the four included and running ones by default) fires off once a second, I didn't really need that widget anyway.

- I had enabled access to disabled devices long ago when playing around, but it seems to start a process that wakes up a lot. Turning that off solves that.

Hair Cut

Benjamin's Personal Blog - Thu, 19/04/2007 - 5:52am
Yesterday I got my hair cut short for the first time since my wedding five years ago. I have been thinking of getting it cut off for about six months and now seemed a good time. I donated my hair to Locks Of Love which is an organization that provides wigs for kids. From their website: "Most of the children helped by Locks of Love have lost their hair due to a medical condition called alopecia areata, which has no known cause or cure." Since getting it cut I have caught myself trying to play with it when thinking about thing.

Pages

Subscribe to Benjamin's Personal Blog