If this blog helped you in any way, please donate a dollar here

Wednesday, December 21, 2011

Encoding Webcam data in Java

Java is the blue eyed boy of modern society. From Open Source lovers to Oracle, they all love Java. So, apparently, something like capturing data from a webcam and creating a video out if it should be a walk in the walk in the park, right?


Well, in this case, the walk appears to be rather full of potholes! Not only that, the road seems to veer off and disappear at times.


You see, there are various multimedia frameworks available in Java that allow you to capture webcam, but all of them have a JNI interface. This is where things so ugly. On Linux, such specific bits of code rely on Video for Linux (v4l or v4l2) abstractions. On Windows, DirectShow is the way to go.

Saturday, November 26, 2011

Genetic Algorithms

I have been busy for the past few months and it reflects on the time it took to bring out another post on my very beloved blog. Since getting admitted to post-graduate studies I have been fascinated by non-deterministic algorithms that are used to solve NP hard problems with reasonable accuracy. The branch of study I am referring to is known as "Soft-Computing".

There are various such algorithms that are based on the natural actions or inspired from nature. Some examples are Genetic Algorithms, Artificial Neural Networks, Fuzzy Logic, et cetera. What is so fascinating about this branch is that non-determinism and confusion are the concepts that determine the solution! When I say determine the solution I never mean to imply it finds out the exact solution always, it does not. These computations will find out the approximate results that are good enough for humans to understand and apply.

Let me try to elaborate each of these wonderful concepts to the best I can. In this part I shall be elaborating on Genetic algorithms.

Monday, August 8, 2011

Iterative Inorder Traversal of Binary Search Tree

A student from my undergrad college asked an innocent question to me on a facebook group to write an iterative implementation for In-Order Traversal of a Binary Search Tree. Of course I obliged and wrote up a code. However, I had never dug deeper into the properties of such traversals before and my observation was quite unexpected.

I was asked a question in the M.Tech. programme interview at NIT Durgapur about the significance of In-Order traversals of BSTs. I wasn't aware of any! So I gave a prompt reply, that it prints the elements in a sorted order. I was sure I was correct but the expression on their faces led me believing I was surely wrong! Oh well, I never did study theory before, so I guess my anguish was justified.

So, for my fellow junior, here's the code I promised:

Monday, June 20, 2011

Solving KDE Freeze

It was after a long time, I decided to install (and use) KDE4 on my desktop. I had always a notion that KDE4 was slow.. especially after trying the initial releases. I was a KDE3.5 person and loved it since Slackware had it. However after trying the latest version available on the Ubuntu (And Hence LinuxMint) repositories, I found my assumption to be pretty flawed!


I installed KDE4 and started it... After a while, the screen made no movements. It froze! Now I put on my debugging hat and started scouring forums for a solution. So here's what I had to do:

Wednesday, June 15, 2011

Hacking Wordpress

I was to configure and install wordpress for a client and so my recent obsession is wordpress themes. Wordpress has a large collection of themes, however a lot of wordpress premium themes are for sale (you need to buy them).


After a lot of searching on the web I found methods to get the professional look and feel for a website by extending wordpress with plug-ins and themes. 


A few websites I found useful for getting themes :

Now let us see how the files are designed.

Tuesday, June 7, 2011

Devhelp documentation for C

Standard C Library documentation can be easily found on the command line via the terminal. Do a simple 'man scanf' and you get the entire documentation for the function. This functionality requires the appropriate manual pages to be installed which is part of the standard C library documentation.

Dev-Help is a documentation viewer for GNOME and has various books to be used by developers. Standard repositories of Ubuntu, LinuxMint and Debian contains many devhelp books but a notable exception is the Standard C Library Documentation

Sunday, June 5, 2011

Clipboard management

When doing something that requires extensive research or repetitive words that need to be copied over and over again, it is almost tedious to right click and press copy and then right click and then paste. Worse still, is when we are in a console window or a virtual terminal. Here I present some tricks to make the most done work of IT professionals, i.e., copy-pasting, much easier!

Firstly, about a very simple way of copy pasting. While on X (XServer or Xorg or X11, which is the graphics server for *nix based systems), simple select some text with the mouse and then middle click on the destination application window. If your mouse does not have a middle mouse button (for scrolling ones) press the right and left keys simultaneously. Cool huh!

Tuesday, May 24, 2011

Become a DJ!

There's a lot of things people do with their computers... among them Listening to music is one of my favorites! DJs are people who play with music, remix mixes and create new stuff that is oh-so-cool!

Perhaps some of you already use Virtual DJ, however it is marred with Copyright breach of OpenSource Libraries [1]. So here's something good that let's you flanger through your DJ-ing ambitions without making you consult your lawyer!

Monday, May 23, 2011

Indtalling d4x on Ubuntu 10.10

I found d4x to be among the best download managers and accelerators out there working on Linux based systems. It is present in the repositories of dapper, hardy (8.04) and lucid (10.04)... However I am going to install it on my Maverick 10.10 aka Linux Mint 10 system.

The procedure is not very tedious as I just have to got the Ubuntu repository search website and search for my man. There is however one neat trick.

Sunday, May 22, 2011

Fixing parcellite on Linux mint 10

Parcellite is a wonderful clipboard manager and enables history of copied items.

It's been a few days I noticed parcellite to be not working... It is starting up and I can see the tray icon but that's about it. There seems to be some problem with the parcellite on the Ubuntu 10 and LinuxMint 10.10 repositories.

So I just headed on the main website of parcellite: http://parcellite.sourceforge.net/ and downloaded the latest debian package from here.

