2008-02-29

Plotting in matplotlib/pylab

by Forrest Sheng Bao http://fsbao.net

I like Python, the simple but elegant syntax. I can't love any other programming languages more than Python. So I prefer to do my scientific computing in Python. I am very happy to find Numpy/SciPy package. matplotlib/pylab makes it possible for me to visualize my results. Neat!

Here is my first plotting script using matplotlib/pylab:

#This software is a free software. 
#Thus, it is licensed under GNU General Public License.
#Python implementation to read U. Bonn's data and plot it
#Forrest Bao, Feb. 26

import sys,string

from numpy import *
from pylab import *

f1=open(sys.argv[1],'r')

data=[]
for line in f1.readlines():
data.append(map(int, line.split()))

x = range(0,len(data));
lines = plot(x, data);

setp(lines, linewidth=0.5)
#shrink_to_aspect(lines, fig_aspect=0.5)
axis('tight')

grid(True);
xlabel('sampling points');
ylabel('quantilized steps');
title(sys.argv[1][:-4]);

savefig('eps/'+sys.argv[1][:-4]+'.eps')
savefig('png/'+sys.argv[1][:-4]+'.png')

#show();

2008-02-23

Great words in IBM Linux "Prodigy" commercial

by Forrest Sheng Bao http://fsbao.net

If you just Google "IBM Linux Prodigy", then you can find the commercial that I am talking about. Here are some great words from it:

  • John Wooden (former UCLA Bruins basketball coach): "A player who makes a team great is more valuable than a great player. Losing yourself in the group for the good of the group, that's teamwork."
  • Henry Lewis Gates (professor at Harvard): "Collecting data is only the first step toward wisdom, but sharing data is the first step toward community."
  • Sylvia Nasar (author of "A Beautiful Mind"): "One little thing can solve an incredibly complex problem."
  • Penny Marshall (actress, director): "Everything's about timing, kid."
  • Muhammad Ali (boxing legend): "Speak your mind. Don't back down."

2008-02-21

Something about embedded system development kit

by Forrest Sheng Bao http://fsbao.net

This morning I met a new friend from California. He told me that he just purchased a new S3C2440 development kit. And the most important is, he told me that the company gave him the uboot, my preferred bootloader for embedded system.

He showed me the webpage of that company and the development kit. It looked so familiar to me. Why? Because I know it is from a company in China. Like him, I have surfed a lot of webpages to search an ARM development kit after my previous one was down last fall. And since the price is at least $100 cheaper than ones made by other USA-based companies, I think it is definitely "Made in China".

Then I read their documentations - pretty nice. I am always looking for a kit whose development environment is not on Red Hat Linux 9, but some "fashionable" Linux, like Ubuntu or openSuSE. Oh, I got it. And the English is so fluent, the structure is so clear. Oh, it's awesome, not only has it Qtopia, but also the NanoX. The company said the Linux running on their kit is called utu-Linux.

But just when I was praising the good quality and the low price of this kit, I found some snapshots in the manual are in Chinese, such as Google China's logo. Later I found their Chinese webpage. The company is in Beijing, China. Then I was surprised, coz I have checked many companies doing this business, they sucked - lack of docs, lack of source code, lack of technical details. The reason is, everything in Linux world are generally open-sourced. So they just copy and re-sell. Of cource they know nothing about what they are doing. None of those companies I have checked can do so well as this company.

For example, there are many SAMSUNG S3C2410/2440 development kits selling in China. Most of them, totally copied the demo board of SAMSUNG, from the circuit, the PCB, the bootloader, the Linux kernel to the desktop environment. It only takes your one second to know that they are totally the same.

And that's why they can't "invade" into USA or Europe market. Here, we need totally transparent technical details and source code. Because embedded systems are generally designed for highly-specified applications, such as GPS navigator or Internet tablet, we need those details and source code to optimize our design. They are different from general-purpose PCs.

I think this company really did some developments and guys in the company really loves Linux. Otherwise they won't try to build cross-compiling environment on openSuSE and Ubuntu, having quite appealing interface and greatly threatening to Windows.

The default development environment of SAMSUNG's demo boards, the SMDK2440 and SMDK2410, is Red Hat Linux 9. I have seen many friends, struggling for this out-of-date system coz they can't run many tools on modern Linux distributions.

The default bootloader for SAMSUNG's demo boards is vivi, developed by a company called Meritech in Korea. I really hate it coz it's no longer developed. This kit, comes with uBoot, a very vigorous open source project.

And their English is very good. English docs or webpages of its Chinese competitors are too musing. And I don't wanna read Chinese technical docs coz I can't read them very fast and sometimes I can't understand some terms.

These three features made it advance those Chinese companies just copying SAMSUNG's technologies.

