正如标题所说:我正在将一个Jupyter笔记本检查成一个github仓库,我是否应该在github中存储ipynb检查点,或者它们是最好的gitignored并保存在本地?
我不确定它们的用途,所以我不知道是否包括它们.
我是Go的新手,我正在尝试使用最少的文档设置Go项目:https://github.com/alphagov/metadata-api
我克隆了它,但是当我尝试时,go build我收到以下警告:
main.go:8:2: cannot find package "github.com/Sirupsen/logrus" in any of:
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/github.com/Sirupsen/logrus (from $GOROOT)
/Users/me/go/src/github.com/Sirupsen/logrus (from $GOPATH)
main.go:14:2: cannot find package "github.com/alphagov/metadata-api/content_api" in any of:
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/github.com/alphagov/metadata-api/content_api (from $GOROOT)
/Users/me/go/src/github.com/alphagov/metadata-api/content_api (from $GOPATH)
Run Code Online (Sandbox Code Playgroud)
我猜这是因为我没有安装Go等效的要求?
我GOPATH的设定:
metadata-api$ echo $GOPATH
/Users/me/go
Run Code Online (Sandbox Code Playgroud)
Go可执行文件在
metadata-ape$ echo $PATH
....:/Users/me/go/bin
Run Code Online (Sandbox Code Playgroud)
我需要做些什么来帮助Go找到这些包?
我正在使用Highcharts,我想格式化图表中任何位置显示的所有数字(工具提示,轴标签......),以逗号分隔数千.
否则,默认的工具提示和标签很棒,我想保持它们完全相同.
例如,在此图表中,数字应该是,2,581,326.31但在其他方面完全相同.

