2011-09-24

Windows 8 should not drastically change user interface

by Forrest Sheng Bao http://fsbao.net

One last thing a developer should do when upgrading a software application is to drastically change the user interface (UI). Users' purpose of using software is not just to use it, but to get things done. Unless you make their lives easier, they will hate the change, and even go back to old versions.

Sadly, Windows 8 made the mistake. To be short, I cannot find the place to restart the PC, nor can I find the Program menu after clicking Start button. Why would I use an OS that does not give me quick access to all my installed applications?

I cannot find anywhere to power off the computer.
The new UI isn't making life easier. For example, Windows 8 puts soooooo many buttons around the Windows Explorer (the window you use to manage files). The space to view files is squeezed. And those buttons are very stupidly designed, like the one introduced in Micro$oft Office 2007. Too many stuff, too many layers. Are we flying a jet plane?

Too many buttons. 
The new UI is a very simple shell over old Windows. For example, the Control Panel on the entry interface cannot allow you to set everything. When you click "More settings", it brings you back to old Windows Control Panel. Then, what's the purpose of this? Why would someone pay, let's say $50 upgrading fee, just for that?

So, there is another Control Panel for More settings?  And the "S" in "settings" isn't capitalized as other options? 
A good news is, Windows 8 will be a good chance for Mac OS X and Linux. When people are tired of Windows, they will look for alternatives.

2011-09-23

Money, killing the fun part of a startup

“Being the richest man in the cemetery doesn’t matter to me … Going to bed at night saying we’ve done something wonderful… that’s what matters to me.” -Steve Jobs said in an interview with The Wall Street Journal, May 25, 1993

by Forrest Sheng Bao http://fsbao.net

I am interested in startups. I have a couple [of] ideas and energetic friends who may join me if I begin. But I never take any action.

The reason is very simple, a startup will soon lose its fun part when people start thinking about monetization.

A lot of people watched Facebook's F8 yesterday. I was kinda disappointed. I couldn't see anything wonderful or fun or awesome there. Actually, I was sorta pissed off when I saw several speakers dressing in suits. Thank God, Mark was wearing a T-shirt. New features of Facebook announced on F8 have little technology awesomeness. They only keep people from getting bored about Facebook. The ultimate goal of doing those, to the best of my intuition, is to make a lot of money from Wall Street investors in the potential IPO - because Google+ does not have so many users as of now.

