<?xml version="1.0" encoding="UTF-8"?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:thr="http://purl.org/syndication/thread/1.0"
	xml:lang="en-US"
	xml:base="http://www.lybecker.com/blog/wp-atom.php"
	>
	<title type="text">Anders Lybecker&#039;s Weblog!</title>
	<subtitle type="text">My software development adventures…</subtitle>

	<updated>2018-08-27T07:57:35Z</updated>

	<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog" />
	<id>http://www.lybecker.com/blog/feed/atom/</id>
	<link rel="self" type="application/atom+xml" href="http://www.lybecker.com/blog/feed/atom/" />

	
	<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Supporting IPv4 and IPv6 dual mode network with one socket]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2018/08/23/supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket" />

		<id>http://www.lybecker.com/blog/?p=1463</id>
		<updated>2018-08-27T07:57:35Z</updated>
		<published>2018-08-23T17:54:05Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term=".Net Core" /><category scheme="http://www.lybecker.com/blog" term=".Net Standard" /><category scheme="http://www.lybecker.com/blog" term="IPv4" /><category scheme="http://www.lybecker.com/blog" term="IPv6" /><category scheme="http://www.lybecker.com/blog" term="networking" /><category scheme="http://www.lybecker.com/blog" term="Socket" />
		<summary type="html"><![CDATA[IP version 6 has not become the de facto standard yet, even though we are close to have exhausted all IPv4 addresses. I set out to learn more about IPv6 and how to support both protocols when building a network solution. It was fueled by lack of understanding and some issues I ran into when [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2018/08/23/supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket"><![CDATA[<p>IP version 6 has not become the de facto standard yet, even though we are close to have exhausted all IPv4 addresses. I set out to learn more about IPv6 and how to support both protocols when building a network solution. It was fueled by lack of understanding and some issues I ran into when using DotNetty to build a protocol translation gateway. I ran into error messages like:</p>
<pre>System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used. Error Code: 10047</pre>
<p>Which means that I have specified one type of protocol but are using another. So why not figure out how to create an IPv4 and IPv6 agnostic solution? Which I did.</p>
<p>Initially the problem I ran into was caused by the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.dns.gethostaddressesasync">Dns.GetHostAddressesAsync</a> method, as it resolves a DNS name to possible multiple IP addresses (e.g. IPv4 and IPv6), but which one should the system choose? With this protocol agnostic solution, it doesn’t matter.</p>
<p>As the BCL (Base Class Library) is not designed to support more than one protocol at the time, it looks at bit clunky when IPv4 addresses are imitating IPv6 adresses, but it works. IPv4 will appear like ::ffff:127.0.0.1, so you will have to use properties and methods like <a href="https://docs.microsoft.com/da-dk/dotnet/api/system.net.ipaddress.isipv4mappedtoipv6">IsIPv4MappedToIPv6</a> and <a href="https://docs.microsoft.com/da-dk/dotnet/api/system.net.ipaddress.maptoipv4">MapToIPv4</a>.</p>
<p>First you need to specify IPv6 as the protocol via AddressFamily.InterNetworkV6 and then set <a href="https://docs.microsoft.com/da-dk/dotnet/api/system.net.sockets.socket.dualmode">DualMode</a> to true, which in effect sets SocketOptionName.IPv6Only to false.</p>
<pre class="brush: csharp; gutter: false; title: ; notranslate">
// TCP Server
var listener = new TcpListener(new IPEndPoint(IPAddress.IPv6Any, 8080));
listener.Server.DualMode = true;
listener.Start();
</pre>
<pre class="brush: csharp; gutter: false; title: ; notranslate">
// TCP Client
var client = new TcpClient(AddressFamily.InterNetworkV6);
client.Client.DualMode = true;
await client.ConnectAsync(&quot;127.0.0.1&quot;, port: 8080);
</pre>
<pre class="brush: csharp; gutter: false; title: ; notranslate">
// UDP Server
var listener = new UdpClient(AddressFamily.InterNetworkV6);
listener.Client.DualMode = true;
listener.Client.Bind(new IPEndPoint(IPAddress.IPv6Any, 8080));
</pre>
<pre class="brush: csharp; gutter: false; title: ; notranslate">
// UDP Client
var client = new UdpClient(AddressFamily.InterNetworkV6);
client.Client.DualMode = true;
client.Connect(&quot;127.0.0.1&quot;, port : 8080);
</pre>
<p>For simplicity I used TcpListener, TcpClient and UdbClient event for the UDP server. I set the DualMode property on the underlying Socket via the client.Client property. The server will open a dual Socket and the client will open either an IPv4 or IPv6 depending on the address given.</p>
<p>Full code samples for both TCP and UDP can be found at my <a href="https://github.com/Lybecker/DotNetCore-DualNetwork-IPv4IPv6/">DotNetCore-DualNetwork-IPv4IPv6 GitHub repo</a>.</p>
<p>During my investigations, I discovered that depending on the Socket class constructor used, the DualMode property was set to true or false. The <a href="https://docs.microsoft.com/da-dk/dotnet/api/system.net.sockets.socket.-ctor">Socket(SocketType, ProtocolType)</a> constructor defaulted the DualMode to true, but all others to false. None of the TcpListener, TcpClient or UdbClient instanciates a Socket with DualModel true.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2018/08/23/supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2018/08/23/supporting-ipv4-and-ipv6-dual-mode-network-with-one-socket/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Security nightmare &#8211; It is time to update all your device]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2017/10/19/security-nightmare-it-is-time-to-update-all-your-device/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=security-nightmare-it-is-time-to-update-all-your-device" />

		<id>http://www.lybecker.com/blog/?p=1445</id>
		<updated>2017-10-19T08:49:00Z</updated>
		<published>2017-10-19T08:49:00Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Security" /><category scheme="http://www.lybecker.com/blog" term="IoT" /><category scheme="http://www.lybecker.com/blog" term="ROCA" /><category scheme="http://www.lybecker.com/blog" term="RSA" /><category scheme="http://www.lybecker.com/blog" term="TPM" /><category scheme="http://www.lybecker.com/blog" term="WiFi" /><category scheme="http://www.lybecker.com/blog" term="WPA2" />
		<summary type="html"><![CDATA[What a week &#8211; security wise. Many vulnerabilities have been uncovered. You are most likely affected by one or more of these. Read on and start updating all your devices. Wi-Fi WPA2 vulnerability Years ago, we all moved our Wi-Fi to WPA security protocol as WEP was deemed unsecure. Now vulnerability is found in WPA1/2 [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2017/10/19/security-nightmare-it-is-time-to-update-all-your-device/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=security-nightmare-it-is-time-to-update-all-your-device"><![CDATA[<p>What a week &#8211; security wise. Many vulnerabilities have been uncovered. You are most likely affected by one or more of these. Read on and start updating all your devices.</p>
<h1>Wi-Fi WPA2 vulnerability</h1>
<p><img loading="lazy" class="alignright size-medium wp-image-1451" src="http://www.lybecker.com/blog/wp-content/uploads/2017/10/wifihacked-300x226.jpg" alt="" width="300" height="226" srcset="http://www.lybecker.com/blog/wp-content/uploads/2017/10/wifihacked-300x226.jpg 300w, http://www.lybecker.com/blog/wp-content/uploads/2017/10/wifihacked.jpg 525w" sizes="(max-width: 300px) 100vw, 300px" />Years ago, we all moved our Wi-Fi to WPA security protocol as WEP was deemed unsecure. Now vulnerability is found in WPA1/2 too, making it possible for malicious attackers to inspect and modify the tracking between computer and access point.</p>
<p>The vulnerability is known as KRACK (Key Reinstallation Attacks) and are in the Wi-Fi standard, so all devices are affected – laptops, access points, printers, phones… anything with Wi-Fi. The vulnerability is at client side, but many access points acts are repeaters etc., so do patch all Wi-Fi devices, otherwise the communication might be compromised.</p>
<p>Bleeping Computers are keeping a <a href="https://www.bleepingcomputer.com/news/security/list-of-firmware-and-driver-updates-for-krack-wpa2-vulnerability/">list of affected devices</a> and firmware and driver updates to mitigate the problem.</p>
<p><a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-13080">Microsoft fixed the issue on October 10th</a> and rolled out the update on Patch Tuesday, so if you are keeping your device up-to-date, then you are all safe. Apple has not yet released a patch.</p>
<p><iframe src="https://www.youtube.com/embed/Oh4WURZoR98" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p><a href="https://www.krackattacks.com/">Read more about KRACK</a>.</p>
<h1>RSA key generation vulnerability</h1>
<p>It does not sound intimidating, but this is a major vulnerability affecting Google Chromebooks, HP, Lenovo and Fujitsu PCs and laptops, SmartCards, routers, IoT devices – all devices that has a hardware secure chip (like TPM) from Infineon Technologies produced since 2012.</p>
<p>RSA keys are used to securely store secrets such as passwords, encrypt data (e.g. BitLocker) and generate certificate keys used in secure communication and sender/receiver attestation. It also affects <a href="https://arstechnica.com/information-technology/2017/10/crypto-failure-cripples-millions-of-high-security-keys-750k-estonian-ids/">digital ID’s such as those used by the Estonian government</a>, based on SmartCard technology.</p>
<p>The RSA generated prime numbers are not truly random, making it possible to crack the private key via the public key. Depending on the size of the RSA key, they estimate it takes:</p>
<ul>
<li>512-bit RSA keys &#8211; 2 CPU hours (the cost of $0.06)</li>
<li>1024-bit RSA keys &#8211; 97 CPU days (the cost of $40-$80)</li>
<li>2048-bit RSA keys &#8211; 140.8 CPU years, (the cost of $20,000 &#8211; $40,000)</li>
</ul>
<p>Based on an Intel E5-2650 v3@3GHz Q2/2014. 97 CPU days are nothing, as the crack can run in parallel and compute resources have become cheap with all the Cloud offerings.</p>
<p>To mitigate the ROCA security vulnerability requires firmware upgrades of the hardware secure chip. <a href="https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-13080">Microsoft</a> (Windows 7+) and <a href="https://sites.google.com/a/chromium.org/dev/chromium-os/tpm_firmware_update">Google</a> and <a href="https://char.gd/blog/2017/wifi-has-been-broken-heres-the-companies-that-have-already-fixed-it">others</a> has released patches.</p>
<p>Read more about the ROCA <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-15361">CVE-2017-15361</a> vulnerability.</p>
<h1>Securing my devices</h1>
<p>It is time to update all my devices, but it is going to take time.</p>
<p>This is the list of devices I need to update: 5 Laptops, 1 Chromebook, 1 Xbox One, 1 Windows tablet, 2 iPads, 2 iPhones, 1 Android, 1 Windows Phone, 1 Ubiquity Access Point, 1 Sagemcom router (Owned by the ISP), 1 Amazon Echo, 1 Samsung TV, 1 Panasonic TV and countless IoT devices</p>
<p>Who am I kidding. Some of my devices are old (like my TVs), so the manufacturer will properly never release a patch.</p>
<p><img loading="lazy" class="size-full wp-image-1450 aligncenter" src="http://www.lybecker.com/blog/wp-content/uploads/2017/10/WPA2-vulnerability.jpg" alt="" width="650" height="608" srcset="http://www.lybecker.com/blog/wp-content/uploads/2017/10/WPA2-vulnerability.jpg 650w, http://www.lybecker.com/blog/wp-content/uploads/2017/10/WPA2-vulnerability-300x281.jpg 300w, http://www.lybecker.com/blog/wp-content/uploads/2017/10/WPA2-vulnerability-624x584.jpg 624w" sizes="(max-width: 650px) 100vw, 650px" /></p>
<p>Like it is not worrisome enough, then a <a href="https://thehackernews.com/2017/10/linux-privilege-escalation.html">privilege-escalation vulnerability in Linux kernel </a>was also discovered. This means even more stuff to update.</p>
<p>&nbsp;</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2017/10/19/security-nightmare-it-is-time-to-update-all-your-device/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=security-nightmare-it-is-time-to-update-all-your-device#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2017/10/19/security-nightmare-it-is-time-to-update-all-your-device/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Installing Windows with Secure Boot from USB drive]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2017/07/18/installing-windows-with-secure-boot-from-usb-drive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-windows-with-secure-boot-from-usb-drive" />

		<id>http://www.lybecker.com/blog/?p=1434</id>
		<updated>2018-08-24T08:26:28Z</updated>
		<published>2017-07-18T12:58:01Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="BIOS" /><category scheme="http://www.lybecker.com/blog" term="BitLocker" /><category scheme="http://www.lybecker.com/blog" term="Secure Boot" /><category scheme="http://www.lybecker.com/blog" term="UEFI" /><category scheme="http://www.lybecker.com/blog" term="Windows 10" />
		<summary type="html"><![CDATA[Once and a while I reinstall my machine. It feels nice with a clean slate as I tend to install all kinds of applications that pollutes my machine. A newly installed machine just runs better somehow. My machine needs to be secure, so Secure Boot and encrypted drive via BitLocker is a must. It limits [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2017/07/18/installing-windows-with-secure-boot-from-usb-drive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-windows-with-secure-boot-from-usb-drive"><![CDATA[<p>Once and a while I reinstall my machine. It feels nice with a clean slate as I tend to install all kinds of applications that pollutes my machine. A newly installed machine just runs better somehow.</p>
<p>My machine needs to be secure, so Secure Boot and encrypted drive via BitLocker is a must. It limits the risk of someone messing with my machine and stealing my data.</p>
<p>Here is how to create a bootable USB that works with Secure Boot enabled:</p>
<ol>
<li>Download 64-bit Windows ISO file and <a href="http://rufus.akeo.ie/">download Rufus</a>, a portable utility to create bootable USB drives.</li>
<li>Connect a 4+ GB USB drive. The data on the drive will be deleted, so make sure to backup the content.</li>
<li>Run Rufus and accept the UAC prompt to launch the tool.</li>
<li>Select the USB drive that you want to make bootable, select <em>GTP partition scheme for UEFI</em>, <em>FAT32</em> and select the Windows ISO image.<img loading="lazy" class="alignnone size-full wp-image-1435" src="http://www.lybecker.com/blog/wp-content/uploads/2017/07/Rufus.png" alt="" width="365" height="518" srcset="http://www.lybecker.com/blog/wp-content/uploads/2017/07/Rufus.png 365w, http://www.lybecker.com/blog/wp-content/uploads/2017/07/Rufus-211x300.png 211w" sizes="(max-width: 365px) 100vw, 365px" /></li>
</ol>
<p>Do remember to enable Secure Boot in the BIOS settings and set it in setup mode/clear the keys.</p>
<p>GTP (GUID Partition Table) is a replacement form MBR partitioning allowing for larger disk sizes which requires a 64-bit OS. <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/dn640535%28v=vs.85%29.aspx">Read more</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2017/07/18/installing-windows-with-secure-boot-from-usb-drive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-windows-with-secure-boot-from-usb-drive#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2017/07/18/installing-windows-with-secure-boot-from-usb-drive/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Composing your own Windows Container with a Dockerfile]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2016/09/02/composing-your-own-windows-container-with-a-dockerfile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=composing-your-own-windows-container-with-a-dockerfile" />

		<id>http://www.lybecker.com/blog/?p=1396</id>
		<updated>2016-09-02T07:48:45Z</updated>
		<published>2016-09-02T07:48:45Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Cloud" /><category scheme="http://www.lybecker.com/blog" term="Containerization" /><category scheme="http://www.lybecker.com/blog" term="Docker" /><category scheme="http://www.lybecker.com/blog" term="MicroServices" /><category scheme="http://www.lybecker.com/blog" term="Windows Container" />
		<summary type="html"><![CDATA[In the previous blog post Getting Started with Windows Containers I showed how to run containers and pull existing containers from the public repository Docker Hub. Now it is time to create a new image and add it to Docker Hub. I wanted to create a Hello World image that works on Windows Containers. I [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2016/09/02/composing-your-own-windows-container-with-a-dockerfile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=composing-your-own-windows-container-with-a-dockerfile"><![CDATA[<p>In the previous blog post <a href="/blog/2016/08/31/getting-started-with-windows-containers/">Getting Started with Windows Containers </a>I showed how to run containers and pull existing containers from the public repository <a href="https://hub.docker.com/">Docker Hub</a>. Now it is time to create a new image and add it to Docker Hub.</p>
<p>I wanted to create a Hello World image that works on Windows Containers. I chose to create the Hello-World program using .NET Core – it runs cross platform (Linux, Mac &amp; Windows), but I’m using Windows.</p>
<p>On the Windows Server 2016 container host I created in the previous blog post, I needed to install .NET Core. You can either go to <a href="http://dot.net/core">http://dot.net/core </a>to download or execute the following PowerShell to download the installer.</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Invoke-WebRequest https://go.microsoft.com/fwlink/?LinkID=809122 -OutFile c:\dotnetinstall.exe
</pre>
<p>I created a folder called HelloWorld and executed the following commands in a command prompt:</p>
<pre class="brush: plain; gutter: false; highlight: [1,3,8,19]; title: ; notranslate">
PS C:\Users\aly\Desktop\HelloWorld&gt; dotnet new
Created new C# project in C:\Users\aly\Desktop\HelloWorld.
PS C:\Users\aly\Desktop\HelloWorld&gt; dotnet restore
log : Restoring packages for C:\Users\aly\Desktop\HelloWorld\project.json...
log : Writing lock file to disk. Path: C:\Users\aly\Desktop\HelloWorld\project.lock.json
log : C:\Users\aly\Desktop\HelloWorld\project.json
log : Restore completed in 1049ms.
PS C:\Users\aly\Desktop\HelloWorld&gt; dotnet run
Project HelloWorld (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling HelloWorld for .NETCoreApp,Version=v1.0

Compilation succeeded.
0 Warning(s)
0 Error(s)

Time elapsed 00:00:01.8161040

Hello World!
PS C:\Users\aly\Desktop\HelloWorld&gt; dotnet publish
Publishing HelloWorld for .NETCoreApp,Version=v1.0
Project HelloWorld (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
publish: Published to C:\Users\aly\Desktop\HelloWorld\bin\Debug\netcoreapp1.0\publish
Published 1/1 projects successfully
PS C:\Users\aly\Desktop\HelloWorld&gt;
</pre>
<p>You can use any executable, I just needed something simple to work with. .NET Core is my simple choice.<br />
I am going to base my image on the microsoft/windowsservercore image. But instead of installing .NET Core myself, I can use an image that already has .NET Core installed called microsoft/dotnet:windowsservercore. See all the official Microsoft Docker images at the <a href="https://hub.docker.com/r/microsoft/">Microsoft Docker Hub repository</a>. So pull down the microsoft/dotnet:windowsservercore image</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
docker pull microsoft/dotnet:windowsservercore
</pre>
<p>If you want to play with it run the following command to start a container and a command prompt will appear. Type exit when you want to go back to the container host.</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
docker run -it microsoft/dotnet:windowsservercore
</pre>
<p>Now let’s create the Hello World image. Create a file called Dockerfile without extension outside the /HelloWorld folder and add this:</p>
<pre class="brush: plain; title: ; notranslate">
FROM microsoft/dotnet:windowsservercore
MAINTAINER Anders Lybecker (@Lybecker)
ADD /helloworld/bin/Debug/netcoreapp1.0/publish/ c:\\code
ENTRYPOINT dotnet c:\\code\\helloworld.dll
</pre>
<p>Line 1 dictates that I’m basing the Hello World image on the official image microsoft/dotnet:windowsservercore<br />
Line 2 is just maintainer information and is optional<br />
Line 3 adds the content of the publish folder of the container host to the image in c:\code<br />
Line 4 sets the default command to execute the Hello World program</p>
<p>For more details see the <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile reference</a>.</p>
<p>Build the container by executing the docker build command. The image is named myhelloword and tagged with v1 for version 1. The last . specifies where the Dockerfile is located.</p>
<pre class="brush: plain; gutter: false; highlight: [1]; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker build -t myhelloworld:v1 .
Sending build context to Docker daemon 341.5 kB
Step 1 : FROM microsoft/dotnet:windowsservercore
---&gt; 1e21a0790e96
Step 2 : MAINTAINER Anders Lybecker (@Lybecker)
---&gt; Running in 6812a0ecf67d
---&gt; 5dce994e32a4
Removing intermediate container 6812a0ecf67d
Step 3 : ADD /helloworld/bin/Debug/netcoreapp1.0/publish/ c:\\code
---&gt; 22fade758f23
Removing intermediate container 665f9e677611
Step 4 : ENTRYPOINT dotnet c:\\code\\helloworld.dll
---&gt; Running in dad461888c4c
---&gt; 204ed6ed0b59
Removing intermediate container dad461888c4c
Successfully built 204ed6ed0b59
</pre>
<p>That’s it. You have now created your own image. Let’s try to run it</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker run myhelloworld:v1
Hello World!
</pre>
<p>You can see the image in the local image repository with the docker images command.</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker images
REPOSITORY                  TAG               IMAGE ID     CREATED        SIZE
myhelloworld                v1                204ed6ed0b59 10 minutes ago 8.111 GB
microsoft/dotnet            windowsservercore 1e21a0790e96 2 weeks ago    8.111 GB
microsoft/windowsservercore 10.0.14300.1030   02cb7f65d61b 10 weeks ago   7.764 GB
microsoft/windowsservercore latest            02cb7f65d61b 10 weeks ago   7.764 GB
</pre>
<p>The myhelloworld:v1 image is based on the microsoft/dotnet:windowsservercore which is based om microsoft/windowsservercore:10.0.14300.1030. You can see all the layers via the docker history command</p>
<pre class="brush: plain; gutter: false; highlight: [1]; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker history myhelloworld:v1
IMAGE CREATED CREATED BY SIZE COMMENT
204ed6ed0b59 12 minutes ago cmd /S /C #(nop) ENTRYPOINT [&quot;cmd&quot; &quot;/S&quot; &quot;/C&quot; 46.58 kB
22fade758f23 12 minutes ago cmd /S /C #(nop) ADD dir:4bef0fa9bcfacdaa9bb8 40.96 kB
5dce994e32a4 12 minutes ago cmd /S /C #(nop) MAINTAINER Anders Lybecker 181.2 MB
1e21a0790e96 2 weeks ago cmd /S /C mkdir warmup &amp;amp;&amp;amp; cd warmup &amp;amp; 40.96 kB
2 weeks ago cmd /S /C #(nop) ENV NUGET_XMLDOC_MODE=skip 4.756 MB
2 weeks ago cmd /S /C setx /M PATH &quot;%PATH%;%ProgramFiles% 160.7 MB
2 weeks ago cmd /S /C powershell -NoProfile -Command 40.96 kB
2 weeks ago cmd /S /C #(nop) ENV DOTNET_SDK_DOWNLOAD_URL 40.96 kB
2 weeks ago cmd /S /C #(nop) ENV DOTNET_SDK_VERSION=1.0. 7.764 GB
</pre>
<p>I have made my Hello World image available on <a href="https://hub.docker.com/r/anderslybecker/">Docker Hub</a>, so you can pull and run the image on your Windows Container host like so:</p>
<pre class="brush: plain; gutter: false; highlight: [1,5]; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker pull anderslybecker/dotnet-hello-world:windowsservercore
windowsservercore: Pulling from anderslybecker/dotnet-hello-world
Digest: sha256:1df17a8a38d969b71b38333be25f76757e69f1537c7a86a6ee966bca87163464
Status: Image is up to date for anderslybecker/dotnet-hello-world:windowsservercore
PS C:\Users\aly\Desktop&gt; docker run anderslybecker/dotnet-hello-world:windowsservercore
Hello World!
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2016/09/02/composing-your-own-windows-container-with-a-dockerfile/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=composing-your-own-windows-container-with-a-dockerfile#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2016/09/02/composing-your-own-windows-container-with-a-dockerfile/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Getting started with Windows Containers]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2016/08/31/getting-started-with-windows-containers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-windows-containers" />

		<id>http://www.lybecker.com/blog/?p=1386</id>
		<updated>2016-08-31T10:06:34Z</updated>
		<published>2016-08-31T10:01:23Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Containerization" /><category scheme="http://www.lybecker.com/blog" term="Windows Azure" /><category scheme="http://www.lybecker.com/blog" term="Cloud" /><category scheme="http://www.lybecker.com/blog" term="Docker" /><category scheme="http://www.lybecker.com/blog" term="MicroServices" /><category scheme="http://www.lybecker.com/blog" term="Windows Container" />
		<summary type="html"><![CDATA[Soon Windows Server 2016 will be released and so will the Docker Engine compatible Windows Containers feature. Here is a tutorial for you to get started with Windows Containers. One thing to be aware of when working with containers is that the underlying host must be of the same type of operating system as the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2016/08/31/getting-started-with-windows-containers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-windows-containers"><![CDATA[<p>Soon Windows Server 2016 will be released and so will the Docker Engine compatible Windows Containers feature. Here is a tutorial for you to get started with Windows Containers.</p>
<p>One thing to be aware of when working with containers is that the underlying host must be of the same type of operating system as the container running on the host. Linux containers on Linux hosts and Windows containers on Windows hosts.</p>
<p>First a container host is needed – you can use <a href="https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_10">Windows 10 Anniversary Update</a> or a Windows Server 2016.</p>
<p>The easiest way of getting started is to spin up a Windows Server 2016 on Azure (get a <a href="https://azure.microsoft.com/en-us/free/">free trial</a>) with the Container feature enabled.</p>
<ol>
<li>Select new</li>
<li>Type “container” to filter only for container images</li>
<li>Select the “Windows Server 2016 with Containers” equivalent (as of writing Tech Preview 5)<img loading="lazy" class="alignnone size-large wp-image-1387" src="http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container-1024x496.png" alt="CreateWindowsServer2016Container" width="625" height="303" srcset="http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container-1024x496.png 1024w, http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container-300x145.png 300w, http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container-768x372.png 768w, http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container-624x302.png 624w, http://www.lybecker.com/blog/wp-content/uploads/2016/08/CreateWindowsServer2016Container.png 1481w" sizes="(max-width: 625px) 100vw, 625px" /></li>
<li>Follow the wizard to specify VM size etc.</li>
</ol>
<p>Alternatively, you can follow <a href="https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quick_start_windows_server">Windows Containers on Windows Server</a> guide to install the Container feature on an existing Windows Server 2016.</p>
<p>Once you have created the host you can connect to the host via RDP (in the Azure portal use the ”Connect” button in the top menu).</p>
<p>Start up a command prompt or the PowerShell. You can use <a href="https://github.com/Microsoft/Docker-PowerShell/">PowerShell for Docker</a> or the Docker CLI to execute Docker commands. The commands are the same across platform &#8211; no matter if you are using Linux or Windows-based containers. I’ll be using the Docker CLI commands. The common commands are:</p>
<ul>
<li>Docker info &#8211; which will show you version etc.</li>
<li>Docker images – shows all the images in the local repository</li>
<li>Docker ps – show all the running containers</li>
<li>Docker ps -a – the -a (or -all) shows all containers including containers that are no longer running</li>
<li>Docker run &#8211; run an instance of an image</li>
</ul>
<p>Let’s get started.</p>
<p>Run the following command to see which images are available in the local repository.</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker images
REPOSITORY                  TAG             IMAGE ID     CREATED      SIZE
microsoft/windowsservercore 10.0.14300.1030 02cb7f65d61b 10 weeks ago 7.764 GB
microsoft/windowsservercore latest          02cb7f65d61b 10 weeks ago 7.764 GB
PS C:\Users\aly\Desktop&gt;
</pre>
<p>On my Windows Server 2016 Tech Preview 5 there are two images both with the name microsoft/windowsservercore with two different tags. Both of them has the same image id, so they are the same image with two different tags.</p>
<p>To start a container of the image tagged with ‘latest’ run the following:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker run microsoft/windowsservercore:latest
Microsoft Windows [Version 10.0.14300]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\&gt;
PS C:\Users\aly\Desktop&gt;
</pre>
<p>The tag is optional, but the default value is ‘latest’.</p>
<p>The container was started and a command prompt appeared, but then it shut down again and it returned to my PowerShell prompt.</p>
<p>If you want to interact with the container, add the -it (interactive) option. You also have the option of specifying which process should be run in the container (cmd is default for this image):</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
docker run -it microsoft/windowsservercore:latest cmd
</pre>
<p>Now a command prompt appears and you are in the context of the container. If you modify a file e.g. adds or deletes a file, then the changes will only apply to the container and not the host.</p>
<p>Create a simple file like this:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
echo &quot;Hello Windows Containers&quot; &gt; hello.txt
</pre>
<p>You can exit the container by typing exit, and the container will terminate. Alternatively, you can press CTRL + P + Q to exit and leave the container running.<br />
If you left the container running, you can see the container by listing the Docker processes:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker ps
CONTAINER ID IMAGE                             COMMAND   CREATED       STATUS    PORTS NAMES
23ca16bb6fdb microsoft/windowsservercore:latest &quot;cmd&quot; 4 minutes ago Up 4 minutes pedantic_lamport
</pre>
<p>If the container was terminated, the -a option needs to be appended.<br />
You can reattach to the container by specifying the container id or name. In my case 23ca16bb6fdb or pedantic_lamport like so:</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
Docker attach 23ca16bb6fdb
</pre>
<p>You only have the Windows Server Core image in the local repository, but you can download others by pulling from Docker Hub.</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
docker pull microsoft/nanoserver
</pre>
<p>Remember that only Windows-based images will run on a Windows host, so if you try the Hello-World Linux-based image, it will fail with a not so elaborate error message.</p>
<pre class="brush: plain; gutter: false; title: ; notranslate">
PS C:\Users\aly\Desktop&gt; docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
c04b14da8d14: Extracting [==================================================&gt;] 974 B/974 B
failed to register layer: re-exec error: exit status 1: output: ProcessBaseLayer C:\ProgramData\docker\winc266a137b0b1fffedf91d8cd6fcb6560f12afe5277e44bca8cb34ec530286: The system cannot find the path specified.
</pre>
<p>For now it is not easy to differentiate between Linux or Windows-based images on Docker Hub. I would have wished for a filter, making it easier to find relevant images.</p>
<p>Microsoft has a public repository of all the <a href="https://hub.docker.com/r/microsoft/">official released Microsoft container images</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2016/08/31/getting-started-with-windows-containers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-windows-containers#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2016/08/31/getting-started-with-windows-containers/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[.NET compiler platform (Roslyn) analyzer packages]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/08/05/dotnet-compiler-platform-roslyn-analyzer-packages/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dotnet-compiler-platform-roslyn-analyzer-packages" />

		<id>http://www.lybecker.com/blog/?p=1362</id>
		<updated>2016-04-27T18:38:13Z</updated>
		<published>2015-08-05T13:39:40Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Everyday coding" /><category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="Roslyn" /><category scheme="http://www.lybecker.com/blog" term="Visual Studio 2015" />
		<summary type="html"><![CDATA[The greatest new feature in Visual Studio 2015 is the .NET compiler platform previously known as Roslyn. The .NET Compiler Platform is an open source compiler for C# and VB with rich code analysis APIs. It enables developers to build code analysis tool like code analyzers, fixes and refactorings. The community has built a number [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/08/05/dotnet-compiler-platform-roslyn-analyzer-packages/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dotnet-compiler-platform-roslyn-analyzer-packages"><![CDATA[<p>The greatest new feature in Visual Studio 2015 is the .NET compiler platform previously known as Roslyn. The .NET Compiler Platform is an open source compiler for C# and VB with rich code analysis APIs. It enables developers to build code analysis tool like code analyzers, fixes and refactorings.</p>
<p>The community has built a number of packages containing great analyzers, fixes and refactorings. These can be installed either as a Visual Studio 2015 Extension or at project level as NuGet packages.</p>
<h2>Refactoring Essentials</h2>
<p><a href="http://vsrefactoringessentials.com/">Refactoring Essentials</a> contains approx. 200 code analyzers, fixes and refactorings<br />
Simple defensive code analyzers like parameter checking.</p>
<p><a href="/blog/wp-content/uploads/Roslyn_CheckDictionaryKeyValueCodeRefactoring.png"><img loading="lazy" class="aligncenter size-full wp-image-1365" src="/blog/wp-content/uploads/Roslyn_CheckDictionaryKeyValueCodeRefactoring.png" alt="Roslyn_CheckDictionaryKeyValueCodeRefactoring" width="493" height="146" /></a></p>
<p>Simplyfing code by converting conditional ternary to null coalescing.</p>
<p><a href="/blog/wp-content/uploads/Roslyn_ConvertConditionalTernaryToNullCoalescingAnalyzer.png"><img loading="lazy" class="aligncenter size-large wp-image-1366" src="/blog/wp-content/uploads/Roslyn_ConvertConditionalTernaryToNullCoalescingAnalyzer-550x174.png" alt="Roslyn_ConvertConditionalTernaryToNullCoalescingAnalyzer" width="550" height="174" /></a></p>
<h2>CSharp Essentials</h2>
<p><a href="https://github.com/DustinCampbell/CSharpEssentials">CSharp Essentials</a> focuses on the new features in C# 6 such as <a href="/blog/2015/01/08/the-nameof-operator/">the nameof operator</a>, <a href="/blog/2015/01/09/awesome-string-formatting/">string interpolation</a>, <a href="/blog/2015/01/15/auto-property-initializers/">auto-properties</a> and <a href="/blog/2015/01/13/expression-bodied-methods/">expression-bodied methods</a>.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_StringInterpolation.jpg"><img loading="lazy" class="aligncenter size-large wp-image-1369" src="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_StringInterpolation-550x156.jpg" alt="Roslyn_StringInterpolation" width="550" height="156" /></a></p>
<h2>Code Cracker</h2>
<p><a href="http://code-cracker.github.io/">Code Cracker</a> is a smaller package for C# and VB with analyzers e.g. for empty catch blocks and if a disposable object is disposed.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_Disposable.png"><img loading="lazy" class="aligncenter size-large wp-image-1367" src="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_Disposable-550x203.png" alt="Roslyn_Disposable" width="550" height="203" /></a></p>
<h2>SonarLint</h2>
<p><a href="http://vs.sonarlint.org/">SonarLint</a> for C# has great analyzers too as Christiaan Rakowski points out in the comments. One of them warns about logical paths that will never be reached or simplified.</p>
<h2><a href="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_conditionalstructure.png"><img loading="lazy" class="aligncenter size-large wp-image-1373" src="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_conditionalstructure-550x123.png" alt="Roslyn_conditionalstructure" width="550" height="123" /></a>Platform Specific Analyzer</h2>
<p>With Windows 10 and the new Universal Windows Platform you as the developer need to make sure that the Windows App does not use an API not supported on the platform you are targeting. This is exactly what the <a href="https://github.com/ljw1004/blog/tree/master/Analyzers/PlatformSpecificAnalyzer">Platform Specific Analyzer</a> package does for both C# and VB.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_PlatformSpecific.png"><img loading="lazy" class="aligncenter size-large wp-image-1368" src="http://www.lybecker.com/blog/wp-content/uploads/Roslyn_PlatformSpecific-550x129.png" alt="Roslyn_PlatformSpecific" width="550" height="129" /></a></p>
<p>If you know any other great packages – let me know.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/08/05/dotnet-compiler-platform-roslyn-analyzer-packages/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dotnet-compiler-platform-roslyn-analyzer-packages#comments" thr:count="9"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/08/05/dotnet-compiler-platform-roslyn-analyzer-packages/feed/atom/" thr:count="9"/>
			<thr:total>9</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[How-to start and stop Azure VMs at a schedule]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/02/25/how-to-start-and-stop-azure-vms-at-a-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-at-a-schedule" />

		<id>http://www.lybecker.com/blog/?p=1331</id>
		<updated>2015-02-25T13:03:51Z</updated>
		<published>2015-02-25T13:03:51Z</published>
		<category scheme="http://www.lybecker.com/blog" term="PowerShell" /><category scheme="http://www.lybecker.com/blog" term="Windows Azure" /><category scheme="http://www.lybecker.com/blog" term="Virtuel Machine" />
		<summary type="html"><![CDATA[I use Azure VMs for dev/test and I do not want them to run all night, as I have to pay for it. Therefore, I stop the VMs at night with a scheduler, as I do not always remember to stop the VMs after use. Azure Automation is the right tool for the job. Azure [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/02/25/how-to-start-and-stop-azure-vms-at-a-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-at-a-schedule"><![CDATA[<p>I use Azure VMs for dev/test and I do not want them to run all night, as I have to pay for it. Therefore, I stop the VMs at night with a scheduler, as I do not always remember to stop the VMs after use.</p>
<p>Azure Automation is the right tool for the job. Azure Automation automates Azure management tasks and orchestrates actions across external systems from within Azure. You need an Azure Automation Account, which is a container for all your runbooks, runbook executions (jobs), and the assets that your runbooks depend on.</p>
<p>To execute runbooks, a set of user credentials needs to be stored as an asset. Create a new user as described in <a href="http://azure.microsoft.com/blog/2014/08/27/azure-automation-authenticating-to-azure-using-azure-active-directory/">Azure Automation: Authenticating to Azure using Azure Active Directory</a>.</p>
<p>Below, see guide on how to create the Azure Automation account and the runbook.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/CreateRunbookStopVM.gif"><img loading="lazy" class="aligncenter wp-image-1332 size-full" src="http://www.lybecker.com/blog/wp-content/uploads/CreateRunbookStopVM.gif" alt="CreateRunbookStopVM" width="974" height="781" /></a></p>
<p>The new Azure Automation account <em>lybAutomation</em> and the runbook <em>Stop Windows Azure Virtual Machines on a Schedule</em> are created from the gallery. The content in the gallery comes from the Azure Script Center. The <a href="http://azure.microsoft.com/en-us/documentation/scripts/">Azure Script Center</a> has many PowerShell scripts covering many scenarios, but not all can be used with Azure Automation, as some scripts use features not available in Azure Automation. You do get a warning if you select one that is not supported, but in my mind, it should not be available in the gallery at all.</p>
<p>It burned me the first time I tried Azure Automation. I used the <em>Stop Windows Azure Virtual Machines on a Schedule</em> from the gallery, but it uses an on-premise scheduler.</p>
<p>You need to store the credentials in the runbook of the user created earlier. See below.<br />
<a href="http://www.lybecker.com/blog/wp-content/uploads/SetupRunBookCredentials.gif"><img loading="lazy" class="aligncenter size-full wp-image-1333" src="http://www.lybecker.com/blog/wp-content/uploads/SetupRunBookCredentials.gif" alt="SetupRunBookCredentials" width="974" height="781" /></a>Then you need to configure the runbook script with the credentials and the Azure subscription where the virtual machines reside. See below.<br />
<a href="http://www.lybecker.com/blog/wp-content/uploads/ConfigureRunbookVmStop.gif"><img loading="lazy" class="aligncenter size-full wp-image-1334" src="http://www.lybecker.com/blog/wp-content/uploads/ConfigureRunbookVmStop.gif" alt="ConfigureRunbookVmStop" width="974" height="781" /></a>You find your subscription name in the top bar “Subscriptions” of the Azure portal.<br />
Now you can test your runbook and all you need is to set up the schedule, so it runs every evening. See guide below.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/ConfigureRunbookSchedule.gif"><img loading="lazy" class="aligncenter size-full wp-image-1335" src="http://www.lybecker.com/blog/wp-content/uploads/ConfigureRunbookSchedule.gif" alt="ConfigureRunbookSchedule" width="974" height="781" /></a></p>
<p>Be aware that the time is in UTC, so you have to correct the time according to your time zone. I expect the scheduler to get an overhaul, as it is too simple right now.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/02/25/how-to-start-and-stop-azure-vms-at-a-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-at-a-schedule#comments" thr:count="8"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/02/25/how-to-start-and-stop-azure-vms-at-a-schedule/feed/atom/" thr:count="8"/>
			<thr:total>8</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Minimizing the cost of dev/test environments in Azure]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/02/25/minimizing-the-cost-of-devtest-environments-in-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minimizing-the-cost-of-devtest-environments-in-azure" />

		<id>http://www.lybecker.com/blog/?p=1340</id>
		<updated>2015-02-25T06:04:58Z</updated>
		<published>2015-02-25T06:04:58Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="Windows Azure" /><category scheme="http://www.lybecker.com/blog" term="Dev/Test" /><category scheme="http://www.lybecker.com/blog" term="MSDN Subscription" />
		<summary type="html"><![CDATA[I use Windows Azure as my dev/test environment because it is fast and convenient to create new virtual machines or services. I use the MSDN Subscription Azure Benefits, which includes free Azure Credits. The Azure Credits cover my dev/test needs even though I use more than a handful of VMs and services. I make smart [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/02/25/minimizing-the-cost-of-devtest-environments-in-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minimizing-the-cost-of-devtest-environments-in-azure"><![CDATA[<p>I use Windows Azure as my dev/test environment because it is fast and convenient to create new virtual machines or services. I use the <a href="http://azure.microsoft.com/en-us/pricing/member-offers/msdn-benefits-details/">MSDN Subscription Azure Benefits</a>, which includes free Azure Credits. The Azure Credits cover my dev/test needs even though I use more than a handful of VMs and services. I make smart use of the free Azure Credits by turning off VMs at night and during weekends, when I am not using them. Which means that I can use 3-4 times more VMs on Azure compared to just letting them run all the time. VMs are costly compared to the PaaS services such as Azure WebSites, SQL Azure and Cloud Services. So the PaaS services are not a cost issue.</p>
<p>I manage the Azure VMs and almost everything with the Server Explorer in Visual Studio. It is a quick way to start VMs in the morning.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/StartStopAzureVmFromVs2013.gif"><img loading="lazy" class=" size-full wp-image-1341 aligncenter" src="http://www.lybecker.com/blog/wp-content/uploads/StartStopAzureVmFromVs2013.gif" alt="StartStopAzureVmFromVs2013" width="469" height="528" /></a></p>
<p>If I have a list of VMs that I need to manage, then I use the Azure PowerShell cmdlets – see my <a href="/blog/2015/02/23/how-to-start-and-stop-azure-vms-via-powershell/">How-to start and stop Azure VMs via PowerShell</a>.</p>
<p>Finally, I use Azure Automation to ensure that I never have a running Azure VM all night, just because I forgot to shut it down &#8211; see <a href="/blog/2015/02/25/how-to-start-and-stop-azure-vms-at-a-schedule/">How-to start and stop Azure VMs at a schedule</a>. It automatically shuts down any VM running in my MSDN Subscription at 6 p.m. If I work later, I can just start the required VMs again – it only take a couple of minutes.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/02/25/minimizing-the-cost-of-devtest-environments-in-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minimizing-the-cost-of-devtest-environments-in-azure#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/02/25/minimizing-the-cost-of-devtest-environments-in-azure/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[How-to start and stop Azure VMs via PowerShell]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/02/23/how-to-start-and-stop-azure-vms-via-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-via-powershell" />

		<id>http://www.lybecker.com/blog/?p=1323</id>
		<updated>2015-02-23T07:02:29Z</updated>
		<published>2015-02-23T07:02:29Z</published>
		<category scheme="http://www.lybecker.com/blog" term="PowerShell" /><category scheme="http://www.lybecker.com/blog" term="Windows Azure" />
		<summary type="html"><![CDATA[With PowerShell it is fast and convenient to manage my development and test servers running on Windows Azure. It is just easier to use command line tools than logging into the Azure management portal shutting down each VM. To set up PowerShell: Install the Azure PowerShell cmdlets Start the Azure PowerShell (do not start the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/02/23/how-to-start-and-stop-azure-vms-via-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-via-powershell"><![CDATA[<p>With PowerShell it is fast and convenient to manage my development and test servers running on Windows Azure. It is just easier to use command line tools than logging into the Azure management portal shutting down each VM. To set up PowerShell:</p>
<ol>
<li>Install the <a href="http://go.microsoft.com/fwlink/p/?linkid=320376&amp;clcid=0x409">Azure PowerShell cmdlets</a></li>
<li>Start the Azure PowerShell (do not start the regular PowerShell as it is not preconfigured with the Azure PowerShell cmdlets)</li>
<li>Authorize Azure PowerShell to access your Azure subscriptions by typing in the Azure PowerShell shell:
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Add-AzureAccount
</pre>
<p>In the sign-in window, provide your Microsoft credentials for the Azure account.</li>
</ol>
<p>If you like me have multiple Azure subscriptions &#8211; change the default subscription with:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Select-AzureSubscription [-SubscriptionName]
</pre>
<p>To start an Azure VM the syntax is:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Start-AzureVM [–Name] [-ServiceName]
</pre>
<p>To start a VM named <em>vs2015</em> in the cloud service <em>lybCloudService</em> requires as little as:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Start-AzureVM vs2015 lybCloudService
</pre>
<p>To stop the VM is just as easy</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Stop-AzureVM [-Name] [-ServiceName]
</pre>
<p>If it is the last running VM in the cloud service, then you will be asked if you want to deallocate the cloud service or not, as the cloud service will release the public IP address. That is not a problem if you access your VM via DNS name – which most people do.<br />
You can override the question by appending <em>–Force</em> like this:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Stop-AzureVM vs2015 lybCloudService –Force
</pre>
<p>There are many useful Azure PowerShell cmdlets to use. To list all Azure PowerShell cmdlets:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Help Azure
</pre>
<p>Get details on Azure PowerShell cmdlet:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Man &lt;cmdlet name&gt;
</pre>
<p>List all VMs:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Get-AzureVM
</pre>
<p>Get details of a specific VM:</p>
<pre class="brush: powershell; gutter: false; title: ; notranslate">
Get-AzureVM [–Name] [-ServiceName]
</pre>
<p>The PowerShell prompt is just like a normal command prompt, so you can use tab completion and F7 to show all executed commands.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/02/23/how-to-start-and-stop-azure-vms-via-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-start-and-stop-azure-vms-via-powershell#comments" thr:count="4"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/02/23/how-to-start-and-stop-azure-vms-via-powershell/feed/atom/" thr:count="4"/>
			<thr:total>4</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Initialize a Dictionary with index initializers]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=initialize-a-dictionary-with-index-initializers" />

		<id>http://www.lybecker.com/blog/?p=1274</id>
		<updated>2015-01-19T08:15:04Z</updated>
		<published>2015-01-19T08:15:04Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks The nameof operator Awesome string formatting Expression-bodied methods Auto-property initializers Initialize a Dictionary with index initializers (this one) A small but still significant feature in C# 6 is index [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=initialize-a-dictionary-with-index-initializers"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li><a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a></li>
<li><a title="The nameof operator blog post by Anders Lybecker" href="/blog/2015/01/08/the-nameof-operator/">The nameof operator</a></li>
<li><a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a></li>
<li><a title="Expression-bodied methods blog post by Anders Lybecker" href="/blog/2015/01/13/expression-bodied-methods/">Expression-bodied methods</a></li>
<li><a title="Auto-property initializers blog post by Anders Lybecker" href="/blog/2015/01/15/auto-property-initializers/">Auto-property initializers</a></li>
<li>Initialize a Dictionary with index initializers (this one)</li>
</ul>
<p>A small but still significant feature in C# 6 is index initializers. Index initializers can be sued to initialize object members, but also dictionaries. Initializing a dictionary has always be cumbersome, but not anymore.</p>
<pre class="brush: csharp; title: ; notranslate">
var numbers = new Dictionary&lt;int, string&gt;
{
  [7] = &quot;seven&quot;,
  [9] = &quot;nine&quot;,
  [13] = &quot;thirteen&quot;
};
</pre>
<p>There are other great new features in C# that I have not touched – have a look at the blog post <a title="New features in C# 6 on MSDN Blogs" href="http://blogs.msdn.com/b/csharpfaq/archive/2014/11/20/new-features-in-c-6.aspx">New features in C# 6</a> by Mads Torgersen, Principal Program Manager, VS Managed Languages.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=initialize-a-dictionary-with-index-initializers#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Auto-property initializers]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/15/auto-property-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=auto-property-initializers" />

		<id>http://www.lybecker.com/blog/?p=1270</id>
		<updated>2015-01-15T08:12:15Z</updated>
		<published>2015-01-15T08:12:15Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks The nameof operator Awesome string formatting Expression-bodied methods Auto-property initializers (this one) Initialize a Dictionary with index initializers At first auto-property initializers does not sound very interesting at all, [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/15/auto-property-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=auto-property-initializers"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li><a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a></li>
<li><a title="The nameof operator blog post by Anders Lybecker" href="/blog/2015/01/08/the-nameof-operator/">The nameof operator</a></li>
<li><a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a></li>
<li><a title="Expression-bodied methods blog post by Anders Lybecker" href="/blog/2015/01/13/expression-bodied-methods/">Expression-bodied methods</a></li>
<li>Auto-property initializers (this one)</li>
<li><a title="Initialize a Dictionary with index initializers blog post by Anders Lybecker" href="/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/">Initialize a Dictionary with index initializers</a></li>
</ul>
<p>At first auto-property initializers does not sound very interesting at all, but wait…</p>
<p>Simple things as setting a default value for a property.</p>
<pre class="brush: csharp; title: ; notranslate">
public class Order
{
  public int OrderNo { get; set; } = 1;
}
</pre>
<p>Or using the getter-only auto-property which are implicit declared <code>readonly</code> and can therefore be set in the constructor.</p>
<pre class="brush: csharp; title: ; notranslate">
public class Order
{
  public Order(int orderNo)
  {
    OrderNo = orderNo;
  }
  
  public int OrderNo { get; }
}
</pre>
<p>From my point of view the value of auto-properties comes to shine when used with list properties where the list has to be initialized.</p>
<pre class="brush: csharp; title: ; notranslate">
public class Order
{
  public IEnumerable&lt;OrderLine&gt; Lines { get; } = new List&lt;OrderLine&gt;();
}
</pre>
<p>I often forget to initialize a list property in the constructor and therefor get a <code>NullReferenceException</code> when accessing the list property. Now I might even be able to omit the constructor all together.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/15/auto-property-initializers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=auto-property-initializers#comments" thr:count="1"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/15/auto-property-initializers/feed/atom/" thr:count="1"/>
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Expression-bodied methods]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/13/expression-bodied-methods/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=expression-bodied-methods" />

		<id>http://www.lybecker.com/blog/?p=1266</id>
		<updated>2015-01-13T07:54:27Z</updated>
		<published>2015-01-13T07:54:27Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks The nameof operator Awesome string formatting Expression-bodied methods (this one) Auto-property initializers Initialize a Dictionary with index initializers Expression-bodied methods make it possible for methods and properties to be [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/13/expression-bodied-methods/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=expression-bodied-methods"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li><a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a></li>
<li><a title="The nameof operator blog post by Anders Lybecker" href="/blog/2015/01/08/the-nameof-operator/">The nameof operator</a></li>
<li><a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a></li>
<li>Expression-bodied methods (this one)</li>
<li><a title="Auto-property initializers blog post by Anders Lybecker" href="/blog/2015/01/15/auto-property-initializers/">Auto-property initializers</a></li>
<li><a title="Initialize a Dictionary with index initializers blog post by Anders Lybecker" href="/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/">Initialize a Dictionary with index initializers</a></li>
</ul>
<p>Expression-bodied methods make it possible for methods and properties to be used as expressions instead of statement blocks, just like lambda functions.</p>
<p>Let’s revisit the <code>Person.ToString</code> method in the <a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a> blog post.</p>
<pre class="brush: csharp; title: ; notranslate">
public class Person
{
  public string Name { get; set; }

  public Address HomeAddress { get; set; }

  public override string ToString()
  {
    return string.Format(&quot;{Name} lives in {HomeAddress?.City ?? &quot;City unknown&quot;}.&quot;);
  }
}
</pre>
<p>The <code>ToString</code> method can be written as a lambda function.</p>
<pre class="brush: csharp; title: Expression-bodied method with String interpolation; notranslate">
public override string ToString() =&gt; string.Format(&quot;{Name} lives in {HomeAddress?.City ?? &quot;City unknown&quot;}.&quot;);
</pre>
<p>And simplified with String interpolation.</p>
<pre class="brush: csharp; title: Expression-bodied method with String interpolation and inferred string.Format; notranslate">
public override string ToString() =&gt; $&quot;{Name} lives in {HomeAddress?.City ?? &quot;City unknown&quot;}.
</pre>
<p>Use expression-bodied methods anywhere…</p>
<pre class="brush: csharp; title: ; notranslate">
public Point Move(int dx, int dy) =&gt; new Point(x + dx, y + dy);
public static Complex operator +(Complex a, Complex b) =&gt; a.Add(b);
public static implicit operator string (Person p) =&gt; &quot;{p.First} {p.Last}&quot;;
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/13/expression-bodied-methods/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=expression-bodied-methods#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/13/expression-bodied-methods/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Awesome string formatting]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/09/awesome-string-formatting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=awesome-string-formatting" />

		<id>http://www.lybecker.com/blog/?p=1262</id>
		<updated>2015-01-09T07:00:26Z</updated>
		<published>2015-01-09T07:00:26Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks The nameof operator Awesome string formatting (this one) Expression-bodied methods Auto-property initializers Initialize a Dictionary with index initializers Using the versatile string.Format required a lot of typing and keeping the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/09/awesome-string-formatting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=awesome-string-formatting"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li><a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a></li>
<li><a title="The nameof operator blog post by Anders Lybecker" href="/blog/2015/01/08/the-nameof-operator/">The nameof operator</a></li>
<li>Awesome string formatting (this one)</li>
<li><a title="Expression-bodied methods blog post by Anders Lybecker" href="/blog/2015/01/13/expression-bodied-methods/">Expression-bodied methods</a></li>
<li><a title="Auto-property initializers blog post by Anders Lybecker" href="/blog/2015/01/15/auto-property-initializers/">Auto-property initializers</a></li>
<li><a title="Initialize a Dictionary with index initializers blog post by Anders Lybecker" href="/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/">Initialize a Dictionary with index initializers</a></li>
</ul>
<p>Using the versatile <code>string.Format</code> required a lot of typing and keeping the numbed placeholders in sync with the method parameters.</p>
<pre class="brush: csharp; title: ; notranslate">
var numerator = 1;
var denominator = 2;

Console.WriteLine(&quot;Fraction {0}/{1}&quot;, numerator, denominator);

// Output:
//   Fraction 1/2
</pre>
<p>In C# 6 is it a lot easier with String interpolation:</p>
<pre class="brush: csharp; highlight: [4]; title: ; notranslate">
var numerator = 1;
var denominator = 2;

Console.WriteLine(&quot;Fraction {numerator}/{denominator}&quot;);

// Output:
//   Fraction 1/2
</pre>
<p>Referencing the variable, property or field directly within the string. It is even possible to access properties or use expressions.</p>
<pre class="brush: csharp; highlight: [8]; title: ; notranslate">
public class Person
{
  public string Name { get; set; }
  public Address HomeAddress { get; set; }

  public override string ToString()
  {
    return string.Format(&quot;{Name} lives in {HomeAddress.City}.&quot;);
  }
}
</pre>
<p>The <code>string.Format</code> is not event needed, but use the shorthand notation $.</p>
<pre class="brush: csharp; title: ; notranslate">
return $(&quot;{Name} lives in {HomeAddress.City}.&quot;;
</pre>
<p>This is easily combinable with an expression and the <a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">null-conditional operator</a> (<strong>?.</strong>) operator.</p>
<pre class="brush: csharp; title: ; notranslate">
return $&quot;{Name} lives in {HomeAddress?.City ?? &quot;City unknown&quot;}.&quot;;
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/09/awesome-string-formatting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=awesome-string-formatting#comments" thr:count="4"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/09/awesome-string-formatting/feed/atom/" thr:count="4"/>
			<thr:total>4</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[The nameof operator]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/08/the-nameof-operator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-nameof-operator" />

		<id>http://www.lybecker.com/blog/?p=1258</id>
		<updated>2015-01-08T07:37:44Z</updated>
		<published>2015-01-08T07:37:44Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks The nameof operator (this one) Awesome string formatting Expression-bodied methods Auto-property initializers Initialize a Dictionary with index initializers The nameof operator takes a class, method, property, field or variable and [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/08/the-nameof-operator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-nameof-operator"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li><a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a></li>
<li>The nameof operator (this one)</li>
<li><a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a></li>
<li><a title="Expression-bodied methods blog post by Anders Lybecker" href="/blog/2015/01/13/expression-bodied-methods/">Expression-bodied methods</a></li>
<li><a title="Auto-property initializers blog post by Anders Lybecker" href="/blog/2015/01/15/auto-property-initializers/">Auto-property initializers</a></li>
<li><a title="Initialize a Dictionary with index initializers blog post by Anders Lybecker" href="/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/">Initialize a Dictionary with index initializers</a></li>
</ul>
<p>The <code>nameof</code> operator takes a class, method, property, field or variable and returns the string literal.</p>
<pre class="brush: csharp; title: ; notranslate">
var p = new Person();

Console.WriteLine(nameof(Person));
Console.WriteLine(nameof(p));
Console.WriteLine(nameof(Person.Name));
Console.WriteLine(nameof(Person.HomeAddress));

// Output:
//   Person
//   p
//   Name
//   HomeAddress
</pre>
<p>This is handy when doing input validation by keeping the method parameter and the parameter name of the <code>ArgumentNullException</code> in sync.</p>
<pre class="brush: csharp; highlight: [4]; title: ; notranslate">
public Point AddPoint(Point point)
{
  if (point == null)
    throw new ArgumentNullException(nameof(point));
}
</pre>
<p>The <code>nameof</code> operator is useful when implementing the <code>INotifyPropertyChanged</code> interface</p>
<pre class="brush: csharp; highlight: [10]; title: ; notranslate">
public string Name
{
  get
  {
    return _name;
  }
  set
  {
    _name = value;
    this.OnPropertyChanged(nameof(Name));
  }
}
</pre>
<p>The <a title="Chained null checks blog post by Anders Lybecker" href="/blog/2015/01/06/chained-null-checks/">Chained null checks</a> blog post shows how to simplify triggering event in the OnPropertyChanged with the null-conditional operator.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/08/the-nameof-operator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-nameof-operator#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/08/the-nameof-operator/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Chained null checks]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2015/01/06/chained-null-checks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chained-null-checks" />

		<id>http://www.lybecker.com/blog/?p=1254</id>
		<updated>2015-01-06T07:36:55Z</updated>
		<published>2015-01-06T07:36:55Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="C# 6" />
		<summary type="html"><![CDATA[The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them. Chained null checks (this one) The nameof operator Awesome string formatting Expression-bodied methods Auto-property initializers Initialize a Dictionary with index initializers Null-conditional operators is one of the features in C# 6 that [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2015/01/06/chained-null-checks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chained-null-checks"><![CDATA[<p>The next release of C# 6 has some amazing new features. In a series of blog posts I will cover some of them.</p>
<ul>
<li>Chained null checks (this one)</li>
<li><a title="The nameof operator blog post by Anders Lybecker" href="/blog/2015/01/08/the-nameof-operator/">The nameof operator</a></li>
<li><a title="Awesome string formatting blog post by Anders Lybecker" href="/blog/2015/01/09/awesome-string-formatting/">Awesome string formatting</a></li>
<li><a title="Expression-bodied methods blog post by Anders Lybecker" href="/blog/2015/01/13/expression-bodied-methods/">Expression-bodied methods</a></li>
<li><a title="Auto-property initializers blog post by Anders Lybecker" href="/blog/2015/01/15/auto-property-initializers/">Auto-property initializers</a></li>
<li><a title="Initialize a Dictionary with index initializers blog post by Anders Lybecker" href="/blog/2015/01/19/initialize-a-dictionary-with-index-initializers/">Initialize a Dictionary with index initializers</a></li>
</ul>
<p>Null-conditional operators is one of the features in C# 6 that will save the world from a lot of boilerplate code and a bunch of <code>NullReferenceExceptions</code>. It works as chained null checks!</p>
<pre class="brush: csharp; title: ; notranslate">
Console.WriteLine(person?.HomeAddress?.City ?? &quot;City unknown&quot;);
</pre>
<p>Note the null-conditional operator (<strong>?.</strong>) after <code>person</code> and <code>HomeAddress</code>, it returns null and terminates the object reference chain, if one of the references are null.</p>
<p>It is the same logic as the below code that you can use today.</p>
<pre class="brush: csharp; title: ; notranslate">
if (person != null)
    person.HomeAddress != null)
{
  Console.WriteLine(person.HomeAddress.City);
}
else
{
  Console.WriteLine(&quot;City unknown&quot;);
}
</pre>
<p>The null-conditional operator will also make it easier to trigger events. Today it is required to reference the event, check if it is null before raising the event like so.</p>
<pre class="brush: csharp; title: ; notranslate">
protected void OnPropertyChanged(string name)
{
  PropertyChangedEventHandler handler = PropertyChanged;

  if (handler != null)
  {
    handler(this, new PropertyChangedEventArgs(name));
  }
}
</pre>
<p>But the null-conditional operator provides a tread-safe way of checking for null before triggering the event.</p>
<pre class="brush: csharp; title: ; notranslate">
PropertyChanged?.Invoke(this, args);
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2015/01/06/chained-null-checks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chained-null-checks#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2015/01/06/chained-null-checks/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[AJAX paging for ASP.NET MVC sites]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2014/09/29/ajax-paging-for-asp-net-mvc-sites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ajax-paging-for-asp-net-mvc-sites" />

		<id>http://www.lybecker.com/blog/?p=1204</id>
		<updated>2018-08-24T13:50:45Z</updated>
		<published>2014-09-29T10:33:12Z</published>
		<category scheme="http://www.lybecker.com/blog" term="ASP.Net" /><category scheme="http://www.lybecker.com/blog" term="AJAX" /><category scheme="http://www.lybecker.com/blog" term="ASP.Net MVC" /><category scheme="http://www.lybecker.com/blog" term="PagedList.Mvc" /><category scheme="http://www.lybecker.com/blog" term="Paging" />
		<summary type="html"><![CDATA[When working with lists of data paging is a necessity, but trivial to implement in an ASP.NET MVC. The article Sorting, Filtering, and Paging with the Entity Framework in an ASP.NET MVC Application on www.asp.net makes use of the X.PackedList.MVC NuGet package and each step is described in detail. The implementation requires full-page refresh and [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2014/09/29/ajax-paging-for-asp-net-mvc-sites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ajax-paging-for-asp-net-mvc-sites"><![CDATA[<p>When working with lists of data paging is a necessity, but trivial to implement in an ASP.NET MVC. The article <a title="Article on asp.net website" href="http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application">Sorting, Filtering, and Paging with the Entity Framework in an ASP.NET MVC Application</a> on <a href="http://www.asp.net/">www.asp.net</a> makes use of the <a title="X.PackedList.MVC&lt;/ NuGet" href="https://www.nuget.org/packages/X.PagedList.Mvc//">X.PackedList.MVC</a> NuGet package and each step is described in detail. The implementation requires full-page refresh and does not make use of AJAX capabilities.</p>
<p>Let us extend the implementation and make full use of the AJAX capabilities.</p>
<p>Wrap the entire table in a div-tag and give it an id of <em>content</em> – it will enable us to replace the table without refreshing the entire webpage.</p>
<pre class="brush: xml; highlight: [1,9]; title: ; notranslate">
&lt;div id=&quot;content&quot;&gt;
    &lt;table&gt;
        ... removed for brevity
    &lt;/table&gt;

    &lt;div id=&quot;contentPager&quot;&gt;
        @Html.PagedListPager(Model, page =&gt; Url.Action(&quot;Index&quot;, new { page }))
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Also wrap the <code>@Html.PagedListPager</code> in a div-tag and set the id to <em>contentPager</em> – it will let us alter the behavior of the click-event.</p>
<p>The below JQuery code attaches the anonymous function to every a-tag within the <em>contentPager</em> element and the function replaces the html within the <em>content</em> element with whatever is returned from the AJAX call.</p>
<pre class="brush: jscript; title: ; notranslate">
$(document).on(&quot;click&quot;, &quot;#contentPager a&quot;, function () {
    $.ajax({
        url: $(this).attr(&quot;href&quot;),
        type: 'GET',
        cache: false,
        success: function (result) {
            $('#content').html(result);
        }
    });
    return false;
});
</pre>
<p>Move everything within the <em>content</em> element to a new view – let us call the new view <em>List</em>.</p>
<pre class="brush: xml; highlight: [10]; title: ; notranslate">
@model PagedList.IPagedList&lt;ContosoUniversity.Models.Student&gt;;
@using PagedList.Mvc;

&lt;div id=&quot;content&quot;&gt;
    &lt;table class=&quot;table&quot;&gt;
      ... removed for brevity
    &lt;/table&gt;

    &lt;div id=&quot;contentPager&quot;&gt;
        @Html.PagedListPager(Model, page =&gt; Url.Action(&quot;List&quot;, new { page }))
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Notice in above highlighted code, that the Action URL is changed to <em>List</em>, which is the name of the Action we need to add to the <code>StudentController</code>.</p>
<pre class="brush: csharp; title: ; notranslate">
public ActionResult List(int? page)
{
    var students = from s in db.Students
                    orderby s.LastName
                    select s;

    int pageSize = 3;
    int pageNumber = (page ?? 1);
    return View(students.ToPagedList(pageNumber, pageSize));
}
</pre>
<p>The functionality of the new <em>List</em> Action is the same as in the existing <em>Index</em> Action. Just move all the code from the <em>Index</em> Action, so it just returns the default view as below.</p>
<pre class="brush: csharp; title: ; notranslate">
public ViewResult Index()
{
    return View();
}
</pre>
<p>To wrap it up, the <em>Index</em> view needs to call the <em>List</em> Action to render the table in the <em>Index</em> view.</p>
<p>So the <em>Index</em> view ends up looking like this.</p>
<pre class="brush: xml; highlight: [7]; title: ; notranslate">
&lt;link href=&quot;~/Content/PagedList.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
@{
    ViewBag.Title = &quot;Students&quot;;
}
&lt;h2&gt;Students&lt;h2&gt;

@Html.Action(&quot;List&quot;)

@section scripts
{
    &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
        $(document).ready(function () {
           $(document).on(&quot;click&quot;, &quot;#contentPager a[href]&quot;, function () {
                $.ajax({
                    url: $(this).attr(&quot;href&quot;),
                    type: 'GET',
                    cache: false,
                    success: function (result) {
                        $('#content').html(result);
                    }
                });
                return false;
            });
        });
    &lt;/script&gt;
}
</pre>
<p>That is it.</p>
<p>The solution is inspired by <a href="http://stackoverflow.com/questions/18822352/using-paging-in-partial-view-asp-net-mvc">this StackOverflow question</a>.</p>
<p><a href="/blog/wp-content/uploads/AspNetMvcAjaxPaging.zip" rel="attachment wp-att-1242">Download the complete solution</a>, build and open the Student page. If running the solution in Visual Studio 2015+, then change the data source connection string in web.config to (localdb)\<em>MSSQLLocalDB</em> as the default SQL Server LocalDB instance name has changed.</p>
<p><strong>Update</strong> May 15th 2016: The <a href="https://www.nuget.org/packages/PagedList.Mvc">PagedList.Mvc</a> NuGet package is no longer maintained, but a fork of the project is available and maintained called <a href="https://www.nuget.org/packages/X.PagedList.Mvc/">X.PagedList.MVC</a>. I have updated the post and the source to use this new package.</p>
<p>Juanster and others pointed out a bug in the sample, but it was actually in the PagedList.MVC. I created a <a href="https://github.com/kpi-ua/X.PagedList/pull/14">pull request</a> for X.PagedList.MVC, which is now part of the NuGet package.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2014/09/29/ajax-paging-for-asp-net-mvc-sites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ajax-paging-for-asp-net-mvc-sites#comments" thr:count="20"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2014/09/29/ajax-paging-for-asp-net-mvc-sites/feed/atom/" thr:count="20"/>
			<thr:total>20</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Clean Domain Model via MongoDB Class Map]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2014/06/30/clean-domain-model-mongodb-class-mao/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clean-domain-model-mongodb-class-mao" />

		<id>http://www.lybecker.com/blog/?p=1190</id>
		<updated>2014-06-30T00:00:24Z</updated>
		<published>2014-06-30T00:00:24Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="MongoDB" /><category scheme="http://www.lybecker.com/blog" term="BSonId" /><category scheme="http://www.lybecker.com/blog" term="Class Map" />
		<summary type="html"><![CDATA[You can get rid of the dependency from the domain model to MongoDB assemblies, by utilizing Class Map functionality of the Official MongoDB C# Driver. It is simple to use the property mapping, but you can also use AutoMap combined with one or more overriding mappings. That is often useful when using the MongoDB IdGenerators. [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2014/06/30/clean-domain-model-mongodb-class-mao/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clean-domain-model-mongodb-class-mao"><![CDATA[<p>You can get rid of the dependency from the domain model to MongoDB assemblies, by utilizing <a title="Class Map MongoDB Documentation" href="http://docs.mongodb.org/ecosystem/tutorial/serialize-documents-with-the-csharp-driver/#creating-a-class-map">Class Map</a> functionality of the <a title="The Official MongoDB C# Driver on NuGet" href="https://www.nuget.org/packages/mongocsharpdriver">Official MongoDB C# Driver</a>.</p>
<p>It is simple to use the property mapping, but you can also use AutoMap combined with one or more overriding mappings. That is often useful when using the MongoDB IdGenerators. However, how do you specify which to use without using attributes?</p>
<p>Below is a simple class with no dependencies – only dependent on the .NET Base Class Library:</p>
<pre class="brush: csharp; title: ; notranslate">
public class Person
{
  public string Id { get; set; }
  public string FirstName { get; set; }
  public string LastName { get; set; }
}
</pre>
<p>Notice that not event an ObjecId is present.<br />
To instruct MongoDB to generate a unique identifier for the Id property:</p>
<pre class="brush: csharp; title: ; notranslate">
public class Person
{
  [BsonId]
  public string Id { get; set; }
  public string FirstName { get; set; }
  public string LastName { get; set; }
}
</pre>
<p>But now there is a dependency on the BSonId attribute. We can remove it via a Class Map:</p>
<pre class="brush: csharp; title: ; notranslate">
BsonClassMap.RegisterClassMap(cm =&gt;
            {
                cm.AutoMap();
                cm.SetIdMember(cm.GetMemberMap(x =&gt; x.Id)
                  .SetIdGenerator(StringObjectIdGenerator.Instance));
            });
</pre>
<p>It is possible to use other data types as unique identifiers; just choose the correspond <a title="IdGenerators MongoDB Documentation" href="http://docs.mongodb.org/ecosystem/tutorial/serialize-documents-with-the-csharp-driver/#selecting-an-idgenerator-to-use-for-an-id-field-or-property">IdGenerator</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2014/06/30/clean-domain-model-mongodb-class-mao/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clean-domain-model-mongodb-class-mao#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2014/06/30/clean-domain-model-mongodb-class-mao/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[MongoDB auto-increment or sequence]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2014/06/27/mongodb-auto-increment-or-sequence/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mongodb-auto-increment-or-sequence" />

		<id>http://www.lybecker.com/blog/?p=1180</id>
		<updated>2014-06-27T15:17:58Z</updated>
		<published>2014-06-27T15:17:58Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="MongoDB" /><category scheme="http://www.lybecker.com/blog" term="auto increment" /><category scheme="http://www.lybecker.com/blog" term="sequence" />
		<summary type="html"><![CDATA[MongoDB is a document database that does not have auto-increment or sequence functionality build-in, like e.g. SQL Server. Auto-increment or sequence numbers are often used to create a consecutive sequence of numbers used as order or invoice identifiers. This is simple to achieve with MongoDB via the atomic operation $inc. If you use the Official [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2014/06/27/mongodb-auto-increment-or-sequence/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mongodb-auto-increment-or-sequence"><![CDATA[<p>MongoDB is a document database that does not have auto-increment or sequence functionality build-in, like e.g. SQL Server. Auto-increment or sequence numbers are often used to create a consecutive sequence of numbers used as order or invoice identifiers.</p>
<p>This is simple to achieve with MongoDB via the atomic operation <a title="MongoDB $inc operation documentation" href="http://docs.mongodb.org/manual/reference/operator/update/inc/">$inc</a>. If you use the <a title="Official MongoDB C# Driver on NuGet" href="https://www.nuget.org/packages/mongocsharpdriver">Official MongoDB C# Driver</a> the operation is exposed via the Update class.</p>
<p>To implement auto-increment or sequence functionality with MongoDB a document is required to keep the state of the sequence. The Id is the natural name of the sequence e.g. orderid and the value is the current counter value.</p>
<pre class="brush: csharp; title: ; notranslate">
class Counter
{
  public string Id { get; set; }
  public int Value { get; set; }
}
</pre>
<p>Then getting the next ordered is done by executing the below statement:</p>
<pre class="brush: csharp; title: ; notranslate">
var client = new MongoClient(connectionString);
MongoServer server = client.GetServer();
MongoDatabase db = server.GetDatabase(&quot;myDatabase&quot;);
var counterCol = db.GetCollection(&quot;counters&quot;)

var result = counterCol.FindAndModify(new FindAndModifyArgs()
{
  Query = Query.EQ(d =&gt; d.Id, &quot;orderId&quot;),
  Update = Update.Inc(d =&gt; d.Value, 1),
  VersionReturned = FindAndModifyDocumentVersion.Modified,
  Upsert = true, //Create if the document does not exists
});
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2014/06/27/mongodb-auto-increment-or-sequence/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mongodb-auto-increment-or-sequence#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2014/06/27/mongodb-auto-increment-or-sequence/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[I am an expert]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2014/04/02/i-am-an-expert/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-an-expert" />

		<id>http://www.lybecker.com/blog/?p=1173</id>
		<updated>2014-04-02T14:53:58Z</updated>
		<published>2014-04-02T14:53:58Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Rambling" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="fun" />
		<summary type="html"><![CDATA[I have been in many meetings as the expert. Especially in pre-sales meetings this scenario is in play. The video is a bit long, but so true and funny 🙂]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2014/04/02/i-am-an-expert/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-an-expert"><![CDATA[<p><iframe width="560" height="315" src="//www.youtube.com/embed/BKorP55Aqvg" frameborder="0" allowfullscreen></iframe><br />
I have been in many meetings as the expert. Especially in pre-sales meetings this scenario is in play. The video is a bit long, but so true and funny <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2014/04/02/i-am-an-expert/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-an-expert#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2014/04/02/i-am-an-expert/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[I am a Softie]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2013/12/24/i-am-a-softie/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-a-softie" />

		<id>http://www.lybecker.com/blog/?p=1138</id>
		<updated>2013-12-24T16:00:57Z</updated>
		<published>2013-12-24T16:00:57Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Rambling" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Microsoft" />
		<summary type="html"><![CDATA[Softie is internal slang for Microsoft employee. For a couple of years I have had my own company Avior together with my partner. We had fun times and difficult times, but we did what we loved – developed software. Late September I started talking with Microsoft Denmark about the position as technical evangelist. At first [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2013/12/24/i-am-a-softie/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-a-softie"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/microsoft-logo.jpg"><img loading="lazy" class=" wp-image-1147 alignright" alt="Microsoft logo" src="http://www.lybecker.com/blog/wp-content/uploads/microsoft-logo-150x150.jpg" width="100" height="100" /></a></p>
<p>Softie is internal slang for Microsoft employee.</p>
<p>For a couple of years I have had my own company <a title="Avior company website" href="http://avior.dk">Avior</a> together with my partner. We had fun times and difficult times, but we did what we loved – developed software. Late September I started talking with Microsoft Denmark about the position as technical evangelist. At first I was reluctant as I was afraid to lose my technical competence and leaving my own company, but I was intrigued. I finally agreed to leave Avior and join Microsoft after a couple of conversations with current and previously Microsoft employees – they all spoke fondly about Microsoft – if I could cope with the politics and ceremony.</p>
<h2>What is the job of a technical evangelist?</h2>
<p>An evangelist advocates the <a title="Evangelium description on Wikipedia" href="http://en.wikipedia.org/wiki/Evangelium">evangelium</a>, which means ‘good news’. All Latin, nothing religious – but in my case just technical <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>It is about connecting people who have problems with a product, technology and knowledge needed in order for them to succeed. In my mind, it is all about authentic content, communication, and community. I wish to spread knowledge and help other developers while keeping my integrity.</p>
<h2>Current status</h2>
<p>Now 3 months in, I find myself at home at Microsoft, but I still feel like a n00b. There are so many people and internal processes that I need to familiarize myself with that I sometimes feel dizzy and do not feel that I am contributing enough.</p>
<h2>Challenges</h2>
<p>I am catching up on the Windows 8, Windows Phone 8 and Azure – which is the new stuff at Microsoft. It is a lot of ground to cover, so I do no longer fear for my technical competencies as I am spending much time studying and helping customers with technical issues.</p>
<p>I wish to engage the community more in the New Year, so I am busy planning talks and the Danish Developer Conference.</p>
<p><span style="line-height: 1.5em;">One request for you – let me know how I am doing, please.</span></p>
<p>Merry Christmas and happy New Year.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2013/12/24/i-am-a-softie/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-a-softie#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2013/12/24/i-am-a-softie/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Instrumentation presentation at Campus Days 2013]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2013/10/10/instrumentation-presentation-at-campus-days-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instrumentation-presentation-at-campus-days-2013" />

		<id>http://www.lybecker.com/blog/?p=1121</id>
		<updated>2013-10-10T15:38:22Z</updated>
		<published>2013-10-10T15:38:22Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="Instrumentation" /><category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="Campus Days 2013" /><category scheme="http://www.lybecker.com/blog" term="ETW" /><category scheme="http://www.lybecker.com/blog" term="EventSource" /><category scheme="http://www.lybecker.com/blog" term="TraceSource" /><category scheme="http://www.lybecker.com/blog" term="Tracing" />
		<summary type="html"><![CDATA[I was fun to present today at Campus Days 2013 in Copenhagen, Denmark. The talk was about how to instrument software by using frameworks like TraceSource, EventSource, Event Tracing for Windows and how to perform post-mortem debugging via Visual Studio and PerfView. Slides CCDK13 Instrumentation Source Code Recorded Session (in Danish) Here is a great [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2013/10/10/instrumentation-presentation-at-campus-days-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instrumentation-presentation-at-campus-days-2013"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/ccdk13_Logo.png"><img loading="lazy" class="alignright size-thumbnail wp-image-1122" alt="Campus Days 2013 logo" src="http://www.lybecker.com/blog/wp-content/uploads/ccdk13_Logo-150x150.png" width="150" height="150" /></a>I was fun to present today at <a title="Campus Days web site" href="http://www.campusdays.dk">Campus Days 2013</a> in Copenhagen, Denmark. The talk was about how to instrument software by using frameworks like <a title="TraceSource documentation on MSDN" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.tracesource.aspx">TraceSource</a>, <a title="EventSource documentation on MSDN" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.tracing.eventsource.aspx">EventSource</a>, Event Tracing for Windows and how to perform post-mortem debugging via Visual Studio and <a title="Download PerView" href="http://www.microsoft.com/en-us/download/details.aspx?id=28567">PerfView</a>.</p>
<ul>
<li><a title="Instrumentation slides" href="http://www.slideshare.net/Lybecker/campus-days-2013-instrumentering">Slides</a></li>
<li><a href="http://www.lybecker.com/blog/wp-content/uploads/CCDK13_Instrumentation_SourceDoe.zip">CCDK13 Instrumentation Source Code</a></li>
<li><a title="Instrumentation session recording at Campus Days 2013 in Danish" href="http://channel9.msdn.com/Events/Microsoft-Campus-Days/Microsoft-Campus-Days-2013/Logging-tracing-instrumentering-debugging-og-fejlfinding">Recorded Session</a> (in Danish)</li>
</ul>
<p>Here is a great resource for <a title="Enabling Diagnostics in Windows Azure" href="https://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/">enabling diagnostics in Azure</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2013/10/10/instrumentation-presentation-at-campus-days-2013/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instrumentation-presentation-at-campus-days-2013#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2013/10/10/instrumentation-presentation-at-campus-days-2013/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Automatic Retry and Circuit Breaker made easy]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2013/08/07/automatic-retry-and-circuit-breaker-made-easy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatic-retry-and-circuit-breaker-made-easy" />

		<id>http://www.lybecker.com/blog/?p=1100</id>
		<updated>2013-08-07T19:54:09Z</updated>
		<published>2013-08-07T19:54:09Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Everyday coding" /><category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="Circuit Breaker" /><category scheme="http://www.lybecker.com/blog" term="dotNet" /><category scheme="http://www.lybecker.com/blog" term="External integration" /><category scheme="http://www.lybecker.com/blog" term="Polly" /><category scheme="http://www.lybecker.com/blog" term="retry-logic" />
		<summary type="html"><![CDATA[If you do not know Polly, you are missing out! I did not know about it until a couple of days ago and you properly never heard about it either, as this wonderful little library only has 63 downloads on NuGet at the time of writing. Polly is an easy to use retry and circuit [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2013/08/07/automatic-retry-and-circuit-breaker-made-easy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatic-retry-and-circuit-breaker-made-easy"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Polly.png"><img class="alignright size-full wp-image-1101" alt="Polly library logo" src="http://www.lybecker.com/blog/wp-content/uploads/Polly.png" /></a>If you do not know <a title="Polly source repository and documentation" href="https://github.com/michael-wolfenden/Polly">Polly</a>, you are missing out! I did not know about it until a couple of days ago and you properly never heard about it either, as this wonderful little library only has 63 downloads on <a title="Polly at NuGet.org" href="https://www.nuget.org/packages/Polly/">NuGet</a> at the time of writing.</p>
<p>Polly is an easy to use retry and <a title="Circuit breaker design pattern on Wikipedia" href="http://en.wikipedia.org/wiki/Circuit_breaker_design_pattern">circuit breaker pattern</a> implementation for .Net – let me show you.<br />
Start by specifying the policy – what should happen when an exception thrown:</p>
<pre class="brush: csharp; title: ; notranslate">
  var policy = Policy
    .Handle&lt;SqlException(e =&gt; e.Number == 1205) // Handling deadlock victim
    .Or&lt;OtherException&gt;()
    .Retry(3, (exception, retyCount, context) =&gt;
    {
      // Log...
    });
</pre>
<p>The above policy specifies a SqlExeption with number 1205 or OtherException should be retried three times – if it still fails log and bobble the original exception up the call stack.</p>
<pre class="brush: csharp; title: ; notranslate">
  var result = policy.Execute(() =&gt; FetchData(p1, p2));
</pre>
<p>It is also possible to specify the time between retries – e.g. exponential back off:</p>
<pre class="brush: csharp; title: ; notranslate">
  var policy = Policy
    .Handle&lt;MyException&gt;()
    .WaitAndRetry(5, retryAttempt =&gt;
      TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)
    );
</pre>
<p>Or the circuit breaker safeguarding against the same error occurs again and again if an external system is temporarily unavailable:</p>
<pre class="brush: csharp; title: ; notranslate">
  var policy = Policy
    .Handle&lt;TimeoutException&gt;()
    .CircuitBreaker(2, TimeSpan.FromMinutes(1));
</pre>
<p>Go get it – I’m already using it <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2013/08/07/automatic-retry-and-circuit-breaker-made-easy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatic-retry-and-circuit-breaker-made-easy#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2013/08/07/automatic-retry-and-circuit-breaker-made-easy/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Accessing HTTP Request from ASP.NET Web API]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2013/06/26/accessing-http-request-from-asp-net-web-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=accessing-http-request-from-asp-net-web-api" />

		<id>http://www.lybecker.com/blog/?p=1093</id>
		<updated>2013-06-26T15:33:33Z</updated>
		<published>2013-06-26T15:33:33Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Web API" /><category scheme="http://www.lybecker.com/blog" term="ASP.Net Web API" /><category scheme="http://www.lybecker.com/blog" term="dotNet" />
		<summary type="html"><![CDATA[Do you need access to the bare HTTP request in ASP.NET Web API to access custom header etc.? Then add the HttpRequestMessage: The HttpRequestMessage is automatically bound to the controller action, so you can still execute the action like http://localhost/calculator/add?x=3&#38;y=2 Simple and easy.]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2013/06/26/accessing-http-request-from-asp-net-web-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=accessing-http-request-from-asp-net-web-api"><![CDATA[<p>Do you need access to the bare HTTP request in ASP.NET Web API to access custom header etc.? Then add the HttpRequestMessage:</p>
<pre class="brush: csharp; highlight: [5]; title: ; notranslate">
public class CalculatorController : ApiController
{
  public int Add(HttpRequestMessage requestMessage, int x, int y)
  {
    var accessToken = requestMessage.Headers.Authorization.Parameter;
    // use the HTTP header

    return x + y;
  }
}
</pre>
<p>The HttpRequestMessage is automatically bound to the controller action, so you can still execute the action like http://localhost/calculator/add?x=3&amp;y=2</p>
<p>Simple and easy.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2013/06/26/accessing-http-request-from-asp-net-web-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=accessing-http-request-from-asp-net-web-api#comments" thr:count="1"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2013/06/26/accessing-http-request-from-asp-net-web-api/feed/atom/" thr:count="1"/>
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[GOTO Aarhus 2012 – Tuesday]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/10/02/goto-aarhus-2012-tuesday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-tuesday" />

		<id>http://www.lybecker.com/blog/?p=1074</id>
		<updated>2016-05-07T20:51:19Z</updated>
		<published>2012-10-02T19:02:46Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="GOTOaar" />
		<summary type="html"><![CDATA[The morning keynote by Scott Hanselman was about the true power of JavaScript. He argued that JavaScript in the browser is a full operating system running as a virtual machine within the browser – so we should treat it so. Don’t use Java Applets, Flash, Flex or Silverlight as it just another (slow) abstraction upon [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/10/02/goto-aarhus-2012-tuesday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-tuesday"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/typescript-preview.png"><img loading="lazy" class="alignright size-full wp-image-1077" title="typescript-preview" src="http://www.lybecker.com/blog/wp-content/uploads/typescript-preview.png" alt="" width="275" height="100" /></a>The morning keynote by <a href="https://twitter.com/shanselman">Scott Hanselman</a> was about the true power of JavaScript. He argued that JavaScript in the browser is a full operating system running as a virtual machine within the browser – so we should treat it so. Don’t use Java Applets, Flash, Flex or Silverlight as it just another (slow) abstraction upon an already powerfull engine – the browser. It was a great talk leading up to the pre-release of <a href="http://www.typescriptlang.org/">TypeScript</a>.</p>
<p>I followed a couple of sessions the continuous delivery by <a href="https://twitter.com/samnewman">Sam Newman</a>, <a href="https://twitter.com/mtnygard">Michael T. Nygard</a> (author of Release It) and <a href="https://twitter.com/jezhumble">Jez Humble</a> (author of Continuous Delivery).<br />
Continuous Integration is a prerequisite of Continuous Delivery, but many still don’t use apply Continuous Integration to their solution, with daily incremental check-ins, automated build and unit tests.</p>
<p>To simplify Continuous Delivery, everything must be automated. To ease the task of automation, things must be simplified. To simplify, start by decomposing the system into manageable pieces, so each can be deployed separately. How?<br />
Decompose the system into disconnected services makes it easier to deploy a subset of the system. This limits the impact of a deployment. It even makes it possible to mitigate the risk further by making small incremental changes by only deploying one subsystem at the time.</p>
<p>These services have to be structured as application silos and share nothing, not even the database schema.</p>
<p>By automating and decomposing your system into disconnected application silo services you too can do Continuous Delivery.<br />
After the conference the GOTO Aarhus guys had joint up with the local community and user groups to hos open sessions. I attended the <a href="http://www.anug.dk/">ANUG</a> (Aarhus .NET User Group) session with Anders Hejlsberg. He presented the brand new <a href="http://www.typescriptlang.org/">TypeScript</a> – a superset of JavaScript that compiles into plain JavaScript and runs in any browser (similar concept as <a href="http://coffeescript.org/">CoffeeScript</a>). It has great tooling support in Visual Studio with intelliSense and static verification.</p>
<p>I’m looking forward to the last day of the conference tomorrow.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/10/02/goto-aarhus-2012-tuesday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-tuesday#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/10/02/goto-aarhus-2012-tuesday/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[GOTO Aarhus 2012 – Monday]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/10/01/gotoaar-2012-monday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gotoaar-2012-monday" />

		<id>http://www.lybecker.com/blog/?p=1068</id>
		<updated>2012-10-01T15:20:37Z</updated>
		<published>2012-10-01T15:20:37Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="GOTOaar" />
		<summary type="html"><![CDATA[The day started with a keynote from @Falkvinge from the Pirate Party. I wasn’t expecting much from this keynote, but I was pleasantly surprised. First of all, I assumed that I knew quite a bit about the Pirate Party – I was wrong! Facts: the Pirate Party is present in 150 countries and has 2 European [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/10/01/gotoaar-2012-monday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gotoaar-2012-monday"><![CDATA[<p>The day started with a keynote from <a title="Falkvinge Twitter profile" href="http://twitter.com/Falkvinge">@Falkvinge </a>from the <a title="The Pirate Party website" href="http://www.piratpartiet.se/international/english">Pirate Party</a>. I wasn’t expecting much from this keynote, but I was pleasantly surprised. First of all, I assumed that I knew quite a bit about the Pirate Party – I was wrong! Facts: the Pirate Party is present in 150 countries and has 2 European Union parliament members. These guys are serious and not just a protest party wanting to legalize sharing copyrighted material. They are fighting the problems with limiting access to knowledge and ideas. They are emphasizing that exclusive right like patents, copyright and subsidizing are counterproductive. That’s so true! @Falkvinge disrupted my brain – that’s great, because that is why I’m here!</p>
<p>Next up was great presentation of graph databases by Jim Webber &#8211; fast speaking provocative British architect from <a href="http://neo4j.org/">Neo4J</a>. He (re)spiked my interest in ‘other’ databases and stressed that each type of database like relational, object, key-value stores, document,  graph etc. databases each fit their problem domain. So you shouldn’t just pick RavenDB because it is the new hot think in .Net sphere (or because Ayende aka Oren Eini says so). I will definitely take a look Net4J with the .Net client library <a title="Neo4jClient on NuGet" href="http://nuget.org/packages/Neo4jClient">Neo4jClient </a>. Another great point from Jim Webber was; ACID does scale (though many claims otherwise), but he stressed it was distributed ACID with 2PC that doesn’t scale.</p>
<p>From then on I attended a couple of unfortunate sessions (not worth mentioning). Now it is time for the conference party where the beer is sponsored by <a title="Atlassian website" href="http://www.atlassian.com/">Atlassian</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/10/01/gotoaar-2012-monday/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gotoaar-2012-monday#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/10/01/gotoaar-2012-monday/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[GOTO Aarhus 2012 Schedule]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/09/27/goto-aarhus-2012-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-schedule" />

		<id>http://www.lybecker.com/blog/?p=1062</id>
		<updated>2012-09-27T18:41:13Z</updated>
		<published>2012-09-27T18:41:13Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="GOTOaar" />
		<summary type="html"><![CDATA[Soon I&#8217;ll be joining a bunch of great people from the Danish developer community and abroad at this year GOTO Conference in Aarhus next week. I&#8217;ve been looking at the conference schedule trying to create my schedule… the line-up of international fame speakers are impressive, but I&#8217;ll go for the odd sessions to expand my [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/09/27/goto-aarhus-2012-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-schedule"><![CDATA[<p>Soon I&#8217;ll be joining a bunch of great people from the Danish developer community and abroad at this year <a title="GotoAar 2012 website" href="http://gotocon.com/aarhus-2012/">GOTO Conference in Aarhus</a> next week.</p>
<p>I&#8217;ve been looking at the <a title="GotoAar 2012 conference schedule" href="http://gotocon.com/aarhus-2012/schedule/">conference schedule</a> trying to create my schedule… the line-up of international fame speakers are impressive, but I&#8217;ll go for the odd sessions to expand my horizon. During breaks I’ll discuss and share ideas with my fellow attendees – I might even skip sessions for interesting discussions in the hallways.</p>
<p>Here is my tentative schedule:</p>
<ul>
<li>Monday I&#8217;ll attend “<a href="http://gotocon.com/aarhus-2012/presentation/What%20is%20value?">What is value?</a>” and “<a href="http://gotocon.com/aarhus-2012/presentation/Management%20Myths:%20are%20we%20getting%20any%20better%20at%20this?">Management Myths: are we getting any better at this?</a>” to expand my software engineering and project management skillset.</li>
<li>Tuesday I&#8217;ll look at the Biiiig Data tracks and attend &#8220;<a href="http://gotocon.com/aarhus-2012/presentation/Building%20secured,%20scalable,%20low-latency%20web%20applications%20with%20the%20Windows%20Azure%20Platform">Building secured, scalable, low-latency web applications with the Windows Azure Platform</a>&#8221; and &#8220;<a href="http://gotocon.com/aarhus-2012/presentation/Runaway%20complexity%20in%20Big%20Data%20systems...%20and%20a%20plan%20to%20stop%20it">Runaway complexity in Big Data systems&#8230; and a plan to stop it</a>&#8220;. Hopefully I’ll be inspired how to handle the 1TB size systems; I’m working on.</li>
<li>Wednesday I&#8217;ll attend the “<a href="http://gotocon.com/aarhus-2012/presentation/Professional%20Productivity%20-%20Part%201">Professional Productivity</a>” sessions – yep… I hope to become twice as productive <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>
</ul>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/09/27/goto-aarhus-2012-schedule/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=goto-aarhus-2012-schedule#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/09/27/goto-aarhus-2012-schedule/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[See you at GOTO Aarhus 2012?]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/08/28/se-you-at-goto-aarhus-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=se-you-at-goto-aarhus-2012" />

		<id>http://www.lybecker.com/blog/?p=1053</id>
		<updated>2012-08-28T20:03:28Z</updated>
		<published>2012-08-28T20:03:28Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="GOTOaar" />
		<summary type="html"><![CDATA[Are you going to GOTO Aarhus 2012 conference October 1-3 in Aarhus, Denmark? The conference is covers diverse software development topics like big data, augmented data, agile perspectives, JavaScript, UX, continuous delivery, mobile, cloud, languages, NoSQL, scale … so this is not a vendor specific conference where the newest technology is presented. I prefer conferences [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/08/28/se-you-at-goto-aarhus-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=se-you-at-goto-aarhus-2012"><![CDATA[<p>Are you going to <a title="GOTO Aarhus 2012 conference homepage" href="http://gotocon.com/aarhus-2012/">GOTO Aarhus 2012</a> conference October 1-3 in Aarhus, Denmark?</p>
<p>The conference is covers diverse software development topics like big data, augmented data, agile perspectives, JavaScript, UX, continuous delivery, mobile, cloud, languages, NoSQL, scale … so this is not a vendor specific conference where the newest technology is presented.</p>
<p>I prefer conferences where I get inspired… a conference where all the participants; speakers and fellow participants plant seeds in my head for new ideas and alternative approaches to solving problems.</p>
<p>That’s why I’m going to the GOTO Aarhus conference.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/08/28/se-you-at-goto-aarhus-2012/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=se-you-at-goto-aarhus-2012#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/08/28/se-you-at-goto-aarhus-2012/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Blog post from 10000 meters in the Air]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/06/21/blog-post-from-10000-meters-in-the-air/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blog-post-from-10000-meters-in-the-air" />

		<id>http://www.lybecker.com/blog/?p=1047</id>
		<updated>2012-06-21T18:58:09Z</updated>
		<published>2012-06-21T18:58:09Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Rambling" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Flight" /><category scheme="http://www.lybecker.com/blog" term="Wi-Fi" /><category scheme="http://www.lybecker.com/blog" term="WiFi" />
		<summary type="html"><![CDATA[While writing and posting this post I&#8217;m currently flying from Copenhagen, Denmark to London, United Kingdom over the North Sea with Norwegian airlines using the free online Wi-Fi connection onboard. The Internet connection is slow, but that&#8217;s expected as the traffic is routed through satellites and the fact that I share the connection with the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/06/21/blog-post-from-10000-meters-in-the-air/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blog-post-from-10000-meters-in-the-air"><![CDATA[<p>While writing and posting this post I&#8217;m currently flying from Copenhagen, Denmark to London, United Kingdom over the North Sea with <a title="The airline carrier Norwegians' homepage" href="http://www.norwegian.com/">Norwegian</a> airlines using the free online Wi-Fi connection onboard. The Internet connection is slow, but that&#8217;s expected as the traffic is routed through satellites and the fact that I share the connection with the 250 or so other passengers; all trying to access Facebook <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>A ping request to Google.com show that a roundtrip takes around 800 ms with some fluctuations into the 1200 ms</p>
<p>Pinging google.com [173.194.70.113] with 32 bytes of data:<br /> Reply from 173.194.70.113: bytes=32 time=681ms TTL=43<br /> Reply from 173.194.70.113: bytes=32 time=869ms TTL=43<br /> Reply from 173.194.70.113: bytes=32 time=705ms TTL=43<br /> Reply from 173.194.70.113: bytes=32 time=750ms TTL=43</p>
<p>An Internet connection speed test reveals my upload was around 400 Kbit/s download and 15 Kbit/s upload.</p>
<p>A trace route didn&#8217;t disclose much information; therefore not included in this blog post.</p>
<p>The Internet connection is very unreliable making it impossible to work, but IM and light sites are browsable. Internet on a flight is a welcome initiative making it more pleasant to fly.</p>
<p>I just hope the competitors will do the same and the quality of the connection will improve.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/06/21/blog-post-from-10000-meters-in-the-air/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blog-post-from-10000-meters-in-the-air#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/06/21/blog-post-from-10000-meters-in-the-air/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Community Day Copenhagen 2012 – Solr Presentation]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/05/11/community-day-copenhagen-2012-solr-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=community-day-copenhagen-2012-solr-presentation" />

		<id>http://www.lybecker.com/blog/?p=1034</id>
		<updated>2012-05-11T09:21:07Z</updated>
		<published>2012-05-11T09:21:07Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="Solr" /><category scheme="http://www.lybecker.com/blog" term="CdCph" /><category scheme="http://www.lybecker.com/blog" term="Facet" /><category scheme="http://www.lybecker.com/blog" term="Fulltext Search" /><category scheme="http://www.lybecker.com/blog" term="jQuery" />
		<summary type="html"><![CDATA[I enjoyed the Community Day immensely and I am looking forward to next year. Download the presentation together with the C# client, jQuery web client and Solr configuration files. Download Solr separately from Apache Foundation.]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/05/11/community-day-copenhagen-2012-solr-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=community-day-copenhagen-2012-solr-presentation"><![CDATA[<p><img class="aligncenter size-full wp-image-1035" title="Community Day Logo" src="http://www.lybecker.com/blog/wp-content/uploads/CommunityDayLogo.jpg" alt="" /></p>
<p>I enjoyed the Community Day immensely and I am looking forward to next year.</p>
<p><a href="/blog/wp-content/uploads/CphCommunityDay2010_Solr.zip">Download the presentation together with the C# client, jQuery web client and Solr configuration files</a>.</p>
<p><a href="http://lucene.apache.org/solr/">Download Solr</a> separately from Apache Foundation.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/05/11/community-day-copenhagen-2012-solr-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=community-day-copenhagen-2012-solr-presentation#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/05/11/community-day-copenhagen-2012-solr-presentation/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Outsourcing requires Talent]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/02/29/outsourcing-requires-talent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outsourcing-requires-talent" />

		<id>http://www.lybecker.com/blog/?p=1022</id>
		<updated>2012-02-29T21:10:36Z</updated>
		<published>2012-02-29T21:10:36Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Rambling" /><category scheme="http://www.lybecker.com/blog" term="Offshoring" /><category scheme="http://www.lybecker.com/blog" term="Outsouring" /><category scheme="http://www.lybecker.com/blog" term="Skill" /><category scheme="http://www.lybecker.com/blog" term="Talent" />
		<summary type="html"><![CDATA[I’ll be discussing specifically in the context of knowledge workers who “think for a living” such as software developers, lawyers, business analysts and the likes. I will use software developers as an example, but it applies to other knowledge workers too. You might have success outsourcing if you find talent, but you will fail without! [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/02/29/outsourcing-requires-talent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outsourcing-requires-talent"><![CDATA[<p><img loading="lazy" class="alignright size-full wp-image-1018" title="Where are the jobs?" src="http://www.lybecker.com/blog/wp-content/uploads/offshoring.jpg" alt="" width="200" height="150" /><em>I’ll be discussing specifically in the context of <a title="Knowledge worker on Wikipedia" href="http://en.wikipedia.org/wiki/Knowledge_worker">knowledge workers</a> who “think for a living” such as software developers, lawyers, business analysts and the likes. I will use software developers as an example, but it applies to other knowledge workers too.</em></p>
<p>You might have success outsourcing if you find talent, but you will fail without!</p>
<p>Businesses neglect the importance of finding skilled and talented software developers when outsourcing, which will almost certainly lead to problems or failure in the long run.</p>
<p>It doesn’t matter if it is a project or IT services being outsourced – the people in the other end have to have skills and preferably talent.</p>
<p>Obtaining a degree or completing a certification does not proof that a person has skills. Just as managers never will employ a developer based on resume only, neither should outsourced developers. The business should setup quality parameters in the outsourcing contract or interview the developers themselves – but that is rarely feasible.</p>
<p>There are other essential parameters that should not be neglected like creativity, motivation and talent nurturing. All the regular personal management things needed, also applies for outsourcing.</p>
<p>Offshoring to low-cost countries just complicates things even further… as you have to consider the language barrier, culture differences and time zones also.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/02/29/outsourcing-requires-talent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outsourcing-requires-talent#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/02/29/outsourcing-requires-talent/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[When to Outsource?]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2012/02/28/when-to-outsource/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=when-to-outsource" />

		<id>http://www.lybecker.com/blog/?p=1010</id>
		<updated>2012-02-28T19:27:29Z</updated>
		<published>2012-02-28T19:27:29Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Rambling" /><category scheme="http://www.lybecker.com/blog" term="Offshoring" /><category scheme="http://www.lybecker.com/blog" term="Outsouring" />
		<summary type="html"><![CDATA[I’ll be discussing specifically in the context of knowledge workers who “think for a living” such as software developers, lawyers, business analysts and the likes. I will use software developers as an example, but it applies to other knowledge workers too. Outsourcing software development can be a good thing for the business, especially if the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2012/02/28/when-to-outsource/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=when-to-outsource"><![CDATA[<p><img loading="lazy" class="alignright size-full wp-image-1018" title="Where are the jobs?" alt="" src="http://www.lybecker.com/blog/wp-content/uploads/offshoring.jpg" width="200" height="150" /><em>I’ll be discussing specifically in the context of <a title="Knowledge worker on Wikipedia" href="http://en.wikipedia.org/wiki/Knowledge_worker">knowledge workers</a> who “think for a living” such as software developers, lawyers, business analysts and the likes. I will use software developers as an example, but it applies to other knowledge workers too.</em></p>
<p>Outsourcing software development can be a good thing for the business, especially if the area is not within the business’s main area of expertise or requiring too few developers to gather enough brain trust to keep the level of expertise.</p>
<p>If software development is not within the business area of expertise then the area will often be neglected leading to low morale and lack of commitment. It is not seen as an important part of the business, but necessary evil. The developers will not have the best tools possible or access to new knowledge like inspiration at conferences. This is a downwards spiral of developer skills and will lead to failure eventually.</p>
<p>If the business only has a small number of developers with similar skillset, then the ability to share knowledge is impaired. Developers that have no one or less than a handful of coworkers to share knowledge with, will almost never be very skilled. Knowledge workers require peers to stay knowledgeable.</p>
<p>If both scenarios above are combined, then the problems become very evident and will never lead to success.</p>
<p>In either case outsourcing makes sense and will in most cases provide business value.</p>
<h3>Offshoring</h3>
<p>Outsourcing to low-cost countries aka offshoring complicates things even further and should not be considered before thorough scrutiny of your business.  Does the business employ the required competency, are the procedures in place and is the organization mature enough?<br />
Due to the magnitude required by preliminary analysis, offshoring only makes economic sense for larger scale operations and is not viable for smaller businesses.</p>
<p><em>Update Feb 28. 2013: </em>A great blog post <a title="Is Offshoring Less Expensive? Exposing Another Management Myth" href="http://www.jrothman.com/blog/mpd/2013/09/is-offshoring-less-expensing-exposing-another-management-myth.html">Is Offshoring Less Expensive? Exposing Another Management Myth</a></p>
<p>&nbsp;</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2012/02/28/when-to-outsource/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=when-to-outsource#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2012/02/28/when-to-outsource/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Memory Management in .Net]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2011/12/23/memorymanagementindotnet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memorymanagementindotnet" />

		<id>http://www.lybecker.com/blog/?p=988</id>
		<updated>2011-12-23T14:48:48Z</updated>
		<published>2011-12-23T14:48:48Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Code fun" /><category scheme="http://www.lybecker.com/blog" term="dotNet" />
		<summary type="html"><![CDATA[I’ve written about Garbage Collection in the .Net Framework in version 2.0 and 3.0 a couple of years ago, but now Red Gate has created a simple and easy to understand funny comic &#8220;Memory Management in .Net&#8221; Download the full one-page comic. The .Net Framework 4.0 provides the new default behavior of background garbage collection.]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2011/12/23/memorymanagementindotnet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memorymanagementindotnet"><![CDATA[<p><a href="http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/learning-memory-management/resources/GCPoster.pdf"></a>I’ve written about <a title="Garbage Collection flavors in .Net 2.0 and 3.0" href="/blog/2007/04/03/garbage-collection-flavors/">Garbage Collection in the .Net Framework in version 2.0 and 3.0 a couple of years ago</a>, but now Red Gate has created a simple and easy to understand funny comic &#8220;Memory Management in .Net&#8221;</p>
<p><a href="http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/learning-memory-management/resources/GCPoster.pdf"><img loading="lazy" class="alignnone size-full wp-image-997" title="Memory Management in .Net comic" src="http://www.lybecker.com/blog/wp-content/uploads/MemoryManagementInDotNet.png" alt="Memory Management in .Net comic" width="550" height="239" /></a></p>
<p><a title="Full Memory Management in .Net comic" href="http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/learning-memory-management/resources/GCPoster.pdf">Download the full one-page comic</a>.</p>
<p>The .Net Framework 4.0 provides the new default behavior of <a title="Background Garbage Collection on MSDN" href="http://msdn.microsoft.com/en-us/library/ee787088.aspx#background_garbage_collection">background garbage collection</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2011/12/23/memorymanagementindotnet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=memorymanagementindotnet#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2011/12/23/memorymanagementindotnet/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[An unfortunate travel story]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2011/11/21/an-unfortunate-travel-story/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-unfortunate-travel-story" />

		<id>http://www.lybecker.com/blog/?p=966</id>
		<updated>2011-11-21T06:21:20Z</updated>
		<published>2011-11-21T06:21:20Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Announcement" />
		<summary type="html"><![CDATA[The last two and a half weeks have been interesting for me &#8211; Interesting in the “what doesn&#8217;t kill you makes you stronger” kind of way. Here is my challenging story… I was on a leisure trip to Rome, Italy to see the sights. A beautiful city with many cites like the Vatican, the Colosseum [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2011/11/21/an-unfortunate-travel-story/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-unfortunate-travel-story"><![CDATA[<p>The last two and a half weeks have been interesting for me &#8211; Interesting in the “what doesn&#8217;t kill you makes you stronger” kind of way. Here is my challenging story…</p>
<p>I was on a leisure trip to Rome, Italy to see the sights. A beautiful city with many cites like the Vatican, the Colosseum and the Spanish Steps. I was supposed to flight directly to Manila, Philippines from Rome to assist a customer. The customer was finalizing my travel plans while I was in Rome. Unfortunately I lost my mobile phone in Rome which made it rather difficult to coordinate the travel plans, but after 3 or 4 different travel itineraries the flight was booked from Rome to Italy via Seoul, Korea.</p>
<p>I arrived in Manila through Seoul only to find out the hotel was not confirmed. To make things worse, they were fully booked and so were all the other hotels in the Makati area in Metro Manila. After an hours searching I managed to find a hotel room for the night, but I had to find another hotel for the next day.</p>
<p>Apparently available rooms where in short supply in Makati area as I had to change hotel the next five days. I could not book a consecutive reservation at the same hotel. I slept in rooms ranging from extravagant 150 m2 suites to 15 m2 crummy hotel room with ants in my bed. It was tiring, but the weekend retreat to lovely Philippine island of Bohol the following weekend made me see everything in a brighter light.</p>
<p><img loading="lazy" class="size-medium wp-image-971 alignright" title="Philippines Tricycle" src="http://www.lybecker.com/blog/wp-content/uploads/Philippines-Tricycle-300x224.jpg" alt="" width="300" height="224" /><img loading="lazy" class="size-medium wp-image-972 alignright" title="Phillippines Jeepney" src="http://www.lybecker.com/blog/wp-content/uploads/Phillippines-Jeepney-300x225.jpg" alt="" width="300" height="225" /><img loading="lazy" class="size-medium wp-image-969 alignleft" title="Alona Beach at Bohol Island, Philippines" src="http://www.lybecker.com/blog/wp-content/uploads/bohol-alona-beach-300x198.jpg" alt="" width="300" height="198" /><img loading="lazy" class="size-medium wp-image-968 alignleft" title="Chocolate Hills at Bohol Island, Philippines" src="http://www.lybecker.com/blog/wp-content/uploads/Bohol-Chocolate-Hills-300x283.jpg" alt="" width="300" height="283" />Friday I had to catch the flight to Bohol, so I took a taxi to the airport. Unfortunately the taxi was barely able to carry its own weight up the Skyway ramp and half way it gave up and broke down. I was now stuck in the middle of Manila with no other available taxi in sight and I was now late and might not make the flight to the lovely island of Bohol. I tried to persuade a tricycle to drive me to the airport, but they were not allowed to enter the airport area – then I tried to hire a Jeepney, but the driver was overly greedy and my attempt to barging failed. Luckily a taxi appeared from nowhere and I was on my way to the airport.</p>
<p>I arrived 25 minutes after the check-in was closed and 5 minutes before departure. I was immediately redirected to the supervisor, who luckily let me check-in – I rushed through the security check and directly onto the waiting flight.</p>
<p>It was a great weekend retreat to Bohol, where I say the <a title="Description of Tarsier on Wikipedia" href="http://en.wikipedia.org/wiki/Tarsier">Tarsier</a>, <a title="Chocolate Hills on Wikipedia" href="http://en.wikipedia.org/wiki/Chocolate_Hills">Chocolate Hills</a> and snorkeled at the coral reef where I saw clown fish and a turtle.</p>
<p>Back in Manila and an additional week work it was Friday and time to travel back home to Copenhagen, Denmark. Due to the confusion of the travel itineraries I apparently was supposed to travel home the day before, Thursday and not Friday. I was too late, as it was already Friday. So I had to find another flight from Manila to Copenhagen the same day… With some help from the very helpful Filipino Lee, I managed to get a flight Friday night with Thai Airways through Bangkok, Thailand.</p>
<p>It was a long trip home as Thai Airways does not have inflight entertainment systems in any of their aircrafts – I thought it was standard in this day and age.</p>
<p>I’m now home – still without a mobile phone. Fortunately I can already look back at this unfortunate trip a laugh. I enjoyed the trip both to Rome and the Philippines even though there where so many things working against me.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2011/11/21/an-unfortunate-travel-story/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-unfortunate-travel-story#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2011/11/21/an-unfortunate-travel-story/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Using Lucene.Net with Microsoft Azure]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2011/01/16/using-lucene-net-with-microsoft-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-lucene-net-with-microsoft-azure" />

		<id>http://www.lybecker.com/blog/?p=867</id>
		<updated>2011-01-16T16:17:24Z</updated>
		<published>2011-01-16T16:17:24Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Lucene" /><category scheme="http://www.lybecker.com/blog" term="Windows Azure" /><category scheme="http://www.lybecker.com/blog" term="Azure" /><category scheme="http://www.lybecker.com/blog" term="Blob Storage" /><category scheme="http://www.lybecker.com/blog" term="CloudDrive" /><category scheme="http://www.lybecker.com/blog" term="Lucene.Net" />
		<summary type="html"><![CDATA[Lucene indexes are usually stored on the file system and preferably on the local file system. In Azure there are additional types of storage with different capabilities, each with distinct benefits and drawbacks. The options for storing Lucene indexes in Azure are: Azure CloudDrive Azure Blob Storage Azure CloudDrive CloudDrive is the obvious solutions, as [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2011/01/16/using-lucene-net-with-microsoft-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-lucene-net-with-microsoft-azure"><![CDATA[<p><img loading="lazy" class="alignright size-thumbnail wp-image-920" title="azure_logo" src="http://www.lybecker.com/blog/wp-content/uploads/azure_logo-150x74.png" alt="" width="150" height="74" />Lucene indexes are usually stored on the file system and preferably on the local file system. In Azure there are additional types of storage with different capabilities, each with distinct benefits and drawbacks. The options for storing Lucene indexes in Azure are:</p>
<ul>
<li>Azure CloudDrive</li>
<li>Azure Blob Storage</li>
</ul>
<h3>Azure CloudDrive</h3>
<p>CloudDrive is the obvious solutions, as it is comparable to on premise file systems with mountable virtual hard drives (VHDs). CloudDrive is however not the optimal choice, as CloudDrive impose notable limitations. The most significant limitation is; only one web role, worker role or VM role can mount the CloudDrive at a time with read/write access. It is possible to mount multiple read-only snapshots of a CloudDrive, but you have to manage creation of new snapshots yourself depending on acceptable staleness of the Lucene indexes.</p>
<h3>Azure Blob Storage</h3>
<p>The alternative Lucene index storage solution is Blob Storage. Luckily a Lucene directory (Lucene index storage) implementation for Azure Blob Storage exists in the <a title="Azure library for Lucene.Net home on MSDN Code Gallery" href="http://code.msdn.microsoft.com/AzureDirectory">Azure library for Lucene.Net</a>. It is called AzureDirectory and allows any role to modify the index, but only one role at a time. Furthermore each Lucene segment (See Lucene Index Segments) is stored in separate blobs, therefore utilizing many blobs at the same time. This allows the implementation to cache each segment locally and retrieve the blob from Blob Storage only when new segments are created. Consequently compound file format should not be used and optimization of the Lucene index is discouraged.</p>
<h4>Code sample</h4>
<p>Getting Lucene.Net up and running is simple, and using it with Azure library for Lucene.Net requires only the Lucene directory to be changes as highlighted below in Lucene index and search example. Most of it is Azure specific configuration pluming.</p>
<pre class="brush: csharp; highlight: [3,4,5,6,8,9,11,13,14,15]; title: ; notranslate">
Lucene.Net.Util.Version version = Lucene.Net.Util.Version.LUCENE_29;

CloudStorageAccount.SetConfigurationSettingPublisher(
    (configName, configSetter) =&gt;
        configSetter(RoleEnvironment
        .GetConfigurationSettingValue(configName)));

var cloudAccount = CloudStorageAccount
    .FromConfigurationSetting(&quot;LuceneBlobStorage&quot;);

var cacheDirectory = new RAMDirectory();

var indexName = &quot;MyLuceneIndex&quot;;
var azureDirectory =
    new AzureDirectory(cloudAccount, indexName, cacheDirectory);

var analyzer = new StandardAnalyzer(version);

// Add content to the index
var indexWriter = new IndexWriter(azureDirectory, analyzer,
    IndexWriter.MaxFieldLength.UNLIMITED);
indexWriter.SetUseCompoundFile(false);

foreach (var document in CreateDocuments())
{
    indexWriter.AddDocument(document);
}

indexWriter.Commit();
indexWriter.Close();

// Search for the content
var parser = new QueryParser(version, &quot;text&quot;, analyzer);
Query q = parser.Parse(&quot;azure&quot;);

var searcher = new IndexSearcher(azureDirectory, true);

TopDocs hits = searcher.Search(q, null, 5, Sort.RELEVANCE);

foreach (ScoreDoc match in hits.scoreDocs)
{
    Document doc = searcher.Doc(match.doc);

    var id = doc.Get(&quot;id&quot;);
    var text = doc.Get(&quot;text&quot;);
}
searcher.Close();
</pre>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/AzureLuceneIndex.zip">Download the reference example</a> which uses Azure SDK 1.3 and Lucene.Net 2.9 in a console application connecting either to Development Fabric or your Blob Storage account.</p>
<h3>Lucene Index Segments (simplified)</h3>
<p>Segments are the essential building  block in Lucene. A Lucene index  consists of one or more segments, each a  standalone index. Segments are  immutable and created when an  IndexWriter flushes. Deletes or updates  to an existing segment are  therefore not removed stored in the original  segment, but marked as  deleted, and the new documents are stored in a  new segment.</p>
<p>Optimizing an index reduces the number of segments, by creating a new segment with all the content and deleting the old ones.</p>
<h3>Azure library for Lucene.Net facts</h3>
<ul>
<li>It is licensed under Ms-PL, so you do pretty much whatever you want to do with the code.</li>
<li>Based on Block Blobs (optimized for streaming) which is in tune with Lucene’s incremental indexing architecture (immutable segments) and the caching features of the AzureDirectory voids the need for random read/write of the Blob Storage.</li>
<li>Caches index segments locally in any Lucene directory (e.g. RAMDirectory) and by default in the volatile Local Storage.</li>
<li>Calling Optimize recreates the entire blob, because all Lucene segment combined into one segment. Consider not optimizing.</li>
<li>Do not use Lucene compound files, as index changes will recreate the entire blob. Also this stores the entire index in one blob (+metadata blobs).</li>
<li>Do use a <a title="Azure Virtual Machine sizes" href="http://msdn.microsoft.com/en-us/library/ee814754.aspx">VM role size (Small, Medium, Large or ExtraLarge)</a> where the Local Resource size is larger than the Lucene index, as the Lucene segments are cached by default in Local Resource storage.</li>
</ul>
<h3>Azure CloudDrive facts</h3>
<ul>
<li>Only Fixed Size VHDs are supported.</li>
<li>Volatile Local Resources can be used to cache VHD content</li>
<li>Based on Page Blobs (optimized for random read/write).</li>
<li>Stores the entire VHS in one Page Blob and is therefore restricted to the Page Blob maximum limit of 1 TByte.</li>
<li>A role can mount up to 16 drives.</li>
<li>A CloudDrive can only be mounted to a single VM instance at a time for read/write access.</li>
<li>Snapshot CloudDrives are read-only and can be mounted as read-only drives by multiple different roles at the same time.</li>
</ul>
<h3>Additional Azure references</h3>
<ul>
<li><a title="Article on MSDN" href="http://msdn.microsoft.com/en-us/library/ee691964.aspx">Understanding Block Blobs and Page Blobs</a></li>
<li><a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/11/using-windows-azure-page-blobs-and-how-to-efficiently-upload-and-download-page-blobs.aspx">Using Windows Azure Page Blobs and How to Efficiently Upload and Download Page Blobs</a></li>
<li><a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/03/29/windows-azure-drive-demo-at-mix-2010.aspx">Windows Azure CloudDrive Demo</a></li>
</ul>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2011/01/16/using-lucene-net-with-microsoft-azure/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-lucene-net-with-microsoft-azure#comments" thr:count="3"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2011/01/16/using-lucene-net-with-microsoft-azure/feed/atom/" thr:count="3"/>
			<thr:total>3</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[CNUG Lucene.Net presentation]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2011/01/10/cnug-lucene-net-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cnug-lucene-net-presentation" />

		<id>http://www.lybecker.com/blog/?p=926</id>
		<updated>2016-05-07T20:53:29Z</updated>
		<published>2011-01-10T19:21:26Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Lucene" /><category scheme="http://www.lybecker.com/blog" term="CNUG" /><category scheme="http://www.lybecker.com/blog" term="Lucene.Net" /><category scheme="http://www.lybecker.com/blog" term="Presentation" />
		<summary type="html"><![CDATA[I have just held another presentation about Lucene.Net, this time in Copenhagen .Net user group. I hope everyone enjoyed the presentation and walked away with newfound knowledge how to implement full text search into their applications. I love the presentations, like this one, where everyone participates in the discussion. It makes the experience so much [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2011/01/10/cnug-lucene-net-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cnug-lucene-net-presentation"><![CDATA[<p>I have just held another presentation about Lucene.Net, this time in <a title="Copenhagen .NET User Group homepage" href="http://cnug.dk/">Copenhagen .Net user group</a>. I hope everyone enjoyed the presentation and walked away with newfound knowledge how to implement full text search into their applications.</p>
<p><a href="http://www.manning.com/hatcher3/"><img loading="lazy" class="alignright size-full wp-image-927" title="Lucene In Action" src="http://www.lybecker.com/blog/wp-content/uploads/LuceneInAction.jpg" alt="" width="240" height="240" /></a>I love the presentations, like this one, where everyone participates in the discussion. It makes the experience so much enjoyable and everyone benefits of the collective knowledge sharing.</p>
<p>The presentation and code samples can be downloaded below:</p>
<ul>
<li> Presentation (<a href="http://www.lybecker.com/blog/wp-content/uploads/Apache-Lucene-CNUG.pdf">pdf</a>)</li>
<li> <a href="http://www.lybecker.com/blog/wp-content/uploads/CnugLucenePlayground.zip">Code samples (Visual Studio 2010)</a></li>
</ul>
<p>I recommend the book <a href="http://www.manning.com/hatcher3/">&#8220;Lucene in Action&#8221; by Eric Hatcher</a>. The samples in this book are all in Java, but they apply equally to Lucene.Net, as it is a 1:1 port of the Java implementation.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2011/01/10/cnug-lucene-net-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cnug-lucene-net-presentation#comments" thr:count="3"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2011/01/10/cnug-lucene-net-presentation/feed/atom/" thr:count="3"/>
			<thr:total>3</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Microsoft Julekalender låge #7 vinder]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/12/08/851/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=851" />

		<id>http://www.lybecker.com/blog/?p=851</id>
		<updated>2010-12-08T20:33:53Z</updated>
		<published>2010-12-08T20:33:53Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Announcement" /><category scheme="http://www.lybecker.com/blog" term="WCF" /><category scheme="http://www.lybecker.com/blog" term="Daniel Frost" /><category scheme="http://www.lybecker.com/blog" term="Julekalender" /><category scheme="http://www.lybecker.com/blog" term="Microsoft" /><category scheme="http://www.lybecker.com/blog" term="Performance" />
		<summary type="html"><![CDATA[Yet another blog post in Danish, sorry. Vinderen af gårsdagens Microsoft Julekalender låge #7 fundet. Vinderen er Gianluca Bosco, som har indsendt følgende WCF klient til servicen: Gianluca har rigtig nok fundet den værste performance synder af dem alle, at man ikke skal instantier en ChannelFactory for hvert kald. Alene denne forbedring kan halvere tiden [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/12/08/851/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=851"><![CDATA[<p>Yet another blog post in Danish, sorry.</p>
<p>Vinderen af <a title="Microsoft Julekalender 2010 låge #7" href="/blog/2010/12/07/microsoft-julekalender-lage-7/">gårsdagens Microsoft Julekalender låge #7 fundet</a>. Vinderen er Gianluca Bosco, som har indsendt følgende WCF klient til servicen:</p>
<pre class="brush: csharp; highlight: [8,9,10,12]; title: ; notranslate">
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine(&quot;Ready? Press [ENTER]...&quot;);
        Console.ReadLine();

        var factory = new ChannelFactory&lt;Shared.IMyService&gt;(
            new WSHttpBinding(),
            new EndpointAddress(&quot;http://localhost:8080/MyService&quot;));

        factory.Endpoint.Binding.SendTimeout = new TimeSpan(0,2,0);

        var names = new[] { &quot;Anders&quot;, &quot;Bende&quot;, &quot;Bo&quot;, &quot;Egon&quot;,
            &quot;Jakob&quot;, &quot;Jesper&quot;, &quot;Jonas&quot;, &quot;Martin&quot;, &quot;Ove&quot;,
            &quot;Rasmus&quot;, &quot;Thomas E&quot;, &quot;Thomas&quot; };

        var x = from name in names.AsParallel()
                    .WithDegreeOfParallelism(12)
                select Do(factory, name);

        x.ForAll(Console.WriteLine);

        Console.WriteLine(&quot;Done processing...&quot;);
        Console.ReadLine();
    }

    static string Do(ChannelFactory&lt;Shared.IMyService&gt; factory,
         string name)
    {
        var proxy = factory.CreateChannel();

        var result = proxy.LooongRunningMethod(name);

        return result;
    }
}
</pre>
<p>Gianluca har rigtig nok fundet den værste performance synder af dem alle, at man ikke skal instantier en ChannelFactory for hvert kald. Alene denne forbedring kan halvere tiden brugt ved et WCF kald.</p>
<p>Desuden fandt Gianluca den indbyggede fælde i min implementation. Server implementationen kalder Thread.Sleep (mellem 1 og 100 sekunder) for at simulere langvarigt arbejde. Default SendTimout på wsHttpBinding (og alle andre bindings) er 1 minut, hvilket betyder, at klienten vil få en TimeoutException pga. serverens lange arbejde.</p>
<p>Tillykke til Gianluca med hans nye helikopter.</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Blade_mCX2.jpg"><img loading="lazy" class="aligncenter size-medium wp-image-823" title="Remote controlled helicopter model Blade mCX2" src="http://www.lybecker.com/blog/wp-content/uploads/Blade_mCX2-300x300.jpg" alt="" width="300" height="300" /></a></p>
<p>Der er en mindre optimering, som kan forbedre performance yderligere og det er at kalde Open og Close på en Channel explicit. Det skyldes, at der i en implicit Open er thread synchronisation, således at kun én thread åbner en Channel og de resterende threads venter på at Channel er klar.</p>
<p>Hvis du har forslag til yderligere forbedringer, så skriv en kommentar.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/12/08/851/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=851#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/12/08/851/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Microsoft Julekalender låge #7]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/12/07/microsoft-julekalender-lage-7/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=microsoft-julekalender-lage-7" />

		<id>http://www.lybecker.com/blog/?p=819</id>
		<updated>2010-12-07T06:45:28Z</updated>
		<published>2010-12-07T06:45:28Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Announcement" /><category scheme="http://www.lybecker.com/blog" term="WCF" /><category scheme="http://www.lybecker.com/blog" term="Daniel Frost" /><category scheme="http://www.lybecker.com/blog" term="Julekalender" /><category scheme="http://www.lybecker.com/blog" term="Microsoft" /><category scheme="http://www.lybecker.com/blog" term="Performance" />
		<summary type="html"><![CDATA[Sorry – this post is in Danish. Dagens opgave handler om Windows Communication Foundation. WCF er kompleks pga. mængden af funktionalitet og kan derfor virke indviklet. Kompleksiteten afspejles også i størrelsen på WCF assembly System.ServiceModel.dll, som er klart den største assembly i hele .Net Framework Class Library (FCL) … selv større end mscorlib.dll. Opgaven: Implementer [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/12/07/microsoft-julekalender-lage-7/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=microsoft-julekalender-lage-7"><![CDATA[<p><a href="http://danielfrost.dk/post/Mr-Frosts-Julekalender-starter-pa-Onsdag!-Er-du-klar-.aspx"><img loading="lazy" class="alignnone size-full wp-image-821" title="Microsoft Julekalender 2010" src="http://www.lybecker.com/blog/wp-content/uploads/MicrosoftJulekalender2010.png" alt="" width="550" height="157" /></a></p>
<p>Sorry – this post is in Danish.</p>
<p>Dagens opgave handler om Windows Communication Foundation.  WCF er kompleks pga. mængden af funktionalitet og kan derfor virke indviklet. Kompleksiteten afspejles også i størrelsen på WCF assembly System.ServiceModel.dll, som er klart den største assembly i hele .Net Framework Class Library (FCL) … selv større end mscorlib.dll.</p>
<p><strong>Opgaven:</strong></p>
<p>Implementer en klient til nedstående service, som benytter WSHttpBinding med default settings.</p>
<pre class="brush: csharp; title: ; notranslate">
[ServiceContract(Namespace = &quot;www.lybecker.com/blog/wcfriddle&quot;)]
public interface IMyService
{
    [OperationContract(ProtectionLevel =
        ProtectionLevel.EncryptAndSign)]
    string LooongRunningMethod(string name);
}

public class MyService : IMyService
{
    public string LooongRunningMethod(string name)
    {
        Console.WriteLine(&quot;{0} entered.&quot;, name);

        // Simulate work by random sleeping
        var rnd = new Random(
            name.Select(Convert.ToInt32).Sum() +
            Environment.TickCount);
        var sleepSeconds = rnd.Next(0, 100);
        System.Threading.Thread.Sleep(sleepSeconds * 1000);

        var message = string.Format(
            &quot;{0} slept for {1} seconds in session {2}.&quot;,
            name,
            sleepSeconds,
            OperationContext.Current.SessionId);
        Console.WriteLine(message);

        return message;
    }
}
</pre>
<p>Klienten må meget gerne være smukt struktureret og skal:</p>
<ul>
<li>Implementeres i .Net 3.x eller .Net 4.0</li>
<li>Simulere et dusin forskellige klienter</li>
<li>Være så effektiv som mulig (tænk memory, CPU cycles, GC)</li>
</ul>
<p>Beskriv kort jeres valg af optimeringer.</p>
<p>For at gøre opgaven nemmere at løse, så har jeg allerede løst den for jer… dog ikke optimalt. <a href="/blog/wp-content/uploads/WcfRiddle.zip">Download min implementation</a>.</p>
<p>Send løsning til anders at lybecker.com inden midnat; vinderen vil bliver offentligt i morgen og vil blive den lykkelige ejer af en fjernstyrret helikopter med tilbehør, så den er klar til af flyve. En cool office gadget. Helikopteren er nem at flyve og kan holde til en del. Det ved jeg af erfaring <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Se helikopteren flyve nedefor.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="331" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/gAlM4FBtDGI?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="550" height="331" src="http://www.youtube.com/v/gAlM4FBtDGI?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/12/07/microsoft-julekalender-lage-7/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=microsoft-julekalender-lage-7#comments" thr:count="1"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/12/07/microsoft-julekalender-lage-7/feed/atom/" thr:count="1"/>
			<thr:total>1</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[ANUG Solr/Lucene presentation]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/10/27/anug-solrlucene-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=anug-solrlucene-presentation" />

		<id>http://www.lybecker.com/blog/?p=805</id>
		<updated>2010-10-27T22:56:42Z</updated>
		<published>2010-10-27T22:56:42Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Lucene" /><category scheme="http://www.lybecker.com/blog" term="ANUG" /><category scheme="http://www.lybecker.com/blog" term="Presentation" /><category scheme="http://www.lybecker.com/blog" term="Solr" />
		<summary type="html"><![CDATA[I am on the train to Copenhagen after a successful presentation of Solr/Lucene at the Aarhus .NET user group. The presentation went very well judging by the number of questions during the almost 2½ hour long presentation and the feedback afterwards. Love it – thanks 🙂 The presentation and code samples can be downloaded below: [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/10/27/anug-solrlucene-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=anug-solrlucene-presentation"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/ANUG.gif"><img loading="lazy" class="alignright size-full wp-image-814" title="ANUG" src="http://www.lybecker.com/blog/wp-content/uploads/ANUG.gif" alt="Aarhus .NET user group" width="150" height="85" /></a>I am on the train to Copenhagen after a successful presentation of Solr/Lucene at the <a title="AArhus .NET user group homepage" href="http://www.anug.dk/">Aarhus .NET user group</a>.</p>
<p>The presentation went very well judging by the number of questions during the almost 2½ hour long presentation and the feedback afterwards. Love it – thanks <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The presentation and code samples can be downloaded below:</p>
<ul>
<li>Presentation (<a href="http://www.lybecker.com/blog/wp-content/uploads/Apache-Lucene-ANUG.pdf">pdf</a>|<a href="http://www.lybecker.com/blog/wp-content/uploads/Apache-Lucene-ANUG.pptx">pptx</a>)</li>
<li><a href="http://www.lybecker.com/blog/wp-content/uploads/AnugLucenePlayground.zip">Code samples (Visual Studio 2010)</a></li>
</ul>
<p>Please do contact me if you have any further questions – I’ll love to help out.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/10/27/anug-solrlucene-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=anug-solrlucene-presentation#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/10/27/anug-solrlucene-presentation/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[WCF Timeouts]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/10/14/wcf-timeouts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-timeouts" />

		<id>http://www.lybecker.com/blog/?p=787</id>
		<updated>2016-05-07T20:56:54Z</updated>
		<published>2010-10-14T10:22:58Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="WCF" /><category scheme="http://www.lybecker.com/blog" term="ws-*" /><category scheme="http://www.lybecker.com/blog" term="Performance" /><category scheme="http://www.lybecker.com/blog" term="Throttling" /><category scheme="http://www.lybecker.com/blog" term="Timeout" />
		<summary type="html"><![CDATA[The last two articles about WCF Throttling part 1 and part 2 would not be complete without looking at WCF timeouts. Any potentially lengthy operation must have a timeout or the system might end up waiting indefinitely – this is remarkably prevalent when working across any network connection (Yes, LAN connections too). Timeouts are not [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/10/14/wcf-timeouts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-timeouts"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Timeout.png"><img loading="lazy" class="alignright size-medium wp-image-791" title="Timeout" src="http://www.lybecker.com/blog/wp-content/uploads/Timeout-300x300.png" alt="" width="170" height="170" /></a>The last two articles about WCF Throttling <a title="WCF Throttling - Part 1" href="/blog/2010/10/06/wcf-throttling-part-1/">part 1</a> and <a title="WCF Throttling - Part 2" href="/blog/2010/10/11/wcf-throttling-part-2/">part 2</a> would not be complete without looking at WCF timeouts. Any potentially lengthy operation must have a timeout or the system might end up waiting indefinitely – this is remarkably prevalent when working across any network connection (Yes, LAN connections too).</p>
<p>Timeouts are not directly related to throttling properties, but effect the way the service (or client) performance under load. Timeout properties can be perceived as an annoyance when sending larger messages or dealing with slow connections or services. The frustration increase as the naming of the properties can be deceiving. Read on… and I’ll explain <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Below are the binding properties that all throw TimeoutExceptions if any of setting thresholds are exceeded:</p>
<ul>
<li>OpenTimeout (TimeSpan) &#8211; the interval of time provided for an open operation to complete including security handshakes (WS-Trust, WS-Secure Conversation etc.). The default is 00:01:00.</li>
<li>CloseTimeout (TimeSpan) &#8211; the interval of time provided for a close operation to complete. The default is 00:01:00.</li>
<li>SendTimeout (TimeSpan) &#8211; the interval of time provided for an entire operation to complete. This includes both sending of message and receiving reply! The default is 00:01:00.</li>
<li>ReceiveTimeout (TimeSpan) &#8211; the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped. The default is 00:10:00.
<ul>
<li>This setting is only used on the server-side and has no effect on client-side.</li>
<li>When using Reliable Sessions remember to set the <a title="ReliableSession.InactivityTimeout property on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.reliablesession.inactivitytimeout.aspx">InactivityTimeout</a> property on the reliableSession element to the same value as the <a title="Binding.ReceiveTimeout property on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.binding.receivetimeout.aspx">ReceiveTimeout</a> property, as both inactivity timers has to be satisfied.</li>
</ul>
</li>
</ul>
<p>Example of configuration file:</p>
<pre class="brush: sql; title: ; notranslate">
&lt;system.serviceModel&gt;
  &lt;bindings&gt;
    &lt;netTcpBinding&gt;
      &lt;binding name=&quot;netTcpBindingConfig&quot;
               openTimeout=&quot;00:01:00&quot;
               closeTimeout=&quot;00:01:00&quot;
               sendTimeout=&quot;00:01:00&quot;
               receiveTimeout=&quot;00:10:00&quot;&gt;
        &lt;reliableSession enabled=&quot;true&quot;
                         inactivityTimeout=&quot;00:10:00&quot; /&gt;
      &lt;/binding&gt;
    &lt;/netTcpBinding&gt;
  &lt;/bindings&gt;
&lt;/system.serviceModel&gt;
</pre>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/10/14/wcf-timeouts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-timeouts#comments" thr:count="3"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/10/14/wcf-timeouts/feed/atom/" thr:count="3"/>
			<thr:total>3</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[WCF Throttling – Part 2]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/10/11/wcf-throttling-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-2" />

		<id>http://www.lybecker.com/blog/?p=773</id>
		<updated>2016-05-07T20:55:23Z</updated>
		<published>2010-10-11T18:05:40Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="WCF" /><category scheme="http://www.lybecker.com/blog" term="Performance" /><category scheme="http://www.lybecker.com/blog" term="Throttling" />
		<summary type="html"><![CDATA[In the WCF Throttling – Part 1 article the service throttling behavior was introduced. There are other throttling features in WCF that are designed to protect the service from request flooding. These WCF throttling feature are configured on the binding, service behaviors and endpoint behaviors. Binding properties: MaxConnections (int) &#8211; specifies the maximum number of [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/10/11/wcf-throttling-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-2"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Funnel.jpg"><img loading="lazy" class="alignright size-full wp-image-780" title="Funnel" src="http://www.lybecker.com/blog/wp-content/uploads/Funnel.jpg" alt="" width="158" height="140" /></a>In the <a title="WCF Throttling - Part 1" href="/blog/2010/10/06/wcf-throttling-part-1/">WCF Throttling – Part 1</a> article the service throttling behavior was introduced.</p>
<p>There are other throttling features in WCF that are designed to protect the service from request flooding.</p>
<p>These WCF throttling feature are configured on the binding, service behaviors and endpoint behaviors.</p>
<p>Binding properties:</p>
<ul>
<li>MaxConnections (int) &#8211; specifies the maximum number of outbound and inbound connections the service creates and accepts respectively. Default value is 10 connections. This setting only applies for statefull TCP connections like <a title="netTcpBinding configuration on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.nettcpbindingelement.aspx">netTcpBinding</a> and not stateless HTTP protocols like <a title="basicHttpBinding configuration on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.basichttpbindingelement.aspx">basicHttpBinding</a>, <a title="wsHttpBinding configuration on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.configuration.wshttpbindingelement.aspx">wsHttpBinding</a> or <a title="webHttpBinding configuration on MSDN" href="http://msdn.microsoft.com/en-us/library/bb412176.aspx">webHttpBinding</a>.</li>
<li>MaxReceivedMessageSize (long) &#8211; the maximum size of a message (including headers), that can be received on a channel. The sender of a message exceeding this limit will receive a fault and the receiver will drop the message. The default value is 65,536 bytes (64K).</li>
</ul>
<p>There are two additional properties on the binding that one might mistakenly think is request throttling properties. These are the MaxBufferPoolSize and MaxBufferSize properties and they control <a title="Detailed explanation of the WCF memory Buffer Manager" href="http://obsessivelycurious.blogspot.com/2008/04/wcf-memory-buffer-management.html">WCF memory Buffer Manager</a>.</p>
<p>Note: remember to set the MaxReceivedMessageSize and MaxBufferSize properties to the same value if using TransferMode.Buffered or an ArgumentException will be thrown at runtime with the message “For TransferMode.Buffered, MaxReceivedMessageSize and MaxBufferSize must be the same value.”</p>
<p>Binding properties for the <a title="readerQuotas element on MSDN" href="http://msdn.microsoft.com/en-us/library/ms731325.aspx">readerQuotas</a> element – used by XmlReader under the hood:</p>
<ul>
<li>MaxArrayLength (int) &#8211; the maximum allowed array length of data received from a client. The default is 16,384 (16K).</li>
<li>MaxBytesPerRead (int) &#8211; the maximum allowed bytes returned per read for the XmlReader. The default is 4,096 (4K).</li>
<li>MaxDepth (int) &#8211; the maximum XML nested node depth. The default is 32.</li>
<li>MaxNameTableCharCount (int) &#8211; the maximum characters allowed in a table name. This is the maximum length of an XML element or attributes identifier including XML namespace. The default is 16,384 (16K).</li>
<li>MaxStringContentLength (int) &#8211; the maximum characters allowed in XML element or attribute content. The default is 8,192 (8K).</li>
</ul>
<p>The <a title="DataContractSerializer on MSDN" href="http://msdn.microsoft.com/en-us/library/ms405768.aspx">DataContractSerializer</a> is by default used to serialize and deserialize messages as it is much faster the XMLSerializer, but with less features. The DataContractSerializer has a single property that can be configures at the endpoint or service behavior:</p>
<ul>
<li>MaxItemsInObjectGraph (int) &#8211; maximum number of items in an object graph to serialize or deserialize. The default is 65,536 (64K).</li>
</ul>
<p>Resist the temptation of settings any of these properties to Int.MaxValue and the likes, because determining the correct values are difficult. Throttle the service, so some clients gets served instead of risk boggling down the service with request flooding, resulting in no clients get served.</p>
<div>
<div>You will become the service hero in your organization by throttling instead of letting the service run wild <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></div>
<p>Example of configuration file:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name=&quot;endpointBehavior&quot;&gt;
        &lt;dataContractSerializer maxItemsInObjectGraph=&quot;65536&quot;/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name=&quot;serviceBehaviors&quot;&gt;
        &lt;dataContractSerializer maxItemsInObjectGraph=&quot;65536&quot;/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;bindings&gt;
    &lt;netTcpBinding&gt;
      &lt;binding name=&quot;netTcpBindingConfig&quot;
                maxReceivedMessageSize=&quot;65536&quot;
                maxConnections=&quot;10&quot;&gt;
        &lt;readerQuotas maxArrayLength=&quot;16384&quot;
                      maxBytesPerRead=&quot;4096&quot;
                      maxDepth=&quot;32&quot;
                      maxStringContentLength=&quot;8192&quot;
                      maxNameTableCharCount=&quot;16384&quot;/&gt;
      &lt;/binding&gt;
    &lt;/netTcpBinding&gt;
  &lt;/bindings&gt;
&lt;/system.serviceModel&gt;
</pre>
</div>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/10/11/wcf-throttling-part-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-2#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/10/11/wcf-throttling-part-2/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[WCF Throttling – Part 1]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/10/06/wcf-throttling-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-1" />

		<id>http://www.lybecker.com/blog/?p=765</id>
		<updated>2010-10-06T18:45:35Z</updated>
		<published>2010-10-06T18:45:35Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="WCF" /><category scheme="http://www.lybecker.com/blog" term=".Net 4" /><category scheme="http://www.lybecker.com/blog" term="dotNet" /><category scheme="http://www.lybecker.com/blog" term="Performance" /><category scheme="http://www.lybecker.com/blog" term="Throttling" />
		<summary type="html"><![CDATA[The default throttling settings in WCF has always been very conservative. There where configured conservatively to diminish the risk of request flooding. Without throttling settings a large number of requests will make the service unresponsive by consuming all resources trying to respond to all requests simultaneously. Because of the very conservative settings many developers have [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/10/06/wcf-throttling-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-1"><![CDATA[<p>The default throttling settings in WCF has always been very conservative. There where configured conservatively to diminish the risk of request flooding. Without throttling settings a large number of requests will make the service unresponsive by consuming all resources trying to respond to all requests simultaneously.</p>
<p>Because of the very conservative settings many developers have run into what seems like WCF performance problems, but was actually incorrectly configured throttling settings.</p>
<p>WCF throttling is a service behavior configuration and each setting has effect dependent on the <a title="InstanceContextMode enum on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.instancecontextmode(v=VS.100).aspx">InstanceContextMode</a> and <a title="ConcurrencyMode enum on MSDN" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.concurrencymode.aspx">ConcurrencyMode</a> settings.</p>
<ul>
<li>maxConcurrentCalls (int) &#8211; the maximum number of concurrent messages processing</li>
<li>maxConcurrentInstances (int) &#8211; the maximum number of concurrent InstanceContext (service type instances) objects processing</li>
<li>maxConcurrentSessions (int) &#8211; the maximum number of concurrent sessions processing</li>
</ul>
<p>These throttling settings can be configured in code via the ServiceThrottlingBehavior in the System.ServiceModel.Description namespace or though configuration like below:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;system.serviceModel&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name=&quot;throttlingServiceBehavior&quot;&gt;
        &lt;serviceThrottling maxConcurrentCalls=&quot;16&quot;
                           maxConcurrentInstances=&quot;160&quot;
                           maxConcurrentSessions=&quot;10&quot;/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
&lt;/system.serviceModel&gt;
</pre>
<p>The default values in .Net 3.0/3.5 are:</p>
<ul>
<li>maxConcurrentCalls = 16</li>
<li>maxConcurrentSessions = 10</li>
<li>maxConcurrentInstances = maxConcurrentCalls + maxConcurrentSessions</li>
</ul>
<p>The default has changed in .Net 4.0 as the .Net 3.0/3.5 default values were too conservative and the increase in server resources – especially the number of cores available. The default values for .Net 4.0 are:</p>
<ul>
<li>maxConcurrentCalls = 16 * Environment.ProcessorCount</li>
<li>maxConcurrentSessions = 100 * Environment.ProcessorCount</li>
<li>maxConcurrentInstances = maxConcurrentCalls + maxConcurrentSessions</li>
</ul>
<p>The Environment.ProcessorCount property is misleading as the value is the number of cores (Hyper-Threading counts double). In my development laptop with four Hyper-Threading cores looks like this:</p>
<p><a href="http://www.lybecker.com/blog/wp-content/uploads/WcfThrottlingDotNet4.png"><img loading="lazy" class="aligncenter size-full wp-image-766" title="WCF Throttling DotNet 4.0 default settings" src="http://www.lybecker.com/blog/wp-content/uploads/WcfThrottlingDotNet4.png" alt="" width="628" height="124" /></a></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/10/06/wcf-throttling-part-1/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wcf-throttling-part-1#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/10/06/wcf-throttling-part-1/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Raoul Illyés, Microsoft MVP]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/10/05/raoul-illyes-microsoft-mvp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raoul-illyes-microsoft-mvp" />

		<id>http://www.lybecker.com/blog/?p=753</id>
		<updated>2010-10-05T18:32:56Z</updated>
		<published>2010-10-05T18:32:56Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Announcement" /><category scheme="http://www.lybecker.com/blog" term="SQL Server" /><category scheme="http://www.lybecker.com/blog" term="MVP SQL Server" />
		<summary type="html"><![CDATA[A friend and former colleague of mine Raoul Illyés has been awarded Microsoft MVP for SQL Server. I am delighted and lucky to continue working with Raoul and his new company Guide-line. Congratulations – It’s about time 🙂]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/10/05/raoul-illyes-microsoft-mvp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raoul-illyes-microsoft-mvp"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Microsoft_MVP_logo.png"><img loading="lazy" class="alignright size-full wp-image-754" title="Microsoft MVP logo" src="http://www.lybecker.com/blog/wp-content/uploads/Microsoft_MVP_logo.png" alt="" width="86" height="135" /></a>A friend and former colleague of mine <a title="Raoul Illyés Blog" href="http://www.guide-line.com/archives/295">Raoul Illyés has been awarded Microsoft MVP for SQL Server</a>.</p>
<p>I am delighted and lucky to continue working with Raoul and his new company <a title="Guide-line homepage" href="http://www.guide-line.com/">Guide-line</a>.</p>
<p>Congratulations – It’s about time <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/10/05/raoul-illyes-microsoft-mvp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raoul-illyes-microsoft-mvp#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/10/05/raoul-illyes-microsoft-mvp/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[ASP.Net Security Vulnerability]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/09/20/asp-net-security-vulnerability/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-security-vulnerability" />

		<id>http://www.lybecker.com/blog/?p=737</id>
		<updated>2010-09-20T18:54:14Z</updated>
		<published>2010-09-20T18:54:14Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Announcement" /><category scheme="http://www.lybecker.com/blog" term="Security" /><category scheme="http://www.lybecker.com/blog" term="ASP.Net Vulnerability" />
		<summary type="html"><![CDATA[Friday the September 17th a serious security exploit was demonstrated at security conference by Juliano Rizzo and Thai Duong. A tool called POET (Padding Oracle Exploit Tool) was used to show the exploit in both .Net and Java. POET exploits a well-known vulnerability in the way many websites encrypt text stored in ViewState, form authentication [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/09/20/asp-net-security-vulnerability/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-security-vulnerability"><![CDATA[<p>Friday the September 17th a serious <a title="Microsoft Security Advisory (2416728) Vulnerability in ASP.NET Could Allow Information Disclosure " href="http://www.microsoft.com/technet/security/advisory/2416728.mspx">security exploit</a> was demonstrated at security conference by Juliano Rizzo and Thai Duong. A tool called POET (Padding Oracle Exploit Tool) was used to show the exploit in both .Net and Java.</p>
<p>POET exploits a well-known vulnerability in the way many websites encrypt text stored in ViewState, form authentication tickets, cookies, hidden HTML fields and request parameters.</p>
<p>It a deficiency in the encryption libraries in both Java and the .Net framework utilizing the fact that encrypted strings are padded in blocks of e.g. 8 bytes or 16 bytes or …. I will not go into details, as it is explained well in details <a title="Article Automated Padding Oracle Attacks with PadBuster" href="http://www.gdssecurity.com/l/b/2010/09/14/automated-padding-oracle-attacks-with-padbuster/">here</a>.</p>
<p>The exploit works on any <a title="Block cipher on Wikipedia" href="http://en.wikipedia.org/wiki/Block_cipher">block-cipher encryption</a> mechanism, such as AES, DES and Triple DES.</p>
<p>The exploit is quite severe, as it can be used to download the web.config file.</p>
<blockquote><p>The attack that was shown in the public relies on a feature in ASP.NET that allows files (typically javascript and css) to be downloaded, and which is secured with a key that is sent as part of the request. Unfortunately if you are able to forge a key you can use this feature to download the web.config file of an application (but not files outside of the application).  We will obviously release a patch for this… <a title="Comment by Scott Gu" href="http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx">Scott Gu</a></p></blockquote>
<p>There are lots of systems affected, such as ASP.Net 1.0-4.0 (WebForms and MVC), SharePoint, Microsoft CRM, JavaServer Faces etc.</p>
<p>HTTPS with SSL/TLS does not protect your site.</p>
<p>Below is a video showing how to use the POET tool with DotNetNuke.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="331" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/yghiC_U2RaM?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="550" height="331" src="http://www.youtube.com/v/yghiC_U2RaM?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Scott Gu has <a title="ASP.Net workaround" href="http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx">workaround details until Microsoft releases a patch</a>.</p>
<p><strong>Update </strong>September 29th, 2010: A <a title="Microsoft Security Bulletin MS10-070 - Important" href="http://www.microsoft.com/technet/security/bulletin/ms10-070.mspx">security update</a> is released by Microsoft. More details about the patch on <a title="Details of the ASP.NET Security Update" href="http://weblogs.asp.net/scottgu/archive/2010/09/28/asp-net-security-update-now-available.aspx">Scott Gu&#8217;s blog</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/09/20/asp-net-security-vulnerability/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-security-vulnerability#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/09/20/asp-net-security-vulnerability/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Configuring Windows 7 network priority]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/09/10/configuring-windows-7-network-priority/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuring-windows-7-network-priority" />

		<id>http://www.lybecker.com/blog/?p=730</id>
		<updated>2010-09-10T19:01:59Z</updated>
		<published>2010-09-10T19:01:59Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Ilities" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Network Connection Priority" /><category scheme="http://www.lybecker.com/blog" term="Wi-Fi" /><category scheme="http://www.lybecker.com/blog" term="WiFi" /><category scheme="http://www.lybecker.com/blog" term="Win7" /><category scheme="http://www.lybecker.com/blog" term="Windows 7" />
		<summary type="html"><![CDATA[Windows 7 apparently always prioritizes the wireless network connection (Wi-Fi) – no matter if a faster wired network connection is available. This is default behavior &#8211; go figure! Luckily you can change it, but it isn’t easy to find. Do the following: Go to &#8220;Network and Sharing Center&#8221; (e.g. through the “Control Panel”) Click &#8220;Change Adapter [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/09/10/configuring-windows-7-network-priority/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuring-windows-7-network-priority"><![CDATA[<p>Windows 7 apparently always prioritizes the wireless network connection (Wi-Fi) – no matter if a faster wired network connection is available. This is default behavior &#8211; go figure!</p>
<p>Luckily you can change it, but it isn’t easy to find. Do the following:</p>
<ol>
<li>Go to &#8220;Network and Sharing Center&#8221; (e.g. through the “Control Panel”)</li>
<li>Click &#8220;Change Adapter Settings&#8221;</li>
<li>In the &#8220;Network Connections&#8221; window, press the ALT key on your keyboard to being up the menu bar.<br />
<img loading="lazy" class="size-full wp-image-733 aligncenter" title="Network Connection Advanced Settings Menu" src="http://www.lybecker.com/blog/wp-content/uploads/NetworkAdvancedSettingsMenu.png" alt="" width="481" height="201" /></li>
<li>Click the &#8220;Advanced&#8221; menu and then &#8220;Advanced Settings&#8221;</li>
<li>In the “Advanced Settings” windows on the &#8220;Adapters and Bindings&#8221; tab under &#8220;Connections&#8221;, you can change the network connection priority with the arrows on the right.</li>
<p><img loading="lazy" class="size-full wp-image-732 aligncenter" title="Network Connection Advanced Settings" src="http://www.lybecker.com/blog/wp-content/uploads/NetworkAdvancedSettings.png" alt="" width="414" height="461" /></ol>
<p>It will still connect to all available network connections (wireless and wired), unless they are disabled.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/09/10/configuring-windows-7-network-priority/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configuring-windows-7-network-priority#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/09/10/configuring-windows-7-network-priority/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Enabling Danish for SQL Server FullText]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/08/09/enabling-danish-for-sql-server-fulltext/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enabling-danish-for-sql-server-fulltext" />

		<id>http://www.lybecker.com/blog/?p=704</id>
		<updated>2016-05-07T21:14:53Z</updated>
		<published>2010-08-09T18:10:19Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Full Text Search" /><category scheme="http://www.lybecker.com/blog" term="MS FullText" /><category scheme="http://www.lybecker.com/blog" term="SQL Server" /><category scheme="http://www.lybecker.com/blog" term="Danish" /><category scheme="http://www.lybecker.com/blog" term="FullText" /><category scheme="http://www.lybecker.com/blog" term="IFilter" /><category scheme="http://www.lybecker.com/blog" term="Stemmer" /><category scheme="http://www.lybecker.com/blog" term="Wordbreaker" />
		<summary type="html"><![CDATA[SQL Server FullText enables you to search large amount of strings fast, and it is easy to use. It hasn’t changed much since SQL Server 2000. A simple getting started tutorial can be found on Code Project. SQL Server FullText is easy to use in applications requiring string searching. The Danish, Polish and Turkish wordbreaker [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/08/09/enabling-danish-for-sql-server-fulltext/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enabling-danish-for-sql-server-fulltext"><![CDATA[<p>SQL Server FullText enables you to search large amount of strings fast, and it is easy to use. It hasn’t changed much since SQL Server 2000.<br />
A simple getting started tutorial can be found on <a title="Creating Full Text Catalog and Full Text Search" href="http://www.codeproject.com/KB/database/SQLServer2K8FullTextSearh.aspx">Code Project</a>.</p>
<p>SQL Server FullText is easy to use in applications requiring string searching.</p>
<p>The Danish, Polish and Turkish wordbreaker and stemmer implementations for SQL Server FullText is not developed by Microsoft and therefore not enabled by default. The libraries are however part of the installation process and are therefore present on disk.</p>
<p>To make use of the Danish language capabilities in SQL Server 2008, register the libraries in registry and reload the FullText languages:</p>
<ol>
<li>Download &amp; run the <a href="http://www.lybecker.com/blog/wp-content/uploads/DanishFullText.zip">DanishFulltext.reg</a> file on the server. It will register wordbreaker, stemmer and default location of the thesaurus xml file.</li>
<li>Run the exec sp_fulltext_service &#8216;update_languages&#8217; in a Management Studio.</li>
</ol>
<p>Now verify that Danish is enabled with this query: SELECT name FROM sys.fulltext_languages</p>
<p>Note: The DanishFullText.reg assumes that SQL Server is a default instance (not a named instance). If not, modify the file by changing the MSSQL10.MSSQLSERVER to the instance name.</p>
<p>It is the same case with Polish and Turkish – they are not registered by default. See more in the MSDN article <a title="MSDN article" href="http://msdn.microsoft.com/en-us/library/ms345188.aspx">How to: Load Licensed Third-Party Word Breakers</a>.</p>
<p>List of out of the box SQL Server 2008 FullText supported languages: Arabic, Bengali (India), Brazilian, British English, Bulgarian, Catalan, Chinese (Hong Kong SAR, PRC), Chinese (Macau SAR), Chinese (Singapore), Croatian, Danish, Dutch, English, French, German, Gujarati, Hebrew, Hindi, Icelandic, Indonesian ,Italian, Japanese, Kannada, Korean, Latvian, Lithuanian, Malay &#8211; Malaysia, Malayalam, Marathi, Neutral, Norwegian (Bokmål), Polish, Portuguese, Punjabi, Romanian, Russian, Serbian (Cyrillic), Serbian (Latin), Simplified Chinese, Slovak, Slovenian, Spanish, Swedish, Tamil, Telugu, Thai, Traditional Chinese, Turkish, Ukrainian, Urdu, Vietnamese.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/08/09/enabling-danish-for-sql-server-fulltext/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=enabling-danish-for-sql-server-fulltext#comments" thr:count="3"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/08/09/enabling-danish-for-sql-server-fulltext/feed/atom/" thr:count="3"/>
			<thr:total>3</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Java 4-ever]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/07/04/java-4-ever/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-4-ever" />

		<id>http://www.lybecker.com/blog/?p=689</id>
		<updated>2010-07-04T19:09:58Z</updated>
		<published>2010-07-04T19:09:58Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Code fun" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Java" /><category scheme="http://www.lybecker.com/blog" term="Programming" />
		<summary type="html"><![CDATA[I find this video hilarious&#8230; You should use the best tools at hand to solve the problem. That said; choosing between Java or .Net doesn’t really matter in most cases. There are however some areas where Java is a better choice and vice versa. I can’t wait to see it in the cinema 🙂 PS. [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/07/04/java-4-ever/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-4-ever"><![CDATA[<p>I find this video hilarious&#8230;<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="334" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/A1zySeNpW20&amp;hl=da_DK&amp;fs=1&amp;rel=0&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="550" height="334" src="http://www.youtube.com/v/A1zySeNpW20&amp;hl=da_DK&amp;fs=1&amp;rel=0&amp;hd=1" allowfullscreen="true" allowscriptaccess="always"></embed></object><br />
You should use the best tools at hand to solve the problem. That said; choosing between Java or .Net doesn’t really matter in most cases. There are however some areas where Java is a better choice and vice versa.</p>
<p>I can’t wait to see it in the cinema <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>PS. I do develop with Java even though I do not blog much about it.</p>
<p>Update: YouTube removed the video due to copyright claims. You can still see it <a href="http://jz10.java.no/java-4-ever-trailer.html">JavaZone</a>.</p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/07/04/java-4-ever/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-4-ever#comments" thr:count="3"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/07/04/java-4-ever/feed/atom/" thr:count="3"/>
			<thr:total>3</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Meeting the SQL Azure Development Team]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/06/30/meeting-the-sql-azure-development-team/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meeting-the-sql-azure-development-team" />

		<id>http://www.lybecker.com/blog/?p=675</id>
		<updated>2010-06-30T14:28:05Z</updated>
		<published>2010-06-30T14:28:05Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Announcement" /><category scheme="http://www.lybecker.com/blog" term="SQL Azure" /><category scheme="http://www.lybecker.com/blog" term="SQL Server" /><category scheme="http://www.lybecker.com/blog" term="Azure" /><category scheme="http://www.lybecker.com/blog" term="Cloud" /><category scheme="http://www.lybecker.com/blog" term="Database" /><category scheme="http://www.lybecker.com/blog" term="Microsoft SQL Server" />
		<summary type="html"><![CDATA[Last week I was at Microsoft HQ in Redmond, WA, USA. I was invited by the SQL Azure Development Team to look at some of the new unreleased features and comment on features in their roadmap. Unfortunately most of the content was confidential, meaning that I was under NDA, so I may not disclose any [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/06/30/meeting-the-sql-azure-development-team/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meeting-the-sql-azure-development-team"><![CDATA[<p style="text-align: center;"><img loading="lazy" class="size-medium wp-image-682   aligncenter" title="SQL Azure Logo" src="http://www.lybecker.com/blog/wp-content/uploads/SqlAzureLogo-300x130.png" alt="" width="300" height="130" /></p>
<p style="text-align: left;">Last week I was at Microsoft HQ in Redmond, WA, USA. I was invited by the <a title="SQL Azure Team Blog" href="http://blogs.msdn.com/b/sqlazure/">SQL Azure Development Team</a> to look at some of the new unreleased features and comment on features in their roadmap.</p>
<p>Unfortunately most of the content was confidential, meaning that I was under <a title="Non-Disclosure Agreement on Wikipedia" href="http://en.wikipedia.org/wiki/Non-disclosure_agreement">NDA</a>, so I may not disclose any details. Sorry :-/</p>
<p>During the week with the SQL Azure Development Team I was fortunate to be engaged in technical detailed discussion about some of the upcoming feature releases – mainly discussing the SQL Server features not currently available in SQL Azure. It was interesting and enlightening at the same time to discuss their technical challenges and why they have build SQL Azure the way they have.</p>
<p>All in all, my conclusion after this event is that Microsoft takes SQL Azure seriously and it will become a major player in the <a title="Relational Database Management System on Wikipedia" href="http://en.wikipedia.org/wiki/Relational_database_management_system">RDBMS</a> world. It will not just be a SQL Server in the cloud, but a separate product with different market segments and different features. I am looking forward to a bright future with SQL Azure <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/06/30/meeting-the-sql-azure-development-team/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=meeting-the-sql-azure-development-team#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/06/30/meeting-the-sql-azure-development-team/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Check for breaking changes in APIs]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/06/08/check-for-breaking-changes-in-apis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-for-breaking-changes-in-apis" />

		<id>http://www.lybecker.com/blog/?p=667</id>
		<updated>2010-06-08T05:59:09Z</updated>
		<published>2010-06-08T05:59:09Z</published>
		<category scheme="http://www.lybecker.com/blog" term=".Net" /><category scheme="http://www.lybecker.com/blog" term="Full Text Search" /><category scheme="http://www.lybecker.com/blog" term="Lucene" /><category scheme="http://www.lybecker.com/blog" term="Useful tools" /><category scheme="http://www.lybecker.com/blog" term="Apache Lucene" /><category scheme="http://www.lybecker.com/blog" term="API" /><category scheme="http://www.lybecker.com/blog" term="Breaking Changes" />
		<summary type="html"><![CDATA[Have you ever had the need to compare interfaces of two versions of the same framework? If you have, then ApiChange is a tool for you. It’s open source, powerful and easy to use 🙂 I gave it a spin comparing current trunk version 2.9.2 of Lucene.Net with the latest official release version 2.4.0. I [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/06/08/check-for-breaking-changes-in-apis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-for-breaking-changes-in-apis"><![CDATA[<p>Have you ever had the need to compare interfaces of two versions of the same framework?</p>
<p>If you have, then <a title="ApiChange on CodePlex" href="http://apichange.codeplex.com/">ApiChange</a> is a tool for you. It’s open source, powerful and easy to use <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>I gave it a spin comparing current trunk version 2.9.2 of Lucene.Net with the latest official release version 2.4.0.</p>
<p>I downloaded ApiChange and ran the following command in a command prompt:</p>
<pre class="brush: bash; title: ; notranslate">
ApiChange.exe -Diff -old C:Lucene.Net_2_4_0Lucene.Net.dll -new C:trunkLucene.Net.dll
</pre>
<p>The output <a href="http://www.lybecker.com/blog/wp-content/uploads/BreakingChangesInLucene.txt">lists all the differences</a>, but here is a summary:</p>
<ul>
<li>23 public types where removed</li>
<li>96 public types where added</li>
<li>158 public types where changed</li>
</ul>
<p>Cool little tool with other features such as:</p>
<ul>
<li>Diff public types for breaking changes.</li>
<li>Who uses a method?</li>
<li>Who uses a type?</li>
<li>Who uses implements an interface?</li>
<li>Who references me?</li>
<li>What format has the binary (32/64, Managed C++, Pure IL, Unmanaged)?</li>
<li>Search for all event subscribers and unsubscribers.</li>
</ul>
<p>It’s based on <a title="Mono Cecil's website" href="http://www.mono-project.com/Cecil">Mono Cecil</a> – a free IL parser, and not reflection as I initial thought. <a title="ApiChange author blog post ApiChange Is Released!" href="http://geekswithblogs.net/akraus1/archive/2010/06/03/140207.aspx">Go check it out…</a></p>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/06/08/check-for-breaking-changes-in-apis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-for-breaking-changes-in-apis#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/06/08/check-for-breaking-changes-in-apis/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Levels of reuse in Software Development]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/06/01/levels-of-reuse-in-software-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=levels-of-reuse-in-software-development" />

		<id>http://www.lybecker.com/blog/?p=656</id>
		<updated>2010-06-01T06:52:33Z</updated>
		<published>2010-06-01T06:52:33Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Everyday coding" /><category scheme="http://www.lybecker.com/blog" term="Ilities" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Design pattern" /><category scheme="http://www.lybecker.com/blog" term="Methodologies" /><category scheme="http://www.lybecker.com/blog" term="Object-oriented programming" />
		<summary type="html"><![CDATA[One of the promises of object-orientation is reuse. Developing new software systems is expensive, and maintaining them is even more expensive. Reuse is therefore sensible in both business and technology perspectives. With assistance of Erich Gamma, I have identified four levels of reuse. First level of reuse: Copy/paste Duplicating code or functionality makes it easy [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/06/01/levels-of-reuse-in-software-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=levels-of-reuse-in-software-development"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/Softwarepuzzle.jpg"><img loading="lazy" class="alignright size-full wp-image-662" title="SoftwarePuzzle" src="http://www.lybecker.com/blog/wp-content/uploads/Softwarepuzzle.jpg" alt="" width="165" height="153" /></a>One of the promises of object-orientation is reuse. Developing new software systems is expensive, and maintaining them is even more expensive. Reuse is therefore sensible in both business and technology perspectives.</p>
<p>With assistance of Erich Gamma, I have identified four levels of reuse.</p>
<h4>First level of reuse: Copy/paste</h4>
<p>Duplicating code or functionality makes it easy to reuse it. It’s a real timesaver at first, but keeping all the duplicates up-to-date and maintaining them is horrifying task. Not to mention the problems when forgetting to update one or more duplicates…</p>
<blockquote><p>“Copy and paste programming is a pejorative term to describe highly repetitive computer programming code apparently produced by copy and paste operations. It is frequently symptomatic of a lack of programming competence, or an insufficiently expressive development environment, as subroutines or libraries would normally be used instead. In certain contexts it has legitimate value, if used with care.” <a title="Copy/past programming on Wikipedia" href="http://en.wikipedia.org/wiki/Copy_and_paste_programming">Wikipedia</a></p></blockquote>
<h4><strong>Second level of reuse: Class libraries</strong></h4>
<p>Reuse at class level or a set of classes in a software library is common and also fairly easy with object-oriented languages.</p>
<blockquote><p>“Libraries contain code and data that provide services to independent programs. This allows the sharing and changing of code and data in a modular fashion. Some executables are both standalone programs and libraries, but most libraries are not executables …” <a title="Software Libraries on Wikipedia" href="http://en.wikipedia.org/wiki/Library_(computer_science)">Wikipedia</a></p></blockquote>
<h4><strong>Third level of reuse: Design Patterns</strong></h4>
<p>Patterns allow you to reuse design ideas and concepts independent of concrete code.</p>
<blockquote><p>“In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.” <a title="Design Patterns on Wikipedia" href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">Wikipedia</a></p></blockquote>
<h4><strong>Fourth level of reuse: Frameworks</strong></h4>
<p>An object-oriented abstract design to solve a specific problem – often very specialized, like Unit Testing frameworks and Object-Relational Mapping frameworks, but can be large, complex or domain specific.</p>
<blockquote><p>&#8220;A software framework … is an abstraction in which common code providing generic functionality can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are reusable abstractions of code wrapped in a well-defined API, yet they contain some key distinguishing features that separate them from normal libraries.&#8221; <a title="Software Frameworks on Wikipedia" href="http://en.wikipedia.org/wiki/Software_framework">Wikipedia</a></p></blockquote>
<p>It’s all about being pragmatic &#8211; not all software will reach fourth level of reuse and will be structured as frameworks &#8211; frankly it shouldn’t. That said; copy/past style development is unquestionably a wrong path.</p>
<p>What level is your company at?</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/06/01/levels-of-reuse-in-software-development/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=levels-of-reuse-in-software-development#comments" thr:count="2"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/06/01/levels-of-reuse-in-software-development/feed/atom/" thr:count="2"/>
			<thr:total>2</thr:total>
			</entry>
		<entry>
		<author>
			<name>Anders Lybecker</name>
							<uri>http://www.lybecker.com/blog/</uri>
						</author>

		<title type="html"><![CDATA[Ageing pictogram]]></title>
		<link rel="alternate" type="text/html" href="http://www.lybecker.com/blog/2010/05/19/ageing-pictogram/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ageing-pictogram" />

		<id>http://www.lybecker.com/blog/?p=646</id>
		<updated>2010-05-19T21:02:03Z</updated>
		<published>2010-05-19T21:02:03Z</published>
		<category scheme="http://www.lybecker.com/blog" term="Conference" /><category scheme="http://www.lybecker.com/blog" term="Full Text Search" /><category scheme="http://www.lybecker.com/blog" term="Lucene" /><category scheme="http://www.lybecker.com/blog" term="Stuff" /><category scheme="http://www.lybecker.com/blog" term="Apache Lucene" /><category scheme="http://www.lybecker.com/blog" term="Pictogram" /><category scheme="http://www.lybecker.com/blog" term="Prague" />
		<summary type="html"><![CDATA[I’m in Prague, Czech for the Apache Lucene EuroCon 2010; wandered around, where I saw this drawing on a house wall. I find it hilarious – especially the natural shadow over the coffins. It’s just by pure coincidence that I was there, at the time of day where the doorway cast its shadow over the [&#8230;]]]></summary>

					<content type="html" xml:base="http://www.lybecker.com/blog/2010/05/19/ageing-pictogram/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ageing-pictogram"><![CDATA[<p><a href="http://www.lybecker.com/blog/wp-content/uploads/AgeingPictogram.jpg"><img loading="lazy" class="alignnone size-full wp-image-650" title="Ageing Pictogram" src="http://www.lybecker.com/blog/wp-content/uploads/AgeingPictogram.jpg" alt="" width="550" height="315" /></a></p>
<p>I’m in Prague, Czech for the <a title="Conference website" href="http://www.lucene-eurocon.org/">Apache Lucene EuroCon 2010</a>; wandered around, where I saw this drawing on a house wall.</p>
<p>I find it hilarious – especially the natural shadow over the coffins. It’s just by pure coincidence that I was there, at the time of day where the doorway cast its shadow over the coffins <img src="https://s.w.org/images/core/emoji/13.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content>
		
					<link rel="replies" type="text/html" href="http://www.lybecker.com/blog/2010/05/19/ageing-pictogram/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ageing-pictogram#comments" thr:count="0"/>
			<link rel="replies" type="application/atom+xml" href="http://www.lybecker.com/blog/2010/05/19/ageing-pictogram/feed/atom/" thr:count="0"/>
			<thr:total>0</thr:total>
			</entry>
	</feed>
