Ubuntu 7.0.4 底下設定 scim

九月 6, 2007 by
  1. apt-get install scim scim-pinyin scim-chewing scim-tables-zh scim-qtimm im-switch
  2. im-switch -s scim
  3. log off

賤盤對應碼

八月 26, 2007 by

功能鍵  KeyCode值
F1      112
F2      113
F3      114
F4      115
F5      116
F6      117
F7      118
F8      119
F9      120
F10     121
BackSpace  8
TAB     9
ENTER    13
ESC     27
PageUp   33
PageDown  34
Space 32
Scroll Lock 145
break 19
Home    36
End     35
Insert   45
DEL     46
←     37
↑     38
→     39
↓     40

RoR Override原有Class的方式

八月 21, 2007 by
  • 在config/environment.rb中加入 

require “#{RAILS_ROOT}/app/overrides/all”

  • 在app下面新增一個overrides目錄
  • 在overrides目錄下新增一個all.rb,並輸入以下內容

Dir[File.dirname(__FILE__) + "/**/*.rb"].each { |file| require(file) }

  • 然後就可在overrides目錄下加入檔案override原有的class
  • 每次修改後請重新啟動server
  • 附上幾個override範例,請點下面下載

http://cid-4bb9c0cea8913133.skydrive.live.com/self.aspx/Marco/ruby

Rails on Apache2.0 + FastCgi

八月 20, 2007 by

fcgi.cgi 放到\ruby\lib\ruby\1.8\
fcgi.so 放到\ruby\lib\ruby\1.8\i386-mswin32
mod_fastcgi.so 放到\Apache\modules\

httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so 取消#註解
LoadModule fastcgi_module modules/mod_fastcgi.so 加上這行

最後面加上:
Alias /myapp “d:/my_app/public” #改成資料夾路徑
<Directory d:/my_app/public/> #改成資料夾路徑
SetEnv RAILS_ENV production #production改成要用的模式
Options +FollowSymLinks +ExecCGI
AllowOverride all
Allow from all
Order allow,deny
</Directory>

專案/public/.htaccess
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] #for apach

關於DB權限的問題

八月 15, 2007 by

之前在設定MySQL user密碼的時候,雖然設好了卻發生密碼錯的問題….(明明就有打對…)

這時候只要…

killall mysqld

mysqld -u root –skip-grant-tables &

mysql

>use mysql
>UPDATE user SET password=password(‘new password’) where user=’root’;
>FLUSH PRIVILEGES;

安裝Scruffy前,得先裝RMagick

八月 12, 2007 by

安裝RMaick步驟(windows)

  1. 先抓http://rubyforge.org/frs/download.php/15132/RMagick-1.14.1_IM-6.3.0-7-Q8.zip
  2. 抓下來之後,閱讀readme.html,先安裝ImageMagick的bin安裝檔
  3. 如果不重新啟動的話,預設路徑會指不到rmagick-1.14.1-win32.gem所在位置,所以可以先把這個gem隨便放到一個path下(e.g. c:\)
  4. cmd下執行 gem install c:\rmagick-1.14.1-win32.gem,即完成

接下來可安裝Scruffy:gem install scruffy

於是,可以先在console試試以下的CODE會不會動:

require ‘scruffy’
graph = Scruffy::Graph.new
graph.title = “Comparative Agent Performance”
graph.value_formatter = Scruffy::Formatters::Percentage.new(:precision => 0)
graph.add :stacked do |stacked|
stacked.add :bar, ‘Jack’, [30, 60, 49, 29, 100, 120]
stacked.add :bar, ‘Jill’, [120, 240, 0, 100, 140, 20]
stacked.add :bar, ‘Hill’, [10, 10, 90, 20, 40, 10]
end
graph.point_markers = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
graph.render(:width => 700, :as => ‘PNG’, :to => “#{RAILS_ROOT}/public/images/test.png”)

如果逼逼叫又寫了一大堆東西進去,而且在你的rails專案目錄底下的public/images/可以看到上圖,應該就是OK了!

p.s. 摘自http://ibrasten.com/articles/2006/08/14/scruffy-0-2-0

ROR得用InnoDB這個storage engine

七月 31, 2007 by

為啥~?… 因為InnoDB才能作到關連式資料表

新版的appserv灌好之後預設應該是MyISAM,可以去MySQL的安裝目錄底下編輯my.ini

改兩行:

  1. 把「 #default-storage-engine=INNODB」 的#號拿掉
  2. 把「skip-innodb」加上#號註解掉

如此重新啟動MySQL即可~

RoR mongrel server

七月 17, 2007 by

覺得webrick很慢嗎? 只要短短的一行

gem install mongrel –include-dependencies

然後用下面的方式啟動server

./script/server mongrel

mongrel server就可以跑啦~

不管是啟動速度,還有網頁的讀取效率,都比webrick快許多

連local端開網頁都快許多~

不用測速光憑感覺就能感受得到

而且console的訊息也較多,包含sql部分的訊息也有

快換掉吧~~

del.icio.us –a collection of online bookmarks

七月 13, 2007 by

Main page

My bookmarks

本日會議重點(2007.7.6)

七月 6, 2007 by

1. AJX & 配爐 因為在這兩個月內不支援eClinic專案,因此照正常上班時間 9:00~18:00。其他採用範圍制彈性上班時間,並針對每項工作設有deadline。
2. 每週固定星期一中午 13:00~14:00作上周檢討會議。
3. 工作指派後,須協調後設定deadline。
4. …..orz

大家加油啊~~大家撐著點啊~~(怎麼感覺好像在對自己說的)


Follow

Get every new post delivered to your Inbox.