与此问题类似,我有兴趣创建时间序列螺旋.该解决方案不一定必须在R中实现或使用ggplot,但似乎大多数解决方案已经在R中使用ggplot实现,其中一些在Python中实现,一个在d3中实现.到目前为止我的尝试都使用了R.与这个问题不同,我对显示特定数据范围感兴趣,而无需对数据进行量化/分级.也就是说,我想显示一个螺旋时间轴,显示特定事件何时开始和停止,其中每个事件的θ-min和theta-max代表特定的时间点.
考虑这个旅行数据:
trip_start trip_stop dist
2017-04-01 17:42:00 2017-04-01 18:34:00 1.95
2017-04-01 18:42:00 2017-04-01 19:05:00 6.54
2017-04-02 01:09:00 2017-04-02 01:12:00 1.07
2017-04-02 01:22:00 2017-04-02 01:27:00 1.03
2017-04-02 08:17:00 2017-04-02 08:23:00 1.98
2017-04-02 11:23:00 2017-04-02 11:30:00 1.98
2017-04-02 15:44:00 2017-04-02 15:56:00 4.15
2017-04-02 16:29:00 2017-04-02 16:45:00 4.08
2017-04-03 10:24:00 2017-04-03 10:55:00 19.76
2017-04-03 14:01:00 2017-04-03 14:18:00 8.21
2017-04-03 14:25:00 2017-04-03 14:31:00 1.49
2017-04-03 14:45:00 2017-04-03 14:50:00 1.59
2017-04-03 15:44:00 2017-04-03 16:10:00 4.44
2017-04-03 16:14:00 2017-04-03 16:37:00 9.96
2017-04-03 16:40:00 2017-04-03 …
Run Code Online (Sandbox Code Playgroud) import { Controller, Post, Body } from '@nestjs/common';
import { MyService } from 'my.service';
import { MyDto } from './dto/my.dto';
@Controller('my-route')
export class MyController {
constructor(private readonly _myService: MyService) {}
@Post()
async myMethod(@Body() myDto: MyDto) {
console.log(myDto); // undefined
return await this._myService.doStuff(myDto.elementOfInterest); // Passes undefined variable into method.
}
}
Run Code Online (Sandbox Code Playgroud)
我对从Nest中的POST访问主体表单数据的正确方法感到困惑。文档和示例都显示了@Body()
修饰符的简单用法,该修饰符位于将包含主体(或主体(如果使用参数,则为主体中的特定元素))的参数名称之前。但是,在上面的示例中,主体从不填充,并且方法myDto
未定义就被调用。即使将其类型更改为字符串,并且仅在POST正文中传递单个键/值对,也仍未定义。
在Nest中处理POST正文的正确方法是什么?
在我的ArangoDB图中,我有一个主题,与该主题相关联的消息线程,以及这些消息线程内的消息.我想以这样一种方式遍历图形,即返回与消息线程关联的数据以及消息线程内的消息计数.
数据的结构非常简单:我有主题节点,边缘扩展到线程节点,日期和类别相关联,以及从线程节点到消息节点的边缘.
我想返回存储在线程节点中的数据和附加到线程的消息计数.
我不确定如何使用for v, e, p in 1..2 outbound
语法执行此操作.我应该for v, e, p in outbound
在里面使用嵌套图吗?这仍然是高性能的吗?
我的部分图表是使用两个大型集合之间的巨型连接构建的,每次我将文档添加到任一集合时都会运行它.该查询基于较旧的帖子.
FOR fromItem IN fromCollection
FOR toItem IN toCollection
FILTER fromItem.fromAttributeValue == toItem.toAttributeValue
INSERT { _from: fromItem._id, _to: toItem._id, otherAttributes: {}} INTO edgeCollection
Run Code Online (Sandbox Code Playgroud)
这需要大约55,000秒才能完成我的数据集.我绝对欢迎提出更快的建议.
但我有两个相关的问题:
upsert
没关系,但在这种情况下,因为我无法预先知道密钥,所以对我没有帮助.为了获得前面的密钥,我需要通过示例查询以找到其他相同的现有边的密钥.这似乎是合理的,只要它不会破坏我的性能,但我不知道如何在AQL中有条件地构造我的查询,以便在等效边缘尚不存在的情况下插入边缘,但如果等效边缘则不执行任何操作确实存在.我怎样才能做到这一点?我是ArangoDB的新手.我对Neo4J很熟悉,但他对ArangoDB的性能和多模型设计很感兴趣.文档似乎非常深刻,但我开始时遇到了麻烦.
我想知道一种简单的方法来做一些基本的图形操作.到目前为止我发现的所有内容都告诉我如何将整个集合连接在一起,但我希望能够简单地定义一个节点,定义另一个节点,并定义它们之间的边缘.
理想情况下,通过HTTP,我该怎么做:
作为一个例子,我想创建一个简单的图形,如下图所示的树:https://www.arangodb.com/2015/07/data-modeling-with-multi-model-databases/
我想了解如何创建此图的子集的基本说明.我想要:
airline0
和airline1
一个名为集合fleets
.plane0
,plane1
,plane2
集合中叫planes
. - 在每个平面的文档中放置一个任意属性 - 比方说颜色.Jennifer
的集合中创建一个调用的节点pilots
.接下来,我想连接图表.根据文档,它看起来像边缘本身是文档,因此可以具有属性.我想创建以下边缘:
(airline0)-[owns]->(plane0)
(airline0)-[owns]->(plane1)
这条边有since: 2013
一个属性(airline1)-[owns]->(plane2)
(airline1)-[previouslyOwned]->(plane1)
between: [1999,2013]
(plane0)-[inFleet]->(airline0)
(plane1)-[inFleet]->(airline0)
(plane1)-[wasInFleet]->(airline1)
between: [1999,2013]
(plane2)-[inFleet]->(airline1)
(jennifer)-[canfly]->(plane0)
(plane0)-[hasPilot]->(jennifer)
请告诉我如何通过HTTP创建这样的图表.如果不是HTTP,我想通过arangosh知道如何做到这一点.
如何使用布尔值取一个简单的对象并将其转换为一个数组,其中只有那些值为true的键才会在数组中结束?
例如:
myObject = {
option1: true,
option2: false,
option3: true,
option4: true
}
Run Code Online (Sandbox Code Playgroud)
变
['option1','option3','option4']
Run Code Online (Sandbox Code Playgroud)
我尝试使用这里_.pick(myObject, Boolean)
建议,但这只是产生一个空对象.我正在使用Typescript,所以如果有任何可以用来完成这个的Typescript魔法,那我也是这样做的.
<md-button-toggle-group name="typeToggle" [(ngModel)]="chosenType" multiple>
<md-button-toggle *ngFor="let type of subTypes" [value]="type">
{{type}}
</md-button-toggle>
</md-button-toggle-group>
Run Code Online (Sandbox Code Playgroud)
但是我得到了错误
core.es5.js:1084
ERROR Error: Uncaught (in promise): Error: No value accessor for form control with name: 'typeToggle'
Error: No value accessor for form control with name: 'typeToggle'
Run Code Online (Sandbox Code Playgroud)
我想念什么吗?
删除name
属性将导致:
core.es5.js:1084
ERROR Error: Uncaught (in promise): Error: No value accessor for form control with unspecified name attribute
Error: No value accessor for form control with unspecified name attribute
Run Code Online (Sandbox Code Playgroud)
删除可以multiple …
我刚刚有一个有趣的git体验.我是我分支机构中唯一的开发人员my-branch
,我最近从我的队友分支机构分支出来:her-branch
.我已经成功地将几个提交推送到我的分支机构.但当我去推动我的最后一个分支时,发生了以下情况:
$ git push
To git@url/repo.git
! [rejected] her-branch -> her-branch (non-fast-forward)
error: failed to push some refs to 'git@url/repo.git'
hint: Updates were rejecetd because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes.
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
我觉得很奇怪,即使我正在推动my-branch
消息说它失败了因为her-branch
.我不知道出了什么问题,但我按照消息建议拉了:
$ git pull
Already up-to-date.
Run Code Online (Sandbox Code Playgroud)
我想确认我在我的分店......
$ …
Run Code Online (Sandbox Code Playgroud)