Wednesday, November 6, 2013

Invited talk of Professor C. K. Toh at DGIST

Professor C. K. Toh
At the end of last month, I got a chance to attend to an interesting talk conducted by Professor C. K. Toh from National Tsing Hua University in Taiwan. In his visit to Korea, he conducted this invited talk at the DGIST (Daegu Gyeongbook Institute of Science and Technology) where I got the opportunity to attend with my lab mates. Professor C. K. Toh is a collaborator and an advisor to our Monet research lab and therefore he is more important to us. However it was the first time I met him in person. The topic of his talk was "The Green Internet" where he talked about the modern trends he observed in the Internet and how it is going to effect the energy crisis of our century. DGIST institute is located in a beautiful place in Daegu, far away from the main city area. It took nearly an hour for us to drive to their place. In addition to us from Monet lab in KNU, there were some other attendees mainly from DGIST itself.

My lab mates and me in front of DGIST building
In his talk, Professor Toh showed how our modern Internet is going to face a challenge from the energy crisis. The number of users of Internet is rapidly increasing and therefore the number of computers connected to the Internet is also increasing. Due to this always connected nature of the Internet, users expect all the network resources to be available anytime anywhere. Data centers has to run 24/7 making them consume power always. Almost all the networked devices including user PCs, routers and servers are powered on all the time even when nobody is using them. The ultimate result of this trend is a huge energy crisis in the near future due to the Internet. He showed that as the Internet bill, actually what we are paying is mainly an energy bill. When the energy consumed to run the Internet infrastructure gets increased, the cost for Internet access also can go higher. In conclusion, he suggests to take proactive actions to reduce the excess energy wasted on Internet related devices. One simple suggestion is to turn of the computers when not in use. He suggested some more interesting ideas as solutions for this issue.

After his lecture we all had lunch with him. He has got his PhD from  University of Cambridge. I didn't know that he is such a giant in the field until I read his profile. He has even worked on some DARPA research projects.
 

Sunday, October 27, 2013

"Incredibly Exciting Thing, This One, Meaningless Life"

Dreams were my driving force. Still they are. Recently I came across a wonderful speech which caused an intellectual quest inside my head about what I'm really doing. At first, I thought it is a challenge to me just like a revolver pointed right on to my head. After reading it again and again, I realized its not such a challenge. It's a wonderful attitude of a wonderful guy which asked me to revise my own attitudes. He is correct at some points according to my own attitudes and he is absolutely wrong at some other points according to my own point of view. Anyway it is such a beautiful speech which deserve my own attention.

Tim Minchin is an Australian artist. He must be a very famous guy I guess, even though I hadn't hear much information about him. Oh, poor me. Anyway, very recently, he attended to a graduation ceremony and delivered an amazing speech at University of Western Australia. First of all, I have to mention that he speaks in a so beautiful way. Its really attractive whatever he say. Secondly I have to accept that I got shocked at some points in the middle of his speech. Some ideas he expressed in his speech challenged my own perspective about life. It caused me to rethink and be prepared to adjust anything that could have gone wrong in my life. So, here we go.

Among the life lessons he mentioned, I'm starting from the points which I agree and which I consider so beautiful. Minchin says, "Happiness is like an orgasm: if you think about it too much, it goes away. Keep busy and aim to make someone else happy, and you might find you get some as a side effect". This is really the definition of happiness. Throughout the past two decades I've realized that happiness is not about doing things which generates it on my own. Happiness is about making others happy. Specially the people who really cares you, the people who are ready to loss their own self for your own good. They will do everything they can to keep you happy and alive. So, they deserve your care and sacrifices to maintain their happiness. When you see they are happy, you will realize that you are happy too. That's the ultimate happiness. The selfless happiness. At some other point, Minchin expresses about the definition of our own self. He says, "Define yourself by what you love". I truely believe him in this point. I always prefer to define myself by what I really love to do. That's where I put my genuine effort, my sweat, my tears and everything I have. I always tried to do things which I really love to do. So, thats the way I can define myself, who I am, whom I really want to be and how I should get there. I'm with Minchin in there in that point.

Now it's time to talk about the things which challenged me, which shocked me and pushed me to an intellectual quest. Minchin said in his speech that, "You don't have to have a dream". The way he elaborated his view convinced me like those who have big dreams are crazy and just wasting their short lifetime. Well, I'm a dreamer. I make progress in my life by trying to chase dreams. Sometimes I succeeded and sometimes I failed. But I never blamed my dreams. They were with me almost all the time of my life. Sometimes they were with me even when nobody else was. They have been dragging me so far in life which makes me face so many challenges. Sometimes they makes me tired. Sometimes they makes me fall down and even cry. But they sit besides me until I wipe the tears, take a long breath and start moving again. So, I have a great respect on my dreams. Sometimes they are the only hope. I will keep them, feed them and love them. They will not leave me alone when I fall down next time in the battle field of life.

