<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><title>Ken Egozi: action=post</title><link rel="alternate" type="text/html" href="http://www.kenegozi.com/blog/" /><updated>2009-06-25T16:05:33.00Z</updated><id>http://www.kenegozi.com/blog</id><author><name>Ken Egozi</name></author><link rel="self" href="http://feeds.feedburner.com/kenegozi" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry><title type="html"><![CDATA[A very nice Unit Testing 101 presentation]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/T9Kzy4eh8o4/a-very-nice-unit-testing-101-presentation.aspx" /><id>http://www.kenegozi.com/blog/2009/06/25/a-very-nice-unit-testing-101-presentation.aspx</id><published>2009-06-25T16:05:33.00Z</published><updated>2009-06-25T16:05:33.00Z</updated><category term="testing" label="Testing" scheme="http://www.kenegozi.com/blog/Tag/testing.aspx" /><content type="html">&lt;p&gt;At &lt;a href="http://webservices20.blogspot.com/"&gt;Yaron Nave’s blog&lt;/a&gt;, which is an excellent reading for all things WCF.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;grab it at: &lt;a href="http://webservices20.blogspot.com/2009/06/unit-tests-presentation.html"&gt;http://webservices20.blogspot.com/2009/06/unit-tests-presentation.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/A14D0E9C89F103E99338A291AC280981B7785CAC"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/A14D0E9C89F103E99338A291AC280981B7785CAC"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=T9Kzy4eh8o4:9xUXn2-4WwM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=T9Kzy4eh8o4:9xUXn2-4WwM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=T9Kzy4eh8o4:9xUXn2-4WwM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=T9Kzy4eh8o4:9xUXn2-4WwM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=T9Kzy4eh8o4:9xUXn2-4WwM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=T9Kzy4eh8o4:9xUXn2-4WwM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/T9Kzy4eh8o4" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/06/25/a-very-nice-unit-testing-101-presentation.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[Accessing a specific revision of SVN repository through the browser]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/Dh1cBc_Z8SQ/accessing-a-specific-revision-of-svn-repository-through-the-browser.aspx" /><id>http://www.kenegozi.com/blog/2009/06/22/accessing-a-specific-revision-of-svn-repository-through-the-browser.aspx</id><published>2009-06-22T13:06:20.00Z</published><updated>2009-06-22T13:06:20.00Z</updated><category term="tools" label="tools" scheme="http://www.kenegozi.com/blog/Tag/tools.aspx" /><category term="scm" label="Source Control" scheme="http://www.kenegozi.com/blog/Tag/scm.aspx" /><content type="html">&lt;p&gt;Just throw ‘!svn/bc/REVISION_NUMBER/’ to the url, right after the repository root&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;thx &lt;a href="http://www.gooli.org/blog"&gt;gooli&lt;/a&gt; for the &lt;a href="http://www.gooli.org/blog/accessing-svn-revision-via-a-browser/"&gt;superb tip&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/954F28F1628B84C3061CE025E1B5F9EFB35AC457"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/954F28F1628B84C3061CE025E1B5F9EFB35AC457"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Dh1cBc_Z8SQ:eTdfrD0Ifj8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Dh1cBc_Z8SQ:eTdfrD0Ifj8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=Dh1cBc_Z8SQ:eTdfrD0Ifj8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Dh1cBc_Z8SQ:eTdfrD0Ifj8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=Dh1cBc_Z8SQ:eTdfrD0Ifj8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Dh1cBc_Z8SQ:eTdfrD0Ifj8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/Dh1cBc_Z8SQ" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/06/22/accessing-a-specific-revision-of-svn-repository-through-the-browser.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[VS WTF &ndash; two fonts in the text editor]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/mKbv44A_X44/vs-wtf-ndash-two-fonts-in-the-text-editor.aspx" /><id>http://www.kenegozi.com/blog/2009/06/15/vs-wtf-ndash-two-fonts-in-the-text-editor.aspx</id><published>2009-06-15T11:37:46.00Z</published><updated>2009-06-15T11:37:46.00Z</updated><category term="visual-studio" label="visual studio" scheme="http://www.kenegozi.com/blog/Tag/visual-studio.aspx" /><content type="html">&lt;p&gt;weird:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.kenegozi.com/blog/Content/Binary/WindowsLiveWriter/VSWTFtwofontsinthetexteditor_A46B/0bd8e0c0-0ba7-45ba-b2c1-aca460eb825f.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VS_wtf_two_fonts" border="0" alt="VS_wtf_two_fonts" src="http://www.kenegozi.com/blog/Content/Binary/WindowsLiveWriter/VSWTFtwofontsinthetexteditor_A46B/ad285863-13a6-4a7a-a980-f1f3ae75f10c.png" width="244" height="32" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/134406A8E5C66A13D56894D23FDC721DCFC3E59A"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/134406A8E5C66A13D56894D23FDC721DCFC3E59A"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=mKbv44A_X44:JUZa4VjXg-g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=mKbv44A_X44:JUZa4VjXg-g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=mKbv44A_X44:JUZa4VjXg-g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=mKbv44A_X44:JUZa4VjXg-g:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=mKbv44A_X44:JUZa4VjXg-g:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=mKbv44A_X44:JUZa4VjXg-g:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/mKbv44A_X44" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/06/15/vs-wtf-ndash-two-fonts-in-the-text-editor.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[Monorail Release - Status update and call for help]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/ZJZQFAjpjKo/monorail-release-status-update-and-call-for-help.aspx" /><id>http://www.kenegozi.com/blog/2009/06/09/monorail-release-status-update-and-call-for-help.aspx</id><published>2009-06-09T18:22:46.00Z</published><updated>2009-06-09T18:22:46.00Z</updated><category term="castle" label="castle" scheme="http://www.kenegozi.com/blog/Tag/castle.aspx" /><category term="monorail" label="monorail" scheme="http://www.kenegozi.com/blog/Tag/monorail.aspx" /><category term="aspview" label="aspview" scheme="http://www.kenegozi.com/blog/Tag/aspview.aspx" /><content type="html">&lt;p&gt;I want to release MonoRail as soon as I can.   &lt;br /&gt;In order to do so I will need some help from the community. Let me list the things currently missing:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Visual Studio wizards - for creating a new project with one of the main view-engines, with or without WindsorExtension enabled.&lt;/li&gt;    &lt;li&gt;Visual Studio templates - for a Controller, a ViewComponent, and view templates for the various view engines (the template should include informative comments).&lt;/li&gt;    &lt;li&gt;Programmatic configuration. I've added IAspViewConfigurationEvents, and having the same for Brail and NV would be great. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Any help with the above will be greatly appreciated.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;thx,&lt;/p&gt;  &lt;p&gt;Ken.&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/2D4D41D93B4D9F78CA76D90380BB521AF31BBC5A"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/2D4D41D93B4D9F78CA76D90380BB521AF31BBC5A"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=ZJZQFAjpjKo:5O7BhSpwdxU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=ZJZQFAjpjKo:5O7BhSpwdxU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=ZJZQFAjpjKo:5O7BhSpwdxU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=ZJZQFAjpjKo:5O7BhSpwdxU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=ZJZQFAjpjKo:5O7BhSpwdxU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=ZJZQFAjpjKo:5O7BhSpwdxU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/ZJZQFAjpjKo" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/06/09/monorail-release-status-update-and-call-for-help.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[MySql won&rsquo;t start &ndash; Error 1067]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/hmrugknqekA/mysql-wonrsquot-start-ndash-error-1067.aspx" /><id>http://www.kenegozi.com/blog/2009/05/26/mysql-wonrsquot-start-ndash-error-1067.aspx</id><published>2009-05-26T04:03:15.00Z</published><updated>2009-05-26T04:03:15.00Z</updated><category term="tools" label="tools" scheme="http://www.kenegozi.com/blog/Tag/tools.aspx" /><content type="html">&lt;p&gt;We’re using MySql at work, and for that I installed 5.1 on my workstation (Windows 7 RC x64), with all the defaults (next, next, next, …, finish)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Being environmentally friendly (or mentally instable – depends on who you’re asking), I tend to shut down my workstation when I go home at the end of every day.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So – today, when first navigating to a url served by my local working copy, I was greeted with a SystemException telling me that MySql is not responding.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My first reaction was WTF&lt;/p&gt;  &lt;p&gt;My following reaction was&lt;/p&gt;  &lt;p&gt;Win-R   &lt;br /&gt;cmd    &lt;br /&gt;net start mysql&lt;/p&gt;  &lt;p&gt;Surprisingly enough, instead of the laconic OK, I was greeted with:&lt;/p&gt;  &lt;p&gt;The MySQL service could not be started. &lt;/p&gt;  &lt;p&gt;A system error has occurred. &lt;/p&gt;  &lt;p&gt;System error 1067 has occurred.&lt;/p&gt;  &lt;p&gt;My next reaction was back to WTF.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Goggling around I found no meaningful answer, so I went for uninstall/reinstall. &lt;/p&gt;  &lt;p&gt;So, Win+MySql (to look for an uninstaller in the Start Menu, lazy me) I stumbled upon “MySQL Server Instance Config Wizard”&lt;/p&gt;  &lt;p&gt;This dude apparently can re-do the Instance Configuration thing, and running it (again with the next, …, next, finish ritual) appear to have fixed the problem.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;After all I do have something nice to say about MySql.&amp;#160; when weird shit happen, there is a tool to make instance re-install rather painless.&lt;/p&gt;  &lt;p&gt;All the rest about it is crap.&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/05232496C2AAC5E14FA8EE70F7B52EA251D32D6B"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/05232496C2AAC5E14FA8EE70F7B52EA251D32D6B"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=hmrugknqekA:E-pfiOpurfU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=hmrugknqekA:E-pfiOpurfU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=hmrugknqekA:E-pfiOpurfU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=hmrugknqekA:E-pfiOpurfU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=hmrugknqekA:E-pfiOpurfU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=hmrugknqekA:E-pfiOpurfU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/hmrugknqekA" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/05/26/mysql-wonrsquot-start-ndash-error-1067.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[System.DateTime.Date, or why a code review is definitely a good thing]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/Z7YYhQbKZTk/system-dot-datetime-dot-date-or-why-a-code-review-is-definitely-a-good-thing.aspx" /><id>http://www.kenegozi.com/blog/2009/05/03/system-dot-datetime-dot-date-or-why-a-code-review-is-definitely-a-good-thing.aspx</id><published>2009-05-03T08:39:30.00Z</published><updated>2009-05-03T08:39:30.00Z</updated><category term="c-sharp" label="c#" scheme="http://www.kenegozi.com/blog/Tag/c-sharp.aspx" /><content type="html">&lt;p&gt;So today a new dev has joined the team. Not too soon after he got his hands on one of our solutions I got an IM from him with the following snippet:&lt;/p&gt;  &lt;pre&gt;public static DateTime GetDateOnly(this DateTime dateTime)
{
   return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day);
}&lt;/pre&gt;

