<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fabse-on-Blog</title>
	<atom:link href="http://blog.fabse.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fabse.net</link>
	<description>Was bewegt mich; was nicht!</description>
	<lastBuildDate>Fri, 20 Jan 2012 22:06:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>My Visual Studio Achievements</title>
		<link>http://blog.fabse.net/2012/01/20/my-visual-studio-achievements/</link>
		<comments>http://blog.fabse.net/2012/01/20/my-visual-studio-achievements/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 22:06:34 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Blogwelt]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=617</guid>
		<description><![CDATA[Finally, you can take a look at my achievements in Visual Studio as well! You may do this as well! --- Unterst&#252;tze mich und meinen Blog und kauf dir was Nettes (&#252;ber diesen Link)<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Finally, you can take a look at my achievements in Visual Studio as well!</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="My Visual Studio Achievements" border="0" alt="My Visual Studio Achievements" src="http://blog.fabse.net/wp-content/uploads/image59.png" width="171" height="244" /></p>
<p><a title="Channel 9 - Visual Studio Achievements" href="http://channel9.msdn.com/achievements/visualstudio">You may do this</a> as well!</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2012/01/20/my-visual-studio-achievements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>String.GetHashCode() Internals</title>
		<link>http://blog.fabse.net/2011/10/25/string-gethashcode-internals/</link>
		<comments>http://blog.fabse.net/2011/10/25/string-gethashcode-internals/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 18:11:56 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/10/25/string-gethashcode-internals/</guid>
		<description><![CDATA[While I was eating dinner, I had this somehow suprising question in my mind: How is String.GetHashCode() implemented? Is it fast? It needs a linear time based on the length of the string. This is understandable if you think about &#8230; <a href="http://blog.fabse.net/2011/10/25/string-gethashcode-internals/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>While I was eating dinner, I had this somehow suprising question in my mind: How is String.GetHashCode() implemented? Is it fast?</p>
<p>It needs a linear time based on the length of the string. This is understandable if you think about what it is doing. It needs to generate a “Fingerprint”-number based on its content, so you need to take a look at all the content at least once. So it is O(N).</p>
<p>I was going to do something more useful while I noticed all the precompiler conditions. That is very interesting! The function returns different results whether it is compiled for 32bit or 64bit. The debug version of the framework (Microsoft internal only?) even changes its resulting hashcodes with every buildnumber.</p>
<blockquote><p>We want to ensure we can change our hash function daily.     <br />This is perfectly fine as long as you don&#8217;t persist the      <br />value from GetHashCode to disk or count on String A       <br />hashing before string B.&#160; Those are bugs in your code.      </p>
</blockquote>
<p>So you better avoid storing hashcodes and you should not exchange hashcodes across process-boundarys. Your communication partner may use a different number of bits!</p>
<p>Last but not least: the result is not stored but recomputed every time you call the function. The implementation is following the advice to not store its result itself.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/10/25/string-gethashcode-internals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Youtube wieder schneller im Firefox</title>
		<link>http://blog.fabse.net/2011/10/19/youtube-wieder-schneller-im-firefox/</link>
		<comments>http://blog.fabse.net/2011/10/19/youtube-wieder-schneller-im-firefox/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 19:45:40 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/10/19/youtube-wieder-schneller-im-firefox/</guid>
		<description><![CDATA[While I had decided to write new articles only in English, the following article has a pure German audience so I figured out to make an exception for this article. Wer wie ich seinen Internetanschluss bei der Telekom hat, dem &#8230; <a href="http://blog.fabse.net/2011/10/19/youtube-wieder-schneller-im-firefox/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p><em>While I had decided to write new articles only in English, the following article has a pure German audience so I figured out to make an exception for this article.</em></p>
<p>Wer wie ich seinen Internetanschluss bei der Telekom hat, dem kann nicht entgangen sein, dass Youtube Videos extrem langsam sind und man manchmal außer der drehenden Ladeanimation nichts zu sehen bekommt. Es war zuletzt wirklich sehr schlimm.</p>
<p>Es gab bis vor kurzem den <a href="https://addons.mozilla.org/de/firefox/addon/telekom-youtube-turbo/" target="_blank">Telekom Youtube Turbo</a>, der zwar funktionierte, dies aber sehr geheimnisvoll gemacht hat. Es gibt keine Einstellungen und auch keine Beschreibungen. Er ist auch für den Firefox 8 nicht verfügbar.</p>
<p>Frustriert habe ich mich umgeschaut und gelesen, dass der Telekom-Proxy wohl schneller ist. Vermutlich hat auch der Telekom Youtube Turbe den verwendet. Ich wollte aber nicht, dass alle meine Seitenaufrufe durch den Proxy laufen, daher habe ich mir FoxyProxy besorgt, was viele Optionen erlaubt. Die Einrichtung geht in wenigen einfachen Schritten:</p>
<p>1. Das AddOn <a href="https://addons.mozilla.org/de/firefox/addon/foxyproxy-standard/" target="_blank">FoxyProxy</a> in den Firefox installieren und den Firefox neu starten.</p>
<p>2. In den Optionen von FoxyProxy einen neuen Proxy anlegen* und ihn auf den Telekom-Proxy (www-proxy.t-online.de mit Port 80) einstellen.</p>
<p><a href="http://blog.fabse.net/wp-content/uploads/image56.png" rel="lightbox[605]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Proxydetails einstellen" border="0" alt="Proxydetails einstellen" src="http://blog.fabse.net/wp-content/uploads/image_thumb10.png" width="244" height="171" /></a></p>
<p>3. Bei den Url-Mustern noch ein Muster für Youtube hinterlegen:</p>
<p><a href="http://blog.fabse.net/wp-content/uploads/image57.png" rel="lightbox[605]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Url-Muster für Youtube hinterlegen" border="0" alt="Url-Muster für Youtube hinterlegen" src="http://blog.fabse.net/wp-content/uploads/image_thumb11.png" width="244" height="172" /></a></p>
<p>4. Der FoxyProxy-Modus sollte “Verwende Proxies entsprechend ihrer konfigurierten Muster und Prioritäten” sein. Das sollte bei euch dann alles so aussehen:</p>
<p><a href="http://blog.fabse.net/wp-content/uploads/image58.png" rel="lightbox[605]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Verwende Proxies entsprechend ihrer konfigurierten Muster und Prioritäten" border="0" alt="Verwende Proxies entsprechend ihrer konfigurierten Muster und Prioritäten" src="http://blog.fabse.net/wp-content/uploads/image_thumb12.png" width="244" height="187" /></a></p>
<p>Und nun wieder viel Spaß auf Youtube!</p>
<p>&#160;</p>
<p>*Es gibt Bonuspunkte, wenn man den Proxy Magenta färbt <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blog.fabse.net/wp-content/uploads/wlEmoticon-winkingsmile4.png" /></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/10/19/youtube-wieder-schneller-im-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dependency injection &amp; their Pitfalls*</title>
		<link>http://blog.fabse.net/2011/09/25/dependency-injection-their-pitfalls/</link>
		<comments>http://blog.fabse.net/2011/09/25/dependency-injection-their-pitfalls/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 17:32:56 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[Prism]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/09/25/dependency-injection-their-pitfalls/</guid>
		<description><![CDATA[After I had my dependency injection set up and running, I noticed a shift in my way of developing. I started to be more focused on only one class and their implementation at a time. If I felt the need &#8230; <a href="http://blog.fabse.net/2011/09/25/dependency-injection-their-pitfalls/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>After I had my dependency injection set up and running, I noticed a shift in my way of developing. I started to be more focused on only one class and their implementation at a time. If I felt the need for another service instance, I just added it to the constructor and would go on coding. I thought that the dependency injection container would take care of how to create the new service for me.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image54.png" width="232" height="214" /></p>
<p>This is nothing fancy so far. After coding for straight 20 minutes without any testing in between I decided to test it. I noticed my machine was doing really nothing but burning cpu for a bunch of seconds and quitting then with a StackoverflowException. I had no idea what was going on.</p>
<p>The exception was not really telling too much about the problem. The only thing was a truncated stacktrace. It had something to do with the container trying to create an instance of a service. Without any further information it would be hard to pinpoint this so I decided to search for trace information. I am using <a href="http://compositewpf.codeplex.com/" target="_blank">Microsoft Prism</a> with the Unity container for inversion of control. So does Unity provide any traces of what is going on? Surprisingly, this is not the case! There is no magic switch.</p>
<p>So I had no choice but removing constructor arguments here and there until I found the root problem. I had managed to create a circular reference:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image61.png" width="232" height="214" /></p>
<p><a href="http://msdn.microsoft.com/en-us/library/ff660897%28v=pandp.20%29.aspx" target="_blank">The MSDN</a> is telling me, that it is my responsibility to prevent this and it also warns of endless recursion. Endless recursion always ends with an StackoverflowException.</p>
<p>My solution was simple. I removed the circular reference through removing one reference. It was not used anyway.</p>
<p><em>*The name of this article is freely leaned on the name of the blog </em><a href="http://eai-technologies-and-their-pitfalls.blogspot.com/" target="_blank"><em>EAI Technologies &amp; their Pitfalls</em></a><em> of an ex coworker</em> <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blog.fabse.net/wp-content/uploads/wlEmoticon-winkingsmile3.png" /></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/09/25/dependency-injection-their-pitfalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make static legacy code testable</title>
		<link>http://blog.fabse.net/2011/09/09/how-to-make-static-legacy-code-testable/</link>
		<comments>http://blog.fabse.net/2011/09/09/how-to-make-static-legacy-code-testable/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 14:32:37 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[mocking]]></category>
		<category><![CDATA[unittesting]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/09/09/how-to-make-static-legacy-code-testable/</guid>
		<description><![CDATA[I had the opportunity to work in a team developing and improving a large legacy application. The project had some unit tests already but there was a long way to go in terms of increasing the test coverage. Many internal &#8230; <a href="http://blog.fabse.net/2011/09/09/how-to-make-static-legacy-code-testable/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I had the opportunity to work in a team developing and improving a large legacy application. The project had some unit tests already but there was a long way to go in terms of increasing the test coverage.</p>
<p>Many internal services are implemented as a bunch of static methods like so:</p>
<pre class="code"><span style="color: blue"><strong>static</strong> class </span><span style="color: #2b91af">SeriousService
</span>{
    <span style="color: blue">public <strong>static</strong> int </span>DoSomething(<span style="color: blue">string </span>value)
    {
        <span style="color: green">//&lt;side effects here&gt;
        </span><span style="color: blue">return </span>17;
    }
}</pre>
<p>And the usages of these static classes are all over the place like so:</p>
<pre class="code"><span style="color: blue">class </span><span style="color: #2b91af">SomeModule
</span>{
    <span style="color: blue">public void </span>ExecuteOrder(<span style="color: #2b91af">Order </span>order)
    {
        <span style="color: green">//...
        </span><span style="color: #2b91af">SeriousService</span>.<strong>DoSomething</strong>(order.Name);
        <span style="color: green">//...
    </span>}
}</pre>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image51.png" width="423" height="88" /></p>
<p>The challenge was to write a unit test which would test ExecuteOrder() without side effects in SeriousService.</p>
<p>A state-of-the-art application would insert the service through dependency injection into SomeModule. You could provide a mock for the service and you would be ready to write your unittest.</p>
<p>Unluckily, changing the caller or the signature of the callee was no option to me. The chance to introduce incompatibilities somewhere in the huge family of applications and tools was to high.</p>
<p>After some thinking I came up with the idea to extract the functionality out of the static service:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image52.png" width="609" height="240" /></p>
<p>The “new” static service endpoint has now a private static reference to the service implementation and all public methods forward there calls to this implementation. The new service implementation is based on an extracted interface. Caller and callee are still unchanged (red rectangle). In code, it looks like so:</p>
<pre class="code"><span style="color: blue">interface </span><span style="color: #2b91af">ISeriousService
</span>{
    <span style="color: blue">int </span>DoSomething(<span style="color: blue">string </span>value);
}

<span style="color: blue">class </span><span style="color: #2b91af">SeriousServiceImpl </span>: <span style="color: #2b91af">ISeriousService
</span>{
    <span style="color: blue">public int </span>DoSomething(<span style="color: blue">string </span>value)
    {
        <span style="color: green">//&lt;side effects here&gt;
        </span><span style="color: blue">return </span>17;
    }
}

<span style="color: blue">static class </span><span style="color: #2b91af">SeriousService
</span>{
    <span style="color: blue">private static </span><span style="color: #2b91af">ISeriousService </span>_seriousService
                            = <span style="color: blue">new </span><span style="color: #2b91af">SeriousServiceImpl</span>();

    <span style="color: green">//Static endpoint
    </span><span style="color: blue">public static int </span>DoSomething(<span style="color: blue">string </span>value)
    {
        <span style="color: blue">return </span>_seriousService.DoSomething(value);
    }
}</pre>
<p>Until here, all we have done is to insert another level of indirection. But this enables us to replace the real functionality of the service with a mock:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image53.png" width="634" height="247" /></p>
<p>This is possible if the service “endpoint” gets a public method to replace its implementation:</p>
<pre class="code"><span style="color: blue">static class </span><span style="color: #2b91af">SeriousService
</span>{
    <span style="color: blue">private static </span><span style="color: #2b91af">ISeriousService </span>_seriousService
                            = <span style="color: blue">new </span><span style="color: #2b91af">SeriousServiceImpl</span>();

<strong>    <span style="color: blue">public static void </span>ReplaceServiceImpl(<span style="color: #2b91af">ISeriousService </span>newImpl)
    {
        _seriousService = newImpl;
    }</strong>

    <span style="color: green">//Static endpoint
    </span><span style="color: blue">public static int </span>DoSomething(<span style="color: blue">string </span>value)
    {
        <span style="color: blue">return </span>_seriousService.DoSomething(value);
    }
}</pre>
<p>Having all of this in place you can write your unit test for the module without the fear of any unforseen sideeffects:</p>
<pre class="code">[<span style="color: #2b91af">TestFixture</span>]
<span style="color: blue">class </span><span style="color: #2b91af">SomeModuleTest
</span>{
    [<span style="color: #2b91af">Test</span>]
    <span style="color: blue">public void </span>ExecuteOrder_handles_condition_xyz()
    {
        <span style="color: green">//Setup
        </span><span style="color: blue">var </span>service = <span style="color: blue">new </span><span style="color: #2b91af">Mock</span>&lt;<span style="color: #2b91af">ISeriousService</span>&gt;();
        <span style="color: #2b91af">SeriousService</span>.<strong>ReplaceServiceImpl</strong>(service.Object);

        <span style="color: green">//Execute
        </span><span style="color: blue">new </span><span style="color: #2b91af">SomeModule</span>().ExecuteOrder(<span style="color: blue">new </span><span style="color: #2b91af">Order</span>());

        <span style="color: green">//Asserts here
    </span>}
}</pre>
<p>There is one more thing left to be done. Obviously the real instance of SeriousServiceImpl is gone for good after executing the test. So if you want to be able to reuse the current AppDomain for another test you either need to recover it somehow or you have to replace it in every test. I have a nice solution for this as well but this article is already long enough.</p>
<p>So summing up, we saw how to introduce another level of indirection into our architecture. We used it to swap the implementation of a static service as was needed to write unit tests without side effects.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/09/09/how-to-make-static-legacy-code-testable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>String.Split() Kwik-e</title>
		<link>http://blog.fabse.net/2011/09/01/string-split-kwik-e/</link>
		<comments>http://blog.fabse.net/2011/09/01/string-split-kwik-e/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 09:23:30 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Kwik-e]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=580</guid>
		<description><![CDATA[While I was cleaning up some legacy code I found an overly complex usage of String.Split() in several places: var sentence = &#34;Hello World!&#34;; var words = sentence.Split(new char[] { ' ' }); If you take a look at the &#8230; <a href="http://blog.fabse.net/2011/09/01/string-split-kwik-e/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>While I was cleaning up some legacy code I found an overly complex usage of String.Split() in several places:</p>
<pre class="code"><span style="color: blue">var </span>sentence = <span style="color: #a31515">&quot;Hello World!&quot;</span>;
<span style="color: blue">var </span>words = sentence.Split(<span style="color: blue">new char</span>[] { <span style="color: #a31515">' ' </span>});</pre>
<p>If you take a look at the available overloads on Split() you may miss the params keyword. In fact it isn’t even visible on the overview page:</p>
<p><a href="http://msdn.microsoft.com/de-de/library/y7h14879%28v=VS.100%29.aspx"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image49.png" width="326" height="329" /></a></p>
<p>But if you take a closer look on Split(char[]) you will see this:</p>
<p><a href="http://msdn.microsoft.com/de-de/library/b873y76a.aspx"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image50.png" width="229" height="53" /></a></p>
<p>The params keyword tells you that the method accepts any number of arguments of type char. So you could also provide only one, which will simplify the given sample to:</p>
<pre class="code"><span style="color: blue">var </span>sentence = <span style="color: #a31515">&quot;Hello World!&quot;</span>;
<span style="color: blue">var </span>words = sentence.Split(<span style="color: #a31515">' '</span>);</pre>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/09/01/string-split-kwik-e/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linq Kwik-e</title>
		<link>http://blog.fabse.net/2011/08/29/linq-kwik-e/</link>
		<comments>http://blog.fabse.net/2011/08/29/linq-kwik-e/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 21:19:46 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Kwik-e]]></category>
		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=572</guid>
		<description><![CDATA[Really often I use the Linq extension methods to formulate a query to reduce a set of data to a single value. Most of the time I refer to the First() method for this use case. var fabse = myList.Where(p &#8230; <a href="http://blog.fabse.net/2011/08/29/linq-kwik-e/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Really often I use the Linq extension methods to formulate a query to reduce a set of data to a single value. Most of the time I refer to the First() method for this use case.</p>
<pre class="code"><span style="color: blue;">var </span>fabse = myList.Where(p =&gt; p.Name == <span style="color: #a31515;">"Fabse"</span>).First();</pre>
<p>There are several ways to improve this scenario. First has an overload where it accepts a predicate function, so the following example yields the same result:</p>
<pre class="code"><span style="color: blue;">var </span>fabse = myList.First(p =&gt; p.Name == <span style="color: #a31515;">"Fabse"</span>);</pre>
<p>But what happens if your list has no elements fulfilling your filter? First() will throw an exception. It is considered bad style to use exceptions to handle program flow. But is quite hard sticking to First() and avoiding the exception at the same time.</p>
<p>It is better to use FirstOrDefault() if there is the possibility of not getting any result. If there is no result, the default for the inferred data type is used, which is null for all reference types and 0 (zero) or false for int/float/double/… and bool. Sample:</p>
<pre class="code"><span style="color: blue;">var </span>fabse = myList.FirstOrDefault(p =&gt; p.Name == <span style="color: #a31515;">"Fabse"</span>);
<span style="color: blue;">if </span>(fabse != <span style="color: blue;">null</span>)
{
    <span style="color: green;">//use fabse ;-</span><span style="color: green;">)
</span>}</pre>
<p>Today I discovered the functions Single() and SingleOrDefault() which have nearly the same semantics but they will test the data source for further hits regarding your predicate. If there are other hits, you will see an InvalidOperationException.</p>
<p>I like this behavior very much because I often search for the existence of a somehow special object and based on this existence I do something or not. If there is more than one of these special objects, there is most likely something wrong with the data and it is better to stop the process and to examine the data. So an exception feels right at this moment.</p>
<p>To finish up this kwik-e: First() will give you the first (duh!) element while Last() and LastOrDefault() will give you the last element.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/08/29/linq-kwik-e/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NuGet: +1</title>
		<link>http://blog.fabse.net/2011/08/14/nuget-1/</link>
		<comments>http://blog.fabse.net/2011/08/14/nuget-1/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 01:04:29 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/08/14/nuget-1/</guid>
		<description><![CDATA[It really couldn’t be easier! --- Unterst&#252;tze mich und meinen Blog und kauf dir was Nettes (&#252;ber diesen Link)<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>It really couldn’t be easier!</p>
<p><a href="http://blog.fabse.net/wp-content/uploads/image48.png" rel="lightbox[571]"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image_thumb8.png" width="453" height="201" /></a></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/08/14/nuget-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Curious Lines 2011</title>
		<link>http://blog.fabse.net/2011/08/10/curious-lines-2011/</link>
		<comments>http://blog.fabse.net/2011/08/10/curious-lines-2011/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 11:08:36 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Aus dem Leben]]></category>
		<category><![CDATA[DIY]]></category>
		<category><![CDATA[home improvement]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/08/10/curious-lines-2011/</guid>
		<description><![CDATA[--- Unterst&#252;tze mich und meinen Blog und kauf dir was Nettes (&#252;ber diesen Link)<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:2e0a8850-3748-4150-ae22-439ca0aa1851" class="wlWriterEditableSmartContent">
<div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/8Jb7b-9P7VY?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/8Jb7b-9P7VY?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div>
</div>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/08/10/curious-lines-2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ideas about NoSql on Windows Azure: Azure Storage</title>
		<link>http://blog.fabse.net/2011/08/02/ideas-about-nosql-on-windows-azure-azure-storage/</link>
		<comments>http://blog.fabse.net/2011/08/02/ideas-about-nosql-on-windows-azure-azure-storage/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 20:47:40 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Azure]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=563</guid>
		<description><![CDATA[This article is the third and last in my small series about NoSql-Solutions on Windows Azure. You may want to read them in order. RavenDB Sql Azure Azure Storage Azure Storage Microsoft proposes Azure Storage as the most scalable solution &#8230; <a href="http://blog.fabse.net/2011/08/02/ideas-about-nosql-on-windows-azure-azure-storage/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p><em>This article is the third and last in my small series about NoSql-Solutions on Windows Azure. You may want to read them in order.</em></p>
<ol>
<li><a href="http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/" target="_blank"><em>RavenDB</em></a> </li>
<li><a href="http://blog.fabse.net/2011/07/14/ideas-about-nosql-on-windows-azure-sql-azure/" target="_blank"><em>Sql Azure</em></a> </li>
<li><em>Azure Storage</em> </li>
</ol>
<h2>Azure Storage</h2>
<p>Microsoft proposes Azure Storage as the most scalable solution if you want to store data in the cloud. If you think of Windows Azure as an operating system for the cloud then Azure Storage is the supporting filesystem for it. It consist of three major parts: Tables, Queues and Blobs.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Blob" border="0" alt="Blob" align="left" src="http://blog.fabse.net/wp-content/uploads/Blob1.png" width="63" height="63" /></p>
<p>Azure Blobs are unstructured binary data just like files on a filesystem. You can&#160; store some additional metadata and you can control whether they are publicly available or protected.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Queue" border="0" alt="Queue" align="left" src="http://blog.fabse.net/wp-content/uploads/Queue.png" width="64" height="64" /></p>
<p>Azure Queues is a persistent Queue implementation. It gives you an async and decoupled way to comunicate between components of your distributed application.</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="Table" border="0" alt="Table" align="left" src="http://blog.fabse.net/wp-content/uploads/Table.png" width="64" height="64" /></p>
<p>Azure Tables is some kind of low level SQL table. In comparison to a real SQL table there are some limititions. Each table has only a partition key and a row key for efficient access. These two keys form a row identifier. There is no equivalent to a non-clustered index so querying with conditions which do not contain these two key columns are always expensive in terms of time. The flipside of this coin is very high scalability. An Azure Table is not limited in size and may span over several nodes.</p>
<p>Azure Storage is hosted for you so you do not have to worry about installing, configuring, managing, backups and scaling. All these points made me decline RavenDB as the candidate number one in the first article of this series.</p>
<p>It has <a href="http://weblogs.asp.net/vblasberg/archive/2009/02/17/azure-details-and-limitations-blobs-tables-and-queues.aspx" target="_blank">some small limitations</a> which I would consider a guideline for a correct usage of the services. The overall amount of data is not limited.</p>
<h2>Azure Storage pricing</h2>
<p>Azure Storage is not free (as well), but it costs much less than SQL Azure. Think of 10-times less depending on your usage behaviour! Azure storage costs you 0,106 € / GB and you also have to pay for every transaction on the storage. One million transactions cost you additional 0,71€.</p>
<p><a href="http://www.microsoft.com/windowsazure/pricing-calculator/" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Storage Pricing compared" border="0" alt="image" src="http://blog.fabse.net/wp-content/uploads/image47.png" width="630" height="208" /></a></p>
<p>&#160;</p>
<h2>Azure Storage for my project?</h2>
<p>I will use Azure Storage in all its flavors in my project. <strong>Why, you ask?</strong> It is the solution I have the least experience with but I have the desire to change this! It will also save money in the long run.</p>
<p>Because of the lack of the experience, I am not that sure, how well queries will work if they contain only the partition key but not the row key. This could become a performance killer. I was thinking about this for a longer time. I will wait for this to show up as a real bottleneck. </p>
<p>If performance really becomes critical then caching is my first choice here. If this is not going to work good enough I will implement secondary tables as some kind of persisted views on the data. This introduces more complexity in the data access but it will be the way to (re-)gain performance at the cost of some extra storage.</p>
<p><em></em></p>
<p><em><a href="http://davidpallmann.blogspot.com/2011/07/windows-azure-design-patterns-part-1.html#fbid=-PMTyp5hV-a" target="_blank">Source of the used Azure Icons</a></em></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/08/02/ideas-about-nosql-on-windows-azure-azure-storage/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ideas about NoSql on Windows Azure: Sql Azure</title>
		<link>http://blog.fabse.net/2011/07/14/ideas-about-nosql-on-windows-azure-sql-azure/</link>
		<comments>http://blog.fabse.net/2011/07/14/ideas-about-nosql-on-windows-azure-sql-azure/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 19:24:03 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=551</guid>
		<description><![CDATA[This is a direct follow-up to my earlier article “Ideas about NoSql on Windows Azure: RavenDB”. You should read it first. While I was considering RavenDB as an actual choice for my project I was stumbling about the bad performance &#8230; <a href="http://blog.fabse.net/2011/07/14/ideas-about-nosql-on-windows-azure-sql-azure/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p><em>This is a direct follow-up to my earlier article </em><a href="http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/" target="_blank"><em>“Ideas about NoSql on Windows Azure: RavenDB”</em></a><em>. You should read it first.</em></p>
<p>While I was considering <a href="http://http://ravendb.net/" target="_blank">RavenDB</a> as an actual choice for my project I was stumbling about the bad performance on big (1-5 MB) blobs. Shortly after I learned about attachments in RavenDB which are designed for exactly this case except it is not possible to include them in transactions. This is fine for me anyway.</p>
<p><strong>Sql Azure</strong></p>
<p>The next best choice is <a href="http://www.microsoft.com/windowsazure/sqlazure/database/" target="_blank">Sql Azure</a>. It feels like having a SQL Server in the cloud with all its pros and cons. I have quite good knowledge in designing and using relational databases and especially storing blobs in them. But this is no NoSql at all <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://blog.fabse.net/wp-content/uploads/wlEmoticon-winkingsmile2.png" /></p>
<p>Some <a href="http://download.microsoft.com/download/9/E/9/9E9F240D-0EB6-472E-B4DE-6D9FCBB505DD/Windows%20Azure%20No%20SQL%20White%20Paper.pdf" target="_blank">whitepapers</a> suggest to use XML document columns to store schema-less documents inside SQL Azure to simulate a NoSql database. While technically possible I cannot imagine someone really doing this.</p>
<p><a href="http://www.microsoft.com/windowsazure/pricing-calculator/" target="_blank">Sql Azure is not free as well</a>. You don’t pay for licences but you pay for the size of your database. It costs about 7€ per month and GB. This is too much for me to use it to store my blobs and as of now I have no idea how much metadata I need to store to run my service.</p>
<p><strong>My decision</strong></p>
<p>Sql Azure could fulfil all my needs. I could store the blobs inside Azure Blob Service to reduce the database size and to use the tools in the way they work best. But I will not use Sql Azure. <em>Why?</em> I am quite sure that Sql Azure is much more capable of scaling than my application would need it. It basically comes down to my desire to learn something new and to design the service in the way it fits best into the cloud.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/07/14/ideas-about-nosql-on-windows-azure-sql-azure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ideas about NoSql on Windows Azure: RavenDB</title>
		<link>http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/</link>
		<comments>http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 17:43:08 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[NoSql]]></category>
		<category><![CDATA[RavenDB]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=547</guid>
		<description><![CDATA[I have a really great idea for a software product and I want to implement it as a software as a service. I am not going to tell more about the actual idea for now. Instead I want to focus &#8230; <a href="http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I have a really great idea for a software product and I want to implement it as a software as a service. I am not going to tell more about the actual idea for now. Instead I want to focus this post on deciding the way how I will implement the storage.</p>
<p><strong>Requirements</strong></p>
<p>Because of my .Net background I am going to use <a href="http://www.microsoft.com/windowsazure/" target="_blank">Windows Azure</a> anyway.     <br />Furthermore I want to have an architecture which is scalable as much as possible. The application should be able to run on only one extra small instance and should be able to scale using many instances in a seamless and efficient ways.</p>
<p><strong>RavenDB as a solution</strong></p>
<p>I am following <a href="http://ayende.com/blog" target="_blank">Ayende</a> for quite a long time now and I appreciate his skills and knowledge. He made me start diving into the NoSql-Space some time ago with his document database <a href="http://ravendb.net/" target="_blank">RavenDB</a>. I am quite impressed by it. I was thinking about using it for my service but there are some issues:</p>
<ul>
<li><a href="http://ravendb.net/licensing" target="_blank">RavenDB is not free</a>. It’s available under the AGPL license but I am not going to release the source of my own stuff so this is not an option. I have some money available and Ayende offers free licenses to startup companies as well so I basically could go for it nevertheless. </li>
<li>RavenDB uses the local filesystem as the underlying storage. Is this possible on Azure? Yes of course. The feature is called Windows Azure Drive. The compute instance gets a simulated local drive which is stored in the Azure Blob Storage. This is somehow great if you want to run some legacy stuff in the cloud but it feels like a huge crook doing this to run a software which is designed with Azure in mind. </li>
</ul>
<p>Think about scaling: RavenDB is able to <a href="http://ravendb.net/documentation/docs-sharding" target="_blank">shard</a> and <a href="http://ravendb.net/documentation/replication" target="_blank">replicate</a> but do you really want to setup another instance of RavenDB and Azure Drive just to scale up?    <br />Scaling down is even worse: You would either need a way to run both Raven-Instances on a single compute instance or you would need to copy the data to free one instance of RavenDB completely. I simply want to change the number of instances in the Azure configuration and it should “just work”.</p>
<p><strong>Solutions?</strong></p>
<p>Is running a database product on top of Azure compute instances a great idea at all? Particularly the last part about scaling leaves the opinion in my head that this is not what I want to deal with.</p>
<p>Should Ayende implement Azure Blob Storage as a supported underlying storage system for RavenDB? Probably not. You would still have the burden to setup and configure RavenDB instances.</p>
<p><strong>My decision</strong></p>
<p>It is a somewhat hard decision because I really like RavenDB but I think I will not use it.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/07/13/ideas-about-nosql-on-windows-azure-ravendb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SQL Server Index Maintenance Script</title>
		<link>http://blog.fabse.net/2011/06/16/sql-server-index-maintenance-script/</link>
		<comments>http://blog.fabse.net/2011/06/16/sql-server-index-maintenance-script/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 09:37:03 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[im Netz gefunden]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/06/16/sql-server-index-maintenance-script/</guid>
		<description><![CDATA[Ich habe ein Script gesucht, was möglichst intelligent die Struktur der Indexe und ihren Fragmentierungsgrad auswertet. Auf Grund dieser Auswertung soll es entscheiden, ob es einen Rebuild oder ein Reorganize macht oder halt einfach nichts. Genau das tut das Script &#8230; <a href="http://blog.fabse.net/2011/06/16/sql-server-index-maintenance-script/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Ich habe ein Script gesucht, was möglichst intelligent die Struktur der Indexe und ihren Fragmentierungsgrad auswertet. Auf Grund dieser Auswertung soll es entscheiden, ob es einen Rebuild oder ein Reorganize macht oder halt einfach nichts.</p>
<p>Genau das tut das Script auf <a title="http://ola.hallengren.com/" href="http://ola.hallengren.com/">http://ola.hallengren.com/</a></p>
<p>Nachdem man die Stored Procedure bei sich eingerichtet hat, genügt ein Aufruf von</p>
<pre>dbo.IndexOptimize 'MeineDatenbank'</pre>
<p>Ich kann das Script wärmstens empfehlen und der Blogeintrag ist auch so eine Art Referenz für mich <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smiley" src="http://blog.fabse.net/wp-content/uploads/wlEmoticon-smile.png" /></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/06/16/sql-server-index-maintenance-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2008: E-Mail-Benachrichtigung bei fehlgeschlagenen Jobs einrichten</title>
		<link>http://blog.fabse.net/2011/04/26/sql-server-2008-e-mail-benachrichtigung-bei-fehlgeschlagenen-jobs-einrichten/</link>
		<comments>http://blog.fabse.net/2011/04/26/sql-server-2008-e-mail-benachrichtigung-bei-fehlgeschlagenen-jobs-einrichten/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 09:49:48 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/?p=538</guid>
		<description><![CDATA[Man muss an mehr als einer Stelle im Sql Server konfigurieren um eine E-Mail zu erhalten, wenn mal ein Job fehlschlägt und um dies das nächste mal zur Hand zu haben, habe ich die Schritte nachfolgend festgehalten. 1. Database Mail &#8230; <a href="http://blog.fabse.net/2011/04/26/sql-server-2008-e-mail-benachrichtigung-bei-fehlgeschlagenen-jobs-einrichten/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Man muss an mehr als einer Stelle im Sql Server konfigurieren um eine E-Mail zu erhalten, wenn mal ein Job fehlschlägt und um dies das nächste mal zur Hand zu haben, habe ich die Schritte nachfolgend festgehalten.</p>
<h3>1. <strong>Database Mail Profil anlegen </strong></h3>
<p>Zuerst muss Database Mail eingerichtet werden:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_01" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image002.jpg" width="306" height="335" /></p>
<p>Wenn man sich durch den Dialog klickt, muss man ein neues Profil anlegen und die Authentifizierung dafür konfigurieren:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_02" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image004.jpg" width="629" height="598" /></p>
<p>Hat man dies erledigt, schließt man den Dialog und versucht zuerst eine Testmail zu senden:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_03" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image006.jpg" width="301" height="143" /></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_04" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image008.jpg" width="437" height="269" /></p>
<p>Dies muss funktionieren bevor man fortsetzt…</p>
<p><strong>2. SQL Server Agent konfigurieren </strong></p>
<p>Jetzt muss der SQL Server Agent konfiguriert werden:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_05" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image010.jpg" width="267" height="203" /></p>
<p>Wichtig ist, dass man ihm ein E-Mail Profil zuordnet:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_06" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image012.jpg" width="628" height="563" /></p>
<p><strong>3. SQL Operator anlegen </strong></p>
<p>Als nächstes muss ein Operator angelegt werden. Man kann sich dies als E-Mail-Kontakt vorstellen:    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_07" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image014.jpg" width="276" height="202" /></p>
<p>Wichtig hier ist der Name und die E-Mail-Adresse, da dorthin die Mails verschickt werden. Es sind mehrere Adressen möglich, wenn diese durch Semikolons getrennt werden!&#160; <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_08" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image016.jpg" width="609" height="546" /></p>
<p>Bei mir war es notwendig, den SQL Server Agent einmal durchzustarten…    <br /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_09" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image018.jpg" width="270" height="222" /></p>
<p><strong>4. Job einrichten </strong></p>
<p>Zuletzt kann man in beliebig vielen Jobs folgende Notifications einstellen:</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SqlServerMailOnFailedJob_10" border="0" alt="" src="http://blog.fabse.net/wp-content/uploads/clip_image020.jpg" width="553" height="498" /></p>
<p>Jetzt sollten E-Mails eintrudeln, wenn der Job fehlschlägt.</p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/04/26/sql-server-2008-e-mail-benachrichtigung-bei-fehlgeschlagenen-jobs-einrichten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erste Schritte mit RavenDB</title>
		<link>http://blog.fabse.net/2011/04/25/erste-schritte-mit-ravendb/</link>
		<comments>http://blog.fabse.net/2011/04/25/erste-schritte-mit-ravendb/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 20:47:00 +0000</pubDate>
		<dc:creator>Fabse</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[RavenDB]]></category>

		<guid isPermaLink="false">http://blog.fabse.net/2011/04/25/erste-schritte-mit-ravendb/</guid>
		<description><![CDATA[…sind ganz einfach! Runterladen, entpacken und Server starten über Batchdatei. Dann eines der Samples öffnen – bei mir war es SimpleClient. RavenDB ist eine schema-lose Dokumentendatenbank und damit Vertreter der NoSQL-Bewegung. Zugriffe erfolgen über REST. Es gibt eine .Net ClientAPI &#8230; <a href="http://blog.fabse.net/2011/04/25/erste-schritte-mit-ravendb/">Continue reading <span class="meta-nav">&#8594;</span></a><p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></description>
			<content:encoded><![CDATA[<p>…sind ganz einfach! Runterladen, entpacken und Server starten über Batchdatei. Dann eines der Samples öffnen – bei mir war es SimpleClient.</p>
<p><a href="http://ravendb.net/" target="_blank">RavenDB</a> ist eine schema-lose Dokumentendatenbank und damit Vertreter der <a href="http://de.wikipedia.org/wiki/NoSQL_%28Konzept%29" target="_blank">NoSQL</a>-Bewegung. Zugriffe erfolgen über <a href="http://de.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">REST</a>. Es gibt eine .Net ClientAPI und mit der kann man in 3 Zeilen jedes beliebige Objekt in die Datenbank schreiben. Ich bin echt beeindruckt, wie unerwartet unkompliziert das geht.</p>
<p>Ich habe eine halbwegs klare Projektidee im Kopf, so musste ich einige konkrete Fragen klären, die durch das Lesen von <a href="http://ayende.com/blog/default.aspx" target="_blank">Ayendes Blog</a> (Tipp!!!) nicht zu klären waren.</p>
<p>Kann man RavenDB embedded hosten? Ja! Neben dem Hosten über einen Windows Service oder über den IIS kann man auch im Client selbst die Datenbank hosten womit das ganze zu einer Standalone-App wird.</p>
<p>Wie gut kommt es mit Blobs klar? Hier habe ich lange probiert. Zuerst hatte ich immer ein Byte-Array in meinen Objekten, was aber schnell zu OutOfMemory-Situationen führt. Ich hatte mit ca. 1000 Objekten mit je 3mb Inhalt zu tun. Es erfolgt eine Base64-Codierung bei der Übertragung so dass zu einem Zeitpunkt in Server und Client in Summe vermutlich mindestens 4 Varianten gehalten werden. Wenn man die richtigen Google-Suchwörter verwendet, findet man heraus, dass RavenDB auch <a href="http://groups.google.com/group/ravendb/browse_thread/thread/7b73377adf3e09cd/43deb6f4db4ca9af?lnk=gst&amp;q=Attachments#43deb6f4db4ca9af" target="_blank">Attachments</a> als Konzept versteht. Hier gibt es wohl keine Transaktionalität aber dafür Performance! Mir gelang es, ein Attachment mit 335mb in 66s in die Datenbank zu pumpen, was für meine Anforderungen vollkommen genügt. Bei dem nächstgrößeren Versuch mit 500mb kam es zu einer OutOfMemoryException, aber das ist ok. Attachments können übrigens auch direkt durch einen Browser geladen werden!</p>
<p>Sollte jetzt der Eindruck entstanden sein, dass RavenDB langsam ist, dann muss ich dem Widersprechen. Mir gelang es die 1000 Objekte nur mit Metadaten und ohne Blobs in unter einer Sekunde in die Datenbank zu laden.</p>
<p>Ich bin sehr beendruckt von RavenDB und kann jedem nur empfehlen, sich selbst einen Eindruck zu verschaffen.</p>
<p><em>Mein Ostermontag ist jedenfalls gut angelegt</em> <img class="wlEmoticon wlEmoticon-openmouthedsmile" style="border-style: none;" src="http://blog.fabse.net/wp-content/uploads/wlEmoticon-openmouthedsmile.png" alt="Open-mouthed smile" /></p>
<p><br /><br />---<br />
<a href="https://www.amazon.de/?&tag=fabsenetfabse-21">Unterst&uuml;tze mich und meinen Blog und kauf dir was Nettes (&uuml;ber diesen Link)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fabse.net/2011/04/25/erste-schritte-mit-ravendb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

