Real Time Temperature Posting in SQL Azure using Windows Mobile Service and the Observer Design Pattern with Gadgeteer

Yes, it works! My goal was to be able to add a display and a logger to Windows Azure based on the Observer Design Pattern.

1. Temperature change -> inform subscribers (LED display & SQL Azure)

2. Led display gets updates through Observer 1, SQL Azure gets updates through Observer 2.

3. The Gadgeteer device communicates with Azure through Azure Mobile Services.

4. The Gadgeteer Ticker event takes care of the measurement. When there is a change then notify all subscribers.

Onderlinge verbanden in het Observer Pattern in C#

Update een aantal Observers (bv. een display, een database) gemeten in "Het Programma". Onderstaande schema geeft aan hoe je makkelijk een nieuwe observer kunt toevoegen (RegisterObserver), die dan gebruik maakt van de IObserver Interface, waarin deze Observer wel zijn eigen Update statement krijgt. Dit komt doordat het update statement van de IObserver interface 1 op 1 wordt geplaatst in je nieuwe Observer Class, die aangemaakt is voor je nieuwe Observer.

Product-fotoshoot op locatie

Afgelopen week is Mediazone op locatie geweest om boilies (aas voor het vissen op karper) te fotograferen. In totaal zijn 13 types op foto gezet, met en zonder verpakking. De foto's zijn in hoge resolutie geleverd aan de klant. 1 x vrijstaand TIF met lagen, 1x orgineel en 1x met witte achtergrond en een lichte schaduw. 

Mediazone rekent geen instel- of voorrijkosten. Neem contact op voor een scherpe offerte. 

Merk registeren?

Wil je een Europees merk registreren (kosten ongeveer 900 euro) dan kun je dat doen via de volgende websites:

Een merk voor de Benelux (kosten ongeveer 240 euro) registreer je hier:

Belangrijk is dat je weet in welke klassen je merk moet worden geregistreerd. En je dient onderzoek te doen of een merk niet al wordt gebruikt. Het kan altijd zo zijn dat een merk wordt afgekeurd. Je bent dan je geld kwijt. Door onderzoek te doen in diverse registers kun je de kans hierop zo klein mogelijk maken.

In de loop der tijd heeft Mediazone de nodige ervaring opgedaan met merkenrecht. Wil je dat wij je tegen lage kosten adviseren en helpen, neem dan contact op.

How to build your Bitcoin wallet in Linux Fedora

NOTE: this is only a manual for educational purpose and you should use it on your own risk. I am not responsible for anything.

If you want to do something with Bitcoin for the first time, do it safe. A very secure way is to setup a virtual machine (VM) and then compile your own Bitcoin Wallet. You can shutdown the VM when your ready or store it anywhere you think it is safe. If you do not anything else with this VM, this is a relative safe solution.

I am using VMware Fusion on a Mac to run the virtual machine. Setting up Fedora in VMWare Fusion as a virtual machine is simple, please google this if you need help.

