<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mohsin Hijazee</title>
	<atom:link href="http://mohsinhijazee.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mohsinhijazee.wordpress.com</link>
	<description>Ruby, Java, Python, Erlang, .NET, philosophy and politics</description>
	<lastBuildDate>Fri, 06 Nov 2009 07:25:57 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='mohsinhijazee.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d210d434be2f525e2d9e6ead706075f1?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Mohsin Hijazee</title>
		<link>http://mohsinhijazee.wordpress.com</link>
	</image>
			<item>
		<title>Ubuntu Karmic and Intel 82915G/GV/910GL Integrated Graphics Controller</title>
		<link>http://mohsinhijazee.wordpress.com/2009/11/06/ubuntu-karmic-and-intel-82915ggv910gl-integrated-graphics-controller/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/11/06/ubuntu-karmic-and-intel-82915ggv910gl-integrated-graphics-controller/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 07:25:57 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=37</guid>
		<description><![CDATA[I am using Ubuntu for almost two years both at home and office. My <a href="http://www.zeropoint.it" target="_blank">office</a> setup quit complex in this regard as we have nVidia GeForce cards with dual LCD monitors on our disposal.  And at home, I am using my HP system which has Intel 82915G/GV/910GL Integrated Graphics Controller. I had some issues regarding resolutions but I almost totally forgot about them and upgrades after upgrades, all worked fine.

But things changed after the Ubuntu Karmic, I was stuck to only 2 resolutions: 640x480 and 800x600 both at 60Hz while my chipset and my monitor are both far more capable then this. In this post, I would try to list how I solved this problem for myself. I am no Linux geek and have a pure Windows background so you know who to blame if something seems odd.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=37&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am using Ubuntu for almost two years both at home and office. My <a href="http://www.zeropoint.it" target="_blank">office</a> setup quit complex in this regard as we have nVidia GeForce cards with dual LCD monitors on our disposal.  And at home, I am using my HP system which has Intel 82915G/GV/910GL Integrated Graphics Controller. I had some issues regarding resolutions but I almost totally forgot about them and upgrades after upgrades, all worked fine.</p>
<p>But things changed after the Ubuntu Karmic, I was stuck to only 2 resolutions: 640&#215;480 and 800&#215;600 both at 60Hz while my chipset and my monitor are both far more capable then this. In this post, I would try to list how I solved this problem for myself. I am no Linux geek and have a pure Windows background so you know who to blame if something seems odd.</p>
<p>In order get a working video setup, you need find out:</p>
<ol>
<li>What video adaptor do you have?</li>
<li>Is there a driver for it?</li>
<li>Is it picking up the modes and resolutions if answer to above two questions is positive?</li>
<li>What your monitor is capable of?</li>
<li>Is the monitor&#8217;s capabilities are known to the system?</li>
</ol>
<p>I assume that you have very little knowledge of the Linux stuff just like me. Lets try to get an answer for all these questions one by one.</p>
<h3>What video adaptor do you have?</h3>
<p>Well, open up command shell by pressing Alt + F2 and typing <code>x-terminal-emulator</code><br />
Probably you would be aware that there is a command available to get the listings of a directory. That command is called <code>ls</code>. In the same way, you can also get a list of the devices attached to PCI slots by a command <code>lspci</code>. If you issue this command, you would get an information about all the components on your system. But probably we are not interested in all the devices right now but only in our VGA. So therefore, issue this command:<br />
<code>lspci | grep VGA</code></p>
<p>and my output is:<br />
<code>00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Integrated Graphics Controller (rev 04)</code><br />
Little explanation about the command. <code>lspci</code>&#8217;s output is given to another program called <code>grep</code> and we are telling <code>grep</code> to show only those lines where string <code>VGA</code>. This mechanism is called piping where output of one program becomes input of the other and thus you can form chain of process to do wonderful stunts. A UNIX philosophy.<br />
At this step, you know what kind of VGA do you have. Next is to determine if you have driver for it or not.</p>
<h2>Is there a driver for it?</h2>
<p>If you have ATI or nVidia graphic adopters, then your output might be different. However, refer to <a href="https://help.ubuntu.com/community/RestrictedDrivers" target="_blank">this page about drivers</a>. For my case, I did following:</p>
<p><code>aptitude search intel</code></p>
<p>And my output looked like this:<br />
<code><br />
p   intel-gpu-tools                                                                            - tools for debugging the Intel graphics driver<br />
p   intel-microcode                                                                            - Processor microcode data file for Intel CPUs<br />
v   intel-rng-tools                                                                            -<br />
p   intel2gas                                                                                  - A converter from NASM assembly language to GAS<br />
p   inteltool                                                                                  - Dump Intel CPU / chipset configuration parameters<br />
i A libdrm-intel1                                                                              - Userspace interface to intel-specific kernel DRM services -- runtime<br />
p   libdrm-intel1-dbg                                                                          - Userspace interface to intel-specific kernel DRM services -- debugging symbols<br />
i   xserver-xorg-video-intel                                                                   - X.Org X server -- Intel i8xx, i9xx display driver<br />
p   xserver-xorg-video-intel-dbg                                                               - X.Org X server -- Intel i8xx, i9xx display driver (debug symbols)<br />
</code></p>
<p>A little explanation of what I did and why. Well I need to know if drivers for my card are installed or not. They would have intel somewhere in there name. <code>aptitude</code> is a program that controls all the software installations on your system and automatically keeps them up to date. So there is a large repository of software behind it somewhere on internet (well Ubuntu servers). This concept of single source of software is unknown to commercial world because they have &#8220;copy rights&#8221; not in there hand and that&#8217;s why it is an alien concept to the user of windows. Of course you cannot hope to install CorelDraw this way!. Well anyway, what I am doing is that I search for a package that name contains <code>intel</code> and I get a list of all those packages. Look at this line:<br />
<code><br />
i   xserver-xorg-video-intel                                                                   - X.Org X server -- Intel i8xx, i9xx display driver<br />
</code><br />
The <code>i</code> in front of that line indicates that this package is already installed. If it were not, instead of <code>i</code>, I would have a <code>p</code> there. Suppose if it w to the deviceere not, I would install it like this:</p>
<p><code>sudo aptitude install xserver-xorg-video-intel</code></p>
<h2>Is it picking up the resolutions?</h2>
<p>If you&#8217;ve got all well as of now, that&#8217;s great. Now we need to determine that if the drivers are really working with the VGA. We do this with two utilities. <code>xrandr</code> and <code>cvt</code></p>
<p>Now we need to experiment with the video adapter. How? We need to check if it supports those resolution we expect from it. For example, I expect that my chip should show up to 1024 760 at 85 Hz. How to check this then? Its in three steps:</p>
<ol>
<li> Introducing a new mode</li>
<li> Associating that mode to a device</li>
<li> Applying that mode on that device</li>
</ol>
<p>This process is better explained <a href="https://wiki.ubuntu.com/X/Config/Resolution" target="_blank">here</a></p>
<p>&lt;h2&gt;What your monitor is capable of?&lt;/h2&gt;</p>
<p>Well this might be most important question. You need to know the maximum resolutions, optimal resolution and horizontal and vertical frequencies if your monitor is not automatically detected as it was with me. I happen to beusing Sony 21&#8243; Multiscan E500 CRT monitor which is capable of displaying upto 2048&#215;1536 at 60 Hz while recommended resolution is 1600&#215;1200 at 85 Hz. The Horizontal frequency range is 30-109kHz and 48-160Hz for vertical. Note that horizontal frequency is in kHz and vertical is in Hz. If you are curious then you can look about CRT workings here. Anyway, Used this information in my <code>xorg.conf</code> file which is at <code>/etc/X11/xorg.conf</code> and added following:</p>
<p><code><br />
Section "Monitor"<br />
	Identifier	"Sony Multiscan E500 CRT Monitor"<br />
	VendorName	"Sony"<br />
	ModelName	"CPD-E500"<br />
	HorizSync	30-109<br />
	VertRefresh	48-160<br />
	Option		"DPMS"<br />
EndSection</p>
<p>Section "Screen"<br />
	Identifier	"Default Screen"<br />
	Monitor		"Sony Multiscan E500 CRT Monitor"<br />
	Device		"Configured Video Device"<br />
	DefaultDepth	24<br />
	SubSection "Display"<br />
		Modes	"1600x1200"<br />
		Modes   "1024x768"<br />
		Modes   "800x600"<br />
	EndSubSection<br />
EndSection<br />
</code></p>
<p>while my complete <code>xorg.conf</code> looks like this:<br />
<code><br />
# xorg.conf (X.Org X Window System server configuration file)<br />
#<br />
# This file was generated by dexconf, the Debian X Configuration tool, using<br />
# values from the debconf database.<br />
#<br />
# Edit this file with caution, and see the xorg.conf manual page.<br />
# (Type "man xorg.conf" at the shell prompt.)<br />
#<br />
# This file is automatically updated on xserver-xorg package upgrades *only*<br />
# if it has not been modified since the last upgrade of the xserver-xorg<br />
# package.<br />
#<br />
# If you have edited this file but would like it to be automatically updated<br />
# again, run the following command:<br />
#   sudo dpkg-reconfigure -phigh xserver-xorg</p>
<p># commented out by update-manager, HAL is now used<br />
#Section "InputDevice"<br />
#	Identifier	"Generic Keyboard"<br />
#	Driver		"kbd"<br />
#	Option		"XkbRules"	"xorg"<br />
#	Option		"XkbModel"	"pc105"<br />
#	Option		"XkbLayout"	"us"<br />
#EndSection</p>
<p># commented out by update-manager, HAL is now used<br />
#Section "InputDevice"<br />
#	Identifier	"Configured Mouse"<br />
#	Driver		"mouse"<br />
#	Option		"CorePointer"<br />
#EndSection</p>
<p>Section "Device"<br />
	Identifier	"Configured Video Device"<br />
	Option		"UseFBDev"		"true"<br />
EndSection</p>
<p>Section "Monitor"<br />
	Identifier	"Sony Multiscan E500 CRT Monitor"<br />
	VendorName	"Sony"<br />
	ModelName	"CPD-E500"<br />
	HorizSync	30-109<br />
	VertRefresh	48-160<br />
	Option		"DPMS"<br />
EndSection</p>
<p>Section "Screen"<br />
	Identifier	"Default Screen"<br />
	Monitor		"Sony Multiscan E500 CRT Monitor"<br />
	Device		"Configured Video Device"<br />
	DefaultDepth	24<br />
	SubSection "Display"<br />
		Modes	"1600x1200"<br />
		Modes   "1024x768"<br />
		Modes   "800x600"<br />
	EndSubSection<br />
EndSection</p>
<p>Section "ServerLayout"<br />
	Identifier	"Default Layout"<br />
	Screen	"Default Screen"<br />
EndSection<br />
</code></p>
<p>After this, restart your display manager in my case it was gdm so I did:<br />
<code>sudo /etc/init.d/gdm restart</code></p>
<p>And from that point onwards, I had no issues with video resolution. Next on my target is sound. Thought it is working but I would document some of my discoveries about it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=37&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/11/06/ubuntu-karmic-and-intel-82915ggv910gl-integrated-graphics-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>Why we&#8217;ve not grown?</title>
		<link>http://mohsinhijazee.wordpress.com/2009/05/16/why-weve-not-grown/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/05/16/why-weve-not-grown/#comments</comments>
		<pubDate>Sat, 16 May 2009 08:15:29 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Bussiness]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[society]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=34</guid>
		<description><![CDATA[The problem what I&#8217;ve been thinking about. Why we&#8217;ve not out grown to a visible stage? Why dont we have large and huge business empires? Why is it so that most of our bussinessmen are confined to the same country and not beyond?
Honesty
Yes that&#8217;s the factor. Even in our private business, our managers would favour [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=34&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The problem what I&#8217;ve been thinking about. Why we&#8217;ve not out grown to a visible stage? Why dont we have large and huge business empires? Why is it so that most of our bussinessmen are confined to the same country and not beyond?</p>
<p>Honesty</p>
<p>Yes that&#8217;s the factor. Even in our private business, our managers would favour those with who are their favourates and not the talented people around. One of my friend in a large Telecom and Internet provider company, told me of such things as of how low calliber people get raised up just because they&#8217;e got links.</p>
<p>In a software company, I&#8217;ve even heard of that and as result all the talented started to move away and out. Definately that affects the business then.</p>
<p>You might be interested in knowing why one prefers dull people over shine? Mostly fear. Fear of being superseded that would force them to make &#8220;safe and smart&#8221; choices. But think of it what gets sorted out as result of this &#8220;bubble&#8221; sort?</p>
<p>So am I asserting that all the managers and those responsible in organizations are dishonest? Then how the hell these businesses are going after all? No, they are not dishonest. They use &#8220;selective honesty&#8221; which in turn haunts explosive growth as you&#8217;ve not let the best to be the next.</p>
<p>So this algorithm being executed in all the organizations of the whole state yields dull bodies and overall we&#8217;re a failed state.</p>
<p>Think about it. If you&#8217;ve got your own business, or intend to initiate one, beware of the managers who are &#8220;slightly&#8221; dishonest and even do not do it yourself if you&#8217;re at decision making. If managed to do so, then that&#8217;s for sure that you&#8217;re going to flourish to the maximum. No doubts about it.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=34&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/05/16/why-weve-not-grown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>The Questions I have been wondering about</title>
		<link>http://mohsinhijazee.wordpress.com/2009/05/13/the-questions-i-have-been-wondering-about/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/05/13/the-questions-i-have-been-wondering-about/#comments</comments>
		<pubDate>Wed, 13 May 2009 09:24:12 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=29</guid>
		<description><![CDATA[From time to time, I&#8217;ve been wondering about many questions in different phases of life. Here are some:

What is power? How it comes? Why they bow to someone and not to the other?
How human race continued to grow in different domains even being unaware of the other areas being developed and dug by fellow human? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=29&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>From time to time, I&#8217;ve been wondering about many questions in different phases of life. Here are some:</p>
<ul>
<li>What is power? How it comes? Why they bow to someone and not to the other?</li>
<li>How human race continued to grow in different domains even being unaware of the other areas being developed and dug by fellow human? Where do they overlap?</li>
<li>Introverts are also inventors? How?</li>
<li>How large business empires work? What keeps them tied and focus on the goal? What the top level is getting?</li>
</ul>
<p>I&#8217;d keep it updating as I come across more.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=29&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/05/13/the-questions-i-have-been-wondering-about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>The Anne Frank</title>
		<link>http://mohsinhijazee.wordpress.com/2009/04/26/the-anne-frank/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/04/26/the-anne-frank/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 15:21:52 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=26</guid>
		<description><![CDATA[I just got a book on my cell phone and kept reading as long as I could: The Diary of a young girl. Yet not in the middle even, I got curious to know if the diary is for real? Reasons for the doubt were the style of writing and the observation that girls makes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=26&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I just got a book on my cell phone and kept reading as long as I could: The Diary of a young girl. Yet not in the middle even, I got curious to know if the diary is for real? Reasons for the doubt were the style of writing and the observation that girls makes about herself and the others not seem to be from a 13 years old girl.</p>
<p>I&#8217;ll update about it as I got along.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=26&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/04/26/the-anne-frank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>A mimimal JavaScript Logger</title>
		<link>http://mohsinhijazee.wordpress.com/2009/03/08/a-mimimal-javascript-logger/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/03/08/a-mimimal-javascript-logger/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:55:34 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[JSLint]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[UrduTools]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/2009/03/08/a-mimimal-javascript-logger/</guid>
		<description><![CDATA[For one of my internal projects, I do not wanted to rely any of the JavaScript frameworks out there and do all on my own. On Linux with Firefox and Firebug installed, I was writing some information to firebug console. When the application ran on another browser without Firebug, it simply did not work at all.I made it working by commenting out the logging calls for the moment but that was not the solution.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=22&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For one of my internal projects, I do not wanted to rely any of the JavaScript frameworks out there and do all on my own. On Linux with Firefox and Firebug installed, I was writing some information to firebug console. When the application ran on another browser without Firebug, it simply did not work at all.I made it working by commenting out the logging calls for the moment but that was not the solution.</p>
<p>My first idea was to call window.console if it is not undefined. But that would not be something nice and would be a lot of code. The scene was clear. I had to write my own logger but what should it do? I thought it must check if window.console is available and emit message there and if not, should silently ignore.</p>
<p>I started to work on the idea and while working, I thought why not try to emit messages to an HTML div in case window.console is not available? So I worked on that. In first iteration you had to instantiate logger yourself. Then I made it already instantiated and you&#8217;d had to call the methods only. The whole idea heavily relies on JavaScritpt anonymous functions, inner functions and JavaScript closures.</p>
<p>Here&#8217;s the source code:</p>
<pre style='color:#000020;background:#f6f8ff;'><span style='color:#595979;'>/*</span>
<span style='color:#595979;'>&#xa0;*The urdu tools base file</span>
<span style='color:#595979;'>&#xa0;*/</span>
<span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span><span style='color:#200080;font-weight:bold;'>typeof</span><span style='color:#308080;'>(</span>URDUTOOLS<span style='color:#308080;'>)</span> <span style='color:#308080;'>===</span> <span style='color:#1060b6;'>'undefined'</span> <span style='color:#308080;'>||</span> !URDUTOOLS<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
    URDUTOOLS <span style='color:#308080;'>=</span> <span style='color:#406080;'>{</span><span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>
<span style='color:#406080;'>}</span>

<span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span><span style='color:#200080;font-weight:bold;'>typeof</span><span style='color:#308080;'>(</span>URDUTOOLS<span style='color:#308080;'>.</span>util<span style='color:#308080;'>)</span> <span style='color:#308080;'>===</span> <span style='color:#1060b6;'>'undefined'</span> <span style='color:#308080;'>||</span> !URDUTOOLS<span style='color:#308080;'>.</span>util<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
    URDUTOOLS<span style='color:#308080;'>.</span>util <span style='color:#308080;'>=</span> <span style='color:#406080;'>{</span><span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>
<span style='color:#406080;'>}</span>

<span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span><span style='color:#200080;font-weight:bold;'>typeof</span><span style='color:#308080;'>(</span>URDUTOOLS<span style='color:#308080;'>.</span>util<span style='color:#308080;'>.</span>Logger<span style='color:#308080;'>)</span> <span style='color:#308080;'>===</span> <span style='color:#1060b6;'>'undefined'</span> <span style='color:#308080;'>||</span> !URDUTOOLS<span style='color:#308080;'>.</span>util<span style='color:#308080;'>.</span>Logger<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
    <span style='color:#595979;'>/**</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Our own logging facility. It basically searches for a special DIV with</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* ID URDUTOOSL_logger_dock. If such a DIV is found, its used as logging </span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* area. If that is not found, window.console is used (which is available in</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* case of Fiebug installed) and even if that's not available, you can set</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* one of your own like this:</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* </span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* URDProblem at line 78 character 10: Missing semicolon.UTOOLS.util.Logger.setLoggingDock("my_logging_div_id");</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* </span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.info()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.warn()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.debug()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.error()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.clear()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.setLoggingDock(element_id)</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Logger.getLoggingDock()</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;* Heavily dependent on closures.</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*</span>
<span style='color:#595979;'>&#xa0;&#xa0;&#xa0;&#xa0;&#xa0;*/</span>

    <span style='color:#595979;'>// Create a new Logger object at the spot!</span>
    URDUTOOLS<span style='color:#308080;'>.</span>util<span style='color:#308080;'>.</span>Logger <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>new</span> <span style='color:#308080;'>(</span><span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>div_id<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>

        <span style='color:#595979;'>// Yet this is null</span>
        <span style='color:#200080;font-weight:bold;'>var</span> logging_dock <span style='color:#308080;'>=</span> <span style='color:#0f4d75;'>null</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.info()</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>info <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            logging_dock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock<span style='color:#308080;'>.</span>info<span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.warn()</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>warn <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            logging_dock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock<span style='color:#308080;'>.</span>warn<span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.debug()</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>debug <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            logging_dock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock<span style='color:#308080;'>.</span>debug<span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.error()</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>error <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            logging_dock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock<span style='color:#308080;'>.</span>error<span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.clear()</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>clear <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            logging_dock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock<span style='color:#308080;'>.</span>clear<span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.setLoggingDock()</span>
        <span style='color:#595979;'>// We try to get the given DOM element and extent it with some </span>
        <span style='color:#595979;'>// of our own methods.</span>
        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>setLoggingDock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>el_id<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            <span style='color:#200080;font-weight:bold;'>var</span> element <span style='color:#308080;'>=</span> document<span style='color:#308080;'>.</span>getElementById<span style='color:#308080;'>(</span>el_id<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>

                <span style='color:#595979;'>// Inner function to build log message</span>
            <span style='color:#200080;font-weight:bold;'>function</span> logMsg<span style='color:#308080;'>(</span>type<span style='color:#308080;'>,</span> msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                <span style='color:#200080;font-weight:bold;'>return</span> <span style='color:#1060b6;'>"&lt;b&gt;"</span><span style='color:#308080;'>+</span> type <span style='color:#308080;'>+</span> <span style='color:#1060b6;'>"&lt;/b&gt;: "</span> <span style='color:#308080;'>+</span> msg <span style='color:#308080;'>+</span> <span style='color:#1060b6;'>"&lt;br/&gt;"</span><span style='color:#406080;'>;</span>
             <span style='color:#406080;'>}</span>

            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>element<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                logging_dock <span style='color:#308080;'>=</span> element<span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span>

            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>

                logging_dock<span style='color:#308080;'>.</span>info <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                    <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>innerHTML <span style='color:#308080;'>+=</span> logMsg<span style='color:#308080;'>(</span><span style='color:#1060b6;'>"INFO"</span><span style='color:#308080;'>,</span> msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

                logging_dock<span style='color:#308080;'>.</span>warn <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                    <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>innerHTML <span style='color:#308080;'>+=</span> logMsg<span style='color:#308080;'>(</span><span style='color:#1060b6;'>"WARN"</span><span style='color:#308080;'>,</span> msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

                logging_dock<span style='color:#308080;'>.</span>debug <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                    <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>innerHTML <span style='color:#308080;'>+=</span> logMsg<span style='color:#308080;'>(</span><span style='color:#1060b6;'>"DEBG"</span><span style='color:#308080;'>,</span> msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

                logging_dock<span style='color:#308080;'>.</span>error <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span>msg<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                    <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>innerHTML <span style='color:#308080;'>+=</span> logMsg<span style='color:#308080;'>(</span><span style='color:#1060b6;'>"EROR"</span><span style='color:#308080;'>,</span> msg<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

                logging_dock<span style='color:#308080;'>.</span>clear <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
                  <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>innerHTML <span style='color:#308080;'>=</span> <span style='color:#1060b6;'>""</span><span style='color:#406080;'>;</span>
                <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>
            <span style='color:#406080;'>}</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

        <span style='color:#595979;'>// Logger.getLoggingDock()</span>

        <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>getLoggingDock <span style='color:#308080;'>=</span> <span style='color:#200080;font-weight:bold;'>function</span><span style='color:#308080;'>(</span><span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
            <span style='color:#595979;'>// Get current div_id DIV if logging_dock not set</span>
            <span style='color:#595979;'>// This is basically becasue when the new() logger is being </span>
            <span style='color:#595979;'>// execute for the first time, the DIV to be used for logger is not</span>
            <span style='color:#595979;'>// available as yet. Each of the logging methos first always get</span>
            <span style='color:#595979;'>// the logging dock by calling this method. If the DOM is ready,</span>
            <span style='color:#595979;'>// and element is get once, its not get for the next times.</span>
            <span style='color:#595979;'>// Read the code carefully to understand!</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>!logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
              <span style='color:#200080;font-weight:bold;'>this</span><span style='color:#308080;'>.</span>setLoggingDock<span style='color:#308080;'>(</span>div_id<span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
              <span style='color:#406080;'>}</span>
            <span style='color:#200080;font-weight:bold;'>if</span><span style='color:#308080;'>(</span>!logging_dock<span style='color:#308080;'>)</span><span style='color:#406080;'>{</span>
              logging_dock <span style='color:#308080;'>=</span> window<span style='color:#308080;'>.</span>console<span style='color:#406080;'>;</span>
              <span style='color:#406080;'>}</span>
          <span style='color:#200080;font-weight:bold;'>return</span> logging_dock<span style='color:#406080;'>;</span>
        <span style='color:#406080;'>}</span><span style='color:#406080;'>;</span>

    <span style='color:#406080;'>}</span><span style='color:#308080;'>)</span><span style='color:#308080;'>(</span><span style='color:#1060b6;'>"URDUTOOLS_logger_dock"</span><span style='color:#308080;'>)</span><span style='color:#406080;'>;</span>
<span style='color:#406080;'>}</span>
</pre>
<p>After writing this, I ran it through JSLint and found no problems and it works well for me.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=22&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/03/08/a-mimimal-javascript-logger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>The Choice of JavaScript</title>
		<link>http://mohsinhijazee.wordpress.com/2009/03/08/18/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/03/08/18/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:45:31 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[appsengine]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=18</guid>
		<description><![CDATA[For one of my internal private pet research projects pertaining to natural language processing, I ended up in implementing it with JavaScript. The factors that contributed to this was the fact that I needed someone non-programmer to review the process and validate. My choices were being platform independence. I wished to built it as a Ruby on Rails application but setting up and running a Rails application for a naive user is not an easy task.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=18&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For one of my internal private pet research projects pertaining to natural language processing, I ended up in implementing it with JavaScript. The factors that contributed to this was the fact that I needed someone non-programmer to review the process and validate. My choices were being platform independence. I wished to built it as a Ruby on Rails application but setting up and running a Rails application for a naive user is not an easy task.</p>
<p>The second choice was Java and building it as a desktop applicaiton. That too was ruled out as running a Java application requires JRE to be installed and the potentail users might not be even capable of that.</p>
<p>I knew it to be a web application. I came accross Google Apps Engine. So the choice turned out to be Python. But looking at that platform, I thought that an appliation with a long future, it would not be wise to setup there as its future is yet not known. Moreover, its very restrictive in its data model. It would be pain to port it somewhere else later. I wanted to use CherryPy or Django for the web framework but again dropped the idea.</p>
<p>PHP is again not what I wanted. I had written few very small PHP scripts back in 2004 or earlier but never returned to it reason being that I wanted to be a Desktop application developer so keep investing myself into C/C++, Win32, MFC and .NET</p>
<p>But eventually, as I was learning advanced JavaScript, and I was also delivering a course in my company, I simply started to write it in JavaScript as it gives true platform independence with 0 installation overhead! Other reason was that I came accross some Japaneese projects that implemented whole Java and Ruby Virtual Machines in pure JavaScript. So I settled with implementing it in JavaScript.</p>
<p>I&#8217;m though enjoying writing it, but one of my concerns is obfuscation. For sometime, unless I am fully done with my idea, I do not want it to be stolen or worked out elsewhere and yet I am not able to find any free and perfect tool. May be I have to write that too. Let&#8217;s see. Let me know if you know any good one for compacting multiple JS files into one with obfuscation in place.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=18&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/03/08/18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>Books that I love</title>
		<link>http://mohsinhijazee.wordpress.com/2009/03/08/books-that-i-love/</link>
		<comments>http://mohsinhijazee.wordpress.com/2009/03/08/books-that-i-love/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:31:29 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=16</guid>
		<description><![CDATA[There are literally thousands of books on computer science But fewer are that have hit me so deep that I refer to them as near to Bible on those subjects.

Turbo C++ by Robert Lafore
Object Oriented JavaScript by Stoyan Stefanov
Object Oriented C (its a free book)

There are many more on my wish list that I want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=16&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are literally thousands of books on computer science But fewer are that have hit me so deep that I refer to them as near to Bible on those subjects.</p>
<ul>
<li>Turbo C++ by Robert Lafore</li>
<li>Object Oriented JavaScript by Stoyan Stefanov</li>
<li>Object Oriented C (its a free book)</li>
</ul>
<p>There are many more on my wish list that I want to read but dont have time for like Code Complete, Patterns of Enterprise Architecture. I&#8217;ll keep sharing my thoughts on this.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=16&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2009/03/08/books-that-i-love/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
		<item>
		<title>REST API: My experience and intents</title>
		<link>http://mohsinhijazee.wordpress.com/2008/12/11/9/</link>
		<comments>http://mohsinhijazee.wordpress.com/2008/12/11/9/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 15:00:18 +0000</pubDate>
		<dc:creator>Mohsin Hijazee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://mohsinhijazee.wordpress.com/?p=9</guid>
		<description><![CDATA[The current happening in my life is that of REST. I've been building a REST API for  Dedomenon. Dedomenon is an online structured data storage engine. I was asked to build REST API on top of it. Though I've done the job very well as I far as I think but still I'd say that designing and API can never be complete until you put it to real use.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=9&subd=mohsinhijazee&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m yet continuously thinking about my career. How do I grow it? And I&#8217;ve got many many things to do which I must undertake one at a time.</p>
<p>The current happening in my life is that of REST. I&#8217;ve been building a REST API for  <a> Dedomenon</a>. Dedomenon is an online structured data storage engine. I was asked to build REST API on top of it. Though I&#8217;ve done the job very well as I far as I think but still I&#8217;d say that designing and API can never be complete until you put it to real use.</p>
<p>When it comes to real usage, You&#8217;re more likely to discover further hidden and indirect use cases which with the designer glasses, you wont be able to see. The concept of REST itself is not very old as it came just in 2000. Incorporation of this as the basis for providing web services in Ruby on Rails only started until 2006. Later, it became clear that Rails was going to favor REST over all the other floating paradigms.</p>
<p>This actually leads to a situation where there&#8217;s very little documentation on REST in Rails. Though there&#8217;s much but its pretty basic. Building a whole REST API is really something different. When I started out with this for Dedomenon, I felt there must be a short booklet about building REST APIs on top of Rails. An outline that comes to my mind is as under:</p>
<ul>
<li> What is REST?</li>
<li>How do I Identify resources?</li>
<li>How do I Identity operations on resources?</li>
<li>How do I map my operations to HTTP verbs?</li>
<li>Some tools of trade</li>
<li>How do I expose resources? (Routes etc)</li>
<li>Who&#8217;ll handle those requests? (Possible suggestions, engines plugin, etc)</li>
<li>How do I response in multiple formats</li>
<li>Doing so in multiple formats</li>
<li>Accepting and processing multiple formats</li>
<li>Writing tests for your REST API</li>
<li>How do I implement REST Auth? (possible schemes)</li>
<li></li>
<li>Managing access rights etc</li>
<li>Advanced topics: Managing consumption rate and other issues</li>
</ul>
<p>I&#8217;m thinking to write all about this in less then 100 pages. But I&#8217;m feeling that 100 pages would not be perhaps a doable amount for me. When you sit down to write, only then you realize that you&#8217;re not able to write even 25 pages!<br />
Another decision is that I wan to use vim as text editor. For publishing it, either LaTeX or DocBook. Let&#8217;s see what do I choose. Most probably LaTeX would be the choice. What do you say?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mohsinhijazee.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mohsinhijazee.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mohsinhijazee.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mohsinhijazee.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mohsinhijazee.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mohsinhijazee.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mohsinhijazee.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mohsinhijazee.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mohsinhijazee.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mohsinhijazee.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mohsinhijazee.wordpress.com&blog=2121400&post=9&subd=mohsinhijazee&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://mohsinhijazee.wordpress.com/2008/12/11/9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c5559084a7e35faed422d1d016abede9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mohsin Hijazee</media:title>
		</media:content>
	</item>
	</channel>
</rss>