(Facebook's News Feed ranking algorithm, or their "People you may know" algorithm do not work very well, really.)

When the focus of a startup shifts to making money from building something really cool, there is no fun at all. I am not saying that a startup should not make money. But money really shouldn't be the dominant focus.

Money cannot buy everything. Money cannot buy fun. Fun in my life is a big reason I haven't committed suicide, seriously. Building something technologically creative and advancing is the fun part of a startup to me and that's the main reason I dream about my startup.

Therefore, if I begin a startup, I will never pursue going to NASDAQ. Canonical, the company behind Ubuntu Linux, has shown me a good example. However, on the other side, Google has also shown me a good example after going public. Google is doing a lot of cool things, such as free hosting to open source projects at Google Code - for many small projects, Google Code is more suitable than SourceForge.

When I have some money, I'll do something that will shape the world better, rather than turning money into expensive wine on the dinner table of the rich. Maybe a hungry kid in Africa needs a spoon of mashed potato more than how much a millionaire needs a glass of 100-year-old wine.

2011-09-22

scp and rsync: two cool UNIX commands for file transferring between computers

by Forrest Sheng Bao http://fsbao.net

This is a simple tutorial for my colleagues who need to transfer files between Linux/Mac OS X boxes. I love scp and rsync. They are both very simple and there is no need to start a GUI.

scp

scp means "SSH copy". Thus you can copy a file from a server to you computer (or even another server) via SSH. It's syntax is very simple.
scp OPTIONS SOURCE DESTINATION
For example, if I wanna copy all files under /data/MEG/MEG077 on example.com to my current computer, I will do this
scp -r  example.com:/data/MEG/MEG077/* .
The -r option means "recursive" that I need to copy everything in MEG077 hierarchically.

rsync

rsync is good to synchronize files incrementally. "Incrementally" means only copying changed files. It's syntax is as simple as scp.
rsync OPTIONS SOURCE DESTINATION OPTIONS
For example, if I wanna make sure everything under /data on example.com, except hidden files, is synchronized to my current folder, I will do this.
rsync -azv --delete example.com:/data/ . --exclulde=".*"

In -azv options, z means compressing the transmission while v means verbose. The --delete option means deleting files that are not on the source but the destination. The --exclude option specifies the filename pattern to avoid in synchronization. Since hidden files on Linux/Mac OS X begin their filename with a dot, --exclulde=".*" means avoiding all hidden files.

Please be aware of the last backslash (/) after example.com:/data. When there IS a backslash, it means all subfolders under that path. If there is none, it means the folder itself specified by the path. The same rule applies to both source and destination.

You can also synchronize your local folder to remote servers, or even between two local folders, using rsync.

2011-09-15

Using your own symbols in geda/gschem

by Forrest Sheng Bao http://fsbao.net

gEDA is a cool tool for making electronic circuits schematics and laying out PCBs. Sometimes, we create our own symbols. To use them, just set your ~/gEDA/gschemrc like this:
(component-library "/forrest/work/Homework/Medical_Instruments/project/circuit")


You may also do this in system-wide or directory-wide manners.

PS: For some reason, a lot of pages i found via googling said you need to edit ~/.gEDA/gafrc. But it doesn't work for me.

2011-09-12

Industry research or academia?

by Forrest Sheng Bao http://fsbao.net

I got some cards, like postcards, from Google Research when I was at AAAI-11 last month in San Francisco. On those cards, scientists talk about the reason they chose Google Research, mostly, instead of academia. I like these quotes very much:

  • "Research at Google is inspired by real problems." - Corinna Cortes
  • "I'm at Google because that's where the data is." - Peter Norvig
  • "Our lab is the whole Internet" - Fernando Pereira
Real data and real problems! I like to see how my research can come out with something that can change people's life. Like, I need some sort of feedback to my work. O/w, it would be like playing with a dummy pet that does not respond you. 

However, other than working for industry research, academia or non-profit research organizations, I think there is another way: starting up your business and funding your own research using your profit. 

The cards! 







2011-09-11

Meaning of #domain declaration in answer set programming

by Forrest Sheng Bao http://fsbao.net

I just notice that a weight constraint acts ``oddly'' for variables declared in #domain declaration in answer set programming (ASP). My grounder and solver are lparse and smodels.

Here is a demo program:
const n=2.
step(0..n).

#domain step(S).
block(a). block(b). 

#domain block(B).

1{put(X,S):block(X)}1 :- step(S), S < n . % rule 1

1{gen(B,S)}1 :- step(S), S < n .          % rule 2

I thought I should get one and only one put/2 and gen/2 literal, respectively, for each S, because the lower and upper bounds are both 1. But this is what I got:
Stable Model: put(a,0) put(a,1) gen(b,0) gen(b,1) gen(a,0) gen(a,1) step(0) step(1) step(2) block(b) block(a) 

For each step S, I got exactly one put/2 literal whereas I got two gen/2 literals. Thus, I have gen(a,0), gen(b,0), gen(a,1) and gen(b,1). They are supported by Rules 1 and 2, respectively. A difference, which is the cause, between Rule 1 and Rule 2 is X is not declared in #domain declaration whereas B is.

With the help of Dr. Zhizheng Zhang, the reason was found out. Lparse manual explains the meaning of #domain a(X), "adding a(X) into the tails of all rules where X occurs." Thus, Rule 2 is actually:
1{gen(B,S)}1 :- step(S), S < n, block(B).

2011-09-10

When the Cloud messes with you

by Forrest Sheng Bao http://fsbao.net

I think a big difference between cloud computing and grid or cluster computing is that you use Cloud as a storage that you frequently access. In this sense, Cloud is our great friend. However, today I realise this could be a point where Cloud messes with you.

I created a lot of small files (in many deeply hiearchical folders) by mistake on a Dropbox-watching folder. I have 4 computers, all connected to Dropbox. When I was deleting files on one computer, Dropbox was adding them to another computer, and later, it synced the files I just deleted back!

So I thought about the reason. This is what I got on my Linux server - where files are always synchronized with my dekstops by Dropbox.
$ python ~/bin/dropbox.py status
Uploading 13,904 files...
Indexing 24,132 files...
Downloading file list...
Too many files are the cause.  This is what happened, to the best of my brain power:
  1. When file F is deleted on computer A, it won't be removed from the Cloud unless local synchronzation client indexes it and/or has time to report the Cloud.
  2. Before that, synchronization client on computer B will download F. 
  3. After A reports the Cloud to remove F, it will take some time for the Cloud tells B to do the same. In my case, "some time" is long enough to cause problem.
  4. It is very possible that before 3 happens, B indexes F and considers it as a new file and upload it.
  5. Since F now is a new file recently uploaded, the Cloud will tell A to download F.
  6. This may take forever - maybe even a dead loop.
The solution is very easy: No uploading, indexing and downloading file list at the same time. The lantency to go over all files may cause problems. I finally calmed everything down by connecting only one computer to Dropbox at one time.

But Dropbox uses a non-conservative strategy for quick synchronization across computers.

This purpose of this blog post is not to attack Dropbox, which, i have no doubt,  is a great company. But this is a problem when using Cloud as main storage.

(Picture) My precious Saturday afternoon:

I may make mistaking in steps 1-5, please feel free to tell me. I didn't think very carefully.

2011-09-01

Dropbox, not a version control choice

I lately need to work on a program back and forth between Mac OS X and Linux.

So I copied everything into a Dropbox folder, to edit the source code in Linux and compile it in Mac OS X. Then I noticed that something went wrong all the time. Anyway, i could not compile it. The Makefile generated from ./configure was always weird.

But if I used scp to sync files, nothing went wrong.

I don't know the reason yet. But I think it is because how Dropbox handles symbolic links.

In conclusion, don't expect to use Dropbox as a collaborative version control system.

PS: The reason i need to work on Linux and compile the code on Mac OS X is because Mac OS X has not-strong-enough memory protection mechanism. So the code that causes segmentation fault on Linux can run well on Mac OS X. And I don't have time to fix the problem now.

So, conclusion 2: Mac OS X (at least 10.5 or 10.6) isn't as secure as as Linux (at least 2.6 kernel) on memory protection.