<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>gigpeppersgigpeppers</title>
	
	<link>http://www.gigpeppers.com</link>
	<description />
	<lastBuildDate>Tue, 16 Apr 2013 15:57:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Gigpeppers" /><feedburner:info uri="gigpeppers" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Gigpeppers</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>The little things I learned from the valley – April 2013 edition</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/0u0I_4BjQ2g/</link>
		<comments>http://www.gigpeppers.com/the-little-things-i-learned-from-the-valley-april-2013-edition/#comments</comments>
		<pubDate>Thu, 04 Apr 2013 03:27:47 +0000</pubDate>
		<dc:creator>Cherian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/?p=216</guid>
		<description><![CDATA[<p>Second trip to the valley in 8 months and here’s what I learnt: Startup employees don’t make as much cash as I thought it would be. And that shouldn’t be the persp­ective. An exit or acquisition does not mean happiness. You have to enjoy the journey. I spent time with a founder with a ‘successful’ [...]</p><p>The post <a href="http://www.gigpeppers.com/the-little-things-i-learned-from-the-valley-april-2013-edition/">The little things I learned from the valley – April 2013 edition</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Second trip to the valley in 8 months and here’s what I learnt:</p>
<ul>
<li>Startup employees don’t make as much cash as I thought it would be. And that shouldn’t be the persp­ective.</li>
<li>An exit or acquisition does not mean happiness. You have to enjoy the journey. I spent time with a founder with a ‘successful’ exit and he wasn’t as happy as I thought he’d be.</li>
<li>Most companies are ‘sold’ and not ‘bought’.</li>
<li>Aquihires are starting to become a non-prestige term.</li>
<li>Many try to exit the scene with big bank balances. Much like the Hollywood and California gold rush.</li>
<li>People are obsessed with failing fast.</li>
<li>Ultra local services like <a href="https://www.uber.com/" target="_blank">Uber</a>, <a href="http://www.lyft.me/" target="_blank">Lyft</a>, <a href="https://www.instacart.com/store" target="_blank">Instacart</a>, <a href="http://www.zerocater.com/" target="_blank">Ze<wbr />roCater</a>, <a href="https://www.chewse.com/" target="_blank">Chewse</a>, etc. are raising more cash than <i>world domination</i> disruptive ideas.</li>
<li>Series A crunch is REAL. But Angel investing continues. Contrary to<a href="http://blog.samaltman.com/upside-risk" target="_blank"> Sam Altman’s upside risk</a>, I met a person doing $ 5000*200. And that makes everyone an Angel investor. JOBS act will help.</li>
<li>Palo Alto/University Ave is no more the place to be. You have to be in San Franciso. Caltrain/BART rides are perceived too long.</li>
<li>South Bay is getting more expensive. Rentals at $2500 for 2 bedrooms in Mountain View and Palo Alto. East PA and Fremont continue to be cheap.</li>
<li>HYPE is now a subject of discussion. <a href="http://www.mailboxapp.com/" target="_blank">MailBox</a> as an example.</li>
</ul>
<p>Do not look at this with judgmental eyes. These are only observances.</p>
<p>The post <a href="http://www.gigpeppers.com/the-little-things-i-learned-from-the-valley-april-2013-edition/">The little things I learned from the valley – April 2013 edition</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=0u0I_4BjQ2g:LLyXk-SQEyw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/0u0I_4BjQ2g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/the-little-things-i-learned-from-the-valley-april-2013-edition/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/the-little-things-i-learned-from-the-valley-april-2013-edition/</feedburner:origLink></item>
		<item>
		<title>My images are all upside down!</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/g314XLwtbNA/</link>
		<comments>http://www.gigpeppers.com/my-images-are-all-upside-down/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 04:45:17 +0000</pubDate>
		<dc:creator>Cherian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/?p=164</guid>
		<description><![CDATA[<p>Surprises are not new to Cucumbertown. Sometimes they come in the form of spice boxes and sometimes they come in as KitchenAid artisan pro’s. This to me is the best part of building a company. The serendipitous hit of the most unlikely scenarios adding up as experiences and owning up to them. Nothing beats this. [...]</p><p>The post <a href="http://www.gigpeppers.com/my-images-are-all-upside-down/">My images are all upside down!</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Surprises are not new to Cucumbertown. Sometimes they come in the form of <a href="http://instagram.com/p/KdJLQnM2wk/">spice boxes</a> and sometimes they come in as <a href="http://instagram.com/p/KxhxhiM2x9/">KitchenAid artisan pro’s</a>.</p>
<p>This to me is the best part of building a company. The serendipitous hit of the most unlikely scenarios adding up as experiences and owning up to them. Nothing beats this.</p>
<p>Last Friday evening was rather amusing.</p>
<p>Two new Cucumbertown users <a href="http://www.cucumbertown.com/recipes/55756/texmex-sour-cream-chicken-enchiladas-with-tomatillos">Courtney</a> &amp; <a href="http://www.cucumbertown.com/recipes/55753/thai-green-shrimp-curry">Samantha</a> pinged us and complained their recipes images were upside down.We probed. The images were indeed upside down.</p>
<p><img title="Thai Green Shrimp Curry | Cucumbertown.png" alt="Thai Green Shrimp Curry Cucumbertown My images are all upside down!" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/Thai-Green-Shrimp-Curry-Cucumbertown.png" width="509" height="452" border="0" /></p>
<p>What was more surprising was that the users said the images looked fine on their laptops.<br />
I pinged <a href="http://www.cucumbertown.com/recipes/55756/texmex-sour-cream-chicken-enchiladas-with-tomatillos">Courtney</a> &amp; <a href="http://www.cucumbertown.com/recipes/55753/thai-green-shrimp-curry">Samantha</a> to send us the original images.</p>
<p><img title="TexMex! Sour Cream Chicken Enchiladas with Tomatillos | Cucumbertown-1.png" alt="TexMex Sour Cream Chicken Enchiladas with Tomatillos Cucumbertown 11 My images are all upside down!" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/TexMex-Sour-Cream-Chicken-Enchiladas-with-Tomatillos-Cucumbertown-11.png" width="512" height="444" border="0" /></p>
<p>Arun inspected it and took a look at the exif data. Both of them came from iPhones.</p>
<p><img title="Droplr • Screenshot on 12.16.2012 at 4.58.47 PM.png.png" alt="Droplr • Screenshot on 12.16.2012 at 4.58.47 PM.png My images are all upside down!" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/Droplr-•-Screenshot-on-12.16.2012-at-4.58.47-PM.png.png" width="376" height="513" border="0" /></p>
<p>A quick google search and <a href="http://reviews.cnet.com/8301-19512_7-57382911-233/why-does-my-iphone-take-upside-down-photos/">cnet had the answer</a>.</p>
<p>tl;dr version:<br />
<em>“Before iOS 5, the only way to snap a photo with your iPhone was to tap the onscreen shutter button&#8211;always a somewhat awkward maneuver. But with iOS 5, Apple transformed the volume-up button into a shutter release, thereby making iPhone photography feel a bit more natural.<br />
Just one problem: when you flip your phone around so the volume-up button is facing, well, up, you end up with upside-down photos and videos.”</em></p>
<p>There goes!</p>
<p>With a bit of inspection we saw hope. Iphone was preserving the orientation in the Exif data. This is good news. At least we can take a shot at attempting to rotate.</p>
<p><a href="http://www.cucumbertown.com/">Cucumbertown</a> is a Python shop and we use the <a href="http://www.pythonware.com/products/pil/">PIL library</a> to do image manipulation.</p>
<p>Investigating more and as usual somebody has already tried to figure out a solution on <a href="http://stackoverflow.com/questions/4228530/pil-thumbnail-is-rotating-my-image">stackoverflow</a>.<br />
<script type="text/javascript" src="https://gist.github.com/4325581.js"></script><br />
 Pretty simple and the solution went out in the next 10 mins.<br />
<script type="text/javascript" src="https://gist.github.com/4325597.js"></script><br />
Except for a minor bug <img src='http://www.gigpeppers.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile My images are all upside down!" class='wp-smiley' title="My images are all upside down!" />  We forgot that images could uploaded be without exif data. There goes the fix and to production.<br />
<script type="text/javascript" src="https://gist.github.com/4325601.js"></script><br />
Its pretty interesting how a minor change in technology can have a tremendous impact on something that relies on it.</p>
<p><em>Code Credits: </em><a href="http://www.cucumbertown.com/users/47/arun-prabhakar/">Arun</a></p>
<p>The post <a href="http://www.gigpeppers.com/my-images-are-all-upside-down/">My images are all upside down!</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=g314XLwtbNA:U2MwtH4vuC0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/g314XLwtbNA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/my-images-are-all-upside-down/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/my-images-are-all-upside-down/</feedburner:origLink></item>
		<item>
		<title>Page speed really does matter</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/o_FDeRdN3U0/</link>
		<comments>http://www.gigpeppers.com/page-speed-really-does-matter-2/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 11:37:52 +0000</pubDate>
		<dc:creator>Cherian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/?p=199</guid>
		<description><![CDATA[<p>At Cucumbertown we use different strategies to ensure page loads in 2 second range. At the most under 3 seconds. And we are fanatical about this. Naturally we have quite a few alerts if it hits upper thresholds of 3 seconds plus. Couple of days before Chris Zacharias wrote about how page weight matters and [...]</p><p>The post <a href="http://www.gigpeppers.com/page-speed-really-does-matter-2/">Page speed really does matter</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>At <a href="http://www.cucumbertown.com/">Cucumbertown</a> we use different strategies to ensure page loads in 2 second range. At the most under 3 seconds. And we are fanatical about this.</p>
<p>Naturally we have quite a few alerts if it hits upper thresholds of 3 seconds plus.</p>
<p>Couple of days before <a href="http://blog.chriszacharias.com/page-weight-matters">Chris Zacharias wrote about how page weight matters</a> and how YouTube dealt with this. So when a mails pop up in your inbox with this alert from Google Analytics with over 20 seconds in page load, you stop everything to find what’s happening.</p>
<p><img title="Page speed 20 sec alert.png" alt="Page speed 20 sec alert1 Page speed really does matter" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/Page-speed-20-sec-alert1.png" width="600" height="257" border="0" /></p>
<p>Usually a delay in page load is often picked up immediately after a production push mostly by random testing or from our highly engaged users. But this didn’t happen and the alert came a day later.</p>
<p>That freaks you out. Unknown problems for which you haven’t yet figured out root cause IMO is greater danger than a big bug where you know the issue.</p>
<p>We started probing and that’s when we saw results like this.</p>
<p><img title="Site Speed Page Timings - Google Analytics.png" alt="Site Speed Page Timings Google Analytics Page speed really does matter" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/Site-Speed-Page-Timings-Google-Analytics.png" width="600" height="298" border="0" /></p>
<p>And of course Google Analytics was averaging the time and the average was skewing the results.</p>
<p>Correlating this with other results and the jig saw started fell into place. Cucumbertown was picked up by a food channel in Nigeria and a prominent blogger in Thailand and this was bringing in the crowds. But the page load in these countries as you can see is ridiculously low.</p>
<p>Cucumbertown is an asset heavy website and there is a significant cost associated in loading the basic scripts even thought we delay everything through <a href="http://requirejs.org/">requireJS</a> and dynamically load JavaScript based on need. Even the basic DOM load is taking time.</p>
<p>Corroborate this with the load time in the US at 2.5 seconds, the <a href="http://www.smartplanet.com/blog/thinking-tech/what-the-fccs-new-metrics-tell-us-about-us-broadband/12395">speed of light and latency at 43ms for DSL devices</a> across the globe and it&#8217;s time to start thinking about CDN&#8217;ing assets.</p>
<p>At Zynga we had initially relied on Akamai but later switched to LimeLight and they look like a prime candidate to rely on.</p>
<p>But the recent activity by <a href="https://www.cloudflare.com/">CloudFlare</a> on HackerNews and the umbrella features they offer seemed tempting to explore. And I took a dip in the water to test CloudFlare.</p>
<p>Right now this blog is served via CloudFlare off a free plan that includes CDNing the assets. The experience is good when there is a rush of requests but if the site is not accessed consistently then it seems like the <em>cache gets evicted</em>. The page load is worse when there is a first time hit after inactivity. But then the follow up requests page loads at <strong><em>1.5-2 seconds</em></strong>.</p>
<p><img title="gigpeppers |-1.png" alt="gigpeppers 1 Page speed really does matter" src="http://www.gigpeppers.com/wp-content/uploads/2012/12/gigpeppers-1.png" width="247" height="282" border="0" /></p>
<p>I have always thought of CDN&#8217;s as an enterprisy expensive word. But here we are; a startup serving the globe and this solution looks imperative.</p>
<p>Do you have any advice? How’s your experience been?</p>
<p>The post <a href="http://www.gigpeppers.com/page-speed-really-does-matter-2/">Page speed really does matter</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=o_FDeRdN3U0:DXmZlMJknic:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/o_FDeRdN3U0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/page-speed-really-does-matter-2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/page-speed-really-does-matter-2/</feedburner:origLink></item>
		<item>
		<title>Post mortem of a failed HackerNews launch</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/puNnOR7X5Hk/</link>
		<comments>http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/#comments</comments>
		<pubDate>Wed, 28 Nov 2012 14:06:11 +0000</pubDate>
		<dc:creator>Cherian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gigpeppers.com/?p=122</guid>
		<description><![CDATA[<p>Right after our TC press post we were onto showcasing Cucumbertown to the HN community and taking feedback. Things were looking fine for sometime until Murphy decided to play spoilsport and we hit ocean bottom when we showed up on the front page. 1 hour on the HN homepage and we were out. Pretty saddening [...]</p><p>The post <a href="http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/">Post mortem of a failed HackerNews launch</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Right after our <a href="http://techcrunch.com/2012/10/17/cucumber-seed-and-launch/">TC press post</a> we were onto showcasing <a href="http://cucumbertown.com/">Cucumbertown</a> to the HN community and taking feedback. Things were looking fine for sometime until Murphy decided to play spoilsport and we hit ocean bottom when we showed up on the front page.<br />
1 hour on the HN homepage and we were out.<br />
Pretty saddening experience. And it got me all the more pissed off for:</p>
<ul>
<li>The community was showing positive emotions, constructive criticism. HN community&#8217;s remarks and constructive criticism are pearls of wisdom.</li>
<li>I did performance engineering at Zynga for a while. This shouldn’t have happened.</li>
</ul>
<p>It’s somewhat interesting to understand what happened underneath and how we went on to fix it.<br />
Here’s how the drama unfolded.<br />
At about 8:30 AM PST <a href="http://news.ycombinator.com/item?id=4669676">I posted the news to HN</a> and waited for someone to up vote. A bump and since it was a “Show HN”, it started moving fast and pretty soon was on its way to the front page.</p>
<p>The connections started increasing and things looked pretty good.</p>
<p><img  title="CucumberTown | Datadog-1.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/CucumberTown-Datadog-1.png" alt="CucumberTown Datadog 1 Post mortem of a failed HackerNews launch" width="476" height="196" border="0" /></p>
<p>The traffic coming in brought with it people who loved food &amp; had so much positive emotions.<br />
Love was in the air.</p>
<p><img  title="Select ct user to change | Cucumbertown.com Backyard.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/Select-ct-user-to-change-Cucumbertown.com-Backyard1.png" alt="Select ct user to change Cucumbertown.com Backyard1 Post mortem of a failed HackerNews launch" width="386" height="171" border="0" /></p>
<p>Juggling between the intense stream of answering mails from new members &amp; questions on HN I found myself singing Backstreet Boys for an hour…</p>
<p>Until one of our <a href="http://trey.cucumbertown.com/">users Trey</a> and an HN user shot me an IM.</p>
<p><img  title="Chat with Trey Hunner - cherian.in@gmail.com - Gmail.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/Chat-with-Trey-Hunner-cherian.in@gmail.com-Gmail1.png" alt="Chat with Trey Hunner cherian.in@gmail.com Gmail1 Post mortem of a failed HackerNews launch" width="444" height="89" border="0" /></p>
<p>We started probing the graphs and it looked like the world was coming to an end.</p>
<p>User United857 struck the nail in the coffin with this message and we were officially down by 11:30 PM IST. It was 404 hell.</p>
<p><img  title="Show HN_ Fork recipes on the _Github for food_ | Hacker News.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/Show-HN_-Fork-recipes-on-the-_Github-for-food_-Hacker-News.png" alt="Show HN  Fork recipes on the  Github for food  Hacker News Post mortem of a failed HackerNews launch" width="600" height="81" border="0" /><br />
The worst part, ssh did not work anymore. All we could wait was to get the terminal buffers to allow us to type a character at a time.<br />
Eventually we got the monit alerts.<br />
Continuous 404’s ensured we went out of the front page and pretty soon down the drain.</p>
<p><img  title="CucumberTown | Datadog-4.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/CucumberTown-Datadog-4.png" alt="CucumberTown Datadog 4 Post mortem of a failed HackerNews launch" width="465" height="194" border="0" /><br />
Even though HN traffic is not our direct market, posting on HN, taking feedback and learning has always been my dream. And it was…<br />
Without considering that we were pretty down &amp; drained already and that it’s nearly 1 AM in Bangalore we decided to get to the root of this.</p>
<p><strong>What became of this investigation is a lesson in carelessness. One I hope I’ll remember for sometime. </strong><br />
So back to the train of events…<br />
Once the domino effect started all we could do was to wait and watch httpd &amp; java processes fail via monit mails.<br />
I’ll save the detailed investigation (its too verbose) and go directly to inference.<br />
Digging through the trails later we saw that<br />
<em>Free memory had decreased, IO wait increased drastically &amp; immediately after that Solr hung. Apache piled the requests and stopped responding. This led Nginx to return 404’s. This continued for 20-30 minutes as a black box.<br />
</em>Eventually Solr crashed releasing some memory. This helped us restart the services. But the damage was done by then.<br />
Digging through logs one by one and eventually in dmesg the culprit showed up<br />
<img  title="cucumbertown — cherian@prod_~ — tmux — 179×50-1.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/cucumbertown-—-cherian@prod_-—-tmux-—-179×50-1.png" alt="cucumbertown — cherian@prod  — tmux — 179×50 1 Post mortem of a failed HackerNews launch" width="593" height="110" border="0" /><br />
So the root cause analysis narrowed down to two points. Why did free memory come down so low and why did IOWait go up so high.<br />
Luckily for us everything was graphed and soon enough we saw that people came in directly and started searching heavily. Solr usage went very high and it started evicting. We did not anticipate this. Pretty bad!<br />
To make matters worse the high usage with memory consumption sent the OS to swap. Even then this should have been handled. The dmesg OOM led us to the details and that’s when we realized Linode offers only a max of 512 MB swap by default. We had gone with it and since memory + swap overflowed pretty quickly the system was OOMing.</p>
<p>Lessons:</p>
<ul>
<li>Mockup high traffic scenarios &amp; test (Although its unlikely it would have hit us to test search so much)</li>
<li>Run Solr separately from your web nodes. It’s an all, in memory process (We are a lean startup and sometimes running process together is a call we have to take. Making it all separate machines is too costly)</li>
<li>Run sufficient swap.</li>
</ul>
<p>But between failures we noticed a pattern that shouldn’t have happened.<br />
Apache requests were in sync with Nginx.</p>
<p><img  title="CucumberTown | Datadog-5.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/CucumberTown-Datadog-5.png" alt="CucumberTown Datadog 5 Post mortem of a failed HackerNews launch" width="600" height="109" border="0" /><br />
Cucumbertown is a site that’s heavily cached. Anonymous requests are all http cached at the load balancer level &amp; only the logged in ones hit the backend web.</p>
<p>Digging further and we started seeing this (<em>below</em>). For every Nginx hit there is equivalent apache hit. But this was only for the homepage.</p>
<p><img  title="cucumbertown — cherian@prod_~ — tmux — 179×50.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/cucumbertown-—-cherian@prod_-—-tmux-—-179×501.png" alt="cucumbertown — cherian@prod  — tmux — 179×501 Post mortem of a failed HackerNews launch" width="600" height="72" border="0" /><br />
Since the homepage is query heavy this had a heavy impact on the underlying infrastructure. In fact you could very well conclude that the homepage hits were the reason we went down (<em>The explore items that you see on homepage – they are all in fact a manifestation of Solr searches</em>)</p>
<p><img  title="Cucumbertown-1.png" src="http://www.gigpeppers.com/wp-content/uploads/2012/11/Cucumbertown-1.png" alt="Cucumbertown 1 Post mortem of a failed HackerNews launch" width="600" height="174" border="0" /><br />
This was surprising. We had our pages cached as follows.</p>
<pre>location = / {
 proxy_pass http://localhost:82;
 proxy_cache cache;
 proxy_cache_key $cache_key; 
 proxy_cache_valid 200 302 2m;
 proxy_cache_use_stale updating;
 }</pre>
<pre></pre>
<p>Things should have been fine. The <a href="http://www.cucumbertown.com/recipes/55528/salad-nicoise-without-fish">show recipe pages</a> were.<br />
A curl request exposed the blunder.</p>
<pre>Cherian-Mac: cherianthomas$ curl -I http://www.cucumbertown.com/
HTTP/1.1 200 OK
Server: ngx_openresty
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
Vary: Cookie
Set-Cookie: csrftoken=Dl4mvy4Rky7sfZwqek27hFrCXzWCi9As; expires=Fri, 18-Oct-2013 02:15:32
 GMT; Max-Age=31449600; Path=/
X-Cache-Status: EXPIRED</pre>
<pre></pre>
<p>I’ll leave it to the reader why X-Cache-Status always returned expired.</p>
<p>And now if you are like us running a machine with very little swap, create a secondary one with sufficient space and a lower priority. This will decrease your chances for OOM drastically.<br />
Here’s how to do it.</p>
<pre>cd /
sudo dd if=/dev/zero of=swapfile bs=1024 count=2097152 
sudo mkswap swapfile
</pre>
<p><em>Change count accordingly</em><br />
Add this to the line lower than the swap file line in /etc/fstab</p>
<pre>
/swapfile swap swap defaults 0 0
sudo swapon -a 
swapon -s</pre>
<p>Additionally add the following two lines to your <strong><em>/etc/sysctl.conf</em></strong></p>
<pre>vm.panic_on_oom=1 kernel.panic=15 
vm.panic_on_oom=1 line enables panic on OOM;</pre>
<p>The kernel.panic=15 line tells the kernel to reboot fifteen seconds after panicking.<br />
In the worst-case scenario you can reboot than be hung for a longer duration</p>
<p>Graphs courtesy <a href="http://www.datadoghq.com/">DataDog</a>.</p>
<p>The post <a href="http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/">Post mortem of a failed HackerNews launch</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=puNnOR7X5Hk:TLDybSt1DD0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/puNnOR7X5Hk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/post-mortem-of-a-failed-hackernews-launch/</feedburner:origLink></item>
		<item>
		<title>Barcamp Flash Tech Talk</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/tW144fWNk08/</link>
		<comments>http://www.gigpeppers.com/barcamp-flash-tech-talk/#comments</comments>
		<pubDate>Sun, 11 Nov 2012 11:10:38 +0000</pubDate>
		<dc:creator>Cherian</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gigpeppers.com/?p=86</guid>
		<description><![CDATA[<p>Details of my Flash Tech Talk at Barcamp Bangalore &#8217;12</p><p>The post <a href="http://www.gigpeppers.com/barcamp-flash-tech-talk/">Barcamp Flash Tech Talk</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Details of my Flash Tech Talk at Barcamp Bangalore &#8217;12</p>
<p><iframe style="border: none;" src="http://www.slideshare.net/cherianthomas1/slideshelf" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="615px" height="470px"></iframe></p>
<p>The post <a href="http://www.gigpeppers.com/barcamp-flash-tech-talk/">Barcamp Flash Tech Talk</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=tW144fWNk08:HuxfHyzl9fQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/tW144fWNk08" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/barcamp-flash-tech-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/barcamp-flash-tech-talk/</feedburner:origLink></item>
		<item>
		<title>Integrating NCover 1.5 with Nant builds</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/S6Z6-b_dO2o/</link>
		<comments>http://www.gigpeppers.com/integrating-ncover-15-with-nant-builds/#comments</comments>
		<pubDate>Fri, 01 May 2009 15:35:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[nant]]></category>
		<category><![CDATA[Ncover]]></category>
		<category><![CDATA[nunit]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/blog/?p=38</guid>
		<description><![CDATA[<p>Getting NCover to work with nant builds was more messy than I assumed. What&#8217;s more appalling about all this is that programmers new to NCover download it from the default NCover landing page, only to find that its a paid version(3)(version 1.5 is sufficient for most use cases and serves most of the purposes.) Another [...]</p><p>The post <a href="http://www.gigpeppers.com/integrating-ncover-15-with-nant-builds/">Integrating NCover 1.5 with Nant builds</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Getting <a href="http://www.ncover.com/" target="_blank">NCover</a> to work with nant builds was more messy than I assumed. What&#8217;s more appalling about all this is that programmers new to NCover download it from the default NCover landing page, only to find that its a paid version(3)(version 1.5 is sufficient for most use cases and serves most of the purposes.)</p>
<p>Another concern was that most of the the ncover tutorials on the web showed how to test a single unit test assembly even though ncover comes with a <a href="http://www.kiwidude.com/dotnet/doc/NCoverExplorer.NAntTasks/tasks/nunitproject.html" target="_blank">nunitproject</a> nant task to pick out multiple test files(which is the highway case).</p>
<p>Without much further ado, here’s what I did</p>
<p>Download version <a href="http://jabr.googlecode.com/files/NCover-1.5.8.zip" target="_blank">1.5.8 of NCover</a>, v <a href="http://www.kiwidude.com/dotnet/NCoverExplorer-1.4.0.7.zip" target="_blank">1.4 of NCover Explorer</a> and v <a title="NCover Extras" href="http://www.kiwidude.com/dotnet/NCoverExplorer.Extras-1.4.0.5.zip" target="_blank">1.4 of NCover Extras</a></p>
<p>NCover Extras encapsulates the functionalities provided by NCover as a set of nant tasks. This needs to be loaded.Also CoverLib.dll that comes with NCover needs to be registered.</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">&lt;loadtasks assembly=<span style="color: #006080;">"${ncover.nant.task.dir}NCoverExplorer.NAntTasks.dll"</span>/&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">&lt;exec program=<span style="color: #006080;">"regsvr32"</span> workingdir=<span style="color: #006080;">"${ncover.dir}"</span> commandline=<span style="color: #006080;">"/s coverlib.dll"</span>/&gt;</pre>
</div>
</div>
<p>Add these lines before the target is called.</p>
<p>Now for the actual task…</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 98.32%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; height: 295px; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">&lt;target name=<span style="color: #006080;">"coverage"</span>&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  &lt;nunitproject project=<span style="color: #006080;">"${output.dir}tests.nunit"</span>&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    &lt;fileset basedir=<span style="color: #006080;">"${output.dir}"</span>&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        &lt;include name=<span style="color: #006080;">"*.*Test*.dll"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">      &lt;/fileset&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  &lt;/nunitproject&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  &lt;ncover</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    program=<span style="color: #006080;">"${ncover.dir}NCover.Console.exe"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    commandLineExe=<span style="color: #006080;">"${nunitconsoleexe.dir}nunit-console-x86.exe"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    logLevel=<span style="color: #006080;">"Verbose"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    commandLineArgs=<span style="color: #006080;">"${output.dir}tests.nunit /nodots /nologo"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    verbose=<span style="color: #006080;">"true"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    logFile=<span style="color: #006080;">"${coverage.reports.dir}/coverage.log"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    workingDirectory=<span style="color: #006080;">"${output.dir}"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    coverageFile=<span style="color: #006080;">"${coverage.reports.dir}Unit.Test.Coverage.xml"</span>&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    &lt;assemblies basedir=<span style="color: #006080;">"${output.dir}"</span>&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      &lt;include name=<span style="color: #006080;">"CompanyName*.dll"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">      &lt;exclude name=<span style="color: #006080;">"*.*Test*.dll"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    &lt;/assemblies&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">  &lt;/ncover&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">  &lt;ncoverexplorer</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    program=<span style="color: #006080;">"${ncoverexplorer.dir}NCoverExplorer.Console.exe"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    projectName=<span style="color: #006080;">"ProjectName"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    reportType=<span style="color: #006080;">"ModuleClassFunctionSummary"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    outputDir=<span style="color: #006080;">"${coverage.reports.dir}"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    xmlReportName=<span style="color: #006080;">"TestCoverage.xml"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    sort=<span style="color: #006080;">"FunctionCoverageDescending"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    htmlReportName=<span style="color: #006080;">"TestCoverage.html"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    showExcluded=<span style="color: #006080;">"True"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    minimumCoverage=<span style="color: #006080;">"80"</span></pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    satisfactoryCoverage=<span style="color: #006080;">"80"</span> &gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    &lt;fileset&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">      &lt;include name=<span style="color: #006080;">"${coverage.reports.dir}Unit.Test.Coverage.xml"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    &lt;/fileset&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">    &lt;exclusions&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      &lt;exclusion type=<span style="color: #006080;">"Assembly"</span> pattern=<span style="color: #006080;">"*.Tests"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">      &lt;exclusion type=<span style="color: #006080;">"Namespace"</span> pattern=<span style="color: #006080;">"*.Tests*"</span> /&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    &lt;/exclusions&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white; border-style: none; padding: 0px;">  &lt;/ncoverexplorer&gt;</pre>
<p> </p>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">&lt;/target&gt;</pre>
</div>
</div>
<p>The node with the nunitproject picks all the test dll’s from the output directory and builds a tests.nunit project file. This will be the input to <a href="http://www.nunit.org/index.php" target="_blank">Nunit</a> which NCover will profile.</p>
<p>Digging into the NCover node you’ll see how NCover is being instructed to take pick the assemblies. If you are copying the code verbatim then change the assemblies node to pick your project dll’s and avoid test dll’s(By convention test assemblies are named ProjectName.Tests.dll). The output of this profiling task will be an xml file(Unit.Test.Coverage.xml in this case) which will be the input to NCoverExplorer, to get those fancy html outputs.</p>
<p>Here’s a typical NCover output xml..</p>
<p><a href="http://assets.gigpeppers.com/IntegratingNcover1.5withNantbuilds_DE21/image.png"><img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="image" src="http://assets.gigpeppers.com/IntegratingNcover1.5withNantbuilds_DE21/image_thumb.png" alt="image thumb Integrating NCover 1.5 with Nant builds" width="644" height="191" align="left" border="0" /></a></p>
<p>The next node ncoverexplorer takes the xml files and builds a html output. Something similar to what&#8217;s shown below. Additionally the attribute <a href="http://www.kiwidude.com/dotnet/doc/NCoverExplorer.NAntTasks/tasks/ncoverexplorer.html" target="_blank">failMinimum</a>(not shown in this case) will fail the build if coverage doesn&#8217;t meet the coverage percentage specified.</p>
<p>Here’s a sample output.</p>
<p><a href="http://assets.gigpeppers.com/IntegratingNcover1.5withNantbuilds_DE21/image_3.png"><img style="display: inline; border-width: 0px;" title="image" src="http://assets.gigpeppers.com/IntegratingNcover1.5withNantbuilds_DE21/image_thumb_3.png" alt="image thumb 3 Integrating NCover 1.5 with Nant builds" width="644" height="183" border="0" /></a></p>
<p>One little quirk I encountered here was using nunit-console.exe instead of nunit-console-x86.exe. My 64 bit Server 2008 build machine rejected the first executable outright since it ran as 64 bit.</p>
<p>What pissed me of in this exercise was the time it took to integrate a seemingly simple open source project. Pretty much the same experience I had dealing with DD-WRT firmware sources. Once the author/company decides to to release a higher version of the project as a paid version or to make money out of the project, they then obfuscate source paths or put in obstacles that deter consumers from downloading those open source versions.</p>
<p>In case of the DD-WRT the source <a href="http://blog.motiwala.com/2008/05/29/tomato-is-in-goodbye-dd-wrt" target="_blank">was hidden inside GB’s of data</a> and in this case the official NCover website removed all the forums and added nag screens asking users to signup(given below) before downloading..</p>
<p><a href="http://www.ncover.com/login" target="_blank"><img class="alignleft" style="display: block; margin-left: auto; margin-right: auto; border-width: 0pt;" title="image" src="http://assets.gigpeppers.com/IntegratingNcover1.5withNantbuilds_DE21/image_4.png" alt="image 4 Integrating NCover 1.5 with Nant builds" width="244" height="143" border="0" /></a></p>
<p>The post <a href="http://www.gigpeppers.com/integrating-ncover-15-with-nant-builds/">Integrating NCover 1.5 with Nant builds</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=S6Z6-b_dO2o:40-4URna2Ck:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/S6Z6-b_dO2o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/integrating-ncover-15-with-nant-builds/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/integrating-ncover-15-with-nant-builds/</feedburner:origLink></item>
		<item>
		<title>Targeted Ad’s</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/dpXfdCPSoLM/</link>
		<comments>http://www.gigpeppers.com/targeted-ads/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 04:57:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/blog/?p=31</guid>
		<description><![CDATA[<p>Google sure knows the guys who read Slashdot!</p><p>The post <a href="http://www.gigpeppers.com/targeted-ads/">Targeted Ad’s</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Google sure knows the guys who read Slashdot!</p>
<p><a href="http://assets.gigpeppers.com/TargetedAds_E5B/Slashdotad1.jpg"><img style="display: inline; border: 0px;" title="Slashdotad1" src="http://assets.gigpeppers.com/TargetedAds_E5B/Slashdotad1_thumb.jpg" alt="Slashdotad1 thumb Targeted Ad’s" width="499" height="398" border="0" /></a></p>
<div class="wlWriterHeaderFooter" style="text-align: right; margin: 0px; padding: 4px 0px 4px 0px;"></div>
<p>The post <a href="http://www.gigpeppers.com/targeted-ads/">Targeted Ad’s</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=dpXfdCPSoLM:v2aIvt92FPs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/dpXfdCPSoLM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/targeted-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/targeted-ads/</feedburner:origLink></item>
		<item>
		<title>Migrating to WordPress</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/WDPXozn7pgQ/</link>
		<comments>http://www.gigpeppers.com/migrating-to-wordpress/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 04:50:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/blog/?p=13</guid>
		<description><![CDATA[<p>You can’t expect me to write blogengine plugins for Disqus, super cache, cl forms, Akismet etc. Its way too much work from my focus area. Being a lot of guys who understand technology terms like scripting and html I chose to do a source control install rather than those “one click installs”. Primary reason for [...]</p><p>The post <a href="http://www.gigpeppers.com/migrating-to-wordpress/">Migrating to WordPress</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<div class="zemanta-img"><a href="http://commons.wikipedia.org/wiki/Image:Paris_servers_DSC00190.jpg"><img class="alignleft" title="An example of server" src="http://upload.wikimedia.org/wikipedia/commons/thumb/0/04/Paris_servers_DSC00190.jpg/202px-Paris_servers_DSC00190.jpg" alt="202px Paris servers DSC00190 Migrating to WordPress" width="202" height="152" align="left" /></a></div>
<p>You can’t expect me to write blogengine plugins for Disqus, super cache, cl forms, Akismet etc. Its way too much work from my focus area.</p>
<p>Being a lot of guys who understand technology terms like scripting and html I chose to do a source control install rather than those “one click installs”. Primary reason for this is that WordPress comes with a lot of security issues(they being the most popular) and upgrading through svn is a breeze.</p>
<p>Here’s how I did it.</p>
<p>Choose a good hosting provider. Mine’s DreamHost. They will give you ssh access apart from the usual ftp and cpanel stuff.</p>
<p>Create a folder in your root to host your blog (use software like <a title="Putty" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">putty</a> to get into your remote hosting machine).</p>
<p>Assuming that your hosting provider has svn installed (which most of them do), run svn co http://svn.automattic.com/wordpress/tags/2.6.1 . (last dot included). Then go through the <a href="http://codex.wordpress.org/Installing_WordPress" target="_blank">standard installation procedures</a>.</p>
<p>Next time you need to upgrade do a svn up (as always backup everything) and you are done.</p>
<p><strong>Update: </strong>This post has some missing sentences at the top.</p>
<div class="wlWriterHeaderFooter" style="text-align: right; margin: 0px; padding: 4px 0px 4px 0px;"></div>
<p>The post <a href="http://www.gigpeppers.com/migrating-to-wordpress/">Migrating to WordPress</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=WDPXozn7pgQ:5elYxwuKFT4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/WDPXozn7pgQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/migrating-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/migrating-to-wordpress/</feedburner:origLink></item>
		<item>
		<title>Buildings</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/2fF-qu3OPHA/</link>
		<comments>http://www.gigpeppers.com/buildings/#comments</comments>
		<pubDate>Sun, 17 Aug 2008 07:10:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/blog/2008/08/17/buildings/</guid>
		<description><![CDATA[<p>buildings Originally uploaded by alainlm A picture like this can take you a long way..</p><p>The post <a href="http://www.gigpeppers.com/buildings/">Buildings</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><a title="photo sharing" href="http://www.flickr.com/photos/alainlm/2769510069/"><img style="border: solid 2px #000000;" src="http://farm4.static.flickr.com/3048/2769510069_29e4d7037e_m.jpg" alt="2769510069 29e4d7037e m Buildings"  title="Buildings" /></a></p>
<p><span style="font-size: 0.9em; margin-top: 0px;"> <a href="http://www.flickr.com/photos/alainlm/2769510069/">buildings</a></span></p>
<p>Originally uploaded by <a href="http://www.flickr.com/people/alainlm/">alainlm</a></p>
<p>A picture like this can take you a long way..</p>
<p>The post <a href="http://www.gigpeppers.com/buildings/">Buildings</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=2fF-qu3OPHA:cILSwiao9Ow:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/2fF-qu3OPHA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/buildings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/buildings/</feedburner:origLink></item>
		<item>
		<title>Enum with attributes</title>
		<link>http://feedproxy.google.com/~r/Gigpeppers/~3/_gKKJIx9K1c/</link>
		<comments>http://www.gigpeppers.com/enum-attributes/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 19:08:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.gigpeppers.com/blog/?p=3</guid>
		<description><![CDATA[<p>Recently I came across an implementation where enum is converted to string and vice versa (http://blogs.msdn.com/tims/archive/2004/04/02/106310.aspx ). The disadvantage here is that, say you want get the string for something like this “Not available”. enum Status { Not_Available, Available_For_Game, Available_For_Discussion } The string conversion here for the first one would yield Not_Available. This is not [...]</p><p>The post <a href="http://www.gigpeppers.com/enum-attributes/">Enum with attributes</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Recently I came across an implementation where enum is converted to string and vice versa (<a href="http://blogs.msdn.com/tims/archive/2004/04/02/106310.aspx">http://blogs.msdn.com/tims/archive/2004/04/02/106310.aspx</a> ). The disadvantage here is that, say you want get the string for something like this “Not available”.</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff;">enum</span> Status {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  Not_Available,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  Available_For_Game,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  Available_For_Discussion</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p>The string conversion here for the first one would yield Not_Available. This is not desirable in some cases where you don’t want the “_”. A better implementation would be to create attributes to this enum and then extract this.</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.75%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; height: 236px; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">enum</span> Status {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    [Status(Description = <span style="color: #006080;">"Not Available"</span>)]</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    Not_Available = 1,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    [Status(Description = <span style="color: #006080;">"Available For Game"</span>)]</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    Available_For_Game = 2,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    [Status(Description = <span style="color: #006080;">"Available For Discussion"</span>)]</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    Available_For_Discussion = 3,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> StatusEnumInfo {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">static</span> StatusAttribute[] edesc;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String GetDescription(<span style="color: #0000ff;">object</span> e)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      System.Reflection.FieldInfo f = e.GetType().GetField(e.ToString());</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">      StatusEnumInfo.edesc = f.GetCustomAttributes(<span style="color: #0000ff;">typeof</span>(StatusAttribute), <span style="color: #0000ff;">false</span>) <span style="color: #0000ff;">as</span> StatusAttribute[];</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      <span style="color: #0000ff;">if</span> (StatusEnumInfo.edesc != <span style="color: #0000ff;">null</span> &amp;&amp; StatusEnumInfo.edesc.Length == 1)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        <span style="color: #0000ff;">return</span> StatusEnumInfo.edesc[0].Description;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      <span style="color: #0000ff;">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        <span style="color: #0000ff;">return</span> String.Empty;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">object</span> GetEnumFromDesc(Type t, <span style="color: #0000ff;">string</span> desc)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">      Array x = Enum.GetValues(t);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      <span style="color: #0000ff;">foreach</span> (<span style="color: #0000ff;">object</span> o <span style="color: #0000ff;">in</span> x) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        <span style="color: #0000ff;">if</span> (GetDescription(o).Equals(desc)) {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">          <span style="color: #0000ff;">return</span> o;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      } <span style="color: #0000ff;">return</span> String.Empty;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> StatusAttribute : Attribute {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    <span style="color: #0000ff;">public</span> String Description { get; set; }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> Implemenation {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> Run()</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">      Status statusEnum = (Status)StatusEnumInfo.GetEnumFromDesc(<span style="color: #0000ff;">typeof</span>(Status), <span style="color: #006080;">"Not Available"</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">      String statusString = StatusEnumInfo.GetDescription(Status.Available_For_Discussion);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">  }</pre>
</div>
</div>
<p>You are of course free to generalize this. Correct me if this is not a correct implementation.</p>
<div class="wlWriterHeaderFooter" style="text-align: right; margin: 0px; padding: 4px 0px 4px 0px;"></div>
<p>The post <a href="http://www.gigpeppers.com/enum-attributes/">Enum with attributes</a> appeared first on <a href="http://www.gigpeppers.com">gigpeppers</a>.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Gigpeppers?a=_gKKJIx9K1c:yHL_q1LKvZc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Gigpeppers?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Gigpeppers/~4/_gKKJIx9K1c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gigpeppers.com/enum-attributes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.gigpeppers.com/enum-attributes/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.444 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-17 22:24:31 -->