Once setup: In Fedora (the Linux operating system used in this guide: open Terminal and then copy and paste these sentences one by one in Terminal:

sudo yum install git

sudo mkdir -p src && cd src

sudo git clone

sudo yum groupinstall "Development Tools" "Development Libraries"

sudo wget

echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef  db-4.8.30.NC.tar.gz' | sha256sum -c

sudo tar -xvf db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix

sudo mkdir -p build

cd '/home/mediazone/src/db-4.8.30.NC/build_unix' 


sudo yum install -y gcc-c++ libtool swig pyqt4-devel python-psutil python-twisted wget protobuf-devel

sudo ../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX

sudo make install

cd ../..

cd bitcoin

sudo git checkout v0.9.3

sudo ./

sudo ./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/" --with-gui

sudo make

sudo make install


Yes! It worked:

Robot.txt file must be ANSI

For some reason I was not able to verify robot.txt files in Google Webmaster. It turned out that setting the encoding of the text file to ANSI, solved this problem.


The best place for Jquery in your website/ web application

Open your master page file and put references like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "">

<head id="Head1" runat="server">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="~/..../....css" runat="server" id="screen"/>

<asp:PlaceHolder ID="PlaceHolder1" runat="server">

<script src=""></script>
<script src=""></script>
<link rel="stylesheet" type="text/css" href="" />
    // Fallback to loading jQuery from a local path if the CDN is unavailable
    (window.jQuery || document.write('<script src="/scripts/jquery-2.0.3.min.js"><\/script>'));

AntiXSS functies nu in .NET 4.5

Automatisch alle data in een webpagina encoderen kan door de nieuwe anti-XSS routines in te laden in je web.config file. Daarna is in je webapplicatie data ge-encodeerd:

 <meta name="copyright" content="Copyright&#32;2014&#32;hetmerk" />


<httpRuntime requestValidationMode="2.0" targetFramework="2.0" 
encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" executionTimeout="30"
maxRequestLength="4096000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8"
minLocalRequestFreeThreads="4" appRequestQueueLimit="40"/>

How to make a widget for 2.0

  1. Make a Web User Control in Visual Studio the way you always do. If you never made a user control, try to learn how to make one first before you continue.
  2. Go to the folder widgets and copy a folder. For this example we copy the Calendar folder.
  3. Rename te folder to something new. For example Calendar2

  4. In the widget.ascx.cs file, put the foldername here (it must be exactly written as the name of the folder ----> Calendar2):

  5. In the widget.ascx file, rename the Inerits part to Calendar2 and the namespace in the widget.ascx.cs file to namespace Widgets.Calendar2:

  6.  Now try to load the new widget. The advantage is that you can see errors later on.

  7. After this step, you are almost there. Find #region Public Methods in widget.ascx.cs: 

    public override void LoadWidget()
    //PLACE YOUR ASCX code (webuser control code, page load part) HERE. 

  8.  Copy and paste the classes in your code from your ascx (web control) file:

  9. Now your widget should work! Here the empty code to get started:



<%@ Control Language="C#" AutoEventWireup="true" CodeFile="widget.ascx.cs" Inherits="Widgets.Calendar2.Widget" %>

<%@ Import Namespace="BlogEngine.Core" %>

<div style="text-align: center">

////////////YOUR CODE HERE/////////////





using ////////////YOUR CODE HERE/////////////

using App_Code.Controls;

namespace Widgets.Calendar2


    public partial class Widget : WidgetBase


        #region Properties

        public override bool IsEditable




                return false;



        public override string Name




                return "////////////YOUR FOLDERNAME HERE/////////////";




        #region Public Methods

        public override void LoadWidget()


 ////////////YOUR CODE HERE/////////////





How to find the IP numbers of your VM's in Hyper-V CORE

I don't know why but I always seem to forget the IP numbers of the VM machines I run in Hyper-V. The PowerShell Management Library for Hyper-V at does not include a script to do this so you have to use a script of yourself.

To find out specific information about the ip address of a VM, I am using the following script I found at



$vm = "!!!NAMEOFYOURVM!!!";

filter Import-CimXml


    $CimXml = [Xml]$_

    $CimObj = New-Object -TypeName System.Object

    foreach ($CimProperty in $CimXml.SelectNodes("/INSTANCE/PROPERTY"))


 if ($CimProperty.Name -eq "Name" -or $CimProperty.Name -eq "Data")


         $CimObj | Add-Member -MemberType NoteProperty -Name $CimProperty.NAME -Value $CimProperty.VALUE





$VmObj = Get-WmiObject -Namespace root\virtualization -Query "Select * From Msvm_ComputerSystem Where ElementName='$vm'"

$KvpObj = Get-WmiObject -Namespace root\virtualization -Query "Associators of {$VmObj} Where AssocClass=Msvm_SystemDevice ResultClass=Msvm_KvpExchangeComponent"

$KvpObj.GuestIntrinsicExchangeItems | Import-CimXml



In Hyper-V Core open notepad by typing notepad in the shell. After that copy and paste the following code into the notepad window and safe your file as (example): C:\ip.ps1

To run this powershell script, cd to C:\ and the type in Powershell: C:\> .\ip.ps1

How to manage a Hyper-V core with powershell on the Hyper-V machine

Virtual computers have always impressed me. Back in the days I had an Amiga 1200 with a Blizzard 1230VI expansion card. I emulated a Macintosh on this computer. Nowadays I have a Macbook and a copy of Windows Server 2003 Web Edition on it (VMware Fusion 2.0). I also have a bootcamp partition on which Hyper-V Core is installed. On this Hyper-V core a copy of Server 2008 WEB is installed. The only free option to manage the Hyper-V Core is using a MMC plugin in Windows Vista or Server 2008 server edition. I am using Powershell on the Hyper-V server. To use the powershell you must have a RDC with the Hyper-V machine.


I experimented a lot with Powershell lately. I read somewhere that notepad can be run from the Hyper-V core. Woow, I thought, that is great, that solves the problem I had to get PS1 (Powershell) files on the Hyper-V core. I used a USB stick in the past, but that was very unhandy. The possibility to run notepad makes it possible to copy scripts from the clipboard of my Macbook, and paste them in a notepad document on the Hyper-V Core. In that way I am able to safe them in the C: drive of the Hyper-V core. And voila, then I will be able to execute these PS1 scripts from the Powershell!


The first script I run was a script to shutdown and boot the Windows 2008 Web edition from Hyper-V. I used the scripts on this website:

And it worked! :-)

