﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>https://ayende.com/blog/</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Backup goes wild</title><description>&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/090d4446afcb_7052/image_2.png"&gt;&lt;img width="765" height="721" title="image" align="right" style="border: 0px currentcolor; border-image: none; float: right; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/090d4446afcb_7052/image_thumb.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;We have a lot of internal test scenarios that run RavenDB through its paces.&lt;/p&gt;&lt;p&gt;One of them had an issue. It would test that RavenDB backups worked properly, but it would (sometimes) fail to clean up after itself.&lt;/p&gt;&lt;p&gt;The end result was that over time, the test database would accumulate more and more backup tasks that it had to execute (and all of them on the same schedule).&lt;/p&gt;&lt;p&gt;You can see here how RavenDB is allocating them to different nodes in an attempt to spread the load as much as possible. &lt;/p&gt;&lt;p&gt;We fixed the bug in the test case, but I also consider this a win because we now have protection from backup DoS attacks &lt;img class="wlEmoticon wlEmoticon-smile" style="" alt="Smile" src="https://ayende.com/blog/Images/Open-Live-Writer/090d4446afcb_7052/wlEmoticon-smile_2.png"&gt;. And I just love this image.&lt;/p&gt;</description><link>https://ayende.com/blog/187425-B/backup-goes-wild?Key=c38a11fd-db33-4e87-a9a6-d0aa632b06e5</link><guid>https://ayende.com/blog/187425-B/backup-goes-wild?Key=c38a11fd-db33-4e87-a9a6-d0aa632b06e5</guid><pubDate>Fri, 24 May 2019 12:00:00 GMT</pubDate></item><item><title>Failing to prove you are human</title><description>&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/5bc3c02ab3b7_883F/image_2.png"&gt;&lt;img width="247" height="256" title="image" align="right" style="border: 0px currentcolor; border-image: none; float: right; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/5bc3c02ab3b7_883F/image_thumb.png" border="0"&gt;&lt;/a&gt;I didn’t intend to do another non technical post, but this was hilarious. My previous post was about taking my daughter to the &lt;a href="https://ayende.com/blog/183713-C/toddlers-cursing-and-preparing-ahead-of-time"&gt;ice cream shop&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;My wife, naturally, wanted to comment on the post. She told me she gave up after failing to complete the CAPTCHA. &lt;/p&gt;&lt;p&gt;I’m not sure if I should be worried about the UX of the blog or upgrade my wife’s firmware.&lt;/p&gt;</description><link>https://ayende.com/blog/183745-C/failing-to-prove-you-are-human?Key=e7d78645-2389-47f5-8026-4276871b3c0a</link><guid>https://ayende.com/blog/183745-C/failing-to-prove-you-are-human?Key=e7d78645-2389-47f5-8026-4276871b3c0a</guid><pubDate>Wed, 11 Jul 2018 09:00:00 GMT</pubDate></item><item><title>Toddlers, cursing and preparing ahead of time</title><description>&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/Toddlers-cursing-and-preparing-ahead-of-_9F78/image_2.png"&gt;&lt;img width="233" height="155" title="image" align="right" style="border: 0px currentcolor; border-image: none; float: right; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/Toddlers-cursing-and-preparing-ahead-of-_9F78/image_thumb.png" border="0"&gt;&lt;/a&gt;My daughter is 3​¼ years old now. About the time that she was born, I decided that I needed to make a small change in my language. Whenever I felt the urge to curse, I would say a food’s name. For example, after being puked on, my reaction would be some variant of: “PASTA”, “PASTA BOLOGNESE” or other pasta’s favorites.&lt;/p&gt;&lt;p&gt;As time went by, I got better and better at expressing emotion through increasingly disturbing food references. My current favorite is: “Pasta Bolognese with pickled carrots in a bun with anchovies and raw eggs”.&lt;/p&gt;&lt;p&gt;A couple of days ago, I took my daughter and a friend to an ice cream shop. As expected of an ice cream shop in the middle of (very hot) summer, the place was packed. My daughter was quite excited to go there and expressed her emotions by standing up and shouting at the top of her lungs (she is three, with a voice that carry like a foghorn): “PASTA! PASTA BOLOGNESE” over and over again. &lt;/p&gt;&lt;p&gt;This is a crowded shop, full of small kids and parents. I got some looks for the little girl holding up a full ice cream cone and shouting about pasta, but it was infinitely preferable to the alternative. &lt;/p&gt;&lt;p&gt;An unforeseen side effect, however, is that because I can, I’m very free with pasta based profanities. This had led to what is effectively a competition, with her trying to cause me to go overboard with that. &lt;/p&gt;&lt;p&gt;And now I must go back to work, before the gluten police arrival.&lt;/p&gt;</description><link>https://ayende.com/blog/183713-C/toddlers-cursing-and-preparing-ahead-of-time?Key=cd6ae6db-6276-4fca-87d9-3ca7759d2675</link><guid>https://ayende.com/blog/183713-C/toddlers-cursing-and-preparing-ahead-of-time?Key=cd6ae6db-6276-4fca-87d9-3ca7759d2675</guid><pubDate>Tue, 10 Jul 2018 09:00:00 GMT</pubDate></item><item><title>.NET Core 2.1 broke my software, thank you very much!</title><description>&lt;p&gt;We just upgraded our stable branch to .NET Core 2.1. The process was pretty smooth overall, but we did get the following exchange in our internal Slack channel. &lt;/p&gt;&lt;p&gt;It went something like this:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;is it known that import doesn't work ? &lt;/li&gt;&lt;li&gt;As you can imagine, Import is pretty important for us.&lt;/li&gt;&lt;li&gt;no&lt;/li&gt;&lt;li&gt;does it work on your machine ?&lt;/li&gt;&lt;li&gt;checking,,,&lt;/li&gt;&lt;li&gt;what's an error?&lt;/li&gt;&lt;li&gt;no error.&lt;/li&gt;&lt;li&gt;so UI is blocked?&lt;/li&gt;&lt;li&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/NE.1-broke-my-software-thank-you-very-m_133A3/image_2.png"&gt;&lt;img width="879" height="329" title="image" style="margin: 0px; border: 0px currentcolor; border-image: none; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/NE.1-broke-my-software-thank-you-very-m_133A3/image_thumb.png" border="0"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;do you have any errors in dev tools console?&lt;/li&gt;&lt;li&gt;`TypeError: e is undefined`&lt;br&gt;doesn't says to me much&lt;/li&gt;&lt;li&gt;same thing in incognito&lt;/li&gt;&lt;li&gt;export doesn't work either&lt;/li&gt;&lt;li&gt;lol the reason is: dotnet core 2.1&lt;/li&gt;
&lt;p&gt;the websockets are faster and I had race in code&lt;br&gt;
will push fix shortly&lt;/p&gt;&lt;/ul&gt;&lt;p&gt;There you have it, .NET Core 2.1 broke our code. Now I have to go and add Thread.Sleep somewhere…&lt;/p&gt;</description><link>https://ayende.com/blog/183297-A/net-core-2-1-broke-my-software-thank-you-very-much?Key=72cefc7b-8d50-4a42-b31a-f0f2374e2f0b</link><guid>https://ayende.com/blog/183297-A/net-core-2-1-broke-my-software-thank-you-very-much?Key=72cefc7b-8d50-4a42-b31a-f0f2374e2f0b</guid><pubDate>Wed, 13 Jun 2018 09:00:00 GMT</pubDate></item><item><title>This will be $11,509,586,000, please (excluding tip)</title><description>&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/This-will-be-11509586000-please-excludin_DD41/image_5.png"&gt;&lt;img width="367" height="232" title="image" align="right" style="border: 0px currentcolor; border-image: none; float: right; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/This-will-be-11509586000-please-excludin_DD41/image_thumb_1.png" border="0"&gt;&lt;/a&gt;About a decade ago I was working at a client, and I was trying to get some idea about the scope of the project. This was a fairly large B2B system, with some interesting requirements around business logic behaviors. &lt;/p&gt;&lt;p&gt;For the life of me, I couldn’t get the customer to commit to even rough SLA or hard numbers around performance, capacity and scale. Whenever I asked, I got some variant of: “It has to be fast, &lt;em&gt;really &lt;/em&gt;fast.”&lt;/p&gt;&lt;p&gt;But what is fast, and under what scenario, that was impossible to figure out. I got quite frustrated by this issue and pressed hard on this topic, and finally got something that was close to a hard number, “it has to be like Google”. &lt;/p&gt;&lt;p&gt;That was a metric I could do something with. I went to last year’s Google financial statements, figured out how much money they spent that year and sent the customer a quote for 11.5 billion US dollars. &lt;/p&gt;&lt;p&gt;As you might imagine, that number caught people’s attention, especially since I sent it to quite a few people at the customer. On a call with the customer I explained, “You want it to be like Google, so I used the same budget as Google”.&lt;/p&gt;&lt;p&gt;From that point it was much easier to actually get performance and scale numbers, although I did have to cut a few zeroes (like, all of them) from the quote.&lt;/p&gt;</description><link>https://ayende.com/blog/182433-C/this-will-be-11-509-586-000-please-excluding-tip?Key=55c50282-2d7b-4eb0-91ed-b5a323463f92</link><guid>https://ayende.com/blog/182433-C/this-will-be-11-509-586-000-please-excluding-tip?Key=55c50282-2d7b-4eb0-91ed-b5a323463f92</guid><pubDate>Sun, 01 Apr 2018 09:00:00 GMT</pubDate></item><item><title>Giving Demeter PTSD</title><description>&lt;p&gt;The law of Demeter goes like this, a method &lt;code&gt;m&lt;/code&gt; of an object &lt;code&gt;O&lt;/code&gt; may only invoke the methods of the following kinds of objects:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;code&gt;O&lt;/code&gt; itself
&lt;li&gt;&lt;code&gt;m&lt;/code&gt;'s parameters
&lt;li&gt;Any objects created/instantiated within &lt;code&gt;m&lt;/code&gt;&lt;li&gt;&lt;code&gt;O&lt;/code&gt;'s direct component objects
&lt;li&gt;A global variable, accessible by &lt;code&gt;O&lt;/code&gt;, in the scope of &lt;code&gt;m&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;And then we have this &lt;em&gt;snippet&lt;/em&gt; from a 1,741 lines index that was sent to us to diagnose some performance problems.&lt;/p&gt;&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/Giving-Demeter-PTSD_11694/image_2.png"&gt;&lt;img width="997" height="551" title="image" style="margin: 0px; border: 0px currentcolor; border-image: none; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/Giving-Demeter-PTSD_11694/image_thumb.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There are at least two separate leaks of customer data here, by the way, can you spot them?&lt;/p&gt;&lt;p&gt;This is it for this post, I really don’t have anything else left to say.&lt;/p&gt;</description><link>https://ayende.com/blog/180193/giving-demeter-ptsd?Key=4a3c21dc-61b7-4b0f-8da9-40d9b1ae0fad</link><guid>https://ayende.com/blog/180193/giving-demeter-ptsd?Key=4a3c21dc-61b7-4b0f-8da9-40d9b1ae0fad</guid><pubDate>Thu, 19 Oct 2017 09:00:00 GMT</pubDate></item><item><title>Fractal release process</title><description>&lt;p&gt;As part of the release process for RavenDB RC, we have different team members doing strange things. Here is what one of them sent me. This is a RavenDB cluster composed of 30+ nodes, with a single database that spans 27 nodes with full master/master replication between them.&lt;/p&gt;&lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Open-Live-Writer/Fractal-release-process_DD17/image_2.png"&gt;&lt;img width="1051" height="1063" title="image" style="margin: 0px; border: 0px currentcolor; border-image: none; display: inline; background-image: none;" alt="image" src="https://ayende.com/blog/Images/Open-Live-Writer/Fractal-release-process_DD17/image_thumb.png" border="0"&gt;&lt;/a&gt;&lt;/p&gt;</description><link>https://ayende.com/blog/179746/fractal-release-process?Key=da8e3aeb-3d56-4521-a29e-e072e079af35</link><guid>https://ayende.com/blog/179746/fractal-release-process?Key=da8e3aeb-3d56-4521-a29e-e072e079af35</guid><pubDate>Tue, 12 Sep 2017 09:44:00 GMT</pubDate></item><item><title>The things that come out late at night</title><description>&lt;p&gt;The following is the opening paragraphs for discussion RavenDB 4.0 clustering and distribution model in the Inside RavenDB 4.0 book.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You might be familiar with the term "murder of crows" as a way to refer to a group for crows[1]. It has been used in literature and arts many times. Of less reknown is the group term for ravens, which is "unkindness". Personally, in the name of all ravens, I'm torn between being insulted and amused.&lt;/p&gt;
&lt;p&gt;Professionally, setting up RavenDB as a cluster on a group of machines is a charming exercise (however, that term is actually reserved for finches) that bring a sense of exaltation (taken too, by larks) by how pain free this is. I'll now end my voyage into the realm of ornithology's etymology and stop speaking in tongues.&lt;/p&gt;
&lt;p&gt;On a more serious note, the fact that RavenDB clustering is easy to setup is quite important, because it means that it is much more approachable.&lt;/p&gt;
&lt;hr align="left" size="1" width="33%" /&gt;
&lt;p&gt;[1] If you are interested in learning why, I found &lt;a href="https://www.quora.com/Why-is-a-group-of-crows-called-a-murder"&gt;this answer&lt;/a&gt; fascinating&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It was amusing to write, and it got me to actually start writing that part of the book. Although I&amp;rsquo;m not sure if this will survive editing and actually end up in the book.&lt;/p&gt;</description><link>https://ayende.com/blog/178881/the-things-that-come-out-late-at-night?Key=d338ab45-e462-4255-a169-a53a4c78fde1</link><guid>https://ayende.com/blog/178881/the-things-that-come-out-late-at-night?Key=d338ab45-e462-4255-a169-a53a4c78fde1</guid><pubDate>Wed, 28 Jun 2017 09:47:00 GMT</pubDate></item><item><title>Code through the looking glass: And a linear search to rule them</title><description>&lt;p&gt;The final piece for this candidate is the code to actually search through the sorted array. As you'll recall, the candidate certainly made our computer pay for that sorting and merging. But we are fine now, we have manage to recover from all of that abuse, and we are ready to rock.&lt;/p&gt; &lt;p&gt;Here is how the search (over sorted array) was implemented.&lt;/p&gt; &lt;blockquote&gt; &lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; List&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; EmailSearcher(&lt;span style="color: blue"&gt;string&lt;/span&gt; email)
{
    List&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; answer = &lt;span style="color: blue"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt;();
    &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; emailsArray.Length; i++)
    {
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (emailsArray[i].STR.ToString().Equals(email, StringComparison.OrdinalIgnoreCase))
        {
            answer = emailsArray[i].ID;
            &lt;span style="color: blue"&gt;return&lt;/span&gt; answer;
        }
    }

    &lt;span style="color: blue"&gt;return&lt;/span&gt; answer;
}

