Friday, June 24, 2011

Monitor systems using Munin Part II

Monitor systems using Munin Part II
by GKONTOS on FEBRUARY 20, 2011

We saw earlier how easy it is to set up munin in FreeBSD. Now, what if a system that you wish to monitor is located somewhere beyond your firewall(s) perimeter ? You could install munin-node and let the whole world to grab your system statistics or become a victim of a future exploit! You could on the other hand tunnel the traffic via ssh.

Openssh has the ability to create a tunnel to encapsulate another protocol in an encrypted session. Which means that you can pretty much pass any traffic you want, even bypass firewall restrictions. Lets try it out. First you have to set up munin-node on the target host.

#cd/usr/ports/sysutils/munin-node/ && make install clean
Edit /usr/local/etc/munin/munin-node.conf and change the bind address to host 127.0.0.1. Start munin-node

#echo 'munin_node="YES"' > /etc/rc.conf && /usr/local/etc/rc.d/munin-node start
Make sure that the daemon is listening

host# telnet localhost 4949
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at host.my.domain
Now lets try to set up the tunnel. From the munin master initiate a ssh tunnel

ssh -2 -N -L 5000:host.my.domain:4949 user@host.my.domain
What we just did ? We created a tunnel to host.my.domain as user and from tcp port 5000 to tcp port 4949. Try connecting to the localhost from munin-master.

host# telnet localhost 5000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
# munin node at host.my.domain
Beautiful! Now lets add this node to the monitor servers. Edit /usr/local/etc/munin/munin.conf in the munin-master, and add the new host.

[this host]
address 127.0.0.1
use_node_name yes
[host.my.domain]
address 127.0.0.1
port 5000
use_node_name yes
There a couple of things though that need improvement. First, you have to type a password and second what happens if the ssh session is terminated.

Setting up ssh with key exchange
Setting up ssh authentication with key exchange is not only easier, it is also more secure. Log on to the master-node with the account you wish to create the key and issue the following command:

gkontos@hp>ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gkontos/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gkontos/.ssh/id_rsa.
Your public key has been saved in /home/gkontos/.ssh/id_rsa.pub.
The key fingerprint is:
ed:3e:d7:62:48:7e:2b:f1:d5:94:e3:13:ee:7a:fa:aa gkontos@mydomain.loc
The key's randomart image is:
+--[ RSA 2048]----+
Good, now you should 2 files, one is id_rsa.pub and it contain your public key, the other one is id_rsa and it has the private key to encrypt data to the remote server.
To enable auto ssh login without being prompt for a password, create the ./~ssh/authorized_keys2 on the munin-node and copy the public key into it. Try logging again

ssh -2 -N -L 5000:host.my.domain:4949 user@host.my.domain
You should now be able to log in without typing any password.

Maintain the ssh tunnel
Autossh is a nice program that monitors and restart ssh sessions and tunnels. It is also very easy to install.

#cd /usr/ports/security/autossh && make install clean
Now lets try to connect with auto ssh

autossh -2 -fN -M 20000 -L 5000:localhost:4949 user@host.my.domain
That should do it. If you check you will see that the tunnel is up. Autossh will monitor the connection and will attempt to connect again if it is lost. So, unless you reboot the machine your tunnel will be up for ever.
I was thinking of writing a startup script because on occasions I do reboot my machines. But because I m too lazy I use a crontab entry like this

gkontos@hp>crontab -l
@reboot /usr/local/bin/autossh -2 -fN -M 20000 -L 5000:localhost:4949 gkontos@my.server
So, each time my machine reboots a tunnel is started automatically!

Reference:
http://www.aisecure.net/?p=60

Thursday, June 23, 2011

Monitor systems using Munin

Monitor systems using Munin
by GKONTOS on FEBRUARY 16, 2011

There is always a need to monitor your systems performance. System statistics can help you fine tune a system and can also warn you of possible issues that could lead to a system misbehavior. Munin is a very nice tool for graphing system statistics using the rrdtool and it is based on a client server model. Munin master is used to collect information from Munin nodes. Fortunately Munin has been ported to FreeBSD.

