<?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"
	>

<channel>
	<title>Azmeer's Corner in the Cyber Space</title>
	<atom:link href="http://www.azmeer.info/feed" rel="self" type="application/rss+xml" />
	<link>http://www.azmeer.info</link>
	<description>On Mechatronics, Software, Graphic Design, Teaching, Music, Reading &#38; Writing</description>
	<pubDate>Mon, 01 Dec 2008 06:36:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Detecting keypress in Visual C++</title>
		<link>http://www.azmeer.info/archives/32</link>
		<comments>http://www.azmeer.info/archives/32#comments</comments>
		<pubDate>Thu, 07 Aug 2008 15:54:49 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[keypress]]></category>

		<category><![CDATA[space invaders]]></category>

		<category><![CDATA[Visual C++]]></category>

		<category><![CDATA[Visual Studio 2005]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=32</guid>
		<description><![CDATA[Jeez, I couldn&#8217;t believe how many people on the net have the same problem; detecting a key press from Visual C++ without echoing the same to the screen (ie: console).
I had this exact requirement today since I was trying to (re)write &#8220;Space Invaders&#8221; game to test the C++ console mode skills.
All I wanted to do [...]]]></description>
			<content:encoded><![CDATA[<p>Jeez, I couldn&#8217;t believe how many people on the net have the same problem; detecting a key press from Visual C++ without echoing the same to the screen (ie: console).</p>
<p>I had this exact requirement today since I was trying to (re)write &#8220;Space Invaders&#8221; game to test the C++ console mode skills.<span id="more-32"></span></p>
<p>All I wanted to do was to detect the arrow keys and throw a message identifying the keys. But digging MSDN never helped me, it was overloaded with &#8217;solutions&#8217; <img src='http://www.azmeer.info/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>After few experiments I figured the way to go forward is to use _kbhit from conio.h library. Remember conio.h is coming from &#8216;C&#8217; not &#8216;C++&#8217; so you got to use the &#8216;.h&#8217; with it. Also note that usual keys return one character but special keys (function keys, arrow keys etc&#8230;) returns two characters. These are called &#8217;scan codes&#8217;. Go <a href="http://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html">here</a> or <a href="http://www.barcodeman.com/altek/mule/scandoc.php">here</a> for more info; and if you are into assembly or electronics, <a href="http://maven.smith.edu/~thiebaut/ArtOfAssembly/CH20/CH20-1.html">here&#8217;s the text</a> from the famous PC assembly language book, &#8220;Art of Assembly&#8221;. This note from <a href="http://msdn.microsoft.com/en-us/library/aa297934(VS.60).aspx">MSDN</a> explains the getch() function.</p>
<p>I wrote and tested this in Visual Studio 2005. Here&#8217;s the code:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co2">#include &quot;stdafx.h&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co2">#include &lt;iostream&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co2">#include &lt;conio.h&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">using namespace std;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">char</span> ch;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;key press detector : use &#8216;z&#8217;, &#8216;x&#8217; or arrow keys&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;press CTRL+C to exit. <span class="es0">\n</span><span class="es0">\n</span>&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">while</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span> <span class="co1">// this is the main loop</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>_kbhit<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// in case of a key is hit, do these</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ch = getch<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span>ch<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;z&#8217;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed z&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;x&#8217;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed x&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;<span class="es0">\0</span>H&#8217;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed up arrow key&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;<span class="es0">\0</span>P&#8217;</span> :</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed down arrow key&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;<span class="es0">\0</span>M&#8217;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed right arrow key&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;<span class="es0">\0</span>K&#8217;</span> :</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;you pressed left arrow key&quot;</span> &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//below line displays the key code</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/cout.html"><span class="kw3">cout</span></a> &lt;&lt; <span class="st0">&quot;key code=&quot;</span> &lt;&lt; <span class="br0">&#40;</span><span class="kw4">int</span><span class="br0">&#41;</span>ch &lt;&lt; endl;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//exit (1); // in this example, it is &quot;exit the program!&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p><a href="http://www.azmeer.info/wp-content/uploads/keyPressDetect-VCC2005.zip">Here&#8217;s the source code and EXE for testing.</a></p>
<p><a href="http://www.talula.demon.co.uk/allegro/" target="_blank">Allegro, a cool game development kit for DOS etc&#8230;</a></p>
<p><a href="http://www.cppgameprogramming.com" target="_blank">And a good Allegro example site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/32/feed</wfw:commentRss>
		</item>
		<item>
		<title>FX from Kushith</title>
		<link>http://www.azmeer.info/archives/30</link>
		<comments>http://www.azmeer.info/archives/30#comments</comments>
		<pubDate>Sun, 27 Jul 2008 13:26:57 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Videos]]></category>

		<category><![CDATA[adobe]]></category>

		<category><![CDATA[FX]]></category>

		<category><![CDATA[kushith]]></category>

		<category><![CDATA[mediasolv]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=30</guid>
		<description><![CDATA[
Kushith Amarasinghe, one of the rare gems Sri Lanka has produced. My reliable creative dude. Our history goes back to 1997  
I am glad to see him settled down finally, at Adobe. Here&#8217;s what he&#8217;s upto now:
Kushith&#8217;s first Adobe TV show episode.  Don&#8217;t forget to view it and give a five star rating ;)   [...]]]></description>
			<content:encoded><![CDATA[<p><object width="300" height="200"><param name="movie" value="http://www.youtube.com/v/cpFCyC1pEg4&amp;rel=0&amp;color1=0xd6d6d6&amp;color2=0xf0f0f0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/cpFCyC1pEg4&amp;rel=0&amp;color1=0xd6d6d6&amp;color2=0xf0f0f0" type="application/x-shockwave-flash" wmode="transparent" width="300" height="200"></object></p>
<p>Kushith Amarasinghe, one of the rare gems Sri Lanka has produced. My reliable creative dude. Our history goes back to 1997 <img src='http://www.azmeer.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <span id="more-30"></span></p>
<p>I am glad to see him settled down finally, at Adobe. Here&#8217;s what he&#8217;s upto now:</p>
<div>Kushith&#8217;s first Adobe TV show episode.  Don&#8217;t forget to view it and give a five star rating ;)   So, get a webcam and send in what ever you want Adobe to know.</div>
<div><a href="http://tv.adobe.com/#v=http%3A//adobe.edgeboss.net/flash/adobe/adobetvprod/ask_the_adobe_one/55_aao_001.flv%3Frss_feedid%3D1069%26xmlvers%3D2" target="_blank">http://tv.adobe.com/#v=http%3A//adobe.edgeboss.net/flash/adobe/adobetvprod/ask_the_adobe_one/55_aao_001.flv%3Frss_feedid%3D1069%26xmlvers%3D2</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/30/feed</wfw:commentRss>
		</item>
		<item>
		<title>Books and articles</title>
		<link>http://www.azmeer.info/archives/28</link>
		<comments>http://www.azmeer.info/archives/28#comments</comments>
		<pubDate>Tue, 01 Jul 2008 13:58:03 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Lectures &amp; Articles]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=28</guid>
		<description><![CDATA[Using the 555 Timer I.C. ?
Few pages from my second book, in Sinhala language. The book covers two ares. First few chapters covers the architecture of 555 timer. Second part covers some interesting projects. All components used are readily avaialble from the famous electronic junk yard &#8216;First Cross Street, Pettah&#8217;  
Here&#8217;s what WiKi says [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://www.azmeer.info/wp-content/uploads/book_Using555Timer.pdf" target="_blank">Using the 555 Timer I.C. ?</a></h2>
<p>Few pages from my second book, in Sinhala language. The book covers two ares. First few chapters covers the architecture of 555 timer. Second part covers some interesting projects. All components used are readily avaialble from the famous electronic junk yard &#8216;First Cross Street, Pettah&#8217; <img src='http://www.azmeer.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <span id="more-28"></span></p>
<p><strong>Here&#8217;s what <a href="http://en.wikipedia.org/wiki/555_timer_IC" target="_blank">WiKi</a> says about the famous &#8216;555&#8242;</strong></p>
<blockquote><p><img src="http://www.azmeer.info/wp-content/uploads/NE555N.jpg" alt="555 IC from Signetics" />The 555 timer is one of the most popular and versatile integrated circuits ever produced. It is an integrated circuit (chip) implementing a variety of timer and multivibrator applications. The IC was designed and invented by Hans R. Camenzind. It was designed in 1970 and introduced in 1971 by Signetics (later acquired by Philips). The original name was the SE555/NE555 and was called &#8220;The IC Time Machine&#8221;. The 555 gets its name from the three 5-kOhm resistors used in typical early implementations (Reference 1). It is still in wide use, thanks to its ease of use, low price and good stability. As of 2003, 1 billion units are manufactured every year.</p></blockquote>
<p>Here&#8217;s an interesting <a href="http://www.falstad.com/circuit/e-555square.html">555 simulator</a> done using Java. <a href="http://www.falstad.com/circuit/e-555int.html">This shows</a> the internals.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/28/feed</wfw:commentRss>
		</item>
		<item>
		<title>Presentations etc&#8230;</title>
		<link>http://www.azmeer.info/archives/27</link>
		<comments>http://www.azmeer.info/archives/27#comments</comments>
		<pubDate>Tue, 01 Jul 2008 08:40:01 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Lectures &amp; Articles]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=27</guid>
		<description><![CDATA[The following presentation were created for various events. As you can see, the topics vary greatly, from creativity to business processes. Click on the topic to load a PDF.


Creative thinking
Explains the thinking process and acquiring knowledge.

Techniques for great design
Explains in detail, how the web works; has interesting basics of color and design elements. Great for [...]]]></description>
			<content:encoded><![CDATA[<p>The following presentation were created for various events. As you can see, the topics vary greatly, from creativity to business processes. Click on the topic to load a PDF.<span id="more-27"></span></p>
<ol>
<li>
<h3><a href="http://www.azmeer.info/wp-content/uploads/ppt_Creative_Thinking.pdf" target="_blank">Creative thinking</a></h3>
<p>Explains the thinking process and acquiring knowledge.</li>
<li>
<h3><a href="http://www.azmeer.info/wp-content/uploads/ppt_WebTechniques.pdf" target="_blank">Techniques for great design</a></h3>
<p>Explains in detail, how the web works; has interesting basics of color and design elements. Great for beginners.</li>
<li>
<h3><a href="http://www.azmeer.info/wp-content/uploads/ppt_entreprenuership.pdf" target="_blank">Entrepreneurship</a></h3>
<p>Thinking of starting on your own? Read this before you do.</li>
<li>
<h3><a href="http://www.azmeer.info/wp-content/uploads/ppt_WhySriLankaForOutsourcing.pdf" target="_blank">Is Sri Lanka ready for ICT projects ? </a></h3>
<p>This was presented to a foreign firm to evaluate the suitability of setting up their outsource operation in Sri Lanka. Good facts about the local ICT industry though they are bit outdated now.</li>
<li>
<h3><a href="http://www.azmeer.info/wp-content/uploads/ppt_WhatIsBluetooth.pdf" target="_blank">What is Bluetooth ?</a></h3>
<p>An introductory powerpoint, presented during the IT Day at the Gateway International School, February 2003. Some figures require updating.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/27/feed</wfw:commentRss>
		</item>
		<item>
		<title>Beautiful Sri Lanka</title>
		<link>http://www.azmeer.info/archives/26</link>
		<comments>http://www.azmeer.info/archives/26#comments</comments>
		<pubDate>Sun, 29 Jun 2008 08:30:42 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Videos]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=26</guid>
		<description><![CDATA[
Produced by Sri Lanka Tourist board, themed &#8220;Small Island, Big Trip&#8221;.
Here&#8217;s the YouTube link
]]></description>
			<content:encoded><![CDATA[<p><object width="300" height="200"><param name="movie" value="http://www.youtube.com/v/_sM9vcAIYyc&amp;rel=0&amp;color1=0xd6d6d6&amp;color2=0xf0f0f0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/_sM9vcAIYyc&amp;rel=0&amp;color1=0xd6d6d6&amp;color2=0xf0f0f0" type="application/x-shockwave-flash" wmode="transparent" width="300" height="200"></object><br />
Produced by Sri Lanka Tourist board, themed &#8220;Small Island, Big Trip&#8221;.<br />
<a href="http://www.youtube.com/watch?v=_sM9vcAIYyc">Here&#8217;s the YouTube link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/26/feed</wfw:commentRss>
		</item>
		<item>
		<title>ePDA : The world&#8217;s first bluetooth, Unix, ARM based PDA</title>
		<link>http://www.azmeer.info/archives/8</link>
		<comments>http://www.azmeer.info/archives/8#comments</comments>
		<pubDate>Sat, 28 Jun 2008 12:36:58 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Mechatronics]]></category>

		<category><![CDATA[ARM]]></category>

		<category><![CDATA[bluetooth]]></category>

		<category><![CDATA[ePDA]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=8</guid>
		<description><![CDATA[I would like to share some of the rare pictures of ePDA. A brave project started by MediaSolv in 1999. It was ahead of its time, just like many other projects MediaSolv tried hard to commercialize.
The idea for a hand held device came while I was discussing my (then) current activities with Vasee. If my [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-9" style="border: 1px solid black;" title="ePDA last prototype" src="http://www.azmeer.info/wp-content/uploads/dscf0003.jpg" alt="" width="290" height="200" />I would like to share some of the rare pictures of ePDA. A brave project started by MediaSolv in 1999. It was ahead of its time, just like many other projects MediaSolv tried hard to commercialize.<span id="more-8"></span></p>
<p>The idea for a hand held device came while I was discussing my (then) current activities with Vasee. If my memory is right this was in October 1999. I was explaining my new found gadget, the <a href="http://www.rabbit.com/">Rabbit processor</a> evaluation board and <a href="http://www.bluetooth.org">bluetooth </a>radio technology. I was busy building a robot control board that can be operated wirelessly with a PC. This was also the time MediaSolv was experimenting with <a href="http://www.mobileinfo.com/WAP/what_is.htm">WAP.</a> The idea was to access BizOA through a mobile phone.</p>
<p>Both of us spent the rest of the evening discussing how this idea of bluetooth and the embedded controller can be used to design a low-cost access device for the masses. I was given the fullest support and a free hand to conceptualize idea and to come up with a plan to get this done, as usual, ASAP <img src='http://www.azmeer.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The rest, as they say, is history&#8230;</p>
<p>BTW here are the features/functions we experienced:</p>
<ul>
<li>Full QWERTY keyboard</li>
<li>Bluetooth radio</li>
<li>Works on two AAA batteries</li>
<li>Graphic mode LCD screen</li>
<li>uCLinux</li>
<li>Full office application suite (diary, email, calendar, etc&#8230;)</li>
<li>Input/output in both English and Sinhala</li>
</ul>
<p>I guess Flickr would be more appropriate for this purpose. <a title="ePDA" href="http://flickr.com/photos/10197404@N07/sets/72157605746038390/" target="_blank">Please click here to see the album.</a> Dont forget to add your comment too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/8/feed</wfw:commentRss>
		</item>
		<item>
		<title>Increasing the effectiveness by &#8216;information architecture&#8217;</title>
		<link>http://www.azmeer.info/archives/21</link>
		<comments>http://www.azmeer.info/archives/21#comments</comments>
		<pubDate>Tue, 24 Jun 2008 14:16:19 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Art &amp; Design]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=21</guid>
		<description><![CDATA[A reader is someone with an attention span of about 30 seconds - a person assailed by other forces competing for attention. At one time these forces weren't so numerous: newspapers, radio, spouse, home, children. Today they also include a "home entertainment center" (TV, VCR, Tapes, CDs), pets, a fitness program, a yard and all [...]]]></description>
			<content:encoded><![CDATA[<p><code>A reader is someone with an attention span of about 30 seconds - a person assailed by other forces competing for attention. At one time these forces weren't so numerous: newspapers, radio, spouse, home, children. Today they also include a "home entertainment center" (TV, VCR, Tapes, CDs), pets, a fitness program, a yard and all the gadgets that have been bought to keep it spruce, and that most potent of competitors, sleep. The person snoozing in a chair with a magazine or a book is a person who was being given too much unnecessary trouble by the writer.</code><span id="more-21"></span></p>
<p align="right"><code><br />
<strong>William Zinsser</strong>, On Writing Well, 5th ed.<br />
(New York: HarperCollins, 1994)</code></p>
<hr style="text-align: right;" />
<p>Starting with <a href="http://www.adobe.com/pagemaker/" target="_blank">Aldus Page Maker v3</a>, back in early nineties (<a href="http://www.adobe.com/" target="_blank">Adobe</a> owns it now), I started experimenting with &#8216;Good Design&#8217;. Currently <a href="http://www.corel.com">Corel Draw</a>, Adobe Illustrator, Photoshop, Page Maker &amp; InDesign are my favorite tools. With these tools It is really fascinating to create brochures, logos, books, web sites, etc&#8230; I believe design is a skill that requires a fine eye and an understanding of human behavior (or more accurately psychology). Selecting the most suitable font size and face for the job to laying out the components is something that one need to pay attention to, in order to make the document effective.</p>
<p>In here you&#8217;ll find some documents re-designed by me in-order to increase the effectiveness, while others are original art-work designed for various instances.</p>
<ol>
<li><strong>John Argenti&#8217;s Trajectories of Corporate Collapse</strong><br />
A very interesting document I developed for the MBA program. Shows 3 scenarios and possible solutions. Available as a <a href="http://www.azmeer.info/wp-content/uploads/Argenti_Trajectories.pdf"><img class="alignnone size-full wp-image-22" title="icon pdf" src="http://www.azmeer.info/wp-content/uploads/files_pdf1.gif" alt="icon pdf" width="24" height="11" /></a> file.</li>
<p></p>
<li><strong>Five value propositions that are reshaping the relationships between companies and their customers.</strong><br />
Five things you must satisfy in order to become successful; Give smarter choices, Faster is better, Do the right thing, Treat partners right, Know what customers want. These may seem as obvious but then, read the document for more information. Available as a <a href="http://www.azmeer.info/wp-content/uploads/ValueProposition.pdf" target="_blank"><img class="alignnone size-full wp-image-23" title="icon pdf" src="http://www.azmeer.info/wp-content/uploads/files_pdf2.gif" alt="icon pdf" width="24" height="11" /></a> file.</li>
<p></p>
<li><strong>Strategies for New Zealand beef industry.</strong><br />
Winner of &#8216;Best Paper&#8217; award; developed for &#8216;International Marketing&#8217; subject during my MBA. The paper looks at the current beef markets around the world and suggests few strategies for New Zealand. Available as a <a href="http://www.azmeer.info/wp-content/uploads/files_pdf2.gif"><img class="alignnone size-full wp-image-23" title="icon pdf" src="http://www.azmeer.info/wp-content/uploads/files_pdf2.gif" alt="icon pdf" width="24" height="11" /></a> file.</li>
<p></p>
<li><strong>Sri Lanka Post Codes</strong><br />
Although this was introduced some time back, due to the difficulty in finding the relevant codes, the public don&#8217;t use them often. Well, now you have this from me <img src='http://www.azmeer.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Enjoy and please pass on. Available as a <a href="http://www.azmeer.info/wp-content/uploads/SriLankaPostalCodes.pdf" target="_blank"><img class="alignnone size-full wp-image-23" title="icon pdf" src="http://www.azmeer.info/wp-content/uploads/files_pdf2.gif" alt="icon pdf" width="24" height="11" /></a> file.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/21/feed</wfw:commentRss>
		</item>
		<item>
		<title>Robot hand PC interface</title>
		<link>http://www.azmeer.info/archives/11</link>
		<comments>http://www.azmeer.info/archives/11#comments</comments>
		<pubDate>Tue, 24 Jun 2008 12:49:55 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[Mechatronics]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=11</guid>
		<description><![CDATA[I guess my love for robots started when I was in eighth grade or so. It must be the tele-series &#8216;Battle Star Galactica&#8216; and continues visits to my school library&#8217;s, &#8217;science - reference only&#8217; section. The various colorful sci-fi dreams kept my head full. I had sketches of weird machines all over my textbooks! The [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.azmeer.info/wp-content/uploads/robot.gif"><img class="alignleft alignnone size-medium wp-image-12" style="border: 1px solid black; margin: 5px; float: left;" title="robot hand" src="http://www.azmeer.info/wp-content/uploads/robot.gif" alt="Robot Hand" width="120" height="90" /></a>I guess my love for robots started when I was in eighth grade or so. It must be the tele-series &#8216;<a href="http://en.wikipedia.org/wiki/Battlestar_Galactica" target="_blank">Battle Star Galactica</a>&#8216; and continues visits to my school library&#8217;s, &#8217;science - reference only&#8217; section. The various colorful sci-fi dreams kept my head full. I had sketches of weird machines all over my textbooks! The first useful &#8216;gadget&#8217; must have been a &#8216;water powered dish washer&#8217;. The idea was never realized, unfortunately. And then I designed my first character ROM using mechanical parts. After discovering digital electronics, I started laughing at my old ideas! Jeez what a waste of brainpower.<span id="more-11"></span></p>
<p>While I was in Sharjah, in 1991, I came across a 5-axis robot hand in a toyshop. They had only about 2 or so units and were stored in a place where no one can see unless you are searching for it. As soon as I saw the yellow hand on the cover, I jumped at it and bought one right then. It&#8217;s made by QuickShot and can be operated by two joysticks (You know the old Atari type, mechanical buttons). After reverse engineering the internal circuit I wanted to control the robot hand with my PC (then, a state of the art Hyundai PC-XT, with 1MB Ram and two 360K floppy drives!).</p>
<p>Internally, the hand uses two-transistor bridge circuits to turn motors clock and anti-clock wise. There are totally 5 motors. The only trouble with this gadget is that there is no way to find the present location, since the motors are just plain vanilla DC type. After all, this is a toy!</p>
<p>My first try was to go all solid state. I tried using CMOS (analog) switch approach. Couple of 4016s and the PC LPT port should do it, so I thought. I built a good-looking PCB for this. And it all came very well, just the way I planned. But, then I figured the motors were drawing more current than these tiny little CMOS chips could handle. I thought of switching to mechanical relays.</p>
<p>Enter &#8216;Aromat&#8217;, PCB relay. These I found while I was shopping in Sim Lim Tower (the famous place for electronic junk in Singapore). This little relay was exactly what I was looking for, 5V, 16 pin DIP compatible, and handles 2A at 30VDC! I used a &#8216;Vero&#8217; board for this prototype. The circuit works todate without a hitch!</p>
<p>The &#8216;big&#8217; board next to the relay board is my &#8216;all purpose buffered LPT interface&#8217;; specially designed for experimenting and interfacing with LPT port.</p>
<p><a href="http://www.azmeer.info/wp-content/uploads/robothand.jpg"><img class="alignnone size-thumbnail wp-image-18" style="border: 1px solid black;" title="robot hand" src="http://www.azmeer.info/wp-content/uploads/robothand-150x150.jpg" alt="robot hand" width="150" height="150" /></a><a href="http://www.azmeer.info/wp-content/uploads/v1.jpg"> <img class="alignnone size-thumbnail wp-image-14" style="border: 1px solid black;" title="Robot controller" src="http://www.azmeer.info/wp-content/uploads/v1-150x150.jpg" alt="Robot controller" width="150" height="150" /></a><a href="http://www.azmeer.info/wp-content/uploads/v1.jpg" target="_blank"> </a><a href="http://www.azmeer.info/wp-content/uploads/v2_relayandlptboard.jpg"><img class="alignnone size-thumbnail wp-image-16" style="border: 1px solid black;" title="Relay board" src="http://www.azmeer.info/wp-content/uploads/v2_relayandlptboard-150x150.jpg" alt="Relay board" width="150" height="150" /> </a><a href="http://www.azmeer.info/wp-content/uploads/v2relay_closeup.jpg"><img class="alignnone size-thumbnail wp-image-17" style="border: 1px solid black;" title="relay board closeup" src="http://www.azmeer.info/wp-content/uploads/v2relay_closeup-150x150.jpg" alt="relay board closeup" width="150" height="150" /><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/11/feed</wfw:commentRss>
		</item>
		<item>
		<title>LED animation</title>
		<link>http://www.azmeer.info/archives/7</link>
		<comments>http://www.azmeer.info/archives/7#comments</comments>
		<pubDate>Sat, 21 Jun 2008 01:15:59 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[LED light and magic]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/archives/7</guid>
		<description><![CDATA[It is right to say that I&#8217;m obsessed with LEDs. I simply love them; red, green, amber, yellow, now even blue and white!. I remember somewhere around 1985, when I first saw someone building a LED blinker (transistor based astable multi vibrator; for the tech savvy crowd), I was really fascinated. At that time, only [...]]]></description>
			<content:encoded><![CDATA[<p>It is right to say that I&#8217;m obsessed with LEDs. I simply love them; red, green, amber, yellow, now even blue and white!. I remember somewhere around 1985, when I first saw someone building a LED blinker (transistor based astable multi vibrator; for the tech savvy crowd), I was really fascinated. At that time, only red and green LEDs were available in the market, and were pretty expensive for a schooling kid like me. I guess LEDs attracted my attention towards electronics.<span id="more-7"></span></p>
<h3>Really simple LED circuits</h3>
<p>Here&#8217;s what attracted me to the world of electronics</p>
<ul>
<li>2 transistor LED blinker</li>
<li>Interfacing 2 separate units</li>
<li>The simple 10 LED sequencer with 555 timer IC for speed control</li>
<li>Here&#8217;s my solution to the expansion - a neat trick using transistor&#8217;s gate function<br />
CD4017 based 100 LED sequencer</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/7/feed</wfw:commentRss>
		</item>
		<item>
		<title>Validating a phone number</title>
		<link>http://www.azmeer.info/archives/6</link>
		<comments>http://www.azmeer.info/archives/6#comments</comments>
		<pubDate>Sat, 19 Apr 2008 14:05:43 +0000</pubDate>
		<dc:creator>Azmeer</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.azmeer.info/?p=6</guid>
		<description><![CDATA[Take few business cards or perhaps advertisements and see how they have shown the phone number. Here are some variants.
+94-11-2906788
+(94)11.2.906788
94-11-2-906788
94112906788
011-2906788
011-2-906788
00112906788
000000112906788
Now, say you have an application that is expecting a ‘proper’ phone number; may be to send a text message automatically or something. Do you see the problem? Users type the number using all kinds of [...]]]></description>
			<content:encoded><![CDATA[<p>Take few business cards or perhaps advertisements and see how they have shown the phone number. Here are some variants.<span id="more-6"></span></p>
<p>+94-11-2906788<br />
+(94)11.2.906788<br />
94-11-2-906788<br />
94112906788<br />
011-2906788<br />
011-2-906788<br />
00112906788<br />
000000112906788</p>
<p>Now, say you have an application that is expecting a ‘proper’ phone number; may be to send a text message automatically or something. Do you see the problem? Users type the number using all kinds of formats, even when you give instructions, it is up to the programmer to clean the number. Let’s see how we do this with some javascript magic.</p>
<h2>The process</h2>
<p>A proper phone number has 10 digits; and the first digit must not be a zero.</p>
<p>Let’s get our hands dirty, we know that the phone number can have ONLY numbers. So the first step is to remove all non digit items. Once we do that we take the last 10 digits. Now all we need to do is to check the first digit for zero. Here’s the simplified logic diagram.<br />
<a title="logic-phoneNumberValidation" href="../wp-content/uploads/logic-phonenumbervalidation.png"></a></p>
<p style="text-align: center"><a title="logic-phoneNumberValidation" href="../wp-content/uploads/logic-phonenumbervalidation.png"><img src="../wp-content/uploads/logic-phonenumbervalidation.png" border="0" alt="logic-phoneNumberValidation" /></a></p>
<h2>Code</h2>
<p>A regular expression (RegEx) is really just a sequence or pattern of characters that is matched against a string of text when performing searches and replacements. A simple regular expression consists of a character or set of characters that matches itself. The regular expression is normally delimited by forward slashes; for example, /abc/.</p>
<p>Like Perl, JavaScript provides a large variety of regular expression metacharacters to control the way a pattern is found. The metacharacters are used to control the search pattern; you can look for strings containing only digits, only alphas, a digit at the beginning of the line followed by any number of alphas, a line ending with a digit, and so on. When searching for a pattern of characters, the possibilities of fine-tuning your search are endless.</p>
<p>I decided to use the power of the string object with RegEx. The replace() method from the string object is used to search for a string and replace the string with another string. First we need to create the pattern to match. So the line</p>
<pre>var regex1 = /[^0-9]/ig; //remove non-digits</pre>
<p>Creates a variable named ‘regex1’.  [^0–9], matches a non-digit (same as \D), ‘^’ means, negate, ie: NOT in set. The ‘I’ modifier is used to turn off case sensitivity and the ‘g’ modifier makes the replacement global; that is, all occurrences of the found pattern are replaced with the new string.</p>
<pre>var phonein = phonein.replace(regex1, "");</pre>
<p>Executes the replace method of the string object. What we are saying is to look for the pattern from regex1 and replace them with nothing, or essentially remove them!</p>
<p>Now we need to get the last 10 digits. In order to do that, first we need to find the length of the string. We do this in two steps:</p>
<pre>var startpos = phonein.length-10; //find the length
phonein = phonein.substr(startpos); //get the last 10 digits</pre>
<h2>Conclusion</h2>
<p>Although I used Javascript here, it will not be difficult to port this code to any other language. Just step through the algorithm and you will be fine.</p>
<h2>Downloads</h2>
<p>HTML with javascript source code</p>
<p>You can test the code here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azmeer.info/archives/6/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