So, that was the first step. To make life easier, I wanted to install on the hyper-V server the PowerShell Management Library for Hyper-V at

I unzipped the files in a directory on the C drive. To use the library you have to install it. You need to re-install after rebooting the Hyper-V machine.

PS: C:\dir_with_library> .\install.cmd

To get the files on the Hyper-V server, I connect the Hyper-V server to a share on the Windows 2008 server. In this share the files are available that can be downloaded from

To set up a share in the Windows 2008 server, you go to computer management and there is an option for adding shares. After setting up this share, I connect the Hyper-V server to this share with the following command in Powershell:

$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("u:", "\\server\share", $false, "domain\user", "password")


After this, you are able to install the files from this new share U:\.


With this library installed, it is possible to do all kind of things. For example find the path of the virtual images, export virtual images, take snapshots, etc.:

Finding a VM
Get-VM, Choose-VM , Get-VMHost

Connecting to a VM

Discovering and manipulating Machine states
Get-VMState , Set-VMState , Convert-VmState, 
Ping-VM , Test-VMHeartBeat, Shutdown-VM , Start-VM, Stop-VM, Suspend-VM
Get-VMKVP, Add-KVP, Remove-KVP, Get-VMJPEG

Backing up, exporting and snapshotting VMs
Export-VM , Import-VM, Get-VMSnapshot, Choose-VMSnapshot , Apply-VMSnapshot , New-VMSnapshot ,Remove-VMSnapshot, Rename-VMSnapShot, Update-VMSnapshot, Get-VMSnapshotTree, Get-VmBackupScript

Adding and removing VMs, configuring motherboard settings.
New-VM , Remove-VM , Set-VM , Get-VMCPUCount, Set-VMCPUCount, Get-VMMemory, Set-VMMemory, Set-VMSerialPort

Manipulating Disk controllers, drives and disk images
Add-VMSCSIController , Remove-VMSCSIcontroller
Get-VMDriveByController , Add-VMDRIVE , Remove-VMdrive
Get-VMDiskByDrive, Add-VMDISK , Set-VMDisk, Get-VMDisk
Get-VMFloppyDisk , Add-VMFloppyDisk

Manipluating Network Interface Cards
Get-VMNic , List-VMNic , Choose-VMNIC, Add-VMNIC, Remove-VMNIC , Set-VMNICAddress , Set-VMNICConnection , Get-VMNicport , 
Get-VMnicSwitch, Choose-VMSwitch, New-VMSwitchPort, Get-VMByMACaddress, Choose-VMExternalEthernet,
New-VMExternalSwitch, New-VMInternalSwitch,New-VmPrivateSwitch

Working with VHD files
Get-VHDDefaultPath, Get-VHDInfo, New-VHD, Compact-VHD, Test-VHD,Convert-VHD,Merge-VHD,Mount-VHD, Unmount-VHD