Now it's working just as it should!

Linux Mint Software Properties does not launch

I've been using Linux Mint for a while now, and I get this problem while mixing and matching Ubuntu repos with Mint ones... also because of some critical PPAs for my system (including Intel Graphics Drivers from glascen).


So the problem description goes like this: Software Properties does not launch and we get the following error when trying to launch it from the terminal with sudo software-properties-gtk



Tuesday, May 17, 2011

[OFF] Complications of a troubled mind

Oh yes, I have a troubled mind. It feels brave to not study, it feels brave to not have a books 2 days before your Final Semester exams. It feels bad too. Bad coz I know perhaps buying them might help me with my score... But then, who wants good scores!?

Yesterday was a night where I did some time traveling, to a place I had left a long time ago. I found out about myself, what I used to be. What I wanted. Now, on the brink of  achieving what I wanted to be, it feels odd. It's  almost like a revolt within me, wishing time had stopped. It wishes for a break.

Monday, May 16, 2011

Tikona WiMAX Internet Connection Problem


It's been over a month I have been stuck with an odd problem that prevented me from getting online from my Linux boxes. Pretty frustrating. I was stuck with XAMPP and realized how buggy the DevC++ System  was. Okay, let me get to the point.

So apparently Tikona WiMAX changed it's system as it would not acknowledge any DHCP requests made by lines that Advertise 100 Mbps connections. It kept fooling me for so long!

So, one fine day, I found @yagoo on #ubuntu. He pointed me out my system was using Half-Duplex connection.. after a brief diagnosis on my WinXP. He then told me about the mii-tool.

Thursday, April 21, 2011

[OFF] How I screwed up my Microsoft Interview

It's almost a month since my interview call at Microsoft India Development Centre @Bangalore. The fateful day was 30th March, 2011 and I got an E-Mail from a recruiter around a week before that day. My friends, Ishan and Sudipto also received the interview call offer. It was a stunning moment for me, after which there was fall from grace.

It all started with a phone call from Ishan, my programming friend at IEM. He wanted me to be a part of their team for Overnite, the ACM-ICPC Programming Contest at IIT, Kharagpur this year. I agreed. We participated for the qualification rounds and qualified as toppers. Sudipto and me solving a problem each. To be frank, this qualifiers was among the worst I have ever seen from this institution.

Sunday, March 20, 2011

Triple Boot Mac OSX, Windows and Linux

So you want the best of the world installed in your computer? Impatiently found this blog from the depths of the internet... Well then get ready to install a Hackintosh OSX Leopard (Macintosh on an Intel Box), Windows XP and Linux Anything (pretty much any Linux Installer with GRUB will work, for e.g. Ubuntu).

Wednesday, February 23, 2011

Recovering GRUB2 in Ubuntu 10.10

GRUB is the boot-loader (the software that starts or boots the computer to action when it starts up) used on Ubuntu and various other systems. The latest edition of GRUB is GRUB2. It features better maintainability and automation than it's predecessor. However, some people find GRUB Legacy to be easier to use.

Comparisons apart, GRUB2 can be reinstalled to the computer after it has been removed or deleted by this process:


Wednesday, February 2, 2011

Fedora and Open Source Event at GCECT, Kolkata

A Fedora and Open Source Event was held at my college (Govt. College of Engg. and Ceramic Tech.) on 2nd February, 2010. I was really excited to meet FOSS experts. However my experience consisted of  a mixed bag of pluses and minuses.

The event was attended by A. Mani,  Abhisekh JhaIndranil Das Gupta, Jayanta NathProshun Prodhan, Stephanie Das Gupta among others. More details about the event can be found here.

Friday, January 21, 2011

[OFF] A different side of me

Yesterday,  got selected for not 1 Job, but 2 jobs... one offered by Cognizant Tech. Solutions (CTS) and the other by Infosys. Infosys being my dream, led me contradict all logic of probably being at home. Once again my logic lost... to my heart. It was an amazing feeling.. once that left me speechless... I did not realize what happened until it slowly sank in. I feel good.


I wrote this piece today, to dig out the side of me, that was not too prominent... Here is a poem I wrote now. A few minutes ago.

Friday, January 14, 2011

Intel Graphics Card Linux Drivers

Looks like the future is perfect for Intel 845, Intel 855 and Intel 910 graphics chip-sets on Linux.

On my Mint 10 (aka Ubuntu 10.10 Maverick Meerkat)... I was finally able to get all my resolutions and Graphics Acceleration after ages.


Okay, so initially the Framebuffer device (fbdev) was the default graphics device on Ubuntu 10.10 (aka Mint 10) and thus the intel driver is not loaded. In order to force loading the intel driver create the file
/etc/X11/xorg.conf
To create this file you must be root... here's how you could do it:

Wednesday, January 12, 2011

OSS on Linux Mint 10

 Finally a relief! The Mint 10 based on Ubuntu maveric meerkat proved useful to me as I could install OSSv4.

Firstly, an introduction on OSSv4 is required. OSS or Open Sound System was developed by 2 hackers, who feel the current scene in Linux Audio is pathetic and also feel that they are not bound to be ruled by the GPL only. They have come up with an audio solution for *nix based systems (works on Linux, Solaris, BSD and other nix-es) that, judging from sound quality and mixing capabilities is much better than ALSA (Advanced Linux Sound Architecture). True, ALSA is far more advanced in terms of harware support and general integration, but take a look at OSS! It is coming to terms with the real world and now has an experimental USB sound driver included. Bluetooth would not be far behind, and well, it would really close the gap between ALSA and OSS.