So, in conclusion, thank you Tim Minchin for this wonderful speech. Its truly wonderful, incredible and enlightening. Its true that there are some places where I don't agree with you. But your speech really deserve my time. He says at the end, "It’s an incredibly exciting thing, this one, meaningless life of yours". Of course, its an incredibly exiting thing, this life. And yes its truly meaningless since we are a result of random events occurred in the universe for millions and billions of years. But still, I believe its worth searching for a meaning, chasing dreams until oneday I fail, fall down and die somewhere in this universe. That might be the meaning of my life. Nobody knows. Perhaps I will never know.

Tuesday, October 8, 2013

Wandering around: what life has to offer?

I'm in almost the same place. Same milky way  galaxy, same solar system, same planet. But in a different country. Far away from the home which I considered as my own place. After being here more than half of a year, today, at this particular point of time, when I stop everything and turn back to see what happened so far, I see some great insight. During last seven months, I forgot lot of good things which I used to practice for many years. There was a time I used to day dream a lot. At home I usually walk here and there from living room to the kitchen, from front door to the rear door thinking about so many crazy things. May be I have walked so many kilometers inside our home a day. I used to read a lot of books. They helped me to improve the quality of my day dreams. They added good ingredients to life. But suddenly I quit living that life and stayed alive for about seven months .

image credit: Udaya Wijenayake
During this time period I could not find time to walk around day dreaming for hours. Everything is scheduled. Wakeup, have breakfast, goto lab, lunch time, dinner time, come back to dormitory and goto sleep. Everything has a specified time. I'm not used to follow these time tables which are virtually unbreakable. At home I used to hold my plate during lunch for more than an hour since I was thinking while eating. I used to stand under the shower for a long time keep thinking. How much wonderful the day dreaming was. I made a mistake by quitting it. Now I know I have initiated to roll back. Back to the mysterious world of day dreaming. Whatever the reasons are, back to the dream world is good. It feels good. Its not easy to find time for that. So I do it all the time. The ingredients provider has started the service again. I'm reading books again. Not just the research papers like last seven months. I read good books. Good as a good book can be. Besides that, the most important function is started now. Let me try to tell you how it feels. 

About a week ago, we had a holiday. That's last Thursday. I couldn't find any enjoyable plan to spend that holiday. After different failures, finally I had the only choice that is going for a ride. A ride on my bicycle. Just me and the bicycle. On that day I woke up late at the lunch time. Had the lunch from dormitory cafeteria, took the bike and left. In my backpack there was a really good book. The book I'm still reading these days. My plan was simple. Go to the river side near the university, ride the bicycle in the track along the river and when I get tired, sit down on a bench and read the book until the stars appear and ask me to go home. However the plan started to shift away from the very beginning. Riding the bicycle along side the river felt so joyful than ever. From one side, the river that flows so calmly. Ahead, the never ending bicycle track. All over I see mountains, trees, and the clear blue sky above me. The faster I ride, the cooler the river side breeze which washed my face. There was nothing to stop me from keep moving. So, I kept moving, riding like crazy.

Carl Sagan once said, "We began as wanderers and we are wanderers still". I was wandering without a hope for no particular destination. I didn't know when I will fed up, when my legs start to hurt and ask me to stop moving. I didn't know when I should turn back and get to home. I just knew that there is a long way ahead and I can try to move a little bit more before I fed up of this long way joyful campaign. For a long time I wondered what life has to offer. What it will bring up finally. Its always the curiosity and uncertainty what fills our lives. There's nothing for sure. We just see the blue sky, the surrounding mountains, the long way ahead and the memories of our starting position of this journey. Whatever the decisions we make either to keep moving ahead hoping for the best or to turn back and go to the beginning is totally based on the limited information we have at the moment. But most importantly, whatever the decision we made, we should have the courage to stand by it without giving up easily. The situations can be really unfavorable for keep moving. But still its worth keep moving until we are really sure that it's time to give up and turn back.

