我目前正在使用Hadoop-2.0.3-alpha,之后我可以完美地使用HDFS(将文件复制到HDFS,从外部框架获得成功,使用webfrontend),在我的VM重新启动后,datanode进程正在停止过了一会儿.namenode进程和所有纱线进程都没有问题.我在另一个用户下的一个文件夹中安装了Hadoop,因为我还安装了Hadoop 0.2,它也运行良好.看一下所有datanode进程的日志文件,我得到了以下信息:
2013-04-11 16:23:50,475 WARN org.apache.hadoop.util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2013-04-11 16:24:17,451 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
2013-04-11 16:24:23,276 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2013-04-11 16:24:23,279 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: DataNode metrics system started
2013-04-11 16:24:23,480 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Configured hostname is user-VirtualBox
2013-04-11 16:24:28,896 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Opened streaming server at /0.0.0.0:50010
2013-04-11 16:24:29,239 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Balancing bandwith is 1048576 bytes/s
2013-04-11 16:24:38,348 INFO org.mortbay.log: Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog …Run Code Online (Sandbox Code Playgroud) 任何人都可以告诉我如何验证UITextFields内部UIAlertController?
除非输入两个字段,否则我需要它来阻止用户单击"保存".
到目前为止,这是我的代码:
@IBAction func btnStart(sender: AnyObject) {
var alert = UIAlertController(title: "New user",
message: "Add a new user",
preferredStyle: .Alert)
let saveAction = UIAlertAction(title: "Save",
style: .Default) { (action: UIAlertAction!) -> Void in
self.textFieldName = alert.textFields![0] as UITextField
self.textFieldEmail = alert.textFields![1] as UITextField
self.saveUser(self.textFieldName.text, email: self.textFieldEmail.text)
self.tableView.reloadData()
}
saveAction.enabled = false
let cancelAction = UIAlertAction(title: "Cancel",
style: .Default) { (action: UIAlertAction!) -> Void in
}
alert.addTextFieldWithConfigurationHandler {
(textFieldName: UITextField!) in
textFieldName.placeholder = "Enter full name" …Run Code Online (Sandbox Code Playgroud) 有没有人找到一个清晰,简洁的示例或指南,介绍如何使用Lion中引入的基于视图的NSOutlineView实现源列表?我看过Apple的示例项目,但没有任何方向或解释感,我发现很难掌握它们究竟是如何工作的概念.
我知道如何使用优秀的PXSourceList作为后备,但是如果可能的话,我真的想开始使用基于视图的源列表.
如何在Linux Debian上安装PHP cURL?我尝试了以下代码并得到以下错误
apt-get update
apt-get install curl libcurl3 php5-curl
Run Code Online (Sandbox Code Playgroud)
错误:
W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/universe/binary-i386/Packages Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)
W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/multiverse/binary-i386/Packages Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)
W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en_US Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)
W: Failed to fetch http://zm.archive.ubuntu.com/ubuntu/dists/precise-updates/main/i18n/Translation-en Something wicked happened resolving 'zm.archive.ubuntu.com:http' (-5 - No address associated with hostname)
W: …Run Code Online (Sandbox Code Playgroud) 我试图运行此代码但我继续收到此错误:
致命错误:在展开Optional值时意外发现nil
我不明白这意味着什么或为什么我得到它.任何提示?
import UIKit
class ViewController: UIViewController {
var lastNumber: String = ""
@IBOutlet var answerField: UILabel
@IBOutlet var operaterLabel: UILabel
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func buttonTapped(theButton: UIButton) {
if answerField.text == "0"
{
answerField.text = theButton.titleLabel.text
}
else
{
answerField.text = answerField.text + theButton.titleLabel.text
}
}
@IBAction …Run Code Online (Sandbox Code Playgroud) 当我更改inputAccessoryViewiOS 8中的高度时,inputAccessoryView不会转到右侧原点,而是覆盖键盘.

以下是一些代码段:
- (UIView *)inputAccessoryView {
if (!_commentInputView) {
_commentInputView = [[CommentInputView alloc] initWithFrame:CGRectMake(0, 0, [self width], 41)];
[_commentInputView setPlaceholder:NSLocalizedString(@"Comment", nil) andButtonTitle:NSLocalizedString(@"Send", nil)];
[_commentInputView setBackgroundColor:[UIColor whiteColor]];
_commentInputView.hidden = YES;
_commentInputView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin;
}
return _commentInputView;
}
Run Code Online (Sandbox Code Playgroud)
#when the textview change height
- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height {
if (height > _textView_height) {
[self setHeight:(CGRectGetHeight(self.frame) + height - _textView_height)];
[self reloadInputViews];
}
}
Run Code Online (Sandbox Code Playgroud)
- (void)setHeight: (CGFloat)heigth {
CGRect frame = self.frame;
frame.size.height …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Hangfire在后台运行定期作业,轮询来自其他网站的数据,问题是如果上一个作业仍在运行,我不希望重复作业运行.
我已阅读文档,但似乎无法找到答案.有没有办法让一个每10分钟运行一次的重复工作,但如果之前的任务还没有完成则会跳过?
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
// Hangfire
GlobalConfiguration.Configuration
.UseSqlServerStorage("DatabaseContext");
app.UseHangfireDashboard();
app.UseHangfireServer();
RecurringJob.AddOrUpdate("site-parser", () => SiteParserService.RunAll(), Cron.Minutely, TimeZoneInfo.Utc);
ConfigureAuth(app);
}
Run Code Online (Sandbox Code Playgroud) 我在构建项目时遇到错误.
错误:
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
C:\Users\MR Maleki\Desktop\WhoIsBetter2\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
Run Code Online (Sandbox Code Playgroud)
摇篮:
compileSdkVersion GLOBAL_COMPILE_SDK as int …Run Code Online (Sandbox Code Playgroud) 我想调用一个函数,我希望该函数将程序中字符串或数组的内容更改为常量.
伪代码:
some_array = "hello"
print some_array #prints "hello"
changeArray(some_array)
print some_array #prints "bingo"
Run Code Online (Sandbox Code Playgroud)
我知道我必须将指针传递给该函数.这是我写的,
void changeArray(char *arr){
arr = "bingo";
}
int main(int argc, const char* argv[]){
char *blah = "hello";
printf("Array is %s\n",blah);
changeArray(blah);
printf("Array is %s\n",blah);
return EXIT_SUCCESS;
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?