Codes from my life

I have moved my blog to http://roshansingh.in/blog/. Please update your bookmarks.

Feed: http://feeds.feedburner.com/roshansingh?format=xml

1. Why did I move my blog?
I wanted some web space for random stuff that I do. So I thought it would be better if I bought a domain and webspace for me.

2. What was the cost for hosting and domain?
I bought the domain from Indialinks at Rs 150 for 1 year, and hosting from 3iX. I am currenlty using 1$/month hosting scheme. So the entire setup costed me around Rs 750.

3. How did I move it?
Wordpress provides easy export and import plugins, so the setup was also done under 1 hour. I tweaked the theme a little bit to match it exacly as the theme that wordpress.com gave me.

4. What about email ?
I have opted out of the default email that 3ix gives. I switched to free google apps which provides gmail for mail ;-) . I had to change the mx record in the dns settings from the indialinks control panel. It took about an hour to propagate. FYI the email address is roshan@roshansingh.in. But I plan to use my existing email id.

But I will continue to use this blog, as I use it as openid everywhere :)

Posted from GScribble.

After a long time, today I finished packaging the newer versions of artha and gscribble for Fedora. The updates have been pushed to update-testing.

The new versions will be available in the updates repositories soon.

Posted from GScribble.

Nonameconf [Day 1]

I had missed FOSS.in again due to some reasons, so I had planned to go to Nonameconf. I went with vignesh. While I was trying to find the building where it was supposed to be, I saw a bike tripping over. I had never seen an accident like this before. I immediately rushed towards them, had no clues what to do. I helped the person get up. The pillion rider was hurt, he was not able to stand also. Some people came with water to help them. After a while I left.

I will still clueless about the venue. I called up Vignesh, he said that he would come in a while. Then we tried to find the venue. Finally when we reached the venue. I saw a very small Nonameconf sticker pasted, I must say this was a very poor arrangement. The venue also was not proper for a meeting like this, but I do not think blame them as it was a free of charge event with no sponsors.

Later I noticed that they had no clear idea as what was to be done. I met with a lot of people there, some coders, others FOSS activist of FSMK. Shreyank had arrived by then, I met him for the first time since he left college. Later I found that there were some entrepreneurs also there mostly startups. Now some person had come up with a website (i forgot the name of the person and the url as well), which would serve as a meet up point for freelancers and startups. Nice idea indeed, but the question was will he be able to sustain the idea, I am rather unsure about this. But the discussion was nice indeed, what startups needed and what freelancers/interns need.

Then we went to CCD to grab some coffee. Then we walked from there to UB City mall. The mall was nice, we were having random discussion on what we need in life and how we should do. After a while Shreyank proposed to write a small app that would pull the latest image from xkcd feeds and save it as desktop background. He took out his laptop to see if there was wifi available. To my amazement it was! There was some paid network available which would charge 50 bucks for 60 mb. He tried to registered but failed. Then we went to S.P. Road, Viggy had to buy adapter for his router. Finally after roaming a lot, I came back.

It was refreshing to meet them. Since I had moved in to Bangalore I have been living with people who do not like coding at all. Every time I would go out with them, they would discuss on cricket, football, politics and so on, none of which interest me. For the first time, I felt like I should start doing something again :) . Hope I can sustain this energy.

Posted from GScribble.

Stack Vs Heap

Some very good discussion here on stack vs heap. Read it entirely. Though it sounds theoretical they are very important when you get to real world problem solving
http://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap

And some more over here for stack overflow: http://stackoverflow.com/questions/26158/how-does-a-stack-overflow-occur-and-how-do-you-prevent-it

Mutex Vs Semaphore

The title seemed to bug me a lot, until today when i found a really good explanation. If you google for the difference between Mutex and Semaphore you will see in most of the places it is mentioned that mutex is a binary semaphore.

But mutex is not actually a binary semaphore.

See these links to understand the difference:
1. http://blog.feabhas.com/2009/09/mutex-vs-semaphores-%e2%80%93-part-1-semaphores/
2. http://blog.feabhas.com/2009/09/mutex-vs-semaphores-%e2%80%93-part-2-the-mutex/
3. http://blog.feabhas.com/2009/10/mutex-vs-semaphores-%e2%80%93-part-3-final-part-mutual-exclusion-problems/

Update

Its been quite sometime that I have blogged. To begin with I have joined a job at Huawei Technologies in Aug this year. I really dont get much time for doing anything cool after a hectic 9-10 hours(9:30 ~ 7) a day schedule. And weekends pass by sleeping.

I have spent three months at Bangalore, and I must say that I am loving it! The weather is always pleasant. I have not seen scorching sun here till now :) . And yes, I visited Wonder La also with my college friends, spent an awesome day there. For the first time I visited a water park, its a must place one must go if he/she is in Bangalore.

