<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Habesh's Weblog</title>
	<atom:link href="http://habesh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://habesh.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 12 Jan 2008 08:43:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='habesh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Habesh's Weblog</title>
		<link>http://habesh.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://habesh.wordpress.com/osd.xml" title="Habesh&#039;s Weblog" />
	<atom:link rel='hub' href='http://habesh.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Disabled button style</title>
		<link>http://habesh.wordpress.com/2008/01/12/disabled-button-style/</link>
		<comments>http://habesh.wordpress.com/2008/01/12/disabled-button-style/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 08:27:14 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2008/01/12/disabled-button-style/</guid>
		<description><![CDATA[Today I have seen an odd disabled button behavior in IE browser I know if a button is disabled it doesn&#8217;t respond to any mouse events, but check this out &#60;html&#62; &#60;body&#62; &#60;input type="button" value="button type" disabled="disabled" onmouseover="alert('respond to mouse event');" /&#62; &#60;input type="submit" value="submit type" disabled="disabled" onmouseover="alert('respond to mouse event');"/&#62; &#60;/body&#62; &#60;/html&#62; Both the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=11&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I have seen an odd disabled button behavior in IE browser</p>
<p>I know if a button is disabled it doesn&#8217;t respond to any mouse events, but check this out</p>
<div style="border:1px solid #999999;background-color:#dddddd;font-size:11px;padding:20px;">
<pre>&lt;html&gt;
 &lt;body&gt;
  &lt;input type="button" value="button type" disabled="disabled"
       onmouseover="alert('respond to mouse event');" /&gt;
  &lt;input type="submit" value="submit type" disabled="disabled"
       onmouseover="alert('respond to mouse event');"/&gt;
 &lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<p>Both the above elements are disabled and are not clickable and hence you won&#8217;t see the alert message while hovering over these buttons(the onmouseover events won&#8217;t fire) but the second html button text(&#8216;submit type&#8217;) happen to be selectable and if you hold down the mouse and move it till the mouse is out of the button area and release the button then you will see the alert message. Very odd!!!!!</p>
<p>This didn&#8217;t happen for input type button. Both form elements should have behaved the same way as specified in the documentation <a href="http://msdn2.microsoft.com/en-us/library/ms533732(VS.85).aspx">http://msdn2.microsoft.com/en-us/library/ms533732(VS.85).aspx</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=11&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2008/01/12/disabled-button-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Cookies</title>
		<link>http://habesh.wordpress.com/2007/12/01/cookies/</link>
		<comments>http://habesh.wordpress.com/2007/12/01/cookies/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 09:25:30 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[Cookie]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2007/12/01/cookies/</guid>
		<description><![CDATA[A Cookie is a small amount of named data stored by the web browser and associated with a particular web page. Things to watch for while implementing cookies. A total of 20 cookies per site or domain with a total max size of 4KB. A user could disable cookies in their browsers(although session cookies may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=8&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A Cookie is a small amount of named data stored by the web browser and associated with a particular web page.</p>
<p>Things to watch for while implementing cookies.</p>
<ul>
<li>A total of 20 cookies per site or domain with a total max size of 4KB.</li>
<li>A user could disable cookies in their browsers(although session cookies may still be enabled). You may want to first check that they are enabled before trying to store persistent cookies.</li>
<li>Cookies default visibility is for all pages in the same directory as the page that created it and sub-directories of that directory. This could be changed by setting the cookie &#8216;path&#8217; attribute.</li>
<li>Cookies are accessible only to pages on the same domain.</li>
<li>Cookies are stored on the client machine and are not shared by different browsers. eg. Cookies stored by IE is not visible to FF and vice verse.</li>
</ul>
<p>Cookies are sent to the server on every HTTP request and could be manipulated both on server side using server side scripts and on client side using javascript. Below is a javascript methods to get, set and remove cookies</p>
<div style="border:1px solid #999999;background-color:#dddddd;padding:20px;"> <i>function set(name,value,day){<br />
if(!name){<br />
return;<br />
}<br />
var cookie;<br />
var date = new Date();<br />
cookie = name + &#8220;=&#8221; + encodeURIComponent(value);<br />
if(typeof day === &#8216;number&#8217;){<br />
date.setTime(date.getTime()+(day*24*60*60*1000));<br />
cookie += &#8220;; expires=&#8221;+date.toGMTString();<br />
//cookie += &#8220;; max-age=&#8221;+day*24*60*60;<br />
}<br />
cookie += &#8220;; path=/&#8221;;<br />
document.cookie = cookie;<br />
}</i><br />
To set session cookie &#8211; set(&#8220;cookieName&#8221;, &#8220;cookieValue&#8221;);<br />
To set persistent cookie(for 30 days) : set(&#8220;cookieName&#8221;, &#8220;cookieValue&#8221;, 30);<i>  function get(name){<br />
if(!name || document.cookie.indexOf(name) === -1){<br />
return;<br />
}<br />
var curCookie;<br />
var list = document.cookie.split(&#8220;; &#8220;);<br />
for(var c=0;c&lt;list.length;c++){<br />
curCookie = list[c];<br />
if(curCookie.indexOf(name + &#8220;=&#8221;) != -1){<br />
return decodeURIComponent(curCookie.subString(name.length+1, curCookie.length));<br />
}<br />
}<br />
}</i><br />
To get a cookie &#8211; get(&#8220;cookieName&#8221;);</p>
<p><i>  function remove(name){<br />
set(name,&#8221;",-1);<br />
}</i></div>
<p>To remove a cookie &#8211; remove(&#8220;cookieName&#8221;);</p>
<p>You may have noticed a commented line in the above &#8216;set&#8217; function that sets the max-age attribute(a way to specify the life time of a cookie according to HTTP 1.1 spec) of a cookie, though that may not work in IE so we should use a depreciated &#8216;expires&#8217; attribute.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=8&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2007/12/01/cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>
	</item>
		<item>
		<title>curried functions</title>
		<link>http://habesh.wordpress.com/2007/11/19/curried-functions/</link>
		<comments>http://habesh.wordpress.com/2007/11/19/curried-functions/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 06:53:35 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[functionl programming]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2007/11/19/curried-functions/</guid>
		<description><![CDATA[In one of my computer science course, our professor start the class by asking a question: &#8216;what will you take with you if you get deserted in an FP world?&#8217; some of us mentioned some popular FP languages, book,&#8230;he then took out a lambda symbol off his pocket&#8230;.this is what you should take with you&#8230;it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=6&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://habesh.files.wordpress.com/2007/11/lambda.thumbnail.jpg?w=450" alt="Lambda" style="padding-left:10px;float:right;border:medium none;" />In one of my computer science course, our professor start the class by asking a question: &#8216;what will you take with you if you get deserted in an FP world?&#8217; some of us mentioned some popular FP languages, book,&#8230;he then took out a lambda symbol off his pocket&#8230;.this is what you should take with you&#8230;it is the basis of functional programming language.</p>
<p>In lambda calculus, every expression is a function and its arguments and return values are also a function. And Each function only take a single argument(curried functions).</p>
<p>To multiply two numbers [ f(x,y)=x*y;] in its curried form :</p>
<p>f x y . x * y;</p>
<p>var double = f 2; //parameter &#8217;2&#8242; is partially applied to the multiplication function.</p>
<p>double 5; //apply the second parameter to the partial function, this will give us 10.</p>
<p>functional programming language focuses on the &#8216;what&#8217; instead of the &#8216;how&#8217; of a problem.</p>
<p>lets write a function to get all prime factors of a number n.</p>
<p>first lets create helper functions to create list of integers b/n lo to hi and a filter function to filter a given list based on a given criteria.</p>
<p>//create a list of integers from lo to hi(in x::xs, x is the first element and xs is the rest of the list)<br />
fun fromTo lo hi =<br />
if lo &gt; hi<br />
then []<br />
else lo :: fromTo (lo+1) hi;</p>
<p>//return a list where the elements pass test f<br />
fun filter f null = []<br />
| filter f x::xs =<br />
if f x<br />
then x :: filter f xs<br />
else filter f xs;</p>
<p>//return true if n is is divisible by i<br />
fun divides n i = (n mod i == 0);<br />
fun factors n = filter (divides n) (fromTo 2 (n &#8211; 1));</p>
<p>How expressive is that?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=6&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2007/11/19/curried-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>

		<media:content url="http://habesh.files.wordpress.com/2007/11/lambda.thumbnail.jpg" medium="image">
			<media:title type="html">Lambda</media:title>
		</media:content>
	</item>
		<item>
		<title>the power of anonymous functions</title>
		<link>http://habesh.wordpress.com/2007/11/16/the-power-of-anonymous-functions/</link>
		<comments>http://habesh.wordpress.com/2007/11/16/the-power-of-anonymous-functions/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 08:09:46 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2007/11/16/the-power-of-anonymous-functions/</guid>
		<description><![CDATA[One of the best practices in javascript programming is avoiding global variables(they are evil), if you happen to have multiple javascript files from multiple authors they will lead to a name collision and hence unexpected result. Fortunately, there are great tools that would help us detect them. It can be avoided by wrapping variables and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=5&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the best practices in javascript programming is avoiding global variables(they are evil), if you happen to have multiple javascript files from multiple authors they will lead to a name collision and hence unexpected result. Fortunately, there are great <a href="http://www.jslint.com/" title="JsLint">tools </a>that would help us detect them.</p>
<p>It can be avoided by wrapping variables and functions in to an object. Anonymous functions are elegant ways of wrapping global variables and functions , and executing them immediately.</p>
<div style="border:1px solid #999999;background-color:#dddddd;padding:20px;">
(function(){</p>
<p>var isIE = !!document.all;</p>
<p>var div = document.getElementById(&#8220;xyz&#8221;);</p>
<p>div.style.height = &#8230;.</p>
<p>})();
</p></div>
<p>It will be very helpful to execute a block of initialization scripts, augmenting an existing object or setting it properties when a .js file is loaded.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=5&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2007/11/16/the-power-of-anonymous-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>
	</item>
		<item>
		<title>javascript functions : Higher Order functions</title>
		<link>http://habesh.wordpress.com/2007/11/16/javascript-functions-higher-order-functions/</link>
		<comments>http://habesh.wordpress.com/2007/11/16/javascript-functions-higher-order-functions/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 05:59:42 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[functionl programming]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2007/11/16/javascript-functions-higher-order-functions/</guid>
		<description><![CDATA[Functions that can accept functions as parameters and return functions are called Higher order functions. Javascript functions are one of these HOFs. javascript functions return functions, that allows us to create a nested function within another function(closure) take an example of advanced event registration of the following Eventing.addEventListner(div,click,click_callback); function Eventing(){ &#8220;addEventListener&#8221; : function(){ if(window.addEventListener){ return [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=4&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Functions that can accept functions as parameters and return functions are called Higher order functions. Javascript functions are one of these HOFs.</p>
<p>javascript functions return functions, that allows us to create a nested function within another function(closure)</p>
<p>take an example of advanced event registration of the following</p>
<p>Eventing.addEventListner(div,click,click_callback);</p>
<div style="border:1px solid #999999;background-color:#dddddd;padding:20px;">
function Eventing(){</p>
<p>&#8220;<font size="2">addEventListener&#8221; :  function(){</font></p>
<p><font size="2">     if(window.<font size="2">addEventListener){</font></font></p>
<p><font size="2"><font size="2">      return function(dom, eventName, callBack){</font></font></p>
<p><font size="2"><font size="2">           dom.addEventListener(eventName, callBack, false);</font></font></p>
<p><font size="2"><font size="2">      };</font></font></p>
<p><font size="2"><font size="2"> }</font></font></p>
<p><font size="2"><font size="2"> else  if <font size="2">(window.attachEvent)</font>{</font></font></p>
<p><font size="2"><font size="2">     return function(dom, eventName, callBack){</font></font><font size="2"><font size="2"><font size="2"><font size="2">           </font></font></font></font></p>
<p><font size="2"><font size="2"><font size="2"><font size="2">          dom.<font size="2">attachEvent</font>(&#8220;on&#8221; + eventName, callBack);</font></font></font></font><font size="2"><font size="2"><font size="2"><font size="2">     </font></font></font></font></p>
<p><font size="2"><font size="2"><font size="2"><font size="2">       };</font></font></font></font><font size="2"><font size="2"> </font></font></p>
<p><font size="2"><font size="2"><font size="2"><font size="2">    }</font></font></font></font><font size="2"><font size="2"> </font></font><font size="2"><font size="2"> </font></font></p>
<p><font size="2"><font size="2"> }()</font></font><font size="2"><font size="2"> </font></font></p>
<p><font size="2"><font size="2">}</font></font><font size="2"><font size="2"> </font></font><font size="2"><font size="2"> </font></font></p>
<p><font size="2"><font size="2">
</div>
<p>In the above example the anomymous function return an event handler function and the event handler function takes a callback function as a parameter. HOF are one of the powerful feature of javascript.</font></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=4&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2007/11/16/javascript-functions-higher-order-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Start marketing &#8216;the self&#8217;</title>
		<link>http://habesh.wordpress.com/2007/11/07/start-marketing-the-self/</link>
		<comments>http://habesh.wordpress.com/2007/11/07/start-marketing-the-self/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 08:16:38 +0000</pubDate>
		<dc:creator>habesh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://habesh.wordpress.com/2007/11/07/start-marketing-the-self/</guid>
		<description><![CDATA[It is 12:05 Am and i was reading this blog about marketing &#8216;the self&#8217;, which inspired to me to create an account and start blagging. It is been a while since i have this thought of improving my communication still, express myself and sharing various ideas with people of similar interest. From now on you will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=3&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is 12:05 Am and i was reading this blog about marketing &#8216;the self&#8217;, which inspired to me to create an account and start blagging.</p>
<p>It is been a while since i have this thought of improving my communication still, express myself and sharing various ideas with people of similar interest. From now on you will see me blogging about various software development related areas like TDD, Scrum, Javascript, Ajax, C#,functional programming(it is cool! I&#8217;ll blog on it soon ).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/habesh.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/habesh.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/habesh.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/habesh.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/habesh.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=habesh.wordpress.com&amp;blog=2072074&amp;post=3&amp;subd=habesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://habesh.wordpress.com/2007/11/07/start-marketing-the-self/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1065541a1869e5c06d1cb1fbc0afbed5?s=96&#38;d=identicon" medium="image">
			<media:title type="html">habesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
