{"action":"created","comment":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/44546027","id":44546027,"diff_hunk":"@@ -381,4 +381,85 @@ FloatVectorList: class extends VectorList<Float> {\n \t\t\tresult add(this[i] clamp(floor, ceiling))\n \t\tresult\n \t}\n+\tfindMaxIndex: func -> Int {\n+\t\tindex := 0\n+\t\tfor (i in 1 .. this count)\n+\t\t\tif (this[index] < this[i])\n+\t\t\t\tindex = i\n+\t\tindex\n+\t}\n+\tcrossCorrelation: func (other: This, vectorLength: Int) -> Float {\n+\t\tupperPart := 0.0f\n+\t\tlowerPart1 := 0.0f\n+\t\tlowerPart2 := 0.0f\n+\t\tthisMean := this mean\n+\t\totherMean := other mean\n+\t\tthisPointer := (this pointer as Float*)\n+\t\totherPointer := (other pointer as Float*)\n+\t\tfor (i in 0 .. vectorLength) {\n+\t\t\tupperPart += ((thisPointer[i] - thisMean) * (otherPointer[i] - otherMean))\n+\t\t\tlowerPart1 += ((thisPointer[i] - thisMean) * (thisPointer[i] - thisMean))\n+\t\t\tlowerPart2 += ((otherPointer[i] - otherMean) * (otherPointer[i] - otherMean))\n+\t\t}\n+\t\tupperPart / sqrt(lowerPart1 * lowerPart2)\n+\t}\n+\tshift: func (offset: Int, filledValue := 0.0f) -> This {\n+\t\tresult := This new(this count)\n+\t\tthisPointer := (this pointer as Float*)\n+\t\tif (offset < 0)\n+\t\t\tfor (i in 0 .. this count)\n+\t\t\t\tif ((i - offset) <= this count)\n+\t\t\t\t\tresult add(thisPointer[i - offset])\n+\t\t\t\telse\n+\t\t\t\t\tresult add(filledValue)\n+\t\telse\n+\t\t\tfor (i in 0 .. this count)\n+\t\t\t\tif (i < offset)\n+\t\t\t\t\tresult add(filledValue)\n+\t\t\t\telse\n+\t\t\t\t\tresult add(thisPointer[i - offset])\n+\t\tresult\n+\t}\n+\t// offset < 0 means it shifts to left\n+\tfindCrossCorrelationOffset: func (other: This, offsetStart, offsetEnd: Int) -> CorrelationData {\n+\t\tcrossCorrelation := This new(this count)\n+\t\tfor (offset in offsetStart .. offsetEnd)\n+\t\t\tcrossCorrelation add(this shift(offset) crossCorrelation(other, other count))\n+\n+\t\tindex := crossCorrelation findMaxIndex()\n+\t\tmaxValue := this[index]\n+\t\tindex = (index < (offsetEnd - offsetStart) / 2) ? (index + offsetStart) : (index - offsetEnd)\n+\n+\t\tCorrelationData new(index, maxValue, crossCorrelation)\n+\t}\n+\t//input: how many points there will be between two origin points.\n+\t// this is a Linear interpolation way to have higher precision\n+\thigherPrecision: func (numberOfPoints: Int) -> This {\n+\t\tif (numberOfPoints != 0) {\n+\t\t\tnewCount := this count + numberOfPoints * (this count - 1)\n+\t\t\tresult := This new(newCount)\n+\t\t\tprecision := (numberOfPoints + 1) as Float\n+\t\t\tthisPointer := (this pointer as Float*)\n+\t\t\tfor (index in 0 .. newCount) {\n+\t\t\t\tnewIndex := (index / precision) as Int\n+\t\t\t\tif (Float modulo(index as Float, precision) == 0.0f)\n+\t\t\t\t\tresult add(this[newIndex])\n+\t\t\t\telse {\n+\t\t\t\t\tratio := Float modulo(index as Float, precision) / precision\n+\t\t\t\t\tdifference := thisPointer[newIndex + 1] - thisPointer[newIndex]\n+\t\t\t\t\ttempResult := thisPointer[newIndex] + ratio * difference\n+\t\t\t\t\tresult add(tempResult)\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tresult\n+\t\t}\n+\t\telse\n+\t\t\tthis","path":"source/math/FloatVectorList.ooc","position":74,"original_position":77,"commit_id":"0f5aef57f68090e90889514a3c52401fff190c00","original_commit_id":"bf6564d5eca600832929ee7ef3fb95dbfada630c","user":{"login":"davidhesselbom","id":4319680,"avatar_url":"https://avatars.githubusercontent.com/u/4319680?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhesselbom","html_url":"https://github.com/davidhesselbom","followers_url":"https://api.github.com/users/davidhesselbom/followers","following_url":"https://api.github.com/users/davidhesselbom/following{/other_user}","gists_url":"https://api.github.com/users/davidhesselbom/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhesselbom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhesselbom/subscriptions","organizations_url":"https://api.github.com/users/davidhesselbom/orgs","repos_url":"https://api.github.com/users/davidhesselbom/repos","events_url":"https://api.github.com/users/davidhesselbom/events{/privacy}","received_events_url":"https://api.github.com/users/davidhesselbom/received_events","type":"User","site_admin":false},"body":"Correct.","created_at":"2015-11-11T15:42:03Z","updated_at":"2015-11-11T15:42:03Z","html_url":"https://github.com/cogneco/ooc-kean/pull/680#discussion_r44546027","pull_request_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680","_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/44546027"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/680#discussion_r44546027"},"pull_request":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680"}}},"pull_request":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680","id":49675307,"html_url":"https://github.com/cogneco/ooc-kean/pull/680","diff_url":"https://github.com/cogneco/ooc-kean/pull/680.diff","patch_url":"https://github.com/cogneco/ooc-kean/pull/680.patch","issue_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/680","number":680,"state":"open","locked":false,"title":"sync check tool.","user":{"login":"ziquanyu","id":11041884,"avatar_url":"https://avatars.githubusercontent.com/u/11041884?v=3","gravatar_id":"","url":"https://api.github.com/users/ziquanyu","html_url":"https://github.com/ziquanyu","followers_url":"https://api.github.com/users/ziquanyu/followers","following_url":"https://api.github.com/users/ziquanyu/following{/other_user}","gists_url":"https://api.github.com/users/ziquanyu/gists{/gist_id}","starred_url":"https://api.github.com/users/ziquanyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziquanyu/subscriptions","organizations_url":"https://api.github.com/users/ziquanyu/orgs","repos_url":"https://api.github.com/users/ziquanyu/repos","events_url":"https://api.github.com/users/ziquanyu/events{/privacy}","received_events_url":"https://api.github.com/users/ziquanyu/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-04T11:08:54Z","updated_at":"2015-11-11T15:42:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cda52593c036385085a059afcf4e22b80fa7ae2d","assignee":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680/commits","review_comments_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680/comments","review_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/680/comments","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/0f5aef57f68090e90889514a3c52401fff190c00","head":{"label":"ziquanyu:sync_check","ref":"sync_check","sha":"0f5aef57f68090e90889514a3c52401fff190c00","user":{"login":"ziquanyu","id":11041884,"avatar_url":"https://avatars.githubusercontent.com/u/11041884?v=3","gravatar_id":"","url":"https://api.github.com/users/ziquanyu","html_url":"https://github.com/ziquanyu","followers_url":"https://api.github.com/users/ziquanyu/followers","following_url":"https://api.github.com/users/ziquanyu/following{/other_user}","gists_url":"https://api.github.com/users/ziquanyu/gists{/gist_id}","starred_url":"https://api.github.com/users/ziquanyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziquanyu/subscriptions","organizations_url":"https://api.github.com/users/ziquanyu/orgs","repos_url":"https://api.github.com/users/ziquanyu/repos","events_url":"https://api.github.com/users/ziquanyu/events{/privacy}","received_events_url":"https://api.github.com/users/ziquanyu/received_events","type":"User","site_admin":false},"repo":{"id":31723801,"name":"ooc-kean","full_name":"ziquanyu/ooc-kean","owner":{"login":"ziquanyu","id":11041884,"avatar_url":"https://avatars.githubusercontent.com/u/11041884?v=3","gravatar_id":"","url":"https://api.github.com/users/ziquanyu","html_url":"https://github.com/ziquanyu","followers_url":"https://api.github.com/users/ziquanyu/followers","following_url":"https://api.github.com/users/ziquanyu/following{/other_user}","gists_url":"https://api.github.com/users/ziquanyu/gists{/gist_id}","starred_url":"https://api.github.com/users/ziquanyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziquanyu/subscriptions","organizations_url":"https://api.github.com/users/ziquanyu/orgs","repos_url":"https://api.github.com/users/ziquanyu/repos","events_url":"https://api.github.com/users/ziquanyu/events{/privacy}","received_events_url":"https://api.github.com/users/ziquanyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ziquanyu/ooc-kean","description":"ooc port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/ziquanyu/ooc-kean","forks_url":"https://api.github.com/repos/ziquanyu/ooc-kean/forks","keys_url":"https://api.github.com/repos/ziquanyu/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ziquanyu/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ziquanyu/ooc-kean/teams","hooks_url":"https://api.github.com/repos/ziquanyu/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/ziquanyu/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/ziquanyu/ooc-kean/events","assignees_url":"https://api.github.com/repos/ziquanyu/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/ziquanyu/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/ziquanyu/ooc-kean/tags","blobs_url":"https://api.github.com/repos/ziquanyu/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ziquanyu/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ziquanyu/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/ziquanyu/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ziquanyu/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/ziquanyu/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/ziquanyu/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/ziquanyu/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/ziquanyu/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/ziquanyu/ooc-kean/subscription","commits_url":"https://api.github.com/repos/ziquanyu/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/ziquanyu/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/ziquanyu/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/ziquanyu/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/ziquanyu/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/ziquanyu/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ziquanyu/ooc-kean/merges","archive_url":"https://api.github.com/repos/ziquanyu/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ziquanyu/ooc-kean/downloads","issues_url":"https://api.github.com/repos/ziquanyu/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/ziquanyu/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/ziquanyu/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/ziquanyu/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ziquanyu/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/ziquanyu/ooc-kean/releases{/id}","created_at":"2015-03-05T16:33:42Z","updated_at":"2015-03-19T12:21:16Z","pushed_at":"2015-11-11T15:41:48Z","git_url":"git://github.com/ziquanyu/ooc-kean.git","ssh_url":"git@github.com:ziquanyu/ooc-kean.git","clone_url":"https://github.com/ziquanyu/ooc-kean.git","svn_url":"https://github.com/ziquanyu/ooc-kean","homepage":"","size":32051,"stargazers_count":0,"watchers_count":0,"language":"ooc","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cogneco:master","ref":"master","sha":"c6df486bcfd2abef301d902f8a412eb0bb164eb4","user":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"cogneco/ooc-kean","owner":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cogneco/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/cogneco/ooc-kean","forks_url":"https://api.github.com/repos/cogneco/ooc-kean/forks","keys_url":"https://api.github.com/repos/cogneco/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cogneco/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cogneco/ooc-kean/teams","hooks_url":"https://api.github.com/repos/cogneco/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/cogneco/ooc-kean/events","assignees_url":"https://api.github.com/repos/cogneco/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/cogneco/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/cogneco/ooc-kean/tags","blobs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cogneco/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/cogneco/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/cogneco/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/cogneco/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/cogneco/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/cogneco/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/cogneco/ooc-kean/subscription","commits_url":"https://api.github.com/repos/cogneco/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/cogneco/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/cogneco/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/cogneco/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cogneco/ooc-kean/merges","archive_url":"https://api.github.com/repos/cogneco/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cogneco/ooc-kean/downloads","issues_url":"https://api.github.com/repos/cogneco/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/cogneco/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/cogneco/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/cogneco/ooc-kean/releases{/id}","created_at":"2014-10-15T13:42:17Z","updated_at":"2015-05-08T13:13:16Z","pushed_at":"2015-11-11T15:41:48Z","git_url":"git://github.com/cogneco/ooc-kean.git","ssh_url":"git@github.com:cogneco/ooc-kean.git","clone_url":"https://github.com/cogneco/ooc-kean.git","svn_url":"https://github.com/cogneco/ooc-kean","homepage":"","size":31909,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":86,"forks":17,"open_issues":86,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/680"},"issue":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/680"},"comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/680/comments"},"review_comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680/comments"},"review_comment":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/680/commits"},"statuses":{"href":"https://api.github.com/repos/cogneco/ooc-kean/statuses/0f5aef57f68090e90889514a3c52401fff190c00"}}}}