我犹豫什么应该使用哪种类型.会有很多ID和组,通常他们学会了我做多个表,但第二个版本的regexp看起来很棒而且不那么多余.我很想知道那两个版本更好.
+----+ +----+-------+
| ID | | ID | Group |
+----+ +----+-------+
| 1 | | 1 | gr1 |
| 1 | | 1 | gr2 |
| 2 | | 2 | gr2 |
| 2 | | 2 | gr3 |
+----+ +----+-------+
SELECT * FROM tbl1 join tbl2 USING(ID) WHERE Group="gr1";
+----+-----------+
| ID | Group |
+----+-----------+
| 1 | gr1,gr2 |
| 2 | gr2,gr3 |
+----+-----------+
SELECT * FROM tbl1 WHERE Group …Run Code Online (Sandbox Code Playgroud) 所以我把一个假想的圆分成了多个部分(为了简单起见,我用了 8 个,但最后我想把它分成 16 个或 32 个部分)。
然后我有 N 条二次贝塞尔曲线,即在 2 个最近的线段之间。它可以停留在圆上或离中心更远,但不能比圆更近。
我知道如何找到,我应该在女巫线中寻找什么交点,但我不知道如何将它分成两部分......我知道,如果我寻找线和曲线的交点,我应该得到指出前一条曲线应该结束,下一条曲线应该开始,并且通过推导我可以得到向量,但我不知道如何去做。
示例图像,其中我只有 8 个部分,以便更轻松地解决问题。
关键是,使用贝塞尔曲线制作“进步”栏。旁注:曲线每帧都会改变,因为它们是音乐可视化的一部分。
如果有更好的方法来为曲线吐色,我完全赞成!
我想有一个服务,它有一个可观察的变量依赖于当前URL.
:programID -- program overivew
:programID/bug -- bug list
:programID/bug/:bugID -- bug overview
Run Code Online (Sandbox Code Playgroud)
哪里programID可以随时切换.我已经提供了一项服务,根据我从棱角分明的文档中的理解,我应该使用参数进行观察
ProgramService :(摘录)
currentProgramID: number
constructor(
private router: Router,
private route: ActivatedRoute,
private http: Http){
this.route.params.subscribe((params: Params) => {
console.log('Parent:', params['programID'])
})
this.route.children[0].params.subscribe((params: Params) => {
console.log('Childern:', params['programID'])
// Works if loaded while at url : 'abc123/bug/abc123'
})
this.route.params.subscribe((params: Params) => {
console.log('Hacky?:', this.route.snapshot.params['programID'])
})
}
Run Code Online (Sandbox Code Playgroud)
需要当前程序参考的组件:(提取)
program: Promise<program>
constructor(
private programService: ProgramService, ... ){}
ngOnInit() {
this.program = this.programService.getProgram(/*current program*/)
...
} …Run Code Online (Sandbox Code Playgroud) 我有一个云功能(generateThumbnail样本函数的修改版本).我想创建缩略图,但我还想获得图像宽度和高度,并更新数据库中的大小值.
要解决这个问题:
/projects数据库project.size为新值我做了一些研究,但是functions.database.DeltaSnapshot当你听的时候我只找到了给出的界面functions.database().ref().onwrite(snapshot => {})
projects.json:
[{
"name": "lolipop",
"src": "lolipop.jpg",
"size": ""
},{
"name": "cookie",
"src": "cookie.jpg",
"size": ""
}]
Run Code Online (Sandbox Code Playgroud) firebase firebase-realtime-database google-cloud-functions firebase-storage
我不知道为什么路由器不会匹配任何给定的路由...我什至尝试过非常简单的路由,但都失败了。
我的路线(摘录):
{
path: ':rootFolder/',
children: [
{
path: 'name/**',
component: MainComponent,
},
{
path: 'name/*', // Debugging only
component: MainComponent,
},
{
path: 'name', // Debugging only
component: MainComponent,
},
{
path: '',
component: MainComponent,
pathMatch: 'full',
},
],
},
{
path: ':rootFolder/:currentFolder/',
children: [
{
path: 'name/**',
component: MainComponent,
},
{
path: '',
component: MainComponent,
pathMatch: 'full',
},
],
},
Run Code Online (Sandbox Code Playgroud)
另外,我确信,这些路由正在被路由器接受,就像我使用一样UrlMatcher,我会得到正确的行为。我只想使用标准的内置解决方案而不是这个......
解决这个问题是一回事,但我很想了解原因并可能帮助其他人......
angular ×2
bezier ×1
canvas ×1
firebase ×1
javascript ×1
math ×1
mysql ×1
performance ×1
regex ×1