当ree是你的默认vm(在Snow Leopard上)时,你如何在rvm下更新rubygems?我在做:
$ rvm ree gem update --system
Run Code Online (Sandbox Code Playgroud)
这导致看起来一切都很好:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed
[...]
RubyGems installed the following executables:
/Users/douglassellers/.rvm/rubies/ree-1.8.7-2010.02/bin/gem
Run Code Online (Sandbox Code Playgroud)
但是当我运行gem --version时它仍然说1.3.5.做一个宝石指向ree版本的宝石.
任何人都知道如何使用RVM更新rubygems?
我一直在开发一个动态生成的表单,它将类似于下面示例的多个项目传递给PHP脚本.
<div class="menu-item">
<input type="text" value="3" readonly="readonly" class="quantity" name="quantity">
<input type="text" value="Menu Item 3" readonly="readonly" class="item" name="item">
<input type="text" value="80.00" readonly="readonly" class="price" name="price">
</div>
...etc
Run Code Online (Sandbox Code Playgroud)
我的问题是因为我没有给出name属性quantity,item并且price我将这些参数传递给服务器端的唯一标识符:
quantity=3&item=Menu+Item+3&price=80.00&quantity=2&item=Menu+Item+2&price=50.00&quantity=1&item=Menu+Item+1&price=30.00&total=370.00&name=Alex&table=10&terms=on
Run Code Online (Sandbox Code Playgroud)
我可以很容易地改变它,所以names将是quantity1,item1,price1,quantity2,item2,price2等,但无论哪种方式,我都不确定如何最好地使用PHP循环这些参数集,这样我就可以确保我处理每个quantity,item并price对应于一个项目.
谢谢,亚历克斯
这是我的代码:
conn = sqlite3.connect(nnpcconfig.commondb)
cur = conn.cursor()
query = ['2124124', 'test2', 'test3', 'test4', 'test5']
cur.execute("insert into users(id, encpass, sname, name, fname) values (?, ?, ?, ?, ?)", query)
conn.commit
cur.execute("select * from users")
for row in cur:
print row
Run Code Online (Sandbox Code Playgroud)
此代码有效,返回行进给它.但它出来了,一旦脚本终止,表再次清晰!哪里出错了?当然,表用户存在.
我想开始使用DSM,但不知道如何开始使用.
良好的依赖矩阵是什么样的?为什么?它是如何工作的?
我有一个与此非常相似的问题:
我只是想尝试使用CATransaction为视图层设置动画.我的问题是变换立即应用于视图.
我尝试使用performSelector执行动画:withObject:afterDelay:没有成功.
这是我的代码:
- (void)viewDidLoad {
[super viewDidLoad];
view = [[[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)] autorelease];
view.backgroundColor = [UIColor blackColor];
[self.view addSubview:view];
[self performSelector:@selector(animateView) withObject:nil afterDelay:0.1];
}
-(void) animateView {
[CATransaction begin];
[CATransaction setValue:[NSNumber numberWithFloat:3.0f] forKey:kCATransactionAnimationDuration];
CALayer *layer = view.layer;
layer.position = CGPointMake(20,
300);
CATransform3D transform = CATransform3DMakeScale(2.0f, 2.0f, 1.0f);
transform = CATransform3DRotate(transform, acos(-1.0f)*1.5f, 1.5f, 1.5f, 1.5f);
layer.transform = transform;
[CATransaction commit];
}
Run Code Online (Sandbox Code Playgroud)
有谁知道出了什么问题?
谢谢,文森特.
还有如何解决"预期"; 在'{'令牌?之前的代码(来自xcode 3.2.3)
- (void)viewDidUnload {
self.cheatName = nil;
self.description = nil;
}
Run Code Online (Sandbox Code Playgroud)
这两个错误都在第一行
- (void)viewDidLoad {
[super viewDidLoad];
[self.titleLabel setText:self.title];
[self.descriptionLabel setText:self.description];
float textHeight = [MLUtils calculateHeightOfTextFromWidth:self.description : descriptionLabel.font :descriptionLabel.frame.size.width :UILineBreakModeWordWrap];
CGRect frame = descriptionLabel.frame;
frame.size.height = textHeight;
descriptionLabel.frame = frame;
CGSize contentSize = descriptionScrollView.contentSize;
contentSize.height = textHeight;
descriptionScrollView.contentSize = contentSize;
- (void)viewDidUnload {
self.cheatName = nil;
self.description = nil;
}
Run Code Online (Sandbox Code Playgroud) 优选长.
我能找到的所有例子都是将日期/时间作为字符串而不是任何标量值.:)
我正在寻找有关易于使用的网页编辑器的建议?它需要编辑php,javascript,html,CSS.我正在寻找能够加速我的发展的东西,目前我正在使用nano.
我在jquery中有一个工作的a.click()函数...但是如果我点击一个锚点,我会打开一个新窗口...但是如何阻止浏览器自己打开一个新窗口?
例:
$('a').each(function() {
$(this).click(function(e) {
if($(this).attr('target') == '_popup') {
//here is code to open window (already exists)
//try to stop propagation, but doesn't work...
e.stopPropagation();
}
hideNSL();
});
});
Run Code Online (Sandbox Code Playgroud)
所以,我该如何停止活动?
首先,这一切都是在Mac OS X上完成的,版本10.6.4
我复制了一个文件树,其中包含一些已经从subversion中检出的java代码.我想删除该树中的所有.svn文件.所以我使用了以下命令:
find . -name .svn -exec rm -fr .svn {} \;
Run Code Online (Sandbox Code Playgroud)
我收到这样的消息:
rm: ./repository/entity/.svn: Directory not empty
Run Code Online (Sandbox Code Playgroud)
我查看了目录,它看起来像这样:
$ ls -ld .
-r--r--r-- 1 tgia staff 1250 Aug 13 10:48 entries
Run Code Online (Sandbox Code Playgroud)
该文件的父目录如下所示:
$ ls -ld .
drwxr-xr-x 4 tgia staff 136 Aug 20 16:55 .
Run Code Online (Sandbox Code Playgroud)
好的,更改文件的权限:
$ chmod u+w entries
chmod: Unable to change file mode on entries: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
我不懂,这些文件怎么了?我没有尝试使用chmod似乎改变了文件权限.文件所有权是正确的.我很痛苦.WTF?即使root也无法改变它们.
$ sudo chmod u+w entries
Password:
chmod: Unable to change file mode on entries: Operation …Run Code Online (Sandbox Code Playgroud)