Monatsarchiv für Februar 2009

The ultimate auto-response against skype spam

Montag, den 23. Februar 2009

Ever received stuff like this on skype?

Hey this is Jennifer. Now I am looking for new friends. U can look my photo here: http://meetcontacts.net/girlsafc/ids1d7f/.

Here’s the ultimate auto-response ;)

yes I know. and you are a fat hairy man sitting on his chair, drinking beer while sending out skype messages to innocent people trying to convince them that you’re a horny girl which will never stop sucking…

Part II: Mimic SynchronizationContext behaviour on .NET CF

Sonntag, den 15. Februar 2009

I just posted the second part of the article Part I: Mimic SynchronizationContext behaviour on .NET CF on planetgeek.ch! On the article I try to show how the basic behavior of the SynchronizationContext can be achieved on the .NET compact framework platform. Please refer to the article under:

http://www.planetgeek.ch/2009/02/15/part-ii-mimic-synchronizationcontext-behaviour-on-net-cf/

Parking failures

Samstag, den 14. Februar 2009

Just watch and you’ll be laughing till your lungs burst ;)

Fuckin’ piece of shit

Samstag, den 14. Februar 2009

This video is so cool! Total nonsense ;)

LaCie LaCinema Black Max

Dienstag, den 10. Februar 2009

I must admit that I’m not an owner of the LaCie LaCinema Black Max but I’m a proud owner of the popcorn hour A110. The popcorn hour A110 is a small media box which plays almost every video and audio format on the market. The media box includes portal services for youtube, google video, shoutcast and many more platforms. Although I’m very pleased with this box I want to present to you the latest news about LaCie LaCinema Black Max.

The LaCinema Black Max is shipped with the video codecs for MPEG-1, MPEG-2, MPEG-4, DIVX, XVID, H.264, MKV and WMV9 HD and is able to play video material up to 1.920 x 1.080p. VOB- or IFO structures without protection can be played directly on the media box without converting. The LaCinema Black Max is also able to upscale videos with less resolution up to 1080i.

The most exciting feature of the LaCinema is the integrated DVB-T module. The DVB-T module contains an integrated program guide which allows to use the black max as a video recorder with time shifting.

LaCinema supports the following audio codecs: MP3, WMA, AAC, OGG, AC3, MP4 and WAV. Pictures in the format JPEG, PNG, GIF, BMP and TIF can be directly viewed on the screen via the integrated photo viewer.

Unfortunately the integrated DVB-T module makes the LaCinema quite an expensive product. The current list prices for the LaCinema with 500 GB hard disk are about 650 swiss francs. This makes the LaCinema about 200 swiss francs more expensive than the popcorn hour A110 with integrated samsung F1 hard disk with 1 TB disk space.

But for those who want an all-in-one player and recorder which supports the latest and greatest high definition codecs the LaCinema Black Max is a “must buy”!

Here are some pictures (copyright by Lacie):

lacinemaBlackMax_1 lacinemaBlackMax_2
lacinemaBlackMax_3 lacinemaBlackMax_4
lacinemaBlackMax_5  

planetgeek.ch to the rescue

Montag, den 9. Februar 2009

As some of you may already have noticed some of my blog entries are now cross-posted on tracelight.ch and planetgeek.ch. A few weeks ago we decided to start a new blog project called planetgeek.ch. The goal of this blog is to provide geeky information to all ICT interested people. The language of the blog is English. We hope that we can provide some valuable and interesting information to you guys (both male and female!) out there in the world.

Please have a look and join us on planetgeek.ch! I can especially recommend the page “Ask a geek”!

Part I: Mimic SynchronizationContext behaviour on .NET CF

Sonntag, den 8. Februar 2009

Before I got into the details of the problem I want to briefly describe what the SynchronizationContext class really does and what it’s main purpose really is in the first part of the article. From that perspective I’m going to show how the basic functionality of the SynchronizationContext class can be implemented for the .NET compact framework in the second part of the article..

The msdn library documentation states:

Provides the basic functionality for propagating a synchronization context in various synchronization models.

I must admit the first time when I read this definition I didn’t really get the key point behind the SynchronizationContext class. Detailed look into the implementation of SynchronizationContext and its base classes provided me the following information:

The SynchronizationContext class is a class belonging to the System.Threading namespace. The SynchronizationContext provides a model to make the communication between threads easier and more robust especially if multiple threading contexts/apartments such as “UI threading context” etc. are present.

To get a deeper understanding of the definition above I want to give you a short example. Imagine if you have a separate thread performing an intense calculation such as calculating the n-th Fibonacci number. When the separate thread has finished its long running operation you want to display the n-th Fibonacci number on a user interface. Normally (without using the SynchronizationContext class) you would need to do the following (or at least something similar):

private delegate void FibonacciResultDelegate(long fibonacciResult);
 
private void MethodCalledByTheFibonacciThread(long fibonacciNumber)
{
   if( fibonacciResultTextBox.InvokeRequired)
   {
      FibonacciResultDelegate fibonacciDelegate =
         MethodCalledByTheFibonacciThread;
      fibonacciDelegate.Invoke(this, new object[] { fibonacciNumber });
      return;
   }
   fibonacciResultTextBox.Text = fibonacciNumber.ToString();
}


With the SynchronizationContext class we can invoke delegates in the context of a different thread. For the example above we could do the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class FibonacciPresenter
    {
        private readonly Thread workerThread;
 
        private readonly SynchronizationContext context;
 
        private readonly IFibonacciView fibonacciView;
 
        public FibonacciWorker(IFibonacciView view)
        {
            fibonacciView = view;
 
            context = SynchronizationContext.Current;
 
            workerThread = new Thread(new ThreadStart(FibonacciCalc));
 
            workerThread.Start();
        }
 
        private void FibonacciCalc()
        {
            long result = CalculateFibonacciNumber( ... );
            context.Post(new SendOrPostCallback(delegate(object state)
            {
               fibonacciView.DisplayResult(result);
            }), null);
        }
 
        // details omitted...
    }

In code line 13 we can see how the SynchronizationContext is retrieved. The SynchronizationContex.Current property points to the SynchronizationContext of the thread where the FibonacciWorker was created (in my example the FibonacciWorker would be created in a control). Then the FibonacciCalc method can post (asynchronous) or send (synchronous) a SendOrPostCallback delegate containing the “job” which needs to be marshaled over the SynchronizationContext. Therefore the line fibonacciView.DisplayResult(result) would be invoked on the UI thread which allows us to remove the “invoke required” code parts and directly set the fibonacci calculation result to the textbox text property.

We can briefly summarize that the purpose of the SynchronizationContext is to post (asynchronous) or send (synchronous) SendOrPostCallback delegates in the correct threading context which simplifies marshaling.

Code reviewing

Montag, den 2. Februar 2009

whatthefucks