We will need to install two ports:
/usr/ports/sysutils/munin-master // Munin Server port.
/usr/ports/sysutils/munin-node // Munin Client port.

First we will install the master node which will collect all the information and create our graphs.

On the Munin Server, install Munin Server port:
# cd /usr/ports/sysutils/munin-master
# make install

Note: this will install the Munin master and will pull all Perl5 needed modules. At the end it will also create a user munin and a crontab for that user which will run the program every five minutes.

On the Munin Server, view the crontab setting by running this command:
# cat /var/cron/tabs/munin
*/5 * * * * /usr/local/bin/munin-cron

On the Munin Server, let's install the Munin node port on the same system since we want to monitor it as well:
# cd /usr/ports/sysutils/munin-node
# make install

Note: install munin-node port on all machines you wished to monitor.

Now, we have to configure our webserver. In this case I assume that apache is being used and Munin has been installed in /usr/local/www/munin:
# vi /usr/local/etc/apache22/httpd.conf
### [START] Munin
Alias /munin "/usr/local/www/munin/"

<Directory /usr/local/www/munin>
Options none
AllowOverride All
Order Deny,Allow
Deny from all
Allow from all
</Directory>
### [END] Munin

On the Munin Server, you can see AuthUserFile is required:
# cat /usr/local/www/munin/.htaccess
AuthUserFile /usr/local/etc/munin/munin-htpasswd

On the Munin Server, create a Munin Admin called "Munin":
# htpasswd -c /usr/local/etc/munin/munin-htpasswd Munin

On the Munin Server, reload Apache:
# apachectl restart

Now it is time to configure Munin. munin-node-configure is a nice script for setting up your plugins.

On any Munin Clients, run following command:
# /usr/local/sbin/munin-node-configure --shell

Note: the above command will generate a list of commands for making symbolic links. These symbolic links are used for Munin plugins. Select the ones you want, and make the symbolic links.

or you can run following command to create all symbolic links automatically:
# /usr/local/sbin/munin-node-configure --shell | sh -x

On any Munin Clients, add this line to /etc/rc.conf:
# vi /etc/rc.conf
munin_node_enable="YES"

On any Munin Clients:
# /usr/local/etc/rc.d/munin-node start

On any Munin Clients, make sure the munin-node daemon is running:
# ps ax | grep munin

On any Munin Clients, make sure the munin-node daemon is running:
# netstat -at | grep 4949

On any Munin Clients, edit /usr/local/etc/munin/munin-node.conf and allow your munin-master IP for example 10.10.10.4 to connect:
# vi /usr/local/etc/munin/munin-node.conf
allow ^127\.0\.0\.1$
allow ^10\.10\.10\.4$

On any Munin Clients, add this line to /etc/rc.conf:
# vi /etc/rc.conf
munin_node_enable="YES"

On any Munin Clients, start munin-node:
# /usr/local/etc/rc.d/munin-node start

On the Munin Server, edit the /usr/local/etc/munin/munin.conf of your munin-master server to collect information:
# vi /usr/local/etc/munin/munin.conf
### a simple host tree
[master-node.example.com]
address 127.0.0.1
use_node_name yes

[target-node.example.com]
address 10.10.10.1 #This is the IP address of my target host
use_node_name yes

Note: Munin wants the host names to match between its configuration and what the munin-node calls itself (see the Troubleshooting section below).

Troubleshooting Section

Check log files
# tail /var/log/munin/munin-update.log
# tail /var/log/munin/munin-node.log

On one host there are no graphs at all!

No plugins installed on the munin node

Plugins that munin-node uses are usually to be found in /etc/munin/plugins (or /etc/opt/munin/plugins). If the directory is empty you will need to fill it. The directory should have been filled by the package installation script or by you when you read the INSTALL instructions.

You can fill it manually by symlinking to files in /usr/share/munin/plugins (or /opt/munin/lib/plugins). Or automatically by running munin-node-configure --shell | sh -x. This will which plugins it thinks are suitable on your system and make the symlinks.