&lt;p&gt;My code. My blame.&lt;/p&gt;

&lt;p&gt;It apparently skipped the &lt;a href="http://msdn.microsoft.com/en-us/library/system.datetime.date.aspx"&gt;DateTime.Date&lt;/a&gt; property of System.DateTime. After over 5 years in C# world.&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/099A223B11A64757A795953F28121C7A546E052E"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/099A223B11A64757A795953F28121C7A546E052E"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Z7YYhQbKZTk:9DfgFK26a6Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Z7YYhQbKZTk:9DfgFK26a6Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=Z7YYhQbKZTk:9DfgFK26a6Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Z7YYhQbKZTk:9DfgFK26a6Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=Z7YYhQbKZTk:9DfgFK26a6Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=Z7YYhQbKZTk:9DfgFK26a6Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/Z7YYhQbKZTk" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/05/03/system-dot-datetime-dot-date-or-why-a-code-review-is-definitely-a-good-thing.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[Javascript and the extended Array prototype]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/-NlckoWbvV0/javascript-and-the-extended-array-prototype.aspx" /><id>http://www.kenegozi.com/blog/2009/04/13/javascript-and-the-extended-array-prototype.aspx</id><published>2009-04-13T14:27:35.00Z</published><updated>2009-04-13T14:27:35.00Z</updated><category term="client-side" label="client-side" scheme="http://www.kenegozi.com/blog/Tag/client-side.aspx" /><category term="javascript" label="Javascript" scheme="http://www.kenegozi.com/blog/Tag/javascript.aspx" /><content type="html">&lt;p&gt;I do quite a bit of javascript stuff lately, and I wanted to enjoy the easier syntax of array methods such as forEach, find etc.&lt;/p&gt;  &lt;p&gt;As the current project is not using prototype.js, but rather a different js stack (jquery, various jquery plugins, EJS, and a bit more) I did not have the extended Array stuff that comes with prototype.js&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;But before I ran off to add the needed methods to Array’s prototype, I had an annoying voice in the back of my head, whispering “extending Array’s prototype is evil, extending Array’s prototype is evil”, so I looked at alternatives.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h6&gt;Alternative 1 – subclassing Array.&lt;/h6&gt;  &lt;p&gt;I went ahead to implement a MyArray (or Array2) type of solution.&lt;/p&gt;  &lt;p&gt;using one method of JS subclassing I thought of&lt;/p&gt;  &lt;pre&gt;&lt;p&gt;var MyArray = function() {
};

