payload: {"action":"created","comment":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/266213622","pull_request_review_id":215328304,"id":266213622,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2NjIxMzYyMg==","diff_hunk":"@@ -0,0 +1,270 @@\n+/** This software is distributed under BSD 3-clause license (see LICENSE file).\n+ *\n+ * Authors: Sergey Lisitsyn, Viktor Gal\n+ */\n+\n+#include <memory>\n+\n+#include <shogun/base/class_list.h>\n+#include <shogun/base/macros.h>\n+#include <shogun/io/serialization/JsonDeserializer.h>\n+#include <shogun/io/ShogunErrc.h>\n+#include <shogun/lib/SGVector.h>\n+#include <shogun/lib/SGMatrix.h>\n+#include <shogun/util/converters.h>\n+\n+#include <rapidjson/reader.h>\n+#include <rapidjson/document.h>\n+\n+#include <iostream>\n+\n+using namespace rapidjson;\n+using namespace shogun;\n+using namespace shogun::io;\n+using namespace std;\n+\n+template<class ValueType>\n+class JSONReaderVisitor;\n+\n+template<typename V>\n+CSGObject* object_reader(V& v, JSONReaderVisitor<V>* visitor);\n+\n+extern const char* const kNameKey;\n+extern const char* const kGenericKey;\n+extern const char* const kParametersKey;\n+\n+template<typename Reader, typename Fn, typename V>\n+void read_vector(Reader* reader, Fn f, V vector)\n+{\n+\tauto json_array = reader->GetArray();\n+\tif (!json_array.Size())\n+\t\treturn;\n+\tvector->resize_vector(json_array.Size());\n+\tauto it = json_array.Begin();\n+\tindex_t idx = 0;\n+\tfor (;it != json_array.End(); ++it, ++idx)\n+\t{\n+\t\tvector->vector[idx] = ((*it).*f)();\n+\t}\n+}\n+\n+template<typename Reader, typename Fn, typename V>\n+void read_matrix(Reader* reader, Fn f, V* matrix)\n+{\n+\tauto json_array = reader->GetArray();\n+\tif (!json_array.Size())\n+\t\treturn;\n+\n+\tSGVector<typename V::Scalar> v;\n+\tauto it = json_array.Begin();\n+\tread_vector(it, f, &v);\n+\tV m(v.vlen, json_array.Size());\n+\tindex_t col = 0;\n+\t// TODO: could do this with less memory consumption\n+\t// i.e. directly set elements and not to do copies\n+\tm.set_column(col, v);\n+\tfor (++col, ++it; it != json_array.End(); ++it, ++col)\n+\t{\n+\t\tread_vector(it, f, &v);\n+\t\tm.set_column(col, v);\n+\t}\n+\t*matrix = m;\n+}\n+\n+template<class ValueType>\n+class JSONReaderVisitor: public AnyVisitor","path":"src/shogun/io/serialization/JsonDeserializer.cpp","position":75,"original_position":75,"commit_id":"fbe5af286fce328735d015617fca4336077082f7","original_commit_id":"fbe5af286fce328735d015617fca4336077082f7","user":{"login":"gf712","id":12395516,"node_id":"MDQ6VXNlcjEyMzk1NTE2","avatar_url":"https://avatars0.githubusercontent.com/u/12395516?v=4","gravatar_id":"","url":"https://api.github.com/users/gf712","html_url":"https://github.com/gf712","followers_url":"https://api.github.com/users/gf712/followers","following_url":"https://api.github.com/users/gf712/following{/other_user}","gists_url":"https://api.github.com/users/gf712/gists{/gist_id}","starred_url":"https://api.github.com/users/gf712/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gf712/subscriptions","organizations_url":"https://api.github.com/users/gf712/orgs","repos_url":"https://api.github.com/users/gf712/repos","events_url":"https://api.github.com/users/gf712/events{/privacy}","received_events_url":"https://api.github.com/users/gf712/received_events","type":"User","site_admin":false},"body":"This is really cool!","created_at":"2019-03-16T20:12:10Z","updated_at":"2019-03-16T20:12:11Z","html_url":"https://github.com/shogun-toolbox/shogun/pull/4573#discussion_r266213622","pull_request_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/266213622"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/4573#discussion_r266213622"},"pull_request":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573"}}},"pull_request":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573","id":261203342,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxMjAzMzQy","html_url":"https://github.com/shogun-toolbox/shogun/pull/4573","diff_url":"https://github.com/shogun-toolbox/shogun/pull/4573.diff","patch_url":"https://github.com/shogun-toolbox/shogun/pull/4573.patch","issue_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4573","number":4573,"state":"open","locked":false,"title":"0xdeadbeef","user":{"login":"vigsterkr","id":30353,"node_id":"MDQ6VXNlcjMwMzUz","avatar_url":"https://avatars1.githubusercontent.com/u/30353?v=4","gravatar_id":"","url":"https://api.github.com/users/vigsterkr","html_url":"https://github.com/vigsterkr","followers_url":"https://api.github.com/users/vigsterkr/followers","following_url":"https://api.github.com/users/vigsterkr/following{/other_user}","gists_url":"https://api.github.com/users/vigsterkr/gists{/gist_id}","starred_url":"https://api.github.com/users/vigsterkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigsterkr/subscriptions","organizations_url":"https://api.github.com/users/vigsterkr/orgs","repos_url":"https://api.github.com/users/vigsterkr/repos","events_url":"https://api.github.com/users/vigsterkr/events{/privacy}","received_events_url":"https://api.github.com/users/vigsterkr/received_events","type":"User","site_admin":false},"body":"@lisitsyn have fun :)","created_at":"2019-03-14T14:53:11Z","updated_at":"2019-03-16T20:12:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7867ae80ec1a4ec2bc143215f2e75e624ed922e6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"lisitsyn","id":424629,"node_id":"MDQ6VXNlcjQyNDYyOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/424629?v=4","gravatar_id":"","url":"https://api.github.com/users/lisitsyn","html_url":"https://github.com/lisitsyn","followers_url":"https://api.github.com/users/lisitsyn/followers","following_url":"https://api.github.com/users/lisitsyn/following{/other_user}","gists_url":"https://api.github.com/users/lisitsyn/gists{/gist_id}","starred_url":"https://api.github.com/users/lisitsyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisitsyn/subscriptions","organizations_url":"https://api.github.com/users/lisitsyn/orgs","repos_url":"https://api.github.com/users/lisitsyn/repos","events_url":"https://api.github.com/users/lisitsyn/events{/privacy}","received_events_url":"https://api.github.com/users/lisitsyn/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573/commits","review_comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573/comments","review_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4573/comments","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/fbe5af286fce328735d015617fca4336077082f7","head":{"label":"vigsterkr:deadbeef","ref":"deadbeef","sha":"fbe5af286fce328735d015617fca4336077082f7","user":{"login":"vigsterkr","id":30353,"node_id":"MDQ6VXNlcjMwMzUz","avatar_url":"https://avatars1.githubusercontent.com/u/30353?v=4","gravatar_id":"","url":"https://api.github.com/users/vigsterkr","html_url":"https://github.com/vigsterkr","followers_url":"https://api.github.com/users/vigsterkr/followers","following_url":"https://api.github.com/users/vigsterkr/following{/other_user}","gists_url":"https://api.github.com/users/vigsterkr/gists{/gist_id}","starred_url":"https://api.github.com/users/vigsterkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigsterkr/subscriptions","organizations_url":"https://api.github.com/users/vigsterkr/orgs","repos_url":"https://api.github.com/users/vigsterkr/repos","events_url":"https://api.github.com/users/vigsterkr/events{/privacy}","received_events_url":"https://api.github.com/users/vigsterkr/received_events","type":"User","site_admin":false},"repo":{"id":4583587,"node_id":"MDEwOlJlcG9zaXRvcnk0NTgzNTg3","name":"shogun","full_name":"vigsterkr/shogun","private":false,"owner":{"login":"vigsterkr","id":30353,"node_id":"MDQ6VXNlcjMwMzUz","avatar_url":"https://avatars1.githubusercontent.com/u/30353?v=4","gravatar_id":"","url":"https://api.github.com/users/vigsterkr","html_url":"https://github.com/vigsterkr","followers_url":"https://api.github.com/users/vigsterkr/followers","following_url":"https://api.github.com/users/vigsterkr/following{/other_user}","gists_url":"https://api.github.com/users/vigsterkr/gists{/gist_id}","starred_url":"https://api.github.com/users/vigsterkr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigsterkr/subscriptions","organizations_url":"https://api.github.com/users/vigsterkr/orgs","repos_url":"https://api.github.com/users/vigsterkr/repos","events_url":"https://api.github.com/users/vigsterkr/events{/privacy}","received_events_url":"https://api.github.com/users/vigsterkr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/vigsterkr/shogun","description":"The Shogun Machine Learning Toolbox (Source Code)","fork":true,"url":"https://api.github.com/repos/vigsterkr/shogun","forks_url":"https://api.github.com/repos/vigsterkr/shogun/forks","keys_url":"https://api.github.com/repos/vigsterkr/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vigsterkr/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vigsterkr/shogun/teams","hooks_url":"https://api.github.com/repos/vigsterkr/shogun/hooks","issue_events_url":"https://api.github.com/repos/vigsterkr/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/vigsterkr/shogun/events","assignees_url":"https://api.github.com/repos/vigsterkr/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/vigsterkr/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/vigsterkr/shogun/tags","blobs_url":"https://api.github.com/repos/vigsterkr/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vigsterkr/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vigsterkr/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/vigsterkr/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vigsterkr/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/vigsterkr/shogun/languages","stargazers_url":"https://api.github.com/repos/vigsterkr/shogun/stargazers","contributors_url":"https://api.github.com/repos/vigsterkr/shogun/contributors","subscribers_url":"https://api.github.com/repos/vigsterkr/shogun/subscribers","subscription_url":"https://api.github.com/repos/vigsterkr/shogun/subscription","commits_url":"https://api.github.com/repos/vigsterkr/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/vigsterkr/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/vigsterkr/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/vigsterkr/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/vigsterkr/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/vigsterkr/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vigsterkr/shogun/merges","archive_url":"https://api.github.com/repos/vigsterkr/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vigsterkr/shogun/downloads","issues_url":"https://api.github.com/repos/vigsterkr/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/vigsterkr/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/vigsterkr/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/vigsterkr/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vigsterkr/shogun/labels{/name}","releases_url":"https://api.github.com/repos/vigsterkr/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/vigsterkr/shogun/deployments","created_at":"2012-06-07T09:44:06Z","updated_at":"2016-04-03T08:51:03Z","pushed_at":"2019-03-14T16:55:37Z","git_url":"git://github.com/vigsterkr/shogun.git","ssh_url":"git@github.com:vigsterkr/shogun.git","clone_url":"https://github.com/vigsterkr/shogun.git","svn_url":"https://github.com/vigsterkr/shogun","homepage":"http://www.shogun-toolbox.org","size":66522,"stargazers_count":3,"watchers_count":3,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"shogun-toolbox:develop","ref":"develop","sha":"ed45c1671ee03d15dfeb7c0966dcd6a20e645a07","user":{"login":"shogun-toolbox","id":690673,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MDY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/690673?v=4","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"repo":{"id":1555094,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU1MDk0","name":"shogun","full_name":"shogun-toolbox/shogun","private":false,"owner":{"login":"shogun-toolbox","id":690673,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5MDY3Mw==","avatar_url":"https://avatars1.githubusercontent.com/u/690673?v=4","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/shogun-toolbox/shogun","description":"Shōgun","fork":false,"url":"https://api.github.com/repos/shogun-toolbox/shogun","forks_url":"https://api.github.com/repos/shogun-toolbox/shogun/forks","keys_url":"https://api.github.com/repos/shogun-toolbox/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shogun-toolbox/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shogun-toolbox/shogun/teams","hooks_url":"https://api.github.com/repos/shogun-toolbox/shogun/hooks","issue_events_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/shogun-toolbox/shogun/events","assignees_url":"https://api.github.com/repos/shogun-toolbox/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/shogun-toolbox/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/tags","blobs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/shogun-toolbox/shogun/languages","stargazers_url":"https://api.github.com/repos/shogun-toolbox/shogun/stargazers","contributors_url":"https://api.github.com/repos/shogun-toolbox/shogun/contributors","subscribers_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscribers","subscription_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscription","commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/shogun-toolbox/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/shogun-toolbox/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shogun-toolbox/shogun/merges","archive_url":"https://api.github.com/repos/shogun-toolbox/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shogun-toolbox/shogun/downloads","issues_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/shogun-toolbox/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/shogun-toolbox/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shogun-toolbox/shogun/labels{/name}","releases_url":"https://api.github.com/repos/shogun-toolbox/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/shogun-toolbox/shogun/deployments","created_at":"2011-04-01T10:44:32Z","updated_at":"2019-03-15T18:02:16Z","pushed_at":"2019-03-16T18:32:13Z","git_url":"git://github.com/shogun-toolbox/shogun.git","ssh_url":"git@github.com:shogun-toolbox/shogun.git","clone_url":"https://github.com/shogun-toolbox/shogun.git","svn_url":"https://github.com/shogun-toolbox/shogun","homepage":"http://shogun.ml","size":66612,"stargazers_count":2374,"watchers_count":2374,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":912,"mirror_url":null,"archived":false,"open_issues_count":564,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":912,"open_issues":564,"watchers":2374,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/4573"},"issue":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4573"},"comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/4573/comments"},"review_comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573/comments"},"review_comment":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/4573/commits"},"statuses":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/fbe5af286fce328735d015617fca4336077082f7"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"gf712"}}