{"action":"created","comment":{"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments/41205341","id":41205341,"diff_hunk":"@@ -1,3 +1,20 @@\n-//all code is currently in the .h file\n #include \"ale_c_wrapper.h\"\n \n+#include <cstring>\n+#include <string>\n+\n+void encodeState(ALEState *state, char *buf) {\n+\tstd::string str = state->serialize();\n+\n+\tmemcpy(buf, str.data(), str.length());","path":"ale_python_interface/ale_c_wrapper.cpp","position":10,"original_position":10,"commit_id":"a706ef74c95004bfe218065504c3703858bcfc22","original_commit_id":"a706ef74c95004bfe218065504c3703858bcfc22","user":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"body":"Ah, right. Can you also pass in the buffer size for safety, & throw an exception as needed?","created_at":"2015-10-05T22:20:24Z","updated_at":"2015-10-05T22:20:24Z","html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109#discussion_r41205341","pull_request_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments/41205341"},"html":{"href":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109#discussion_r41205341"},"pull_request":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109","id":46741698,"html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109","diff_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109.diff","patch_url":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109.patch","issue_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/109","number":109,"state":"open","locked":false,"title":"Serialization of ALEStates to strings","user":{"login":"Jragonmiris","id":3078382,"avatar_url":"https://avatars.githubusercontent.com/u/3078382?v=3","gravatar_id":"","url":"https://api.github.com/users/Jragonmiris","html_url":"https://github.com/Jragonmiris","followers_url":"https://api.github.com/users/Jragonmiris/followers","following_url":"https://api.github.com/users/Jragonmiris/following{/other_user}","gists_url":"https://api.github.com/users/Jragonmiris/gists{/gist_id}","starred_url":"https://api.github.com/users/Jragonmiris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jragonmiris/subscriptions","organizations_url":"https://api.github.com/users/Jragonmiris/orgs","repos_url":"https://api.github.com/users/Jragonmiris/repos","events_url":"https://api.github.com/users/Jragonmiris/events{/privacy}","received_events_url":"https://api.github.com/users/Jragonmiris/received_events","type":"User","site_admin":false},"body":"This is on top of the new head of dev after master was merged into it. It also addressed the comments made in #106 and #83, and uses the Stella serializer/deserializer which I didn't know existed.","created_at":"2015-10-05T03:20:12Z","updated_at":"2015-10-05T22:20:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"525b11f1ead00f88b8e654112d84f0abd04e2ba2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109/commits","review_comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109/comments","review_comment_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/109/comments","statuses_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/a706ef74c95004bfe218065504c3703858bcfc22","head":{"label":"Jragonmiris:state-serialize","ref":"state-serialize","sha":"a706ef74c95004bfe218065504c3703858bcfc22","user":{"login":"Jragonmiris","id":3078382,"avatar_url":"https://avatars.githubusercontent.com/u/3078382?v=3","gravatar_id":"","url":"https://api.github.com/users/Jragonmiris","html_url":"https://github.com/Jragonmiris","followers_url":"https://api.github.com/users/Jragonmiris/followers","following_url":"https://api.github.com/users/Jragonmiris/following{/other_user}","gists_url":"https://api.github.com/users/Jragonmiris/gists{/gist_id}","starred_url":"https://api.github.com/users/Jragonmiris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jragonmiris/subscriptions","organizations_url":"https://api.github.com/users/Jragonmiris/orgs","repos_url":"https://api.github.com/users/Jragonmiris/repos","events_url":"https://api.github.com/users/Jragonmiris/events{/privacy}","received_events_url":"https://api.github.com/users/Jragonmiris/received_events","type":"User","site_admin":false},"repo":{"id":43662313,"name":"Arcade-Learning-Environment","full_name":"Jragonmiris/Arcade-Learning-Environment","owner":{"login":"Jragonmiris","id":3078382,"avatar_url":"https://avatars.githubusercontent.com/u/3078382?v=3","gravatar_id":"","url":"https://api.github.com/users/Jragonmiris","html_url":"https://github.com/Jragonmiris","followers_url":"https://api.github.com/users/Jragonmiris/followers","following_url":"https://api.github.com/users/Jragonmiris/following{/other_user}","gists_url":"https://api.github.com/users/Jragonmiris/gists{/gist_id}","starred_url":"https://api.github.com/users/Jragonmiris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jragonmiris/subscriptions","organizations_url":"https://api.github.com/users/Jragonmiris/orgs","repos_url":"https://api.github.com/users/Jragonmiris/repos","events_url":"https://api.github.com/users/Jragonmiris/events{/privacy}","received_events_url":"https://api.github.com/users/Jragonmiris/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jragonmiris/Arcade-Learning-Environment","description":"The Arcade Learning Environment (ALE) -- a platform for AI research.","fork":true,"url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment","forks_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/forks","keys_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/events","assignees_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/merges","archive_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/Jragonmiris/Arcade-Learning-Environment/releases{/id}","created_at":"2015-10-05T02:46:33Z","updated_at":"2015-10-05T02:46:35Z","pushed_at":"2015-10-05T03:18:12Z","git_url":"git://github.com/Jragonmiris/Arcade-Learning-Environment.git","ssh_url":"git@github.com:Jragonmiris/Arcade-Learning-Environment.git","clone_url":"https://github.com/Jragonmiris/Arcade-Learning-Environment.git","svn_url":"https://github.com/Jragonmiris/Arcade-Learning-Environment","homepage":null,"size":5410,"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":"mgbellemare:dev","ref":"dev","sha":"e6c5beaec0223592b09ee1ade96c62774439aa31","user":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"repo":{"id":5816654,"name":"Arcade-Learning-Environment","full_name":"mgbellemare/Arcade-Learning-Environment","owner":{"login":"mgbellemare","id":2350286,"avatar_url":"https://avatars.githubusercontent.com/u/2350286?v=3","gravatar_id":"","url":"https://api.github.com/users/mgbellemare","html_url":"https://github.com/mgbellemare","followers_url":"https://api.github.com/users/mgbellemare/followers","following_url":"https://api.github.com/users/mgbellemare/following{/other_user}","gists_url":"https://api.github.com/users/mgbellemare/gists{/gist_id}","starred_url":"https://api.github.com/users/mgbellemare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgbellemare/subscriptions","organizations_url":"https://api.github.com/users/mgbellemare/orgs","repos_url":"https://api.github.com/users/mgbellemare/repos","events_url":"https://api.github.com/users/mgbellemare/events{/privacy}","received_events_url":"https://api.github.com/users/mgbellemare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","description":"The Arcade Learning Environment (ALE) -- a platform for AI research.","fork":false,"url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment","forks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/forks","keys_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/teams","hooks_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/hooks","issue_events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/events{/number}","events_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/events","assignees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/assignees{/user}","branches_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/branches{/branch}","tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/tags","blobs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/refs{/sha}","trees_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/{sha}","languages_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/languages","stargazers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/stargazers","contributors_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contributors","subscribers_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscribers","subscription_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/subscription","commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/commits{/sha}","git_commits_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/git/commits{/sha}","comments_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/comments{/number}","issue_comment_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/comments{/number}","contents_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/contents/{+path}","compare_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/merges","archive_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/downloads","issues_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues{/number}","pulls_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls{/number}","milestones_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/milestones{/number}","notifications_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/labels{/name}","releases_url":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/releases{/id}","created_at":"2012-09-15T01:42:13Z","updated_at":"2015-09-29T05:59:55Z","pushed_at":"2015-10-05T03:20:12Z","git_url":"git://github.com/mgbellemare/Arcade-Learning-Environment.git","ssh_url":"git@github.com:mgbellemare/Arcade-Learning-Environment.git","clone_url":"https://github.com/mgbellemare/Arcade-Learning-Environment.git","svn_url":"https://github.com/mgbellemare/Arcade-Learning-Environment","homepage":null,"size":5410,"stargazers_count":82,"watchers_count":82,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":16,"forks":44,"open_issues":16,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109"},"html":{"href":"https://github.com/mgbellemare/Arcade-Learning-Environment/pull/109"},"issue":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/109"},"comments":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/mgbellemare/Arcade-Learning-Environment/statuses/a706ef74c95004bfe218065504c3703858bcfc22"}}}}