MyArray.prototype = new Array;

MyArray.prototype.forEach = function(action) {
  for (var i = 0, l=this.length; i &amp;lt; l, ++i)
    action(this[i]);
};
...&lt;/p&gt;&lt;/pre&gt;

&lt;p&gt;the problem with that approach is that IE does not like Array subclassing, thus the .length property becomes unreliable, rendering the whole idea of subclassing Array useless.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h6&gt;Alternative 2 – using a different object alltogether&lt;/h6&gt;

&lt;p&gt;It would work, however things like &lt;/p&gt;

&lt;pre&gt;if (anArrayInstance instanceof Array)&lt;/pre&gt;

&lt;p&gt;will naturally break.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h6&gt;Alternative 3 – extend any ‘interesting’ instances&lt;/h6&gt;

&lt;pre&gt;function extendArray(arr) {
    if (arr.__wasExtended) return;
    arr.forEach = function(action) {
      for (var i = 0, l=this.length; i &amp;lt; l, ++i)
        action(this[i]);
    };
    arr.__wasExtended = true;
}&lt;/pre&gt;

&lt;p&gt;which is wrong as any instance will get a copy of all the functions, so too much memory will be used for non-core functionality&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h6&gt;Alternative 4 – use the separated scoped Array trick&lt;/h6&gt;

