Uncertain Binary Thoughts
01110100110101010101011101100010
01110100110101010101011101100010
Aug 29th
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 in Qt (C++) and the application on the Phone is written using the Bada SDK.
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 requires better calibration 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 Abhimanyu which we implemented.
if you cannot see the above video here and here are short demo of how it works.
PS – code and proper working for the previous and this weekend project will be posted soon!
Jun 26th
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 AdCenter 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.
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 “i have no idea where that place is, but it will cost you Rs100″, 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 “Hey lets go out and see around” to which you say “Ok nice, lets find a good place to eat!!”, after walking a few kilometers and looking around and probably eating, when its time to return someone is bound to ask “Which way ?” and atleast one guy from your group will say “Its this way, TRUST ME!” 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 “TRUST ME” incident happened with us, we were going in completely wrong direction.
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.
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 NUI Group, 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.
During my 2nd week AdCenter team had an outing to Leonia which was a great experience, i met some interesting people from AdCenter team during the trip and the best part was Paint Ball, 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.
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.
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/foosball/TableTennis, cab drop at night, the cubicle, all the excitement is gone and work has started.
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….
Apr 5th
I was having discussion about State Machines with one of my friend, regarding pro’s and con’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 function definition for our FSM
Mar 11th
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.
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’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.
the working is Phone —(WiFi)—>Laptop —(USB/UART)—> Micro controller —(Relays)—> Car Remote —(RF)—> Toy Car
will post details with code sometime later
Feb 10th
i recently noticed this anyone has a proper explanation for this
for literals i get this
>>> def a():
... b = []
... c = {}
...
>>> import dis
>>> 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 constructors i get this
>>> def a():
... b = list()
... c = dict()
...
>>> dis.dis(a)
2 0 LOAD_GLOBAL 0 (list)
3 CALL_FUNCTION 0
6 STORE_FAST 0 (b)
3 9 LOAD_GLOBAL 1 (dict)
12 CALL_FUNCTION 0
15 STORE_FAST 1 (c)
18 LOAD_CONST 0 (None)
21 RETURN_VALUE
i mean why the difference, i was thinking {} and dict() do the same thing, shouldn’t they?
Jan 27th
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 ->
Time: 5:30 pm
Place: NLH 103
Date: 29th JAN to 3rd FEB
PS :- Slides for the workshop are available Begining Python Slides
Oct 15th
First and Second Phase for MobiVision 2.0 is long over, and we can call it a workshop well done, the slides are here
Sep 25th
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 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.
we wait for the threads to finish using the pthread_join function
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
PS – No updates from a long time as i dont have a proper net connection ….
Jul 30th
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…
download here
Jun 25th
It all started with a failing Student’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.
i asked DJ if he wants to join me and after few weeks of coding there it was Manipal university’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.
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 ” You are a threat to our network “, 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 LUG Manipal, some pics
PS – 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??