<?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>Aaron Lerch &#187; Uncategorized</title>
	<atom:link href="http://www.aaronlerch.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aaronlerch.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 04 Dec 2011 03:27:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Global Day of Coderetreat in Indianapolis</title>
		<link>http://www.aaronlerch.com/blog/2011/11/10/global-day-of-coderetreat-in-indianapolis/</link>
		<comments>http://www.aaronlerch.com/blog/2011/11/10/global-day-of-coderetreat-in-indianapolis/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 01:52:28 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/?p=251</guid>
		<description><![CDATA[I recently came across this thing called a &#8220;coderetreat&#8221; that Corey Haines puts on. The gist is that it&#8217;s a free full-day event where a small group of dedicated-but-busy software developers can come together and work on honing the skill or art of writing software, away from the usual pressures of business. I thought it sounded [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across this thing called a &#8220;<a title="Coderetreat" href="http://coderetreat.com/" target="_blank">coderetreat</a>&#8221; that <a title="Tweets by Corey" href="https://twitter.com/coreyhaines" target="_blank">Corey Haines</a> puts on. The gist is that it&#8217;s a free full-day event where a small group of dedicated-but-busy software developers can come together and work on honing the skill or art of writing software, away from the usual pressures of business.</p>
<p>I thought it sounded awesome. I have yet to attend a developer event that was comprised primarily of the attendees coding, with the possible exception of some <a title="Codemash - a fantastic conference! I'm going this year, are you?" href="http://codemash.org/" target="_blank">codemash</a> sessions.</p>
<p>Then I saw something about a &#8220;Global Day of Coderetreat&#8221; &#8212; coderetreats organized to occur all around the world on the same day: December 3rd.</p>
<p>And I noticed that Indianapolis was <strong>not</strong> on the list.</p>
<p><em>That simply won&#8217;t do.</em></p>
<p><strong>So I&#8217;m happy to announce that Indianapolis is going to participate in the Global Day of Coderetreat!</strong> My employer <a title="Interactive Intelligence" href="http://www.inin.com/" target="_blank">Interactive Intelligence</a> (I contend it&#8217;s the best place to work in the midwest) has agreed to sponsor the entire event by providing a great space to meet and a <em>free catered lunch! </em>Check out these pics of our <a title="Our offices" href="https://www.facebook.com/media/set/?set=a.10150280912742721.326964.87805467720&amp;type=1" target="_blank">offices</a> and <a title="Interactive Cafe" href="https://www.facebook.com/media/set/?set=a.10150280879662721.326950.87805467720&amp;type=1" target="_blank">in-house cafe</a> on facebook.</p>
<p>You&#8217;re probably asking,</p>
<blockquote><p>&#8220;Okay, so what&#8217;s a coderetreat anyway?&#8221;</p></blockquote>
<p>I&#8217;ll talk about what ours is on December 3rd. I&#8217;ve opened it up to 26 people. (I said it was a small group&#8230;) You can see more information on the structure <a title="Coderetreat agenda" href="http://coderetreat.com/facilitation.html" target="_blank">here</a>, but the gist is that there is some meet &amp; greet time at the start, an intro, then 5 to 6 sessions (with a long lunch in the middle) of dividing up into pairs and tackling a problem (same problem all day). After each session, we <em>delete</em> all our code, switch pairs, and start over again, but working to grow our designs, and explore alternatives and practices like TDD. This is language agnostic, we just try to make sure each pair knows the same language (regardless of proficiency level.) Then there&#8217;s a wrap-up and whoever wants heads out for a beer. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And did I mention it&#8217;s all free?</p>
<p>Sound good to you?</p>
<p>Yes? Me too!</p>
<p>See below for ticket info. I want to point out something first, though. With only 26 slots, I want to avoid it filling up quickly with people who won&#8217;t show up. So I&#8217;m charging $5 to attend. <em>If you attend, you will get a full refund</em>, or you can opt to donate your $5 to the <a title="Interactive Intelligence Foundation" href="http://www.inin.com/foundation/" target="_blank">Interactive Intelligence Foundation</a> &#8211; a great not-for-profit that helps at-risk youth, especially with technology education.</p>
<p><strong>You can get a ticket at <a href="http://coderetreatindy.eventbrite.com/" target="_blank">http://coderetreatindy.eventbrite.com/</a></strong></p>
<p>Any questions? Tweet to me at <a title="Mah tweets." href="http://twitter.com/aaronlerch" target="_blank">@aaronlerch</a> or email me at aaronlerch at gmail</p>
<p>Hope to see you on the 3rd!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2011/11/10/global-day-of-coderetreat-in-indianapolis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How Talentopoly is Built</title>
		<link>http://www.aaronlerch.com/blog/2011/05/31/how-talentopoly-is-built/</link>
		<comments>http://www.aaronlerch.com/blog/2011/05/31/how-talentopoly-is-built/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 02:49:38 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/?p=241</guid>
		<description><![CDATA[Today&#8217;s post is written by my guest and fellow Indianapolis-ite, Jared Brown. I asked Jared to guest post here because he has created an application using Ruby on Rails, Heroku, and a host of other bits and services that I&#8217;ve also been using to bootstrap my new business, beautifulsavings.com which I&#8217;ll post more about in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://talentopoly.com/"><img src="http://www.aaronlerch.com/blog/wp-content/uploads/2011/05/T-Icon-vector.png" alt="Talentopoly" title="Talentopoly" width="200" height="200" class="alignright size-full wp-image-245" /></a>Today&#8217;s post is written by my guest and fellow Indianapolis-ite, <a href="http://twitter.com/jaredbrown">Jared Brown</a>. I asked Jared to guest post here because he has created an application using <a href="http://rubyonrails.org/">Ruby on Rails</a>, <a href="http://www.heroku.com/">Heroku</a>, and a host of other bits and services that I&#8217;ve also been using to bootstrap my new business, <a href="http://beautifulsavings.com/">beautifulsavings.com</a> which I&#8217;ll post more about in the near future. He&#8217;s done a fantastic job with Talentopoly, and he&#8217;s a developer I respect. Talentopoly is on my short-list when it comes to finding useful tidbits to expand my tech horizons. <a href="http://talentopoly.com/users/402">Check out my profile here.</a></p>
<p><em>Jared Brown is the founder of <a href="http://talentopoly.com/">Talentopoly.com</a>, a community for programmers, designers, and IT professionals staying current by sharing the best of what they discover online.</em></p>
<p>I wanted to take a minute to give a glimpse into the platform Talentopoly is built on. A lot of this may not be familiar to non-Rails developers.</p>
<p>The site is hosted on Heroku. I use it for staging as well as production. To say Heroku makes deployment easy would be an understatement. To deploy Talentopoly all it takes is a quick &#8220;git push heroku&#8221; or &#8220;git push heroku-staging&#8221;. To setup your project is also one command.</p>
<p>The production server consists of two dynos (Heroku&#8217;s term for a virtual server unit) for a cost of $36/mo. This setup can handle dozens of concurrent users per minute. The site regularly peaks at 50 users and doesn&#8217;t break a sweat.</p>
<p>Add-ons are Heroku&#8217;s way of making it easier to integrate with other services. Often times no configuration is necessary when turning on an add-on.</p>
<p>My staging server mirrors production. It uses the same add-ons. The WebSolr folks were nice enough to setup a free staging instance. So the staging server is free. I populate staging with production data via Heroku&#8217;s handy PostgreSQL commands.</p>
<p>Heroku uses nginx as the http server acting as a cache store and reverse proxy. nginx is written in C and super fast. Behind nginx are a load-balanced cluster of Thin servers (modified Mongrel servers) running the application stack. Heroku is constantly monitoring the health of the dynes and will spin up new ones to replace hung processes if necessary.</p>
<p>Other than Heroku non of these things are exclusive to Ruby on Rails developers. The following services help make my life easy.</p>
<p>Search is provided by WebSolr and the excellent Solr search engine. Search is configured on a per-model basis. Only a few lines of code are responsible for making the models searchable. It provides geospatial search as well as full text search. Unlike Sphinx Solr doesn&#8217;t rely on fragment indexes. Everything is handled transparently. When new records are added or destroyed the index is updated. WebSolr costs $20/mo. for 75k documents.</p>
<p>The database is a shared PostgreSQL instance on Heroku. It performs well under load. There are other options such as Amazon&#8217;s RDS but for simplicity of deployment I have stuck with Heroku&#8217;s native solution.</p>
<p>SendGrid handles all the outgoing email. It&#8217;s accomplished via a SMTP gateway, which saved time over using their API.</p>
<p>S3 handles user uploaded image assets via the awesome paperclip gem. Paperclip re-sizes and stores the images on S3.</p>
<p>Scribd is used to store and convert uploaded resumes. This is why Talentopoly can accept and properly display so many different file formats.</p>
<p>New Relic is also provided as an add-on. It&#8217;s invaluable for investigating bottlenecks. It provides a breakdown of the request stack tracing it through the database.</p>
<p>Chartbeat provides real-time analytics and alerts. I can see how many concurrent users I have on the site, which is useful if it&#8217;s seeming slow. Google Analytics gives me the full stats to analyze.</p>
<p>I haven&#8217;t had a strong need to implement an in-memory key-value store like Mongo, Memcached, or Redis yet. Though hopefully the increasing traffic on the site makes that a priority soon.</p>
<p>There are other great services, gems, and plug-ins I could talk about but hopefully that gives you a sense for how Talentopoly is built and what it&#8217;s like to build a Ruby on Rails app on Heroku.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2011/05/31/how-talentopoly-is-built/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office Prank</title>
		<link>http://www.aaronlerch.com/blog/2011/04/12/office-prank/</link>
		<comments>http://www.aaronlerch.com/blog/2011/04/12/office-prank/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 21:47:31 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/?p=237</guid>
		<description><![CDATA[Every now and then we like to have some fun with our boss. I&#8217;ve said it before, and I&#8217;ll say it again &#8211; he&#8217;s a fun-loving guy and we all love working together. Usually when you go on vacation for a week you can expect something to happen by the time you get back. Not [...]]]></description>
			<content:encoded><![CDATA[<p>Every <a href="http://www.aaronlerch.com/blog/2006/10/31/office-pranks/">now</a> and <a href="http://www.aaronlerch.com/blog/2008/01/29/office-pranks-part-deux/">then</a> we like to have some fun with our boss. I&#8217;ve said it before, and I&#8217;ll say it again &#8211; he&#8217;s a fun-loving guy and we all love working together. Usually when you go on vacation for a week you can expect something to happen by the time you get back. Not too long ago I returned to find my office completely filled with black plastic. I mean it took 6 large garbage cans and a mini-dumpster, tightly packed, to remove it all.</p>
<p>We recently played yet another prank on my boss. This one probably takes the cake, and it was a ton of fun to pull off. We actually geeked out a bit and we had two hidden cameras, which were automatically recording any motion they saw, as well as live streaming their feeds via ustream.tv. I wrote an app that monitored the filesystem and when it detected a new motion-based recording, it <a href="http://twitter.com/themissingdoor">tweeted</a> a frame of the motion. I just subscribed to mobile notifications and I got an SMS with a link to a JPG file every time it detected movement over the weekend. Pretty easy monitoring system!</p>
<p>Check out the video of the prank. His reaction was priceless!<br />
We love to work hard and have a lot of fun at the same time. If this sounds like the kind of software company you&#8217;d like to work for, <a href="http://inin.jobs/">we&#8217;re hiring</a>! (Nobody asked me to post that, in case you wondered.)</p>
<p><object width="480" height="390"><param name="movie" value="http://www.youtube.com/v/qD8MhnQs588?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/qD8MhnQs588?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="390"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2011/04/12/office-prank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Things You Need to Know About PowerShell at Codemash</title>
		<link>http://www.aaronlerch.com/blog/2010/01/15/10-things-you-need-to-know-about-powershell-at-codemash/</link>
		<comments>http://www.aaronlerch.com/blog/2010/01/15/10-things-you-need-to-know-about-powershell-at-codemash/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 16:41:30 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2010/01/15/10-things-you-need-to-know-about-powershell-at-codemash/</guid>
		<description><![CDATA[Thanks to everybody who came to the PowerShell talk that Matt Hester and I did at Codemash! If you haven’t heard of Codemash or attended it, it’s an extremely well-done conference in Sandusky, Ohio at a huge indoor waterpark. I brought my whole family (including in-laws) along with to enjoy a vacation. The conference itself [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display: inline; margin-left: 0px; margin-right: 0px" align="left" src="http://s3.amazonaws.com:80/aaronlerch.com/images/speaking-at-codemash.png" /></p>
<p>Thanks to everybody who came to the PowerShell talk that <a href="http://blogs.technet.com/matthewms/">Matt Hester</a> and I did at <a href="http://codemash.org/">Codemash</a>! If you haven’t heard of Codemash or attended it, it’s an extremely well-done conference in Sandusky, Ohio at a huge indoor waterpark. I brought my whole family (including in-laws) along with to enjoy a vacation. The conference itself draws in all sorts of smart people with all sorts of backgrounds, and there have been many interesting sessions, open space sessions, and conversations already. It’s worth way more than the price of admission. (WAY more.)</p>
<p>We tried to tailor our talk to people who have only heard of PowerShell, and people who have limited experience with it. And that worked great because I think that described the majority of people there. We got a lot of great questions, and of course we went well over our 1-hour timeslot. There’s so much to talk about! I wish we could’ve gotten into more advanced topics like the type system, etc.</p>
<p>For my part of the talk, I presented a few demos. You can download them and the slides below. Briefly, the demos were the following:</p>
<p><strong>Using PowerShell from within applications.</strong> I extended the <a href="http://familyshow.codeplex.com/">Family.Show</a> example application that Vertigo Software wrote by adding “scripting support” using PowerShell. You can see a screenshot I <a href="http://twitpic.com/xkmwf">posted here</a>. I also wrote a simple WPF application that gets a list of processes running on the computer, only including those who have a handle count less than 200.</p>
<p><strong>Simple Cmdlet.</strong> I wrote a simple Cmdlet as an example. It’s completely non-functional but I included it here for completeness. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Build Scripts with PSake.</strong> I have a simple build script with <a href="http://code.google.com/p/psake/">PSake</a> that doesn’t actually build anything, but shows how to define dependencies, prerequisites, etc.</p>
<p><strong>Windows Troubleshooting Platform + Reference Application.</strong> Not included in the download (because you can get the source as-is from codeplex), I briefly covered the <a href="http://pssymbolstore.codeplex.com/">PSSymbolStore application</a>. It demos using the Windows Troubleshooting Platform, defining more advanced Cmdlets, and building an application on top of PowerShell at the core. You can browse (and/or download) the code <a href="http://pssymbolstore.codeplex.com/sourcecontrol/changeset/view/33254?projectName=PSSymbolStore">here</a>.    <br /><em>As a note</em>, because of the signing requirements of the Windows Troubleshooting Framework, I will leave the code in the application but will remove any UI that invokes the Troubleshooter. It won’t work on any machine but mine unless I have a trusted certificate, which I don’t. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a title="Code and Slides from our PowerShell talk" href="http://s3.amazonaws.com:80/aaronlerch.com/files/CodeMash-2010-Powershell.zip">Download the code and slides from our presentation.</a></p>
<p>See you next year (hopefully)!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2010/01/15/10-things-you-need-to-know-about-powershell-at-codemash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Two Components for your Toolbox</title>
		<link>http://www.aaronlerch.com/blog/2009/09/25/two-components-for-your-toolbox/</link>
		<comments>http://www.aaronlerch.com/blog/2009/09/25/two-components-for-your-toolbox/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 06:36:11 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2009/09/25/two-components-for-your-toolbox/</guid>
		<description><![CDATA[Any desktop application I write from now on will contain these two interfaces. They’re useful enough I thought I should share. Also note, with upcoming improvements in .NET 4.0 (or higher) they might be rendered moot. So far, I don’t think they are, as it’s still difficult to test the code itself that performs asynchronous [...]]]></description>
			<content:encoded><![CDATA[<p>Any desktop application I write from now on will contain these two interfaces. They’re useful enough I thought I should share. Also note, with upcoming improvements in .NET 4.0 (or higher) they might be rendered moot. So far, I don’t think they are, as it’s still difficult to test the code itself that performs asynchronous operations.</p>
<p>First, is an abstraction around the User Interface thread, IUserInterfaceContext. This exists today in the form of <a href="http://msdn.microsoft.com/en-us/library/system.threading.synchronizationcontext.aspx">SynchronizationContext</a>, but I favor this specific interface because</p>
<ol>
<li>It’s more explicit (the SynchronizationContext applies to more than just the main UI thread) whereas this is very clear what its purpose is.</li>
<li>The API is cleaner – passing a “state” is unnecessary with nested closures.</li>
<li>It’s easier to grab out of an IoC container. Because a SynchronizationContext is only specific to the context it was created in (which could be a background thread) it’s not meaningful to put a SynchronizationContext argument in your constructor. Which one do you want?</li>
</ol>
<pre class="brush: csharp;">public interface IUserInterfaceContext
{
    void Execute(Action action);
    void ExecuteAndBlock(Action action);
}</pre>
<p>Now, any component in my application can execute code on the UI thread extremely easily. I just register the implementation of IUserInterfaceContext (which does use a SynchronizationContext) when my application is started, which is on the UI thread.</p>
<p>The implementation could look something like this:</p>
<pre class="brush: csharp;">public class UserInterfaceContext : IUserInterfaceContext
{
    private readonly SynchronizationContext _syncContext;

    public UserInterfaceContext(SynchronizationContext syncContext)
    {</pre>
<pre class="brush: csharp;">        /* Ensure the SynchronizationContext passed in is the main UI thread context */
        _syncContext = syncContext;
    }

    public void ExecuteAndBlock(Action action)
    {
        if (_syncContext != null)
        {
            _syncContext.Send(s =&gt; action(), null);
        }
        else
        {
            action();
        }
    }

    /// &lt;inheritdoc /&gt;
    public void Execute(Action action)
    {
        if (_syncContext != null)
        {
            _syncContext.Post(s =&gt; action(), null);
        }
        else
        {
            ThreadPool.QueueUserWorkItem(s =&gt; action(), null);
        }
    }
}</pre>
<p>Secondly, is a more generalized example of Jeremy Miller’s <a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/02/15/build-your-own-cab-18-the-command-executor.aspx">ICommandExecutor</a>, which is even more generalized as the <a href="http://blog.gurock.com/postings/active-objects-and-futures-a-concurrency-abstraction-implemented-for-c-and-net/290/">Active Object pattern</a>. I named mine “IAsyncExecutor” because it executes any code asynchronously. The advantage with this approach is that it drastically simplifies test activities to be able abstract multithreading (to a point) and allow a test to run single threaded. That is nothing but pure win. We’ve also found that using the interface makes the code read better than using a bunch of BeginInvoke/EndInvoke’s or the ThreadPool, or an async pattern such as &#8220;void FooAsync(AsyncCallback callback, object state);</p>
<pre class="brush: csharp;">public interface IAsyncExecutor
{
    void Execute(Action action);
    void Execute(Action action, Action after, bool callbacksOnUIThread);
    void Execute(Action action, Action after, Action&lt;Exception&gt; error, bool callbacksOnUIThread);
}</pre>
<p>You’ll notice that IAsyncExecutor looks a lot like IUserInterfaceContext, and in fact, it can use it under the covers if the callbacksOnUIThread is true.</p>
<p>Both of these are simple interfaces, with trivial implementations, but you’d be surprised how often I’ve wished I’ve had them in the past. What are some “core” interfaces/services/etc that you <strong>*must have*</strong> in your toolbox?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2009/09/25/two-components-for-your-toolbox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>#3!</title>
		<link>http://www.aaronlerch.com/blog/2009/04/02/3/</link>
		<comments>http://www.aaronlerch.com/blog/2009/04/02/3/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 00:58:58 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2009/04/02/3/</guid>
		<description><![CDATA[No, that’s not a bash command or a regular expression. #3 will be joining #2 and #1, and we are pumped. Well, I’m pumped, my wife is just trying not to feel too sick. She’ll be pumped later, like in 5 years.]]></description>
			<content:encoded><![CDATA[<p>No, that’s not a bash command or a regular expression. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://s3.amazonaws.com:80/aaronlerch.com/images/ultrasound-3.jpg" /></p>
<p>#3 will be joining <a href="http://picasaweb.google.com/aaronlerch/FromHalloweenToThanksgiving#5275445275518695186">#2 and #1</a>, and we are pumped.    <br />Well, I’m pumped, my wife is just trying not to feel too sick. She’ll be pumped later, like in 5 years. <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2009/04/02/3/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Windows Forms Globalization</title>
		<link>http://www.aaronlerch.com/blog/2008/01/08/windows-forms-globalization/</link>
		<comments>http://www.aaronlerch.com/blog/2008/01/08/windows-forms-globalization/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 22:21:00 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[windows forms]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2008/01/08/windows-forms-globalization/</guid>
		<description><![CDATA[It&#8217;s amazing how the process of making an application localizable can be both simple and confusing at the same time. At a basic level, the Visual Studio designer makes it very easy. Set the &#34;Localizable&#34; property on your form to True and you&#8217;re good to go. It&#8217;s very convenient. On the other hand, there are [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s amazing how the process of making an application localizable can be both simple and confusing at the same time. At a basic level, the Visual Studio designer makes it very easy. Set the &quot;Localizable&quot; property on your form to True and you&#8217;re good to go. It&#8217;s very convenient.</p>
<p>On the other hand, there are a lot of challenges like <a href="http://blogs.msdn.com/michkap/archive/2007/01/11/1449754.aspx" mce_href="http://blogs.msdn.com/michkap/archive/2007/01/11/1449754.aspx">poorly named properties</a>, confusing defaults, and possibly unexpected behavior. You really need to understand what&#8217;s going on under the covers.</p>
<p>For instance, if you&#8217;ve looked into .NET <a href="http://blogs.msdn.com/larryosterman/archive/2005/01/26/361015.aspx" mce_href="http://blogs.msdn.com/larryosterman/archive/2005/01/26/361015.aspx">localizability</a> at all, you probably know that by default resources are loaded using the <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx">CultureInfo</a> retrieved from the <a href="http://msdn2.microsoft.com/en-us/library/system.threading.thread.currentuiculture.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.threading.thread.currentuiculture.aspx">System.Threading.Thread.CurrentThread.CurrentUICulture</a> property. That&#8217;s why most <a href="http://msdn2.microsoft.com/en-us/library/b28bx3bh%28VS.71%29.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/b28bx3bh(VS.71).aspx">guidance</a> for manually changing the default application UI language says to set that property to a value of your choice. And well you should &#8211; it&#8217;s the only way to override the default language settings for your Windows Forms.</p>
<p>See, the Windows Forms designer automatically generates all sorts of useful code that you can&#8217;t (and shouldn&#8217;t) touch. Here&#8217;s an example.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="262" alt="image" src="http://aaronlerch.com.s3.amazonaws.com/images/localizing_windows_forms_code.png" width="520" border="0" mce_src="http://aaronlerch.com.s3.amazonaws.com/images/localizing_windows_forms_code.png" /> </p>
<p>Notice the ComponentResourceManager? It&#8217;s a local variable in the InitializeComponent method. The only way to alter it&#8217;s behavior is to alter the current thread&#8217;s UI culture information.</p>
<p>So that&#8217;s great, and even better it&#8217;s easy. When your application starts, you can load culture/language information from whatever persistence mechanism you prefer, and essentially &quot;set it and forget it&quot;, since all Controls should be created on the <a href="http://www.aaronlerch.com/blog/2007/05/19/net-20-winforms-multithreading-and-a-few-long-days/" mce_href="http://www.aaronlerch.com/blog/2007/05/19/net-20-winforms-multithreading-and-a-few-long-days/">same</a> <a href="http://www.aaronlerch.com/blog/2006/12/15/controltrifecta-invokerequired-ishandlecreated-and-isdisposed/" mce_href="http://www.aaronlerch.com/blog/2006/12/15/controltrifecta-invokerequired-ishandlecreated-and-isdisposed/">thread</a>.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="160" alt="image" src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_3.png" width="510" border="0" mce_src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_3.png" /> </p>
<p>But there&#8217;s one problem with this: <b>it only applies to UI elements (Controls).</b></p>
<p>It&#8217;s also common to load objects outside the context of the UI, perhaps with the intention of later presenting them to the user, or persisting to a file, or something else &quot;user visible&quot;. For this, you can add an arbitrary number of resx files that contain images, strings, serialized objects, etc.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="165" alt="image" src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_4.png" width="370" border="0" mce_src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_4.png" /> </p>
<p>With Visual Studio 2005 and higher, these resources are available as strongly-typed properties, giving you compile-time checking and ease of use.</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="40" alt="image" src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_5.png" width="430" border="0" mce_src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_5.png" /> </p>
<p>But here&#8217;s where our problem comes in. Overriding the default UI culture on the main thread applies <i>only to that thread</i>. If you load any resources from a background thread of any kind, they will be the resources for the default windows UI language.</p>
<p>The strongly-typed class (&quot;Resources&quot;, in my example) offers us some relief, however, in the form of a static &quot;Culture&quot; property on the auto generated class. If you never touch the property, resources will be loaded using the current thread value. But if you assign your own value, you can explicitly control which resources are loaded.</p>
<p>Consider this debugging example where I&#8217;m stopped in the execution of a background thread. I&#8217;ve created a global static &quot;Localization&quot; class with a &quot;CurrentCulture&quot; property that I use to maintain the current UI language for my application. You can compare and contrast the values set for the current thread and the auto generated Resource static class, which my application has initialized. (I&#8217;m running the English UI for Windows, by the way.)</p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="106" alt="image" src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_6.png" width="520" border="0" mce_src="http://www.aaronlerch.com/files/blog/Localizingwindowsformsapplications_1D07/image_6.png" /> </p>
<p>So, why am I posting this? Because I myself was unsure about how to correctly accomplish the goal of enabling users to select their own UI language until I noticed the auto generated &quot;Culture&quot; property on the Resources class. And <a href="http://www.aaronlerch.com/blog/2008/01/08/on-blogging/" mce_href="http://www.aaronlerch.com/blog/2008/01/08/on-blogging/">it took me embarrassingly long to find it</a>. Hopefully this post keeps somebody else from wasting an evening, or more.</p>
<p>In summary, it&#8217;s actually simple once you understand all the details. To enable a specific &quot;non-default&quot; language in your application:</p>
<ul>
<li>Set the System.Threading.Thread.CurrentThread.CurrentUICulture property to the appropriate culture, and </li>
<li>Initialize all auto generated resource classes (or any custom uses of the ResourceManager class) to the appropriate culture, before loading any resources.      </li>
</ul>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:fd4651f7-d1cf-405f-ad83-99df1c936466" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Windows%20Forms" rel="tag" mce_href="http://technorati.com/tags/Windows%20Forms">Windows Forms</a>, <a href="http://technorati.com/tags/Localization" rel="tag" mce_href="http://technorati.com/tags/Localization">Localization</a>, <a href="http://technorati.com/tags/Localizable" rel="tag" mce_href="http://technorati.com/tags/Localizable">Localizable</a>, <a href="http://technorati.com/tags/Globalization" rel="tag" mce_href="http://technorati.com/tags/Globalization">Globalization</a>, <a href="http://technorati.com/tags/Internationalization" rel="tag" mce_href<br />
="http://technorati.com/tags/Internationalization">Internationalization</a>, <a href="http://technorati.com/tags/CurrentUICulture" rel="tag" mce_href="http://technorati.com/tags/CurrentUICulture">CurrentUICulture</a>, <a href="http://technorati.com/tags/CultureInfo" rel="tag" mce_href="http://technorati.com/tags/CultureInfo">CultureInfo</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2008/01/08/windows-forms-globalization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Physics Books Next To Things</title>
		<link>http://www.aaronlerch.com/blog/2007/10/25/physics-books-next-to-things/</link>
		<comments>http://www.aaronlerch.com/blog/2007/10/25/physics-books-next-to-things/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 19:41:52 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/10/25/physics-books-next-to-things/</guid>
		<description><![CDATA[This is a guest post brought to you by Physics Books Next to Things. Some Books and Stuff to be Donated]]></description>
			<content:encoded><![CDATA[<p>This is a guest post brought to you by <a href="http://physicsbooksnexttothings.blogspot.com/">Physics Books Next to Things</a>.</p>
<h4>Some Books and Stuff to be Donated</h4>
<h1></h1>
<p><a href="http://www.aaronlerch.com/files/blog/PhysicsBooksNextToThings_DCBC/image.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="409" alt="image" src="http://www.aaronlerch.com/files/blog/PhysicsBooksNextToThings_DCBC/image_thumb.png" width="449" border="0"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/10/25/physics-books-next-to-things/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2005 Debugging Tips</title>
		<link>http://www.aaronlerch.com/blog/2007/09/11/visual-studio-2005-debugging-tips/</link>
		<comments>http://www.aaronlerch.com/blog/2007/09/11/visual-studio-2005-debugging-tips/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 21:34:16 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/09/11/visual-studio-2005-debugging-tips/</guid>
		<description><![CDATA[I was going to post more on some neat tips that John Robbins showed us in a Mastering .NET Debugging class, but when I did some searching to see what was out there I came across Jim Gries&#8217; helpful blog. He&#8217;s posted about pretty much every item I had on my list, so just subscribe [...]]]></description>
			<content:encoded><![CDATA[<p>I was going to post more on some neat tips that <a href="http://www.wintellect.com/cs/blogs/jrobbins/default.aspx">John Robbins</a> showed us in a <a href="http://www.aaronlerch.com/blog/2007/08/31/mastering-net-debugging-with-john-robbins/">Mastering .NET Debugging class</a>, but when I did some searching to see what was out there I came across <a href="http://blogs.msdn.com/jimgries/default.aspx">Jim Gries&#8217; helpful blog</a>. He&#8217;s posted about pretty much every item I had on my list, so just subscribe to his blog and enjoy all the debugging goodness, even if his posts are really far and few between. Better that he&#8217;s busy working on the VS debugging UI instead of blogging all the time! <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/09/11/visual-studio-2005-debugging-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Talented Mr. Edit.GoToFindCombo</title>
		<link>http://www.aaronlerch.com/blog/2007/09/11/the-talented-mr-editgotofindcombo/</link>
		<comments>http://www.aaronlerch.com/blog/2007/09/11/the-talented-mr-editgotofindcombo/#comments</comments>
		<pubDate>Tue, 11 Sep 2007 21:30:43 +0000</pubDate>
		<dc:creator>aaron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.aaronlerch.com/blog/2007/09/11/the-talented-mr-editgotofindcombo/</guid>
		<description><![CDATA[In the movie The Talented Mr. Ripley, Matt Damon plays Tom Ripley, &#8220;a young underachiever&#8221;. Ripley is gifted at improvisation and impersonation, but he takes an obsession too far. Apparently our Visual Studio friend the &#8220;Go To Find Combo&#8221; (weird name, I know&#8211;from this point on I&#8217;m just going to call the dang thing the [...]]]></description>
			<content:encoded><![CDATA[<p>In the movie <a title="The Talented Mr. Ripley" href="http://www.imdb.com/title/tt0134119/">The Talented Mr. Ripley</a>, Matt Damon plays Tom Ripley, &#8220;a young underachiever&#8221;. Ripley is gifted at improvisation and impersonation, but he takes an obsession too far.</p>
<p>Apparently our Visual Studio friend the &#8220;Go To Find Combo&#8221; (weird name, I know&#8211;from this point on I&#8217;m just going to call the dang thing the &#8220;Find&#8221; combo) is like Mr. Ripley&#8211;adaptive, talented, and full of secrets. If you don&#8217;t recognize it by name, the &#8220;Go To Find Combo&#8221; is the &#8220;Find&#8221; combo box in the Standard toolbar. (Shortcut: CTRL+/ or CTRL+D, depending on who you believe.)<br /><a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/VisualStudioGoToFindCombo.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="30" alt="Visual Studio Go To Find Combo" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/VisualStudioGoToFindCombo_thumb.png" width="389" border="0"></a> </p>
<p>In the recent <a href="http://www.aaronlerch.com/blog/2007/08/31/mastering-net-debugging-with-john-robbins/">Mastering .NET Debugging</a> class I took, John Robbins clued us in to some of the crazy stuff this combo can do. I&#8217;m sure under the covers in the key processing code for this dialog there&#8217;s a huge &#8220;if/else if/else&#8221; statement. Just kidding.</p>
<h4>Find</h4>
<p>Okay, this is what we all know it does. Type in a search term, press enter, and it searches within the current document. Or press the &#8220;Find in Files&#8221; button (<img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; vertical-align: middle; border-right-width: 0px" height="22" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image.png" width="22" border="0">) and it will display the Find in Files dialog with your search term pre-populated. It probably does so much more relating to searching, but that&#8217;s primarily how I use it.</p>
<h4>Open A File By Name</h4>
<p>Type the name of a file into the &#8220;Find&#8221; combo, then press CTRL+SHIFT+G (&#8220;Open File&#8221;), it will find and open the file you specified.<br /><a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="55" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_thumb.png" width="225" border="0"></a> <br /><font size="1">(Imagine me pressing CTRL+SHIFT+G in the screen shot above)</font></p>
<h4>Create a New File By Name</h4>
<p>Similar to opening a file, create a new file by typing a file name into the &#8220;Find&#8221; combo and pressing CTRL+N (&#8220;New File&#8221;). A new file with the specified name will be opened, but it&#8217;ll be up to you to save it to the correct place.</p>
<h4>Set Breakpoints Instantly</h4>
<p>Probably the coolest &#8220;hidden feature&#8221;, type the name of a Method into the &#8220;Find&#8221; combo and press F9. Notice that a breakpoint was automatically set on the opening brace of the method! And, if you&#8217;ve got overloads, notice that a breakpoint was set on every overload. For example, let&#8217;s say I have a &#8220;Show&#8221; method that has 3 overloads. Typing &#8220;Show&#8221; and pressing F9 sets these breakpoints:</p>
<p><a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="302" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_thumb_3.png" width="452" border="0"></a> </p>
<p>But check out just how talented Edit.GoToFindCombo really is&#8230; using my example above, I&#8217;m going to type in &#8220;Show(Control)&#8221; and press F9 to set a breakpoint specifically on the <code>Show(Control control)</code> method. What happens?</p>
<p>&nbsp;<a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="302" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_thumb_4.png" width="452" border="0"></a> </p>
<p>It sets a breakpoint on both the Show(IWin32Window) and Show(Control) overloads. Why? Because the Control class implements the IWin32Window interface! So my &#8220;search term&#8221; for the breakpoint matched two possible overloads, and it was smart enough to know that. Great stuff.</p>
<h4>Commands</h4>
<p>Anything you can type into the command window you can also type into the Find combo. Just prefix it with &#8220;&gt;&#8221; and intellisense will guide you. For example, to open a file, type &#8220;&gt;open &#8221; plus the first letter of a file. Or you can execute macros, etc. The sky is the limit!</p>
<p><a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_6.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="243" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_thumb_5.png" width="270" border="0"></a><br /><font size="1">Execute a command window command</font></p>
<p><a href="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_7.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="79" alt="image" src="http://www.aaronlerch.com/files/blog/TheTalentedMr.GoToFindCombo_F0A5/image_thumb_6.png" width="429" border="0"></a>&nbsp;<br /><font size="1">Execute a macro, custom or otherwise</font></p>
<p><strong>Update:</strong> <a href="http://blogs.msdn.com/saraford/archive/2007/09/18/did-you-know-how-to-do-a-ctrl-g-without-the-go-to-line-dialog-box-popping-up.aspx">Sara Ford shows us one more useful feature.</a> Type in a line number and press CTRL+G to jump to the line. Is there no end to the madness?? <img src='http://www.aaronlerch.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.aaronlerch.com/blog/2007/09/11/the-talented-mr-editgotofindcombo/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

