Thursday, September 19, 2013

Provide access to USB devices

I have been having problem with accessing USB devices I use in the lab. Whenever I unplug device and plug it again, it always cries for providing admin access. So here is what I did :

jenis@Jenis-Laptop:~$ ls -al /dev/ttyUSB0

crw-rw---- 1 root dialout 188, 0 Sep 19 12:15 /dev/ttyUSB0

Add your user to dialout group by using :

"sudo adduser jenis dialout"

And you are done. Restart/Re-log your machine.



Thursday, September 12, 2013

Learning Hadoop/Map-Reduce

Trying some hands on this new technology, had worked on one of the projects long back. So trying to get those details back. Meanwhile, came across this simple example of Map-Reduce, thought of sharing:


Friday, September 06, 2013

Interesting fact about finding perl array size

Recently, I came across a problem with Perl array. I was assuming that these three methods generate same output for finding array size, but I am WRONG :

my @newArray = (2);
print scalar @newArray;   #1
print $#newArray; #2
print @newArray; #3

First and third give me proper values, but second gave me 0 size. So be careful, while using it. I would recommend using "scalar @newArray".

Here is some explanation on it :