2009年3月9日
2009年3月6日
[Ubunwu007]linux flash 中文亂碼問題
安裝了flash播放器,播放正常,但中文全是亂碼,解決方法如下:
打開配置文件:
cd /etc/fonts/conf.d/
sudo vim 49-sansserif.conf
修改edit節點,將sans-serif
改為sans
文章節錄自 linux flash 中文亂碼 的解決
打開配置文件:
cd /etc/fonts/conf.d/
sudo vim 49-sansserif.conf
修改edit節點,將
改為
文章節錄自 linux flash 中文亂碼 的解決
2009年3月5日
[Ubunwu005]螢幕解析度
Section "Monitor"
Identifier "Configured Monitor"
Vendorname "Dell"
Modelname "Dell E196FP"
Horizsync 31.0-83.0
Vertrefresh 56.0-76.0
modeline "640x480@60" 25.2 640 656 752 800 480 490 492 525 -vsync -hsync
modeline "640x480@72" 31.5 640 664 704 832 480 489 491 520 -vsync -hsync
modeline "640x480@75" 31.5 640 656 720 840 480 481 484 500 -vsync -hsync
modeline "800x600@56" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
modeline "800x600@72" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
modeline "800x600@75" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
modeline "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
modeline "832x624@75" 57.284 832 864 928 1152 624 625 628 667 -vsync -hsync
modeline "1024x768@75" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
modeline "1024x768@70" 75.0 1024 1048 1184 1328 768 771 777 806 -vsync -hsync
modeline "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -vsync -hsync
modeline "1152x864@75" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync
modeline "1280x1024@75" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync
modeline "1280x960@60" 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
modeline "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
modeline "1280x960@75" 129.86 1280 1368 1504 1728 960 961 964 1002 -hsync +vsync
modeline "1400x1050@60" 122.61 1400 1488 1640 1880 1050 1051 1054 1087 -hsync +vsync
modeline "1400x1050@75" 155.85 1400 1496 1648 1896 1050 1051 1054 1096 -hsync +vsync
modeline "1600x1200@65" 175.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
modeline "1600x1200@60" 162.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
modeline "1792x1344@60" 204.8 1792 1920 2120 2448 1344 1345 1348 1394 -hsync +vsync
Gamma 1.0
EndSection
#
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
Defaultdepth 24
SubSection "Display"
Depth 24
Virtual 1792 1344
Modes "1280x1024@60" "1280x960@75" "1280x960@60" "1400x1050@60" "1280x1024@75" "1400x1050@75" "1152x864@75" "1600x1200@65" "1024x768@60" "1600x1200@60" "1024x768@70" "1792x1344@60" "1024x768@75" "832x624@75" "800x600@60" "800x600@75" "800x600@72" "800x600@56" "640x480@75" "640x480@72" "640x480@60"
EndSubSection
EndSection
Identifier "Configured Monitor"
Vendorname "Dell"
Modelname "Dell E196FP"
Horizsync 31.0-83.0
Vertrefresh 56.0-76.0
modeline "640x480@60" 25.2 640 656 752 800 480 490 492 525 -vsync -hsync
modeline "640x480@72" 31.5 640 664 704 832 480 489 491 520 -vsync -hsync
modeline "640x480@75" 31.5 640 656 720 840 480 481 484 500 -vsync -hsync
modeline "800x600@56" 36.0 800 824 896 1024 600 601 603 625 +hsync +vsync
modeline "800x600@72" 50.0 800 856 976 1040 600 637 643 666 +hsync +vsync
modeline "800x600@75" 49.5 800 816 896 1056 600 601 604 625 +hsync +vsync
modeline "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
modeline "832x624@75" 57.284 832 864 928 1152 624 625 628 667 -vsync -hsync
modeline "1024x768@75" 78.8 1024 1040 1136 1312 768 769 772 800 +hsync +vsync
modeline "1024x768@70" 75.0 1024 1048 1184 1328 768 771 777 806 -vsync -hsync
modeline "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -vsync -hsync
modeline "1152x864@75" 108.0 1152 1216 1344 1600 864 865 868 900 +hsync +vsync
modeline "1280x1024@75" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +hsync +vsync
modeline "1280x960@60" 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
modeline "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
modeline "1280x960@75" 129.86 1280 1368 1504 1728 960 961 964 1002 -hsync +vsync
modeline "1400x1050@60" 122.61 1400 1488 1640 1880 1050 1051 1054 1087 -hsync +vsync
modeline "1400x1050@75" 155.85 1400 1496 1648 1896 1050 1051 1054 1096 -hsync +vsync
modeline "1600x1200@65" 175.5 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
modeline "1600x1200@60" 162.0 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync
modeline "1792x1344@60" 204.8 1792 1920 2120 2448 1344 1345 1348 1394 -hsync +vsync
Gamma 1.0
EndSection
#
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
Defaultdepth 24
SubSection "Display"
Depth 24
Virtual 1792 1344
Modes "1280x1024@60" "1280x960@75" "1280x960@60" "1400x1050@60" "1280x1024@75" "1400x1050@75" "1152x864@75" "1600x1200@65" "1024x768@60" "1600x1200@60" "1024x768@70" "1792x1344@60" "1024x768@75" "832x624@75" "800x600@60" "800x600@75" "800x600@72" "800x600@56" "640x480@75" "640x480@72" "640x480@60"
EndSubSection
EndSection
2009年2月26日
[Ubunwu004]安裝 Subversion
如果要用 url ,記得要裝 libapache2-svn 套件
Ubuntu - 安裝 SVN (Subversion Server)
Subversion - Ubuntu documentation
Ubuntu - 安裝 SVN (Subversion Server)
Subversion - Ubuntu documentation
[Ubunwu002] 安裝 SSH
安裝 SSH server ,是為了可以遠端簽入管理。
作法很簡單,直接 apt-get install OpenSSH Server 即可。
參考:
Ubuntu Linux OpenSSH Server installation and configuration
作法很簡單,直接 apt-get install OpenSSH Server 即可。
參考:
Ubuntu Linux OpenSSH Server installation and configuration
[Ubunwu001]Ubunwu 誕生
我一直都沒有一台屬於自己的 server,因為一直沒有那個需求。也就懶得去架設,因為我想要的一些日常服務,Google 相關的服務都可以滿足我。
但是工作時發現需要有些 server 管理經驗,如果沒有實際去架設管理過,是學不到這方面的知識。臨時需要作些什麼處理時,很容易因為經驗的不足,而會不知道要怎麼下手。
而我又是學資訊的,不去瞭解,不去學習,不去體驗這些好像又說不過去。所以今天我就從我的桌機切一塊空間出來,灌了 Ubuntu 8.10 Desktop。準備架設一些 server 好好研究,像是 subversion, web server, mail server,等等都有計畫要架設。
沒有什麼目標,也沒有什麼確切的時間表要達架設好什麼 server,反正可以遠端控制,隨時可以上線修改,就讓它慢慢演化吧。
但是工作時發現需要有些 server 管理經驗,如果沒有實際去架設管理過,是學不到這方面的知識。臨時需要作些什麼處理時,很容易因為經驗的不足,而會不知道要怎麼下手。
而我又是學資訊的,不去瞭解,不去學習,不去體驗這些好像又說不過去。所以今天我就從我的桌機切一塊空間出來,灌了 Ubuntu 8.10 Desktop。準備架設一些 server 好好研究,像是 subversion, web server, mail server,等等都有計畫要架設。
沒有什麼目標,也沒有什麼確切的時間表要達架設好什麼 server,反正可以遠端控制,隨時可以上線修改,就讓它慢慢演化吧。
2009年1月9日
FlexTable 的 clear method
GWT 中的 Grid 和 FlexTable 都繼承自 HTMLTable,也就是相對於 HTML 中的 table 標籤。
其中 HTMLTable 有個 clear() method, 使用時要小心。看一下 GWT Javadoc 解釋:
意思是說,clear method 只清掉所加入的 widget 而已。所以如果你有為它加 CSS style,比如畫出 td 標籤的邊框。假設原本有 3 筆資料的 table ,clear 後,再加入 1 筆的資料。table 的呈現還是有 3 筆,但下面 2 筆資料都是空白的。
就像這樣