After making all the symlinks restart munin-node.

Then wait 5 to 10 minutes before re-loading the munin web pages to see graphs.

Did you restart munin-node?

Restarting munin-node is a rather heavy operation requiring running all the plugins as part of the startup. Therefore munin-node does not restart itself when the contents of the plugin directory changes. So after making a change in the plugin directory you need to restart munin-node.

There is a bug in a good number of versions of the Debian (and Ubuntu) munin package that did not restart munin-node after running munin-node-configure. A manual restart is needed in this case.

Then wait 5 to 10 minutes before re-loading the munin web pages to see graphs.

Inconsistent names for the node on the master and on the node

If your node has plugins and is restarted the next possibility is: it is likely because the server and the node have inconsistent name information for the node. Munin wants the host names to match between its configuration and what the munin-node calls itself.

If you telnet to the node you'll be told the node name:

$ telnet lorbanery 4949
Trying 10.1.0.2
Connected to lorbanery.
Escape character is '^]'.
# munin node at lorbanery.langfeldt.net
quit
Connection closed by foreign host.

This means that this machine knows itself to be named lorbanery.langfeldt.net. If the name shown is not what you expected, you need to configure the correct name in munin-node.conf:

host_name lorbanery.langfeldt.net
On the master you configure lorbanery like this:

[lorbanery.langfeldt.net]
address 10.1.0.2
This makes the names identical. If you had put lorbanery in the square brackets the result would be no graphs because munin expects the whole name to be the same, and the whole name isn't lorbanery.

Restart munin-node, then wait 5 to 10 minutes before re-loading the munin web pages to see graphs.

I just read the above answer and there still aren't any graphs

Then it's time to get more advanced. Consider the following protocol exchange for lorbanery aka lorbanery.langfeldt.net. You should of course use the host name of your host, as configured in the munin.conf file. Please make very sure that you use the whole and exactly the same filename as configured in munin.conf.

$ > telnet lorbanery.langfeldt.net 4949
Trying 10.1.0.2...
Connected to lorbanery.langfeldt.net.
Escape character is '^]'.
# munin node at lorbanery.langfeldt.net
> nodes
lorbanery.langfeldt.net
wifi.langfeldt.net
.
> list lorbanery.langfeldt.net
open_inodes http_loadtime irqstats apache_accesses df swap uptime load ntp_offset cpu df_inode open_files ntp_kernel_err forks iostat memory vmstat apache_processes entropy ntp_kernel_pll_freq postfix_mailqueue processes apache_volume users interrupts netstat iostat_ios if_err_eth1 if_eth1 postfix_mailvolume proc_pri surfboard threads ntp_kernel_pll_off
> fetch df
_dev_hda1.value 66
tmpfs.value 0
udev.value 1
tmpfs.value 1
.
> quit
Connection closed by foreign host.
The user input is marked with ">"s.

This is the actual exchange used with munin-nodes that understands the nodes command. The nodes command asks the munin-node which hosts it has information for, then asks it to list the plugins that represent lorbanery.langfeldt.net. Lastly it fetches the df results from lorbanery.langfeldt.net.

If the output of the list command with the host name behind is empty, there are no plugins installed for that host. And that's the reason there are no graphs.

If there are plugins listed by the list command then you have some other problem. Please contact the users mailing-list.

Node does not "allow" master to telnet

You have not added allow to node's munin-node.conf file. See munin-node.conf. Ensure you use the reg ex syntax as prescribed there.

See also Debugging_Munin

Reference:
http://www.aisecure.net/?p=50
http://munin-monitoring.org/wiki/FAQ_no_graphs

該如何學好"寫程式"?作者 : jasper(Jasper)

作者 : jasper(Jasper)


該如何學好 "寫程式"?

這是安德魯的部落格上的一個系列的文章,這個系列總共有五篇,第一篇的原文在此 http://columns.chicken-house.net/post/GoodProgrammer1.aspx

該如何學好〝寫程式〞?文中提了三點:

1.最基本的: 計算機概論 & 資料結構
這些有助於你用正確的邏輯寫程式。要成為一個合格的 programmer 一定要有這樣的能力。

2.進階一點的系統層面,作業系統 & 系統程式
這些有助於你瞭解系統層面如何運作,如果你開發的系統需要些基礎建設,像是元件等等,這些知識很有用。成為 software engineer 就應該要有這些基礎。

3.再來就專精一點了,我推薦 OOP 理論 / Design Patterns、或是軟體工程的方法論 ( XP, TDD ... 等 )。
這個層次的知識能幫助你設計正確的架構,或是用正確的方式開發軟體,是成為 ARCHITECT 的必要技能。

文中談到了資料結構,然後在第二篇、第三篇分別講解了如何運用正確的資料結構及演算法。在第三篇提到PASCAL 之父 (Niklaus Wirth) 講的這句名言: "程式 = 資料結構+演算法"。

我自己在修資料結構這門課時,那是大二的必修課程,剛好經過了大一的計概的 Fortran 及 Pascal 的磨練,有了一點點的程式撰寫經驗,所以會對資料結構這門課程更覺得有意思、有深度。引用文中的一段話:

想到資料結構,不外忽一堆排序 (SORT) 的演算法,或是各種 TREE / LIST 等怎麼 "放" 資料,及怎麼 "找" 資料的問題,如 LINKED LIST,HASH TABLE,BINARY TREE,HEAP,STACK 等等。再來就是什麼問題可以用什麼資料結構來處理?像是走迷宮要靠 STACK,各種資料結構的特性為何?它們的時間複雜度 (Time Complexity) 為何?什麼時後該用那一種?

我自己在設計一個英文字典查詢功能上栽過一次,那時用 Binary Tree 來記載每個單字,結果耗掉的記憶體空間太多,導致程式根本無法執行,那是一個 640 KB 上限的環境。

執行的環境有時候會對程式設計的方法有所限制,我另一次的經驗是在一台手提電腦上,一個等待的迴圈增加了耗電量,那又是一個沒有 NoteBook 玩意的時代。遊戲寫慣了,偵測不到鍵盤有動作,當然會自動做一些動作,哪裡會知道硬體設計會期望沒有輸入動作就該休息,以便省電。呵!當然那個〝手提電腦〞最後一定是不了了之。

很多人都不知道資料結構這門課真正的用途何在?只覺得重要。現在程式語言已內建 Sort, LinkList, Tree 等功能,也沒必要自行開發。但如果您不懂,未必能挑對內建的物件,就像這系列第二篇提到的用錯了 List。

資料結構、演算法、資料庫表格的設計等等,多一點的思考會讓您的程式寫起來更簡潔、更有脈絡,當然啦,門外漢會很難理解其中的奧妙、玄機。

程式入門、上手是很容易的事,畫面上拉拉控件、安排事件處理,易如反掌。然而該如何進階呢?不外基礎紮根,多多加強這方面的認知才是根本。

=========
作者 : fcwang(fortran)

如果要在這幾項基本工找出最重要的根基, 我會毫無遲疑地選擇資料結構, 因為它是讓我理解作業系統,資料庫, ...等許多電腦軟體必修課程的基礎.

個人修習資料結構可以說是自修完成的, 它讓我非常著迷, 也有相當的心得.
個人認為如果對資料結構未能修成正果, 你可能無法理解作業系統的運作. 作業系統中記憶體的管理(包含Garbage Collecvtion), Process Management, ... 等都是Link List的運用
程式設計師常呼叫副程式或Procedure, 有多少人真正理解它是 Stack 的運用. 如果你真正理解它是 Stack 的運用, 你就不會對Call by value或 Call by Reference有迷惑.
資料庫更毫無疑問地是以資料結構為主的系統.

資料結構是非常難的一門課程, 因為有許多數學觀念, 學生經常會分成 知之為知之,不知為不知的兩極化的群組. 如果資料結構能學得好, 學 Design Pattern就不會有太大問題,因為也是有許多抽象的概念
如果有興趣從事軟體設計的工作, 學好資料結構是會有相當的助益. 學習是一回事, 但是如何應用則是另ㄧ項挑戰. 這是我個人對年輕學生的建議.