&lt;p&gt;just read &lt;a title="http://dean.edwards.name/weblog/2006/11/hooray/" href="http://dean.edwards.name/weblog/2006/11/hooray/"&gt;http://dean.edwards.name/weblog/2006/11/hooray/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the idea is to use an Array object from a separate iframe, thus enjoy the Array (instanceof), but not interfere with existing Array object on the main window&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;On top of all that. all three alternatives are problematic, as a regular&lt;/p&gt;

&lt;pre&gt;var a = [];&lt;/pre&gt;

&lt;p&gt;will not be extended. which is not such a big problem if you're disciplined enough, but it's terribly annoying to need to extend every array you want. think about JSON data you get from a service. you'd first have to iterate over the object graph and extend all of the arrays. yuck.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Now, do you remember that annoying voice from the back of my head? I decided to stand up to him !&lt;/p&gt;

&lt;p&gt;Why actually not extend the Array prototype and be done with it?&lt;/p&gt;

&lt;p&gt;It will solve the “instanceof” problem, it will solve the need to apply the functions manually on all arrays (as any [] will natively have the new functions), and it wouldn’t cost much memory as it will only be added to the single prototype of all array instances.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The usual reason for not wanting to do so, is that it would break the associative array ‘feature’ of javascript, and you won’t be able to&lt;/p&gt;

