Search Google

Sunday, August 16, 2009

Pixar展覽日

今天跟chtsai與信安一行人到台北市立美術館看pixar 20周年展覽,沒想到人超多,買預售票還要排大概一小時,現場買票要等兩小時~


整個展覽中我最喜歡的是那些上面寫滿密密麻麻註記的手稿,還有製作流程的說明影片,感覺上跟我們做系統文件差不多,只是歡樂多了!為了不破壞各位參觀的興致,就不說得太仔細了,不過當然要不免俗地放一些在入口及出口拍的紀念照。




最後推薦大家去看看,可以晚一點再去,如果堅持要現在(週末)去的話就要做好跟一堆人擠&排隊的心理準備~

Tuesday, August 11, 2009

tar + exclude

長久以來都是整個目錄tar起來,還沒有真的用過exclude功能,嘗試了一下之後發現exclude除了要帶路徑之外還要再加上個*,不然想exclude的路徑一樣會被tar起來。

這樣子是不會work2的:
tar czf auto_import.tar.gz --exclude="auto_import/csv_files/" --exclude="auto_import/tmp_csv/" auto_import

這樣子才對:
tar czf auto_import.tar.gz --exclude="auto_import/csv_files/*" --exclude="auto_import/tmp_csv/*" auto_import

Monday, August 10, 2009

擴充sqlldr的容錯值

使用sqlldr將資料倒進DB的時候Oracle預設只要遇到50比錯誤的資料就會停止import,若想將容錯值擴充為大於50,可以使用errors這個參數,範例如下:

/u01/app/oracle/product/10.2.0/db_1/bin/sqlldr control=./ctl_files/vp_tb_vasmd_cdrinfo.ctl errors=10000000 log=./log_files/vp_tb_vasmd_cdrinfo.log userid=foak/qazwsx direct=true

Sunday, August 02, 2009

Use Google Spreadsheet as DB

每天都有新鮮事!
今天的新鮮事則是發現可以把Google spreadsheet拿來當作DB用~

下面兩個links有蠻詳盡的說明:
http://ouseful.wordpress.com/2009/05/14/querying-a-google-spreadsheet-of-mps-expenses-data-so-who-claimed-for-biscuits/
http://ouseful.wordpress.com/2009/05/18/using-google-spreadsheets-as-a-databace-with-the-google-visualisation-api-query-language/

我在試的時候發現如果想要用修改URL方式將spreadsheet拿來當作DB用,光是到spreadsheet的[Share]中設定Get the link to share...將view與edit權限開給所有人還不夠,還要publish spreadsheet,不然就會有access denied的錯誤訊息。

下面就貼個範例好了:
Publish之後的spreadsheet --> http://spreadsheets.google.com/pub?key=tsaL9uDLIVQLQup8e-67sjw
加上DB query --> http://spreadsheets.google.com/tq?tqx=out:html&tq=select%20A,B,C%20where%20A%20contains%20'PHP'%20order%20by%20A&key=tsaL9uDLIVQLQup8e-67sjw

PS. 不過這畢竟不是真的DB,所以有些statement要改一下,例如LIKE要改成CONTAINS,然後statement中的欄位名稱要用spreadsheet裡的ABCD,有點不太人性化,但是對於完全不想要自己架(或找DB)server的狀況下可以藉由spreadsheet來做到動態網頁。