`
smallwolf
  • 浏览: 19857 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
文章列表
[abc] A single character: a, b or c [^abc] Any single character but a, b, or c [a-z] Any single character in the range a-z [a-zA-Z] Any single character in the range a-z or A-Z ^ Start of line $ End of line \A Start of string \z End of string . Any single character \s Any whitespac ...
1.use the css style <style type="text/css"> .content-width {MARGIN: auto;WIDTH: 600px;} .content-width img{MAX-WIDTH: 100%!important;HEIGHT: auto!important;width:expression(this.width > 600 ? "600px" : this.width)!important;} </style> </head> <body> ...
class Movie < ActiveRecord::Base validates_presence_of :name, :rating, :length_minutes validates_uniqueness_of :name validates_length_of :name, :maximum => 256 validates_numericality_of :length_minutes, :only_integer => true has_many :movie_showtimes VALID_RATINGS = ['Unrat ...
A criticism often leveraged against Ruby on Rails is that it’s slow. It’s true that the Ruby language is slower at some things than other languages used in web development con- texts. That just means that you as a developer need to be aware of where Ruby and Rails can eat up valuable processor cyc ...
You can generate a key in Linux using the ssh-keygen  command. You should run it in the command line. You will be asked for a file in which the key should be saved to and for a passphrase (password) for the key: user@localhost: ssh-keygen -t dsa Generating public/private dsa key pair. Enter file ...
1.用于删除vi/vim产生的垃圾文件 find -iname '*.swp' |awk '{print "rm " $0}'|bash 2.同步时间 ntpdate time.nuri.net 3.重定向:将命令的结果输出到文件,而不是标准输出(屏幕) > 写入文件并覆盖旧文件 >> 加到文件尾部,保留旧文件内容 4.反短斜线:使用反短斜线可以将一个命令的输出作为另外一个命令的一个命令行参数。 命令:find . -mtime -1 -type f -print 用来查找过去24小时(-mtime -2 则表示过去48小时)内修改过的文件。如果将所 ...

git问题

今天:提交版本的时候发现报如下错误,HTTP Path Not Found: '/svn/zbs/!svn/bc/151/trunk/1' path not found at /usr/bin/git-svn line 450 最后,通过看console发现,是某些已上传的文件改名,会产生这样的问题。 解决方法:首先可以把那些改名的文件剪切到别处,比如说桌面。然后,再用git stash命令。用git svn dcommit提交一次,然后再把那些剪切到别处的文件放回到原处在提交就可以了.注:需用git rm ..file_name  删掉需要那些被改名的文件. 再此遇到这个错误,这次采取分步提 ...
首先,用下列rake 命令生成html文档 liweihui@liweihui-desktop:~$ rake doc:app rm -r doc/app README_FOR_APP: people_helper.rb: m extensions_helper.rb: m sessions_helper.rb: m.. hurries_helper.rb: m Ge ...
[size=x-small]vi/vim 中可以使用 :s 命令来替换字符串。以前只会使用一种格式来全文替换,今天发现该命令有很多种写法(vi 真是强大啊,还有很多需要学习),记录几种在此,方便以后查询。 :s/vivian/sky/ 替换当前行第一个 vivian 为 sky :s/vivian/sky/g 替换当前行所有 vivian 为 sky :n,$s/vivian/sky/ 替换第 n 行开始到最后一行中每一行的第一个 vivian 为 sky :n,$s/vivian/sky/g 替换第 n 行开始到最后一行中每一行所有 vivian 为 sky n 为数字,若 n 为 ...
  今天,开始为自己的代码补充单元测试,用的是rails 里面的rspec,首先, 1.安装 gem install rspec 2.然后,生成script/generate rspec_model performances script/generate rspec_controller performances :注:如果以前已经用script/generate model ..生成过模型或者控制器的,就选参数n,及不覆盖原来的代码。 3.fixture first_performance: buskind: 102 score: 1.0 4.spec_modelr ...

关于git

今天不小心在用git 切换分之前,只将其git commit -a -m '' 然而,却没有git add .,造成,我切换到别的分值,所增加的代码还在. 后用git status查看,果真是很多东西文件显示的是untracked file,然后,再切换原来的分支,将其重新add.和commit次,这样再切换到其他分支,就不会产生这个问题了
http://dizzy.co.uk/ruby_on_rails/cheatsheets/form-helpers http://ruby.runpaint.org http://hi.baidu.com/it_zen_data/blog/item/0bc19639d8b47a2db9998f3d.html http://www.rubyinside.com/21-ruby-tricks-902.html http://www.learnivore.com/search http://getcaliper.com/ watirhttp://m.onkey.org/ 十条不错的编程观点http:/ ...
http://forum.ubuntu.org.cn/viewtopic.php?t=240806
liweihui@liweihui-desktop:/$ sudo fdisk -l [sudo] password for liweihui: Disk /dev/sda: 80.0 GB, 80000000000 bytes 255 heads, 63 sectors/track, 9726 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000080 Device Boot Start End Blocks Id ...
可以采用下面方式解决:liweihui@liweihui-desktop:~/Documents/zbs$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 12275 max locked memor ...
Global site tag (gtag.js) - Google Analytics