{"action":"created","comment":{"url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/comments/24789188","id":24789188,"diff_hunk":"@@ -78,6 +98,52 @@ struct State {\n                                   HTTPResponseCode::OK,\n                                   \"image/svg+xml\");\n   }\n+\n+  void DemoRequest(Request r) {\n+    if (r.http.Method() == \"POST\") {\n+      // TODO(dkorolev): This should get simpler once Bricks 1.0 is out, the `.http.` will go away.\n+      if (!r.http.HasBody()) {\n+        points.emplace_back(atof(r.url.query[\"x\"].c_str()),\n+                            atof(r.url.query[\"y\"].c_str()),\n+                            !!atoi(r.url.query[\"label\"].c_str()));\n+      } else {\n+        // Note: this will throw on an invalid JSON. TODO(dkorolev): Think of it further :-)","path":"demo/state.h","position":null,"original_position":53,"commit_id":"96948a8763744364c3b1bc1204a4929d0ff7fa89","original_commit_id":"e40d8cccd0b652e8c0a84026071a6ed591f6ecd6","user":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"body":"Good point about the framwork.\n\nI'll edit the comment instead of removing it :)\n\nThanks,\nDima\n\nhttp://dimakorolev.com/ | http://www.linkedin.com/in/dimakorolev |\ndmitry.korolev@gmail.com | +1 (312) 593 2783\n\n\nOn Mon, Feb 16, 2015 at 6:37 PM, John Babak <notifications@github.com>\nwrote:\n\n> In demo/state.h\n> <https://github.com/KnowSheet/KnowSheet/pull/8#discussion_r24789110>:\n>\n> > @@ -78,6 +98,52 @@ struct State {\n> >                                    HTTPResponseCode::OK,\n> >                                    \"image/svg+xml\");\n> >    }\n> > +\n> > +  void DemoRequest(Request r) {\n> > +    if (r.http.Method() == \"POST\") {\n> > +      // TODO(dkorolev): This should get simpler once Bricks 1.0 is out, the `.http.` will go away.\n> > +      if (!r.http.HasBody()) {\n> > +        points.emplace_back(atof(r.url.query[\"x\"].c_str()),\n> > +                            atof(r.url.query[\"y\"].c_str()),\n> > +                            !!atoi(r.url.query[\"label\"].c_str()));\n> > +      } else {\n> > +        // Note: this will throw on an invalid JSON. TODO(dkorolev): Think of it further :-)\n>\n> Wow :) That was just a thought on how error handling should be implemented\n> in the framework, not in the demo. OK, you could likely remove the comment,\n> too.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/KnowSheet/KnowSheet/pull/8/files#r24789110>.\n>\n","created_at":"2015-02-17T02:40:14Z","updated_at":"2015-02-17T02:40:14Z","html_url":"https://github.com/KnowSheet/KnowSheet/pull/8#discussion_r24789188","pull_request_url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/comments/24789188"},"html":{"href":"https://github.com/KnowSheet/KnowSheet/pull/8#discussion_r24789188"},"pull_request":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8","id":29331655,"html_url":"https://github.com/KnowSheet/KnowSheet/pull/8","diff_url":"https://github.com/KnowSheet/KnowSheet/pull/8.diff","patch_url":"https://github.com/KnowSheet/KnowSheet/pull/8.patch","issue_url":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/8","number":8,"state":"open","locked":false,"title":"Stateful points demo.","user":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-15T08:09:46Z","updated_at":"2015-02-17T02:40:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"193526ce923aa1c64dc5747fc8457914990d4854","assignee":{"login":"sompylasar","id":498274,"avatar_url":"https://avatars.githubusercontent.com/u/498274?v=3","gravatar_id":"","url":"https://api.github.com/users/sompylasar","html_url":"https://github.com/sompylasar","followers_url":"https://api.github.com/users/sompylasar/followers","following_url":"https://api.github.com/users/sompylasar/following{/other_user}","gists_url":"https://api.github.com/users/sompylasar/gists{/gist_id}","starred_url":"https://api.github.com/users/sompylasar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sompylasar/subscriptions","organizations_url":"https://api.github.com/users/sompylasar/orgs","repos_url":"https://api.github.com/users/sompylasar/repos","events_url":"https://api.github.com/users/sompylasar/events{/privacy}","received_events_url":"https://api.github.com/users/sompylasar/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8/commits","review_comments_url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8/comments","review_comment_url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/comments/{number}","comments_url":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/8/comments","statuses_url":"https://api.github.com/repos/KnowSheet/KnowSheet/statuses/96948a8763744364c3b1bc1204a4929d0ff7fa89","head":{"label":"dkorolev:stateful_points","ref":"stateful_points","sha":"96948a8763744364c3b1bc1204a4929d0ff7fa89","user":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"repo":{"id":29337896,"name":"KnowSheet","full_name":"dkorolev/KnowSheet","owner":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkorolev/KnowSheet","description":"Top-level KnowSheet repository.","fork":true,"url":"https://api.github.com/repos/dkorolev/KnowSheet","forks_url":"https://api.github.com/repos/dkorolev/KnowSheet/forks","keys_url":"https://api.github.com/repos/dkorolev/KnowSheet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkorolev/KnowSheet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkorolev/KnowSheet/teams","hooks_url":"https://api.github.com/repos/dkorolev/KnowSheet/hooks","issue_events_url":"https://api.github.com/repos/dkorolev/KnowSheet/issues/events{/number}","events_url":"https://api.github.com/repos/dkorolev/KnowSheet/events","assignees_url":"https://api.github.com/repos/dkorolev/KnowSheet/assignees{/user}","branches_url":"https://api.github.com/repos/dkorolev/KnowSheet/branches{/branch}","tags_url":"https://api.github.com/repos/dkorolev/KnowSheet/tags","blobs_url":"https://api.github.com/repos/dkorolev/KnowSheet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkorolev/KnowSheet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkorolev/KnowSheet/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkorolev/KnowSheet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkorolev/KnowSheet/statuses/{sha}","languages_url":"https://api.github.com/repos/dkorolev/KnowSheet/languages","stargazers_url":"https://api.github.com/repos/dkorolev/KnowSheet/stargazers","contributors_url":"https://api.github.com/repos/dkorolev/KnowSheet/contributors","subscribers_url":"https://api.github.com/repos/dkorolev/KnowSheet/subscribers","subscription_url":"https://api.github.com/repos/dkorolev/KnowSheet/subscription","commits_url":"https://api.github.com/repos/dkorolev/KnowSheet/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkorolev/KnowSheet/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkorolev/KnowSheet/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkorolev/KnowSheet/issues/comments/{number}","contents_url":"https://api.github.com/repos/dkorolev/KnowSheet/contents/{+path}","compare_url":"https://api.github.com/repos/dkorolev/KnowSheet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkorolev/KnowSheet/merges","archive_url":"https://api.github.com/repos/dkorolev/KnowSheet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkorolev/KnowSheet/downloads","issues_url":"https://api.github.com/repos/dkorolev/KnowSheet/issues{/number}","pulls_url":"https://api.github.com/repos/dkorolev/KnowSheet/pulls{/number}","milestones_url":"https://api.github.com/repos/dkorolev/KnowSheet/milestones{/number}","notifications_url":"https://api.github.com/repos/dkorolev/KnowSheet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkorolev/KnowSheet/labels{/name}","releases_url":"https://api.github.com/repos/dkorolev/KnowSheet/releases{/id}","created_at":"2015-01-16T07:35:54Z","updated_at":"2015-02-16T02:10:17Z","pushed_at":"2015-02-17T02:39:50Z","git_url":"git://github.com/dkorolev/KnowSheet.git","ssh_url":"git@github.com:dkorolev/KnowSheet.git","clone_url":"https://github.com/dkorolev/KnowSheet.git","svn_url":"https://github.com/dkorolev/KnowSheet","homepage":null,"size":174,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"KnowSheet:master","ref":"master","sha":"16b93e6afaeb431cefc2c64630b5210c9ba4d2dd","user":{"login":"KnowSheet","id":9897562,"avatar_url":"https://avatars.githubusercontent.com/u/9897562?v=3","gravatar_id":"","url":"https://api.github.com/users/KnowSheet","html_url":"https://github.com/KnowSheet","followers_url":"https://api.github.com/users/KnowSheet/followers","following_url":"https://api.github.com/users/KnowSheet/following{/other_user}","gists_url":"https://api.github.com/users/KnowSheet/gists{/gist_id}","starred_url":"https://api.github.com/users/KnowSheet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KnowSheet/subscriptions","organizations_url":"https://api.github.com/users/KnowSheet/orgs","repos_url":"https://api.github.com/users/KnowSheet/repos","events_url":"https://api.github.com/users/KnowSheet/events{/privacy}","received_events_url":"https://api.github.com/users/KnowSheet/received_events","type":"Organization","site_admin":false},"repo":{"id":29337892,"name":"KnowSheet","full_name":"KnowSheet/KnowSheet","owner":{"login":"KnowSheet","id":9897562,"avatar_url":"https://avatars.githubusercontent.com/u/9897562?v=3","gravatar_id":"","url":"https://api.github.com/users/KnowSheet","html_url":"https://github.com/KnowSheet","followers_url":"https://api.github.com/users/KnowSheet/followers","following_url":"https://api.github.com/users/KnowSheet/following{/other_user}","gists_url":"https://api.github.com/users/KnowSheet/gists{/gist_id}","starred_url":"https://api.github.com/users/KnowSheet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KnowSheet/subscriptions","organizations_url":"https://api.github.com/users/KnowSheet/orgs","repos_url":"https://api.github.com/users/KnowSheet/repos","events_url":"https://api.github.com/users/KnowSheet/events{/privacy}","received_events_url":"https://api.github.com/users/KnowSheet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KnowSheet/KnowSheet","description":"Top-level KnowSheet repository.","fork":false,"url":"https://api.github.com/repos/KnowSheet/KnowSheet","forks_url":"https://api.github.com/repos/KnowSheet/KnowSheet/forks","keys_url":"https://api.github.com/repos/KnowSheet/KnowSheet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KnowSheet/KnowSheet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KnowSheet/KnowSheet/teams","hooks_url":"https://api.github.com/repos/KnowSheet/KnowSheet/hooks","issue_events_url":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/events{/number}","events_url":"https://api.github.com/repos/KnowSheet/KnowSheet/events","assignees_url":"https://api.github.com/repos/KnowSheet/KnowSheet/assignees{/user}","branches_url":"https://api.github.com/repos/KnowSheet/KnowSheet/branches{/branch}","tags_url":"https://api.github.com/repos/KnowSheet/KnowSheet/tags","blobs_url":"https://api.github.com/repos/KnowSheet/KnowSheet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KnowSheet/KnowSheet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KnowSheet/KnowSheet/git/refs{/sha}","trees_url":"https://api.github.com/repos/KnowSheet/KnowSheet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KnowSheet/KnowSheet/statuses/{sha}","languages_url":"https://api.github.com/repos/KnowSheet/KnowSheet/languages","stargazers_url":"https://api.github.com/repos/KnowSheet/KnowSheet/stargazers","contributors_url":"https://api.github.com/repos/KnowSheet/KnowSheet/contributors","subscribers_url":"https://api.github.com/repos/KnowSheet/KnowSheet/subscribers","subscription_url":"https://api.github.com/repos/KnowSheet/KnowSheet/subscription","commits_url":"https://api.github.com/repos/KnowSheet/KnowSheet/commits{/sha}","git_commits_url":"https://api.github.com/repos/KnowSheet/KnowSheet/git/commits{/sha}","comments_url":"https://api.github.com/repos/KnowSheet/KnowSheet/comments{/number}","issue_comment_url":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/comments/{number}","contents_url":"https://api.github.com/repos/KnowSheet/KnowSheet/contents/{+path}","compare_url":"https://api.github.com/repos/KnowSheet/KnowSheet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KnowSheet/KnowSheet/merges","archive_url":"https://api.github.com/repos/KnowSheet/KnowSheet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KnowSheet/KnowSheet/downloads","issues_url":"https://api.github.com/repos/KnowSheet/KnowSheet/issues{/number}","pulls_url":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls{/number}","milestones_url":"https://api.github.com/repos/KnowSheet/KnowSheet/milestones{/number}","notifications_url":"https://api.github.com/repos/KnowSheet/KnowSheet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KnowSheet/KnowSheet/labels{/name}","releases_url":"https://api.github.com/repos/KnowSheet/KnowSheet/releases{/id}","created_at":"2015-01-16T07:35:44Z","updated_at":"2015-02-15T04:24:27Z","pushed_at":"2015-02-15T04:24:24Z","git_url":"git://github.com/KnowSheet/KnowSheet.git","ssh_url":"git@github.com:KnowSheet/KnowSheet.git","clone_url":"https://github.com/KnowSheet/KnowSheet.git","svn_url":"https://github.com/KnowSheet/KnowSheet","homepage":null,"size":186,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8"},"html":{"href":"https://github.com/KnowSheet/KnowSheet/pull/8"},"issue":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/8"},"comments":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/KnowSheet/KnowSheet/statuses/96948a8763744364c3b1bc1204a4929d0ff7fa89"}}}}