<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Uncategorized on Dr. Random</title><link>https://drrandom.org/tags/uncategorized/</link><description>Recent content in Uncategorized on Dr. Random</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 22 Feb 2009 17:19:09 +0000</lastBuildDate><atom:link href="https://drrandom.org/tags/uncategorized/index.xml" rel="self" type="application/rss+xml"/><item><title>Some (good?) string extension methods</title><link>https://drrandom.org/2009/02/22/some-good-string-extension-methods/</link><pubDate>Sun, 22 Feb 2009 17:19:09 +0000</pubDate><guid>https://drrandom.org/2009/02/22/some-good-string-extension-methods/</guid><description>&lt;p&gt;So, to take a slightly different turn from my usual meta discussions of process, theory, and architecture, there have been several people who have offered up some examples of extension methods that they have found useful, now that .Net 3.5 is roaring along nicely.  There are some collections of such utilities, like the &lt;a href="http://www.codeplex.com/umbrella"&gt;Umbrella project&lt;/a&gt;, and some folks like &lt;a href="http://srtsolutions.com/blogs/billwagner/default.aspx"&gt;Bill Wagner&lt;/a&gt; who have &lt;a href="http://www.amazon.com/More-Effective-Specific-Software-Development/dp/0321485890"&gt;written books&lt;/a&gt; on the subject (okay, there are other things in there too), so I thought I might as well throw my hat into the ring as well.  Specifically, there was this &lt;a href="http://twitter.com/elijahmanor/status/1219521290"&gt;tweet&lt;/a&gt; from &lt;a href="http://twitter.com/elijahmanor"&gt;@elijahmanor&lt;/a&gt; a few days ago.  It points to a positing which includes some extensions on string to convert from strings to value types (int, long, short, etc).  I pointed out that in our current project we have distilled this down to a single extension method: To().&lt;/p&gt;</description></item><item><title>How important is your Code Audience?</title><link>https://drrandom.org/2008/04/08/how-important-is-your-code-audience/</link><pubDate>Tue, 08 Apr 2008 17:30:04 +0000</pubDate><guid>https://drrandom.org/2008/04/08/how-important-is-your-code-audience/</guid><description>&lt;p&gt;We had a friend visiting from out of town last night, and she is apparently fond of &amp;ldquo;Top Chef&amp;rdquo;.  This was the first time I had encountered this particular &amp;ldquo;reality&amp;rdquo; based show, and I found in a lot of ways it was like the majority of the rest of the shows out there; trying hard to create drama where there really isn&amp;rsquo;t any.  In this particular episode there was a challenge to cook food for a neighborhood block party.  The group that did the worst in this particular case cited the fact that they were preparing food for everyone including kids, as a reason for not getting jiggy with the menu (in a culinary sense).  The response from the judges was that good food would speak for itself, and they should have considered it their responsibility to raise the collective bar of quality for the neighborhood.&lt;/p&gt;</description></item><item><title>I'm getting more fluent...and its kinda strange</title><link>https://drrandom.org/2007/09/15/im-getting-more-fluent-and-its-kinda-strange/</link><pubDate>Sat, 15 Sep 2007 15:29:40 +0000</pubDate><guid>https://drrandom.org/2007/09/15/im-getting-more-fluent-and-its-kinda-strange/</guid><description>&lt;p&gt;About two weeks ago I crafted my first Fluent Interface.  Since then I&amp;rsquo;m finding myself seeing more and more places where I think such an approach would be useful.  The part that I&amp;rsquo;m finding odd is that it is something that just recently became a possibility for me.  The big motivating factor behind that I believe was reading the &lt;a href="http://martinfowler.com/bliki/FluentInterface.html"&gt;post&lt;/a&gt; that &lt;a href="http://martinfowler.com/bliki"&gt;Martin Fowler&lt;/a&gt; did on the subject, in which he basically describes it as a super-great idea (okay, I&amp;rsquo;m paraphrasing, but you get the idea).  The concept is fairly simple; write an API that reads like a sentence. &lt;/p&gt;</description></item><item><title>Forcing redirection to HTTPS in ASP.Net</title><link>https://drrandom.org/2007/08/17/forcing-redirection-to-https-in-asp-net/</link><pubDate>Fri, 17 Aug 2007 21:02:01 +0000</pubDate><guid>https://drrandom.org/2007/08/17/forcing-redirection-to-https-in-asp-net/</guid><description>&lt;p&gt;I ran into this issue today when trying to find a quick and dirty script to enforce redirection from HTTP to HTTPS for an intranet site we&amp;rsquo;re enabling for HTTPS (yes, I know SSL on an intranet???  One word - Audit).  I thought this would be easy&amp;hellip;I half expected that there would be an IIS setting to handle this for me; I was wrong on both counts.  So what I ended up doing is using an old DNN HttpModule which was set up to allow the user to specify specific tabs in DNN for SSL, and greatly simplifying things to work to my advantage.  I thought I would post it so I wouldn&amp;rsquo;t have to look for it again.&lt;/p&gt;</description></item><item><title>To TOOP or OOP? How to decide?</title><link>https://drrandom.org/2007/05/29/to-toop-or-oop-how-to-decide/</link><pubDate>Tue, 29 May 2007 21:12:42 +0000</pubDate><guid>https://drrandom.org/2007/05/29/to-toop-or-oop-how-to-decide/</guid><description>&lt;p&gt;Its been a while now, but &lt;a href="http://weblogs.asp.net/rosherove/default.aspx" title="ISerializable"&gt;Roy Osherove&lt;/a&gt; posted &lt;a href="http://weblogs.asp.net/rosherove/archive/2007/02/25/why-you-should-think-about-ootp-object-oriented-testable-programming.aspx" title="TOOP 1"&gt;some&lt;/a&gt; &lt;a href="http://weblogs.asp.net/rosherove/archive/2007/03/02/testable-designs-round-2-tooling-design-smells-and-bad-analogies.aspx" title="TOOP 2"&gt;articles&lt;/a&gt; about Testable Object-Oriented Programming.  That is, designing your code to be testable by default.  The part of this that is most interesting is that he suggests that sometimes you need to sacrifice encapsulation in favor of being able to test your code.  This is where one of the biggest flaws with TDD (at least in my opinion) begins to show.  I think the idea of making code testable breaking encapsulation is one of the only arguments against TDD that I have heard that I can&amp;rsquo;t give a good defense for, and it makes me crazy.&lt;/p&gt;</description></item><item><title>More on Marker Interfaces</title><link>https://drrandom.org/2007/01/16/more-on-marker-interfaces/</link><pubDate>Tue, 16 Jan 2007 17:15:01 +0000</pubDate><guid>https://drrandom.org/2007/01/16/more-on-marker-interfaces/</guid><description>&lt;p&gt;I&amp;rsquo;ve been reading the &amp;ldquo;Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries&amp;rdquo; book recently, and I came across a section discussing interface design, which had direct bearing on one of my earlier posts regarding programmer intent.  They basically state flat out that you should never use marker interfaces in .Net.  Instead, you should favor custom attributes, and then test the type for that attribute.  This was interesting to me, since I have been trying to determine what, if any, value marker interfaces would have in .Net.  In the Java example I cited, one of the benefits was that the JavaDoc information associated with the interface would then be attached to the class, so you would have clear intent from the developer when the interfaces were used.  .Net documentation comments don&amp;rsquo;t carry that same direct association&amp;hellip;granted, when the documentation is generated, most of the time there will be a link to the interface definition..but it&amp;rsquo;s not quite the same.  On the other hand, generally a custom attribute will not even provide that link, so from a doc standpoint there is less information available. &lt;/p&gt;</description></item><item><title>Thread Exception Change in .Net 2.0</title><link>https://drrandom.org/2006/05/31/thread-exception-change-in-net-2-0/</link><pubDate>Wed, 31 May 2006 15:47:26 +0000</pubDate><guid>https://drrandom.org/2006/05/31/thread-exception-change-in-net-2-0/</guid><description>&lt;p&gt;I just learned that Microsoft changed the way unhandled exceptions in Threads are propogated in .Net 2.0 vs the way they worked in 1.1.  With 2.0 any unhandled exceptions in a thread will not only cause that thread to exit, but will also be bubbled up to the thread that started the offending thread.  Overall, I think this is a good thing, since not only will it force people to handle exceptions within their thread code, but it will also eliminate the problem of processes mysteriously stopping if there is an unhandled exception on a thread.  It will, however, cause some serious grief for any developers not expecting that sort of behavior.  I&amp;rsquo;m sure I&amp;rsquo;m not the only one who has seen less than steller multi-threaded programming tactics in applications which should be better behaived (heck, I&amp;rsquo;ve done my share of shoddy thread handling in the past).&lt;/p&gt;</description></item><item><title>Learn something new every....</title><link>https://drrandom.org/2006/05/24/learn-something-new-every/</link><pubDate>Wed, 24 May 2006 16:30:23 +0000</pubDate><guid>https://drrandom.org/2006/05/24/learn-something-new-every/</guid><description>&lt;p&gt;It just goes to show that there are always little surprises waiting around the corner.  I&amp;rsquo;ve been looking at least casually at .Net 2.0 since Beta 2, and I even read through the &amp;ldquo;What&amp;rsquo;s New&amp;rdquo; for C# 2.0 to see if I missed anything.  Somehow I managed not to notice Implicit Delegate Assignment (or at least that&amp;rsquo;s what I&amp;rsquo;m calling it).&lt;/p&gt;
&lt;p&gt;It is now possible to assign a delegate using just the Class and Method name&amp;hellip;you no longer have to create a new instance of the delegate type.  Not a huge thing, I know, but for those of us who are easily impressed it&amp;rsquo;s, well, impressive.&lt;/p&gt;</description></item></channel></rss>