<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>[ mkhairul.com ] &#187; blog</title>
	<atom:link href="http://mkhairul.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://mkhairul.com</link>
	<description>Musings of a web ninja</description>
	<lastBuildDate>Sun, 07 Mar 2010 13:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SVN (Version Control) and binary files</title>
		<link>http://mkhairul.com/2010/03/07/svn-version-control-and-binary-files/</link>
		<comments>http://mkhairul.com/2010/03/07/svn-version-control-and-binary-files/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 13:38:46 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1585</guid>
		<description><![CDATA[Does a version control eats a lot of space when using on binary files?  What I mean a lot is, for each changes, does it commit a new copy of the binary file and thus uses twice the amount of space?
No.
Taken from Subversion FAQ (How does Subversion handle binary files?) :

For storage and transmission [...]]]></description>
			<content:encoded><![CDATA[<p>Does a version control eats a lot of space when using on binary files?  What I mean a lot is, for each changes, does it commit a new copy of the binary file and thus uses twice the amount of space?</p>
<p>No.</p>
<p>Taken from Subversion FAQ (<a href="http://subversion.apache.org/faq.html#binary-files">How does Subversion handle binary files?</a>) :</p>
<blockquote><p>
For storage and transmission purposes, Subversion uses a diffing method that works equally well on binary and text files;
</p></blockquote>
<p>From what I <a href="http://svn.haxx.se/dev/archive-2003-01/2088.shtml">read</a>, it does <strong>reverse delta</strong> on the files being commit</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2010/03/07/svn-version-control-and-binary-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Predictable Design</title>
		<link>http://mkhairul.com/2010/02/28/predictable-design/</link>
		<comments>http://mkhairul.com/2010/02/28/predictable-design/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 18:22:13 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1572</guid>
		<description><![CDATA[A Quote from Predictable Design (UX Magazine)

For a design process to produce an extraordinary product, two conditions must be met: stakeholders and participants must unequivocally accept that they aren&#8217;t designers, and trust the real designers&#8217; abilities.

]]></description>
			<content:encoded><![CDATA[<p>A Quote from <a href="http://uxmag.com/strategy/predictable-design">Predictable Design</a> (<a href="http://uxmag.com">UX Magazine</a>)</p>
<blockquote><p>
For a design process to produce an extraordinary product, two conditions must be met: stakeholders and participants must unequivocally accept that they aren&#8217;t designers, and trust the real designers&#8217; abilities.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2010/02/28/predictable-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery context menu problem in chrome and IE</title>
		<link>http://mkhairul.com/2010/02/25/jquery-context-menu-problem-for-chrome-and-ie/</link>
		<comments>http://mkhairul.com/2010/02/25/jquery-context-menu-problem-for-chrome-and-ie/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 05:08:33 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1566</guid>
		<description><![CDATA[I was doing some image uploading with swfupload and added context menu to the pictures that were uploaded. I was told by a colleague (who helped me testing in other browsers) that the context menu is overlapped by the browser&#8217;s context menu (for those who don&#8217;t know what &#8216;context menu&#8217; is, its the menu when [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some image uploading with <a href="http://swfupload.org/">swfupload</a> and added context menu to the pictures that were uploaded. I was told by a colleague (who helped me testing in other browsers) that the context menu is overlapped by the browser&#8217;s context menu (for those who don&#8217;t know what &#8216;context menu&#8217; is, its the menu when you right click).</p>
<p>I&#8217;m using jquery&#8217;s <a href="http://plugins.jquery.com/project/jqueryContextMenu">contextmenu</a>. There&#8217;s a code needed to be changed. </p>
<p>Search for (which is probably at line 141)</p>
<pre class="brush: javascript" name="code">
$(el).add('UL.contextMenu').bind('contextmenu', function() { return false; });
</pre>
<p>Replace it with</p>
<pre class="brush: javascript" name="code">
$(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; });
</pre>
<p><strong>Reference</strong><br />
<a href="http://plugins.jquery.com/node/13085">jQuery Contextmenu DOESN&#8217;T WORK IN JQUERY 1.4 CHROME &#038; SAFARI</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2010/02/25/jquery-context-menu-problem-for-chrome-and-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Service Error 1067: The program terminated unexpectedly</title>
		<link>http://mkhairul.com/2010/02/17/mysql-service-error-1067-the-program-terminated-unexpectedly/</link>
		<comments>http://mkhairul.com/2010/02/17/mysql-service-error-1067-the-program-terminated-unexpectedly/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 19:25:38 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1559</guid>
		<description><![CDATA[I was bugged by this error for 30 minutes, wondering what the hell is it? No spaces in data dir path? Or no spaces in some other paths?
What is needed is just to set the bin directory in the windows path.

If that does not work, check this steps out, MySQL Error 1067.
]]></description>
			<content:encoded><![CDATA[<p>I was bugged by this error for 30 minutes, wondering what the hell is it? No spaces in data dir path? Or no spaces in some other paths?</p>
<p>What is needed is just to <strong>set the bin directory in the windows path</strong>.</p>
<p><a href="http://mkhairul.com/wp-content/uploads/2010/02/mysql_config.jpg"><img src="http://mkhairul.com/wp-content/uploads/2010/02/mysql_config.jpg" alt="" title="mysql_config" width="320" height="239" class="aligncenter size-full wp-image-1560" /></a></p>
<p>If that does not work, check this steps out, <a href="http://kathirvelmariappan.blogspot.com/2009/03/mysql-error-1067-process-terminated.html">MySQL Error 1067</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2010/02/17/mysql-service-error-1067-the-program-terminated-unexpectedly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pondering while reading</title>
		<link>http://mkhairul.com/2009/12/16/pondering-while-reading/</link>
		<comments>http://mkhairul.com/2009/12/16/pondering-while-reading/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 15:07:41 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1519</guid>
		<description><![CDATA[One of the few stuffs that I do while reading a book is to ponder at a sentence that makes a really good quote. Since I&#8217;m driving around now (less public transport), my speed to finish a book almost halted but I still bring a book everywhere I went to because you never know there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://mkhairul.com/wp-content/uploads/2009/12/ponder.png" alt="ponder" title="ponder" width="185" height="136" class="alignright size-full wp-image-1520" />One of the few stuffs that I do while reading a book is to ponder at a sentence that makes a really good quote. Since I&#8217;m driving around now (less public transport), my speed to finish a book almost halted but I still bring a book everywhere I went to because you never know there&#8217;s bound to be late appointments, clients, waiting for something, etc.</p>
<p>Pondering is what I do when I read before going to sleep, sometimes the pondering puts me to sleep, other times it gives me the urge to write something in my notebook or do some google search and more reading on the subject matter.</p>
<p>Anyway, its nice to ponder.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/12/16/pondering-while-reading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secret Sauce for Software Development</title>
		<link>http://mkhairul.com/2009/12/09/secret-sauce-for-software-development/</link>
		<comments>http://mkhairul.com/2009/12/09/secret-sauce-for-software-development/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 08:16:54 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1515</guid>
		<description><![CDATA[From kirk&#8217;s post, The Secret Sauce. Words of wisdom from Ralph Johnson..
The state of the practice in software development is pretty dismal. Some groups do a great job, but most do not.  As I tell the students in my software engineering course, if you manage requirements, make sure the developers talk to each other, [...]]]></description>
			<content:encoded><![CDATA[<p>From kirk&#8217;s post, <a href="http://techdistrict.kirkk.com/2009/12/08/the-secret-sauce/">The Secret Sauce</a>. Words of wisdom from Ralph Johnson..</p>
<blockquote><p>The state of the practice in software development is pretty dismal. Some groups do a great job, but most do not.  As I tell the students in my software engineering course, if you manage requirements, make sure the developers talk to each other, release working code regularly, have some sort of a systematic testing process, use build and version control tools, and periodically stop and see how you are doing and how you can improve, you will be better than 90% of the groups out there. Of course, I could be exaggerating.  Maybe it is only better than 75%.</p></blockquote>
<p>Sounds simple enough. The human factor makes it difficult.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/12/09/secret-sauce-for-software-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Guard Clause</title>
		<link>http://mkhairul.com/2009/11/25/using-guard-clause/</link>
		<comments>http://mkhairul.com/2009/11/25/using-guard-clause/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 16:09:05 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1498</guid>
		<description><![CDATA[Guard Clause, explained in Refactoring: Improving the Design of Existing Code (Chapter 9: Simplifying Conditional, Replace Nested Conditional with Guard Clauses), focuses on the key principle of refactoring: clarity.
A colleague of mine requested a function to validate the time format (10:00, etc). I quickly posted something on pastebin which looked like this.

sub valid_time{
   [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html">Guard Clause</a>, explained in <a href="http://www.amazon.com/gp/product/0201485672?ie=UTF8&#038;tag=mkhairulcom-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0201485672">Refactoring: Improving the Design of Existing Code</a><img src="http://www.assoc-amazon.com/e/ir?t=mkhairulcom-20&#038;l=as2&#038;o=1&#038;a=0201485672" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> (<strong>Chapter 9: Simplifying Conditional</strong>, Replace Nested Conditional with Guard Clauses), focuses on the key principle of refactoring: <strong>clarity</strong>.</p>
<p>A colleague of mine requested a function to validate the time format (10:00, etc). I quickly posted something on pastebin which looked like this.</p>
<pre class="brush: perl" name="code">
sub valid_time{
    my ($time) = @_;

    # format kena betul. 10:00 ataupun 23:00
    if(!($time =~ m/([0-9]{2})\:([0-9]{2})/))
    {
        return 0;
    }

    my ($hour, $min) = split(/\:/, $time);
    if ($hour eq "" or $min eq "")
    {
        return 0;
    }

    if($hour > 23 or $hour < 0)
    {
        return 0;
    }

    if($min > 59 or $min < 0)
    {
        return 0;
    }

    return 1;
}
</pre>
<p>It was not as good as I expected. So I changed it a bit.</p>
<pre class="brush: perl" name="code">
sub valid_time{
    my ($time) = @_;

    # format kena betul. 10:00 ataupun 23:00
    if(($time =~ m/([0-9]{2})\:([0-9]{2})/))
    {
        my ($hour, $min) = split(/\:/, $time);
        if (($hour eq "" or $min eq "")
            or ($hour > 24 or $hour < 0)
            or $min > 60 or $min < 0)
        {
            return 0;
        }
    }
    else
    {
        return 0;

    }

    return 1;
}
</pre>
<p>By using the Guard Clause, hopefully it is more readable.</p>
<pre class="brush:perl">
sub valid_time{
    my ($time) = @_;

    # format kena betul. 10:00 ataupun 23:00
    if(!($time =~ m/([0-9]{2})\:([0-9]{2})/)){ return 0; }

    my ($hour, $min) = split(/\:/, $time);
    if($hour eq "" or $min eq ""){ return 0; }
    if($hour > 23 or $hour < 0){ return 0; }
    if($min > 59 or $min < 0){ return 0; }

    return 1;
}
</pre>
<p>I remembered that I read somewhere sometime ago, there should be only one exit point in a function, at first I thought it was a rule or something, apparently it is not.</p>
<blockquote><p>
One entry point is enforced by modern languages, and one exit point is really not a useful rule. Clarity is the key principle: if the method is clearer with one exit point, use one exit point; otherwise don't.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/11/25/using-guard-clause/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reflections on changing jobs</title>
		<link>http://mkhairul.com/2009/10/16/reflections-on-changing-jobs/</link>
		<comments>http://mkhairul.com/2009/10/16/reflections-on-changing-jobs/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 19:29:10 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1469</guid>
		<description><![CDATA[Here I am, thinking, reflecting on the past while waiting for my download to finish. Some stupid stuffs that I did a few months back.
Changing jobs. Never ever, change a job in 24 hours. Especially for an unknown company whose office you have never seen. You could think that they&#8217;re being lenient and all for [...]]]></description>
			<content:encoded><![CDATA[<p>Here I am, thinking, reflecting on the past while waiting for my download to finish. Some stupid stuffs that I did a few months back.</p>
<p>Changing jobs. Never ever, change a job in 24 hours. Especially for an unknown company whose office you have never seen. You could think that they&#8217;re being lenient and all for meeting at a restaurant for a chat (which actually is an interview), but there&#8217;s always &#8220;udang disebalik mee&#8221;. </p>
<p>Think for a while (in my case I didn&#8217;t), if you had an office that you&#8217;re proud of, why the hell wouldn&#8217;t you invite a potential employee to come over for an interview? This should raise a flag (+5 suspicion).</p>
<p>One of my other mistake is asking a developer who is a good friend of the technical manager for an opinion on the working environment. Obviously it will be biased. Should have waited for a whole month before jumping the ship to investigate further.</p>
<p>There&#8217;s also other bunch of mistakes that I made:</p>
<ul>
<li>I did not ask about the environment in detail</li>
<li>I did not ask about developer level documentation</li>
<li>I did not ask about version control in detail (they used it, but there&#8217;s no comments in the commits, you&#8217;d have to diff the file to see what have been done)</li>
<li>I did not ask if there&#8217;s any code review being done</li>
<li>I agreed on the odd working hours (there&#8217;s no amount of money that could substitute for this, ok maybe RM10,000. You&#8217;d miss a lot in socializing with friends, cats and other stuffs). Burning out by spending too much time on work is certainly not worth it</li>
<li>I got sucked into a promise of a &#8216;family environment&#8217; when in reality every company is govern by a market norm (no exceptions, unless you&#8217;re one of the founders of the company, then yes it is like a family)</li>
<li>I was promised that the transition will be fully paid by the company from the old one when in reality their policy only allows them to pay half.</li>
</ul>
<p>Well that certainly was depressing to think about. <strong>Always take your time to dig deeper for more understanding on the environment and work being done at the company that you&#8217;re going to.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/10/16/reflections-on-changing-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google gives up on debugging IE for wave</title>
		<link>http://mkhairul.com/2009/09/24/google-gives-up-on-debugging-ie-for-wave/</link>
		<comments>http://mkhairul.com/2009/09/24/google-gives-up-on-debugging-ie-for-wave/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 23:30:16 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1459</guid>
		<description><![CDATA[
A well thought out solution for a problem that could drive an engineer insane (or maybe just bald) trying to fix the quirks on these browsers (IE6, IE7, IE8), but is wrapped around words that doesn&#8217;t offend anyone. 
Good thinking.
Google Wave in Internet Explorer

]]></description>
			<content:encoded><![CDATA[<div style="float:right; margin-left: 5px; padding:2px;"><a href="http://mkhairul.com/wp-content/uploads/2009/09/chromeie.jpg"><img src="http://mkhairul.com/wp-content/uploads/2009/09/chromeie-294x300.jpg" alt="" title="chromeie" width="294" height="300" class="alignnone size-medium wp-image-1461" /></a></div>
<p>A well thought out solution for a problem that could drive an engineer insane (or maybe just bald) trying to fix the quirks on these browsers (IE6, IE7, IE8), but is wrapped around words that doesn&#8217;t offend anyone. </p>
<p>Good thinking.<br />
<a href="http://googlewavedev.blogspot.com/2009/09/google-wave-in-internet-explorer.html">Google Wave in Internet Explorer</a></p>
<p><br style="clear:both;" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/09/24/google-gives-up-on-debugging-ie-for-wave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Having a clear development process</title>
		<link>http://mkhairul.com/2009/09/23/having-a-clear-development-process/</link>
		<comments>http://mkhairul.com/2009/09/23/having-a-clear-development-process/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 01:40:27 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=1454</guid>
		<description><![CDATA[Not many company have this (at least not the one that I worked for). Usually the process is just hearsay that most of the time changed into something else everytime its passed around and its not the same thing coming from everyone.
There was one time, where theres an ISO document for the development process, after [...]]]></description>
			<content:encoded><![CDATA[<p>Not many company have this (at least not the one that I worked for). Usually the process is just hearsay that most of the time changed into something else everytime its passed around and its not the same thing coming from everyone.</p>
<p>There was one time, where theres an ISO document for the development process, after it has been reviewed by the ISO department it was kept and never to be seen again (that&#8217;s what usually happens when its too formal and nobody wants anything to do with it, oh yeah, and no enforcement).</p>
<div style="float: right; margin-left: 5px; border: 1px solid #9f9f9f; padding: 2px;">
<a href="http://mkhairul.com/wp-content/uploads/2009/09/dilbert-cartoon.jpg"><img src="http://mkhairul.com/wp-content/uploads/2009/09/dilbert-cartoon-268x300.jpg" alt="" title="dilbert-cartoon" width="268" height="300" class="alignnone size-medium wp-image-1456" /></a></div>
<p>I agree that, <a href="http://www.makinggoodsoftware.com/2009/09/22/7-non-technical-tips-to-deliver-great-software/">having a clear development process</a> is on of the aspects to deliver great software (short-term and long-term), but how?</p>
<p>It shouldn&#8217;t be long, one or two page of text explaining with simple yet casual language. It all depends on the environment that you&#8217;re on and incrementally improve on it.</p>
<p>An example from my observation,<br />
- make changes based on the current task and project (duh)<br />
- compare the changes that I made with the one on the server<br />
- merge it<br />
- overwrite it<br />
- inform everyone involved in the project of the changes made using the developer mailing list<br />
- at the end of the week, present what I have done to the management (heh)</p>
<p>If you noticed, the process is full of pitfalls. To understand why it is the way it is, you&#8217;d have to understand its context (which I wouldn&#8217;t explain it here). Even though the process is flawed, it is still good to have it clearly for everyone to see instead of passing it through word of mouth.</p>
<p>So, if you or anyone else go to a company and the process is still passed with word of mouth, write it down and see if it makes sense (or just pry it out of your colleague&#8217;s/boss brain, ref cartoon).</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2009/09/23/having-a-clear-development-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
