<?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>ChalamiuS&#039; Blog</title>
	<atom:link href="http://blog.chalamius.se/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.chalamius.se</link>
	<description>Yet another random blog on the internet</description>
	<lastBuildDate>Fri, 30 Sep 2011 01:46:20 +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>This blog is totally not dead</title>
		<link>http://blog.chalamius.se/2011/05/this-blog-is-totally-not-dead</link>
		<comments>http://blog.chalamius.se/2011/05/this-blog-is-totally-not-dead#comments</comments>
		<pubDate>Wed, 18 May 2011 16:19:32 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=360</guid>
		<description><![CDATA[I totally hadn&#8217;t forgot about the fact that I even had a blog.]]></description>
			<content:encoded><![CDATA[<p><object width="584" height="438"><param name="movie" value="http://www.youtube.com/v/cF6PaxzmaRg?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/cF6PaxzmaRg?version=3" type="application/x-shockwave-flash" width="584" height="438" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>I totally hadn&#8217;t forgot about the fact that I even had a blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2011/05/this-blog-is-totally-not-dead/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A smaller status update</title>
		<link>http://blog.chalamius.se/2011/03/a-smaller-status-update</link>
		<comments>http://blog.chalamius.se/2011/03/a-smaller-status-update#comments</comments>
		<pubDate>Thu, 03 Mar 2011 19:50:32 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[QDB]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=336</guid>
		<description><![CDATA[Except for the ordinary slavery going on at school I&#8217;m working on a bunch of projects Hecate A rewrite of Lolikins&#8217; rewrite (which I never finished), sort of. Made in Python instead of PHP which gives a couple of quite &#8230; <a href="http://blog.chalamius.se/2011/03/a-smaller-status-update">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_343" class="wp-caption alignright" style="width: 206px"><a href="http://danbooru.donmai.us/post/show/684832/absurdres-butterfly-camellia_-flower-flower-hagiwa"><img class="size-medium wp-image-343" title="Akyu" src="http://static.chalamius.se/wp-content/uploads/2011/03/akyu2-196x300.png" alt="Akyu" width="196" height="300" /></a><p class="wp-caption-text">Akyu~</p></div>
<p>Except for the ordinary slavery going on at school I&#8217;m working on a bunch of projects</p>
<h4><strong>Hecate</strong></h4>
<p>A rewrite of Lolikins&#8217; rewrite (which I never finished), sort of.<br />
Made in Python instead of PHP which gives a couple of quite nice advantages such as:</p>
<ul>
<li>SSL support again</li>
<li>Clean code (PHP looks dirty for some reason, probably all those $)</li>
<li>Module reloading without the use of unsupported extensions</li>
</ul>
<p>Oh and I have someone helping me out actively this time (which means it&#8217;ll probably be finished too).</p>
<h4><strong>Akyu</strong></h4>
<p>As usual there&#8217;s some changes I did to the quote database such as infi-scroll (you know, the thing that makes the page continue loading while you scroll on twitter and such) which&#8230; doesn&#8217;t work quite as I want it to just yet but oh well.</p>
<h4><strong>Lastly</strong></h4>
<p>There&#8217;s a project I&#8217;ll announce when it&#8217;s ready (some of you may already know but keep it to yourselves).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2011/03/a-smaller-status-update/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Birthday Southrop</title>
		<link>http://blog.chalamius.se/2010/11/happy-birthday-southrop</link>
		<comments>http://blog.chalamius.se/2010/11/happy-birthday-southrop#comments</comments>
		<pubDate>Sat, 13 Nov 2010 09:00:24 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=304</guid>
		<description><![CDATA[So, once again it&#8217;s Southrop&#8217;s birthday. Head over to Chaos&#124;Theory and congratulate him. Some facts about Southrop: He is a staff member over at BakaBT runs Chaos, an anime fansub group (among other things) Well, that&#8217;s all. Head over to Chaos&#124;Theory &#8230; <a href="http://blog.chalamius.se/2010/11/happy-birthday-southrop">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, once again it&#8217;s Southrop&#8217;s birthday.<br />
Head over to <a title="Southrop's Blog" href="http://chaos-th.com/?p=1708" target="_blank">Chaos|Theory</a> and congratulate him.</p>
<div id="attachment_306" class="wp-caption alignnone" style="width: 302px"><a href="http://static.chalamius.se/wp-content/uploads/2010/11/0d3f23a876a8626fbdc02b5b14064ab5.png" rel="lightbox[304]"><img class="size-medium wp-image-306  " title="Happy Birthday Southrop!" src="http://static.chalamius.se/wp-content/uploads/2010/11/0d3f23a876a8626fbdc02b5b14064ab5-292x300.png" alt="Cirno &amp; Achi Cirno" width="292" height="300" /></a><p class="wp-caption-text">Happy birthday Southrop!</p></div>
<p><span id="more-304"></span></p>
<p>Some facts about Southrop:</p>
<p>He</p>
<ul>
<li> is a staff member over at <a title="An anime tracker aimed at providing the highest quality releases to the public" href="http://www.bakabt.com" target="_blank">BakaBT</a></li>
<li>runs Chaos, an anime fansub group (among other things)</li>
</ul>
<p>Well, that&#8217;s all. Head over to Chaos|Theory and congratulate him already!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2010/11/happy-birthday-southrop/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Some updates (and new creations)</title>
		<link>http://blog.chalamius.se/2010/09/some-updates-and-new-creations</link>
		<comments>http://blog.chalamius.se/2010/09/some-updates-and-new-creations#comments</comments>
		<pubDate>Sun, 05 Sep 2010 02:37:26 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[QDB]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=277</guid>
		<description><![CDATA[The Quote Database The quote database I work on (Akyu) have been updated to 0.2 recently (24th August). This changed some things: Voting buttons now actually tells you they are, i.e voting buttons No text error messages, all error messages &#8230; <a href="http://blog.chalamius.se/2010/09/some-updates-and-new-creations">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>The Quote Database</h3>
<p>The <a title="Quote Database" href="http://www.chalamius.se/quotes/" target="_blank">quote database</a> I work on (Akyu) have been updated to 0.2 recently (24th August).<br />
This changed some things:</p>
<ul>
<li>Voting buttons now actually tells you they are, i.e voting buttons</li>
<li>No text error messages, all error messages are displayed when you hover over the button you just clicked</li>
<li>Some minor changes to the layouts of some pages (for example the search page)</li>
</ul>
<p><span id="more-277"></span></p>
<h3>pIRC</h3>
<p>A smaller bug fix a couple of days ago. The event handler couldn&#8217;t handle some constants as triggers.<br />
Away has been added to the irc wrapper as well.</p>
<p>Going to try to get some sort of Admin module into it next time I have a longer weekend than I have now.</p>
<h3>Voile</h3>
<p>My little image gallery I work on every now and then.<br />
It currently only generates cached thumbnails for what I upload and lists them on the index page; nothing fancy.</p>
<p>Feel free to take a <a title="Image Gallery" href="http://voile.chalamius.se/index2.php" target="_blank">look</a></p>
<p>One last <strong>thing</strong>&#8230;</p>
<div class="wp-caption alignnone" style="width: 314px"><a href="http://voile.chalamius.se/uploads/images/thingie.png" rel="lightbox[277]"><img class=" " title="Thingie~" src="http://voile.chalamius.se/uploads/images/thingie.png" alt="Thingie~" width="304" height="225" /></a><p class="wp-caption-text">Rawr, I&#39;m going to poke you with my antenna</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2010/09/some-updates-and-new-creations/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Summer</title>
		<link>http://blog.chalamius.se/2010/06/summer</link>
		<comments>http://blog.chalamius.se/2010/06/summer#comments</comments>
		<pubDate>Mon, 14 Jun 2010 22:40:21 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=238</guid>
		<description><![CDATA[It&#8217;s finally here and everything is fine~ :3 Mandatory Touhou Tenshi, that is all. (Anyone thought of Angel Beats! Tenshi? No? Good.) Either way, recently I realized how nice Tenshi&#8217;s theme is. You should check it out (a simple search &#8230; <a href="http://blog.chalamius.se/2010/06/summer">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s finally here and everything is fine~ :3</p>
<h3>Mandatory Touhou</h3>
<div id="attachment_244" class="wp-caption alignright" style="width: 210px"><a href="http://static2.chalamius.se/images/3ebs0yp3.jpg" rel="lightbox[238]"><img class="size-full  wp-image-244    " title="Tenshi &amp; Yuuka" src="http://static.chalamius.se/wp-content/uploads/2010/06/tenshi__.jpg" alt="Tenshi and Yuuka" width="200" height="200" /></a><p class="wp-caption-text">Oh Tenshi, you masochist</p></div>
<p>Tenshi, that is all. (Anyone thought of Angel Beats! Tenshi? No? Good.)</p>
<p>Either way, recently I realized how nice Tenshi&#8217;s theme is. You should check it out (a simple search for &#8220;Catastrophe in Bhava-agra ~ Wonderful Heaven&#8221; on YouTube will give you plenty results or her final spell theme for that matter &#8220;Bhava-agra  As Seen Through a Child&#8217;s Mind&#8221;).</p>
<p><span id="more-238"></span></p>
<h3>Also, Git.</h3>
<p>I switched most of my projects over from SVN to Git, which is quite a lot better IMO. Not to mention it&#8217;s quite a bit faster and works without an internet connection (which is a plus if you&#8217;re on the bus or similar).</p>
<p>I&#8217;m yet to experiment with the more hidden features of Git though but I&#8217;ll get to that soon enough. So far so good though, Git is good.</p>
<h3>Anyways</h3>
<p>I have a rewrite of both the quote database and Lolikins going on (Lolikins is being moved over to the new IRC Lib), the QDB is being rewritten to be easier to manage.</p>
<p>The Quote Database&#8217;s appearance probably won&#8217;t change at all considering I&#8217;m the lazy person I am.<br />
Lolikins won&#8217;t have anything major changed except she replies to a few more CTCP commands (kind of got exchange rates planned for her though, but that&#8217;s up to Mirgond to help me figure out some good exchange rates).</p>
<h3>And finally</h3>
<p>That&#8217;s all. I just thought I&#8217;d write something again to not let this blog die out.</p>
<p><strong>tl;dr I&#8217;m bored.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2010/06/summer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random updates</title>
		<link>http://blog.chalamius.se/2010/02/random-updates</link>
		<comments>http://blog.chalamius.se/2010/02/random-updates#comments</comments>
		<pubDate>Mon, 22 Feb 2010 23:07:45 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[QDB]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=202</guid>
		<description><![CDATA[So&#8230; I just thought I&#8217;d post some updates to keep this blog from being idle for way too long. As you might know (at least if you checked out the Projects tab) I&#8217;m working on an irclib, so I thought &#8230; <a href="http://blog.chalamius.se/2010/02/random-updates">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So&#8230; I just thought I&#8217;d post some updates to keep this blog from being idle for way too long.</p>
<p>As you might know (at least if you checked out the Projects tab) I&#8217;m working on an irclib, so I thought I&#8217;d give you a bit of a preview on how the actual ircbot looks from the command-line.</p>
<p>Sadly it seems like the coloring and stuff will be Linux only since it requires an extra (3rd-party, not Microsoft) executable for Windows.</p>
<div id="attachment_203" class="wp-caption alignnone" style="width: 310px"><a href="http://static.chalamius.se/wp-content/uploads/2010/02/pirc.png" rel="lightbox[202]"><img class="size-medium wp-image-203 " title="pIRC" src="http://static.chalamius.se/wp-content/uploads/2010/02/pirc-300x169.png" alt="pIRC - A screenshot" width="300" height="169" /></a><p class="wp-caption-text">So, this is how it looks</p></div>
<p><span id="more-202"></span></p>
<blockquote><p>An extensible IRC-bot made in PHP using as few PECL modules as  possible.</p>
<p>The goal of pIRC is to have a fast lightweight bot that&#8217;s  extensible.</p></blockquote>
<p>And this is the current feature set:</p>
<h3>- Event Handler</h3>
<ul>
<li>Supports both arrays and single arguments, if none are given upon registering the function will be passed the standard Message object.</li>
<li>Built-in flood protection</li>
</ul>
<h3>- Modules</h3>
<ul>
<li>All modules can be loaded, unloaded and reloaded during run-time</li>
<li>It checks the syntax before loading to prevent accidental crashing</li>
<li>Probably less leaky than the rename class method that others seems to use</li>
</ul>
<h3>Anyways,</h3>
<p>I did some updates to the QDB to make it a bit faster along with fixing up a new theme for my <a title="#bakabt @ Rizon stats by ChalamiuS" href="http://chalamius.se/stats?chan=bakabt" target="_blank">#bakabt</a> stats.</p>
<p>Sadly not much more to report, except the fact that I have math test on Wednesday so I wont get anything done on anything this week anyway :3</p>
<p>Also, if you have any suggestions to the QDB or similar, feel free, suggestions are always welcome.</p>
<h6>This post is pretty much a post to remind myself to work on this crap when I get the time to &gt;_&gt;<br />
also, todo: Add more stuff to this update post.</h6>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2010/02/random-updates/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>C#: Lambda Expressions</title>
		<link>http://blog.chalamius.se/2010/01/c-lambda-expressions</link>
		<comments>http://blog.chalamius.se/2010/01/c-lambda-expressions#comments</comments>
		<pubDate>Fri, 08 Jan 2010 22:47:05 +0000</pubDate>
		<dc:creator>jisakujien</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=183</guid>
		<description><![CDATA[As a belated follow up to my post on C# Anonymous Methods, let&#8217;s look at a closely related feature of the CLS: lambda expressions.  Then let&#8217;s use a lambda expression to improve the code example from that earlier article. Lambda &#8230; <a href="http://blog.chalamius.se/2010/01/c-lambda-expressions">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://static.chalamius.se/wp-content/uploads/2010/01/LambdaTransparent.png" rel="lightbox[183]"><img class="alignright size-full wp-image-189" title="Lambda" src="http://static.chalamius.se/wp-content/uploads/2010/01/LambdaTransparent.png" alt="" width="168" height="168" /></a>As a belated follow up to my post on <a title="C#: Anonymous Methods" href="http://blog.chalamius.se/jisakujien/c-anonymous-methods" target="_blank">C# Anonymous Methods</a>, let&#8217;s look at a closely related feature of the <a href="http://msdn.microsoft.com/en-us/library/12a7a7h3.aspx">CLS</a>: <a title="Lamda Expressions (C# Programming Guide) - MSDN" href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" target="_blank">lambda expressions</a>.  Then let&#8217;s use a lambda expression to improve the code example from that earlier article.<span id="more-183"></span></p>
<p>Lambda Expressions were introduced in the 3.0 version of the Common Language Specification.  Lambdas are essentially a refinement of anonymous methods.  They allow you to define a block of code which operates on one or more input variables and returns a single result.  Let&#8217;s break down a simple lambda example, from <a title="Lamda Expressions (C# Programming Guide) - MSDN" href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" target="_blank">the MSDN page on Lambda Expressions</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">delegate</span> <span style="color: #6666cc; font-weight: bold;">int</span> del<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    del myDelegate <span style="color: #008000;">=</span> x <span style="color: #008000;">=&gt;</span> x <span style="color: #008000;">*</span> x<span style="color: #008000;">;</span>
    <span style="color: #6666cc; font-weight: bold;">int</span> j <span style="color: #008000;">=</span> myDelegate<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">5</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">//j = 25</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>In this example, a delegate type is defined, <tt>del</tt>.   Then an instance of the delegate is created using a lambda expression.   Finally, the delegate is executed, and the return value is assigned to the integer variable <tt>j</tt>.   Let&#8217;s ignore everything but the lambda expression itself: <tt>x =&gt; x * x</tt>.</p>
<p>The first character of the expression actually defines a variable named <tt>x</tt>, which only exists inside the lambda expression.   In the MSDN example, when the lambda is actually executed, <tt>x</tt> will be assigned the input value of <tt>5</tt>.</p>
<p>The <tt>=&gt;</tt> character sequence tells C# that your lambda expression operates on the variable <tt>x</tt>.   To oversimplify, everything to the left of <tt>=&gt;</tt> is an input variable declaration, and everything on the right is an expression which determines the return value.  In our examples, there will only ever be one input variable.</p>
<p>The <tt>x * x</tt> character sequence is the actual expression, the bit of code that gets executed.   So we could rewrite down the code above to this:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">int</span> x <span style="color: #008000;">=</span> <span style="color: #FF0000;">5</span><span style="color: #008000;">;</span>
<span style="color: #6666cc; font-weight: bold;">int</span> j <span style="color: #008000;">=</span> x <span style="color: #008000;">*</span> x<span style="color: #008000;">;</span></pre></div></div>

<p>&#8230;and achieve the same result.</p>
<h3>Filtering Cars with Lambda Expressions</h3>
<p>Returning to our <a title="C#: Anonymous Methods" href="http://blog.chalamius.se/jisakujien/c-anonymous-methods" target="_blank">anonymous methods example</a>, we found that the <a title="List(T).FindAll Method (System.Collections.Generic) - MSDN" href="http://msdn.microsoft.com/en-us/library/fh1w7y8z.aspx" target="_blank"><tt>FindAll</tt></a> method of the <a title="List(T) Class (System.Collections.Generic) - MSDN" href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" target="_blank"><tt>List&lt;&gt;</tt></a> generic class can take a delegate.  The delegate is used to filter which items in the list are returned.</p>
<h4>With Anonymous Methods</h4>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// Create a list of cars meeting criteria by calling the FindAll()</span>
    <span style="color: #008080; font-style: italic;">// method of the List returned by CreateCars().</span>
    List cars <span style="color: #008000;">=</span> CreateCars<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">FindAll</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">delegate</span><span style="color: #008000;">&#40;</span>Car candidate<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">// Return whether the car matches our criteria.  FindAll()</span>
        <span style="color: #008080; font-style: italic;">// expects our anonymous method to return a boolean, and</span>
        <span style="color: #008080; font-style: italic;">// the compiler makes sure this is the case.</span>
        <span style="color: #0600FF; font-weight: bold;">return</span>
            candidate<span style="color: #008000;">.</span><span style="color: #0000FF;">Manufacturer</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Toyota&quot;</span> <span style="color: #008000;">||</span>
            candidate<span style="color: #008000;">.</span><span style="color: #0000FF;">Manufacturer</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Nissan&quot;</span> <span style="color: #008000;">&amp;&amp;</span>
            candidate<span style="color: #008000;">.</span><span style="color: #0000FF;">Turbocharged</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">foreach</span><span style="color: #008000;">&#40;</span>Car car <span style="color: #0600FF; font-weight: bold;">in</span> cars<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span>car<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Instead, let&#8217;s replace that anonymous method block with a lambda expression.</p>
<h4>With Lambda Expressions</h4>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    List cars <span style="color: #008000;">=</span> CreateCars<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">FindAll</span><span style="color: #008000;">&#40;</span>car <span style="color: #008000;">=&gt;</span>
        car<span style="color: #008000;">.</span><span style="color: #0000FF;">Manufacturer</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Toyota&quot;</span> <span style="color: #008000;">||</span>
        car<span style="color: #008000;">.</span><span style="color: #0000FF;">Manufacturer</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Nissan&quot;</span> <span style="color: #008000;">&amp;&amp;</span>
        car<span style="color: #008000;">.</span><span style="color: #0000FF;">Turbocharged</span> <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">false</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    car<span style="color: #008000;">.</span><span style="color: #0000FF;">Turbocharged</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// Invalid code, &quot;car&quot; does not exist.</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>In this case, our lambda expression creates the variable <tt>car</tt>, and then does the same set of conditional tests as the old example.  Note that the <tt>car</tt> variable only exists in the scope of the lambda expression, just like in the anonymous method.  For that reason, the second to last line of code would be a compiler error.</p>
<h3>So What&#8217;s the Difference?</h3>
<p>For the purposes of our example, not a whole lot:</p>
<ul>
<li>The input variable and return types are <a title="C# Version 3.0 Specification - Implicitly Typed Local Variables - MSDN" href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx" target="_blank"><i>inferred</i></a>.  C# is able to figure out what type <tt>car</tt> is by looking at where the lambda is used.   The type is actually defined in the <tt>CreateCars()</tt> method of our earlier example.  C# looks at the return type of <tt>List&lt;Car&gt;</tt> and <i>infers</i> (or deduces) that a lambda expression operating on the <tt>FindAll</tt> method of that <tt>List&lt;Car&gt;</tt> would operate on a single input variable of type <tt>Car</tt>.  Note that in the old anonymous methods example, C# was only able to infer the return type.</li>
<li>The lambda expression does not need curly braces, since it is a basic expression.</li>
<li>The lambda expression does not use the ugly <tt>delegate()</tt> syntax, thanks to the type inference.</li>
</ul>
<p>Of course lambda expressions are a bit more complicated than I let on; they can declare multiple input variables, and they can also contain normal procedural code statements (such as calling a method &#8212; and that does require using curly braces).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2010/01/c-lambda-expressions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy birthday Southie</title>
		<link>http://blog.chalamius.se/2009/11/happy-birthday</link>
		<comments>http://blog.chalamius.se/2009/11/happy-birthday#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:56:46 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=108</guid>
		<description><![CDATA[So, apparently today is Southrop&#8216;s birthday. Go to his blog and congratulate him, if he posts a post about his birthday that is :3 Now go congratulate him.]]></description>
			<content:encoded><![CDATA[<p>So, apparently today is <a href="http://chaos-th.com">Southrop</a>&#8216;s birthday.</p>
<p>Go to his blog and congratulate him, if he posts a post about his birthday that is :3</p>
<div id="attachment_121" class="wp-caption alignnone" style="width: 310px"><a href="http://static.chalamius.se/wp-content/uploads/2009/11/mokou-n-stuff-touhou1.jpg" rel="lightbox[108]"><img class="size-full wp-image-121  " title="&lt;3" src="http://static.chalamius.se/wp-content/uploads/2009/11/mokou-n-stuff-touhou1.jpg" alt=":3" width="300" height="240" /></a><p class="wp-caption-text">:3</p></div>
<p>Now go congratulate him.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2009/11/happy-birthday/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Double Scarlet</title>
		<link>http://blog.chalamius.se/2009/11/double-scarlet</link>
		<comments>http://blog.chalamius.se/2009/11/double-scarlet#comments</comments>
		<pubDate>Sun, 08 Nov 2009 21:12:16 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Cute]]></category>
		<category><![CDATA[Touhou]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=103</guid>
		<description><![CDATA[;_; iBaww&#8217;d On another note I&#8217;m working a bit on the QDB and on Lolikins, again. You can expect an update on one of them like&#8230; next month or something, blame school for making my projects appear stalled ;_;]]></description>
			<content:encoded><![CDATA[<p>;_; iBaww&#8217;d<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/oMPQWjb0rZo&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed title="Flash" type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/oMPQWjb0rZo&amp;hl=en&amp;fs=1&amp;" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>
<p>On another note I&#8217;m working a bit on the QDB and on Lolikins, again.<br />
You can expect an update on one of them like&#8230; next month or something, blame school for making my projects appear stalled ;_;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2009/11/double-scarlet/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>⑨</title>
		<link>http://blog.chalamius.se/2009/09/%e2%91%a8</link>
		<comments>http://blog.chalamius.se/2009/09/%e2%91%a8#comments</comments>
		<pubDate>Wed, 09 Sep 2009 09:09:09 +0000</pubDate>
		<dc:creator>ChalamiuS</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[⑨]]></category>

		<guid isPermaLink="false">http://blog.chalamius.se/?p=52</guid>
		<description><![CDATA[That is all for now.]]></description>
			<content:encoded><![CDATA[<div id="attachment_65" class="wp-caption alignnone" style="width: 412px"><img class="size-full wp-image-65 " title="Cirno" src="http://static.chalamius.se/wp-content/uploads/2009/09/Cirno.jpg" alt="Cirno is the strongest!" width="402" height="402" /><p class="wp-caption-text">Cirno is the strongest!</p></div>
<p>That is all for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chalamius.se/2009/09/%e2%91%a8/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.174 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 08:28:05 -->
<!-- Compression = gzip -->