========
作者 : seabook_liu(西布克)

個人經驗是...Data Structure和Compiler還有Architecture真的是基本功。
即便是工作十年,這些東西還是很重要。畢竟根基沒有打好,學再多花樣都是枉然!

不過現在的老闆倒是很喜歡很多花樣的人...

要學好最快的途徑就是,大量的翻人家寫得典範code吧... ACM 上面很多可以參考。

http://www.programmer-club.com.tw/ShowSameTitleN/exp/14428.html

Wednesday, June 8, 2011

How do I sort a multidimensional array in php

How do I sort a multidimensional array in php

Method 1:
<?php
class TableSorter {
  protected $column;

  function __construct($column) {
    $this->column = $column;
  }

  function sort($table) {
    usort($table, array($this, 'compare'));

    return $table;
  }

  function compare($a, $b) {
    if ($a[$this->column] == $b[$this->column]) {
      return 0;
    }

    return ($a[$this->column] < $b[$this->column]) ? -1 : 1;
  }
}

$arr = array();

$arr[] = array('IBM', 'NYSE', 100);
$arr[] = array('MSFT', 'NASDAQ', 400);
$arr[] = array('GOOG', 'NASDAQ', 200);
$arr[] = array('AAPL', 'NASDAQ', 50);

$sorter = new TableSorter(2); // sort by third column
$arr = $sorter->sort($arr);

echo '<pre>';
print_r($arr);
echo '</pre>';
?>


Method 2:
<?php
$arr = $index = array();

$arr[] = array('IBM', 'NYSE', 100);
$arr[] = array('MSFT', 'NASDAQ', 400);
$arr[] = array('GOOG', 'NASDAQ', 200);
$arr[] = array('AAPL', 'NASDAQ', 50);

foreach ($arr as $key => $row) {
    $index[$key]  = $row[2];
    // of course, replace 2 with whatever is the field's index
}

array_multisort($index, SORT_ASC, $arr);

echo '<pre>';
print_r($arr);
echo '</pre>';
?>

Reference: http://stackoverflow.com/questions/96759/how-do-i-sort-a-multidimensional-array-in-php

Saturday, June 4, 2011

Don't date a programmer!

Don't date a programmer!

The Valentines day for 2011 is just a Monday away. Do you have a date? Or do you ever experience dating a programmer? Somewhat like a computer scientist. Why try to date one?
Don't date a programmer.

Programmers are geeks. They are nerds. They are anti-social. They are hackers and will just hack your Facebook account. They are self centered. They spent their whole time in front of a computer, typing some weirdo code. They end their line with a semicolon. They are just plain weird.
But if you still insist and want to take the risk, do some adventure and try it. Try and date a programmer!

Maybe it is an adventure, because a programmer, a computer scientist is no ordinary person. Yes, maybe they are geeks and nerds, but have you ever heard of Chuck?

He's a nerd, just do the math.

Programmers think outside the box. They use their critical thinking skill to formulate some algorithms. It definitely needs going out of the box to do it. Thus it solves the problem of cliche. They are wild thinkers and can execute an outside of the box move. A move that is new to the eyes, definitely not a cliche. Who says proposing using a game is overused?

If thinking outside of their box is not enough, how is thinking inside the other box? How about thinking inside your box? Programmers need rigorous testing for their programs to work well. To do it, the programmer must simulate the position of the projected user and use their program. It is thinking like the other person.

With it, that programmer can see things in your perspective. A perspective different from his, but he will definitely understand the way you think.

They also understand the concept of strict rules. Programmers need to have the correct syntax in their program for it to compile and run. They understand how important rule is and not following it can lead to a bad result.

Unlike some people, they also know that a certain "if" word exist and it can always be there. They know that some things or event might not happen with that "if". Life is full of uncertainty and you will never know what will happen next. When an "if" event happen, they know how to accept it.