&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;And with that, I have nothing left to say.&lt;/p&gt;</description><link>https://ayende.com/blog/173669/code-through-the-looking-glass-and-a-linear-search-to-rule-them?Key=78297dd2-0ab9-4514-bf00-cf48b13b7ddd</link><guid>https://ayende.com/blog/173669/code-through-the-looking-glass-and-a-linear-search-to-rule-them?Key=78297dd2-0ab9-4514-bf00-cf48b13b7ddd</guid><pubDate>Fri, 18 Mar 2016 10:00:00 GMT</pubDate></item><item><title>Code through the looking glass: Sorting large data sets</title><description>&lt;p&gt;The task in question was to read a CSV file (which is large, but can fit in memory) and allow quick searches on the data by email to find the relevant users. Most candidates handle that with a dictionary, but since our candidate decided to flip things around, he also included an implementation of doing this with sorted arrays. That is actually quite nice, in theory. In practice, it ended up something like this:&lt;/p&gt; &lt;p&gt;&lt;img alt="funny, funny pictures, funny photos, hilarious, wtf, weird, bizarre, funny animals, 17 Bizarre Photoshop Hybrid Animals" src="http://images.dailydawdle.com/hilarious-wtf-bizarre-photoshop-hybrid-animals8.jpg" width="240" height="240"&gt;&lt;/p&gt; &lt;p&gt;In order to truly understand the code, I have to walk you through a&amp;nbsp; bunch of it. &lt;/p&gt; &lt;p&gt;It starts with the following fields:&lt;/p&gt; &lt;blockquote&gt; &lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;List&amp;lt;Structure&amp;gt; emails = &lt;span style="color: blue"&gt;new&lt;/span&gt; List&amp;lt;Structure&amp;gt;();

