{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/comments/65352601","id":65352601,"diff_hunk":"@@ -0,0 +1,181 @@\n+/*******************************************************************************\n+ The MIT License (MIT)\n+\n+ Copyright (c) 2015 Maps.Me\n+\n+ Permission is hereby granted, free of charge, to any person obtaining a copy\n+ of this software and associated documentation files (the \"Software\"), to deal\n+ in the Software without restriction, including without limitation the rights\n+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ copies of the Software, and to permit persons to whom the Software is\n+ furnished to do so, subject to the following conditions:\n+\n+ The above copyright notice and this permission notice shall be included in all\n+ copies or substantial portions of the Software.\n+\n+ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ SOFTWARE.\n+ *******************************************************************************/\n+\n+// This define is needed to preserve client's timestamps in events.\n+#define ALOHALYTICS_SERVER\n+#include \"../../src/event_base.h\"\n+#include \"../../../include/processor.h\" // TODO: This is actually not from Alohalytics repo\n+\n+#include <algorithm>\n+#include <iostream>\n+#include <string>\n+#include <set>\n+\n+#define DLLEXPORT extern \"C\"\n+\n+// Public struct used in Python\n+struct UserInfo\n+{\n+  char os_t;\n+  float lat;\n+  float lon;\n+  char raw_uid[32];\n+};\n+\n+// Public struct used in Python\n+struct EventTime\n+{\n+  uint64_t client_created;\n+  uint64_t server_upload;\n+};\n+\n+typedef void (*callbackFunction)(char const *, EventTime const &, UserInfo const &, char const **, int);\n+\n+// Helper function that convert KeyPairs event into list of (key, value) for use in Python\n+void SetPairs(AlohalyticsKeyPairsEvent const * event, std::vector<char const *> & pairs)\n+{\n+  int i = 0;\n+  for (std::pair<std::string, std::string> const & kp : event->pairs)\n+  {\n+    pairs[i++] = kp.first.c_str();\n+    pairs[i++] = kp.second.c_str();\n+  }\n+}\n+\n+// Helper function for setting up geo coords","path":"snippets/c_api/iterate_events.cc","position":66,"original_position":66,"commit_id":"e42ba1c8b6bad6ee7f9c3e4d0d8423e15c998833","original_commit_id":"e42ba1c8b6bad6ee7f9c3e4d0d8423e15c998833","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"Dot at the end of expression, please.","created_at":"2016-06-01T12:43:50Z","updated_at":"2016-06-01T12:43:50Z","html_url":"https://github.com/mapsme/Alohalytics/pull/12#discussion_r65352601","pull_request_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/comments/65352601"},"html":{"href":"https://github.com/mapsme/Alohalytics/pull/12#discussion_r65352601"},"pull_request":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12","id":72165895,"html_url":"https://github.com/mapsme/Alohalytics/pull/12","diff_url":"https://github.com/mapsme/Alohalytics/pull/12.diff","patch_url":"https://github.com/mapsme/Alohalytics/pull/12.patch","issue_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/12","number":12,"state":"open","locked":false,"title":"Python-powered scripting system added","user":{"login":"burivuh","id":2204417,"avatar_url":"https://avatars.githubusercontent.com/u/2204417?v=3","gravatar_id":"","url":"https://api.github.com/users/burivuh","html_url":"https://github.com/burivuh","followers_url":"https://api.github.com/users/burivuh/followers","following_url":"https://api.github.com/users/burivuh/following{/other_user}","gists_url":"https://api.github.com/users/burivuh/gists{/gist_id}","starred_url":"https://api.github.com/users/burivuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burivuh/subscriptions","organizations_url":"https://api.github.com/users/burivuh/orgs","repos_url":"https://api.github.com/users/burivuh/repos","events_url":"https://api.github.com/users/burivuh/events{/privacy}","received_events_url":"https://api.github.com/users/burivuh/received_events","type":"User","site_admin":false},"body":"There are three parts:\r\n1) C module with a loop function based on Processor class\r\n2) Python framework named pyaloha\r\n3) Example script in examples directory","created_at":"2016-06-01T11:41:34Z","updated_at":"2016-06-01T12:43:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"192e178ba240b4e43013a6caf1111b7dff20142b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12/commits","review_comments_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12/comments","review_comment_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/12/comments","statuses_url":"https://api.github.com/repos/mapsme/Alohalytics/statuses/e42ba1c8b6bad6ee7f9c3e4d0d8423e15c998833","head":{"label":"mapsme:python-api","ref":"python-api","sha":"e42ba1c8b6bad6ee7f9c3e4d0d8423e15c998833","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":44220892,"name":"Alohalytics","full_name":"mapsme/Alohalytics","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/Alohalytics","description":"","fork":true,"url":"https://api.github.com/repos/mapsme/Alohalytics","forks_url":"https://api.github.com/repos/mapsme/Alohalytics/forks","keys_url":"https://api.github.com/repos/mapsme/Alohalytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/Alohalytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/Alohalytics/teams","hooks_url":"https://api.github.com/repos/mapsme/Alohalytics/hooks","issue_events_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/Alohalytics/events","assignees_url":"https://api.github.com/repos/mapsme/Alohalytics/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/Alohalytics/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/Alohalytics/tags","blobs_url":"https://api.github.com/repos/mapsme/Alohalytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/Alohalytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/Alohalytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/Alohalytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/Alohalytics/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/Alohalytics/languages","stargazers_url":"https://api.github.com/repos/mapsme/Alohalytics/stargazers","contributors_url":"https://api.github.com/repos/mapsme/Alohalytics/contributors","subscribers_url":"https://api.github.com/repos/mapsme/Alohalytics/subscribers","subscription_url":"https://api.github.com/repos/mapsme/Alohalytics/subscription","commits_url":"https://api.github.com/repos/mapsme/Alohalytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/Alohalytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/Alohalytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/Alohalytics/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/Alohalytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/Alohalytics/merges","archive_url":"https://api.github.com/repos/mapsme/Alohalytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/Alohalytics/downloads","issues_url":"https://api.github.com/repos/mapsme/Alohalytics/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/Alohalytics/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/Alohalytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/Alohalytics/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/Alohalytics/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/Alohalytics/deployments","created_at":"2015-10-14T03:11:06Z","updated_at":"2016-01-22T12:36:52Z","pushed_at":"2016-06-01T11:41:34Z","git_url":"git://github.com/mapsme/Alohalytics.git","ssh_url":"git@github.com:mapsme/Alohalytics.git","clone_url":"https://github.com/mapsme/Alohalytics.git","svn_url":"https://github.com/mapsme/Alohalytics","homepage":null,"size":1591,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"5c46d5b4c7fc6f24fa01076be1ce55a824a2b5e8","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":44220892,"name":"Alohalytics","full_name":"mapsme/Alohalytics","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/Alohalytics","description":"","fork":true,"url":"https://api.github.com/repos/mapsme/Alohalytics","forks_url":"https://api.github.com/repos/mapsme/Alohalytics/forks","keys_url":"https://api.github.com/repos/mapsme/Alohalytics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/Alohalytics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/Alohalytics/teams","hooks_url":"https://api.github.com/repos/mapsme/Alohalytics/hooks","issue_events_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/Alohalytics/events","assignees_url":"https://api.github.com/repos/mapsme/Alohalytics/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/Alohalytics/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/Alohalytics/tags","blobs_url":"https://api.github.com/repos/mapsme/Alohalytics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/Alohalytics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/Alohalytics/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/Alohalytics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/Alohalytics/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/Alohalytics/languages","stargazers_url":"https://api.github.com/repos/mapsme/Alohalytics/stargazers","contributors_url":"https://api.github.com/repos/mapsme/Alohalytics/contributors","subscribers_url":"https://api.github.com/repos/mapsme/Alohalytics/subscribers","subscription_url":"https://api.github.com/repos/mapsme/Alohalytics/subscription","commits_url":"https://api.github.com/repos/mapsme/Alohalytics/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/Alohalytics/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/Alohalytics/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/Alohalytics/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/Alohalytics/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/Alohalytics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/Alohalytics/merges","archive_url":"https://api.github.com/repos/mapsme/Alohalytics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/Alohalytics/downloads","issues_url":"https://api.github.com/repos/mapsme/Alohalytics/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/Alohalytics/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/Alohalytics/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/Alohalytics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/Alohalytics/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/Alohalytics/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/Alohalytics/deployments","created_at":"2015-10-14T03:11:06Z","updated_at":"2016-01-22T12:36:52Z","pushed_at":"2016-06-01T11:41:34Z","git_url":"git://github.com/mapsme/Alohalytics.git","ssh_url":"git@github.com:mapsme/Alohalytics.git","clone_url":"https://github.com/mapsme/Alohalytics.git","svn_url":"https://github.com/mapsme/Alohalytics","homepage":null,"size":1591,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12"},"html":{"href":"https://github.com/mapsme/Alohalytics/pull/12"},"issue":{"href":"https://api.github.com/repos/mapsme/Alohalytics/issues/12"},"comments":{"href":"https://api.github.com/repos/mapsme/Alohalytics/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/Alohalytics/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/Alohalytics/statuses/e42ba1c8b6bad6ee7f9c3e4d0d8423e15c998833"}}}}
{"actor":{"display_login":"ygorshenin"}}