3月 03

去年夏天的時候,Google大肆炒熱AppEngine的平台,讓使用者能夠撰寫自己的程式,並且放在Google的雲端計算環境上執行。

Google AppEngine的好處我們都曉得,尤其對於應用的角度來說,無非就是可以讓很多有想法的網路創業族群能夠以極少的成本自行開發軟體並且供人使用。但從學術角度及高效能計算的觀點,Google的運算資源極為龐大,如果只是單拿來跑應用程式,有點可惜。

於是有了這個HTTPMR。

Continue reading »

written by Kiwi

6月 17

說真的這幾天實在是令人覺得驚奇

打從聽到Jeff發現我的作品也被選上,到公關公司打電話來
星期三過去看見73樓這些令我讚嘆的景色
直到記者會…直到星期六上台這10分鐘
總覺得好像在夢境中

不管怎樣,還是很給感謝Google給我這個機會展示
儘管還有許多功能還要加強,而且ok17go整合apps engine也已經是勢在必行了
我想接下來我有一些重要的任務就是,趕緊多帶一些學弟們一起開發
不然使用者們想要的功能就要等很久了

星期三基本上是去談一些初步的方向,例如說當天該怎樣簡報,也認識到了Caroline,Josie,Jessica,Andy等人。大家一下子就聊開了,其中Jessica一直讓我覺得很像我一個國中同學,大家都叫他奧莉薇XD。Caroline很招待我們,各塞給我們一個冰淇淋,還有一堆零食帶回家。文化是的確不同,但還是有點不好意思。

其實我心裡一直覺得能夠在73樓看風景,就已經不枉此行了吧。

Continue reading »

written by Kiwi

5月 24