So, you can see, a China company can do as well as US-based companies. It can do much better than other hundreds of its Chinese competitors. They just need the passion to do things better and to create something new rather than just to copy. This company made it. It is the only such Chinese company I have found in North America. And I will recommend all my "electronic and computer friends", to use their boards to build our dreams. Hmm, less than $300 to build a robotics dream or a PDA dream, neat!

Oh yeah, in North America, they provide 30-day money back guarantee.

You may ask me where to find this company. In United States and Canada, this way: http://youtiyou.com/default.aspx In China, Taiwan and Hong Kong, this way: http://www.yctek.com/

2008-02-10

Thinking in AI [0]: Why I don't need to know how to read EEG plots?

by Forrest Sheng Bao http://fsbao.net

Recently I wanna write a computer program that can diagnose a neural disease automatically from EEG data. Since I have no idea on diagnosis of this disease, those medical guys couldn't understand how I can "teach" a computer to some stuff without knowing how to it by myself.

So I gave them another example. I know nothing about botany, but Stephen Wu and I did build a program that can classify 32 plants. I explained to them that I just need to extract some features by signal processing techniques and "feed" them into a classifier, which is a mathematical transformation in essential. The the output of the transformation can tell me of which class the sample is.

They just couldn't understand the mechanism I explained to them. It looked like that I was discussing building a time machine.

Then I tried much easier way, I said we wanna find a mapping from the space spanned from feature vectors to a space of classes. Different classifiers (linear classifiers, ANN, SVM, integral transformation, etc.) are just different mappings. They varies on identity, speed, anti-noise ability, etc. You can just consider you have a lot of equations and you wanna find a solution. That's why I don't need to know any medical knowledge about diagnosis of this disease.

Well, it was still useless.

Besides this, I was always asked what Answer Set Programming is. It seems this time I am talking about building time machine again. Since I don't know how to solve Sudoku or many other puzzles, again, they couldn't understand why I can "teach" computer to do something without knowing how to it myself. I told them that I just need to tell the computer rules to generate solutions and criteria to eliminate wrong solutions, then the computer can figure out possible solutions by logical reasoning.

So now I am tried and I just wanna tell everyone can't understand my answers "Yes, I am building a time machine". It is as difficult as telling Indians in 1800s what space shuttle is. But I am a graduate student rather than a magician.

Since I am working on a project using pattern recognition and machine learning stuffs, I wanna make my professors know what I am doing - I am not playing video games at the lab. I plan to write down the techniques I know in this fields so I can check them when need to review them.

Ok, so I will discuss some basic ideas of linear classifiers next time.

2008-02-09

Vive la liberté: I am burying my MSN and Yahoo accounts

by Forrest Sheng Bao http://fsbao.net

For he today that sheds his blood with me, shall be my brother. - St. Crispen's Day Speech, HENRY V, by William Shakespeare, 1599

Brothers,

I know you love freedom, so I think you will fight with me, for our future free market. This is a war, to secure the blessing of liberty to ourselves and our children. I know this is tough, but "Freedom is not free".

Due to Microsoft acquiring Yahoo transaction may form a terrible monopoly that can

