2008年6月19日星期四
Google Reader keyboard shortcuts
http://www.google.com/support/reader/bin/answer.py?answer=69973&topic=12012
有一些快捷键在 Google Groups 也能用。真是太方便了。
有一些快捷键在 Google Groups 也能用。真是太方便了。
2008年6月18日星期三
2008年6月17日星期二
2008年6月16日星期一
2008年6月15日星期日
2008年6月13日星期五
2008年6月10日星期二
2008年6月7日星期六
2008年6月5日星期四
在子类中调用父类的非同名方法
class Ahttp://rc.org.cn/forums/viewthread.php?tid=879
def a
puts "base a"
end
end
class B < A
def b
puts "sub b"
# 调用A的方法a
A.instance_method('a').bind(self).call
end
end
感谢汉东(blackanger)
2008年5月5日星期一
2008年4月14日星期一
Ubuntu字体设置及环境变量
http://wenq.org/index.cgi?Debian_WQY
为autotest设置环境变量的时候,居然把:$PATH给忘了,以前写过blog的啊,该打。
export PATH=/var/lib/gems/1.8/bin:$PATH (:$PATH, add the orgi PATH)
查看环境变量:
cd /usr/share/X11/fonts/misc
sudo gunzip wenquanyi_*pcf.gz
为autotest设置环境变量的时候,居然把:$PATH给忘了,以前写过blog的啊,该打。
export PATH=/var/lib/gems/1.8/bin:$PATH (:$PATH, add the orgi PATH)
source .bashrc
查看环境变量:
env
echo $PATH
在Ubuntu上搭建ROR开发环境
又要在新的Ubuntu上搭建ROR开发环境了。以前都是照着别人写的wiki来做,结果一段时间不做,又忘了。这次简要记一些步骤,纯粹备忘。
- 设置网络(公司网络环境需要,特殊)
Network settings -> Connections -> Properties -> (set static IP address)
Gateway address: 192.168.0.1sudo gedit /etc/resolv.conf
add line 'nameserver 192.168.0.3'
- checkout code and sql schema from svn
sudo apt-get install subversion
svn co code and schema(伪命令) - 初始化数据库
sudo apt-get install mysql-server mysql-admin
sudo apt-get install libmysql-ruby下面四条是公司导数据库用的:
source schema/createscheme.sql
source schema/fwmrm_feedback_test.sql
source schema/fwmrm_rpt_test.sql
source schema/db_test/createscheme_test.sql - 安装ruby相关
sudo apt-get install ruby
install RMagick
sudo apt-get install irb
sudo apt-get install rubygems
sudo apt-get install libmagick9-dev - 安装jre和aptana
sudo apt-get install sun-java6-jre
(change JVM to SUN JVM)
sudo apt-get install sun-java6-jdk
sudo update-alternatives --config javadownload aptana and unzip it
Add RadRails to Aptana Studio by following the Start Page instructions (Help > Aptana Studio Start Page...)
install subclipse (Help -> Software Updates -> Find and Install... -> Search for new features to install ) - 安装autotest,see here
sudo gem install ZenTest
gedit .bashrcadd line 'export PATH=/var/lib/gems/1.8/bin:$PATH'
source .bashrc
- 以下是公司开发需要的
cd to ..\vendor\gemsudo gem install json
cd ..\config\
cp database.yml.dist.linux database.yml (change the content as needed)
change '/var/lib/mysql/mysql.sock' to '/var/run/mysqld/mysqld.sock'
change 'freewheel_test' to 'fwmrm_oltp_test'
change 'reporting_test: -> database:' to 'fwmrm_rpt'
change 'feedback_test: -> database:' to 'fwmrm_feedback'
cp maui_config.rb.dist maui_config.rbsudo gedit /etc/mysql/my.cnf
add the two lines 'max_allowed_packet = 16M
max_sp_recursion_depth=255'
under "[mysqld] -> language = /usr/share/mysql/english"
add this line 'max_allowed_packet = 16M'
under "[client]"
2008年4月8日星期二
Aptana字体
Aptana的字体选择不正确的话,空格的宽度会窄于字符的宽度,也就是说两个空格的宽度看起来和一个字符的宽度差不多,这给代码缩进带来了很大的麻烦。
解决办法:
Window -> Preferences -> General -> Appearance -> Colors and Fonts -> Basic -> Text Font -> Change
选择 BitStream Vera Sans Mono (其他几个BitStream的字体应该也可以)
注:本Blog中,凡是Aptana没有特别指明的,一般都指RadRails
解决办法:
Window -> Preferences -> General -> Appearance -> Colors and Fonts -> Basic -> Text Font -> Change
选择 BitStream Vera Sans Mono (其他几个BitStream的字体应该也可以)
注:本Blog中,凡是Aptana没有特别指明的,一般都指RadRails
InstantRails使用相关
Skype using port 80 :
在打开InstantRails时,提示80端口被skype占用了。这个问题以前的同事遇到过,所以不感到奇怪。
解决方法,在skype里,工具->选项->高级->连接,uncheck the one called “将80端口与443端口作为接入连接的备用端口”。
MySql env path :
使用InstantRails时,如果要在命令行下访问MySql的话,需要将其bin目录(如:E:\InstantRails\mysql\bin)加入系统环境变量中。
相应的,还应该把ruby的bin目录(如:E:\InstantRails\ruby\bin)也加入到环境变量中。
InstantRails folder name :
包含InstantRails的文件夹名称不能有空格。
在打开InstantRails时,提示80端口被skype占用了。这个问题以前的同事遇到过,所以不感到奇怪。
解决方法,在skype里,工具->选项->高级->连接,uncheck the one called “将80端口与443端口作为接入连接的备用端口”。
MySql env path :
使用InstantRails时,如果要在命令行下访问MySql的话,需要将其bin目录(如:E:\InstantRails\mysql\bin)加入系统环境变量中。
相应的,还应该把ruby的bin目录(如:E:\InstantRails\ruby\bin)也加入到环境变量中。
InstantRails folder name :
包含InstantRails的文件夹名称不能有空格。
订阅:
博文 (Atom)