(本文圖片皆引用自PGCluster官方網站,http://pgcluster.projects.postgresql.org)

我在商業服務的Ruby on Rails HTTP Cluster觀念及測試中的第一張圖的前面那一段有提到說,DB的情況有點像是如此,不過實際上情況有點不同。因為有網友的疑問,如今我認為該是時候補完一下。

應用系統如果要能夠真正地服務大量的使用者,與常見裝個MySQL然後跑個PHP論壇程式,是完全的兩回事。因此一個良好的資料庫管理員,必須清楚地知道自己的應用程式與資料庫在單台機器上執行的時候,效能的瓶頸在哪裡。如果不清楚應用程式及資料庫各佔的資源比例,那在切割成叢集的時候,並不見得有 顯著的效能提升,因為負載平衡以及複寫管理的程式都會吃CPU。認為1+1就極有可能等於2,這個是一般的管理員錯誤的認知。

舉例來說,許多大型的論壇,擁有上萬使用者,每天流量破10G;這樣的論壇,有些時候一開始因為資金及管理人力的限制,會考慮只買一台效能相當好的伺服器(例如HP ProLiant 380 G5),並且將Apache+PHP(應用程式)與MySQL(DBMS)擺在同一台主機上。管理員會想說反正這台效能高,一方面省下買另一台伺服器的錢,一方面PHP程式不用透過網路與MySQL連線,理論上應該效能很好。卻沒有考慮到,一般的論壇Web應用程式是以CPU及RAM需要量大的應用,而DBMS是一種I/O裝置(RAM+Disk)需要量大的應用。這是由於,大多數的管理員會誤以為DBMS僅吃CPU與RAM。負載低的時候看起來沒什麼,一旦人數增多,表示應用程式的部分記憶體就會越吃越多。系統用來快取的記憶體不足,很快地瓶頸就會出現在記憶體及硬碟之間,造成資料庫效能低落。這個代價比使用兩台機器跨網路線這樣的部署方式要來的大太多。

Continue reading »

written by Kiwi \\ tags: , , ,

6月 27

http://postgresql-chinese.blogspot.com/2007/06/postgresqlmysqlfirebird.html

我覺得大家看到這一篇就可以不用再爭了,這已經解釋地相當清楚
以往我經常遭到到底該使用哪個資料庫的挑戰,很可惜的是到最後MSSQL,Oracle我幾乎都沒有考慮
你應該不會有聽過人用裝Oracle只是來架個Blog吧?

不過比起文章中我還要附加一點
相較於mysql,視窗版的postgresql安裝介面比較不人性化,而且同樣地視窗管理介面比較簡單(剛好滿足基本功能)

firebird在資料庫系統的定位中就相當模糊,他既無法承受大量的連線數,又需要啟動服務程序,否則效能就會大減
還是一句話,總不能架blog用firebird吧?

至於單機應用,那當然是選擇sqlite
最佳的範例就是GoogleGears

written by Kiwi

6月 15

2007年是一個Web與P2P大放異彩的時代,我相信大家有要求及使用更方便更迅速軟體的權力,也因此我強烈建議m-team開啟RSS的功能,讓大家一有新文章就可以趕快來看。

什麼是RSS?參考以下連結

http://zh.wikipedia.org/wiki/RSS
http://www.ytower.com.tw/rss/about_rss.htm
http://www.tuzaiz.idv.tw/archives/13

Continue reading »

written by Kiwi

1月 04

Rails的ActiveRecord大家已經很熟悉,可是實際上Rails Team他們卻慢慢地在提供新的功能讓大家感受不一樣的寫程式習慣。我相信有些功能是很實用,但是避免大家會依賴syntax suger,還是要稍微解釋一下裡面幹了些什麼,如此你可以自行判斷怎樣才不會做太多重複的事。

雖然這個函示庫是給Rails使用的,不過我會建議大家多利用在任何型態的專案裡,如此就很快地可以"write like a ruby programmer"。

請參考 http://lightyror.blogspot.com/2006/09/blog-post.html

更多的資料請參考 http://api.rubyonrails.org/

舉個例:

[code]
irb(main):001:0> require 'active_support'
=> true
irb(main):002:0> 10.years.ago
=> Sun Jan 05 03:57:34 +0800 1997
irb(main):003:0> 6.hours.ago
=> Fri Jan 05 09:57:44 +0800 2007
irb(main):004:0> 6.hours.since
=> Fri Jan 05 21:57:51 +0800 2007
[/code]

當然不只十年之前,之後也可以
以下列出大略的method以及他們的作法

時間

所有的數字(包括小數)都繼承自class Numeric,而前面的範例就是Fixnum的method

  1. 計算秒數:呼叫這些methods會傳回一個整數,表示秒數
    • second(s)
    • minute(s)
    • hour(s)
    • day(s)
    • week(s)
    • year(s)
    • RUBY:
      1. 60.seconds==1.minute

  2. 從::Numeric計算日期:從任何繼承自::Numeric的物件可以計算出日期,這些methods傳入::Time的物件便可以從該時間計算
    • until,ago:向前計算
    • since,from_now:向後計算
  3. 從::Time物件計算時間:以下method傳入任何繼承自::Numeric的數值。其實會呼叫到上面的method。
    • until,ago:向前計算
    • since,from_now:向後計算
  4. ::Time更改數值:
    • change

written by Kiwi

12月 19
  1. Perl is the oldest Web Programming Language, and then influences PHP, Python and Ruby. If you want to get those language started very fast, you better learn Perl first.
  2. Perl Compatible Regular Expression(PCRE) has many instances on utilitites and editors, and also on many Web Programming Languages. If you wish to match your text quickly, learn PCRE first.
  3. Perl provides programmers more than one way to write with flexible syntax, this also has effects on later Web Programming Languages such as Ruby.
  4. The main data structures of Perl are scalar, list, associative array. However string, regular expressions are also important. These are all essentials of later Web Programming Languages, through Perl that you will understand how to manipulate them with your code.
  5. Using Perl to wirte CGI code looks somehow inefficient, but helps you integrate other Client Side languages to it. Generating code with Perl's string processing, reference or OOP also helps you get well to differences between Server Side and Client Side programming, and how to coordinate them.
  6. In those old years with Perl, we use CGI program to show HTML and process HTML forms. If you practice this now, you can know the structure of HTTP and the actual data a web server gets. When debugging in HTTP level, you will resolve the bug in a very short time. Most Web Programming Languages
  7. Perl can combine C libraries effectively, that's how later Web Programming Languages make stable. Once your code needs acceleration, you can write C libraries to be used in your web application. Most Web Programming Languages for now support this way.
  8. Load mod_perl into your apache web server, this makes you realize how mod_php and modules for other language work. Use CGI wrappers to run your code if you find it hard to do so, and you will notice some security problems with your code.
  9. When reading Perl docs, or writing code with POD(perl's documentation format) on it, you can use perldoc to generate API documentation. You will learn that writing code is writing beautiful documents.
  10. There is a huge software library called CPAN, you can use it to install libraries, or join software projects. You may learn how an opensource project works. CPAN has been running for 10 years, with 280 mirror sites, more than 5000 authors and 10000 libraries. This is a goal of most Web Programming Languages.

The purpose I write this article isn't telling everyone to write your applicaiton with Perl. My previous article has talked about, I don't even really want to write for now because Perl spend me a lot more time.
Many of Web Programmers depend on Framework and ignore essential of web technology.
Obviously, after learning a language like Perl (and resolve hard problems), they will understand what HTTP, Apache, CGI is. Myabe read some documents of it such as PCRE will help.
Continue reading »

written by Kiwi

12月 15

http://www.jubling.com/ten-reasons-why-every-programmer-should-learn-c.html

我應該去寫個Ten reasons why web programmers should learn perl ...

為什麼Script Language可以這樣彈性?
Script Language一定就慢嗎?他又是怎樣才能寫的快?
為什麼只需要幾種基本型態如Array,Hash就足夠?
結構化且直線的Perl CGI程式如何撰寫?跟Ruby的View又有啥關係?
Perl如何促成了Web Programming?
我認為答案都在Advanced Perl Programming裡(已經絕版 ...)

我記得兩年前我讀這本書的時候,也正是PHP,Python在熱門的時候。而Perl雖然快要成灰燼了,卻在某些系統管理的角度還是很有用。

我並不是Perl的死忠支持者,但我相信在Web Programming越來越簡單的今天,設計師們不應該只是用簡單的物件堆疊,元件拖拉放,做出固定的視窗表單風格,或是犧牲效能完成程式。應該更注重Web的本質,多善用各種特校,ajax及排版來增強使用者經驗及改善效能。Web之所以能夠造成與視窗程式截然不同的發展方向與高人氣,也是因為這原因。

目前我已經將發展方向移往Ruby,我確實在我的學弟身上發現學習Perl對他們後來學習Php及Ruby有相當大的幫助。

written by Kiwi

9月 20

Continue reading »

written by Kiwi \\ tags:

8月 10




距離之前研究也有一陣子,忽然發現狀態並不見得單純的branch而已。
無奈一心無法兩用~晚上來惡補一下。

Continue reading »

written by Kiwi