1. kill our chance to make money in a free market (i.e., they can "pay" politicians to treat your company unfairly.)
2. force us to pay more money for more sucking service (e.g. AT&T's rate in 1980s)
3. control us where to go and where not to go (i.e., they don't wanna us to use better services of their competitors. They may also control the freedom of speech by controlling our web surfing. )
4. violate our privacy and freedom (i.e., they may turn United States into Nazi Germany or Communist Russia since they can control the freedom of speech.)

To defend our unalienable rights endowed by our creator, I am abandoning Microsoft and Yahoo services. If you wanna reach me, you can use Email or other IMs, such as Google Talk (as well as other Jabbers), Skype, AIM, IRC channels. You will also be able to find me at Facebook, Linkedin and other online forums and mailing lists. Don't worry, you still can contact me if you use the non-evil services through free market, with hot competition.

Since this afternoon, I have "forced" many people to shift their ways to IM me, including my sister. Abraham Lincoln, Martin Luther King, Jr., Mohandas Gandhi and uncountable people dedicated their life to freedom. Now I just ask you my friends, not sacrifice your life, but just click your mouse to switch your online service and disconnect any relationship with the evil company - Microsoft. I know you may not find a workable alternative beyond Windows, so I won't ask you to stop using Windows. My idea is to let Apple fight with Microsoft on OS market and we can enlarge our Linux share meanwhile.

You may ask, Forrest, don't you afraid of losing friends? Well, firstly, I don't have much friends on MSN and Yahoo. Secondly, most of them are also using Google Talk, AIM or Skype. Third, to the rest of them, I am persuading them to switch. So, to the rest few couples of people, I have to say "For he today that sheds his blood with me, shall be my brother".

You may say that this Microsoft-Yahoo deal is still under-going. Well, I wanted to say goodbye to Yahoo and Microsoft a long time ago, since their online services both suck very much. Now, Microsoft give me a chance to abandon it. Even if Microsoft's bidding fails, I will continue burying my Windows Live (a.k.a. MSN) account, including instant messaging and blogging. No need for Windows, coz it has already been pissed by me since my sophomore year. If Microsoft successfully acquires Yahoo!, I will also stop using Yahoo! mail, Yahoo! 360 and Yahoo! Messenger. If Microsoft wanna modify Flickr, I will take further action.

Well, I won't only rely on Google. I will "balance" the services on different providers. I don't need one guru. In stead, I prefer many "big brothers" fighting each other. And some day, I will open fire to them and eat their market shares later.

So I will be very happy to see later that Microsoft can't acquire Yahoo so that Yahoo, Microsoft, Google, Apple, AOL, Skype and all other Internet companies continue fighting each other. Then we can enjoy the free market by maintaining a competition among them.

Vive la liberté! (Long live liberty!)

2008-02-05

Connecting to Samba server (TTU TechDrive) on Linux

by Forrest Sheng Bao http://fsbao.net

/* Nope, I don't use Windows. I generally use Linux and Mac. Sometimes, I wanna try something different, so I will use Solaris or FreeBSD. So, I wanna help Texas Tech Linux users connecting to TechDrive, which is a file sharing service running on a Windows computer! Oh, gee, I can't believe they run it on Windows. It's much cheaper, safer and better on a Linux box. Windows, hmmm, I don't trust it. */

On GNOME desktop environment, the default one of Ubuntu Linux, it's quite easy, using "Connect to server", which is similar to the one on Mac.

Click "Places" -> "Connect to Server" and enter stuffs like this:

Then, double click the shortcut on your desktop or double click the shortcut under "Places" -> "Connect to Server". You will be prompt the password. Enter it.

How to copy? It's easy, drag-and-drop, like this. Oops, I exceed the 100 MB quota.

The best deal for you - stopping Microsoft from buying Yahoo

by Forrest Sheng Bao http://fsbao.net

I think all of you have read the news that Microsoft is bidding Yahoo. If you haven't read, here is one from Google Blog and here is one on Yahoo! finance.

Ok, what I wanna say? I wanna stop Microsoft from buying Yahoo. Yahoo! is the top email and instant messaging provider. Once Microsoft acquired it, M$ can force users using every Internet service provided only by Microsoft-Yahoo. They control you not go to websites of their competitors, since they controlled the PC market as well as your computer.

On that day,
Wanna buy books on Amazon? No way.
Wanna sell your old stuff on eBay? No way.
Wanna chat on AIM? No way.
Wanna check emails on Gmail? No way.
Wanna make friends on facebook? No way.
Wanna watch TV shows, rent movies, read news, play games,..., not on "the Internet of Microsoft" ? No way.

And finally, wanna make money from the Internet? Absolutely bullshit. Business? You have only two choices, earning dirty money with Microsoft, or dying without a breath.

These all will happen if Microsoft monopolies the Internet.

Because there is no free market, there is no competitors to Microsoft-Yahoo. No innovation without openness. You think the rate of AT&T was too high in 1980s, unh? So don't let the new AT&T born.

We need a free market so that all of us can make money. And because of the competition led by openness, we all do our best to provide better services to our customers. So our world is innovating. No one is forced to pay extra money for poor products.

You like deals? Supporting antitrust actions, is the best deal for you that never expires.

2008-02-04

Microsoft teaching you Linux system administration

by Forrest Sheng Bao http://fsbao.net

This sounds incredible. But it's true. I came across some videos on Microsoft website regarding Linux vs. Windows. They made some videos about system administration on Linux and the one on Windows. It is obvious Linux is a threaten to Windows and it surely will grow up to eat the market share of Windows. O/w, why Microsoft built this site to claim Windows is superior than Linux?

And M$ uses Ubuntu Linux for demonstration rather than other enterprise level ones, Red Hat or SuSE. Why? I think the reason is because they feel really hard to change the status of Red Hat Linux of SuSE Linux in enterprise application now. So they wanna kill some new emerging one, Ubuntu Linux.

For example, if you wanna learn how to check you system performance, watch this: http://www.microsoft.com/windowsserver/compare/videos/Linux_Performance.wvx

If you wanna learn how to balance loads among HTTP servers, watch this:
http://www.microsoft.com/windowsserver/compare/videos/Load_balancing_Linux.wvx

A full list of screencast is here:
http://www.microsoft.com/windowsserver/compare/windows-server-comparison-screencasts-and-webcasts.mspx