<?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:blogger='http://schemas.google.com/blogger/2008' 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-21214452</id><updated>2024-09-12T06:55:14.570+01:00</updated><category term="Programming"/><category term="C#"/><category term="FAIL"/><category term="hobby"/><category term="500px"/><category term="FeatureWishlist"/><category term="Flickr"/><category term="IIS"/><category term="KISS"/><category term="Lifestyle"/><category term="Linq"/><category term="csv"/><category term="diary"/><category term="events"/><category term="full-screen"/><category term="graphing"/><category term="hindsight"/><category term="logging"/><category term="mendhak"/><category term="parsing"/><category term="photos"/><category term="refactoring"/><category term="sql"/><category term="ssis"/><category term="ssms"/><title type='text'>Gog Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21214452.post-5529809148625353345</id><published>2014-03-26T20:51:00.000+00:00</published><updated>2014-09-04T14:59:30.382+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="csv"/><category scheme="http://www.blogger.com/atom/ns#" term="graphing"/><category scheme="http://www.blogger.com/atom/ns#" term="IIS"/><category scheme="http://www.blogger.com/atom/ns#" term="logging"/><category scheme="http://www.blogger.com/atom/ns#" term="parsing"/><title type='text'>Log Parsing</title><content type='html'>I love log files, they have so much value.&lt;br /&gt;
I work with IIS sites a lot and IIS log files are wonderful things. I also enjoy looking at Squid, Apache, and ELB logs. Really, I enjoy it.&lt;br /&gt;
&lt;br /&gt;
I have two tools I especially love for IIS log file parsing.&lt;br /&gt;
This &lt;a href=&quot;http://www.microsoft.com/en-gb/download/details.aspx?id=24659&quot; target=&quot;_blank&quot;&gt;Log Parser&lt;/a&gt;&amp;nbsp;is amazing; it gives you SQL syntax for quering text files including IIS log files or more generally CSV files. I think it does more but those two are the ones I&#39;m most often dealing with. It&#39;s really fast at processing too.&lt;br /&gt;
The other tool I love for taking a peek at IIS log files is Microsoft Excel. Excel is a wonderful bit of software and doesn&#39;t mind chewing on large log files. I import them as data from a text file, space delimited, and then format the whole thing as a table. This gives me filtering and sorting on the columns which allows me to answer questions like &#39;which request with a response code in the 200s takes the longest&#39;, &#39;which requests are 404-ing most often&#39;.&lt;br /&gt;
&lt;br /&gt;
Alongside graphing solutions (I&#39;m a fan of &lt;a href=&quot;https://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CD0QFjAB&amp;amp;url=http%3A%2F%2Fgraphite.wikidot.com%2F&amp;amp;ei=FqwyU5WZN-bb7Ab1kYDICA&amp;amp;usg=AFQjCNET5mcFa8pzkqEHzBu0zJUkfZivpQ&amp;amp;sig2=yyIqyRrfaYRWXwPVa7zkow&amp;amp;bvm=bv.63738703,d.ZGU&quot; target=&quot;_blank&quot;&gt;Graphite&lt;/a&gt;) parsing the log files is powerful; the graph will show some weirdness such as an increase in average response time, or a large number of errors and the log files will give you the details. Hopefully you&#39;ll find an answer to the deviant behaviour there.&lt;br /&gt;
I&#39;ve found this tutorial to be an excellent &lt;a href=&quot;https://www.digitalocean.com/community/tutorials/an-introduction-to-tracking-statistics-with-graphite-statsd-and-collectd&quot; target=&quot;_blank&quot;&gt;introduction to Graphite&lt;/a&gt; and it has some tutorials on setting it up and configuring it.&lt;br /&gt;
&lt;br /&gt;
In general I find that graphing solutions will give you a question, the logs will give you the answer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/5529809148625353345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/5529809148625353345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5529809148625353345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5529809148625353345'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2014/03/log-parsing.html' title='Log Parsing'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-217292295479401985</id><published>2014-03-20T18:48:00.000+00:00</published><updated>2014-03-20T18:48:00.825+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FeatureWishlist"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="ssis"/><category scheme="http://www.blogger.com/atom/ns#" term="ssms"/><title type='text'>Management Studio Feature Request</title><content type='html'>I spend quite a bit of time in Sql Server Management studio in bursts, at the moment I&#39;m there quite a lot because I&#39;m creating an SSIS package.&lt;br /&gt;
I find that I create tons of tabs which roughly group together a bunch of related, useful queries. They&#39;re nothing I want to keep long-term so I seldom save them but after a while I forget which bit of sql is in which tab. Things get worse when I have more tabs than can be displayed and the one I want is scrolled off the screen somewhere; &quot;Hmm, was that query in SQLQuery20? *click* Nope, not that one. What is this stuff?&quot;.&lt;br /&gt;
&lt;br /&gt;
I&#39;d love to have two features here:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Rename a tab without having to save it. I really should save it but sometimes I really only need them for an hour or two, I don&#39;t want the clean-up afterwards;&lt;/li&gt;
&lt;li&gt;Save a whole session for later. So say I&#39;m working on the SSIS project, I have lots of tab open which are useful for now. But then I need to do something else, or management studio is running slowly so I want to close it and re-open it later. Wouldn&#39;t it be cool if I could save the whole session as it is and close management studio. Then when I get back to it I can re-open my SSIS project and have it reconnect to the databases I had, re-open all the tabs back to how they were including their names and positions;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
That&#39;d make me happy.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/217292295479401985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/217292295479401985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/217292295479401985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/217292295479401985'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2014/03/management-studio-feature-request.html' title='Management Studio Feature Request'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-3938957557857654640</id><published>2013-01-31T19:12:00.000+00:00</published><updated>2013-01-31T19:12:00.368+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="diary"/><category scheme="http://www.blogger.com/atom/ns#" term="events"/><category scheme="http://www.blogger.com/atom/ns#" term="hindsight"/><category scheme="http://www.blogger.com/atom/ns#" term="hobby"/><category scheme="http://www.blogger.com/atom/ns#" term="Lifestyle"/><title type='text'></title><content type='html'>Oh look, it&#39;s been a whole year since I added an entry. Its apt then then I found a new fad to start playing with.&lt;br /&gt;
&lt;br /&gt;
I&#39;ve always liked the idea of a diary; I like the thought of having written hind-sight on seemingly insignificant days. Problem is I hate *writing* diaries, especially &#39;real&#39; ones on dead tree.&lt;br /&gt;
&lt;br /&gt;
Here&#39;s the proposed solution for me: &lt;a href=&quot;http://ohlife.com/&quot; target=&quot;_blank&quot;&gt;Oh Life&lt;/a&gt;.&lt;br /&gt;
I joined two days ago and I&#39;ve added two entries. I&#39;m two for two, how could it go wrong?&lt;br /&gt;
&lt;br /&gt;
A feature I like about this is reading a random entry and it even emails you a random entry from time to time. Hopefully the site will keep my entries private...</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/3938957557857654640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/3938957557857654640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/3938957557857654640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/3938957557857654640'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2013/01/oh-look-its-been-whole-year-since-i.html' title=''/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-2063990117291390546</id><published>2012-01-17T18:04:00.000+00:00</published><updated>2012-01-17T18:04:00.593+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Ever wondered what a local variable is?</title><content type='html'>I managed to mumble an answer about a variable with a very limited scope, which wasn&#39;t far from the truth.&lt;br /&gt;
In any case, here&#39;s the answer to a question no-one else really though to ask but is quite interesting when you get to read the answer:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blogs.msdn.com/b/ericlippert/archive/2012/01/16/what-is-the-defining-characteristic-of-a-local-variable.aspx&quot; target=&quot;_blank&quot;&gt;What is the defining characteristic of a local variable?&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/2063990117291390546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/2063990117291390546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/2063990117291390546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/2063990117291390546'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2012/01/ever-wondered-what-local-variable-is.html' title='Ever wondered what a local variable is?'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-6172954313306903893</id><published>2011-11-17T15:18:00.001+00:00</published><updated>2012-03-21T09:20:19.478+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="FAIL"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="refactoring"/><title type='text'>On the importance of good, readable code</title><content type='html'>Browsing through a solution I&#39;m involved with I found a line that looks like this:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Utils.Reshape(xsltFileStream, out xslt);&lt;/blockquote&gt;
It caught my eye because I have no idea what that method does based on that bit of code. It reshapes something (perhaps it reshapes the Util?), it receives a Stream and out&#39;s an XslCompiledTransform.&lt;br /&gt;
I could guess that it runs some xml through the xsl transform but it doesn&#39;t have any xml as a parameter and Utils is a class name, not an object (therefore making the method a static method, it doesn&#39;t use some xml from an instance variable).&lt;br /&gt;
&lt;br /&gt;
So what does it do? Here&#39;s the method (I really should get a C# syntax highlighter...):&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
public static bool Reshape(Stream source, out XslCompiledTransform target)&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
{&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; XmlTextReader xr = new XmlTextReader(source);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;           &amp;nbsp; target = new XslCompiledTransform();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;           &amp;nbsp; target.Load((XmlReader)xr);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; return (true);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
}&lt;/blockquote&gt;
So, it creates an XslCompiledTransform from the Stream you provide. Then it returns &#39;true&#39;.&lt;br /&gt;
To be fair, this is very old code (I checked the source control history) and it&#39;s probably been changed (I didn&#39;t say refactored) a million times by different people to get into this state. There aren&#39;t any automated tests in this solution so it&#39;s scary to change code in this situation; countering that though is the fact that this code isn&#39;t in a library that&#39;s shared with anyone else and it&#39;s only called in one place in this solution.&lt;br /&gt;
&lt;br /&gt;
What would I change?&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;div&gt;
That&#39;s a silly method name, &#39;LoadXslTransformerFromStream&#39; is better but I bet there are even better names still. Descriptive names are great, descriptive and succinct get extra points but really long method names don&#39;t slow your code down so don&#39;t be afraid of them.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Returning a hard-coded value (that isn&#39;t used anyway) = FAIL. Make the method return an XslCompiledTransform, lovely.&lt;/li&gt;
&lt;li&gt;Are utility classes really a good idea? I&#39;m undecided but shouldn&#39;t they be encapsulated in a relevant object rather than floating as a static method in a helper class?&lt;/li&gt;
&lt;li&gt;That cast to XmlReader could be improved - XmlTextReader is an XmlReader.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Anything else?&lt;br /&gt;
&lt;br /&gt;
EDIT: Never mind a syntax highlighter, I&#39;ll try .NET Pad for a bit. Here&#39;s the &lt;a href=&quot;http://dotnetpad.net/ViewPaste/2CkufmRKi0SFpcDx0iw1hA#c0,c2,c3,c6,&quot; target=&quot;_blank&quot;&gt;Reshape method&lt;/a&gt; with some formatting.</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/6172954313306903893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/6172954313306903893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/6172954313306903893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/6172954313306903893'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2011/11/on-importance-of-good-readable-code.html' title='On the importance of good, readable code'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-4015848544644202776</id><published>2011-11-17T14:03:00.001+00:00</published><updated>2011-11-17T14:08:16.299+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FAIL"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Recruitment email gone wrong</title><content type='html'>If you sign up to a recruitment site/agency you get called for ever. Even if they found you a job they&#39;ll call you in a year or so to make sure you&#39;re still happy or if not then they can help you find another role (and make some money for themselves). Anyway, you&#39;re meant to be friends with them so that you go back to them; I got an email this morning that didn&#39;t really warm me to the recruitment site:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Are you still working as NULL? Your profile was last updated 22/03/2004 and there are currently positions open that you may be missing out on.&lt;/span&gt;&lt;/strong&gt;&lt;/blockquote&gt;
&amp;nbsp;Perhaps they need some fresh programmers to work on their mass mailer?</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/4015848544644202776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/4015848544644202776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/4015848544644202776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/4015848544644202776'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2011/11/recruitment-email-gone-wrong.html' title='Recruitment email gone wrong'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-5270562840261196625</id><published>2011-11-17T08:05:00.001+00:00</published><updated>2011-11-17T08:12:52.455+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="500px"/><category scheme="http://www.blogger.com/atom/ns#" term="Flickr"/><category scheme="http://www.blogger.com/atom/ns#" term="full-screen"/><category scheme="http://www.blogger.com/atom/ns#" term="hobby"/><category scheme="http://www.blogger.com/atom/ns#" term="mendhak"/><category scheme="http://www.blogger.com/atom/ns#" term="photos"/><title type='text'>Flickr, Mendhak and the full screen option</title><content type='html'>What&#39;s a blog for if not for self-promotion. I&#39;m feeling altruistic too so I&#39;m going to promote my friend Mendhak!&lt;br /&gt;
I&#39;ve been a &lt;a href=&quot;http://www.flickr.com/photos/gogllundain/&quot; target=&quot;_blank&quot;&gt;Flickr&lt;/a&gt; user for years; I love taking photos although I consider that I&#39;m only a mediocre photographer. I love looking at portrait photos and Flickr was the first site I found that let me indulge in other people&#39;s photos in a rich way and with an abundance of photos. I&#39;ve recently found &lt;a href=&quot;http://www.500px.com/GogLlundain&quot; target=&quot;_blank&quot;&gt;500px&lt;/a&gt; which has a nicer interface but you always prefer that first site, it&#39;ll take a while to port over to anything else.&lt;br /&gt;
&lt;br /&gt;
Anyway, my friend &lt;a href=&quot;http://www.flickr.com/photos/mendhak/&quot; target=&quot;_blank&quot;&gt;Mendhak&lt;/a&gt; also shares a love of photography and of coding and has produced a &lt;a href=&quot;http://flkr.me/signatures&quot; target=&quot;_blank&quot;&gt;signature generator&lt;/a&gt; and a &lt;a href=&quot;http://flkr.me/backgrounds&quot; target=&quot;_blank&quot;&gt;full screen show-off-your-photo generator&lt;/a&gt;.&lt;br /&gt;
That&#39;s enough promotion for Mendhak, here&#39;s the self-promotion. Behold, &lt;a href=&quot;http://flkr.me/full/6317828894&quot; target=&quot;_blank&quot;&gt;leaves in autumn&lt;/a&gt; what I took (best viewed full screen on the biggest screen you own).&lt;br /&gt;
&lt;br /&gt;
Thanks Mendhak : )</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/5270562840261196625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/5270562840261196625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5270562840261196625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5270562840261196625'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2011/11/flickr-mendhak-and-full-screen-option.html' title='Flickr, Mendhak and the full screen option'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-6645505106044890917</id><published>2011-11-11T15:47:00.001+00:00</published><updated>2011-11-14T11:13:34.927+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="KISS"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>IEqualityComparer with Linq</title><content type='html'>I was completely thrown by a simple Linq issue today.&lt;br /&gt;
&lt;br /&gt;
I was reading in two lists of strings (user names as it happens) and I wanted to know which ones from the second list weren&#39;t in the first list. Simple problem right?&lt;br /&gt;
First stab was to iterate over the second list; if FirstList.Contains(string) then I wasn&#39;t interested in that entry but if it didn&#39;t contain that entry I was interested in it and would squirrel it away.&lt;br /&gt;
Multiple runs of this code provided a different number of results despite the source data being the same. Confusion reigned for a bit, scratched head and poked the code a few times until I realised I wasn&#39;t telling the .Contains call how to figure out if one string was the same as the other.&lt;br /&gt;
That sounds simple but C# wasn&#39;t making any assumptions, I don&#39;t know what the default equality comparer was doing but providing my own implementation of IEqualityComparer&amp;lt;T&amp;gt; (T was a string in my case) solved this problem.&lt;br /&gt;
&lt;br /&gt;
I love the satisfaction of solving a problem like this but good grief I felt a bit silly to be stumped by something so simple : )&lt;br /&gt;
For full closure I really should have a go at finding out what the default comparer actually does, no time at the moment though.&lt;br /&gt;
&lt;br /&gt;
EDIT (12th November, 2011): Spent some more time on it. I haven&#39;t found what the default comparer does yet however Microsoft have already created &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.stringcomparer.aspx&quot; target=&quot;_blank&quot;&gt;StringComparer&lt;/a&gt;s for me.&lt;br /&gt;
This is an abstract class that has a couple of static properties that expose the concrete examples. In my case I would have used StringComparer.OrdinalIgnoreCase as my comparer instead of writing my own.&lt;br /&gt;
&lt;br /&gt;
Thanks Microsoft : )</content><link rel='replies' type='application/atom+xml' href='http://gogllundain.blogspot.com/feeds/6645505106044890917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/21214452/6645505106044890917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/6645505106044890917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/6645505106044890917'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2011/11/i-was-completely-thrown-by-simple-linq.html' title='IEqualityComparer with Linq'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21214452.post-5644290788347303368</id><published>2011-11-11T15:41:00.001+00:00</published><updated>2011-11-14T11:08:42.763+00:00</updated><title type='text'>First Post w00t w00t</title><content type='html'>A beginning is a very delicate time.&lt;br /&gt;
Know then that it is the year 2011 and this is the first post. Who can say how long I&#39;ll be posting, I may get bored and stop.&lt;br /&gt;
&lt;br /&gt;
In any case, this is slightly more interesting than most first posts and I shall probably be the only one to read it whilst it&#39;s fresh.&lt;br /&gt;
&lt;br /&gt;
See you later?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5644290788347303368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21214452/posts/default/5644290788347303368'/><link rel='alternate' type='text/html' href='http://gogllundain.blogspot.com/2011/11/beginning-is-very-delicate-time.html' title='First Post w00t w00t'/><author><name>GogLlundain</name><uri>http://www.blogger.com/profile/08068747385210874171</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbN1ZJzNWEaktiM3NstG74w-E1YiwmV_m7YRvuh6OIF5LdP_5mFkbmfgm7L5DXVScyJFAiFgJEs_86fEq6t2gJiJY6Dz8cxF7leRQ96Q2-Y44LwgIsT-A2bsufaNPE2_Y/s220/LogoGLJ.jpg'/></author></entry></feed>