woensdag 5 september 2012

XBMC met Windows 8 op ION 3D

Nu de RTM van Windows 8 uit is, ben ik er eens mee gaan spelen. Het grootste voordeel voor een HTPC is de snellere starttijd.

Ik heb hem als volgt geïnstalleerd:
  • Installeer Windows 8
  • Installeer laatste NVIDIA ION driver voor Windows 8 (momenteel 302.82)
  • Opgelet! Bij het installeren van de afstandsbediening moet je de laatste versie (20110219 voor Windows 7) van de Asrock site installeren en de compatibiliteitsmodus van de setup op Windows 7 zetten. Anders krijg je achteraf bluescreens (net zoals in het begin bij Windows 7). Check na de installatie dat hij nuviocir_win7_x86.sys gebruikt en niet nuviocir_vista_x86.sys in de hardware manager.
Remote control driver
  • Alle nodige drivers zijn nu geïnstalleerd, installeer de laatste XBMC (momenteel Eden 11.0)
  • De afstandsbediening is eenvoudig te configuren mbv XBMCCustomregis van Elitegamer360:
    • Eerst backup maken van registry entries
    • Keyboard.xml kopieren naar de XMBC  userdata
    • Autohotkey installeren (om groene windows knop te kunnen gebruiken)
    • GSB_Script_AllinOne.ahk script downloaden en opslaan onder C:\Tools (Zie autostart)
    • Registry config mergen
  • Maak batch file C:\Tools\StartXBMC.bat aan met inhoud:
:: Mount NAS shares
start cmd /C "C:\Tools\Mount NAS.bat"

:: Enable GSB on remote
start /D "C:\Program Files\AutoHotkey" AutoHotkey.exe C:\Tools\GSB_Script_AllinOne.ahk

:: Start XBMC
start /D "C:\Program Files\XBMC" XBMC.exe
    • Zet autologin en "wakeup zonder wachtwoord"
    • Stel UI in via gpedit.msc (onder User Configuration > Administrative Templates > System > Custom User Interface). Selecteer C:\Tools\StartXBMC.bat
    • Als je nu reboot, start hij vanzelf op in XMBC. Om terug in de standaardomgeving te komen start je explorer.exe (Ctrl+Shift+Esc (Task Manager) > File > Run new task) en druk je vervolgens op de Windows key om in de Metro interface te komen.
  • Reboot & enjoy!

vrijdag 24 augustus 2012

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