image credit: Udaya Wijenayake
Anyway, this lonely voyage didn't last longer. Suddenly I got a message from Udaya Aiya who is a senior and a close friend of me. He was worrying where I was and then he decided to join the journey. Within the next half an hour, he arrived with his bicycle. Then Pathum joined. Finally Nadee akka. Together we all, traveled a long way. It was so much an exciting experience. We decided to turn back and go home when it was darkness all over, leaving the distant stars staring at us. I returned to the dormitory but not as the person who left in the lunch time. My mind was full of fresh thoughts and great insights into life which I collected from the cool breeze of river side. I hope they will last long with me in the voyage of life. 

- -------------------- -

Sunday, September 8, 2013

Working with Android NDK applications

I wanted to try some native applications on Android recently and it was a mystery to me for several days. Something was missing. Finally, I clearly understood the way to compile and run JNI based Android applications. So, here's the procedure I followed to try a sample native application on Android. I assume that we already have Android SDK, and also installed the Android ADT plagin for Eclipse.

First of all we need C/C++ support on Eclipse IDE. To install it on Eclipse, we goto the menu bar.
Help -> Install New Software...
In the pop up window, enter the name as CDT. For the USR, add the following URL.
Now Eclipse can compile C/C++ applications.

Second step is we need Android NDK. So, download it from the following place.
Extract the downloaded compressed directory and save the folder somewhere most probably in the same directory where your Android SDK folder is. Now we are ready to try some example native application. There are some good native application samples in the downloaded NDK directory. We are going to use the native-activity example in the "android-ndk-r9/samples/native-activity" directory.

Move into that directory from the terminal. We need to run a tool called ndk-build within this directory. This tool is in the "android-ndk-r9/ndk-build" directory. So while in the native app directory, we run that tool by providing the absolute or relative path.

/path-to-ndk-folder/android-ndk-r9/ndk-build

When this tool is running, it will print some output on the screen and then it will exit.
This tool is compile and build the C based codes of the native app. Now we can use this app on the Eclipse IDE. So, go back to Eclipse IDE.

File -> Import... -> Existing Android code Into Workspace -> Next

Now browse and select the "android-ndk-r9/samples/native-activity" directory. Put the tick for "Copy projects into the workspace". Then  click "Finish". 
Now right-click on the project folder in navigator of eclipse and "Run As" android application.

Done!!!

Thursday, August 22, 2013

Installing and running Antidote IEEE 11073 library for personal healthcare device systems


When comes to personal health care device systems, a major problem which can occur is the incompatibility between different devices manufactured by different vendors. The obvious solution is the standardization. So, IEEE has defined the IEEE 11073 protocol for personal health device communication. Antidote is an open source library which implements this protocol for using in such personal health device systems. Recently I got a chance to try this implementation and find out how it works. As usual, for the sake of not forgetting the steps I followed, I'm writing down everything here.

To test Antidote with the sample Agent and Manager components, we need two computers with the bluetooth capability. So, I used my desktop PC which is connected with a USB bluetooth adapter and a laptop which has bluetooth capability. Both are running Ubuntu 12.04 version. I performed following steps on the desktop PC which is going to run the Manager component.

First of all, download Antidote 2.0 version from their website. After uncompressing it to somewhere in my Ubuntu 12.04 desktop machine, I started the installation process. When I try to install it, there were many error messages about missing packages in my platform. So, before installing Antidote, we have to issue following commands on the terminal to install those required package tools.

sudo apt-get install automake
sudo apt-get install libtool
sudo apt-get install libdbus-1-dev
sudo apt-get install libdbus-glib-1-dev
sudo apt-get install libusb-1.0-0-dev


After completing their installation, we can proceed to install Antidote. Move into the antidote-2.0.0 directory from the terminal and issue following commands.

./autogen.sh
./configure
make
sudo make install


Now Antidote installation on desktop machine is complete. I have to follow the same steps to install Antidote on the laptop but first I have to fix a little bug. After downloading Antidote to the laptop which is also running Ubuntu 12.04, I opened the file "antidote-2.0.0/src/communication/plugin/bluez/plugin_bluez.c" and commented the line number 1455 which is a call to "channel_connected" function. This is required to solve some problem occured by Agent program in Antidote. I found this solution in this mailing list discussion. After doing this little fix, then followed all the above instructions to install Antidote on the laptop computer too.

After completing the installation, we can try sample applications. In the IEEE 11073, there are two basic components which are Agent and Manager. Agent is the medical device which generate health-care data. Manager is a user device which collects the data from Agent device and provide some useful functionalities for the user such as visualizing and storing data or send to some other remote application. Manager device can be a smart-phone or a tablet, while Agent device will be a medical equipment which generate data. Agent and Manager communicates to each other via Bluetooth HDP profile. In our case, we are going to run a simple Manager program on desktop computer while the simple Agent program will run on the laptop computer(which has the bug fixed Antidote). Agent will send just dummy data to the manager to demonstrate the functionality.