Everything happens for a reason, and programmers know it. Every effect has a cause, and every cause has an effect. A small problem that is disregarded might be a bigger problem and may affect later. A problem ignored, is not a problem solved. Programmers also know that perfection is such an impossible to achieve. Because they know, that even though their program is well made, sooner or later, a bug will appear. A problem that needs an update to fix. A problem is better solved than ignored.
Computers do not understand the language of the people, but the programmers can understand the language of the computer. Programmers are flexible. Try to date a programmer and you will not have a hard time fitting in, because they will understand you with ease.


Simple things are appreciated by programmers. And they do not take it for granted. It is because the programs made by them are somewhat taken for granted. The simple interface of the program is just a mask to a much more inside. The complex code that is written by the programmers is hidden to the user unlike the wires and circuits of engineers that can easily be seen by naked eye.

Yes, those are some qualities of a programmer. Programmers that are sometimes stereotyped by misconceptions.

But the fact is, programmers are really cool. Try to date one.


I am a programmer.

Inspired by this post and this post.

Wednesday, June 1, 2011

MIT、CMU 美国计算机专业最牛20名学校大点评

[作者:水木清華  ]


(會員:陳宇投稿)
約定:CS=計算機科學 (系)。總的來說,前20的CS可以分成三波:


一、4個最為優秀的CS Program: Stanford, UC. Berkeley, MIT, CMU


二、6個其他前10的: UIUC, Cornell, U. of Washington,Princeton, U. of Texas-Austin 和 U. of Wisconsin-Madison, 其中UIUC, Cornell, U. of Washington和UW-Madison幾乎從未出過前10。


