<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7373856298610071567</id><updated>2011-04-22T03:08:40.549+02:00</updated><category term='Hints and Tips'/><category term='Code'/><category term='Reminder'/><category term='General'/><category term='Tools'/><category term='WTF??'/><category term='Stupid ideas'/><category term='Humour'/><category term='Gotcha'/><category term='Probably best avoided if you are in a hurry'/><category term='Tales of a code monkey'/><category term='Completely pointless'/><category term='Things that irritate me'/><title type='text'>Object not set</title><subtitle type='html'>... to an instance of an object.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-2485443602423123688</id><published>2008-04-24T18:20:00.001+02:00</published><updated>2009-04-23T12:07:08.260+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Enter: the Clone control...</title><content type='html'>&lt;p&gt;I haven't posted in a while, so I thought I would post a little bit of ASP.NET goodness that I whipped up too, very quickly, fill a gap. &lt;/p&gt;  &lt;p&gt;If you have ever needed to duplicate a control on your page &lt;strong&gt;completely&lt;/strong&gt; (behaviour, look &amp;amp; feel), but just alter the position then I think this could help. I think its wonderful in its simplicity, but then I would. I wrote it. :D&lt;/p&gt;  &lt;p&gt;A little bit of background: I needed to have the same button at the top and the bottom of a &lt;a title="GridView Class" href="http://msdn2.microsoft.com/4w7ya1ts.aspx"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a title="GridView Class" href="http://msdn2.microsoft.com/4w7ya1ts.aspx"&gt;GridView&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; control - it made sense from a usability point of view. I wasn’t happy with creating a &lt;font face="Courier New"&gt;UserControl&lt;/font&gt; or to copy/paste a duplicate wired up the same way, so I whipped this baby up. This clone control has some basic design-time support. The property page of the control will display a list of controls already placed on your page, will allow you to select one of them. This will be the control that will be duplicated. Pretty basic stuff (take a look and modify the &lt;span class="code"&gt;FilterControl &lt;/span&gt;method of the &lt;span class="code"&gt;CloneControlConverter &lt;/span&gt;if it doesn't meet your needs).&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DISCLAIMER&lt;/strong&gt;: Consider this code as &lt;em&gt;Alpha&lt;/em&gt; quality. I am sure there will be issues with the more complex controls (just for giggles I tried it out on a &lt;a title="GridView Class" href="http://msdn2.microsoft.com/4w7ya1ts.aspx"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a title="GridView Class" href="http://msdn2.microsoft.com/4w7ya1ts.aspx"&gt;GridView&lt;/a&gt;&amp;#160;&lt;/a&gt;&lt;/a&gt;and it seemed to work :P ). But it’s completely up to you to determine if its production ready. If nothing else it may help point you in the right direction. So with no further ado… drum roll please... say hello to my leeedle friend!&lt;/p&gt;  &lt;div class="dropshadow code"&gt;   &lt;div class="innerbox"&gt;     &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;internal class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CloneControlConverter &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;ControlIDConverter&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style="color: blue"&gt;protected override bool &lt;/span&gt;FilterControl(&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;control)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;return &lt;/span&gt;!(control &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CloneControl&lt;/span&gt;) &amp;amp;&amp;amp;&lt;br /&gt;                !(control &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Page&lt;/span&gt;) &amp;amp;&amp;amp;&lt;br /&gt;                !(control &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;DataSourceControl&lt;/span&gt;) &amp;amp;&amp;amp;&lt;br /&gt;                !(control &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HierarchicalDataSourceControl&lt;/span&gt;) &amp;amp;&amp;amp;&lt;br /&gt;                !(control &lt;span style="color: blue"&gt;is &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Content&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;[&lt;span style="color: #2b91af"&gt;ToolboxData&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;&amp;lt;{0}:CloneControl runat=\&amp;quot;server\&amp;quot; /&amp;gt;&amp;quot;&lt;/span&gt;)]&lt;br /&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;CloneControl &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;Control&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;&lt;br /&gt;    [&lt;span style="color: #2b91af"&gt;DefaultValue&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;), &lt;span style="color: #2b91af"&gt;IDReferenceProperty&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;TypeConverter&lt;/span&gt;(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;CloneControlConverter&lt;/span&gt;))]&lt;br /&gt;    &lt;span style="color: blue"&gt;public string &lt;/span&gt;ControlToClone&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;get&lt;br /&gt;        &lt;/span&gt;{&lt;br /&gt;            &lt;span style="color: blue"&gt;string &lt;/span&gt;value = &lt;span style="color: blue"&gt;this&lt;/span&gt;.ViewState[&lt;span style="color: #a31515"&gt;&amp;quot;__controlToClone&amp;quot;&lt;/span&gt;] &lt;span style="color: blue"&gt;as string&lt;/span&gt;;&lt;br /&gt;            &lt;span style="color: blue"&gt;return &lt;/span&gt;value ?? &lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty;&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: blue"&gt;set&lt;br /&gt;        &lt;/span&gt;{&lt;br /&gt;            &lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;value &lt;/span&gt;== &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br /&gt;                &lt;span style="color: blue"&gt;this&lt;/span&gt;.ViewState.Remove(&lt;span style="color: #a31515"&gt;&amp;quot;__controlToClone&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: blue"&gt;this&lt;/span&gt;.ViewState[&lt;span style="color: #a31515"&gt;&amp;quot;__controlToClone&amp;quot;&lt;/span&gt;] = &lt;span style="color: blue"&gt;value&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;protected &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;FindControlToClone(&lt;span style="color: blue"&gt;string &lt;/span&gt;controlId)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;control = &lt;span style="color: blue"&gt;this&lt;/span&gt;.NamingContainer.FindControl(controlId);&lt;br /&gt;        &lt;span style="color: blue"&gt;if &lt;/span&gt;(control == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br /&gt;            control = &lt;span style="color: blue"&gt;this&lt;/span&gt;.Page.FindControl(controlId);&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: blue"&gt;return &lt;/span&gt;control;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;protected override void &lt;/span&gt;Render(&lt;span style="color: #2b91af"&gt;HtmlTextWriter &lt;/span&gt;writer)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Control &lt;/span&gt;c = &lt;span style="color: blue"&gt;this&lt;/span&gt;.FindControlToClone(&lt;span style="color: blue"&gt;this&lt;/span&gt;.ControlToClone);&lt;br /&gt;        &lt;span style="color: blue"&gt;if &lt;/span&gt;(c == &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br /&gt;            &lt;span style="color: blue"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        c.RenderControl(writer);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="clear"&gt;And that’s it. Nifty eh? :)&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="clear"&gt;Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-2485443602423123688?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/2485443602423123688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=2485443602423123688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/2485443602423123688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/2485443602423123688'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/enter-clone-control.html' title='Enter: the Clone control...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8140888410626562973</id><published>2008-04-17T18:20:00.001+02:00</published><updated>2009-04-23T11:57:53.723+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hints and Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>The asp:radiobutton and the tale of the repeating control...</title><content type='html'>&lt;p&gt;How many times have you needed to use a radio button in a repeating control, such as a &lt;span class="code"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx" target="_blank"&gt;GridView&lt;/a&gt;&lt;/span&gt;? Simple right? Just create a template column, drop in an &lt;span class="code"&gt;asp:radiobutton&lt;/span&gt; and you are off. Sounds fantastic, yet it's a little more tricky than it first appears. The problem is that a radio button uses the &lt;span class="code"&gt;name &lt;/span&gt;attribute to determine the group in which it belongs. That way it gives you the &amp;quot;only have one selected&amp;quot; effect. &lt;/p&gt;  &lt;p&gt;The problem is that all server controls, housed within a repeater of sorts, are more than likely going to be created within an object implementing an interface called &lt;span class="code"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.inamingcontainer.aspx" target="_blank"&gt;INamingContainer&lt;/a&gt;&lt;/span&gt;. This is a “token” interface that instructs the framework to create a unique name for any child controls that the control contains, at runtime, based on its own name (i.e. the name of the parent). That way, you can define a row template, have a data source with multiple rows, and not have a naming clash. Actually, its a requirement of the framework that all controls have a unique name. Technically, I am being incorrect, the framework requires all controls to have a unique ID, but the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx" target="_blank"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx" target="_blank"&gt;asp:radiobutton&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; will generate a unique ID and a unique name (generally its exactly the same as the ID). However, as you can probably guess, the problem in this particular case, is the &amp;quot;name clash&amp;quot; effect on the &lt;span class="code"&gt;name&lt;/span&gt; attribute is &lt;em&gt;exactly &lt;/em&gt;the behaviour we need! Remember, it defines a “group” of radio buttons. The problem is that this behaviour is exactly what &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.inamingcontainer.aspx" target="_blank"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.inamingcontainer.aspx" target="_blank"&gt;INamingContainer&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; was created to avoid. &lt;/p&gt;  &lt;p&gt;So enough chat... how do we get around this limitation without having to go to the trouble of rolling our own server control? The answer is actually quite simple. Don't use a server control. &lt;/p&gt;  &lt;p&gt;For example, in the markup, within the repeater control (in this my case it was a &lt;span class="code"&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx" target="_blank"&gt;GridView&lt;/a&gt;&lt;/span&gt;, if you were curious), define a &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.templatefield.aspx" target="_blank"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.templatefield.aspx" target="_blank"&gt;templatefield&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; as such:&lt;/p&gt;  &lt;div class="dropshadow code"&gt;   &lt;div class="innerbox"&gt;&lt;span style="color: blue"&gt;       &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;templatefield&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;itemtemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;input &lt;/span&gt;&lt;span style="color: red"&gt;name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;rbSelected&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;type&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;radio&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;/span&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt;# Eval(&amp;quot;ID&amp;quot;) &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;quot; /&amp;gt;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;itemtemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;        &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;asp&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;templatefield&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;        &lt;br /&gt;        &lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;  &lt;p class="clear"&gt;As you can see, its a normal, plain old HTML element (admit it, you didn't even consider using one of these babies did you? :D ). Take note that it does &lt;strong&gt;not&lt;/strong&gt; have a &lt;span style="color: red"&gt;runat&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;server&amp;quot; &lt;/span&gt;attribute and is therefore (yes you guessed it) not a server control. This will make it exempt from the naming rules. I have however, used the databinding syntax to bind a useful value into the &lt;span class="code"&gt;value&lt;/span&gt; property of the element, to demonstrate that while we are not using an &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx" target="_blank"&gt;&lt;span class="code"&gt;&lt;/span&gt;&lt;/a&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx" target="_blank"&gt;asp:radiobutton&lt;/a&gt;&lt;/a&gt; server control, we can still make use of the funky databinding expressions that we know and love (and sometimes hate). This is because the row housing the element &lt;strong&gt;is&lt;/strong&gt; a server control and when its databinding expressions are evaluated, databound values will be in the output. In my fictional case, this would be the primary key of the item I wanted to select. This could be anything you like or anything that is useful in your context. &lt;/p&gt;  &lt;p class="clear"&gt;Right, so the next question is: how do we access this value from the codebehind? This turns out to be very easy, just interrogate the Form value from the &lt;span class="code"&gt;Page.Request &lt;/span&gt;object like so:&lt;/p&gt;  &lt;div class="dropshadow code"&gt;   &lt;div class="innerbox"&gt;     &lt;pre&gt;&lt;span style="color: blue"&gt;int &lt;/span&gt;value; &lt;br /&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(!&lt;span style="color: blue"&gt;int&lt;/span&gt;.TryParse(&lt;span style="color: blue"&gt;this&lt;/span&gt;.Request.Form[&lt;span style="color: #a31515"&gt;&amp;quot;rbSelected&amp;quot;&lt;/span&gt;], &lt;span style="color: blue"&gt;out &lt;/span&gt;value)) &lt;br /&gt;	value = -1; &lt;br /&gt;&lt;span style="color: blue"&gt;return &lt;/span&gt;value;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="clear"&gt;It's that simple. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="clear"&gt;However, to reiterate, the radio button in this example &lt;strong&gt;is not a server control&lt;/strong&gt;. That means that we do loose a lot of the yummy-goodness that comes with having the control available on the server side (server side events to name just one). Therefore, this approach could be somewhat limited. However, for a simple option select, within a repeating control, you can not beat the simplicity and ease in which this solution can be implemented. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="clear"&gt;Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8140888410626562973?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8140888410626562973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8140888410626562973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8140888410626562973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8140888410626562973'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/aspradiobutton-and-tale-of-repeating.html' title='The asp:radiobutton and the tale of the repeating control...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-7992127462028709282</id><published>2008-04-09T17:47:00.001+02:00</published><updated>2009-04-23T11:47:39.960+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hints and Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>T4 and the framework 3.5...</title><content type='html'>&lt;p&gt;I have been playing around with the T4 template engine for the last few days now. One of the first things that I noticed was that the wonderful &amp;quot;var&amp;quot; keyword and lambda expressions were not recognised. Obviously, the template generator was generating against the framework 2.0. I couldn't believe this was the only option we had available, especially with the release of VS2008. Google wasn't all that helpful and revealed nothing.&lt;/p&gt;  &lt;p&gt;Looking at the &lt;a href="http://msdn2.microsoft.com/en-us/library/bb126421.aspx#AssemblyReference" target="_blank"&gt;&amp;quot;official&amp;quot; documentation&lt;/a&gt; also revealed very little, except that the using the template directive &lt;font face="Courier New"&gt;&amp;lt;@# template #&amp;gt; &lt;/font&gt;you could change the language from C# (the default) to VB. Fantastic. Not what I wanted, but I felt like it was the right place to begin my search.&lt;/p&gt;  &lt;p&gt;So out came good’ol trusty &lt;a href="http://www.aisto.com/roeder/dotnet/" target="_blank"&gt;Reflector&lt;/a&gt; and off I went, with my little code explorer hat on. After a few minutes of digging around I managed to track down this little bit of code:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt; x = str.Substring(2);       &lt;br /&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt; (&lt;font color="#00a6a6"&gt;StringComparer&lt;/font&gt;.OrdinalIgnoreCase.Compare(x, &lt;font color="#800000"&gt;&amp;quot;v3.5&amp;quot;&lt;/font&gt;) == 0)       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; session.LanguageOptions[&lt;font color="#800000"&gt;&amp;quot;CompilerVersion&amp;quot;&lt;/font&gt;] = &lt;font color="#800000"&gt;&amp;quot;v3.5&amp;quot;&lt;/font&gt;;       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Aha! Look at that... A quick change to the language parameter of the template directive and I was in business. :) So, should you want to compile your T4 template using all the 3.5 goodness that is on offer, use the following:    &lt;br /&gt;&lt;font face="Courier New"&gt;&amp;lt;@# template language=&amp;quot;C#v3.5&amp;quot; #&amp;gt;&lt;/font&gt;     &lt;br /&gt;... or ...     &lt;br /&gt;&lt;font face="Courier New"&gt;&amp;lt;@# template language=&amp;quot;VBv3.5&amp;quot; #&amp;gt;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;And you should be in business... something I do think they need mention in the doc's somewhere.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-7992127462028709282?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/7992127462028709282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=7992127462028709282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7992127462028709282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7992127462028709282'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/t4-and-framework-35.html' title='T4 and the framework 3.5...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8545170149501631688</id><published>2008-04-09T14:08:00.001+02:00</published><updated>2008-04-09T14:57:58.641+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotcha'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Sending fax-emails through RightFax using the COM API...</title><content type='html'>&lt;p&gt;&lt;a href="http://www.captaris.com/rightfax/index.html" target="_blank"&gt;Captris RightFax&lt;/a&gt; is a very funky document delivery system. It will handle the conversion of documents to and from &amp;quot;Fax&amp;quot; ready formats (e.g. TIFF) and send them on. My experience with it has been extremely limited but from what I have seen I am duly impressed. It is built in a modular format so additional modules can be purchased/ignored depending on your particular needs. For instance there is an additional OCR component that can be purchased (albeit for quite a hefty price tag) and snapped into the installation for use. However, I only had the immediate need of only one of the basic features and that was to send a &amp;quot;fax&amp;quot; through the API to an email address.&lt;/p&gt;  &lt;p&gt;Using the object model its very simple. Fill in the required email address, add the attachments, and send. This seems to work a treat, however, I was stymied when all the emails I had sent, ended staying in the &amp;quot;Waiting to send&amp;quot; status indefinitely. At first I thought this had to be a setup issue, but using their client, emails could flow fast and furious. I then consulted the documentation for the API which, while it semi-explains everything (its better than nothing I guess), it didn't answer any of the questions I had about anything relevant. I tried every permutation of the sending code as I could think of.&lt;/p&gt;  &lt;p&gt;Finally, I stumbled upon the solution out of pure frustration. Here it is in c#:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New" size="2"&gt;&lt;font color="#008000"&gt;//assume server is the RightFax server object, and userID is a valid RightFax user&lt;/font&gt;      &lt;br /&gt;&lt;font color="#0000ff"&gt;Fax&lt;/font&gt; fax = (&lt;font color="#0000ff"&gt;Fax&lt;/font&gt;) server.get_CreateObject2(userID, &lt;font color="#00a6a6"&gt;CreateObjectType&lt;/font&gt;.coFax);       &lt;br /&gt;      &lt;br /&gt;fax.IsINLJob = &lt;font color="#00a6a6"&gt;BoolType&lt;/font&gt;.True;       &lt;br /&gt;fax.ToEmailAddress = &lt;font color="#800000"&gt;&amp;quot;bill@gates.com&amp;quot;&lt;/font&gt;;       &lt;br /&gt;fax.EmailSubject = &lt;font color="#800000"&gt;&amp;quot;RightFax Fax Email...&amp;quot;&lt;/font&gt;;       &lt;br /&gt;      &lt;br /&gt;fax.IsProductionFax = &lt;font color="#00a6a6"&gt;BoolType&lt;/font&gt;.True; &lt;font color="#008000"&gt;// &amp;lt;--- critical&lt;/font&gt;      &lt;br /&gt;fax.Send(); &lt;font color="#008000"&gt;// &amp;lt;--- critical&lt;/font&gt;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;The critical two items here, seem to be that you &lt;strong&gt;have&lt;/strong&gt; to set the .&lt;font face="Courier New"&gt;IsProductionFax&lt;/font&gt; property to &lt;font face="Courier New"&gt;BoolType.True&lt;/font&gt; and you have to send the fax with the .&lt;font face="Courier New"&gt;Send()&lt;/font&gt; method. There is a .&lt;font face="Courier New"&gt;Save()&lt;/font&gt; method that takes a &lt;font face="Courier New"&gt;BoolType&lt;/font&gt; as a parameter that can be used to perform a similar action to the straight out .&lt;font face="Courier New"&gt;Send().&lt;/font&gt; It works with normal faxes, but in the case of an email - no dice.&amp;#160; For the life of me, I can't imagine why these two small things would make a difference nor why its not mentioned in the documentation. And speaking about documentation... this is quoted directly from the official documentation regarding the .&lt;font face="Courier New"&gt;IsProductionFax&lt;/font&gt; property.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;&lt;strong&gt;IsProductionFax&lt;/strong&gt;       &lt;br /&gt;Data type: Boolean Read/Write       &lt;br /&gt;Specifies whether or not the fax was generated by the RightFax Production module.&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;And that's it. Nothing else in the entire document. Not even a *hint* there.&lt;/p&gt;  &lt;p&gt;At least I don't feel stupid for missing it the first couple of times around... ;)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8545170149501631688?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8545170149501631688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8545170149501631688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8545170149501631688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8545170149501631688'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/sending-fax-emails-through-rightfax.html' title='Sending fax-emails through RightFax using the COM API...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8646010286446095262</id><published>2008-04-09T03:06:00.000+02:00</published><updated>2009-04-23T11:43:44.622+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tales of a code monkey'/><title type='text'>Microsoft Office Document Imaging woes...</title><content type='html'>&lt;p&gt;It’s that time of the morning... that wondrous time when I hope that my final round of testing, with my brand-spanking-newly developed component is going to work... maybe.&lt;/p&gt;  &lt;p&gt;And all this because it seems as though there are a series of hoops that one has to jump through to make any Microsoft Office COM component to operate smoothly. And by smoothly, I refer to, in particular, convincing the COM component to let go of any/all resources it was consuming and/or quit. These two things are surprisingly hard to achieve.&lt;/p&gt;  &lt;p&gt;It has been a night fraught with dangerous code refactoring, extensive use of the &lt;em&gt;&lt;font face="Courier New"&gt;Marshal.ReleaseComObject&lt;/font&gt;&lt;/em&gt; and &lt;font face="Courier New"&gt;&lt;em&gt;Marshal.FinalReleaseComObject, AppDomains &lt;/em&gt;&lt;/font&gt;&lt;font face="ver"&gt;and various other craziness. I thought I had it at one stage where I would load the assembly of the component into a temporary &lt;em&gt;&lt;font face="Courier New"&gt;AppDomain&lt;/font&gt;&lt;/em&gt;, taking great care as to not let anything cross the Domain boundaries in an attempt to make sure there were no cases of rogue assembly leakage, ensuring that when I unloaded the &lt;font face="Courier New"&gt;&lt;em&gt;AppDomain&lt;/em&gt;&lt;/font&gt; all would be right with the world. The long and the short of that approach is that it didn’t help.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;(WARNING: to save those time looking for some direction should they be having similar issues, let me just stop you right here and tell you up front, I hacked it. The working solution I came up with was quick, dirty, and above all nowhere near elegant. But it works! You do these things when a demo to the boss is looming, first thing the next morning, and its just hit 02:30 AM). &lt;/p&gt;  &lt;p&gt;Now, to the background of my tale of woe... We have had a windows service application developed by a 3rd party that makes use of MODI (Microsoft Office Document Imaging). They use this component to facilitate OCR (Optical Character Recognition). MODI seems a fantastic alternative (far from perfect but it gets the job done for the most part) for businesses out there who don't want to (or can’t) fork over the wads of moolah for those high end OCR components - especially when they, almost certainly, already own a licence for Microsoft Office. The best part about it? Its actually rather good at what it does (right, enough about MODI now, perhaps I'll do a very quick post about it - not many people know about it as an alternative OCR engine you can manipulate through code). However, this particular windows service had issues (I am being very nice with that statement), and unfortunately required extensive reverse engineering and recompilation. This poor service has/had a lot of issues, and one of the components not working correctly was the OCR (to give you an example, the vendor only OCR'ed the first page looking for a specific text string, so if the client sent the fax with a cover sheet, it was all over). During our testing, I noticed errors popping up with the MODI component. These would happen after a few documents had been OCR'ed successfully (not necessarily having that text found, just passing through the engine). Obscure sounding errors about the COM server throwing this and that and a good amount of GoG (Good 'ol Googling) resulted in nothing concrete. &lt;/p&gt;  &lt;p&gt;Enter my &amp;quot;Bright Idea(tm)&amp;quot; of rewriting the OCR component. It should not have been a big deal. Just clean up the messy code and the COM component takes care of the rest? Right? Well yes, it did the rest and more. Like holding onto the file it was supposed to OCR for dear life. After managing to pry the file handle out of MODI's tight little clutches by &lt;font face="Courier New"&gt;&lt;em&gt;Marshalling&lt;/em&gt;&lt;/font&gt; my way to success and trying to make sure there simply could be no dangling references to MODI lying around... anywhere... ever… ever ever. I thought it was going to be clear sailing. Initial unit tests made me feel all warm and fuzzy with those green lights of goodness burning bright and having the service chug away at a few documents and finding once lost reference numbers filled me with giddy glee. &lt;/p&gt;  &lt;p&gt;That is, however, till I saw the RPC_E_SERVERFAULT errors popping up like crazy in the event log. The odd (or perhaps not so odd) thing was that if the service was restarted MODI would once again begin to function correctly. That is, until a few documents had been processed and/or some random time had passed. &lt;/p&gt;  &lt;p&gt;Then the problems would line up. Take a number, stand in line.&lt;/p&gt;  &lt;p&gt;Now, I am no stranger to “COM Interop” in .NET (but I am by no stretch of the imagination a Guru), and I performed all the good COM house cleaning I could and then some, to the point of overkill. &lt;em&gt;&lt;font face="Courier New"&gt;Try-Catch&lt;/font&gt;&lt;/em&gt; blocks everywhere there should be with &lt;em&gt;&lt;font face="Courier New"&gt;Finally&lt;/font&gt;&lt;/em&gt; blocks to make sure things were released after useage. Still nothing. Same issues. As I mentioned previously, I even went as far as to create a temporary &lt;font face="Courier New"&gt;&lt;em&gt;AppDomain&lt;/em&gt;&lt;/font&gt; and try and load everything through there... Still the same errors. &lt;/p&gt;  &lt;p&gt;Finally I cracked. Desperate times, desperate measures and all that. I pushed the OCR component out into an executable and now a whole new process is spawned when the OCR needs to happen - not just a thread. That way the entire process would close down and ensure (that's the theory anyway) all references were severed and objects cleaned up. &lt;/p&gt;  &lt;p&gt;The good news is that it works. It has continued to work for the last hour. I am overjoyed to say the least. However, I really don't like it as a solution. I need to know why MODI was faulting in such a spectacular way. I just can't figure it out. If I had it in me - I would post some code, but right now I am too bushed.&lt;/p&gt;  &lt;p&gt;I just hope I don't have to face that particular problem again for a little bit. And if I do, I would like it to be when I don't have a deadline looming over my head. At least, now, I don't have to tell the powers-that-be that its completely broken this morning...&lt;/p&gt;  &lt;p&gt;Little victories.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="ver"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="ver"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="ver"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8646010286446095262?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8646010286446095262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8646010286446095262' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8646010286446095262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8646010286446095262'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/microsoft-office-document-imaging-woes.html' title='Microsoft Office Document Imaging woes...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-7936363074295030298</id><published>2008-04-07T16:24:00.001+02:00</published><updated>2008-04-07T16:31:07.506+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Gotcha'/><category scheme='http://www.blogger.com/atom/ns#' term='Reminder'/><title type='text'>T4 and something to keep in mind...</title><content type='html'>&lt;p&gt;A friend of mine recently did a post on the T4 framework (Text Template Transformation Toolkit) &lt;a href="http://patramadass.emediait.com/weblog/2008/04/t4-code-generat.html" target="_blank"&gt;here&lt;/a&gt;. I had been following the technology for a little bit but I haven't had the opportunity to actually use it (just literature till now). After reading that post, I decided it was time to put on the water-wings and give it a whirl from within VS2008 (no additional downloads for VS2008). Needless to say, its pretty good. Honestly, its about time they built a template engine directly into the IDE. I think this will encourage a host of folk to rally around the banner of Code Generation goodness.&lt;/p&gt;  &lt;p&gt;With all that said, there is a small thing to keep in mind. It's something that, when you think about it, is quite obvious, yet because of its nice &amp;quot;integration&amp;quot; with VS2008 its easy to overlook (well for me it was anyway). &lt;/p&gt;  &lt;p&gt;What I wanted to do was, quite simply, using code inspection, create a set of interfaces and base implementation classes for a set of types. For example:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; INodeVisitor&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; Walk(BlockStatement node);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Postwalk(BlockStatement node);&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; Walk(ScopeStatement node);&lt;br /&gt;    &lt;span style="color: #008000"&gt;// .... continue on&lt;/span&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I thought it would be a funky &amp;quot;first time&amp;quot; use of the template engine as if I added a new type, both my IVisitor and the various default implementations could be generated. I was quite proud of myself for finding such a nice &amp;quot;practical&amp;quot; use for T4 (I really didn't want to do the atypical &amp;quot;generate the business objects from the database&amp;quot; routine). The problem is, even though the template &amp;quot;looks&amp;quot; like it is part of your solution - it is important to realise that &lt;strong&gt;only&lt;/strong&gt; the generated file is actually part of your solution, and not the template itself (ok, technically, that's wrong. The template &lt;em&gt;is &lt;/em&gt;part of your solution, its just not within the same &amp;quot;code scope&amp;quot; - if I can call it that...). That is to say, you don't have access to types, from within the template (via template statements and/or features), that are defined within the same solution. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The reason for this is actually very simple and straightforward. The default T4 compiler kicks in via an &amp;quot;external&amp;quot; command line call with, compiles the template file, applies the transforms and generates your file. Therefore, like I have mentioned, its important to keep in mind that the &lt;strong&gt;template compilation and file generation happens &lt;em&gt;outside&lt;/em&gt; of the scope of your own solution's compilation cycle&lt;/strong&gt;. However, the generated file &lt;strong&gt;will&lt;/strong&gt; still be compiled as part of your solution's normal compilation cycle.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now before everyone pipes up at once, I do realise that using template directives, you can reference another assembly. The only issue is, that from what I saw, it required the full path to the assembly (i.e. &amp;quot;C:\development\someproject\bin\debug\somedll.dll&amp;quot;). I am not a huge fan of this, because of the potential for different build configurations (do you import the debug version of the assembly or the release version?). It just felt a little dirty to me. Also, we wont even step into issues like what happens on the first time build when the assembly doesn't yet exist. I guess you could use the &lt;em&gt;hostspecific=&amp;quot;true&amp;quot;&lt;/em&gt; and try and interact with the code model using the &lt;em&gt;EnvDTE&lt;/em&gt; (from what I know the Visual Studio T4 host implements &lt;em&gt;IServiceProvider&lt;/em&gt;) but I haven't gone that far just yet. Something to look into. Perhaps the topic of another post... &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Anyway, like I said, nothing major, and not something that should stop anyone from using T4 - generally most (if not all) the other template engines should suffer the same limitation. It's just something to keep in mind when designing/creating your templates. It's way to easy to assume that because its within your solution explorer, that it has the built-in ability to access all types available within your assembly.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To sum up. T4 - I like it. I'll probably make more use of it where I can - especially in the area of boilerplate test cases - even if I have to &amp;quot;full path&amp;quot; the assembly reference (or use some DTE magic - is that even possible?) The simple fact that I don't have to bounce out to another application to compile the template and that there are no additional downloads, makes it a winner for me. It's really useful when you just want to quickly whip something up to &amp;quot;fill that gap&amp;quot; and not have to alt-tab for it and contend with project file changes and reloads...&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;My only gripe? No &lt;em&gt;built-in&lt;/em&gt; intellisense! I guess that if you don't want to have download and install something like this &lt;a href="http://www.t4editor.net/" target="_blank"&gt;T4 Editor&lt;/a&gt;, template edition is going to have to be done without all our new fan-dangled toys and back to the notepad roots! (for now, at least ;D). &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-7936363074295030298?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/7936363074295030298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=7936363074295030298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7936363074295030298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7936363074295030298'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/04/t4-and-something-to-keep-in-mind.html' title='T4 and something to keep in mind...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8340626276929243611</id><published>2008-03-27T18:26:00.001+02:00</published><updated>2008-03-27T18:26:09.876+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Things that irritate me'/><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>That's cute, but wrong...</title><content type='html'>&lt;p&gt;It's not everyday I come across something as full of nonsense as this &lt;a href="http://www.manageability.org/blog/archive/20030518%23the_imminent_demise_of_net" target="_blank"&gt;article&lt;/a&gt;. I'm quite surprised the author hasn't taken it down by now because of how wrong it turned out to be. Fine, he didn't write the original, but he's definitely hoping. Just taking a look around the site really goes to show the guy has some serious &amp;quot;short man virtual machine&amp;quot; syndrome. I use what I like. I don't like Java. I don't use it. Clearly, he doesn't like .NET. Its my very humble opinion that if you don't like it just don't use it. It shows a serious lack of maturity, in my mind, to come up with the usual sort of tabloid &lt;a href="http://www.manageability.org/blog/archive/20030113%23why_java_is_better_than2" target="_blank"&gt;&amp;quot;101 Reasons why Java is better than .NET&amp;quot;&lt;/a&gt; rubbish. &lt;/p&gt;  &lt;p&gt;I decided, with an open mind, I would take a look at some of the reasons. Here are two of them that I noted before I just decided to stop:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;26. Better Support for Peer to Peer Networks &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Java is used extensively to build Peer to Peer (P2P) networks. There are open source java implementations of the gnutella protocol. JXTA is an emerging standard for P2P networks and uses Java as its prototype implementations. Limewire and Kazaa downloaded hundreds of millions of times are written in Java and are among the more popular P2P clients available to date.&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Errm.... what? Thats like saying, use Microsoft Operating Systems because there is more software out there? To me, points like that obscure what should be the core reasoning of the argument. It should be about the language features/advantages. Java is better because the GC of the virtual machine is more advanced... or whatever.&lt;/p&gt;  &lt;p&gt;... And ...&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;47. Open Source Java Compilers and Parsers &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;There are several open source java compilers, many written also in java (i.e. Jikes, Eclipse, AspectJ, Kopi, Kiev) that make it easier to develop tools like Auditors, Metrics, Code Coverage and Refactoring. Furthermore, it makes is easier to develop embedded languages like SQLJ. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;By contrast .NET's CodeDOM assembly isn't able to parse .NET languages like C# or VB. It can only generate code, however what real gain is that, when writing out strings will suffice?&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;There is so much wrong with the last statement in his point, its not even funny. Again, another uninformed view of things. CodeDOM while not fantastic, can still be used to write (largely) language agnostic code that targets the .NET framework. Think Code Generators. You want to do that using strings. Good luck... let me know how that works out for you. He should have contrasted the shortcomings of CodeDOM vs. the other offering if he wants to make a debate of it. And he should certainly think twice about finishing off a point with utter bollocks. Even though he may have been 100% correct with the first part, you kind of loose the point, and you have to wonder just what other rubbish he is trying to spit out. &lt;/p&gt;  &lt;p&gt;Sure, like I said, its a 2003 article, and sure, he has a little tongue-in-cheek stab at &amp;quot;I'm open for debate&amp;quot; with &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;People who hate the list have also argued that some reasons are invalid because over time .NET will catch up.&amp;#160; All I can say to this line of argument is that this is a list about&amp;#160; &amp;quot;Today, the Here and Now&amp;quot;.&amp;#160; We can always revisit the list a year from now, and just maybe, there may be less reasons why Java is better.&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;But the truth is, back then, he was/is trying to compare apples with oranges. To me that doesn't work. Compare things when they are on the same level. &lt;/p&gt;  &lt;p&gt;All of this, however, is nothing when you read &lt;a href="http://www.manageability.org/blog/stuff/jetbrains-selling-arms-to-the-enemy" target="_blank"&gt;this article&lt;/a&gt;. I mean, goodness. Taking that last little bit into account, it seems he is worried that should there be better IDE tools that target the .NET framework (and we are not even talking about language enhancements), his beloved Java may get the shaft. You have to wonder that, if he thinks the release of a 3rd party tool becoming available on BOTH platforms, is a worrying thing, Java may not be &amp;quot;all that&amp;quot; he has built it up to be in the first place. He is/was clearly worried about something. And looking back it it now - he's had every reason to worry. .NET is flying fast and furious. And no, its not because now the IDE has built in code refractor support and/or JetBrains making swanky tools available for it.&lt;/p&gt;  &lt;p&gt;Don't get me wrong - if you use Java good on you. If you enjoy it, even better. I didn't. I preferred .NET. Don't try and &amp;quot;convert&amp;quot; me, I wont try and &amp;quot;convert&amp;quot; you. And if you are going to try, do it with a proper discussion. I welcome it. I'm not rooted in one language, I'll use the right tool for the job. If that's Java, so be it. &lt;/p&gt;  &lt;p&gt;Last word on the matter... &lt;/p&gt;  &lt;p&gt;I really dislike idiot zealots.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8340626276929243611?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8340626276929243611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8340626276929243611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8340626276929243611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8340626276929243611'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/03/that-cute-but-wrong.html' title='That&amp;#39;s cute, but wrong...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8387547835919458078</id><published>2008-03-05T17:24:00.000+02:00</published><updated>2008-03-05T17:43:00.502+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reminder'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>Don't forget about string.IsNullOrEmpty() in .NET 2.0</title><content type='html'>&lt;p&gt;I have noticed, in my travels though code written by others, that &lt;em&gt;string.IsNullOrEmpty&lt;/em&gt; is simply being overlooked.&lt;br /&gt;&lt;/p&gt;     &lt;p&gt;As most of you know by now, its much better practice, performance wise, to check if length of a string is less than or equal to zero, than comparing it to &amp;quot;&amp;quot; or &lt;em&gt;string.Empty&lt;/em&gt;, when trying to determine if its an empty string or not. For those of you who didn't (yes you, in the back, I see you) &lt;a href="http://msdn2.microsoft.com/en-us/library/ms182279(VS.80).aspx" target="_blank"&gt;here is a MSDN article&lt;/a&gt; that answers the question. Anyways, I digress and that's not the focus of this post.&lt;/p&gt;  &lt;p&gt;The point is that in .NET 1.1 you did the classic:&lt;/p&gt;  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;( someString == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; || someString.Length &amp;lt;= 0 )&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Fantastic. However, typing that every time you want to do a &lt;em&gt;&amp;quot;is the string empty check&amp;quot;&lt;/em&gt; gets old quite fast. Never fear - MS to the rescue of our ever precious keystrokes. It was decided that in .NET 2.0 that a static function, doing just the above, would become part of the public &lt;em&gt;string&lt;/em&gt; interface and save us a little of the hassle.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now the above code can be &amp;quot;simplified&amp;quot; as:&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;( &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(someString) )&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;It's a lot more expressive of intent, therefore more readable and as an added bonus, less of a pain to type (a massive 12 chars including white space ;P).&lt;/p&gt;&lt;br /&gt;  &lt;br /&gt; &lt;p&gt;I have just noticed that a great deal of developers either don't now about it, simply don't use it or are still comparing strings to &amp;quot;&amp;quot;, hence this post. Not exactly a &amp;quot;wow&amp;quot; or &amp;quot;this-going-to-change-my-life-forever-thank-you-so-much&amp;quot; post, but hopefully it will serve its purpose. It's just a little reminder to those who have made the move from 1.x to 2.0+ (or are just starting) that it's there... aching to be used.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8387547835919458078?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8387547835919458078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8387547835919458078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8387547835919458078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8387547835919458078'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/03/don-forget-about-stringisnullorempty-in.html' title='Don&amp;#39;t forget about string.IsNullOrEmpty() in .NET 2.0'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-7957751277772629992</id><published>2008-03-04T11:30:00.001+02:00</published><updated>2008-04-08T17:13:05.562+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gotcha'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>The Object.Equals Gotcha</title><content type='html'>&lt;p&gt;I haven't had the need to override the .Equals implementation on reference types all that much in my coding career. However, such a need sprang up earlier on today. While implementing it in the most rudimentary way, I just couldn't shake the feeling there was something that just didn't feel right. So I booted up Good 'ol Google and took a quick look at what was out there.&lt;/p&gt;  &lt;p&gt;I came across &lt;a href="http://weblogs.asp.net/bleroy/archive/2004/12/15/316601.aspx" target="_blank"&gt;this article&lt;/a&gt; that spells it out quite nicely (be sure to read the comments as well). Bottom line, if you are dealing with a reference type, its better to include an &lt;strong&gt;additional method&lt;/strong&gt; on your public interface that will compare the contents for equality. &lt;/p&gt;  &lt;p&gt;It's still a bit of a gray area for me. I am going to have to sit a while and mull over just what exactly the implications are, but these little bits of information are great to have stored in the back of your mind.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-7957751277772629992?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/7957751277772629992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=7957751277772629992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7957751277772629992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/7957751277772629992'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2008/03/objectequals-gotcha.html' title='The Object.Equals Gotcha'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-9143680090974754824</id><published>2007-11-16T11:41:00.001+02:00</published><updated>2007-11-16T12:00:48.111+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Completely pointless'/><category scheme='http://www.blogger.com/atom/ns#' term='Probably best avoided if you are in a hurry'/><category scheme='http://www.blogger.com/atom/ns#' term='Humour'/><category scheme='http://www.blogger.com/atom/ns#' term='Stupid ideas'/><title type='text'>If only the truth was a base class...</title><content type='html'>&lt;p&gt;I was having a discussion with a friend of mine and, as fate would have it, we managed a brief stint over the theory of truth and lies...&lt;br&gt;&lt;em&gt;"Lie" &lt;/em&gt;is such a &lt;strong&gt;strong&lt;/strong&gt; word - to alleviate this burden some think it's better phrased as "extending the truth". Now if only there was some technical implementation of this.... hmmmm.... &lt;/p&gt; &lt;p&gt;Fear not! I have done it. Here it is in all its glory...&lt;br&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;The truth as a base class. &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;(in C#)&lt;/p&gt; &lt;div&gt; &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ExtenedTruth : Truth&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {      &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; TellTheTruth()      &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {          &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         StringBuilder sb = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringBuilder(&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.TellTheTruth());          &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         sb.AppendLine(&lt;span style="color: #006080"&gt;" and we extend over here... "&lt;/span&gt;);           &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; sb.ToString();      &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="csharpcode"&gt;&lt;br /&gt;&lt;p&gt;Done! All this without any lies involved. What a pleasure... :D&lt;/p&gt;&lt;br /&gt;&lt;p&gt;P.S. please notice the use of the StringBuilder so that we can append loads onto the "truth" with as little of a performance hit as possible.&lt;br&gt;P.P.S. I am pretty sure this would compile on the Mono framework.&lt;br&gt;P.P.P.S I think I need to patent this.&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-9143680090974754824?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/9143680090974754824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=9143680090974754824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/9143680090974754824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/9143680090974754824'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2007/11/if-only-truth-was-base-class.html' title='If only the truth was a base class...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-3824340420124045699</id><published>2007-11-05T10:00:00.001+02:00</published><updated>2007-11-05T19:05:49.768+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WTF??'/><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>I hate those Permanent Temporary Failures...</title><content type='html'>&lt;p&gt;This is one of those things that make you laugh on your Monday morning...&lt;/p&gt; &lt;p&gt;Let me set the scene for you. A few days back, I was attempting to send a file via email (gmail) to various recipients. It would send, but never reach its destination. Frustrating to say the least, especially when you take into account that 12 previous attempts had already been made.&lt;/p&gt; &lt;p&gt;Now the more technically savvy among you may say: "Why not just use FTP? Email is notoriously bad for reliably sending files, especially when its important..." &lt;/p&gt; &lt;p&gt;Bottom line - I couldn't. Lets just leave it at that and be done with it. Below is a snippet of the delivery failure I got from Google (obviously I changed the email address and bolded the important parts...).&lt;/p&gt; &lt;p&gt;*snip*&lt;br&gt;&lt;em&gt;...&lt;br&gt;subject:&lt;br&gt;Delivery Status Notification (Failure)&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;This is an automatically generated Delivery Status Notification&lt;br&gt;Delivery to the following recipient failed &lt;strong&gt;permanently&lt;/strong&gt;:&lt;br&gt;&lt;/em&gt;&lt;a href="mailto:names.changed.to@protect.the.guilty"&gt;&lt;em&gt;names.changed.to@protect.the.guilty&lt;/em&gt;&lt;/a&gt;&lt;br&gt;&lt;em&gt;Technical details of &lt;strong&gt;permanent failure&lt;/strong&gt;:&lt;br&gt;&lt;strong&gt;TEMP_FAILURE: SMTP Error (state 16): 451 qq temporary problem (#4.3.0)&lt;/strong&gt;&lt;br&gt;&amp;nbsp; ----- Original message -----&lt;br&gt;Received: by &lt;/em&gt;&lt;a href="http://10.100.212.14"&gt;&lt;em&gt;10.100.212.14&lt;/em&gt;&lt;/a&gt;&lt;em&gt; with SMTP id k14mr997577ang.1193785829292;&lt;br&gt;...&lt;br&gt;&lt;/em&gt;*snip*&lt;/p&gt; &lt;p&gt;Well, I thought it was funny... a permanent failure with a temporary problem. Sweet.&lt;/p&gt; &lt;p&gt;P.S. what is also quite interesting that Google marks those failure notifications, from itself, as SPAM. I'm not complaining, just an interesting side note.&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-3824340420124045699?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/3824340420124045699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=3824340420124045699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/3824340420124045699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/3824340420124045699'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2007/11/i-hate-those-permanent-temporary-errors.html' title='I hate those Permanent Temporary Failures...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-4615749185409037157</id><published>2007-10-27T01:40:00.001+02:00</published><updated>2007-10-27T02:02:36.590+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Gotcha'/><title type='text'>It seems Windows Live Writer has a problem with publishing...</title><content type='html'>&lt;p&gt;any posting that has been assigned a category with an "!" in it.&lt;/p&gt; &lt;p&gt;For those of you who don't know, Windows Live Writer is a nifty little tool that allows us to blog away independent of the native blogging editors provided by the various different flavours of blogging software. I rather like it.&lt;/p&gt; &lt;p&gt;Aaaanyways...&lt;/p&gt; &lt;p&gt;I get the following little error notification when attempting to do so: &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.google.com/michael.kalogeropoulos/RyJ-_M75-qI/AAAAAAAAABU/0vZII8vMCdw/image%5B3%5D.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="316" alt="image" src="http://lh6.google.com/michael.kalogeropoulos/RyJ_As75-rI/AAAAAAAAABg/CmUCL4nK4zI/image_thumb%5B1%5D.png" width="443" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The software is still in beta, so little issues here and there are to be expected I suppose. The upside is that the software didn't crash and my post wasn't lost... just incase you were interested... ;)&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-4615749185409037157?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/4615749185409037157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=4615749185409037157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/4615749185409037157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/4615749185409037157'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2007/10/it-seems-windows-live-writer-has.html' title='It seems Windows Live Writer has a problem with publishing...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-8900237943392549723</id><published>2007-10-27T01:32:00.001+02:00</published><updated>2007-10-27T07:29:05.812+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WTF??'/><category scheme='http://www.blogger.com/atom/ns#' term='Code'/><title type='text'>When simple is just not enough...</title><content type='html'>&lt;p&gt;We all have felt the pain at one time or another. Yes... you know it... its that warm fuzzy time when you have to maintain someone else's code. &lt;/p&gt; &lt;p&gt;Generally, its difficult enough to adapt your thought process/logic to that of someone else, however, the added fun comes when the person who actually created the masterpiece of code, did it with a complete disregard to any sort of afore mentioned logic. &lt;/p&gt; &lt;p&gt;Now please, don't get me wrong... I don't usually go around ragging on code that someone else has done to the best of his/her ability (in this particular case lets hope, for the sake of the creator, it was the result of something closer to an alcohol induced coma as opposed to a fair reflection of said ability), but sometimes, especially at 01:20 in the morning, having to sift through what can only be described as a waste of time, I am a little less in the forgiving mood...&lt;/p&gt; &lt;p&gt;I believe the following sums it up:&lt;/p&gt; &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 270px; background-color: #f4f4f4"&gt; &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; CultureInfo cuInfo = CultureInfo.CurrentCulture;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; NumberFormatInfo numberFormatInfo = cuInfo.NumberFormat;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; strNegativeSymbol = numberFormatInfo.NegativeSign;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((dtbContract != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (dtbContract.Rows.Count &amp;gt; 0))&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     decContracRate = Convert.ToDecimal(dtbContract.Rows[0][&lt;span style="color: #006080"&gt;"PayoffAmount"&lt;/span&gt;],&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;                        System.Globalization.CultureInfo.InvariantCulture);&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((decContracRate.ToString().IndexOf(strNegativeSymbol) &amp;gt; -1))&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;     btnPrintPayment.Enabled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (btnIsVoid.Enabled == &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;         btnIsVoid.Enabled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt; }&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  20:&lt;/span&gt;     btnPrintPayment.Enabled = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  21:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Excluding all the other issues with this code snippet, unless I am missing something extremely sneaky - I am pretty sure the following would have done the trick:&lt;/p&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;( decContractRate &amp;lt; 0 )&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #008000"&gt;// oh look - its a negative&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     ...&lt;/pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Yup... sometimes simple is just not enough...&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-8900237943392549723?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/8900237943392549723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=8900237943392549723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8900237943392549723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/8900237943392549723'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2007/10/when-simple-is-just-not-enough.html' title='When simple is just not enough...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7373856298610071567.post-2846599316216031480</id><published>2007-10-27T00:33:00.001+02:00</published><updated>2007-10-29T12:50:45.947+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>The first posting...</title><content type='html'>&lt;p&gt;Well... here it is. Finally. My first blog posting. I have been thinking about doing this for quite some time now. &lt;/p&gt;  &lt;p&gt;Today, it seems, is that day...&lt;/p&gt;&lt;p&gt;Heaven help us all ;)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;- Mike&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7373856298610071567-2846599316216031480?l=objectnotset.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://objectnotset.blogspot.com/feeds/2846599316216031480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7373856298610071567&amp;postID=2846599316216031480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/2846599316216031480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7373856298610071567/posts/default/2846599316216031480'/><link rel='alternate' type='text/html' href='http://objectnotset.blogspot.com/2007/10/first-posting.html' title='The first posting...'/><author><name>Mike</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
