GitHub PullRequestReviewCommentEvent at 2014-10-11 16:59:19
Repository: 03_Queue_Lab
Actor: brinkmwj
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/comments/18742632","id":18742632,"diff_hunk":"@@ -53,4 +53,92 @@ class ArrayQueue : public Queue <T> {\n  * source code for the whole class.\n  *\n  **/\n-#include \"ArrayQueue.ipp\"\n+\n+\n+\n+//#include \"ArrayQueue.ipp\"\n+//This is the code for the \"ArrayQueue.ipp\" file and that file is now emtpy\n+//You SHOULD change this part of the file and THIS PART OF THE FILE ONLY\n+\n+//You will need this so you can make a string to throw in\n+// remove\n+#include <string>\n+\n+//Syntax note: This uses the pre-processor to create a constant\n+// You could also use \"const static\" to make a constant, as in Java.\n+// Notice, however, that START_SIZE is NOT a variable! Instead, any\n+// place that the pre-processor sees \"START_SIZE\" it will replace it with\n+// 10 ... so this is like a global \"find and replace\".\n+#define START_SIZE 10\n+\n+//Syntax note: C++ is not very good at figuring out which methods belong\n+// to which classes. That is why we have to use the scope operator to\n+// tell the compiler that this ArrayQueue() method belongs to the\n+// ArrayQueue<T> class.\n+template <class T>\n+ArrayQueue<T>::ArrayQueue(){\n+\tnumItems = 0;\n+\tfront = 0;\n+\tbackingArray = new T[numItems];\n+\tbackingArraySize = START_SIZE;\n+\n+}\n+\n+template <class T>\n+ArrayQueue<T>::~ArrayQueue() {\n+\t//cleanup after yourself\n+\tdelete[] backingArray;\n+\t//backingArray = NULL;\n+}\n+\n+template <class T>\n+void ArrayQueue<T>::add(T toAdd){\n+\tif (backingArraySize == numItems) {\n+\t\tgrow();\n+\t\t\n+\t\tunsigned long i = 0;\n+\t\twhile (i < front) {\n+\t\t\tbackingArray[backingArraySize + i] = backingArray[i];\n+\t\t\ti++;\n+\t\t}\n+\t} \n+\n+\tbackingArray[(front + numItems) % backingArraySize] = toAdd;\n+\n+\tnumItems++;\n+\n+}\n+\n+template <class T>\n+T ArrayQueue<T>::remove(){\n+\tif(numItems < 1) {\n+\t  //bad news!\n+\t  throw std::string(\"Queue is already empty, attempted to remove.\");\n+\t  }\n+\n+\t  numItems--;\n+\n+\t  T retVal = backingArray[front];\n+\t  backingArray[front] = 0;\n+\n+\t  front = (front + 1) % backingArraySize;\n+  \n+\treturn retVal;\n+}\n+\n+template <class T>\n+unsigned long ArrayQueue<T>::getNumItems(){\n+\treturn numItems;\n+}\n+\n+template <class T>\n+void ArrayQueue<T>::grow(){ //double the length of the array\n+\tT* oldBackingArray = backingArray;\n+\tbackingArraySize *= 2;\n+\tbackingArray = new T[backingArraySize];\n+\tfor (unsigned int i = 0; i < backingArraySize/2; i++) {\n+\t\tbackingArray[i] = oldBackingArray[i];","path":"ArrayQueue.h","position":102,"original_position":102,"commit_id":"5e3237f4e983ff2b6ebc97069dde516fbde78c69","original_commit_id":"5e3237f4e983ff2b6ebc97069dde516fbde78c69","user":{"login":"brinkmwj","id":591376,"avatar_url":"https://avatars.githubusercontent.com/u/591376?v=2","gravatar_id":"","url":"https://api.github.com/users/brinkmwj","html_url":"https://github.com/brinkmwj","followers_url":"https://api.github.com/users/brinkmwj/followers","following_url":"https://api.github.com/users/brinkmwj/following{/other_user}","gists_url":"https://api.github.com/users/brinkmwj/gists{/gist_id}","starred_url":"https://api.github.com/users/brinkmwj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brinkmwj/subscriptions","organizations_url":"https://api.github.com/users/brinkmwj/orgs","repos_url":"https://api.github.com/users/brinkmwj/repos","events_url":"https://api.github.com/users/brinkmwj/events{/privacy}","received_events_url":"https://api.github.com/users/brinkmwj/received_events","type":"User","site_admin":false},"body":"Do\r\nbackingArray[i] = oldBackingArray[(i+front)%backingArraySize]\r\nThis will let you get rid of the extra loop you have in add()","created_at":"2014-10-11T16:59:19Z","updated_at":"2014-10-11T16:59:19Z","html_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61#discussion_r18742632","pull_request_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/comments/18742632"},"html":{"href":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61#discussion_r18742632"},"pull_request":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61","id":21476770,"html_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61","diff_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61.diff","patch_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61.patch","issue_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/61","number":61,"state":"open","locked":false,"title":"Kristen Mesler Pull Request","user":{"login":"meslerke","id":8559034,"avatar_url":"https://avatars.githubusercontent.com/u/8559034?v=2","gravatar_id":"","url":"https://api.github.com/users/meslerke","html_url":"https://github.com/meslerke","followers_url":"https://api.github.com/users/meslerke/followers","following_url":"https://api.github.com/users/meslerke/following{/other_user}","gists_url":"https://api.github.com/users/meslerke/gists{/gist_id}","starred_url":"https://api.github.com/users/meslerke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meslerke/subscriptions","organizations_url":"https://api.github.com/users/meslerke/orgs","repos_url":"https://api.github.com/users/meslerke/repos","events_url":"https://api.github.com/users/meslerke/events{/privacy}","received_events_url":"https://api.github.com/users/meslerke/received_events","type":"User","site_admin":false},"body":"I think that the 'front' variable is still set from using the second tester method and it is affecting the second to last tester method. I couldn't figure out a way to fix this issue but is does run to a certain point. It will give the print statements and and error will pop up. You can close the error and still look at my output to all of the methods except for the last two.","created_at":"2014-09-19T03:56:46Z","updated_at":"2014-10-11T16:59:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e13cfb97adef7579266a7388bcacc442a4d8e8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61/commits","review_comments_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61/comments","review_comment_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/comments/{number}","comments_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/61/comments","statuses_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/statuses/5e3237f4e983ff2b6ebc97069dde516fbde78c69","head":{"label":"meslerke:master","ref":"master","sha":"5e3237f4e983ff2b6ebc97069dde516fbde78c69","user":{"login":"meslerke","id":8559034,"avatar_url":"https://avatars.githubusercontent.com/u/8559034?v=2","gravatar_id":"","url":"https://api.github.com/users/meslerke","html_url":"https://github.com/meslerke","followers_url":"https://api.github.com/users/meslerke/followers","following_url":"https://api.github.com/users/meslerke/following{/other_user}","gists_url":"https://api.github.com/users/meslerke/gists{/gist_id}","starred_url":"https://api.github.com/users/meslerke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meslerke/subscriptions","organizations_url":"https://api.github.com/users/meslerke/orgs","repos_url":"https://api.github.com/users/meslerke/repos","events_url":"https://api.github.com/users/meslerke/events{/privacy}","received_events_url":"https://api.github.com/users/meslerke/received_events","type":"User","site_admin":false},"repo":{"id":24105555,"name":"03_Queue_Lab","full_name":"meslerke/03_Queue_Lab","owner":{"login":"meslerke","id":8559034,"avatar_url":"https://avatars.githubusercontent.com/u/8559034?v=2","gravatar_id":"","url":"https://api.github.com/users/meslerke","html_url":"https://github.com/meslerke","followers_url":"https://api.github.com/users/meslerke/followers","following_url":"https://api.github.com/users/meslerke/following{/other_user}","gists_url":"https://api.github.com/users/meslerke/gists{/gist_id}","starred_url":"https://api.github.com/users/meslerke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meslerke/subscriptions","organizations_url":"https://api.github.com/users/meslerke/orgs","repos_url":"https://api.github.com/users/meslerke/repos","events_url":"https://api.github.com/users/meslerke/events{/privacy}","received_events_url":"https://api.github.com/users/meslerke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/meslerke/03_Queue_Lab","description":"Implement an array-based queue in C++","fork":true,"url":"https://api.github.com/repos/meslerke/03_Queue_Lab","forks_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/forks","keys_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/teams","hooks_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/hooks","issue_events_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/issues/events{/number}","events_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/events","assignees_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/assignees{/user}","branches_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/branches{/branch}","tags_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/tags","blobs_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/statuses/{sha}","languages_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/languages","stargazers_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/stargazers","contributors_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/contributors","subscribers_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/subscribers","subscription_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/subscription","commits_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/issues/comments/{number}","contents_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/contents/{+path}","compare_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/merges","archive_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/downloads","issues_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/issues{/number}","pulls_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/pulls{/number}","milestones_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/milestones{/number}","notifications_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/labels{/name}","releases_url":"https://api.github.com/repos/meslerke/03_Queue_Lab/releases{/id}","created_at":"2014-09-16T15:31:45Z","updated_at":"2014-09-18T21:29:03Z","pushed_at":"2014-10-07T09:03:36Z","git_url":"git://github.com/meslerke/03_Queue_Lab.git","ssh_url":"git@github.com:meslerke/03_Queue_Lab.git","clone_url":"https://github.com/meslerke/03_Queue_Lab.git","svn_url":"https://github.com/meslerke/03_Queue_Lab","homepage":null,"size":6273,"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":"MiamiOH-CSE274:master","ref":"master","sha":"55e752a14ebc8209353d4dd693af7bddc9b193f2","user":{"login":"MiamiOH-CSE274","id":1835517,"avatar_url":"https://avatars.githubusercontent.com/u/1835517?v=2","gravatar_id":"","url":"https://api.github.com/users/MiamiOH-CSE274","html_url":"https://github.com/MiamiOH-CSE274","followers_url":"https://api.github.com/users/MiamiOH-CSE274/followers","following_url":"https://api.github.com/users/MiamiOH-CSE274/following{/other_user}","gists_url":"https://api.github.com/users/MiamiOH-CSE274/gists{/gist_id}","starred_url":"https://api.github.com/users/MiamiOH-CSE274/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiamiOH-CSE274/subscriptions","organizations_url":"https://api.github.com/users/MiamiOH-CSE274/orgs","repos_url":"https://api.github.com/users/MiamiOH-CSE274/repos","events_url":"https://api.github.com/users/MiamiOH-CSE274/events{/privacy}","received_events_url":"https://api.github.com/users/MiamiOH-CSE274/received_events","type":"Organization","site_admin":false},"repo":{"id":10972340,"name":"03_Queue_Lab","full_name":"MiamiOH-CSE274/03_Queue_Lab","owner":{"login":"MiamiOH-CSE274","id":1835517,"avatar_url":"https://avatars.githubusercontent.com/u/1835517?v=2","gravatar_id":"","url":"https://api.github.com/users/MiamiOH-CSE274","html_url":"https://github.com/MiamiOH-CSE274","followers_url":"https://api.github.com/users/MiamiOH-CSE274/followers","following_url":"https://api.github.com/users/MiamiOH-CSE274/following{/other_user}","gists_url":"https://api.github.com/users/MiamiOH-CSE274/gists{/gist_id}","starred_url":"https://api.github.com/users/MiamiOH-CSE274/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MiamiOH-CSE274/subscriptions","organizations_url":"https://api.github.com/users/MiamiOH-CSE274/orgs","repos_url":"https://api.github.com/users/MiamiOH-CSE274/repos","events_url":"https://api.github.com/users/MiamiOH-CSE274/events{/privacy}","received_events_url":"https://api.github.com/users/MiamiOH-CSE274/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab","description":"Implement an array-based queue in C++","fork":false,"url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab","forks_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/forks","keys_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/teams","hooks_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/hooks","issue_events_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/events{/number}","events_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/events","assignees_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/assignees{/user}","branches_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/branches{/branch}","tags_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/tags","blobs_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/git/refs{/sha}","trees_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/statuses/{sha}","languages_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/languages","stargazers_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/stargazers","contributors_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/contributors","subscribers_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/subscribers","subscription_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/subscription","commits_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/commits{/sha}","git_commits_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/git/commits{/sha}","comments_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/comments{/number}","issue_comment_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/comments/{number}","contents_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/contents/{+path}","compare_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/merges","archive_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/downloads","issues_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues{/number}","pulls_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls{/number}","milestones_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/milestones{/number}","notifications_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/labels{/name}","releases_url":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/releases{/id}","created_at":"2013-06-26T15:56:36Z","updated_at":"2013-12-17T16:01:27Z","pushed_at":"2013-12-11T13:10:14Z","git_url":"git://github.com/MiamiOH-CSE274/03_Queue_Lab.git","ssh_url":"git@github.com:MiamiOH-CSE274/03_Queue_Lab.git","clone_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab.git","svn_url":"https://github.com/MiamiOH-CSE274/03_Queue_Lab","homepage":null,"size":6484,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":20,"forks":47,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61"},"html":{"href":"https://github.com/MiamiOH-CSE274/03_Queue_Lab/pull/61"},"issue":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/61"},"comments":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/MiamiOH-CSE274/03_Queue_Lab/statuses/5e3237f4e983ff2b6ebc97069dde516fbde78c69"}}}}