Structure[] namesArray = &lt;span style="color: blue"&gt;new&lt;/span&gt; Structure[0];&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;Structure, by the way, is a helper class that just has a key and a list of ids.&amp;nbsp; The duplicate is strange, but whatever, let move on.&lt;/p&gt;
&lt;p&gt;The class constructor is reading one line at a time and add an structure instance with the email and the line id to the emails list.&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ToArray()
{
    emailsArray = &lt;span style="color: blue"&gt;this&lt;/span&gt;.emails.ToArray();
}

&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;This code just copy emails to the array, we are not sure why yet, but then we have:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Sort()
{
    Array.Sort(emailsArray, &lt;span style="color: blue"&gt;delegate&lt;/span&gt;(Structure x, Structure y) { &lt;span style="color: blue"&gt;return&lt;/span&gt; x.STR.CompareTo(y.STR); });
}

&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;So far, this is right in line with the "use a sorted array" method that the candidate talked about. There is a small problem here, because emails are allowed to be duplicated, but no fear, our candidate can solve that…&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; UnifyIdLists()
{
    &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; emailsArray.Length; i++)
    {
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (i + 1 == emailsArray.Length)
            &lt;span style="color: blue"&gt;break&lt;/span&gt;;
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (emailsArray[i].STR.Equals(emailsArray[i + 1].STR))
        {
            emailsArray[i].ID.AddRange(emailsArray[i + 1].ID);
            emailsArray[i + 1] = &lt;span style="color: blue"&gt;null&lt;/span&gt;;
            List&amp;lt;Structure&amp;gt; temp = emailsArray.ToList&amp;lt;Structure&amp;gt;();
            temp.RemoveAll(item =&amp;gt; item == &lt;span style="color: blue"&gt;null&lt;/span&gt;);
            emailsArray = temp.ToArray();
        }
    }
}

