<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uncertain Binary Thoughts</title>
	<atom:link href="http://ankurs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ankurs.com</link>
	<description>01110100110101010101011101100010</description>
	<lastBuildDate>Mon, 30 Aug 2010 16:51:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Weekend Project II</title>
		<link>http://ankurs.com/2010/08/weekend-project-ii/</link>
		<comments>http://ankurs.com/2010/08/weekend-project-ii/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 16:22:33 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[bada]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[pong]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[qt]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[sensors]]></category>
		<category><![CDATA[tilt]]></category>
		<category><![CDATA[weekend]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=656</guid>
		<description><![CDATA[In march i posted about a weekend project which involved controlling a small toy car using my cell phone, this is a similar one again implemented in few hours, here we are trying to play the awesome game of pong using the tilt sensor on Samsung Wave. The pong application running on Laptop is written]]></description>
			<content:encoded><![CDATA[<p>In march i posted about a <a href="http://ankurs.com/2010/03/weekend-project/">weekend project</a> which involved controlling a small toy car using my cell phone, this is a similar one again implemented in few hours, here we are trying to play the awesome game of pong using the tilt sensor on Samsung Wave. The pong application running on Laptop is written in <a href="http://qt.nokia.com/">Qt</a> (C++) and the application on the Phone is written using the <a href="http://www.bada.com/">Bada SDK</a>.<br />
The working is simple, the pong application running on Laptop requires phones to make a TCP connection to it. Phones just create a TCP connection to the application on PC and sends tilt sensor data to it, movement of paddles is done by the PC application based on the value it receives from the phones. It still <strong>requires better calibration</strong> and we will work on it after the exams are over (Education prevents you from doing cool things!!), there are a lot of ideas buzzing in our empty heads (according to our teachers!!) , the original idea was by <a href="http://abhikumar777.blogspot.com/">Abhimanyu</a> which we implemented.</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/dHinEjh8iIw?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/dHinEjh8iIw?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Aw15OuquzcQ?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Aw15OuquzcQ?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>if you cannot see the above video <a href="http://www.youtube.com/watch?v=dHinEjh8iIw">here</a> and <a href="http://www.youtube.com/watch?v=Aw15OuquzcQ">here</a> are short demo of how it works.</p>
<p>PS &#8211; code and proper working for the previous and this weekend project will be posted soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/08/weekend-project-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>4 weeks at Microsoft (Internship)</title>
		<link>http://ankurs.com/2010/06/4-weeks-at-microsoft/</link>
		<comments>http://ankurs.com/2010/06/4-weeks-at-microsoft/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 23:08:19 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[hyderabad]]></category>
		<category><![CDATA[idc]]></category>
		<category><![CDATA[India]]></category>
		<category><![CDATA[internship]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=627</guid>
		<description><![CDATA[It has been 4 weeks since i arrived in Hyderabad for my internship at Microsoft IDC and it has been a unique experience. There are 7 people from MIT,Manipal this time 6 in IDC and 1 in MS IT, but manipal being the crowded place it is none of the 7 people knew each other,]]></description>
			<content:encoded><![CDATA[<div id="attachment_646" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2010/06/30314_10150207747590258_707590257_13113994_6380796_n.jpg"><img src="http://ankurs.com/wp-content/uploads/2010/06/30314_10150207747590258_707590257_13113994_6380796_n-300x202.jpg" alt="Hello From Hyderabad" title="Hello From Hyderabad" width="300" height="202" class="size-medium wp-image-646" /></a><p class="wp-caption-text">Hello From Hyderabad</p></div>
<p>It has been 4 weeks since i arrived in Hyderabad for my internship at Microsoft IDC and it has been a unique experience. There are 7 people from MIT,Manipal this time 6 in IDC and 1 in MS IT, but manipal being the crowded place it is none of the 7 people knew each other, well except for me which was kind of odd, imagine having to introduce people who have spent 3 years in the same college to each other !!. Akshay jhori (MS IT) arrived one week before us i.e. 23rd May (i guess) and rest of us arrived by 30th May. First day we were given a small orientation, which was just to get us familiar with how things work and what we were supposed to do, after the orientation we were taken to our respective Mentors who is the go to guy for all things related to what ever we were supposed to do, i was assigned to <a href="https://adcenter.microsoft.com/">AdCenter</a> team. I was given a cubicle and later my mentor explained what i was supposed to do for the next 8 weeks and was asked to get familiar with MS tools and process.</p>
<p>Hyderabad is kind of a strange city where if you ask an auto rickshaw driver to go to a place X he will simply say &#8220;i have no idea where that place is, but it will cost you Rs100&#8243;, so most of the time you need to look up on maps for directions and then tell the auto driver where you have to go, which is what we did after loosing our way few times, it all starts with Someone saying &#8220;Hey lets go out and see around&#8221; to which you say &#8220;Ok nice, lets find a good place to eat!!&#8221;, after walking a few kilometers and looking around and probably eating, when its time to return someone is bound to ask &#8220;Which way ?&#8221; and atleast one guy from your group will say &#8220;Its this way, TRUST ME!&#8221; by point to a particular direction in the INDIAN WAY, believe me that is the time when you should start asking for directions because every time the &#8220;TRUST ME&#8221; incident happened with us, we were going in completely wrong direction.</p>
<p>Coming back to the four weeks, for the first 2 weeks we were provided accommodation in white fields (Hyderabad, not Bangalore as most the people were thinking after i told them where i was staying), the place was good and around 5-6 Km from MS IDC at Gachibowli, you get shuttles from ~9am to ~10am and if you are taking an auto just say you want to go to Wipro, Gachibowli and not Microsoft, Gachibowli you will have to pay less this way, even tough Wipro Campus is just in front of Microsoft Campus, ohh and the sharing auto is a very cheap way to travel around in Hyderabad but it gets weird, i remember there were 8 people + 1 auto driver in a single auto one time.</p>
<div id="attachment_642" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2010/06/36912_10150217080125258_707590257_13408192_3588140_n.jpg"><img src="http://ankurs.com/wp-content/uploads/2010/06/36912_10150217080125258_707590257_13408192_3588140_n-300x225.jpg" alt="Microsoft Surface" title="Microsoft Surface " width="300" height="225" class="size-medium wp-image-642" /></a><p class="wp-caption-text">Microsoft Surface</p></div>
<p>I got my hands on Microsoft Surface at the visitor center and it has increased my desire to create something like surface using what is already available by <a href="http://wiki.nuigroup.com/About_us">NUI Group</a>, dunno if it will get somewhere. Also i have started to like C# as a language and i have personally found it to be more close to C++ then Java, which is not what a large number of people think, this has also made me realize that there is no computer language that i hate which is kind of strange because most of the people i know hate one or the other language and JAVA tops most of their list as the most hated (but used) language.</p>
<p>During my 2nd week AdCenter team had an outing to <a href="http://leonia.in/">Leonia</a> which was a great experience, i met some interesting people from AdCenter team during the trip and the best part was<a href="http://en.wikipedia.org/wiki/Paintball"> Paint Ball</a>, a match in team of 22 Vs 22 it was pure fun, well except for the friendly fire part, where i got shot in the arm from a really close distance, anyways we lost the game because of what was clearly CHEATING done by other team but that is as always debatable.</p>
<p>After our 2 weeks were over we shifted out to a different place in White Fields itself, if someone is looking for accommodation there are plenty of places in HiTech city / Madhapur area to stay for short/long duration, we looked at a large number of places before settling for white fields because its close and we were familiar with this area now, plus the price difference was not much.</p>
<div id="attachment_640" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2010/06/37220_10150217086085258_707590257_13408351_3774171_n.jpg"><img class="size-medium wp-image-640" title="Microsoft India Development Center" src="http://ankurs.com/wp-content/uploads/2010/06/37220_10150217086085258_707590257_13408351_3774171_n-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Microsoft India Development Center - Building 3</p></div>
<p>The first few weeks were pretty exciting but now after 4 weeks everything seems normal to us, all the free coffee/tea/ice tea/cold drinks/etc, all the games of pool/<a href="http://en.wikipedia.org/wiki/Foosball">foosball</a>/TableTennis, cab drop at night, the cubicle, all the excitement is gone and work has started.<br />
anyways i am planing to roam around Hyderabad which i have done only a little, any special places that i should absolutely visit ? leave a comment&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/06/4-weeks-at-microsoft/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Finite State Machines in C</title>
		<link>http://ankurs.com/2010/04/simple-finite-state-machines-in-c/</link>
		<comments>http://ankurs.com/2010/04/simple-finite-state-machines-in-c/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 21:42:15 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[finite]]></category>
		<category><![CDATA[fsm]]></category>
		<category><![CDATA[machine]]></category>
		<category><![CDATA[state]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=617</guid>
		<description><![CDATA[I was having discussion about State Machines with one of my friend, regarding pro&#8217;s and con&#8217;s of implementing programs as Sate Machines, it was then that i realised there is no simple way to implement programs as Finite State Machines, so here is a very basic implementation of FSM in C file: fsm.h contains the]]></description>
			<content:encoded><![CDATA[<p>I was having discussion about State Machines with one of my friend, regarding pro&#8217;s and con&#8217;s of implementing programs as Sate Machines, it was then that i realised there is no simple way to implement programs as Finite State Machines, so here is a very basic implementation of FSM in C</p>
<p>file: <a href="http://gist.github.com/raw/355708/8046352e1209396bc7485dfa8e7ab9236d685e89/fsm.h">fsm.h</a> contains the function definition for our FSM<br />
<script src="http://gist.github.com/355708.js?file=fsm.h"></script></p>
<p><span id="more-617"></span><br />
file: <a href="http://gist.github.com/raw/355708/4a1b7b3d51b5f470a6c5e4344fb69e5e1ebbebc4/fsm.c">fsm.c</a> contains the function implementation for our FSM<br />
<script src="http://gist.github.com/355708.js?file=fsm.c"></script></p>
<p>file: <a href="http://gist.github.com/raw/355708/3b79787def0978345fa9ae3b67a2daf3ab89102a/main.c">main.c</a> contains an example on how this FSM can be used<br />
<script src="http://gist.github.com/355708.js?file=main.c"></script></p>
<p>PS &#8211; If you are reading this post on a blog aggregator  like planet you can view full post <a href="http://ankurs.com/2010/04/simple-finite-state-machines-in-c/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/04/simple-finite-state-machines-in-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Weekend Project</title>
		<link>http://ankurs.com/2010/03/weekend-project/</link>
		<comments>http://ankurs.com/2010/03/weekend-project/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 19:52:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[car]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[rf]]></category>
		<category><![CDATA[toy]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=607</guid>
		<description><![CDATA[In Dec 2009 at foss.in at the maemo stall i saw a guy control a small toy car through accelerometer on his N900, i thought of replicating that but it just remained in my mind, so last Saturday i finally decided to implement it and went straight to a toy store and bought a toy]]></description>
			<content:encoded><![CDATA[<p>In Dec 2009 at foss.in at the maemo stall i saw a guy control a small toy car through accelerometer on his N900, i thought of replicating that but it just remained in my mind, so last Saturday i finally decided to implement it and went straight to a toy store and bought a toy RF car, one hour of hacking and i was able to control the small car through by phone (Nokia E61i) here is the video of it working.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tdfnt-a7vkM&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/tdfnt-a7vkM&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/XK8eOvkX14U&amp;hl=en_US&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/XK8eOvkX14U&amp;hl=en_US&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>the concept is simple, i send commands through my phone over wifi to my laptop which controls the car remote, controlling a toy car remote is very easy with a Parallel port and few transistors but laptops don&#8217;t have parallel ports, so i used a micro-controller in between to sort that out, so now micro controller controls the car remote by acting on signals received over UART from laptop.<br />
the working is Phone &#8212;(WiFi)&#8212;&gt;Laptop &#8212;(USB/UART)&#8212;&gt; Micro controller &#8212;(Relays)&#8212;&gt; Car Remote &#8212;(RF)&#8212;&gt; Toy Car<br />
will post details with code sometime later</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/03/weekend-project/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>strange thing in python</title>
		<link>http://ankurs.com/2010/02/strange-thing-in-python/</link>
		<comments>http://ankurs.com/2010/02/strange-thing-in-python/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 12:52:17 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=599</guid>
		<description><![CDATA[i recently noticed this anyone has a proper explanation for this for literals i get this &#62;&#62;&#62; def a(): ...     b = [] ...     c = {} ... &#62;&#62;&#62; import dis &#62;&#62;&#62; dis.dis(a) 2 0 BUILD_LIST               0 3 STORE_FAST               0 (b) 3 6 BUILD_MAP                0 9 STORE_FAST               1 (c) 12 LOAD_CONST               0 (None) 15 RETURN_VALUE but for]]></description>
			<content:encoded><![CDATA[<p>i recently noticed this anyone has a proper explanation for this</p>
<p>for literals i get this<br />
<code><br />
&gt;&gt;&gt; def a():<br />
...     b = []<br />
...     c = {}<br />
...<br />
&gt;&gt;&gt; import dis<br />
&gt;&gt;&gt; dis.dis(a)<br />
2 0 BUILD_LIST               0<br />
3 STORE_FAST               0 (b)</code><br />
<code><br />
3 6 BUILD_MAP                0<br />
9 STORE_FAST               1 (c)<br />
12 LOAD_CONST               0 (None)<br />
15 RETURN_VALUE</code></p>
<p>but for constructors i get this<br />
<code><br />
&gt;&gt;&gt; def a():<br />
...     b = list()<br />
...     c = dict()<br />
...<br />
&gt;&gt;&gt; dis.dis(a)<br />
2  0 LOAD_GLOBAL              0 (list)<br />
3 CALL_FUNCTION            0<br />
6 STORE_FAST               0 (b)</code><br />
<code><br />
3  9 LOAD_GLOBAL              1 (dict)<br />
12 CALL_FUNCTION            0<br />
15 STORE_FAST               1 (c)<br />
18 LOAD_CONST               0 (None)<br />
21 RETURN_VALUE<br />
</code><br />
i mean why the difference, i was thinking {} and dict() do the same thing, shouldn&#8217;t they?</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/02/strange-thing-in-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Begining Python workshop</title>
		<link>http://ankurs.com/2010/01/begining-python-workshop/</link>
		<comments>http://ankurs.com/2010/01/begining-python-workshop/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 21:09:33 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=593</guid>
		<description><![CDATA[LUG Manipal is organising a workshop on python, Workshop is aimed at people interested in beginning programming with python.No programming experience required. Details are -&#62; Time: 5:30 pm Place: NLH 103 Date: 29th JAN to 3rd FEB PS :- Slides for the workshop are available Begining Python Slides]]></description>
			<content:encoded><![CDATA[<div id="attachment_594" class="wp-caption aligncenter" style="width: 222px"><a href="http://ankurs.com/wp-content/uploads/2010/01/python.jpg"><img class="size-medium wp-image-594" title="LUG Manipal python workshop" src="http://ankurs.com/wp-content/uploads/2010/01/python-212x300.jpg" alt="LUG Manipal python workshop" width="212" height="300" /></a><p class="wp-caption-text">LUG Manipal python workshop poster</p></div>
<p>LUG Manipal is organising a workshop on python, Workshop is aimed at people interested in beginning programming with python.No programming experience required.</p>
<p>Details are -&gt;<br />
Time: 5:30 pm<br />
Place: NLH 103<br />
Date: 29th JAN to 3rd FEB</p>
<p>PS :- Slides for the workshop are available <a href="http://ankurs.com/wp-content/uploads/2010/01/python.pdf">Begining Python Slides</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2010/01/begining-python-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobi Vision 2.0 Slides</title>
		<link>http://ankurs.com/2009/10/mobi-vision-2-0-slides/</link>
		<comments>http://ankurs.com/2009/10/mobi-vision-2-0-slides/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 12:30:55 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=561</guid>
		<description><![CDATA[First and Second Phase for MobiVision 2.0 is long over, and we can call it a workshop well done, the slides are here Mobi Vision 2.0 View more documents from Ankur Shrivastava.]]></description>
			<content:encoded><![CDATA[<p>First and Second Phase for MobiVision 2.0 is long over, and we can call it a workshop well done, the slides are here</p>
<div style="width:425px;text-align:left" id="__ss_2267468"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/ankur.os/mobi-vision-20" title="Mobi Vision 2.0">Mobi Vision 2.0</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=homeankurdesktopdump1mobivisionmobivision-091018161227-phpapp01&#038;stripped_title=mobi-vision-20" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=homeankurdesktopdump1mobivisionmobivision-091018161227-phpapp01&#038;stripped_title=mobi-vision-20" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/ankur.os">Ankur Shrivastava</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/10/mobi-vision-2-0-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with pthread</title>
		<link>http://ankurs.com/2009/09/getting-started-with-pthread/</link>
		<comments>http://ankurs.com/2009/09/getting-started-with-pthread/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 19:38:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[begining]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[pthread]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=562</guid>
		<description><![CDATA[Recently i have started coding in C a lot and what i came across from a lot of people is that doing Threading in C is very hard, is it really like that? here is a simple Pthread program that should clear that up get it here in the above program i have just created]]></description>
			<content:encoded><![CDATA[<p>Recently i have started coding in C a lot and what i came across from a lot of people is that doing Threading in C is very hard, is it really like that? here is a simple Pthread program that should clear that up<br />
<script src="http://gist.github.com/179778.js"></script><br />
get it <a href="http://gist.github.com/179778">here</a></p>
<p>in the above program i have just created 2 threads and passed thr1 ( = 1 ) and thr2 ( = 2 ) values as parameters the function void * thread ( void * ptr ) is executes as a separate thread, we create two thread objects thread1 and thread2, and start threads using pthread_create function passing thread object, function pointer and parameters as arguments, here NULL specifies default attributes for the thread, we can change this by passing pthread_attr_t structure instead of NULL.<br />
we wait for the threads to finish using the pthread_join function<br />
One major problem that is faced by most of the people is of using a library which is not a thread safe library, so you need to be careful about the libraries you use in your program, if not sure about a particular library being thread safe, just assume it not to be thread safe</p>
<p>PS &#8211; No updates from a long time as i dont have a proper net connection &#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/09/getting-started-with-pthread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple python socket chat example</title>
		<link>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/</link>
		<comments>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:08:34 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[socket]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=557</guid>
		<description><![CDATA[i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230; download here]]></description>
			<content:encoded><![CDATA[<p>i was trying to explain sockets to one of my friend and this is what i used, the code should be self explanatory, this is a very simple application of sockets&#8230;</p>
<p><script src="http://gist.github.com/145536.js"></script></p>
<p>download <a href="http://gist.github.com/raw/145536/753a6d62042163710647574ea723c42807f44aef/python-socket-chat.py">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/07/a-simple-python-socket-chat-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Manipal got its first Linux (fedora) server</title>
		<link>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/</link>
		<comments>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 17:38:16 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[college]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=542</guid>
		<description><![CDATA[It all started with a failing Student&#8217;s Teacher Feedback System, designed by few fourth year students of my college, in oct-nov 2008 the system was not able to scale and everything was reverted back to paper, it was then when i was contacted by a teacher from my Department ( Information and Communication Technology ),]]></description>
			<content:encoded><![CDATA[<p>It all started with a failing Student&#8217;s Teacher Feedback System, designed by few fourth year students of my college, in oct-nov 2008 the system was not able to scale and everything was reverted back to paper, it was then when i was contacted by a teacher from my Department ( Information and Communication Technology ), regarding if i can improve it.</p>
<p>i asked <a href="http://djsh.net">DJ</a> if he wants to join me and after few weeks of coding there it was Manipal university&#8217;s  first (working) Feedback System, when the point of hosting it came, i was surprised to find Manipal University has no Linux servers, i mean come on no Linux what are you people click sys admins, then we decided to setup our own server in the department, thus giving Manipal university its first Linux ( fedora 10 ) server.</p>
<p>currently it just hosts the Feedback System, but we are planning to use it as local ( internal ) fedora repository mirror, we need permission from the WiFi provider ION because almost all the students use only WiFi and not LAN, last time we tried we were denied by saying &#8221; You are  a threat to our network &#8220;, lets see how it goes this time. we will also require people to manage it but i think this can be handled very well by <a href="http://lugmanipal.org">LUG Manipal</a>, some pics<br />
<div id="attachment_543" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/06/09032009001.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/06/09032009001-300x225.jpg" alt="Fedora 10 server in Manipal" title="Fedora 10 server in Manipal" width="300" height="225" class="size-medium wp-image-543" /></a><p class="wp-caption-text">Fedora 10 server in Manipal</p></div><br />
<div id="attachment_544" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/06/09032009002.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/06/09032009002-300x225.jpg" alt="Fedora 10 server in Manipal" title="Fedora 10 server in Manipal" width="300" height="225" class="size-medium wp-image-544" /></a><p class="wp-caption-text">Fedora 10 server in Manipal</p></div></p>
<p>PS &#8211; i am looking for a way to convince them that setting up a mirror will be helpful for them as well as students can anyone suggest me how to go about it??</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/06/how-manipal-got-its-first-linux-fedora-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Removing windows viruses from pen drives/HDD</title>
		<link>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/</link>
		<comments>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 12:05:42 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Special]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[virus]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=530</guid>
		<description><![CDATA[last week i gave my 250GB HDD to one of my friend and when i got it back it was filled with viruses, it was that virus which creates .exe inside every , since there were a lot of folders in the HDD ( it was 200GB full ) it was practically impossible for me]]></description>
			<content:encoded><![CDATA[<p>last week i gave my 250GB HDD to one of my friend and when i got it back it was filled with viruses, it was that virus which creates <folder>.exe inside every <folder>, since there were a lot of folders in the HDD ( it was 200GB full ) it was practically impossible for me to go and delete every virus in there, so i decided to make a simple script to remove these viruses here it is</p>
<p><script src="http://gist.github.com/123522.js"></script></p>
<p>Download <a href="http://gist.github.com/raw/123522/158dc4ed71fb8fe86250125eacfd9fd90b3ba2f9/rmvirus.pl">here</a></p>
<p>PS &#8211; please be careful if you have windows programs they can also get deleted </p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/06/removing-windows-viruses-from-pen-driveshdd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating your own service like tinyurl</title>
		<link>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/</link>
		<comments>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/#comments</comments>
		<pubDate>Sun, 24 May 2009 09:45:56 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[tinyurl]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=505</guid>
		<description><![CDATA[Few weeks ago i came across this article on Techcrunch which says tinyurl is worth $46Million (of course before twitter started using bit.ly as default) which made me think how hard is it to make a simple service like tinyurl and i figured out its not hard. so i used apache&#8217;s mod_rewrite to rewrite the]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago i came across <a href="http://www.techcrunch.com/2009/03/30/if-bitly-is-worth-8-million-tinyurl-is-worth-at-least-46-million/">this</a> article on Techcrunch which says tinyurl is worth $46Million (of course before twitter started using bit.ly as default) which made me think how hard is it to make a simple service like tinyurl and i figured out its not hard. so i used apache&#8217;s mod_rewrite to rewrite the url and forward the code to a php script ( url.php ) which will then search for the url in database and take the use to the original url and for shorting, url it is inserted into a table with a auto increment primary key and the key is converted to base36 which contains [a-z] and [0-9], making the short code&#8230;</p>
<p>First create a database say &#8216;shorturl&#8217;<code><br />
CREATE TABLE IF NOT EXISTS `shorturl` (<br />
`id` int(11) NOT NULL AUTO_INCREMENT,<br />
`url` varchar(300) NOT NULL,<br />
PRIMARY KEY (`id`)<br />
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;<br />
</code><br />
then create file .htaccess where you want your url to be and write<code><br />
RewriteEngine On<br />
RewriteCond %{REQUEST_URI} \/([0-9a-z]*)$ [NC]<br />
RewriteRule ^(.*) url.php?url=%1 [L]<br />
</code></p>
<p>and to create the url we will use a simple file say create.php<br />
<code><br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Url Shortner&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;?php<br />
ob_start();<br />
$host=""; //host<br />
$dbuser=""; // database username<br />
$dbpass=""; // database password<br />
$db=""; //database name<br />
$con = mysql_connect($host,$dbuser,$dbpass);<br />
mysql_select_db("url",$con);<br />
if (!isset($_POST['shorten']))<br />
{<br />
echo "&lt;center&gt;&lt;h3&gt;Enter the url to shorten&lt;/h3&gt;&lt;form method='POST'&gt;&lt;input type='text' name='url' /&gt;<br />
&lt;input type='submit' name='shorten' value='Shorten' /&gt;&lt;/form&gt;&lt;/center&gt;";<br />
}<br />
else<br />
{<br />
if (isset($_POST['url']))<br />
{<br />
$url=" ".mysql_real_escape_string($_POST['url']);<br />
if (strpos($url,"http://") or strpos($url,"https://") or strpos($url,"ftp://"))<br />
{<br />
$url=mysql_real_escape_string($_POST['url']);<br />
}<br />
else<br />
{<br />
$url="http://".mysql_real_escape_string($_POST['url']);<br />
}<br />
$q="select * from url where url='{$url}'";<br />
$res = mysql_query($q,$con);<br />
$row=mysql_fetch_row($res);<br />
if (!$row)<br />
{<br />
$query="insert into url set url='{$url}'";<br />
$res = mysql_query($query,$con);<br />
}<br />
$query1="select id from url where url='{$url}' limit 1";<br />
$res=mysql_query($query1,$con);<br />
$row=mysql_fetch_row($res);<br />
echo "shortened url is http://yoursite.com/".base_convert($row[0],10,36);<br />
}<br />
}<br />
ob_end_flush();<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code><br />
then our url.php file<br />
<code><br />
&lt;?php<br />
ob_start();<br />
$host=""; //host<br />
$dbuser=""; // database username<br />
$dbpass=""; // database password<br />
$db=""; //database name<br />
$con = mysql_connect($host,$dbuser,$dbpass);<br />
mysql_select_db($db,$con);<br />
if (isset($_GET['url']))<br />
{<br />
$query="select * from url where id ='".base_convert(mysql_real_escape_string($_GET['url']),36,10)."'";<br />
$res = mysql_query($query,$con);<br />
$row=mysql_fetch_row($res);<br />
header("Location: ".$row[1]);<br />
}<br />
ob_end_flush();<br />
?&gt;</code></p>
<p>Download <a href="http://ankurs.com/wp-content/uploads/2009/05/urltar.gz">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/05/creating-your-own-service-like-tinyurl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Get updates of completed torrents via SMS</title>
		<link>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/</link>
		<comments>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 12:13:16 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Special]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[ktorrent]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[torrent]]></category>
		<category><![CDATA[twit]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=489</guid>
		<description><![CDATA[This Sunday when i was giving DBUS a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way]]></description>
			<content:encoded><![CDATA[<p>This Sunday when i was giving <a href="http://www.freedesktop.org/wiki/Software/dbus">DBUS</a> a look and thinking about all the cool things possible with it, one of my friend came asking how can he control his torrents from anywhere and i thought controlling is ok, do you want SMS updates??, i fired up qdbusviewer and there it was a simple way to get sms notifications of finished torrents using well twitter and ktorrent, so here are the steps<br />
1) setup your cell phone to recieve SMS updates in twitter,<br />
2) get one more twitter account lets say ktorrent, follow ktorrent and turn device updates on,<br />
3) now save the script below say as torrenttwit.py<br />
4) now enter this ktorrent account username and password in the script below,<br />
5) start ktorrent if not already started, now run the script by typing &#8220;python torrenttwit.py&#8221;</p>
<pre>import dbus,base64,urllib2,urllib
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)
username="username"
password="password"

def tweet(msg):
        request = urllib2.Request('http://twitter.com/statuses/update.json')
        request.add_header('Authorization', 'Basic %s' % base64.encodestring('%s:%s' % (username,password))[:-1])
        request.add_data(urllib.urlencode({'status': msg.encode('utf-8')}))
        opener = urllib2.build_opener()
        req= opener.open(request)

s = dbus.SessionBus()
kt = s.get_object("org.ktorrent.ktorrent","/core")

def update(k):
        torrent = s.get_object("org.ktorrent.ktorrent","/torrent/"+k)
        name = torrent.get_dbus_method("name","org.ktorrent.torrent")
        tweet("ktorrent: finished " +name())

kt.connect_to_signal("finished",update)

import gobject
loop = gobject.MainLoop()
loop.run()
</pre>
<p>you are done, now whenever a torrent finishes the script will twit and you will receive an SMS update<br />
enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/04/get-updates-of-completed-torrents-via-sms/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>JavaFX and Pong</title>
		<link>http://ankurs.com/2009/03/javafx-and-pong/</link>
		<comments>http://ankurs.com/2009/03/javafx-and-pong/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 17:38:03 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Stuff]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[javafx]]></category>
		<category><![CDATA[manipal]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[pong]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=476</guid>
		<description><![CDATA[There was a workshop conducted by engineers form SUN in our college regarding JavaFX, which went quite well. I was planning to start with JavaFX but as there was no Official release of any Linux SDK, it kept me back but this semester i had to install Windows because of my University which wants me]]></description>
			<content:encoded><![CDATA[<p>There was a workshop conducted by engineers form SUN in our college regarding <a href="http://javafx.com/">JavaFX</a>, which went quite well. I was planning to start with JavaFX but as there was no Official release of any Linux SDK, it kept me back but this semester i had to install Windows because of my University which wants me to use Visual Studio for my mini project this semester, so as i had Windows (unwillingly) on my system i planned to go and attend this JavaFX workshop.<br />
From what i have learned in these two days, JavaFX looks promising for developing Rich Internet Applications, the language is somewhat a mixture of JavaScript and Java. With Type Inference , Audio/Video support  etc making it very easy to use and create applications with.<br />
In the workshop after every thing was over we were asked to make a simple application in JavaFX, so here is my code for a Simple pong game in JavaFX<br />
the resolution is set to 1440&#215;900 you can change it to your resolution in the code<br />
<span id="more-476"></span><br />
<script type="text/javascript" src="http://snipt.net/embed/af5b15371751e9d9ebbe6b42f96d1f34"></script><br />
if you cannot see the code see <a href="http://snipt.net/ankur/a-simple-pong-game-in-javafx">here</a><br />
<br />
PS &#8211; as i dont normally boot into windows i dont think that i will do anything in it soon, i am waiting for Linux JDK to be released&#8230;&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/03/javafx-and-pong/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Apple Keyboard in Linux (Fedora)</title>
		<link>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/</link>
		<comments>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 19:23:30 +0000</pubDate>
		<dc:creator>Ankur Shrivastava</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[F key]]></category>
		<category><![CDATA[Fn]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ankurs.com/?p=467</guid>
		<description><![CDATA[Few Days Ago i received my Apple Keyboard and i am enjoying typing on it, but having to hold down the Fn key then tap one of the F-keys to get F-keys working was irritating. a simple solution to get it working just add this to your /etc/rc.local file echo 2 > /sys/module/hid_apple/parameters/fnmode and F-keys]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_470" class="wp-caption aligncenter" style="width: 310px"><a href="http://ankurs.com/wp-content/uploads/2009/02/190220091.jpg"><img src="http://ankurs.com/wp-content/uploads/2009/02/190220091-300x225.jpg" alt="My Apple Keyboard" title="My Apple Keyboard" width="300" height="225" class="size-medium wp-image-470" /></a><p class="wp-caption-text">My Apple Keyboard</p></div><br />
Few Days Ago i received my <a href="http://www.apple.co.in/store/miscAccessories/apple_keyboard.html#overview">Apple Keyboard</a> and i am enjoying typing on it, but having to hold down the Fn key then tap one of the F-keys to get F-keys working was irritating.<br />
a simple solution to get it working just add this to your /etc/rc.local file<code><br />
echo 2 > /sys/module/hid_apple/parameters/fnmode</code><br />
and F-keys will start to work properly, enjoy</p>
<p>Update :- update for recent kernels,</p>
]]></content:encoded>
			<wfw:commentRss>http://ankurs.com/2009/02/using-apple-keyboard-in-linux-fedora/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
