14 January, 2010

PTM (Personal Time Manager): A good proposal to automated time tracking

I’m always shifting between tasks and always forget what I did “yesterday”. This makes it really hard to keep a consistent and accurate timetracking, when it comes to how much time to assign to customer projects.

Today I found a tool that keeps track of my actions “automatically”. I’ve for a long time been thinking about writing a task tray utility that monitored what you were doing, with the purpose of reporting this every Friday. Surprise-surprise, another dude have come up with that utility already! It looks pretty “old school” in the UI, but if it works – then I don’t care.

I’m going to give PTM a chance and see how it works for me!
Try it out here (it is free): http://sourceforge.net/projects/ptm/

12 January, 2010

“Launch for User” exception?

It is at times really annoying to be an MS-developer!

For the life of me, I could not figure out the source of a “nice” exception I was presented with today numerous times. “A Launch for User” exception? Come on, what’s that ?

A lot of Googling lead me to a number of other dudes with the same problem. They all had something like “Debugger.Launch()” in their code, which I certainly did not have! Finally pressing the Launch Debugger dialog and opening the editor to debug the problem led me to the precise source of the problem. I too had forgotten that I indeed did have such statement (Debugger.Launch()) in my code hidden far inside the code. So – if you ever experience this strange dialog/exception; hunt for Debugger.Launch() statements in the code running.

Happy coding.

07 January, 2010

How to close a Browser window without warning

I’m not really a web developer, but today a friend asked me how to force close a browser window? And also without the infamous security measure (“Are you sure you want to close?”) taken by Microsoft in IE 7 and forward.

It goes without saying, that it is a local operation on the Client-side as we are talking about closing his browser. It can therefore not happen server side (really..?). The only option we are left with is to execute some script in the browser, or to let the Client download a browser plug-in that forces the browser to close. Well – I took the easy path and went for the scripting option.

According to Google, I’m not the only one with this problem! A number of other dudes have faced the same problem. The recipe (1) they used proved not to work in my case. I found only one solution that actually worked (2).

The trick is to let the browser believe that the browser window has been opened by JavaScript in the first place. If the browser believes, that the window is the initial window (window.opener = null), it will ask for a confirmation from the User. If the browser on the other hand believes, the window has been opened by JavaScript (and thereby carrying an '.opener'), it will close without prompting. This should actually make option (1) work as you explicitly set the owner, but for some reason unknown to me, it did not work at all in my IE8 browser. Option (2) works like a charm instead!

(1) This does not work for me. You are still present with a dialog using this option (IE 8).
function closeWin() {
    window.opener = ''x'';

(2) This WORKS!
function closeWin() {
    window.open('', '_self', '');

Invoking this last function from a client side button (html button), will close the browser without asking any questions or presenting any warnings. I suspect the reason is that you open the windows “into itself” so to speak. The current window has therefore been opened by JavaScript, which allows IE to close the window without prompts.

Neat work, but still somewhat bizarre workaround :-)

05 January, 2010

Windows 7: The secret ‘God’ folder

A colleague today showed my the so-called ‘God'-folder. It is a folder that contains virtually anything related to system setup of Windows 7.


Pretty easy to setup:
1) Create a folder anywhere
2) Name the folder: ‘GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
3) Voila! You have access to everything related to system configuration of Windows 7

iPhone/XCode - not all cases are equal!

This bit me! Having made some changes to an iPhone application (Obj-C); everything worked fine in the simulator. But, when deploying the s...