我怎样才能做到这一点?
我尝试添加:
tooltip: {
pointFormat: "{point.y:,.0f}"
}
Run Code Online (Sandbox Code Playgroud)
但这摆脱了工具提示中的漂亮圆圈和系列标签 - 我想保留它.理想情况下,我更喜欢使用单个选项在整个图表中设置全局数字格式.
我在git中有以下消息:
# Your branch and 'origin/master' have diverged,
# and have 3 and 8 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
Run Code Online (Sandbox Code Playgroud)
我想丢弃3个本地提交,并在origin/master处提取8个远程提交.
(合并将变得非常困难,一旦掌握最新,我宁愿再次进行3次本地提交.)
我怎样才能做到这一点?
我正在尝试开始使用Karma测试,将它们添加到现有的Angular应用程序中.
这是我的主要应用定义文件:
angular
.module('myApp', [
'ngRoute',
'moduleAdherence'
]);
Run Code Online (Sandbox Code Playgroud)
这是我的控制器文件:
angular
.module('moduleAdherence', [])
.controller('AdherenceCtrl', ['$scope', function ($scope) {
$scope.awesomeThings = [1,2,3,4];
}]);
Run Code Online (Sandbox Code Playgroud)
这是我对文件的第一次尝试:
describe('Controller: AdherenceCtrl', function () {
beforeEach(module('myApp'));
var MainCtrl,
scope;
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
MainCtrl = $controller('AdherenceCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings.length).toBe(4);
});
});
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时grunt test,它失败并出现以下错误:
Uncaught Error: [$injector:nomod] Module 'd3' is not available!
You either misspelled the module name or …Run Code Online (Sandbox Code Playgroud) 我正在Protractor中为Angular应用程序编写测试.我想填写一份登录表格并提交.
我怎样才能做到这一点?我已经做到这一点,但我不知道如何设置电子邮件和密码字段的值.
describe('The dashboard', function() {
ptor = protractor.getInstance();
beforeEach(function() {
ptor.get('#/dashboard');
var email = ptor.findElement(protractor.By.model('email'));
var password = ptor.findElement(protractor.By.model('password'));
var submit = ptor.findElement(protractor.By.tagName('button'));
// Fill out the form?
submit.click();
});
it('has a heading', function() {
heading = ptor.findElement(protractor.By.tagName('h1'));
expect(heading.getText()).toEqual('My Dashboard');
});
});
Run Code Online (Sandbox Code Playgroud) 我正在使用D3绘制散点图.当用户将鼠标悬停在每个圆圈上时,我想显示工具提示.
我的问题是,我可以追加提示,但他们使用的鼠标事件定位成d3.event.pageX和d3.event.pageY,所以他们不会在每个圆圈一贯定位.
相反,有些位于圆圈的左侧,有些位于右侧 - 这取决于用户的鼠标进入圆圈的方式.
这是我的代码:
circles
.on("mouseover", function(d) {
tooltip.html(d)
.style("left", (d3.event.pageX) + "px")
.style("top", (d3.event.pageY - 28) + "px");
})
.on("mouseout", function(d) {
tooltip.transition().duration(500).style("opacity", 0);
});
Run Code Online (Sandbox Code Playgroud)
并且是一个JSFiddle显示问题:http://jsfiddle.net/WLYUY/5/
有什么方法可以使用圆心的中心作为定位工具提示的位置,而不是鼠标位置?
我正在尝试安装IPython.我pip install ipython[notebook]没有任何错误,但现在我得到了这个:
$ ipython notebook
Traceback (most recent call last):
File "/Users/me/.virtualenvs/.venv/bin/ipython", line 7, in <module>
from IPython import start_ipython
File "/Users/me/.virtualenvs/.venv/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
from .terminal.embed import embed
File "/Users/me/.virtualenvs/.venv/lib/python2.7/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.core.interactiveshell import DummyMod
File "/Users/me/.virtualenvs/.venv/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 31, in <module>
from pickleshare import PickleShareDB
File "/Users/me/.virtualenvs/.venv/lib/python2.7/site-packages/pickleshare.py", line 41, in <module>
from path import path as Path
ImportError: cannot import name path
Run Code Online (Sandbox Code Playgroud)
如果我尝试import pickleshare在Python控制台上运行,我会遇到同样的错误from path import path.
我该怎么做才能解决这个问题?
我确定这是一个重复的问题,因为某个地方有答案,但是谷歌搜索10分钟后我找不到答案,所以我要求编辑不要关闭它它可能对其他人有用的基础.
我正在使用Postgres 9.5.这是我的表:
Column ? Type ? Modifiers
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
id ? integer ? not null default nextval('mytable_id_seq'::regclass)
pmid ? character varying(200) ?
pub_types ? character varying(2000)[] ? not null
Run Code Online (Sandbox Code Playgroud)
我想在"Journal"中找到所有行pub_types.
我找到了文档和Google搜索,这就是我尝试过的:
select * from mytable where ("Journal") IN pub_types;
select * from mytable where "Journal" IN pub_types;
select * from mytable where pub_types=ANY("Journal");
select * from mytable where pub_types IN ("Journal");
select * from mytable where where pub_types contains "Journal";
Run Code Online (Sandbox Code Playgroud)
我已经扫描了postgres数组文档,但是看不到一个如何运行查询的简单示例,而StackOverflow问题似乎都是基于更复杂的示例.
我想在D3中创建一个时间序列折线图,下面的图表的较小版本允许用户放大图表的某些部分,如Google财经图表.
我发现的最接近的例子是这个泳道图:
有没有人在D3中使用折线图做任何这样的例子?
注意:我绝对想要一个小版本的图形,顶部有一个可调整大小的刷子,而不是像这个例子那样纯粹可拖动/可缩放的x轴.
理想情况下,我想使用人力车,但人力车的例子似乎只有一个范围滑块.所以人力车的例子会更好.
javascript ×5
angularjs ×2
d3.js ×2
git ×2
charts ×1
go ×1
graph ×1
highcharts ×1
ipython ×1
karma-runner ×1
postgresql ×1
protractor ×1
python ×1
tooltip ×1
zoom ×1