我尝试安装zsh
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
cd zsh
Util/preconfig
./configure --prefix=dir
make
Run Code Online (Sandbox Code Playgroud)
但是,我明白了
gcc -Wl,-x -bundle -flat_namespace -undefined suppress -o zleparameter.so zleparameter..o -liconv -ldl -ltermcap -lm -lc
: yodl -o zsh.texi -I. -w ztexi.yo version.yo zsh.yo; \
test -f zsh.texi
make[1]: *** [zsh.texi] Error 1
Run Code Online (Sandbox Code Playgroud) 在R中,ecdf
我可以绘制经验累积分布函数
plot(ecdf(mydata))
Run Code Online (Sandbox Code Playgroud)
并且hist
我可以绘制我的数据的直方图
hist(mydata)
Run Code Online (Sandbox Code Playgroud)
如何在同一个图中绘制直方图和ecdf?
我尝试做出类似的东西
在 R 中,使用 seq,我可以获得日期序列
seq(as.Date('2014-02-01'), as.Date('2014-8-31'), by='1 month')
[1] "2014-02-01" "2014-03-01" "2014-04-01" "2014-05-01" "2014-06-01" "2014-07-01" "2014-08-01"
Run Code Online (Sandbox Code Playgroud)
我怎么能得到一对值?序列上的值区间
"2014-02-01" "2014-03-01"
"2014-03-01" "2014-04-01"
...
Run Code Online (Sandbox Code Playgroud) 在Python中,如果我有一个datetime
和一个datetime
s 列表,例如:
import datetime as dt
date = dt.datetime(1970, 1,1)
dates = [dt.datetime(1970, 1, 2), dt.datetime(1970, 1,3)]
Run Code Online (Sandbox Code Playgroud)
我怎么能得到datetime
最接近的列表date
?
如果我有一个普通的javascript文件
// hello.js
function hello(string) {
return 'hello ' + string;
}
Run Code Online (Sandbox Code Playgroud)
如何对该文件中的功能使用单元测试?
目前,我有两个想法(都使用nodejs):
使用mochajs测试框架进行测试,为此我需要使用 eval
// test file
var assert = require('assert');
var fs = require('fs');
eval.apply(this, [fs.readFileSync('./hello.js').toString()]);
describe('hello function', function() {
it('test output', function () {
assert.equal('hello world', hello('world'));
});
});
Run Code Online (Sandbox Code Playgroud)
在运行测试之前hello.js
,请使用nodejs模块的结构自动创建一个副本,然后对该副本进行测试
// _hello.js to testing
exports.hello = function(string) {
return 'hello ' + string;
}
// test file
var assert = require('assert');
var hello = require('./_hello.js');
describe('hello function', function() …
Run Code Online (Sandbox Code Playgroud) 当我在作业日志中将 gitlab 与 docker 一起使用时,我可以获得以下信息:
Running with gitlab-ci-multi-runner 9.5.0 (413da38)
on platform-docker-orc (2c06225e)
Using Docker executor with image registry:5000/local_image: ...
Using docker image sha256:db4434f2a9c3529af30397031df5bc1277f13882e0f6613a8c8f9c059645c04d for predefined container...
Pulling docker image registry:5000/local_image ...
Using docker image registry:5000/local_image ID=sha256:8d1cac8ae6371b01505e9cd3aaf654696cc144117a9c89dcd21cf4c0d9cfa709 for build container...
Running on runner-2c06225e-project-99-concurrent-0 via a96c0c765ce7...
Run Code Online (Sandbox Code Playgroud)
如何获取执行 gitlab 作业的容器 ID?
我试图用docker-compose在docker上打开第二个终端。
首先使用
docker-compose run my-centos bash
Run Code Online (Sandbox Code Playgroud)
当我尝试打开第二个终端时
docker-compose exec my-centos bash
Run Code Online (Sandbox Code Playgroud)
我收到消息
ERROR:No container found for my_centos_1
Run Code Online (Sandbox Code Playgroud)
如果我搜索正在运行的容器的名称,则会得到
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34a95b44f0a2 centos6 "bash" 9 minutes ago Up 9 minutes docker_my-centos_run_1
Run Code Online (Sandbox Code Playgroud)
为什么docker-compose exec search docker_my_centos_1
而不是docker_my-centos_run_1
?
在一本大词典中,类似于
d = {}
d['a']=[1,2,3,4]
d['b']=[1,2,3,4,5,6]
d['c']=[1,2]
d['d']=[1,4]
Run Code Online (Sandbox Code Playgroud)
如何快速删除列表中的"四个"?
有没有办法链接列表中的四肢?如同,消除一个消除了其他.
如果我有一本字典
d = {'a':1, 'b':2 , 'c': 3}
Run Code Online (Sandbox Code Playgroud)
与d['a']
或d.get('a')
我得到1
.
如何从键列表中获取字典中的值?
就像是
d[['a','b']]
Run Code Online (Sandbox Code Playgroud)