&lt;p&gt;for (var i in myArray)&lt;/p&gt;

&lt;p&gt;anymore.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;You know what? that reason is a total bullshit.&lt;/p&gt;

&lt;p&gt;Why? cuz there’s not such thing as an associative array in javascript !&lt;/p&gt;

&lt;p&gt;If anything, the Object object is similar enough. However the Array object should be used with 0-based integer index, just like any native java/c#/c/whatever array.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Removing that ‘problem’ from the equation, and we can resort back to stuff like&lt;/p&gt;

&lt;pre&gt;Array.prototype.numSort = function() {
    this.sort(function(a, b) { return a - b; });
    return this;
};
Array.prototype.forEach = function(action, index) {
    for (var i = 0, l = this.length; i &amp;lt; l; ++i)
        action(this[i], index);
};
Array.prototype.find = function(func) {
	for (var i = 0, l = this.length; i &amp;lt; l; ++i) {
		var item = this[i];
		if (func(item))
			return item;
	}
	return null;
};
Array.prototype.where = function(func) {
	var found = [];
	for (var i = 0, l = this.length; i &amp;lt; l; ++i) {
		var item = this[i];
		if (func(item))
			found.push(item);
	}
	return found;
};&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;You just have to *love* dynamic languages :)&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/7CA19BD0E41C83A1AFA880C3CB68B6CA3007E69E"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/7CA19BD0E41C83A1AFA880C3CB68B6CA3007E69E"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=-NlckoWbvV0:mG7OQOJXGV4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=-NlckoWbvV0:mG7OQOJXGV4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=-NlckoWbvV0:mG7OQOJXGV4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=-NlckoWbvV0:mG7OQOJXGV4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=-NlckoWbvV0:mG7OQOJXGV4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=-NlckoWbvV0:mG7OQOJXGV4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/-NlckoWbvV0" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/04/13/javascript-and-the-extended-array-prototype.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[Quick scripting &ndash; Boo to the rescue]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/6pLfKHixRUw/quick-scripting-ndash-boo-to-the-rescue.aspx" /><id>http://www.kenegozi.com/blog/2009/04/09/quick-scripting-ndash-boo-to-the-rescue.aspx</id><published>2009-04-09T16:05:05.00Z</published><updated>2009-04-09T16:05:05.00Z</updated><category term="open-source-software" label="open-source-software" scheme="http://www.kenegozi.com/blog/Tag/open-source-software.aspx" /><content type="html">&lt;p&gt;Today I needed to run a SQL script that sat in a 1.4Gb text file.&lt;/p&gt;  &lt;p&gt;It includes the schema creation, plus a massive amount of INSERTs, all for a project I need to complete in order to get my Bachelour’s degree from uni. The amount of data is due to the fact the it’s an Advanced DB seminar, and I’m demo-ing DB related stuff, so size matter.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Anyway, the script was lacking the “use DBNAME” at it’s top. and since the file was too large to open up in the Management Studio, I wanted to OSQL it. I just needed a way to add the “use” statement at it’s top.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Quick and dirty boo script to the rescue (add.boo):&lt;/p&gt;  &lt;pre&gt;import System.IO
import System.Text

r = StreamReader('openu.sql')
w = StreamWriter('new_unicode.sql', false, Encoding.Unicode)
w.WriteLine('use openuni')
l = r.ReadLine()
while (l != null):
	w.WriteLine(l)
	l = r.ReadLine()
w.Flush()
w.Dispose()&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Running it with&lt;/p&gt;

&lt;pre&gt;booi add.boo&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And executing with&lt;/p&gt;