&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;em&gt;intent &lt;/em&gt;of this code is to merge all identical email values into a single entry in the list. &lt;/p&gt;
&lt;p&gt;Now, to put things in perspective, we are talking about a file that is going to be around the 500MB in size, and there are going to be about 3.5 million lines in it.&lt;/p&gt;
&lt;p&gt;That means that the emailsArray alone is going to take about 25MB. &lt;/p&gt;
&lt;p&gt;Another aspect to consider is that we are using dummy data in our test file. Do you want to guess how many duplicates there are going to be there? Each of which is generating two 25MB allocations and multiple passes over an array of 3.5 million items in size.&lt;/p&gt;
&lt;p&gt;Oh, and for the hell of it, the code above doesn't even &lt;em&gt;work&lt;/em&gt;. Consider the case when we have three duplicates…&lt;/p&gt;</description><link>https://ayende.com/blog/173668/code-through-the-looking-glass-sorting-large-data-sets?Key=cf787206-f4cf-4037-a884-8101c594a065</link><guid>https://ayende.com/blog/173668/code-through-the-looking-glass-sorting-large-data-sets?Key=cf787206-f4cf-4037-a884-8101c594a065</guid><pubDate>Thu, 17 Mar 2016 10:00:00 GMT</pubDate></item><item><title>Code through the looking glass: I'm the God of all OOP</title><description>&lt;p&gt;We typically don't look too deeply into the overall design on a candidate's code. Most coding tasks just aren't big enough to warrant it. &lt;/p&gt; &lt;p&gt;When we do, it is typically because the candidate has done something… peculiar. For example, we have had a candidate that send a submission with no less than 17 classes to manager reading a CSV file and populating a dictionary. At some point we knew that this candidate wasn't going to move forward, but it became a challenge, to try to outline how the data actually traveled through that particular maze. But as much as we love Mr. Goldberg, I'm afraid that dear Rubbie isn't going to be remembered for much longer. &lt;/p&gt; &lt;p&gt;Here is how this candidate code started:&lt;/p&gt; &lt;blockquote&gt; &lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)
{
    &lt;span style="color: green"&gt;//Call for parsing method&lt;/span&gt;
    HelperClass cr = &lt;span style="color: blue"&gt;new&lt;/span&gt; HelperClass();
    cr.CsvParser();
    cr.ToArray();
    cr.Sort();
    cr.UnifyIdLists();
    &lt;span style="color: green"&gt;//ask the user to enter input&lt;/span&gt;
    &lt;span style="color: blue"&gt;string&lt;/span&gt; input = cr.InputReader();
&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;I actually started explaining the issues in this code, but I run out of… pretty much everything. &lt;/p&gt;
&lt;p&gt;I have a challenge for you, can you think of a single OOP principle that isn't being broken here?&lt;/p&gt;
&lt;p&gt;For… fun, I guess, you can also look at the following code, which come just after the one above:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;Start:
&lt;span style="color: green"&gt;    //check input type&lt;/span&gt;
    &lt;span style="color: blue"&gt;switch&lt;/span&gt; (cr.InputTester(input))
    {
        &lt;span style="color: blue"&gt;case&lt;/span&gt; 0:
            &lt;span style="color: green"&gt;//valid email structure, but the input is not found in the file&lt;/span&gt;
            List&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; emails = &lt;span style="color: blue"&gt;new&lt;/span&gt; List&amp;lt;&lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt;();
            emails = cr.EmailSearcher(input);
            &lt;span style="color: blue"&gt;if&lt;/span&gt; (emails.Count == 0)
            {
                Console.WriteLine(&lt;span style="color: #a31515"&gt;"The input you have entered has not been found in the file. \nPlease try again."&lt;/span&gt;);
                input = cr.InputReader();
                &lt;span style="color: blue"&gt;goto&lt;/span&gt; Start;
            }
&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;I guess someone heard that loops are a performance bottleneck in most applications and decided to do away with them.&lt;/p&gt;</description><link>https://ayende.com/blog/173667/code-through-the-looking-glass-im-the-god-of-all-oop?Key=20e143b0-7abe-4397-b6d3-61df72314b6c</link><guid>https://ayende.com/blog/173667/code-through-the-looking-glass-im-the-god-of-all-oop?Key=20e143b0-7abe-4397-b6d3-61df72314b6c</guid><pubDate>Wed, 16 Mar 2016 10:00:00 GMT</pubDate></item><item><title>Code through the looking glass: Finding today's log file</title><description>&lt;p&gt;You might have noticed that we are looking for more people again. Mostly because I gripe about some of the bad ones here every now and then.&lt;/p&gt;
&lt;p&gt;One of my absolute requirements is that I want to read a candidate's code before hiring them. Some of them have made significant contributions to Open Source code, but a large number don't have any significant body of code that they can show. That is why we ask candidates to send us a coding test.&lt;/p&gt;
&lt;p&gt;We had people flat out refuse to do the coding test, and some who thought that the questions were incredibly hard and unrealistic. We had people who sent in code that was so bad it caused migraines, we had people who sent in code that wouldn't compile, we&amp;nbsp; had people do stuff like read a 15TB file (16,492,674,416,640)! times. And just to clarify, that is &lt;strong&gt;factorial&lt;/strong&gt;(16492674416640). I don't know what the actual value of this number is, but is it &lt;em&gt;big&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The nice thing is that you can usually tell right away when the code is bad. We also play a game called "guess the candidate's background". We have about 89% success rate there*.&lt;/p&gt;
&lt;p&gt;Spotting good code is much harder, because a really successful submission is going to be boring. It does what needs to be done, and that is it. Our most recent hire's code submission was so boring, we had to analyze it using our standard metrics to find issues (our standard metrics are for production code running in a high performance DB for months on end, not the same metrics we evaluate code submissions).&lt;/p&gt;
&lt;p&gt;And then&amp;hellip; then there is this candidate, whose code is so unique that I decided to dedicate a full week to explore it. The code looks good, documented, there are explanations that show what is going on and they are going in the right direction, on the surface of it.&lt;/p&gt;
&lt;p&gt;And then there is the devil in the details. I have quite a lot to write about this particular submission, but I'll just start with the following:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;&lt;span style="color: green;"&gt;//Find today's log file in the directory&lt;/span&gt;
&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; LogFileFinder()
{
    &lt;span style="color: blue;"&gt;string&lt;/span&gt;[] files = Directory.GetFiles(LoggingAggregation.Program.GlobalVar.path, &lt;span style="color: #a31515;"&gt;"*.log"&lt;/span&gt;);
    &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; files.Length; i++)
    {
        &lt;span style="color: blue;"&gt;int&lt;/span&gt; slash = files[i].LastIndexOf(&lt;span style="color: #a31515;"&gt;@"\"&lt;/span&gt;);
        &lt;span style="color: blue;"&gt;int&lt;/span&gt; dot = files[i].LastIndexOf(&lt;span style="color: #a31515;"&gt;"."&lt;/span&gt;);
        &lt;span style="color: blue;"&gt;string&lt;/span&gt; fileName = files[i].Substring(slash + 1, dot - slash - 1);
        &lt;span style="color: blue;"&gt;string&lt;/span&gt; fileDate = DateTime.Now.ToString(&lt;span style="color: #a31515;"&gt;"yyyy-MM-dd"&lt;/span&gt;);
        &lt;span style="color: blue;"&gt;if&lt;/span&gt; (fileName.Equals(fileDate))
            &lt;span style="color: blue;"&gt;return&lt;/span&gt; fileName + &lt;span style="color: #a31515;"&gt;".log"&lt;/span&gt;;
    }

    &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;null&lt;/span&gt;;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;Now, another way to write this code would be:&lt;/p&gt;
&lt;blockquote&gt;
&lt;div style="color: black; background-color: white;"&gt;
&lt;pre&gt;Path.Combine(LoggingAggregation.Program.GlobalVar.path, DateTime.Now.ToString(&lt;span style="color: #a31515;"&gt;"yyyy-MM-dd"&lt;/span&gt;) +&lt;span style="color: #a31515;"&gt;".log"&lt;/span&gt;) 
&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;I literally stared at this piece of code for several minutes, trying to figure out what is actually going on there. I wasn't able to.&lt;/p&gt;
&lt;p&gt;As an aside, we sent the candidate a rejection notice, along with a few pointers to some of the more egregious things that were wrong in the code.&amp;nbsp; They know how to code, it is just that it goes sideway in the middle.&lt;/p&gt;
&lt;p&gt;* The game call to guess the candidate's default language settings. That is, someone who write C# code, but has been brought up on C, so have a C style to the code.&lt;/p&gt;</description><link>https://ayende.com/blog/173665/code-through-the-looking-glass-finding-todays-log-file?Key=018035de-5326-4bd1-b79a-1ec49bfc1605</link><guid>https://ayende.com/blog/173665/code-through-the-looking-glass-finding-todays-log-file?Key=018035de-5326-4bd1-b79a-1ec49bfc1605</guid><pubDate>Mon, 14 Mar 2016 10:00:00 GMT</pubDate></item><item><title>Nepotism in the interview process</title><description>&lt;p&gt;I admit, she only go the interview because of who her father is. But she still managed to show more enthusiasm for the job than some candidates.&lt;/p&gt; &lt;p&gt;&lt;a href="https://ayende.com/blog/Images/Windows-Live-Writer/0a66b44c9f6b_14905/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://ayende.com/blog/Images/Windows-Live-Writer/0a66b44c9f6b_14905/image_thumb.png" width="943" height="747"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Her test was:&lt;/p&gt; &lt;blockquote&gt; &lt;div style="color: black; background-color: white"&gt;&lt;pre&gt;&lt;span style="color: blue"&gt;try&lt;/span&gt;
{
	Tamar.LearnToWalk();
	Tamar.LearnToProgram();
	Tamar.Debug();
}
&lt;span style="color: blue"&gt;catch&lt;/span&gt;(PoopException)
{
	Tamar.Change(DiaperMode.Clean);
}
&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;She passed, but decided to take a nap instead of the job.&lt;/p&gt;</description><link>https://ayende.com/blog/172897/nepotism-in-the-interview-process?Key=b9ac609d-5a68-477d-9896-c146fd2e97b4</link><guid>https://ayende.com/blog/172897/nepotism-in-the-interview-process?Key=b9ac609d-5a68-477d-9896-c146fd2e97b4</guid><pubDate>Fri, 22 Jan 2016 10:00:00 GMT</pubDate></item><item><title>Technical observations from my wife: Production issues</title><description>&lt;p&gt;So I was telling my wife about &lt;a href="http://ayende.com/blog/172449/production-postmortem-the-case-of-the-it-is-slow-on-that-machine-only?key=a9ede5fb00884ef180f0284fb2c590d1"&gt;this issue&lt;/a&gt;, and she had two interesting comments.&lt;/p&gt;
&lt;p&gt;When I told her that the customer was complaining about performance, she stopped me to figure out what I meant by that. When I told her that they had to wait for 20 minutes, her response was:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Oh, I thought you were talking about 1/16 of a millisecond here again. Well, if it is 20 minutes, why make a fuss about it? They should go have a cup of coffee or something.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The second observation was when I told her that we narrowed things down to suggestions taking up a lot of a CPU:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Oh, so you told them to go and &lt;a href="http://ayende.com/blog/172002/technical-observations-from-my-wife-disk-speeds"&gt;buy some more RPM&lt;/a&gt;, right?&lt;/p&gt;
&lt;/blockquote&gt;</description><link>https://ayende.com/blog/172481/technical-observations-from-my-wife-production-issues?Key=91e2bcd0-d6cf-47df-8e03-696f0dee9fa4</link><guid>https://ayende.com/blog/172481/technical-observations-from-my-wife-production-issues?Key=91e2bcd0-d6cf-47df-8e03-696f0dee9fa4</guid><pubDate>Fri, 13 Nov 2015 14:17:00 GMT</pubDate></item><item><title>Technical observations from my wife: Disk speeds</title><description>&lt;p&gt;My wife complained that her laptop was running slow. We had a discussion that went something like this:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Me: Okay, I think I know what is going on, this laptop has a HD with 5,400 RPM.&lt;/li&gt; &lt;li&gt;Wife: …&lt;/li&gt; &lt;li&gt;Me:&amp;nbsp; …&lt;/li&gt; &lt;li&gt;Wife: …&lt;/li&gt; &lt;li&gt;Me: Okay, RPM is how fast the drive spins. The faster it spin, the faster it is. This is 5,400 RPM drive, and usually you want 7,200 RPM drive.&lt;/li&gt; &lt;li&gt;Wife: So go to the store and buy me another 2,000 RPM.&lt;/li&gt;&lt;/ul&gt;</description><link>https://ayende.com/blog/172002/technical-observations-from-my-wife-disk-speeds?Key=0a379a8b-31a1-48d1-a6b4-e156583261c4</link><guid>https://ayende.com/blog/172002/technical-observations-from-my-wife-disk-speeds?Key=0a379a8b-31a1-48d1-a6b4-e156583261c4</guid><pubDate>Tue, 15 Sep 2015 09:00:00 GMT</pubDate></item><item><title>Technical observations from my wife: Performance</title><description>&lt;p&gt;I was telling my wife about my day at work, and the conversation went something like that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Me: So we spent all day trying to optimize this really expensive query.&lt;/li&gt;
&lt;li&gt;Wife: What made it so expensive?&lt;/li&gt;
&lt;li&gt;Me: We weren&amp;rsquo;t sure, but it run for 300 &amp;ndash; 400 ms!&lt;/li&gt;
&lt;li&gt;Wife: You are so impatient.&lt;/li&gt;
&lt;/ul&gt;</description><link>https://ayende.com/blog/171873/technical-observations-from-my-wife-performance?Key=246a2d28-869a-4ec6-96a5-1d897f108dd3</link><guid>https://ayende.com/blog/171873/technical-observations-from-my-wife-performance?Key=246a2d28-869a-4ec6-96a5-1d897f108dd3</guid><pubDate>Thu, 27 Aug 2015 09:00:00 GMT</pubDate></item><item><title>Hibernating Rhinos: The Movie</title><description>&lt;p&gt;Well, it is finally here, it has been &lt;strong&gt;ten years&lt;/strong&gt; since I started blogging. My first blog was on April’s 1st 2004, and somehow, we are a decade later.&lt;/p&gt; &lt;p&gt;Usually it is time for introspective, and careful thought about what was and what will be, but I’m having no time for that. Instead, I wanted to let you know that we just finished signing with Lucas Film (well, it said Disney on the contract, but I’m a geek, so I’ll go with the more impressive title) for a movie about Hibernating Rhinos. The idea is basically similar to the Social Network, but much better.&lt;/p&gt; &lt;p&gt;I’m trying to see if I can get Jesse Eisenberg to play there.&lt;/p&gt; &lt;p&gt;And I got a budget for 999 ravens to be released in a flock at one of the scenes!&lt;/p&gt; &lt;p&gt;We’ll show a trailer for the movie (purely computer generated, so far) at our &lt;a href="http://conference.ravendb.net"&gt;Conference in a week.&lt;/a&gt;&lt;/p&gt;</description><link>https://ayende.com/blog/166210/hibernating-rhinos-the-movie?Key=e0a6281a-8432-425a-8cbd-f7948da48609</link><guid>https://ayende.com/blog/166210/hibernating-rhinos-the-movie?Key=e0a6281a-8432-425a-8cbd-f7948da48609</guid><pubDate>Tue, 01 Apr 2014 06:50:00 GMT</pubDate></item><item><title>Google has a sense of humor</title><description>&lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Google-has-a-sense-of-humor_FAAE/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Google-has-a-sense-of-humor_FAAE/image_thumb.png" width="453" height="136"&gt;&lt;/a&gt;&lt;/p&gt;</description><link>https://ayende.com/blog/164321/google-has-a-sense-of-humor?Key=b7e849c6-302f-411b-b099-efc0f3a8573c</link><guid>https://ayende.com/blog/164321/google-has-a-sense-of-humor?Key=b7e849c6-302f-411b-b099-efc0f3a8573c</guid><pubDate>Mon, 11 Nov 2013 10:00:00 GMT</pubDate></item><item><title>Your services will not be needed, thank you</title><description>&lt;p&gt;I am not sure what to think about this, to be perfectly honest. But it is &lt;em&gt;quite&lt;/em&gt; funny.&lt;/p&gt; &lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Your-services-will-not-be-needed-thank-y_EA20/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Your-services-will-not-be-needed-thank-y_EA20/image_thumb.png" width="1044" height="327"&gt;&lt;/a&gt;&lt;/p&gt;</description><link>https://ayende.com/blog/162689/your-services-will-not-be-needed-thank-you?Key=382a5d75-1510-43a0-9cb0-b49b803afa92</link><guid>https://ayende.com/blog/162689/your-services-will-not-be-needed-thank-you?Key=382a5d75-1510-43a0-9cb0-b49b803afa92</guid><pubDate>Mon, 01 Jul 2013 09:00:00 GMT</pubDate></item><item><title>Questions that stumps me</title><description>&lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Questions-that-stumps-me_E58E/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Questions-that-stumps-me_E58E/image_thumb.png" width="734" height="148"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;My response?&lt;/p&gt; &lt;p&gt;&lt;font size="72"&gt;&lt;a href="http://en.wikipedia.org/wiki/Mu_(negative)"&gt;無&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;</description><link>https://ayende.com/blog/158273/questions-that-stumps-me?Key=dcead584-b8e4-4aa8-b02d-438bfcc67829</link><guid>https://ayende.com/blog/158273/questions-that-stumps-me?Key=dcead584-b8e4-4aa8-b02d-438bfcc67829</guid><pubDate>Fri, 14 Sep 2012 09:00:00 GMT</pubDate></item></channel></rss>