所以原本這樣的寫法
改用 removeRow 土法煉鋼。
其中 HTMLTable 有個 clear() method, 使用時要小心。看一下 GWT Javadoc 解釋:
Removes all widgets from this table, but does not remove other HTML or text contents of cells.
意思是說,clear method 只清掉所加入的 widget 而已。所以如果你有為它加 CSS style,比如畫出 td 標籤的邊框。假設原本有 3 筆資料的 table ,clear 後,再加入 1 筆的資料。table 的呈現還是有 3 筆,但下面 2 筆資料都是空白的。
就像這樣
所以原本這樣的寫法
table.clear()改用 removeRow 土法煉鋼。
while (table.getRowCount() > 0) {
table.removeRow(0);
}
2008年8月23日
GAE 中 Datastore 的小陷阱
在 Google app engine 平台 + GAEO 寫超好用公佈欄時,發現 Datastore 在使用時有小陷阱要小心。
資料間的連結關係有 one-to-one, one-to-many, 以及 many-to-many 三種,如何在 Datastore 實做可以參考[AppEngine] 實戰 Datastore (1)這篇文章。
當時實做 one-to-many 時,對 Datastore 不熟悉,所以寫出了像下面的程式碼
parent 是自定義 class, children 是自定義 class 所串成的 list,parent 和 children 的關係是 one-to-many。所以會很自然的認為 parent.children.order(`-date') 意思是這個 parent 底下的 children 依照最新到最舊的日期排序。然後直接將已排序好的 parent.children 指定給 self.children ,讓相關的網頁存取 children。
但這樣的想法是錯的,網頁呈現出來的依然是沒有排序過的資料。
文件中,The Query Class的 order() method 描述
重點是 Results ,要接了 return 的值後才是有排序過的資料。
只要改成下列程式碼後,結果就正確了。
或直接接 return 值,也是可以。
我被文件前面的例子給誤導了
以為 query.order(`-date') 後,query 裡的資料就已經排序好了。
所以,不管你如何串接,最後一定要接傳回值才是正確的結果。
資料間的連結關係有 one-to-one, one-to-many, 以及 many-to-many 三種,如何在 Datastore 實做可以參考[AppEngine] 實戰 Datastore (1)這篇文章。
當時實做 one-to-many 時,對 Datastore 不熟悉,所以寫出了像下面的程式碼
parent.children.order('-date')
self.children = parent.children
parent 是自定義 class, children 是自定義 class 所串成的 list,parent 和 children 的關係是 one-to-many。所以會很自然的認為 parent.children.order(`-date') 意思是這個 parent 底下的 children 依照最新到最舊的日期排序。然後直接將已排序好的 parent.children 指定給 self.children ,讓相關的網頁存取 children。
但這樣的想法是錯的,網頁呈現出來的依然是沒有排序過的資料。
文件中,The Query Class的 order() method 描述
Adds an ordering for the results. Results are ordered starting with the first order added.
重點是 Results ,要接了 return 的值後才是有排序過的資料。
只要改成下列程式碼後,結果就正確了。
childQuery = parent.children.order(`-date')
self.children = childQuery.fetch()
或直接接 return 值,也是可以。
self.children = parent.children.order(`-date')
我被文件前面的例子給誤導了
query.filter(`title =`, `Imagine')
query.order(`-date')
query.ancestor(key)
query.filter(`title =`, `Imagine').order(`date').ancestor(key)
以為 query.order(`-date') 後,query 裡的資料就已經排序好了。
所以,不管你如何串接,最後一定要接傳回值才是正確的結果。
訂閱:
文章 (Atom)