&lt;pre&gt;OSQL -E -i new_unicode.sql&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Who needs powershell ...? &lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/86B341334794ECD927D7A44C88E1EB30AB893087"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/86B341334794ECD927D7A44C88E1EB30AB893087"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=6pLfKHixRUw:_6FW2BxkoLw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=6pLfKHixRUw:_6FW2BxkoLw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=6pLfKHixRUw:_6FW2BxkoLw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=6pLfKHixRUw:_6FW2BxkoLw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=6pLfKHixRUw:_6FW2BxkoLw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=6pLfKHixRUw:_6FW2BxkoLw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/6pLfKHixRUw" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/04/09/quick-scripting-ndash-boo-to-the-rescue.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[Programmer Competency Matrix]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/SiteRjL5wKI/programmer-competency-matrix.aspx" /><id>http://www.kenegozi.com/blog/2009/04/07/programmer-competency-matrix.aspx</id><published>2009-04-07T03:36:36.00Z</published><updated>2009-04-07T03:36:36.00Z</updated><category term="miscellanea" label="miscellanea" scheme="http://www.kenegozi.com/blog/Tag/miscellanea.aspx" /><content type="html">&lt;p&gt;I just got an email from a friend (thx Zeev) which simply contained a single URL:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm" href="http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm"&gt;http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Couldn’t come at a better time for me. We’re in the process of hiring new extraordinary people here at SHC Israel, and this matrix helps formalizing the things we want our candidates to know. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;so, if you believe you’re a &lt;code&gt;log(n)&lt;/code&gt; on quite a few of the fields, then please ping me&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/0CE5A8B6012947B16E80D3644443DCE8FCFE06E7"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/0CE5A8B6012947B16E80D3644443DCE8FCFE06E7"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=SiteRjL5wKI:QuGLNp182bQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=SiteRjL5wKI:QuGLNp182bQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=SiteRjL5wKI:QuGLNp182bQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=SiteRjL5wKI:QuGLNp182bQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=SiteRjL5wKI:QuGLNp182bQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=SiteRjL5wKI:QuGLNp182bQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/SiteRjL5wKI" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/04/07/programmer-competency-matrix.aspx</feedburner:origLink></entry><entry><title type="html"><![CDATA[I wish that it was an April fool&rsquo;s thing]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/kenegozi/~3/v4eRVpVbzDI/i-wish-that-it-was-an-april-foolrsquos-thing.aspx" /><id>http://www.kenegozi.com/blog/2009/04/05/i-wish-that-it-was-an-april-foolrsquos-thing.aspx</id><published>2009-04-05T06:26:30.00Z</published><updated>2009-04-05T06:26:30.00Z</updated><content type="html">&lt;p&gt;Last week I got a promotion on my Email. The title said:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Write 10,000 lines of code in 10 minutes&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Any why the heck is that a *good* thing?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I would however buy a product that can *eliminate* 10,000 LOC in 10 minutes&lt;/p&gt;&lt;p&gt;&lt;a target="_blank" href="http://theloungenet.com/feeds/redirect/DOTNETRSS/EGOZI/E23B1A192143359704928D872139F4C2A65CFF56"&gt;&lt;img src="http://theloungenet.com/feeds/img/DOTNETRSS/EGOZI/E23B1A192143359704928D872139F4C2A65CFF56"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=v4eRVpVbzDI:wOf6kKoUaSY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=v4eRVpVbzDI:wOf6kKoUaSY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=v4eRVpVbzDI:wOf6kKoUaSY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=v4eRVpVbzDI:wOf6kKoUaSY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?i=v4eRVpVbzDI:wOf6kKoUaSY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/kenegozi?a=v4eRVpVbzDI:wOf6kKoUaSY:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/kenegozi?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/kenegozi/~4/v4eRVpVbzDI" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.kenegozi.com/blog/2009/04/05/i-wish-that-it-was-an-april-foolrsquos-thing.aspx</feedburner:origLink></entry></feed>
