在我的rails应用程序中,我想要使用活动目录进行身份验证.我已经看过Adauth,但我不知道该怎么做
我可以用我的学校广告测试AD:exchange.nhl.nl
有人可以帮助我进行身份验证,或者可能有一个很好的教程或有更好的宝石?AD中是否有密码?
在使用RubyMotion创建应用程序之后,这是我第一次使用xCode在Swift中开发应用程序.
我使用以下代码从Rails API获取所有帖子,请求成功但解析JSON会出错.
代码:
func loadData() {
let url = NSURL(string: "http://localhost:3000/api/posts")
let task = NSURLSession.sharedSession().dataTaskWithURL(url, completionHandler: {(data, response, error) in
var err: NSError?
var json = NSJSONSerialization.JSONObjectWithData(data, options: .MutableLeaves, error: &err) as NSDictionary
})
task.resume()
}
Run Code Online (Sandbox Code Playgroud)
错误:
libswift_stdlib_core.dylib`swift_dynamicCastObjCClassUnconditional:
0x103dbae20: pushq %rbp
0x103dbae21: movq %rsp, %rbp
0x103dbae24: pushq %rbx
0x103dbae25: pushq %rax
0x103dbae26: movq %rsi, %rcx
0x103dbae29: movq %rdi, %rbx
0x103dbae2c: xorl %eax, %eax
0x103dbae2e: testq %rbx, %rbx
0x103dbae31: je 0x103dbae4d ; swift_dynamicCastObjCClassUnconditional + 45
0x103dbae33: movq 0x72b66(%rip), %rsi ; …Run Code Online (Sandbox Code Playgroud) 我已经在 vps 服务器上安装了 gitlab,这也是我提交本地更改的远程服务器。
当我提交并推送到服务器(git@domain.com:root/project.git)时,代码将被更新。
在我的 vps 上,我有这个工作流程:
- var/www/
- project (created through git clone git@domain.com:root/project.git)
- Files within the project
Run Code Online (Sandbox Code Playgroud)
当我推送到服务器时,我想让服务器自动从 gitlab 中提取更改。我也尝试使用更新后挂钩,但这不起作用。
我必须创建一个裸仓库吗?还是我忘记了什么?
我想计算2次之间的差异.start_time:22:00(Rails将其解释为2015-12-31 22:00:00 +0100)second_time:02:00(Rails将此解释为2015-12-31 02:00:00 +0100).第二次是4小时后,所以在第二天.有没有办法计算这个差异?
我不能简单地这样做:second_time - first_time,因为这给了我22小时而不是4小时的差异.
编辑: 一些背景信息: 作业从22:00开始,到第二天02:00结束.因为我只填写这份工作的形式,所以上述2个值的时间是2015-12-31 22:00:00 +0100和2015-12-31 02:00:00 +0100.我不希望用户填写包括日期在内的时间.时间之间的真正差异应该是4个小时.
所以我真正想要的是计算22:00和02:00(第二天)之间的差异.