<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://hardcode.ro/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Hardcode</title><subtitle type="html">Making it happen</subtitle><id>http://hardcode.ro/atom.aspx</id><link rel="alternate" type="text/html" href="http://hardcode.ro/default.aspx" /><link rel="self" type="application/atom+xml" href="http://hardcode.ro/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61129.2">Community Server</generator><updated>2009-03-26T15:47:00Z</updated><entry><title>Windows 7 Old Right Click on Taskbar Windows</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2010/03/09/windows-7-old-right-click-on-taskbar-windows.aspx" /><id>http://hardcode.ro/archive/2010/03/09/windows-7-old-right-click-on-taskbar-windows.aspx</id><published>2010-03-09T08:33:00Z</published><updated>2010-03-09T08:33:00Z</updated><content type="html">&lt;p&gt;Do you sometimes need the old right click menu on a taskbar icon in Windows 7 ? The one with Restore, Move, Minimize, etc ? Here's what happens when you right click a taskbar item:&lt;/p&gt;&lt;p&gt;&lt;img src="http://hardcode.ro/photos/pics/images/9825/original.aspx" border="0"&gt;&lt;/p&gt;&lt;p&gt;Should you miss the old menu, press &lt;span style="font-weight:bold;"&gt;shift+right-click&lt;/span&gt;:&lt;/p&gt;&lt;p&gt;&lt;img src="http://hardcode.ro/photos/pics/images/9826/original.aspx" border="0"&gt;&lt;/p&gt;&lt;p&gt;If you have multiple windows open: &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://hardcode.ro/photos/pics/images/9828/original.aspx" border="0"&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9829" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Linq Select Indices of Top Ordered Elements</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2010/02/24/linq-select-indices-of-top-ordered-elements.aspx" /><id>http://hardcode.ro/archive/2010/02/24/linq-select-indices-of-top-ordered-elements.aspx</id><published>2010-02-24T13:13:00Z</published><updated>2010-02-24T13:13:00Z</updated><content type="html">&lt;p&gt;I've recently got over the second Select variant, so now I can do the following to find the top 3 elements:&lt;/p&gt;&lt;p&gt;double[] output = new double[] { 5,6,7,8,9 };&lt;br&gt;var indices = output.Select( (v,i) =&amp;gt; new { v = v, i = i}).OrderByDescending( p =&amp;gt; p.v).Take(3).Select( p =&amp;gt; p.i);&amp;nbsp; &lt;/p&gt;&lt;p&gt;Result: 4,3,2. Anyone has a better solution ?&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9824" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Free ASP.NET Profiler</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/11/03/free-asp-net-profiler.aspx" /><id>http://hardcode.ro/archive/2009/11/03/free-asp-net-profiler.aspx</id><published>2009-11-03T16:49:00Z</published><updated>2009-11-03T16:49:00Z</updated><content type="html">&lt;p&gt;At last a free and brilliant asp.net profiler, &lt;a href="http://www.eqatec.com/tools/profiler" target="_blank"&gt;here&lt;/a&gt;. Instructions for starting it &lt;a href="http://stackoverflow.com/questions/378617/profiling-asp-net-websites-with-eqatec-profiler" target="_blank"&gt;here&lt;/a&gt;. 10 minutes and I've already got a 100% increase in speed.&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9815" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>IKEA Prank</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/09/16/ikea-prank.aspx" /><id>http://hardcode.ro/archive/2009/09/16/ikea-prank.aspx</id><published>2009-09-16T15:14:00Z</published><updated>2009-09-16T15:14:00Z</updated><content type="html">&lt;p&gt;And btw check our latest prank in the IKEA store: &lt;a href="http://culturavura.fourhooks.com/cat54435/art6451142070/" target="_blank"&gt;http://culturavura.fourhooks.com/cat54435/art6451142070/&lt;/a&gt;. Pictures from &lt;a href="http://cocalari.com" target="_blank"&gt;http://cocalari.com&lt;/a&gt; and &lt;a href="http://pitzipoanca.org" target="_blank"&gt;http://pitzipoanca.org&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9812" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>CodeJam 2009</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/09/16/codejam-2009.aspx" /><id>http://hardcode.ro/archive/2009/09/16/codejam-2009.aspx</id><published>2009-09-16T15:05:00Z</published><updated>2009-09-16T15:05:00Z</updated><content type="html">&lt;p&gt;If you've participated be sure to check out the &lt;a href="http://www.go-hero.net/jam/09/languages/0" target="_blank"&gt;solutions&lt;/a&gt; written in some exotic programming languages like BrainFuck, SQL, Fortran and even PostScript ...&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9811" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>C# Initialize Dictionary</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/08/05/c-initialize-dictionary.aspx" /><id>http://hardcode.ro/archive/2009/08/05/c-initialize-dictionary.aspx</id><published>2009-08-05T12:40:00Z</published><updated>2009-08-05T12:40:00Z</updated><content type="html">&lt;p&gt;I've recently found the magic way to do it:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Dictionary&amp;lt;string,string&amp;gt;() { &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ "from_uid", "1" }, &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ "to_uid", "2"}, &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{ "ocurred", "1000" }&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;&lt;p&gt;The language feature for this is not the ability to do the following:&lt;/p&gt;&lt;p style="margin-left:40px;"&gt;&amp;nbsp;KeyValuePair&amp;lt;string,string&amp;gt; pair = { "a", "b"} &lt;br&gt;&lt;/p&gt;&lt;p&gt;and then have the list constructor enumerator feature that we already know: new List&amp;lt;int&amp;gt; () { 1,2,3 }, but rather a shortcut to Dictionary&amp;lt;string,string&amp;gt;.Add(string key, string value). More on this &lt;a href="http://blogs.msdn.com/madst/archive/2006/10/10/What-is-a-collection_3F00_.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9806" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Entity Framework Related Entities Queries</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/07/22/entity-framework-related-entities-queries.aspx" /><id>http://hardcode.ro/archive/2009/07/22/entity-framework-related-entities-queries.aspx</id><published>2009-07-22T09:35:00Z</published><updated>2009-07-22T09:35:00Z</updated><content type="html">&lt;p&gt;In Linq to SQL the following works by issuing a second query, in Linq to Entities it does not (and this sucks):&lt;/p&gt;&lt;p&gt;&amp;nbsp; Shortcut sh = db.Shortcuts.First();&lt;br&gt;&amp;nbsp; int count = sh.Redirects.Where( r =&amp;gt; r.ocurred &amp;lt; dt).Count();&lt;/p&gt;&lt;p&gt;You have to do the following instead:&lt;/p&gt;&lt;p&gt;&amp;nbsp; int count = db.Redirects.Where( r =&amp;gt; r.shortid == sh.id &amp;amp;&amp;amp; r.ocurred &amp;lt; dt).Count();&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9803" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Some quick stats</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/07/08/some-quick-stats.aspx" /><id>http://hardcode.ro/archive/2009/07/08/some-quick-stats.aspx</id><published>2009-07-08T07:59:00Z</published><updated>2009-07-08T07:59:00Z</updated><content type="html">... for &lt;a href="http://oracolulmeu.ro/" target="_blank"&gt;http://oracolulmeu.ro/&lt;/a&gt; for the last Monday: 1K visits and 42K pageviews (same day).&lt;br&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9801" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>S4H</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/07/08/s4h.aspx" /><id>http://hardcode.ro/archive/2009/07/08/s4h.aspx</id><published>2009-07-08T07:44:00Z</published><updated>2009-07-08T07:44:00Z</updated><content type="html">
&lt;p&gt;So now we have or own url-shortener service: &lt;a href="http://s4h.ro/" target="_blank"&gt;http://s4h.ro/&lt;/a&gt;. Give it a try !&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9800" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>The Holy Grail of Webdesign</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/06/22/the-holy-grail-of-webdesign.aspx" /><id>http://hardcode.ro/archive/2009/06/22/the-holy-grail-of-webdesign.aspx</id><published>2009-06-22T16:01:00Z</published><updated>2009-06-22T16:01:00Z</updated><content type="html">.... is almost live : &lt;a href="http://psdbreaker.com" target="_blank"&gt;http://psdbreaker.com&lt;/a&gt;.&lt;br&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9794" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/04/27/provider-sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx" /><id>http://hardcode.ro/archive/2009/04/27/provider-sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx</id><published>2009-04-27T00:36:00Z</published><updated>2009-04-27T00:36:00Z</updated><content type="html">&lt;p&gt;I recently got the dreadful error when starting the website, even if the database connection string was more than correct and it worked in sql management studio. If you've tried anything else without success of getting your website started, and you use SQL Server-backed session persistance, be sure to &lt;i&gt;also check for the sessionState connection string..&lt;/i&gt;.&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9789" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Nokia Friend View</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/04/21/nokia-friend-view.aspx" /><id>http://hardcode.ro/archive/2009/04/21/nokia-friend-view.aspx</id><published>2009-04-21T12:04:00Z</published><updated>2009-04-21T12:04:00Z</updated><content type="html">&lt;p&gt;Similar to &lt;a href="http://www.jaiku.com/" target="_blank"&gt;Jaiku&lt;/a&gt; and &lt;a href="http://www.google.com/latitude/intro.html" target="_blank"&gt;Google Latitude&lt;/a&gt;: &lt;a href="http://betalabs.nokia.com/betas/view/nokia-friend-view" target="_blank"&gt;Friend View&lt;/a&gt; from Nokia. &lt;i&gt;(thanks, &lt;a href="http://tase.ro/" target="_blank"&gt;Tase&lt;/a&gt;!)&lt;/i&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9788" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>John Carmack on iPhone Development</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/03/30/john-carmack-on-iphone-development.aspx" /><id>http://hardcode.ro/archive/2009/03/30/john-carmack-on-iphone-development.aspx</id><published>2009-03-30T16:40:00Z</published><updated>2009-03-30T16:40:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://www.idsoftware.com/wolfenstein3dclassic/" target="_blank"&gt;Wolfenstein 3D&lt;/a&gt; for iPhone is out, &lt;a href="http://www.idsoftware.com/wolfenstein3dclassic/wolfdevelopment.htm" target="_blank"&gt;here&lt;/a&gt; are John Carmack's comments. &lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9782" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Digi Cafe Awards</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/03/27/digi-cafe-awards.aspx" /><id>http://hardcode.ro/archive/2009/03/27/digi-cafe-awards.aspx</id><published>2009-03-27T09:25:00Z</published><updated>2009-03-27T09:25:00Z</updated><content type="html">&lt;p&gt;Yey both Coolio and Urbee won prizes at last night's &lt;a href="http://www.digicafe.ro/awards.html" target="_blank"&gt;Digi Cafe Awards&lt;/a&gt;, Urbee even won the big prize! &lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9781" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry><entry><title>Exceptions when DataBinding</title><link rel="alternate" type="text/html" href="http://hardcode.ro/archive/2009/03/26/exceptions-when-databinding.aspx" /><id>http://hardcode.ro/archive/2009/03/26/exceptions-when-databinding.aspx</id><published>2009-03-26T13:47:00Z</published><updated>2009-03-26T13:47:00Z</updated><content type="html">&lt;p&gt;A really annoying thing if you use the DataSourceID databinding is that you can't identify the control that throws the exception, the only thing that you get is an ID-less stacktrace and the debugger doesn't break at all ...&lt;br&gt;&lt;/p&gt;&lt;img src="http://hardcode.ro/aggbug.aspx?PostID=9780" width="1" height="1"&gt;</content><author><name>andrei</name><uri>http://hardcode.ro/members/andrei.aspx</uri></author></entry></feed>