<?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>Simon Ottenhaus &#187; Development</title>
	<atom:link href="http://familie-ottenhaus.de/simon/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://familie-ottenhaus.de/simon/blog</link>
	<description>Uni &#38; Software</description>
	<lastBuildDate>Fri, 23 Dec 2011 13:15:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Listen filtern mit LINQ &#8211; c# Snippets</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/10/listen-filtern-mit-linq-c-snippets/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/10/listen-filtern-mit-linq-c-snippets/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 19:27:15 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1354</guid>
		<description><![CDATA[Damit die Reihe c# Snippets gleich mit zwei Artikel startet folgt nun noch ein kurzes aber praktisches Snippet. Problemstellung Gegeben ist eine Liste. Gesucht ist eine Teilmenge der Liste, die eine bestimmte Bedingung erfüllt. Beispiel Gegeben: List&#60;int&#62; list = new List&#60;int&#62;() { 5, 3, 17, 2, 23 }; Gesucht ist eine neue Liste, die alle [...]]]></description>
			<content:encoded><![CDATA[<p>Damit die <a href="http://familie-ottenhaus.de/simon/blog/tag/snippets/" class="liinternal">Reihe c# Snippets</a> gleich mit zwei Artikel startet folgt nun noch ein kurzes aber praktisches Snippet.</p>
<p><strong>Problemstellung</strong><br />
Gegeben ist eine Liste.<br />
Gesucht ist eine Teilmenge der Liste, die eine bestimmte Bedingung erfüllt.</p>
<p><strong>Beispiel</strong><br />
Gegeben: <code>List&lt;int&gt; list = new List&lt;int&gt;() { 5, 3, 17, 2, 23 };</code><br />
Gesucht ist eine neue Liste, die alle Elemente größer 10 enthält.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1354code3'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13543"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1354code3"><pre class="csharp" style="font-family:monospace;">List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> list <span style="color: #008000;">=</span> ...<span style="color: #008000;">;</span>
List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> result <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>from i <span style="color: #0600FF;">in</span> list where i <span style="color: #008000;">&gt;</span> 10 select i<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>In dem Select-Teil kann auch Code ausgeführt werden, zum Beispiel wenn die Quadrate der Zahlen gesucht sind:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1354code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13544"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1354code4"><pre class="csharp" style="font-family:monospace;">List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> list <span style="color: #008000;">=</span> ...<span style="color: #008000;">;</span>
List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">int</span><span style="color: #008000;">&gt;</span> result <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>from i <span style="color: #0600FF;">in</span> list where i <span style="color: #008000;">&gt;</span> 10 select i <span style="color: #008000;">*</span> i<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/10/listen-filtern-mit-linq-c-snippets/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/10/listen-filtern-mit-linq-c-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SerializeToString &#8211; c# Snippets</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/10/serializetostring-c-snippets/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/10/serializetostring-c-snippets/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 19:10:58 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1337</guid>
		<description><![CDATA[Dieser Artikel ist der erste Teil der Reihe c# Snippets. Oftmals hat man eine Liste von Elementen möchte diese aber als einen String darstellen. Beispiel Gegegen ist eine Liste von decimal-Werten: List&#60;decimal&#62;list = new list&#60;decimal&#62;{ 1.05, 2.50; 3.66 }; Gewünscht ist "1,05; 2,50; 3,66" Der herkömmliche Ansatz &#8230; sieht dann vermutlich so oder so ähnlich [...]]]></description>
			<content:encoded><![CDATA[<p><em>Dieser Artikel ist der erste Teil der <a href="http://familie-ottenhaus.de/simon/blog/tag/snippets/" class="liinternal">Reihe c# Snippets</a>.</em></p>
<p>Oftmals hat man eine Liste von Elementen möchte diese aber als einen String darstellen.</p>
<p><strong>Beispiel</strong><br />
Gegegen ist eine Liste von decimal-Werten:<br />
<code>List&lt;decimal&gt;list = new list&lt;decimal&gt;{ 1.05, 2.50; 3.66 };</code><br />
Gewünscht ist <code>"1,05; 2,50; 3,66"</code></p>
<p><strong>Der herkömmliche Ansatz</strong><br />
&#8230; sieht dann vermutlich so oder so ähnlich aus:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1337code9'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p13379"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p1337code9"><pre class="csharp" style="font-family:monospace;">StringBuilder sb <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StringBuilder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">decimal</span> d <span style="color: #0600FF;">in</span> list<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    sb.<span style="color: #0000FF;">Append</span><span style="color: #000000;">&#40;</span>d.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;0.00&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;;  &quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>sb.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> 0<span style="color: #000000;">&#41;</span> sb.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-=</span><span style="color: #FF0000;">2</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// Trennzeichen am Ende entfernen</span>
<span style="color: #0600FF;">return</span> sb.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p><strong>Die Hilfsmethode SerializeToString mit Lamda-Ausdrücken</strong></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1337code10'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p133710"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p1337code10"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> <span style="color: #FF0000;">class</span> StringExtensions
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> SerializeToString<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span> IEnumerable<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> list, Func<span style="color: #008000;">&lt;</span>T, <span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> serialize, <span style="color: #FF0000;">string</span> separator<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        StringBuilder sb2 <span style="color: #008000;">=</span> list.<span style="color: #0000FF;">Aggregate</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StringBuilder<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>sb, item<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=&gt;</span> sb.<span style="color: #0000FF;">Append</span><span style="color: #000000;">&#40;</span>serialize<span style="color: #000000;">&#40;</span>item<span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> separator<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>sb2.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">&gt;</span> 0<span style="color: #000000;">&#41;</span> sb2.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-=</span> separator.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">return</span> sb2.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><strong>Der Aufruf von SerializeToString</strong><br />
ist nun wesentlich kürzer und meiner Meinung nach besser lesbar:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1337code11'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p133711"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1337code11"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">string</span> serializedValues <span style="color: #008000;">=</span> list.<span style="color: #0000FF;">SerializeToString</span><span style="color: #000000;">&#40;</span>d <span style="color: #008000;">=&gt;</span> d.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;0.00&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>Natürlich funktioniert dies auch für Listen von komplexeren Datenstrukturen und auch verschachtelt:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1337code12'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p133712"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p1337code12"><pre class="csharp" style="font-family:monospace;">List<span style="color: #008000;">&lt;</span>List<span style="color: #008000;">&lt;</span>DateTime<span style="color: #008000;">&gt;&gt;</span> list <span style="color: #008000;">=</span> ...<span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">string</span> serializedValues <span style="color: #008000;">=</span> list.<span style="color: #0000FF;">SerializeToString</span><span style="color: #000000;">&#40;</span>i1 <span style="color: #008000;">=&gt;</span> i1.<span style="color: #0000FF;">Count</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; Elemente: &quot;</span> <span style="color: #008000;">+</span> i1.<span style="color: #0000FF;">SerializeToString</span><span style="color: #000000;">&#40;</span>i2 <span style="color: #008000;">=&gt;</span> i2.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #666666;">&quot;, &quot;</span><span style="color: #000000;">&#41;</span>, <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\r</span><span style="color: #008080; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008080; font-style: italic;">// Beispiel-Ausgabe:</span>
<span style="color: #008080; font-style: italic;">// 1.1.2010, 2.1.2010</span>
<span style="color: #008080; font-style: italic;">// 1.1.2011, 2.1.2011, 3.1.2011</span>
<span style="color: #008080; font-style: italic;">// ...</span></pre></td></tr></table></div>

<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/10/serializetostring-c-snippets/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/10/serializetostring-c-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Filmchen&#8221; zur Rekursion</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 20:50:42 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HowTo / Anleitung]]></category>
		<category><![CDATA[Uni Stuttgart]]></category>
		<category><![CDATA[Informatikpraktikum]]></category>
		<category><![CDATA[Rekursion]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1288</guid>
		<description><![CDATA[Findet sich ab sofort unter InfoP]]></description>
			<content:encoded><![CDATA[<p>Findet sich ab sofort unter <a href="http://familie-ottenhaus.de/simon/blog/infop/" class="liinternal">InfoP</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/06/filmchen-zur-rekursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die Schriftart machts!</title>
		<link>http://familie-ottenhaus.de/simon/blog/2011/05/die-schriftart-machts/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2011/05/die-schriftart-machts/#comments</comments>
		<pubDate>Sun, 29 May 2011 18:13:57 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Georgia]]></category>
		<category><![CDATA[Schriftart]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1268</guid>
		<description><![CDATA[Soeben habe ich beschlossen, dass mein Blog deutlich mehr Georgia verträgt. Artikelüberschriften und Überschriften in der Sidebar erfreuen sich nun einer neuen Schriftart. vorher war Arial jetzt ist Georgia in kursiv]]></description>
			<content:encoded><![CDATA[<p>Soeben habe ich beschlossen, dass mein Blog deutlich mehr Georgia verträgt. Artikelüberschriften und Überschriften in der Sidebar erfreuen sich nun einer neuen Schriftart.<br />
<span style="font: normal 30px/40px Arial">vorher war Arial</span><br />
<span style="font: italic 30px/40px Georgia">jetzt ist Georgia in kursiv</span></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2011/05/die-schriftart-machts/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2011/05/die-schriftart-machts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>c# &#8211; WorkingSetControl / RamControl: Displaying the Working Set size / current RAM usage of an application</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/11/c-workingsetcontrol-ramcontrol-displaying-the-working-set-size-current-ram-usage-of-an-application/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/11/c-workingsetcontrol-ramcontrol-displaying-the-working-set-size-current-ram-usage-of-an-application/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 13:38:42 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[Working Set]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1133</guid>
		<description><![CDATA[English Did you ever want to display the Working Set size / current RAM usage of your c# application? If the answer to this question is &#8216;yes&#8217;, here is your solution. If the answer is &#8216;no&#8217; you still might find some usable code snippets in the control. Deutsch Es ist relativ einfach die aktuelle Speicherbelegung [...]]]></description>
			<content:encoded><![CDATA[<p><em>English</em><br />
Did you ever want to display the Working Set size / current RAM usage of your c# application? If the answer to this question is &#8216;yes&#8217;, here is your solution. If the answer is &#8216;no&#8217; you still might find some usable code snippets in the control.</p>
<p><em>Deutsch</em><br />
Es ist relativ einfach die aktuelle Speicherbelegung in einem c# Programm herauszufinden. Ich habe dies Funktionalität in ein kleinen Control verpackt.</p>
<p>Screenshot des Controls:<br />
<img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2010/11/WorkingSetControl.png" alt="WorkingSetControl" title="WorkingSetControl" width="136" height="31" class="alignnone size-full wp-image-1137" /></p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1133code14'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p113314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
</pre></td><td class="code" id="p1133code14"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Windows.Forms</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Threading</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Diagnostics</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Drawing</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> MyProject
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Control to display the  current WorkingSet size. Aka &quot;RamControl&quot;. Just call Start to start the monitoring.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #FF0000;">class</span> WorkingSetControl <span style="color: #008000;">:</span> Control
    <span style="color: #000000;">&#123;</span>
        Thread t1<span style="color: #008000;">;</span>
        <span style="color: #FF0000;">bool</span> active <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> WorkingSetControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            SetStyle<span style="color: #000000;">&#40;</span>ControlStyles.<span style="color: #0000FF;">OptimizedDoubleBuffer</span>, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Start displaying the current WorkingSet size. If you don't call Start you won't see a thing!</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #0600FF;">internal</span> <span style="color: #0600FF;">void</span> Start<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// start only if not started yet</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>t1 <span style="color: #008000;">==</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #008080; font-style: italic;">// although we could use a lambda expression to create this thread don't use one to be .NET 2.0 compatible.</span>
                t1 <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Thread<span style="color: #000000;">&#40;</span>run<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #008080; font-style: italic;">// if you *HAVE* to use a lambda expression, fine have fun with your cryptic code:</span>
                <span style="color: #008080; font-style: italic;">/*
                t1 = new Thread(() =&gt;
                {
                    while (active)
                    {
                        Invalidate();
                        Thread.Sleep(100);
                    }
                });
                */</span>
&nbsp;
                <span style="color: #008080; font-style: italic;">// set active to true, so our run method does actually run in loops 'n loops 'n loops until active is set to false ==&gt; see Dispose.</span>
                active <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span>
                t1.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">void</span> run<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">while</span> <span style="color: #000000;">&#40;</span>active<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                Invalidate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Thread.<span style="color: #0000FF;">Sleep</span><span style="color: #000000;">&#40;</span>100<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Get and draw the WorkingSet size</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;</span>
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnPaint<span style="color: #000000;">&#40;</span>PaintEventArgs e<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #FF0000;">string</span> ram <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;xxx&quot;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Only get the WorkingSet size if the control is in active mode.</span>
            <span style="color: #008080; font-style: italic;">// This prevents the control displaying the WorkingSet size of Visual Studio in the designer (which works actually, but is somehow confusing).</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>active<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #FF0000;">long</span> lngSessMemory <span style="color: #008000;">=</span> Process.<span style="color: #0000FF;">GetCurrentProcess</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">WorkingSet64</span><span style="color: #008000;">;</span>
                ram <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>Convert.<span style="color: #0000FF;">ToDouble</span><span style="color: #000000;">&#40;</span>lngSessMemory<span style="color: #000000;">&#41;</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">1000</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">1000</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;0.00&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// do the grphics stuff</span>
            e.<span style="color: #0000FF;">Graphics</span>.<span style="color: #0000FF;">Clear</span><span style="color: #000000;">&#40;</span>BackColor<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            e.<span style="color: #0000FF;">Graphics</span>.<span style="color: #0000FF;">DrawString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;WorkingSet: &quot;</span> <span style="color: #008000;">+</span> ram <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; MB&quot;</span>, Font, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SolidBrush<span style="color: #000000;">&#40;</span>ForeColor<span style="color: #000000;">&#41;</span>, 0, 0<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// Lets make sure our thread terminates at some point in time.</span>
        <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
        <span style="color: #008080; font-style: italic;">/// &lt;param name=&quot;disposing&quot;&gt;&lt;/param&gt;</span>
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Dispose<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span> disposing<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// I know we should wait for the thread to actually funish by using t1.Join() but that would slow down this methob by up to 100ms.</span>
            <span style="color: #008080; font-style: italic;">// If you have any Problems with controls not disposing properly, let me know and send me a solution ;)</span>
            active <span style="color: #008000;">=</span> false<span style="color: #008000;">;</span>
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span>disposing<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/11/c-workingsetcontrol-ramcontrol-displaying-the-working-set-size-current-ram-usage-of-an-application/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/11/c-workingsetcontrol-ramcontrol-displaying-the-working-set-size-current-ram-usage-of-an-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dotfuscator CE + Explizite Schnittstellen- implementierung (Interface) = TypeLoadException: Die Methode GetEnumerator hat keine Implementierung</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/06/dotfuscator-ce-explizite-schnittstellen-implementierung-interface-typeloadexception-die-methode-getenumerator-hat-keine-implementierung/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/06/dotfuscator-ce-explizite-schnittstellen-implementierung-interface-typeloadexception-die-methode-getenumerator-hat-keine-implementierung/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 13:36:49 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Dotfuscator]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1108</guid>
		<description><![CDATA[Ich verwende Dotfuscator CE (Community Edition) um meine .Net Anwendungen zu schützen. Kürzlich ist dabei ein Fehler aufgetreten: TypeLoadException: Die Methode GetEnumerator hat keine Implementierung Das Problem bestand aber nur nachdem die Anwendung vom Dotfuscator bearbeitet wurde. Vorher funktionierte alles noch prima. Aufgetreten war das Ganze, weil ich in einer Klasse zwei verschiedene IEnumerable&#60;T&#62; implementiert [...]]]></description>
			<content:encoded><![CDATA[<p>Ich verwende Dotfuscator CE (Community Edition) um meine .Net Anwendungen zu schützen. </p>
<p>Kürzlich ist dabei ein Fehler aufgetreten:</p>
<blockquote><p>TypeLoadException: Die Methode GetEnumerator hat keine Implementierung</p></blockquote>
<p>Das Problem bestand aber nur nachdem die Anwendung vom Dotfuscator bearbeitet wurde. Vorher funktionierte alles noch prima.</p>
<p>Aufgetreten war das Ganze, weil ich in einer Klasse zwei verschiedene IEnumerable&lt;T&gt; implementiert hatte.<br />
Beispiel:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1108code16'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p110816"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1108code16"><pre class="csharp" style="font-family:monospace;"><span style="color: #FF0000;">class</span> MyClass <span style="color: #008000;">:</span> IEnumerable<span style="color: #008000;">&lt;</span>ClassA<span style="color: #008000;">&gt;</span>, IEnumerable<span style="color: #008000;">&lt;</span>ClassB<span style="color: #008000;">&gt;</span> <span style="color: #000000;">&#123;</span>
...
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>In diesem Fall ist eine sogenannte <a href="http://msdn.microsoft.com/de-de/library/ms173157%28VS.80%29.aspx" target="_blank" class="liexternal">Explizite Schnittstellenimplementierung</a> notwendig. Dies hat der Dotfuscator offensichtlich nicht verstanden. Nachdem ich die Implementierung der Schnittstelle in eine extra Methode ausgelagert hatte und die Explizite Schnittstellenimplementierung entfernt hatte funktionierte alles wieder gut.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/06/dotfuscator-ce-explizite-schnittstellen-implementierung-interface-typeloadexception-die-methode-getenumerator-hat-keine-implementierung/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/06/dotfuscator-ce-explizite-schnittstellen-implementierung-interface-typeloadexception-die-methode-getenumerator-hat-keine-implementierung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows XP SP3 + Visual Studio 2010 (c#) = Bluescreen</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/05/windows-xp-sp3-visual-studio-2010-c-bluescreen/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/05/windows-xp-sp3-visual-studio-2010-c-bluescreen/#comments</comments>
		<pubDate>Tue, 25 May 2010 10:53:25 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Bluescreen]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1104</guid>
		<description><![CDATA[Nachdem ich angefangen habe einen Teil meiner Projekte in von VS 2008 nach VS 2010 zu konvertieren musste ich Visual Studio 2010 auch auf allen Entwicklungsrechnern installieren. Die Migration der Projekte und build-skripte verlief erstaunlich problem- und reibungslos. Probleme gab es nur auf dem letzten Windows XP PC. Visual Studio konnte zwar problemlos geöffnet, das [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich angefangen habe einen Teil meiner Projekte in von VS 2008 nach VS 2010 zu konvertieren musste ich Visual Studio 2010 auch auf allen Entwicklungsrechnern installieren. Die Migration der Projekte und build-skripte verlief erstaunlich problem- und reibungslos.</p>
<p>Probleme gab es nur auf dem letzten Windows XP PC. Visual Studio konnte zwar problemlos geöffnet, das Projekt auch gebaut und gestartet werden. Wenn VS 2010 allerdings geschlossen wurde verabschiedete sich Windows XP jedes Mal ausnahmslos mit einem Bluescreen.</p>
<p><strong>Sofortlösung</strong><br />
Die schnellste Lösung war Visual Studio 2010 nicht zu schließen sondern mit dem Task Manager zu beenden. Da dies allerdings nur eine Notlösung war musste ich weiter probieren&#8230;</p>
<p>Das Installieren der von VS 2010 angemahnten &#8220;Windows-Automatisierungs-API&#8221; brachte leider nichts.</p>
<p><strong>Endgültige Lösung</strong><br />
Da VS 2010 WPF (Windows Presentation Foundation) verwendet und diese Hardwarebeschleunigung verwendet beschloss ich das Problem mit einem Grafikkartrenteiberupdate anzugehen. Nahezu unglaublich aber wahr: Der aktuelle GeForce Treiber (197.45) löste das Problem. VS lässt sich nun wieder ohne Absturz schließen.</p>
<p>Es gilt also:<br />
Windows XP SP3<br />
+ Visual Studio 2010 (c#)<br />
+ Neuer Grafikkarten Treiber = <img src='http://familie-ottenhaus.de/simon/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (Zumindest in meinem Fall)</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/05/windows-xp-sp3-visual-studio-2010-c-bluescreen/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/05/windows-xp-sp3-visual-studio-2010-c-bluescreen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Die Untiefen der GD-lib in PHP</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/05/die-untiefen-der-gd-lib-in-php/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/05/die-untiefen-der-gd-lib-in-php/#comments</comments>
		<pubDate>Tue, 04 May 2010 18:49:40 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1098</guid>
		<description><![CDATA[Bevor die Informationsseiten auf compulearnenglisch.de online gegangen sind habe ich diese offline getestet. Dazu habe ich unter anderem transparente Bilder serverseitig verkleinert. Auf meinem lokalen Linux Server ergaben sich dabei Streifen, bei Hosteurope (dort ist compulearnenglisch.de gehostet) nicht. links: lokal, rechts: online Hier stark vergrößert:]]></description>
			<content:encoded><![CDATA[<p>Bevor die <a href="http://compulearnenglisch.de/information/" target="_blank" class="liexternal">Informationsseiten</a> auf <a href="http://compulearnenglisch.de" target="_blank" class="liexternal">compulearnenglisch.de</a> online gegangen sind habe ich diese offline getestet. Dazu habe ich unter anderem transparente Bilder serverseitig verkleinert. Auf meinem lokalen Linux Server ergaben sich dabei Streifen, bei Hosteurope (dort ist compulearnenglisch.de gehostet) nicht.</p>
<p>links: lokal, rechts: online<br />
<img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2010/05/flaggen-normal.png" alt="flaggen-normal" title="flaggen-normal" width="568" height="180" class="alignnone size-full wp-image-1100" /></p>
<p>Hier stark vergrößert:<br />
<a href="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2010/05/flaggen-groß.png" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/uploads/2010/05/flaggen-groß-300x264.png" alt="flaggen-groß" title="flaggen-groß" width="300" height="264" class="alignnone size-medium wp-image-1099" /></a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/05/die-untiefen-der-gd-lib-in-php/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/05/die-untiefen-der-gd-lib-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zoomimage &amp; jQuery: Schönes kann so einfach sein.</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/04/zoomimage-jquery-schones-kann-so-einfach-sein/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/04/zoomimage-jquery-schones-kann-so-einfach-sein/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 16:31:33 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Post Functions]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Zoomimage]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1090</guid>
		<description><![CDATA[Zoomimage ist ein Plugin für jQuery mit dem verlinkte Bilder vergrößert werden können. Die Einbindung ist denkbar einfach und auf der Zoomimage Homepage auch ausreichend beschrieben. Um Zoomimage vollständig in WordPress einzubinden habe ich mein Post Functions Plugin erweitert. View Code PLAIN1 [zoomimage:src=screenshots/lueckentext-mit-hilfe.png, w=400, zw=800, float=right, alt=Lückentext zu den unregelmäßigen Verben] Obiger Code resultiert in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.eyecon.ro/zoomimage/" target="_blank" class="liexternal">Zoomimage</a> ist ein Plugin für <a href="http://jquery.com/" target="_blank" class="liexternal">jQuery</a> mit dem verlinkte Bilder vergrößert werden können.<br />
Die Einbindung ist denkbar einfach und auf der Zoomimage Homepage auch ausreichend beschrieben.</p>
<p>Um Zoomimage vollständig in WordPress einzubinden habe ich mein <a href="http://familie-ottenhaus.de/simon/blog/tag/post-functions/" class="liinternal">Post Functions Plugin</a> erweitert.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1090code18'); return false;">View Code</a> PLAIN</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p109018"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1090code18"><pre class="plain" style="font-family:monospace;">[zoomimage:src=screenshots/lueckentext-mit-hilfe.png, w=400, zw=800, float=right, alt=Lückentext zu den unregelmäßigen Verben]</pre></td></tr></table></div>

<p>Obiger Code resultiert in einem 400px breiten Bild, das bei Klick auf 800px verbreitert wird. Zusätzlich wird unter dem Bild der alt-Text angezeigt.</p>
<p>Die Resultate können dann in absehbarer Zeit auf <a href="http://compulearnenglisch.de/information/" target="_blank" class="liexternal">compulearnenglisch.de/information</a> besichtigt werden.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/04/zoomimage-jquery-schones-kann-so-einfach-sein/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/04/zoomimage-jquery-schones-kann-so-einfach-sein/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Services_JSON vs. json_decode</title>
		<link>http://familie-ottenhaus.de/simon/blog/2010/04/php-services_json-vs-json_decode/</link>
		<comments>http://familie-ottenhaus.de/simon/blog/2010/04/php-services_json-vs-json_decode/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 18:30:14 +0000</pubDate>
		<dc:creator>Simon Ottenhaus</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://familie-ottenhaus.de/simon/blog/?p=1086</guid>
		<description><![CDATA[Da PHP4 noch keine native JSON-Unterstützung mitbrachte hatte ich mich für Services_JSON entschieden. Eine neue Anwendung erforderte nun das Hochladen von größeren Datenmengen. Dabei stieß Services_JSON an seine Grenzen: Ab einer gewissen Datenmenge wurden die Daten nicht mehr umgewandelt. Da PHP5 inzwischen gut verbreitet ist konnte ich View Code PHP1 2 3 4 function json2array&#40;$sJson&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Da PHP4 noch keine native <a href="http://json.org/" target="_blank" class="liexternal">JSON</a>-Unterstützung mitbrachte hatte ich mich für <a href="http://pear.php.net/pepr/pepr-proposal-show.php?id=198" target="_blank" class="liexternal">Services_JSON</a> entschieden. Eine neue Anwendung erforderte nun das Hochladen von größeren Datenmengen. Dabei stieß Services_JSON an seine Grenzen: Ab einer gewissen Datenmenge wurden die Daten nicht mehr umgewandelt.</p>
<p>Da PHP5 inzwischen gut verbreitet ist konnte ich</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1086code21'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p108621"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p1086code21"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> json2array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sJson</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$oJson</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Services_JSON <span style="color: #009900;">&#40;</span> SERVICES_JSON_LOOSE_TYPE <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$oJson</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">decode</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sJson</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>nun durch</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1086code22'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p108622"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p1086code22"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> json2array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sJson</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <a href="http://www.php.net/json_decode"><span style="color: #990000;">json_decode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sJson</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>ersetzen.</p>
<p><strong>Das Resultat</strong><br />
Das Parsen der JSON codierten Daten läuft nun um Faktoren schneller.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://familie-ottenhaus.de/simon/blog/2010/04/php-services_json-vs-json_decode/" target="_blank" class="liimagelink"><img src="http://familie-ottenhaus.de/simon/blog/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://familie-ottenhaus.de/simon/blog/2010/04/php-services_json-vs-json_decode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

