{"action":"created","comment":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/45367812","id":45367812,"diff_hunk":"@@ -80,3 +103,4 @@ def randcolor():\n             # SUBPROBLEM 3: sort objects by location.  Be sure to update the\n             # grid if objects' indices change!  Also be sure to sort the\n             # velocities with their object positions!\n+            # at first, we create a","path":"HW2/P5/driver.py","position":43,"original_position":43,"commit_id":"b78bd8382939b5e00f973604c83498ffba6b31d0","original_commit_id":"b78bd8382939b5e00f973604c83498ffba6b31d0","user":{"login":"xdai1091","id":14097973,"avatar_url":"https://avatars.githubusercontent.com/u/14097973?v=3","gravatar_id":"","url":"https://api.github.com/users/xdai1091","html_url":"https://github.com/xdai1091","followers_url":"https://api.github.com/users/xdai1091/followers","following_url":"https://api.github.com/users/xdai1091/following{/other_user}","gists_url":"https://api.github.com/users/xdai1091/gists{/gist_id}","starred_url":"https://api.github.com/users/xdai1091/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdai1091/subscriptions","organizations_url":"https://api.github.com/users/xdai1091/orgs","repos_url":"https://api.github.com/users/xdai1091/repos","events_url":"https://api.github.com/users/xdai1091/events{/privacy}","received_events_url":"https://api.github.com/users/xdai1091/received_events","type":"User","site_admin":false},"body":"OMG, I must have been too excited when I made the pull request... and I accidentally deleted my sorting part..Jesus..I pasted my code here, so I hope our grader could go to my P5.driver commit and looked for the second last commit, you will find this code.. I am sorry for my stupidity \r\n# SUBPROBLEM 3: sort objects by location.  Be sure to update the\r\n             # grid if objects' indices change!  Also be sure to sort the\r\n             # velocities with their object positions!\r\n             # at first, we create a grid loc\r\n             grid_loc = (positions/grid_spacing).astype(int)\r\n             morton = map(lambda a,b: cmp_zorder(a,b), grid_loc, np.array(list(grid_loc[1:])+list(grid_loc[:1])))\r\n             grid[:] = -1\r\n             grid_index = np.argsort(morton)\r\n             velocities, positions= velocities[grid_index], positions[grid_index]\r\n \r\n             #let's update our grid values\r\n             for i in range(num_balls):\r\n                 if (positions[i,0] >= 0) and (positions[i,1] >= 0) and (positions[i,0] <= grid_size) and (positions[i,1] <= grid_size):\r\n                     grid[(positions[i,0] / grid_spacing).astype(int),\r\n-                         (positions[i,1] / grid_spacing).astype(int)] = i\r\n-\r\n-\r\n-\r\n+                         (positions[i,1] / grid_spacing).astype(int)] = i \r\n","created_at":"2015-11-19T16:57:03Z","updated_at":"2015-11-19T16:57:03Z","html_url":"https://github.com/harvard-cs205/cs205-homework/pull/348#discussion_r45367812","pull_request_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348","_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments/45367812"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/348#discussion_r45367812"},"pull_request":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348"}}},"pull_request":{"url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348","id":49775538,"html_url":"https://github.com/harvard-cs205/cs205-homework/pull/348","diff_url":"https://github.com/harvard-cs205/cs205-homework/pull/348.diff","patch_url":"https://github.com/harvard-cs205/cs205-homework/pull/348.patch","issue_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/348","number":348,"state":"open","locked":false,"title":"HW2-YEAH","user":{"login":"xdai1091","id":14097973,"avatar_url":"https://avatars.githubusercontent.com/u/14097973?v=3","gravatar_id":"","url":"https://api.github.com/users/xdai1091","html_url":"https://github.com/xdai1091","followers_url":"https://api.github.com/users/xdai1091/followers","following_url":"https://api.github.com/users/xdai1091/following{/other_user}","gists_url":"https://api.github.com/users/xdai1091/gists{/gist_id}","starred_url":"https://api.github.com/users/xdai1091/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdai1091/subscriptions","organizations_url":"https://api.github.com/users/xdai1091/orgs","repos_url":"https://api.github.com/users/xdai1091/repos","events_url":"https://api.github.com/users/xdai1091/events{/privacy}","received_events_url":"https://api.github.com/users/xdai1091/received_events","type":"User","site_admin":false},"body":"Only one more left  :)","created_at":"2015-11-05T02:36:09Z","updated_at":"2015-11-19T16:57:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dde9f47dbd95ca3d23ba3f499dd3d7e5ec38d87f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348/commits","review_comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348/comments","review_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/348/comments","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/b78bd8382939b5e00f973604c83498ffba6b31d0","head":{"label":"xdai1091:HW2","ref":"HW2","sha":"b78bd8382939b5e00f973604c83498ffba6b31d0","user":{"login":"xdai1091","id":14097973,"avatar_url":"https://avatars.githubusercontent.com/u/14097973?v=3","gravatar_id":"","url":"https://api.github.com/users/xdai1091","html_url":"https://github.com/xdai1091","followers_url":"https://api.github.com/users/xdai1091/followers","following_url":"https://api.github.com/users/xdai1091/following{/other_user}","gists_url":"https://api.github.com/users/xdai1091/gists{/gist_id}","starred_url":"https://api.github.com/users/xdai1091/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdai1091/subscriptions","organizations_url":"https://api.github.com/users/xdai1091/orgs","repos_url":"https://api.github.com/users/xdai1091/repos","events_url":"https://api.github.com/users/xdai1091/events{/privacy}","received_events_url":"https://api.github.com/users/xdai1091/received_events","type":"User","site_admin":false},"repo":{"id":41871216,"name":"cs205-homework","full_name":"xdai1091/cs205-homework","owner":{"login":"xdai1091","id":14097973,"avatar_url":"https://avatars.githubusercontent.com/u/14097973?v=3","gravatar_id":"","url":"https://api.github.com/users/xdai1091","html_url":"https://github.com/xdai1091","followers_url":"https://api.github.com/users/xdai1091/followers","following_url":"https://api.github.com/users/xdai1091/following{/other_user}","gists_url":"https://api.github.com/users/xdai1091/gists{/gist_id}","starred_url":"https://api.github.com/users/xdai1091/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xdai1091/subscriptions","organizations_url":"https://api.github.com/users/xdai1091/orgs","repos_url":"https://api.github.com/users/xdai1091/repos","events_url":"https://api.github.com/users/xdai1091/events{/privacy}","received_events_url":"https://api.github.com/users/xdai1091/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xdai1091/cs205-homework","description":"","fork":true,"url":"https://api.github.com/repos/xdai1091/cs205-homework","forks_url":"https://api.github.com/repos/xdai1091/cs205-homework/forks","keys_url":"https://api.github.com/repos/xdai1091/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xdai1091/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xdai1091/cs205-homework/teams","hooks_url":"https://api.github.com/repos/xdai1091/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/xdai1091/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/xdai1091/cs205-homework/events","assignees_url":"https://api.github.com/repos/xdai1091/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/xdai1091/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/xdai1091/cs205-homework/tags","blobs_url":"https://api.github.com/repos/xdai1091/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xdai1091/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xdai1091/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/xdai1091/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xdai1091/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/xdai1091/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/xdai1091/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/xdai1091/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/xdai1091/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/xdai1091/cs205-homework/subscription","commits_url":"https://api.github.com/repos/xdai1091/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/xdai1091/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/xdai1091/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/xdai1091/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/xdai1091/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/xdai1091/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xdai1091/cs205-homework/merges","archive_url":"https://api.github.com/repos/xdai1091/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xdai1091/cs205-homework/downloads","issues_url":"https://api.github.com/repos/xdai1091/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/xdai1091/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/xdai1091/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/xdai1091/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xdai1091/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/xdai1091/cs205-homework/releases{/id}","created_at":"2015-09-03T16:38:24Z","updated_at":"2015-09-03T16:38:24Z","pushed_at":"2015-11-05T02:46:00Z","git_url":"git://github.com/xdai1091/cs205-homework.git","ssh_url":"git@github.com:xdai1091/cs205-homework.git","clone_url":"https://github.com/xdai1091/cs205-homework.git","svn_url":"https://github.com/xdai1091/cs205-homework","homepage":null,"size":2926,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"harvard-cs205:master","ref":"master","sha":"ed6f0167fd1f6097ce9e454c2950c5db00a0c513","user":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"repo":{"id":40614104,"name":"cs205-homework","full_name":"harvard-cs205/cs205-homework","owner":{"login":"harvard-cs205","id":13456002,"avatar_url":"https://avatars.githubusercontent.com/u/13456002?v=3","gravatar_id":"","url":"https://api.github.com/users/harvard-cs205","html_url":"https://github.com/harvard-cs205","followers_url":"https://api.github.com/users/harvard-cs205/followers","following_url":"https://api.github.com/users/harvard-cs205/following{/other_user}","gists_url":"https://api.github.com/users/harvard-cs205/gists{/gist_id}","starred_url":"https://api.github.com/users/harvard-cs205/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harvard-cs205/subscriptions","organizations_url":"https://api.github.com/users/harvard-cs205/orgs","repos_url":"https://api.github.com/users/harvard-cs205/repos","events_url":"https://api.github.com/users/harvard-cs205/events{/privacy}","received_events_url":"https://api.github.com/users/harvard-cs205/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/harvard-cs205/cs205-homework","description":"","fork":false,"url":"https://api.github.com/repos/harvard-cs205/cs205-homework","forks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/forks","keys_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/teams","hooks_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/hooks","issue_events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/events{/number}","events_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/events","assignees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/assignees{/user}","branches_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/branches{/branch}","tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/tags","blobs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/refs{/sha}","trees_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/{sha}","languages_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/languages","stargazers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/stargazers","contributors_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contributors","subscribers_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscribers","subscription_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/subscription","commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/commits{/sha}","git_commits_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/git/commits{/sha}","comments_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/comments{/number}","issue_comment_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/comments{/number}","contents_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/contents/{+path}","compare_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/merges","archive_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/downloads","issues_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues{/number}","pulls_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls{/number}","milestones_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/milestones{/number}","notifications_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/labels{/name}","releases_url":"https://api.github.com/repos/harvard-cs205/cs205-homework/releases{/id}","created_at":"2015-08-12T17:18:15Z","updated_at":"2015-10-21T19:21:28Z","pushed_at":"2015-11-19T05:31:25Z","git_url":"git://github.com/harvard-cs205/cs205-homework.git","ssh_url":"git@github.com:harvard-cs205/cs205-homework.git","clone_url":"https://github.com/harvard-cs205/cs205-homework.git","svn_url":"https://github.com/harvard-cs205/cs205-homework","homepage":null,"size":162893,"stargazers_count":5,"watchers_count":5,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":99,"mirror_url":null,"open_issues_count":380,"forks":99,"open_issues":380,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348"},"html":{"href":"https://github.com/harvard-cs205/cs205-homework/pull/348"},"issue":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/348"},"comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/harvard-cs205/cs205-homework/statuses/b78bd8382939b5e00f973604c83498ffba6b31d0"}}}}