MATCH (a:Author {id:'author_1'}),
(art:Article {id:'PMID:21473878'})
WITH a, art
MATCH r=((a)-[*2..4]-(art))
RETURN r
在一个大约有130万个节点和800万个关系的数据库中,这个查询将永远运行。有什么我能做的吗?
在:作者和:文章id上有索引
===============
在6.00x edX中有一个练习,他们提供的答案如下:
def genPrimes():
primes = [] # primes generated so far
last = 1 # last number tried
while True:
last += 1
for p in primes:
if last % p == 0:
break
else:
primes.append(last)
yiel
我试着做:
db.table(table)
.max({index: 'number'})('number')
.default(0)
并接收错误:
(node:45) UnhandledPromiseRejectionWarning: ReqlQueryLogicError: `max` found no entries in the specified index in:
r.db("db").table("table").max({"index": "number"})(
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrad
我试图用bsxfun向矢量化一些matlab操作。看一下bsxfun文档,看起来我一次只能做两个操作。但我想做的手术有几个手术。
# delta_g is 100 X 1
# z is 100 X 1
# W is 100 X 10
# delta 10 X 1
for j = 1:100
delta_g(j) = (1 - z(j)) * (W(j,:) * delta);
end
下面是我试图使用的代码。
temp = bsxfun(@times, W, delta.');
temp1 = 1 - z;
我的基本原理是将其分解为两个操作,然后将多个temp和temp1组合
我试图在终端中安装chrome,这是我试图安装它时出现的错误:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
我能做些什么来解决这个问题?