在文件db/migrate
夹中添加迁移文件并运行后rake db:migrate
,我想回到上一步,我认为使用VERSION=n
是正确的方法,但我不知道使用n的正确值.有没有命令检查当前的n值?
如果有人能提供有关如何使用的完整说明,那就太好了rake db:migrate
.
我用tar czvf file
command.then 创建了.tgz文件,最后得到了一个tgz文件.我想知道它和tar.gz之间的区别.
我只是从GNU屏幕移动到tmux,在屏幕上我点击C-a
,然后a
再次键入可以带我到行的开头,我想知道我是否坚持使用C-a
tmux我该如何解决这个问题?
在我输入URL之前看过这个http://test.com/test/
,而不是给我一个html页面,它给了我一个"文件浏览器"之类的界面来浏览给定位置的所有文件.
我认为它可能是一个可以在位置上下文中启用的nginx模块.
该nginx.conf
文件中:
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 122.97.248.252;
location /test {
root /home/yozloy/html/;
autoindex on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Run Code Online (Sandbox Code Playgroud)
更新 error.log
2012/05/19 20:48:33 [错误] 20357#0:*72 open()"/ home/yozloy/html/test"失败(2:没有这样的文件或目录),客户端:125.43.236.33,服务器:122.97.248.252,请求:"GET/test HTTP/1.1",主持人:"unicom2.markson.hk
我必须误解位置的/test
意思,我认为这意味着当我输入http://example.com/test时,它会访问根词典,这是/home/yozloy/html/
我喜欢标记和Mou编辑器,它具有动态预览渲染结果的强大功能.所以我想知道,有没有办法在Vim做同样的事情?
从这段代码我不知道两种方法之间的区别,collect
和each
.
a = ["L","Z","J"].collect{|x| puts x.succ} #=> M AA K
print a.class #=> Array
b = ["L","Z","J"].each{|x| puts x.succ} #=> M AA K
print b.class #=> Array
Run Code Online (Sandbox Code Playgroud) 在php web手册的侧栏中,addChild方法使用范围解析运算符链接文本::
,但在示例中它使用了Arrow运算符.谁能告诉我为什么会这样?
以传统的方式添加事件监听器:
function getComboA(sel) {
var value = sel.options[sel.selectedIndex].value;
}
<select id="comboA" onchange="getComboA(this)">
<option value="">Select combo</option>
<option value="Value1">Text1</option>
<option value="Value2">Text2</option>
<option value="Value3">Text3</option>
</select>
Run Code Online (Sandbox Code Playgroud)
但我想适应addEventListener方式:
productLineSelect.addEventListener('change',getSelection(this),false);
function getSelection(sel){
var value = sel.options[sel.selectedIndex].value;
alert(value);
}
Run Code Online (Sandbox Code Playgroud)
它不起作用,因为我不能将getSelection()中的任何参数作为addEventListener方法中的第二个参数传递?据我所知,我只能使用没有括号的函数名称.
任何的想法?
顺便说一下,请看看我之前关于console.log在safari 6.0开发人员检查器中不起作用的问题,我无法在控制台中编写任何输出,这令人沮丧.
这两条线之间有什么区别?
first_page = Page.new(:name => "First page")
first_page = Page.create(:name => "First page")
Run Code Online (Sandbox Code Playgroud)
顺便说一句,这是很棒的教程; 我推荐给像我这样的其他新手.
在Python中,编写它是很繁琐的:
print "foo is" + bar + '.'
Run Code Online (Sandbox Code Playgroud)
我可以在Python中做这样的事吗?
print "foo is #{bar}."
ruby python language-comparisons string-formatting string-interpolation