<?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>Selfelected</title>
	<atom:link href="http://www.selfelected.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.selfelected.com</link>
	<description>Experience about programming and architecture.  Musings about delivering and quality.  Findings about projects and people.</description>
	<lastBuildDate>Thu, 10 May 2012 19:38:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Communicate, communicate, communicate &#8211; and the value of updating. now.</title>
		<link>http://www.selfelected.com/communicate-communicate-communicate-and-the-value-of-updating-now/</link>
		<comments>http://www.selfelected.com/communicate-communicate-communicate-and-the-value-of-updating-now/#comments</comments>
		<pubDate>Thu, 10 May 2012 19:30:57 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[CCCommunicate]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1039</guid>
		<description><![CDATA[Update.  Update now.  Cccommunicate news letter is here: https://docs.google.com/document/pub?id=1vv8AYziIMfJxOdffOH-EunwmqbuTyR19B314EniZIfw]]></description>
			<content:encoded><![CDATA[<p>Communicate, communicate, communicate letter <a title="Cccommunicate letter." href="https://docs.google.com/document/pub?id=1vv8AYziIMfJxOdffOH-EunwmqbuTyR19B314EniZIfw">is out</a>.</p>
<p><strong>Update!  Update now!</strong></p>
<p>A new version of an operating system or tool you use is out.  Should you upgrade now, in a few weeks after reading through the forums, when version x.1 is out or wait until the next version with the feature(s) you really need is out?</p>
<p>The immediate answer is Now.  Other answers require an explanation; to not stay current with times requires a reason.</p>
<p>An upgrade of a system might require time, resources and risk.  For simplicity I use the word &#8220;cost&#8221; for these as a group.</p>
<p><strong>Is this cost a problem?</strong></p>
<p>Toy with the idea of updating something as big and complex as an operating system in small small pieces, say once a week, or even better: whenever available.  This is already done today with antivirus and patches.  Even though each and every update risks a cost they are applied all the time.  Besides, if one has business critical 24/7 systems one most probably also has checkpoints, backups and redundancy.<br />
Alas: already today we are updating our systems continously without hesitation and it seems to work splendidly.</p>
<p><strong>The job must be done anyway</strong></p>
<p>As long as a system isn&#8217;t planned to be scrapped it has to be maintained so the update job has to be done anyway.  The cost is there &#8211; it is just a matter of paying the debt now or later.  While the debt isn&#8217;t payed someone else has to pay; either the very person who uses the OS or tool or the whole business unit.  By not upgrading one moves the cost from one place to another while still keeping the cost to be payed at a later time anyway.<br />
If one waits until &#8220;next update&#8221; to do two updates at once one does just that.  Waits.  And then updates twice.  The cost is mainly dependant on the change in functionality &#8211; only partly on manual work.  Two updates directly after each other won&#8217;t decrease the cost; it will instead increase the amount of changes, the risk and the resulting cost even more.<br />
If each update requires a lot of manual work one probably has yet a problem &#8211; the lack of dexterity to do something fast and simple.<br />
Alas: Update now.  You will update anyway in a way or another.</p>
<p><strong>What if the the update doesn&#8217;t contain anything needed?</strong></p>
<p>Do the update anyway.  The situation is now such that any problems that arise is due to the update process only, not the functionality.  A golden opportunity to weed out problems with the update process.  By next update, the one with changed functionality will run smoother and with less cost.<br />
Alas: Update now.  Take the cost now.</p>
<p><strong>Child diseases</strong></p>
<p>Everyone has them.  Both this update and next.  Make sure to get as few as possible.  Alas: update each time.  Now.</p>
<p><strong>Dead time</strong></p>
<p>If one spends a week on forums to find out if others got problems oneself might get, don&#8217;t wait with starting the process of updating.  As soon as the update is available, start working on it.  As soon as the update is verfied, apply it.  Remember: the update has to be done anyway and there is no reason to let the rest of the company pay for a week more with an old system.</p>
<p><strong>Psychology</strong></p>
<p>By choosing to not upgrade one also tells the surrounding that staying current with time isn&#8217;t proper.  As a business leader the signal is that work is done at desk, in chair, 8 hours a day with the tools in front, not with the tools available.  Progress? things others do.  As a IT pro running the computers one tells the users their time and working environment is less worth.  As a developer one is simply smoked.  A developer who doesn&#8217;t embrace change maybe should change line of business &#8211; conservation or royal court comes to mind.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/communicate-communicate-communicate-and-the-value-of-updating-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exception in AspnetMvc with Razor: Parser Error Message: Expected &#8220;}&#8221;.</title>
		<link>http://www.selfelected.com/exception-in-aspnetmvc-with-razor-parser-error-message-expected/</link>
		<comments>http://www.selfelected.com/exception-in-aspnetmvc-with-razor-parser-error-message-expected/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 16:05:00 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[aspnetmvc]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[razor]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1033</guid>
		<description><![CDATA[The below text/error can occur if you have missed one of the } in jquery in a @section features{ section. It can be hard tracking exactly which } is missing because commenting out the javascript code doesn&#8217;t change anything &#8211; it seems the razor engine doesn&#8217;t care about that type of comments.  Instead start the [...]]]></description>
			<content:encoded><![CDATA[<p>The below text/error can occur if you have missed one of the } in jquery in a @section features{ section.</p>
<p>It can be hard tracking exactly which } is missing because commenting out the javascript code doesn&#8217;t change anything &#8211; it seems the razor engine doesn&#8217;t care about that type of comments.  Instead start the @section{} anew and copy-paste the code in again piece by piece.</p>
<p>In my case it was a totally ok javascript for loop:</p>
<p>for (i = 0 ; i &lt; 12 ; i++) { }</p>
<div>Event though it is correct syntax it makes Razor fail.  Seems to be a bug in AspnetMVC/Razor/Dotnet4.5/Visualstudio11.</div>
<div></div>
<div>I am losing karma by not making the bug easy to reproduce and report the bug.</div>
<div></div>
<p><strong>Server Error in &#8216;/myApplication&#8217; Application. </strong></p>
<p>&nbsp;</p>
<p><strong><em>Parser Error</em> </strong></p>
<p><strong>Description: </strong>An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.</p>
<p><strong>Parser Error Message: </strong>Expected &#8220;}&#8221;.</p>
<p><strong>Source Error:</strong></p>
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle">Line 204:        &lt;/p&gt;</p>
<p>Line 205:    &lt;/section&gt;</p>
<p>Line 206:&lt;/section&gt;</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/exception-in-aspnetmvc-with-razor-parser-error-message-expected/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Communicate, communicate, communicate &#8211; and the lack of privacy in Facebook applications</title>
		<link>http://www.selfelected.com/communicate-communicate-communicate-and-the-lack-of-privacy-in-facebook-applications/</link>
		<comments>http://www.selfelected.com/communicate-communicate-communicate-and-the-lack-of-privacy-in-facebook-applications/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 19:49:30 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[CCCommunicate]]></category>
		<category><![CDATA[cccommunicate]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1024</guid>
		<description><![CDATA[Cccommunicate news letter is out. [ When you share personal data with a friend on Facebook you also share it with the Facebook apps your friend uses.  Read that again. That’s right.  When the price is free regard yourself as the product. This news letter is found online here. This news letter is sponsored by [...]]]></description>
			<content:encoded><![CDATA[<p>Cccommunicate news letter is <a title="The Cccommunicate news letter." href="https://docs.google.com/document/pub?id=1oa8JG2Eut3vF7WYv5hYf2J3td-Fd4bAHacbENRIzVu8">out</a>.</p>
<p>[</p>
<p style="padding-left: 30px;">When you share personal data with a friend on Facebook you also share it with the Facebook apps your friend uses.  <a href="http://www.hanselman.com/blog/FacebooksPrivacySettingsAreTooComplexForANYONEToUseChangeTheseSettingsToday.aspx">Read that again.</a><br />
That’s right.  When the price is free regard yourself as the product.</p>
<p>This news letter is found online <a href="https://docs.google.com/document/d/1oa8JG2Eut3vF7WYv5hYf2J3td-Fd4bAHacbENRIzVu8/edit">here</a>.<br />
This news letter is sponsored by <a href="http://www.youtube.com/watch?v=tsnIZ-kZk_s">Pain</a>, <a href="http://www.youtube.com/watch?v=Dxaz1FNEc6o">Jump</a> and <a href="http://www.youtube.com/watch?v=jUiLzTlWZ2o">Imagination</a>.<br />
This news letter doesn’t come with a ridiculously long eula.</p>
<p>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/communicate-communicate-communicate-and-the-lack-of-privacy-in-facebook-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Windows8 through Parallells on Mac/OSX</title>
		<link>http://www.selfelected.com/install-windows8-through-parallells-on-macosx/</link>
		<comments>http://www.selfelected.com/install-windows8-through-parallells-on-macosx/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 20:43:53 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[parallells]]></category>
		<category><![CDATA[windows 8]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1022</guid>
		<description><![CDATA[Installing Windows8 consumer preview on a Max/OSX running Parallells works like a charm.  I even saw a button in Parallells to install Win8; I guess Parallells downloads and installs everything.  I had downloaded the gigs already so I chose to install from ISO. It can also be an advantage to install on a mac since [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Windows8 consumer preview on a Max/OSX running Parallells works like a charm.  I even saw a button in Parallells to install Win8; I guess Parallells downloads and installs everything.  I had downloaded the gigs already so I chose to install from ISO.</p>
<p>It can also be an advantage to install on a mac since the touchpad is fantastic.</p>
<p>Next mission is to install Visualstudio11.</p>
<p><strong>Update:</strong></p>
<p>Visualstudio11 works.</p>
<p><strong>Update:</strong></p>
<p>Multitouch on the Mac mouse <strong>does not work</strong> when you write your own WPF applications as mentioned on <a title="An article on Stackoverflow asking about Mac, multitouch and Win8" href="http://superuser.com/questions/415502/multitouch-wpf-on-windows7-8-on-osx-doesnt-work">Stackoverflow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/install-windows8-through-parallells-on-macosx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Communicate, communicate, communicate &#8211; and feature or a security hole</title>
		<link>http://www.selfelected.com/communicate-communicate-communicate-and-feature-or-a-security-hole/</link>
		<comments>http://www.selfelected.com/communicate-communicate-communicate-and-feature-or-a-security-hole/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 20:46:43 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[cccommunicate]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1018</guid>
		<description><![CDATA[Cccommunicate news letter is out.]]></description>
			<content:encoded><![CDATA[<p>Cccommunicate news letter is <a title="The Cccommunicate news letter." href="https://docs.google.com/document/pub?id=1xLgPbU-y-kygGH6TYKPf7h_du8J3BV9Gh2e8jCoZDBA">out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/communicate-communicate-communicate-and-feature-or-a-security-hole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyboard 1337 &#8211; a better developer keyboard</title>
		<link>http://www.selfelected.com/keyboard-1337-a-better-developer-keyboard/</link>
		<comments>http://www.selfelected.com/keyboard-1337-a-better-developer-keyboard/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 19:50:53 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[Products and releases]]></category>
		<category><![CDATA[keyboard1337]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=1011</guid>
		<description><![CDATA[I have created a better Windows keyboard layout for developers.  It is very similar to the US keyboard but with a few tweaks that makes it nicer to work with.  For a regular US keyboard user the only difference is less pressing of the shift key. Download it here, of course as open source. Longer [...]]]></description>
			<content:encoded><![CDATA[<p><strong>I have created a better Windows keyboard layout for developers.  It is very similar to the US keyboard but with a few tweaks that makes it nicer to work with.</strong>  For a regular US keyboard user the only difference is less pressing of the shift key.</p>
<p><a href="https://plus.google.com/photos/112224237767441591951/albums/5726140302638439521#photos/112224237767441591951/albums/5726140302638439521"><img class="alignnone" title="Keyboard 1337 layout" src="https://lh4.googleusercontent.com/-l9iN3roWnwM/T3dWRFS1HAI/AAAAAAAACjc/iEMn-ARgues/s612/L337+Key.jpg" alt="Keyboard 1337 layout, without any modifier key." width="612" height="265" /></a></p>
<p>Download it <a title="Keyboard1337 project site." href="http://code.google.com/p/keyboard1337/">here</a>, of course as open source.</p>
<p><strong>Longer story:</strong></p>
<p>The US keyboard is a good working start for a better developer keyboard since most languages are created for the US layout.</p>
<p><strong>Symbols often need shift to be pressed.</strong><br />
As developers we often press ( and ) and = and @ and the other symbols at the top row, but to reach them we need to press shift.  That is a total waste.  So I switched them.  With Keyboard 1337 you instead press shift to reach the figures.  Or use the num pad.</p>
<p><strong>Alt-gr-\</strong><br />
Swedish developers have a problem with the keyboard layout.  For instance backslash &#8220;\&#8221; is reached through &#8220;alt-gr&#8221;, a button to the right of the space bar and then 7.  There is no good way to press those two buttons without hand gymnastics.  My solution is to switch to US layout.</p>
<p><strong>ÅÄÖ</strong><br />
I need ÅÄÖ and instead of switching keyboard every time I need one of those letters I put them in their regular place but activated with alt-gr.  A solution that works better than it sounds.</p>
<p><strong>Physics</strong><br />
The physical keyboard layout doesn&#8217;t change due to installing a new keyboard layout so you have to have a bit of fantasy or switch the plastic keys if possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/keyboard-1337-a-better-developer-keyboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying out running Windows on Mac</title>
		<link>http://www.selfelected.com/trying-out-running-windows-on-mac/</link>
		<comments>http://www.selfelected.com/trying-out-running-windows-on-mac/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 21:10:51 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[Products and releases]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=997</guid>
		<description><![CDATA[I have started at a new job and after some days of contemplation and a try-out I decided to go for running Windows as a virtual machine under OSX on an Macbook pro. I had several reasons in no particular order. - The hardware is nice.  The rumour is that Apple don&#8217;t buy cheap stuff [...]]]></description>
			<content:encoded><![CDATA[<p>I have started at a new job and after some days of contemplation and a try-out I decided to go for running Windows as a virtual machine under OSX on an <a title="Apple's page with Macbook pros." href="http://www.apple.com/macbookpro/">Macbook pro</a>.</p>
<p>I had several reasons in no particular order.</p>
<p>- The hardware is nice.  The rumour is that Apple don&#8217;t buy cheap stuff on the spot market.  When you use a Mac it feels nice and I can play with it in the store; ordering a Dell over internet doesn&#8217;t give me the chance to handle it.</p>
<p>- I need to learn other stuff than the Microsoft stack.  If you use a thing for long enough you start to believe the world has to be that way.  I want to get that rust out of my fingers.  I have installed linux several times but without being forced to use it, it has all but collected dust.  Digital dust.</p>
<p>- I want to get started with using virtual machines for developing.  I have tried developing on a Windows virtual machine on a Windows host before but failed; it was too easy to use the host for everything.</p>
<h2>Setup:</h2>
<p>17&#8243; screen, 7200rpm hd, antiglare.  The rest is stock and will be upgraded as time goes.</p>
<p>I intend to use Parallels for running my Win machines virtual.  If the hardware can&#8217;t handle it I should be able to use the same virtual drive through Bootcamp.</p>
<p>I can&#8217;t afford SSD right now even though it was a <a title="Use SSD.  Use SSD. Use SSD." href="http://www.selfelected.com/making-your-ssd-go-faster-and-last-longer/">requirement</a> to start with.  Apple&#8217;s prices are too high so I will buy on the spot market later.</p>
<p>I can&#8217;t afford 8gigs right now and Apple&#8217;s prices are too high so I will buy on the spot market later.  I am running Win8 on 1,5gigs and that is not enough it needs at least 4.  My machine doesn&#8217;t take more than 8 gigs according to the specs so I&#8217;ll probably have problems running more than 1 virtual OS at once.</p>
<h2>For better and worse:</h2>
<p>I have played with the first Mac thousands of years ago, worked with Mac during the 90s and I have played with my SO&#8217;s Macbookpro so I know a little from beforehand.  But playing and working with pre-OSX is not the same as knowing.</p>
<p>The win keyboard is arguably better than the mac one.  It has page up and page down as separate buttons.  Yes it can be remedied by pressing fn at the mac keyboard but that not the same.  The delete button is also missing and corresponding work around is more cumbersome, instead of 3 delete presses for deleting 3 characters one has to press 3 shift-right and then one backspace.  If you are used to fiddling around with the mouse for moving your caret 3 characters to the right this isn&#8217;t a problem for you.  But then you probably have blunt knives in the kitchen anyway.</p>
<p>The OSX keyboard doesn&#8217;t have a properties button but I instead have to use shift-f10 in Windows (which really is what the properties button is a shortcut for).  It.  Is.  Not.  A.  Proper.  Workaround.</p>
<p>The apple touch pad is awesome.  It is awesome enough, on its own, to argue for running Win on a Mac through Bootcamp.  The best touchpad I have tried on Win isn&#8217;t even close to the Mac.  I use 10.7.3 and it has an even more awesome touchpad with up to 4 (5?) fingers recognition for doing stuff.  I gladly confess it isn&#8217;t perfect and sometimes miss my swipes but it won&#8217;t push it from 1st, 2nd and 3rd place.<br />
I recommend turning on all the features on the touchpad.  They features are not turned on out of the box.</p>
<p>On the other hand, keyboard handling and shortcuts in Windows is way better than in OSX.  OSX is created for people with three hands, two on the keyboard and one on the mouse.  If you think using the mouse for moving around in your application is state of the art you probably have blunt knives in the kitchen too.</p>
<p>Give me the Mac touchpad and the Windows keyboard handling and we have nerdvana.  Wait&#8230; that is what I am sitting with right now!</p>
<p>Appstore is a must.  But why does it want to know so much about me?  On my Android phone I can download anything free without giving away my credit card number.<br />
Through my bank I can create virtual credit cards with a limited amount of money on.  It works on Appstore.</p>
<p>OSX doesn&#8217;t have as many good gratis text editors as Windows has.</p>
<p>The installation of OSX is smooth.  Start the machine, do your choices and you are good to go.  Windows, on the contrary, requires a day and a half for reboots and checks for updates.  Add another day if you want Visual studio and Sqlserver.</p>
<p>OSX doesn&#8217;t run the full fledged dotnet framework but Mono.  Dotnet is a good framework so it is a shame.<br />
I use Keepass on Mono in OSX.  To make a long story short it fails in several ways.  The most noticeable is that the good copy-password functionality in Keepass doesn&#8217;t work.  Add mismatched highlighted text, crashes and that it sometimes refuses to start.  It might be a bad port of Keepass, it might be shortcomings in Mono.  If you give me time I will investigate but as for now I am short of spare time.</p>
<p>OSX has a proper *nix/BSD terminal.  Windows still has its console and Console2.  Windows also has Powershell which is *nix terminal piping made right.  Like so: in *nix one can do lots of automation from the terminal through piping and griping.  A big drawback is that what is piped is the text output and not the contents.  Powershell can also pipe data between apps but uses real dotnet objects instead.  Ponder this for a while and realise what a leap that is in functionality and updatability.</p>
<p>One of the reasons for choosing to use both OSX and Windows is to not fall into the belief that everything should look like Windows.  The start menu is one of them.  I have always thought the start menu was a good idea, especially after Vista when one could start entering text directly and let Windows find the application or document for you; much like Spotlight in OSX.  Now I have seen OSX&#8217;s 5 finger pinch which gives me all apps as icons over the whole screen. (think iPhone)  It has the same drawback as the Iphone app chooser &#8211; there are lots of icons but no system to separate them for making them easier to find.</p>
<p>Minimising and maximizing works better in Windows than in OSX.  There are system wide short cuts and visual clues (menus that pop up).  OSX can minimize a window but one needs the mouse to open it again.  Sometimes.<br />
Which brings me to Safari which has recently passed IE as the least good web browser.  Example: if you detach a tab you cannot attach it again.  Unless you choose to mouse to the menu window-merge all windows.  When every tab in every Safari window is put into the same window.  I am not saying all other browser behave differently but right now I am irritated on Safari so it has to wear my flames.<br />
I am not irritated on Evernote but it is equally mousey.  If one hides a window of Evernote one has to use the mouse to get it back.</p>
<p>The TextEdit editor in OSX is better than Notepad in Windows.  On the other hand Notepad is (easily) replaced with other good and gratis editors.  Good and gratis editors in OSX are not as plenty.</p>
<p>I miss the light telling me the HD is working.  When the machines doesn&#8217;t respond for  a few seconds it is a good clue to what is going on &#8211; is it the HD or the code that is the culprit?</p>
<p>My OSX version has switched up and down while scrolling.  I say the OSX direction is the correct one.<br />
Here is why: when I programmed scroll bars back in last century I learned that there is no correct way regarding what is up and down.   The document goes down when the scroll bar goes up when the earlier/above text is shown when the up arrow is pressed.  Now we have learned to use fingers for moving documents around and now there is only one way to look at it; the correct way.<br />
You, dear reader, might disagree, but I suggest you embrace change, <a title="Wikipedia entry of Don Quixote and his fight against the wind mills." href="http://en.wikipedia.org/wiki/Don_Quixote">mr Quixote</a>.</p>
<h2>Notes:</h2>
<p>Parallels has its own Swedish keyboard.  I don&#8217;t know the difference between that and the regular OSX one.</p>
<p>Windows ctrl-alt-del is in Parallels fn-ctrl-alt-backspace.</p>
<p>I have yet to figure out where backslash is on my Swedish OSX, Swedish Win and English Win keyboards.  I am not sure Parallels work properly there.</p>
<p>Folders in Finder is opened through command-o.  Enter does something else.  I won&#8217;t say it is 100% bad but I believe the Windows choice of making Enter open the folder is better.</p>
<p>I really miss having standardised command-o for opening, -w for closing a window, -h for hiding a window, and command-comma for settings in Windows.  Alt-f4 and ctrl-f4 are steady standards in Windows but the combinations were probably invented by a <a title="Picture of a weird hand." href="http://www.delawareonline.com/blogs/uploaded_images/hands-782531.jpg">chiropractor gone mad</a>. Ctrl-o is standard and alt-enter almost so.  OSX could learn something from Win what happens when a window is hidden, opening a hidden window on OSX changes from app to app and often requires the mouse.</p>
<p>Switching tab in windows is ctrl-tab and command-left/right in OSX.  Unless where it is ctrl-tab.  The gratis editor Textwrangler has its own scheme where switching document isn&#8217;t visualised as a table and requires the mouse.  Which made med ditch Textwrangler since a text editor is keyboard centric and shouldn&#8217;t force me to stretch of for the mouse or move my fingers to the touch pad.</p>
<p>Ctrl-left/right is used in Windows for selecting a word.  In OSX it is used for switching desktop.  I had to turn that functionality off in OSX.  I now have to do a 4 finger swipe to change desktop.  I see no immediate other solution.</p>
<p>When I get in to heavy programming in Windows on this machine I will bring forward my Windows keyboard.  I wonder how my muscular memory will react when it is subjected to the OSX layout.  I plan to update this article.  Let&#8217;s see if I remember.</p>
<p>Pressing the function buttons in OSX requires the fn key.  In Windows it does not.  Thankfully there is a setting in OSX System preferences to turn this off.  Recommended if you run Windows under OSX.</p>
<p>Zooming in OSX is done through ctrl-scroll up/down (two finger swipe) much like in Visual studio.  Windows has a similar functionality I can&#8217;t recall the name of and shortcut for.  I have a feeling the Windows variant works better.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/trying-out-running-windows-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Communicate, communicate, communicate &#8211; and what to do if you&#8217;re stuck</title>
		<link>http://www.selfelected.com/communicate-communicate-communicate-and-what-to-do-if-youre-stuck/</link>
		<comments>http://www.selfelected.com/communicate-communicate-communicate-and-what-to-do-if-youre-stuck/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 10:51:47 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[CCCommunicate]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=994</guid>
		<description><![CDATA[The news letter is out here https://docs.google.com/document/pub?id=1y8vmb5DNUpMziJh4ifcFzRBQFv8cl1bbStuSheB4Tx0]]></description>
			<content:encoded><![CDATA[<p>Cccommunicate news letter is <a title="The news letter." href="https://docs.google.com/document/pub?id=1y8vmb5DNUpMziJh4ifcFzRBQFv8cl1bbStuSheB4Tx0">out</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/communicate-communicate-communicate-and-what-to-do-if-youre-stuck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of list and collection classes in dotnet</title>
		<link>http://www.selfelected.com/list-of-list-and-collection-classes-in-dotnet-11-45/</link>
		<comments>http://www.selfelected.com/list-of-list-and-collection-classes-in-dotnet-11-45/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 19:54:17 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=984</guid>
		<description><![CDATA[List of list and collection classes in dotnet.  And some explanations and reasoning.]]></description>
			<content:encoded><![CDATA[<p><strong>Which List/Collection to use and where?</strong></p>
<p><strong>What do I choose and what do I have to choose from?</strong></p>
<p>I have found no comprehensive, and good, list so here is a stab at it. Much of it thanks to <a title="Gary Short at Öredev cast." href="http://vimeo.com/37936474">Gary Short</a> (he seems to lack home page so I can&#8217;t tribute him correctly)</p>
<h1>List&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx">http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx</a><br />
Dotnet 2-4.5</p>
<p>( This chapter has the most information and explanations that won&#8217;t be repeated in for the lesser used lists. )</p>
<p>This is the one we &#8220;normally&#8221; use. If you use it as return you should use IList&lt;T&gt; instead as interfaces gives you more decoupling.</p>
<p>Good: Simple to use. No brainer, especially for short lists. Usable with lambda.<br />
Bad: Adding can be expensive. Removing even more so. (I haven&#8217;t checked Insert but it should be expensive too.)<br />
There are some caveats with List&lt;T&gt; though.</p>
<h2>method: Add(&#8230;)</h2>
<p>One is that it allocates space in chunks that increas as the list grows bigger. By your first myList.Add(&#8230;) dotnet allocates 4 items. When you add a fifth element it doubles the allocation so 4 new are allocated. Now 8 items are allocated, 5 used and 3 wasted. When you add your 9th, 8 new are allocated.</p>
<p>Like this.<br />
4, 8, 16, 32, 64, &#8230; you get the idea of doubling.</p>
<p>Now note that the doubling not only is a waste in space but also ticks. Every time the list is extended a call to Array.Copy(&#8230;) is made and memory copying is expensive. I haven&#8217;t any good figures but check the Gary Short&#8217;s cast linked in this article and wind to 15:30.</p>
<p>When one allocates directly in the constructor like this:</p>
<pre>var myList = new List&lt;int&gt;(){1,2,3,4,5};</pre>
<p>nothing really changes. Behind the scenes 5 myList.Add(&#8230;) are called and you still have 8 items allocated.</p>
<p>A way to mitigate this is to tell the compiler how big list you want:</p>
<pre>var myList = new List&lt;int&gt;(5);</pre>
<p>Now you get 5 items, allocated once. On the other hand it also changes the allocation scheme to multiples of 5</p>
<p>5, 10, 15, 20, &#8230;</p>
<p>which might be exactly what you wanted or not.</p>
<p>The way to do this at constructor time is:</p>
<pre>var myList = new List&lt;int&gt;(5){1,2,3,4,5};</pre>
<p>If you know you are adding a lot of items avoid looping and instead use .AddRange like this:</p>
<pre>myList.AddRange( new int[]{6,7,8,9} );</pre>
<h2>methods: Remove(&#8230;) and RemoveAt(&#8230;)</h2>
<p>Remove does a linear search for your object. Performance is O(n). RemoveAt just goes to the index and removes the item which gives us O(1). Unless you have veeery long lists both methods are considered fast. But. Remember that Remove(&#8230;) does a comparision which comes in three flavours IEquatable&lt;T&gt;, Equals and bitwise. Wind to 18:00 in the linked cast.</p>
<h2>method: Sort</h2>
<p>Sorting is done with Quicksort. Unless you have special cases like an almost ordered list or &#8211; even worse &#8211; an ordered list, this is a fast sorting algorithm. Performance is O(n log n) in best case and O( n^2) in worst case.</p>
<p>If you have an ordered list, which we often have, you could get some benefit of randomising the list first. Or the obvious: check if the list is ordered before sorting it. Or use another list or collection; which this article is about&#8230;</p>
<h1>LinkedList&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx">http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx</a><br />
Dotnet 2-4.5</p>
<p>This is a double linked list.</p>
<p>Good: Fast for Add, Remove and Insert.<br />
Bad: Searching is slower.</p>
<p>Since Add, Remove and Insert only manipulates the item at hand and the items just before and after the performance is O(1).</p>
<p>Searching and going to a certain index means traversing the list and hence performance is O(n).</p>
<h1>Dictionary&lt;TKey, TValue&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/xfhwa508.aspx">http://msdn.microsoft.com/en-us/library/xfhwa508.aspx</a><br />
Dotnet 2-4.5</p>
<p>Good: Fast for searching. Implementing your own key type can be a problem.<br />
Bad: Only one key.</p>
<p>The dictionary is a key-value store. This is considered fast since the comparision between two items depend on a key and not on the whole item.<br />
Here the caveat is on the comparision on the key. The comparision is dependant on the hash key which, if expensive, makes this list less performant.</p>
<p>A simple key like a string (not too long) or a number is fast when the key is evenly distributed. What this means is that lots of keys around 100 and a few around 10000 makes worse performance than if the keys are spread 100, 200, 300, 400 etc. Not a tool good example of me and that is why web searching is your friend.</p>
<p>Caveat: if you have an object as the key comparision is done through IEquatable.Equals or by overriding Equals and when you do (which you should do once in a while just for the fun of it) you have to override GetHashCode too. And following this you must now grokk both hashing of an object and the hashing theories. Personal recommendation: don&#8217;t write the code in a few minutes just because you can; invest a couple of hours in it. It will pay off in the long run.<br />
Also note that hashes are only theoretically unique. This means you can get two hits for the same hash.</p>
<p>Hmm: I haven&#8217;t tried implementing IEquatable.Equals and don&#8217;t know how that affects GetHashCode. Someone?</p>
<h1>Lookup&lt;TKey, TValue&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/bb460184.aspx">http://msdn.microsoft.com/en-us/library/bb460184.aspx</a><br />
Dotnet 3.5-4.5</p>
<p>Good: has several items for each key. Fast searching through the key.<br />
Bad: has several items for each key.</p>
<p>This is a Dictionary&lt;TKey,TValue&gt; variant with the addition that it can take several items for the same key. For a reason unkown to man the interface is totally different though; it uses an extension method ToLookup which takes a lambda as parameter. I guess there is some good rationale behind this since it the gu&lt;&lt;ys behind this are smart.</p>
<h1>SortedList&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/ms132319.aspx">http://msdn.microsoft.com/en-us/library/ms132319.aspx</a><br />
Dotnet 2-4.5<br />
There is a generic SortedList too.</p>
<p>Good: Sorted. Fast retrieval [O( log n )].</p>
<p>Uses less memory than SortedDictionary&lt;T&gt;.<br />
If you add lots of data at once, use SortedList&lt;T&gt; instead of SortedSet&lt;T&gt; or SortedDictionary&lt;T&gt;.</p>
<h1>SortedSet&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd412070.aspx">http://msdn.microsoft.com/en-us/library/dd412070.aspx</a><br />
Dotnet 4-4.5</p>
<p>Good: Sorted. Fast retrieval [O( log n )].<br />
See more at <a title="More info on SortedSet." href="http://msdn.microsoft.com/en-us/vstudio/ee906600">http://msdn.microsoft.com/en-us/vstudio/ee906600</a></p>
<h1>SortedDictionary&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/f7fta44c.aspx">http://msdn.microsoft.com/en-us/library/f7fta44c.aspx</a><br />
Dotnet 2-4.5<br />
There is a generic version too.</p>
<p>Good: Sorted. Fast retrieval [O( log n )]. Faster insert and remove than SortedList&lt;T&gt;.</p>
<h1>ConcurrentBag&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd381779.aspx">http://msdn.microsoft.com/en-us/library/dd381779.aspx</a><br />
Dotnet4-4.5</p>
<p>Used for concurrency. They don&#8217;t solve the problem of concurrency conflicts but mitigates them. Every fetch of add should be tried. The add method is called TryAdd and return true/false depending on if you succeeded or not; the same with TryTake. Yes, this means an if(&#8230;) for every such call and corresponding handling. That is one of the reasons concurrency is hard. And fun.</p>
<p>Check out int.TryParse for an easier-to-test method with the same functionality.</p>
<h1>ConcurrentDictionary&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd381779.aspx">http://msdn.microsoft.com/en-us/library/dd381779.aspx</a><br />
Dotnet 4-4.5</p>
<p>Used for concurrency. They don&#8217;t solve the problem of concurrency conflicts but mitigates them. Every fetch of add should be tried. The add method is called TryAdd and return true/false depending on if you succeeded or not. Yes, this means an if(&#8230;) for every such call and corresponding handling. That is one of the reasons concurrency is hard. And fun.</p>
<h1>ConcurrentQueue&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd267265.aspx">http://msdn.microsoft.com/en-us/library/dd267265.aspx</a><br />
Dotnet 4-4.5</p>
<p>See ConcurrentDictionary.</p>
<h1>ConcurrentStack&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd267331.aspx">http://msdn.microsoft.com/en-us/library/dd267331.aspx</a><br />
Dotnet 4-4.5</p>
<p>See ConcurrentDictionary.</p>
<h1>OrderablePartioner&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd394988.aspx">http://msdn.microsoft.com/en-us/library/dd394988.aspx</a><br />
Dotnet 4-4.5</p>
<p>See ConcurrentDictionary.</p>
<p>Represents a particular manner of splitting an orderable data source into multiple partitions. Not only does it work particular but is also is named totally different. I predict this list will almost never be used since noone finds it.</p>
<h1>BlockingCollection&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/dd267312.aspx">http://msdn.microsoft.com/en-us/library/dd267312.aspx</a><br />
Dotnet 4-4.5</p>
<p>See ConcurrentDictionary.</p>
<p>Now this collection is slightly different regarding add/remove since it can block and give you true safety. But also deadlocks. If you don&#8217;t know what a deadlock is an are alone on studying this just go and ask a SQL guy for transactions and deadlocks and he&#8217;ll have about the same problem and answers. If you understand what s/he says you&#8217;ll understand BlockingCollection.Add too.</p>
<p>One can set a timeout. Ask the SQL guy if you wonder what that sentence meant.</p>
<h1>ObservableCollection&lt;T&gt;</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/ms668604.aspx">http://msdn.microsoft.com/en-us/library/ms668604.aspx</a><br />
Dotnet 3-4.5</p>
<p>Used typically for MVVM in WPF or Silverlight.</p>
<p>Good: can tell others about its state changes.</p>
<p>If you have a collection and want to watch over it to see if it changes &#8211; then this collection is for you. Start a WPF project if you want to play around and test it.</p>
<p>Due to a reason known to only a few this collection is defined in the WindowsBase assembly.</p>
<p>Uses List&lt;T&gt; internally so anything that applies to List&lt;T&gt; applies to ObservableCollection too.</p>
<h1>ListDictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.listdictionary.aspx">http://msdn.microsoft.com/en-us/library/system.collections.specialized.listdictionary.aspx</a><br />
Dotnet 1.1-4.5</p>
<p>A Dictionary implementing IDictionary as a key-value pair linked list. Check Dictionary for what that means.</p>
<p>This list is suitable for lists with fewer than 10 items and even though you probably can retrieve the items in the same order every time, don&#8217;t depend on it since Microsoft has specified that the order might change.</p>
<p>It is generic which means type casting is up to you.</p>
<h1>OrderedDictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary.aspx">http://msdn.microsoft.com/en-us/library/system.collections.specialized.ordereddictionary.aspx</a><br />
Dotnet 2-4.5</p>
<p>Uses key-value pairs and have them ordered. Duh.</p>
<p>It is generic which means type casting is up to you.</p>
<h1>HybridDictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.hybriddictionary.aspx">http://msdn.microsoft.com/en-us/library/system.collections.specialized.hybriddictionary.aspx</a><br />
Dotnet 1.1-4.5</p>
<p>Changes to a ListDictionary if the items are few and a Hashtable if they are many. &#8220;Few&#8221; and &#8220;many&#8221; has a breakpoint around 10.</p>
<p>One can change if comparision is case sensitive or not.</p>
<p>The key cannot be null.</p>
<h1>StringCollection</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringcollection.aspx">http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringcollection.asp</a>x<br />
Dotnet 1.1-4.5</p>
<p>Optimised for string lists.</p>
<p>One can store null, allows duplicates, case sensitive comparision; just the same as List&lt;string&gt; but supposedly faster. If someone had some performance figures or reverse engineered code we might know.</p>
<h1>StringDictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringdictionary.aspx">http://msdn.microsoft.com/en-us/library/system.collections.specialized.stringdictionary.aspx</a><br />
Dotnet 1.1-4.5</p>
<p>Implemented as hash table. Case insensitive comparision. I haven&#8217;t checked but I suppose it does ToLower or ToUpper on the keys before storing them. At least that is what I should have done.</p>
<p>StringDictionary is generic and I suppose it exists solely because generics didn&#8217;t exist in Dotnet 1.1 and instead of everyone writing their own StringDictionary with their own casts Microsoft built it for everyone (and for themselves of course).</p>
<h1>SortedList</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/system.collections.sortedlist.aspx">http://msdn.microsoft.com/en-us/library/system.collections.sortedlist.aspx</a><br />
Dotnet 1.1-4.5</p>
<p>Generic list. Do your own type casting.</p>
<h1>SortedDictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/f7fta44c(v=vs.80).aspx">http://msdn.microsoft.com/en-us/library/f7fta44c(v=vs.80).aspx</a><br />
Dotnet 2-4.5</p>
<p>Generic version. Do your own type casting. And debug your own bugs.</p>
<h1>Dictionary</h1>
<p><a title="MSDN reference." href="http://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.80).aspx">http://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.80).aspx</a><br />
Dotnet 2-4.5</p>
<p>Is this really correct? Didn&#8217;t we have Dictionary in dotnet 1 and 1.1? I vividly remember writing my own version (see StringDictionary) for every type I had.<br />
Which brings me to that it isn&#8217;t very difficult inheriting from Dictionary and overriding the right methods. There is (at list was back in last century) cookbooks for this on the web. Today I just use List&lt;T&gt; and am happy with it.</p>
<h1>IList&lt;T&gt;</h1>
<p>IList is the interface behind List&lt;T&gt;. Use it when you can.<br />
Especially when returning a List, return IList instead to get more decoupling.  Especially especially when writing a framework.</p>
<p><a title="More info on IList vs List at stackoverflow." href="http://stackoverflow.com/questions/400135/c-sharp-listt-or-ilistt">http://stackoverflow.com/questions/400135/c-sharp-listt-or-ilistt</a></p>
<h1>Performance tips</h1>
<p>These tips come from Gary Short unless noted.</p>
<p>Boxing/unboxing takes time so if you have value types (int, char etc) (not string that even though it behaves like a value type isn&#8217;t one) use generic collections instead.<br />
<em>My comment</em>: casting can fail runtime but un/boxing through, say, List&lt;T&gt; never does so 99 of 100 times I prefer the performance penalty. I also have no figures on the costs. Someone?</p>
<p>All lists, except LinkedList has O(1) for adding an item unless it results in growing when we get O(n). LinkedList never grows in chunks and always have O(1). Se more about growing under List&lt;T&gt;.</p>
<p>List&lt;T&gt; sorts slower when the list is almost sorted and slowest when it is already sorted. This is not schtoopidity but a drawback of the quicksort algorithm.</p>
<p>SortedList&lt;T&gt; uses less memory than SortedDictionary&lt;T&gt; but the latter has faster add/remove.</p>
<h1>Also</h1>
<p>The cast of Gary Short at Öredev is found <a title="Gary Short at Öredev." href="http://oredev.org/2011/sessions/-net-collections-deep-dive">here</a>.<br />
More info on collections is found <a title="More info on collections." href="http://www.ikriv.com/en/prog/info/dotnet/DotNetCollections.html">here</a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/list-of-list-and-collection-classes-in-dotnet-11-45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Function within a method in C# / csharp / dotnet</title>
		<link>http://www.selfelected.com/function-within-a-method-in-c-csharp-dotnet/</link>
		<comments>http://www.selfelected.com/function-within-a-method-in-c-csharp-dotnet/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 19:49:17 +0000</pubDate>
		<dc:creator>selfelected</dc:creator>
				<category><![CDATA[Code and Development]]></category>
		<category><![CDATA[dothet]]></category>
		<category><![CDATA[lamdba]]></category>

		<guid isPermaLink="false">http://www.selfelected.com/?p=949</guid>
		<description><![CDATA[Function within a method in C# / csharp / dotnet can be accomplished with a lambda.]]></description>
			<content:encoded><![CDATA[<p>I have since the birth of dotnet missed the possibility to have a function inside a function like one can in Pascal.</p>
<p>With lambda, and possibly Dotnet4(?) it is possible.  Below is a rather stupid example.  I haven&#8217;t  got it to work with a function that doesn&#8217;t return anything.  Anyone?</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">internal int AddMax( int x, int y )<br />
{<br />
&nbsp; &nbsp; Func&lt;int , int&gt; Max = delegate( int a ){<br />
&nbsp; &nbsp; &nbsp; &nbsp; return Math.Min( a, 10 );<br />
&nbsp; &nbsp; };<br />
<br />
&nbsp; &nbsp; return Max(x) + Max(y);<br />
}<br />
&lt;/int&gt;</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.selfelected.com/function-within-a-method-in-c-csharp-dotnet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

