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.

Source: http://stackoverflow.com/questions/9839988/dev-ttys0-does-not-open-in-ubuntu-12-04-beta

Cheers.
Jenis

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:

http://ksat.me/map-reduce-a-really-simple-introduction-kloudo/

Cheers. 

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 : http://stackoverflow.com/questions/7406807/find-size-of-array-in-perl

Cheers.