LogCat Does Not Show Log Messages

LogCat is quite good thing to look at when program goes haywire since it usually shows both system and developer’s own log messages.

If you are trying to debug your Android program inside of Eclipse and you cannot see your custom log message, fixing it might be as simple as going to DDMS perspective and selecting your current device (whether real or simulated).

LogCat window displays only messages from device in focus and that might not be device you are currently debugging.

QText 2.30 (Beta 3)

Although I was preparing for final version here goes another beta. I decided upon it since internals of QText were rearranged quite a bit.

Just to make it worthwhile, there is support for hiding tabs and lot of polishing. Download is here and soon (really this time) there will be final.

P.S. Since most of things that was asked for is now implemented, I am open for suggestions.

Visual Studio 2010 Patches

I consider Visual Studio 2010 an improvement to Visual Studio 2008. However, it had few annoying issues.

One was making find box wider and wider and that was solved few weeks ago via patch.

Another one was need to scroll context menu although there was enough place on screen. Finally patch for that issue is here. For this patch to work properly you also need another WPF patch.

This is quite a collection of patches - 1, 2 and 3. Once these are installed Visual Studio 2010 suddenly becomes even better environment.

How to Gently Kill a Thread

Creating your own thread is not something that I do lightly. There are so many alternatives these days where framework does “dirty job” for you.

However, sometime making your own thread is way to go. I found that mostly I use same code in order to cancel it.

Idea is creating ManualResetEvent that we can check fairly quick from thread loop. Once that event switches it’s value to true, our thread should terminate.

private ManualResetEvent _cancelEvent;
private Thread _thread;

public void Start() {
    _cancelEvent = new ManualResetEvent(false);
    _thread = new Thread(Run);
    _thread.IsBackground = true;
    _thread.Name = "EntranceBarrier";
    _thread.Priority = ThreadPriority.AboveNormal;
    _thread.Start();
}

public void Stop() {
    _cancelEvent.Set();
    while (_thread.IsAlive) { Thread.Sleep(10); } //wait until it is really stopped
}

bool IsCanceled {
    get { return _cancelEvent.WaitOne(0, false); }
}

void Run() {
    while (!IsCanceled) {
        //some code
        if (this.IsCanceled) { return; }
        //some code
    }
}

P.S. This will terminate thread gently and it only works if event is checked often. If you have code that is waiting for system event, this is not solution for you.

MagiWOL 2.20

After very long time (more than a year!) here is update to my Wake-On-LAN program.

This update consists mostly of bug-fixes with single new feature. One can define custom wait period between sending packets. This change will not be used much but for situations where you need to wake hundred of computers without burning fusebox it is definitely crucial.

Additional small tweak that may stop some frustration is change of console tool to wol.exe. This way one working in command-line can write only three letters instead of eight (it was magiwolc.exe).

Download is ready.