The next big thing is FOSS.in. I missed PyCon because I did not have internet connection then. But I will certainly go for FOSS.in.

Posted from GScribble.

I had recently bought MTS connection which gave a usb stick to connect it. It also gave a rpm for the GUI. Later I found that due to it, some software like vlc and skype had stopped working.

I used to get errors like this:

roshan@localhost:~/Downloads$ vlc
VLC media player 1.1.3 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
Warning: call to signal(13, 0x1)
[0x9e9c8fc] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0xa02ba9c] skins2 interface error: no suitable dialogs provider found (hint: compile the qt4 plugin, and make sure it is loaded properly)
[0xa02ba9c] skins2 interface error: cannot instanciate qt4 dialogs provider
[0x9e9c8fc] main libvlc error: interface "default" initialization failed


roshan@localhost:~/Downloads$ skype
Fatal: Cannot mix incompatible Qt libraries
Aborted (core dumped)

The problem was with the linking of Qt libraries.
roshan@localhost:~/Downloads$ ldd /usr/bin/skype |grep -i Qt
libQtDBus.so.4 => /usr/lib/libQtDBus.so.4 (0x00406000)
libQtGui.so.4 => /usr/local/bin/ztemtApp/bin/libQtGui.so.4 (0x00efa000)
libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x002eb000)
libQtCore.so.4 => /usr/local/bin/ztemtApp/bin/libQtCore.so.4 (0x0084e000)
libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x00122000)

The libraries installed by the MTS stick had screwed the system. Notice that libQtGui links to /usr/local/bin/ztemtApp/bin/libQtGui.so.4.

So since I had forgotten which rpm had installed it I simply moved /usr/local/bin/ztemtApp/ to some location not in my path and things were back to normal.

roshan@localhost:~/Downloads$ ldd /usr/bin/skype |grep -i Qt
libQtDBus.so.4 => /usr/lib/libQtDBus.so.4 (0x00e24000)
libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x00eff000)
libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x002eb000)
libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x073ae000)
libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x00d1a000)

Coin denomination problem is a very common question asked in interviews. It involves Greedy Approach, Dynamic Programming and Recursion. You may find a lot of stuff on the internet if you just google out “Coin denomination problem”.

A link that was really helpful for me to analyse the problem is http://www.ccs.neu.edu/home/jaa/CSG713.04F/Information/Handouts/dyn_prog.pdf.

Some other helpful text to recollect things can be found here.

Posted from GScribble.

This is a problem that I faced once earlier also. However, I never cared to solve it then. The solution to this problem is on http://www.mjmwired.net/resources/mjm-fedora-f11.html#binarycodecs.

Simply download the tar and extract the tar. Follow the steps mentioned on the page.

Posted from GScribble.

Fate

Four years back, I was there at BIT Mesra, after counselling, I waiting for my final seat allocation. Finally after waiting for 3 hours, the result was pasted in a white sheet in a board. Suddenly a huge crowd had gathered to see their respective results. After 5 minutes I managed to reach the board, and the result was “Information Technology at NIT Durgapur”. NIT Durgapur ? Had I filled that in my options, I could barely remember, all I could remember was that I had filled the CSE, ME, IT, EEE, ECE of BIT Mesra and then NIT Jamshedpur. Had I mentioned NIT Durgapur, I took out the file to check if I had mentioned NIT Durgapur, and there it was in the middle of BIT Mesra and NIT Jamshedpur. I had no idea about this college or rather say any NIT at that time.

I took a bus went to Lalpur Chowk, sat in a cyber cafe to check out my new college’s website to see what was the placement scenario. I got a .doc file that gave some consultancy companies like TCS, Infosys, Wipro, etc. I said to myself, “don’t worry, you will get into any of these”. After I came to college, I saw that people were getting placed easily and companies like Microsoft, Cisco were also visiting. I thought that, I landed at a safer place than NIT Jsr, however I always repented that I could not get BIT Mesra.

To add to it, I had cleared IIT JEE with poor rank, though I could get some branch at ISM Dhanbad and M.Sc. courses at any IIT. But I thought that I had a good enough rank in AIEEE and I should opt out all these choices and go for AIEEE counselling.

I am placed at TCS right now. Yesterday, Sapient visited our campus. I had not heard a lot about this company, however they were paying a decent salary much better than what TCS is paying. And I was rejected because I could not solve a logic puzzle (maths sequence). I was so angry at the interviewer that I even asked him, if they were looking at coders or people good at cracking CAT or similar entrance test. Had they asked me some tech questions and rejected me, I would have been satisfied.

Was it my fate? Why had recession to hit the same time when my ass was on line or rather why did IITs suddenly planned to make “only two attempts” the same year when I was to appear.

Posted from GScribble.

Follow

Get every new post delivered to your Inbox.