First of all we must run the manager. For this purpose move in to the "antidote-2.0.0/src" directory from the terminal of desktop computer. Now issue the following command.

./healthd

Our terminal should now print some stuff and then hangout. Open a new terminal or a tab and then move into the same directory. Now issue the following command.

python test_healthd.py

That healthd program and this python script are collectively going to give us the Manager functionality. Now its time to run the Agent on the laptop computer. Before that, turn on wifi in both computers and then pair them. Now in the laptop computer, open a terminal and move into the directory "antidote-2.0.0/src" and issue the following command. Note that we have given the bluetooth address of the desktop computer running Manager as a parameter to this sample Agent program.

./sample_bt_agent 00:19:0E:11:9F:5D

After issuing this command, sample Agent start to communicate with the Manager program via bluetooth HDP with the help of IEEE 11073 protocol. On the desktop computer where the test_healthd.py script is running, you will see some output like the following which shows that Manager has received some dummy data from the Agent. When we get this output that means our Agent and Manager are working fine.

This is the very basic level of Antidote Agent and Manager for testing. There are more things for me to learn about Antidote library.

Thursday, August 8, 2013

On Screen Keyboard for Raspberry Pi

I faced a little difficulty with the limited number of USB ports available on Raspberry Pi. I wanted to test a USB bluetooth adapter on a Raspberry Pi and obviously I wanted the keyboard and mouse connected to it at the same time. So, I needed 3 USB ports but there are only 2 ports available. One option was to use a USB hub. However when using a USB hub, it seemed my bluetooth adapter is not working as expected which I guess due to low amount of current it can drag through the USB hub. Anyway, I had to look for a solution and there is a simple solution.

I searched in the web for a on-screen keyboard for Raspberry Pi and found this thread. I tried it and worked fine. I'm writing down it here in case I need to do such a thing again oneday. I installed the on-screen keyboard program by issuing the following command in the terminal.

sudo apt-get install matchbox-keyboard

After it completed the installation, we can start it by typing the following in the terminal. The reason is, there is no any launcher icon coming to the desktop or anywhere. Therefore we have to launch it from the command line.

sudo matchbox-keyboard

However its obvious that we cannot have a hardware keyboard to type that command in the terminal in each time we need a keyboard. So, we need a launcher icon. So, we have to add a desktop shortcut for launching the on-screen keyboard. For that, as instructed in that thread, I created a file in the desktop and named it keyboard.sh (name can be anything). In the file I added the following.

#!/bin/bash
matchbox-keyboard

When we double click it, this shell script should run. For that we have to set the executable permission for this file. So, from the terminal, I went to the desktop where this file is saved and issued the following command.

chmod +x keyboard.sh

 Now, when we double click on the file in the desktop, a pop up message should come asking what to do. One option should be to run the file as an executable. By selecting that option, our on-screen keyboard should launch.

Friday, July 19, 2013

Algorithms in IEEE latex paper manuscripts

While preparing a manuscript on a IEEE latex paper template, I wanted to add a pseudo code of an algorithm to it. I write it down here to avoid forgetting it and also for the benefit of somebody somewhere in this world.

First of all I should have installed the full package of latex on my Ubuntu 12.04 machine to avoid the problems of different missing packages. I do it by the following command.

sudo apt-get install texlive-full

For preparing the manuscript I used the bare_conf.tex file coming with the latex templates which can be downloaded from IEEE website here. So, following commands should be added to that file in the appropriate places to make an example algorithm.

1:  \usepackage{algpseudocode}  
2:    
3:  \begin{figure}  
4:  \begin{algorithmic}[1]  
5:  \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}  
6:  \State $r\gets a\bmod b$  
7:  \While{$r\not=0$}\Comment{We have the answer if r is 0}  
8:  \State $a\gets b$  
9:  \State $b\gets r$  
10:  \State $r\gets a\bmod b$  
11:  \EndWhile\label{euclidendwhile}  
12:  \State \textbf{return} $b$\Comment{The gcd is b}  
13:  \EndProcedure  
14:  \end{algorithmic}  
15:  \caption{Euclid's algorithm}  
16:  \label{euclid}  
17:  \end{figure}

After this if we generate the PDF file, our algorithm should appear in the paper like the following.












So, have a nice time with preparing research papers!