三、其他非常非常優秀的CS:CalTech, U. of Maryland at CP, UCLA, Brown, Harvard , Yale, GIT, Purdue, Rice, 和 U. of Michigan.

  Stanford URL: http://www.stanford.edu/ Stanford的CS是個很大個的CS,擁有40人以上的Faculty成員,其中不乏響噹噹硬梆梆的圖靈獎得主(Edward A.Feigenbaum, John McCarthy) 和各個學科領域的大腕人物,比如理論方面的權威 Donald E. Knuth; 數據庫方面的大牛Jeffrey D. Ullman(他還寫過那本著名的編譯原理,此人出自Princeton);以及RISC技術挑頭人之一的John Hennessy。相信CS的同學對此並不陌生。該系每年畢業30多名Ph.D.以及更多的Master。學生的出路自然是如魚得水,無論學術界還是工業界,Stanford的學生倍受青睞。幾乎所有前10的CS中都有Stanford的畢業生在充當教授。當然同樣享有如此地位的還包括其他三頭巨牛:UC.Berkeley, MIT 和 CMU. 畢業於U. of Utah的Jim Clark 曾經在Stanford CS當教授。後來就是這個人創辦了高性能計算機和科學計算可視化方面巨牛的SGI公司。SUN 公司名字的來歷是:Stanford UniversityNetwork.。順便提一下,創辦 YAHOO的華人楊致遠曾在斯坦福的EE攻讀博士,後來中途輟學辦了YAHOO。 CS科研方面,斯坦福無論在理論,數據庫,軟件,硬件,AI 等各個領域都是實力強勁的頂級高手。斯坦福的RISC技術後來成為SGI/MIPS的 Rx000系列微處理器的核心技術; DASH,FLASH 項目更是多處理器並行計算機研究的前沿;SUIF並行化編譯器成為國家資助的重點項目,在國際學術論文中SUIF編譯器的提及似乎也為某些平庸的論文平添幾分姿色。 Stanford有學生14000多,其中研究生7000多。CS有175人攻讀博士, 350人攻讀碩士,每年招的學生數不詳,估計少不了,但不要忘了,每年申請CS的申請學生接近千人。申請費高達 90$。 斯坦福大學位於信息世界的心臟地帶--硅谷。加州宜人的氣候,美麗的風景使得Stanford堪稱CS的天堂。33.1平方公里的校園面積怕是夠學子們翻江蹈海,叱姹風雲的了。 申請斯坦福是很難成功的,但也並非不可為之。去斯坦福這樣的牛校,運氣很重要,牛人的推薦也很重要。


  UC-Berkeley URL: http://www.berkeley.edu/ 同樣地處舊金山灣畔,硅谷地帶,離Stanford只有大約 50公里的加州大學伯克利校區:UC.Berkeley是美國最激進的學校之一。60年代的嬉皮文化,反越戰,東方神秘主義,回歸自然文化都起源於此。詩人愛倫金斯堡是當年 Berkeley的代言人。 在當今高科技領域C. Berkeley 在締造新的神話,在文學,數學,化學,新聞等20多個大的學科領域中位居前3. 16個諾貝爾獎得主,總數近200的科學院院士、工程院院士,連同眾多在硅谷商戰中成為億萬富翁的伯克利人撐起了一面彙集天下之英才的大旗。INTEL總裁AndrewGrove畢業於UC. Berkeley。 BSD版的UNIX影響了整個OS界,伯克利的RISC技術後來成為了SUN公司SPARC微處理器的核心技術,巨牛人物David Patterson接下了一個6億美元的項目用於新型計算機體系結構,特別是IRAM的研究開發。 UC. Berkeley有學生30000多,研究生超過8500。申請費和其他加州大學的分校一樣,40$。據一項最近的調查,伯克利已經成為美國大學生最嚮往的研究生院,高居榜首,其申請的難度可想而知。UC.Berkeley的 DEADLINE一般很早,12月中就截至了,其內部 的實際DEADLINE其實要遲一些。 Berkeley的CS是個大系,Faculty中有圖靈獎得主以及象 Patterson這樣的巨牛。學生的出路同Stanford,MIT,CMU一樣,光 圓 爛,前程錦繡,這裡不再贅述。CS科研方面,Berkeley也是樣樣強,門門巨牛。 舊金山湛藍起伏的海灣,蒼翠綿延的山巒,舒心宜人的氣候,以及近在咫尺的硅谷…… 這一切的一切不也使得UC.Berkeley 儼然一個CS 學子的世外桃源麼?

  MIT URL: http://www.mit.edu/ MIT 招生好像不看GRE成績。但MIT的CS是巨牛的,99年最新排名上它和斯坦福被打了5.0 的滿分,並列第一。MIT的CS曾為CS的發展作出不可磨滅的貢獻,數據流計算的思想和數據流計算機、人工智能方面的許多重大成就,以及影響了整個 UNIX界的X-Window……MIT和斯坦福,CMU, UC. BERKELEY一樣,都是幾乎在CS界樣樣巨牛的學校。 MIT的Media Arts and Sciences其知名度不在Computer Department下。主要是多媒體技術,信息處理,人工智能……有一大批著名的教授,如Marvin Minsky (Turing Aw ard)


  CMU URL: http://www.cmu.edu/ CMU是個位於匹茲堡的不大的學校,學生7000多,校園好像也不大。但這個學校在工程及其他一些領域卻是頂尖的學堂。 CMU的 CS 不單單是個系,而是一個學院,其規模之大,可能只有Stanford, UIUC可比。教師學生的情況同前面3個類似,不再贅述。Mach 操作系統,PVM,C.mmp等都有CMU的巨大貢獻。 申請CMU的難度很大,因為儘管CMU的 CS Faculty很多,但每年只招不足30人的研究生隊伍。


  CORNELL URL: http://www.(cs.)cornell.edu 作為 IVY LEAGUE的成員和一所私立學校,Cornell有其獨到的優勢。在美國,私立學校一般比公立學校難進,其學生也是經過很嚴的選拔才錄取的,Cornell的CS學生入校後多能享受FELLOW的待遇,其個人經濟條件非公立學校可比,加上貴族式校友的提拔,私立學校的出路是很誘人的。 Cornell在理論計算機方面一直是頂級高手,但在其他CS領域並不總能在前10.Cornell學生18000多,研究生過5000。CS每年招攻讀Ph.D.的學生25 人左右。


  UIUC URL: http://www.uiuc.edu/ UIUC的工程院在全美堪稱至尊級的巨牛,其CS,ECE,EE在歷史上都屢建戰功。在CS方面,從早期的超級計算機ILLIAC I, II, III, IV到後來的 CEDAR,都是CS發展史上,特別是並行計算機發展史上的重要事件,影響,引導了很長時期的發展。 David Kuck曾是並行處理界的一代先驅。 超級計算機研究開發中心:CSRD,美國國家超級計算及應用中心:NCSA等眾多的機構,使得UIUC的CS常常成為研發的領軍頭領。 大家可能還記得,Netscape-Navigator 的最初開發人員中有個Marc,Anderssen。這位來自WISCONSIN的小夥在UIUC讀本科,大四的時候在NCSA參與編寫了MOSAIC,後來他去了硅谷,並在那裡遇到了前面提到過的大牛: Jim Clark,SGI的前創始人,兩人一見如故,聯手創辦了著名的網景,並一度在瀏覽器市場上獨霸武林。 隨著一代代至尊大師的離去,UIUC 的 Faculty看上去似乎並不引人 注目。但得提醒你,UIUC的CS向來以實幹著稱。我期待著他們下一個驚世之舉。 UIUC是個大學校,學生數過35000,研究生院的近萬。UIUC的CS很大個,40餘個Faculty提供了全面的CS教育和科研項目。每年30多個博士的畢業數目似乎只有斯坦福可以匹敵。 UIUC的Polaris並行化編譯器是這個領域和斯坦福的SUIF直接叫板的拳頭產品。清華開發並行編程環境時選用了這個系統。只是代碼龐大,運作緩慢的Polaris搞的清華有那麼一點點癟西西... UIUC 在計算機硬件,軟件,AI,DB,等各個領域都相當巨牛。特別是硬件,前面提到的ILLIAC,CEDAR.....事實上,UIUC在超級計算機系統的研究開發方面決不遜於CS四大天王中的任何一個,甚至有過之而無不及。NCSA建立在UIUC這一事實本身就是佐證。 UIUC-CS 的學生畢業後去學術界的不少,Stanford, Berkeley...都有UIUC的博士挑大樑。但更多UIUC-CS學人還是進入業界,成為業界實幹的中堅。


  U. of Washington URL: http://www.washington.edu/ 位於 Seattle的 UW 得天獨厚--計算機界的巨牛MS就在西雅圖,而且 更為要命的是,Bill Gates就是那裡兒的人。這位Harvard 的輟學者給了哈福許多MONEY, 但同給UW的錢財相比,實在是小巫見大巫。 U. of Washington位於分光秀麗的WASHINGTON湖畔,氣候四季如春。33000多學生中研究生有8000。Seattle最令人厭惡的地方可能就是一年有160天會降水。 UW的CS較大,30多名Faculty成員,每年近20個優質博士畢業,以及大量的Master。估計每年的招生數應該不低,UW的CS在各個方面比較均衡,最強的軟件排名第5,而其他領域也一般都能位居前10,好像沒有明顯弱的地方。 圖靈獎得主 Dick Karp從Berkeley告老還鄉後又被返聘到了UW的CS。U. of Washin gton的 CS要求很高,Ph.D.學生入學的平均 GPA 高達 3.86, GRE2160+,加上一般較早的DEADLINE,申請UW是相當有難度的。


  Princeton URL: http://www.princeton.edu/ Princeton是個令人神往的地方,這裡曾經是科學的世界中心。Princeton的CS不大, 18個Faculty成員,學生數也不算多。科研上除了排名第5的理論,似乎俺還沒注意到其他閃光點,望知情人補充。但是,Princeton無疑培養出了大量計算機界的優秀人物,Jeffrey D. Ullman, John McCarthy等巨牛人物均出自大名鼎鼎的Princeton. 在Princeton領受的教育是最好的教育熏陶。 Princeton學校不大

Reference: http://www.yuloo.com/liuxue/lxue-lxsx/lxsx-rmzy/2006-05/1148803960.html