Exporting a virtual machine VHD file to my Macbook

It would be great to be able to store a backup of a virtual machine running in Hyper-V on my Macbook. Then it will be able to run this VHD in Mac Fusion or I can import it in another Hyper-V core machine.

First I needed to do the export job:

PS C:\> export-vm VM c:\ -CopyState -Force

This created the VHD in the C:\ directory. -CopyState is required to copy the VHD to C:\

To see the progess type (please note that the InstanceID is between '':

PS C:\> Test-wmiJob '\\MS_HYPER-V\root\virtualization:Msvm_ConcreteJob.InstanceID="91321CDB-9AF7-49AF-BB08-E08EAB03BC11"'

When ready, it is time to get the file on the Macbook. To do this I shared a drive in MacosX with SMB and added the user that has access to the Hyper-V core. Done!

Happy computing!

Server Shortcuts that are handy

Search with CMD for a file

dir /s \. |find "text"


Find computerdetails on LAN from PowerShell

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName HP380

Find responsetimes from websites:

"","localhost","" | ForEach-Object -Process {Get-WmiObject -Class Win32_PingStatus -Filter ("Address='" + $_ + "'") -ComputerName .} | Select-Object -Property Address,ResponseTime,StatusCode

Find drives attached:


Get-PSDrive | Format-List

How to transfer Blogengine running on SQL2008 to SQL2005

Recently we had to move our Mediazone website, which is build with Blogengine, from SQL 2008 Web Edition to a machine with SQL 2005 Express edition. Since it is not possible to do a backup in SQL 2008 and then import the backup file in SQL 2005, we had to find another solution. To accomplish this task, we did a SQL export using the DTS Wizard utility that is supplied with SQL 2008 Web Edition. We exported from our local database to a SQL 2005 database on our local network. After this step, we made a backup and imported this backup in the SQL 2005 machine. After this, everything worked as planned. There were a few permissions that were not right, but these errors could be corrected easily by allowing null values to be inserted in several columns in the Blogengine database.

The steps:

Start dtswizard. you can use run or cmd to start the application

The SQL Import and Export Wizard starts:

Select the source for the the transfer. Select the database on the 2008 server:

Select the destination for the data. In our case it is a SQL 2005 Express database on our local network:


After this step, you can select all the tables you wish to transfer from the SQL 2008 to the SQL 2005 database. In our case we select all tables:


Please note that the SQL user account that connects to the SQL 2005 database needs full permissions (we give this user temporary database owner priviledges):

Also turn Windows Firewall temporary off:


After these steps it is time to do the export from SQL 2005 to SQL 2008:

If everything goes as planned, you will see the following screen:


Now turn on the firewall again and remove the 'owner' priviledges from the user that connects to the database. You now migrated a SQL 2008 database to a SQL 2005 database.

How to 'save for web' multiple images in Photoshop

Imagine you have hundreds om images in a folder that are all in hi-resolution and you want these images to be saved for the Internet. In Photoshop you use the "safe for web" feature that enables you to get the smallest size of an image in combination with the highest image quality. To process multiple images you need to execute a script. The source for this script was available in the Adobe Exchange forum, but somehow Adobe decided to remove this important post (or it is very difficult to find). So that is why you can download this handy 'save for web' script here:

saveforweb.jsx (2,49 kb)

You can execute the script in Photoshop by selecting: File - Scripts - Browse: Enjoy

Webshop developed by Mediazone nominated for the Thuiswinkel Award!! is a webshop developed by us in 2007. This webshop with more then 2000 products was completely customized to the needs of Lief! This means Lief! is capable of running this webshop with only 2 full time employees. Now, almost 3 year later, this webshop is competing for the dutch award of the year: Thuiswinkel Award.

To nominate for go to this page and klik on the button in the category "Baby & Kindermode":


PC shortcut keys in Bootcamp, running Windows Server 2008 R2 on a Macbook (with small keyboard)

PC key commands

Today I tried to make a screengrab of an active window in Windows Server 2008 R2, running on a Macbook Pro under Bootcamp. Since the keyboard of the Macbook Pro has no "Print Screen" button and lacks the F13 button, I did some research to find out help is provided by the Bootcamp help files.

It turned out that a simple fn-alt-shift-F11 did the trick. After pressing these keys the screengrab is available in your clipboard and you can paste it in for example Paint (Program files - Accessoiries - Paint).

The following table tells you how to type PC key commands on Apple external and built-in keyboards. For details, see:

PC key command

Apple external keyboard

Built-in Mac keyboard/Apple Wireless Keyboard


Control-Option-Fwd Delete (1)












Fwd Delete (1)






(numeric keypad)


(with some built-in keyboards only) (2)


Fn-Enter or Help


Num lock


(with some built-in keyboards only) (2)




Print Screen



Print active window









(1) Use the Delete key above the navigation keys.
(2) Some Mac portable computers have a group of keys with small numbers on them that can be used as a numeric keypad. To use these keys as a keypad, press the Num Lock (F6) key to engage Num Lock, or hold down the Fn key while you press the keys in the keypad.

How to solve the RPC server unavailable in Windows 2008 Hyper-V Server R2 core

Hyper-V Server contains only the Windows Hypervisor, Windows Server driver model and virtualization components. It is therefore that it is quite a job to get Hyper-V core to work without errors since the firewall options that you are able to configure in hyper-v core are not enough to allow remote management of your Hyper-V virtual machines. I had this problem when I was running the Hyper-V core not under Active Directory but as a Workgroup. Some of my sites are now running in this vitual testlandscape, and they are running very good.

One of the problems that did take some time to figure out, was the Windows Firewall running on the Hyper-V box. You have to take notice that configuring Hyper-V Firewall through the normal Hyper-V core is not enough. You have to connect to the hyper-v core remotely and then use MMC on the computer you are connecting from. In MMC you add a snap-in for Windows Firewall. Instead of managing the local firewall, you can also manage remote firewall's. Now open a connection to the hyper-V server and add the firewall of that server to your local MMC. Now you are able to configure the firewall of the Hyper-V core.

To solve the problem with the "RPC server unavailable" I had to open network discovery in Windows Firewall. After setting these options, I was able to connect to remote Hyper-V virtual machines without any problem. If you have this error too, try shutting down the firewall in the Hyper-V server core completely (CMD in hyper-v core: netsh firewall set opmode disable“). Then try to connect remotely to this Hyper-V core. Are you able to connect, then you know you have to tweak the firewall settings in Windows Firewall of the Hyper-V core machine that hosts your virtual machines.

The problem I faced when trying to connect to a hyper-v core in my network:

Turning of the firewall in the Hyper-V core solved the problem. So I needed to tweak the firewall settings of this core server remotely.

Start MMC on your local compu:

Loading the remore Windows Firewall of the Hyper-V core in your local running MMC:

The solution is to tweak the Windows Firewall (enable network directory as in the picture) of the Hyper-V core:

After these steps, you will be able to access your Hyper-V core remotely.

Facebook integration in website

Yesterday I got an e-mail from Zaneta from Boys Essentials. Zaneta is very active on social media sites like Facebook. It would be nice if Facebook would be integrated in here website. Currently I am looking into the possibilities. One possibility is that she takes a look at Microsoft Livewriter:

This software is capable of posting at once to social media sites likte Twitter and Facebook with the xPollinate plugin. Furthermore, - and this is a big advantage of Windows Live Writer -, it supports posting to (the customized blog that will run on here website in the near future).

xPollinate is a Windows Live Writer plugin that enables you to cross post your blog entries to other blogs, as well as social networking sites like Twitter and Facebook via Ping.FM. Use it to reach more audiences, or even to create backups of your blog posts.

With xPollinate, you can cross post full or summarized versions of your entries to any other blogs you have configured in Live Writer. You can also use it to post announcements and full or summarized blog posts to your favorite social networking services such as Twitter, Facebook, MySpace, etc via Ping.FM.

I also looked at Adobe Contribute 4. This software is designed basically around the account and misses therefore the possibility to integrate with Facebook and like Windows Live Writer does.