donderdag 26 januari 2012

Samsung firmware T-VALDEUC-3011.0 released

14-10-2011 T-VALDEUC-3011.0
  • Optimization to find the Service Channel  for SkyD (Germany, Austria , Swiss Region)
  • Improve ''11 Skype(MoIP) Camera screen is not showed
  • When turning off and on after recording Guide plus (Only Italy)
  • Improve Samsung Digital Camera''s specific MJPEG movie clip is not playbacked
  • fix power on/off issue continuously when connected with Network

woensdag 31 augustus 2011

Singleton in C#

One of the most used design patterns is the singleton pattern. There are a lot of implementations in each language. Thanks to Jon Skeet, I could find the best implementations for C#.

I prefer this lazy and threadsafe implementation for all my pre .NET 4 applications:



The .NET 3's lambda expression and .NET 4's generic Lazy class can create a lazy and threadsafe implementation without subclass:

woensdag 24 augustus 2011

The right way to get an auto-incremental id

When you write a PostgreSQL-appliction, you often need to fetch the id of inserted rows. In the past years, I've used the following three appoaches.

The person table is used as an example and has an auto-incremental primary key:

A sequence will automatically be created for the person_id column.

Now we want to insert a person and get his person_id:

The person will be inserted and you get his person_id. But only as long as you are the only user inserting in the person table. When there are concurrent inserts, the chance is high to get a wrong id with this method.

The next method is a little better:

This approach uses a transaction and the lastval() function. The generated id will be stored in a transactionvariable and is concurrent proof.

I recently added a lot of triggers to my database and suddenly I was getting invalid id's with the lastval() function. This happens only if a sequence is incremented in the trigger.

The last transactionless approach is concurrent- and triggerproof. This is the best Method:

vrijdag 22 juli 2011

WindowsFormsHost on a transparent WPF window

When you create a fancy WPF window with AllowTransparency set to true, all WindowsFormsHost controls  will be invisible because of some underlaying incompatible drawing methods.

This issue also causes the WPF WebBrowser control to be invisible on transparent windows. Chango V. has worked out a solution which creates an overlay for the WebBrower. I've created a similar solution for the WindowsFormsHost control. We make use of a separate non-transparent window which overlays a target FrameworkElement in the transparent window.

It seem to work fine, so I want to share it with the world. Here is the sourcecode:

WindowsFormsHostOverlay.xaml


WindowsFormsHostOverlay.xaml.cs


Here is a small (and incomplete) example of how you use WindowsFormsHostOverlay:

XAML


CS

woensdag 11 mei 2011

Samsung firmware T-VALDEUC-3009.2 released

11-05-2011 T-VALDEUC-3009.2
  • Optimization to find the Service Channel for SkyD (Germany, Austria , Swiss Region)
  • Improve ''11 Skype(MoIP) Camera screen is not showed
  • When turning off and on after recording Guide plus (Only Italy)
  • Improve Samsung Digital Camera''s specific MJPEG movie clip is not playbacked

dinsdag 26 april 2011

Samsung firmware T-VALDEUC-3008.3 released

19-04-2011 T-VALDEUC-3008.3
  • Optimization to find the Service Channel for SkyD (Germany, Austria , Swiss Region)

dinsdag 8 februari 2011

Samsung firmware T-VALDEUC-3007.1 released

7-02-2011 T-VALDEUC-3007.1
  • Optimization to find the Service Channel for SkyD (Germany, Austria , Swiss Region)