GitHub PullRequestReviewCommentEvent at 2014-09-17 07:45:16
Repository: practice-scala
Actor: ellenfkh
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/comments/17649984","id":17649984,"diff_hunk":"@@ -28,56 +28,71 @@ object RecursionPatternMatchingExercise {\n    * checkValuesIncrease(Seq(1,2,3)) == true\n    * checkValuesIncrease(Seq(1,2,2)) == false\n    */\n-  def checkValuesIncrease(seq: Seq[Int]): Boolean = {\n-    error(\"fix me\")\n+  def checkValuesIncrease(seq: Seq[Int]): Boolean = seq match {\n+    case s if 1 >= s.length => true\n+    case s if s(0) >= s(1) => false\n+    case s if s(0) < s(1) => checkValuesIncrease(s.tail)\n   }\n   \n   /**\n    * Group Consecutive values\n    * List(1,1,2,3,1,1) -> List(1,1), List(2), List(3), List(1,1)\n    */\n-  def groupConsecutive[T](in: List[T]): List[List[T]] = {\n-    error(\"fix me\")\n+  def groupConsecutive[T](in: List[T]): List[List[T]] = getNextGroup(in, List()) match {\n+    case List() => List()\n+    case group => group +: groupConsecutive(in.slice(group.length, in.length))\n   }\n+  def getNextGroup[T](l: List[T], acc: List[T]): List[T] = l match {\n+    case a :: rest if acc.isEmpty => getNextGroup(rest, List(a))\n+    case a :: rest if acc(0) == a => getNextGroup(rest, a +: acc)\n+    case _ => acc\n+  } \n \n   /**\n    * Group Equal values\n    * List(1,1,2,3,1,1) -> List(1,1,1,1), List(2), List(3)\n    */\n-  def groupEquals[T](in: List[T]): List[List[T]] = {\n-    error(\"fix me\")\n+  def groupEquals[T](in: List[T]): List[List[T]] = in match {\n+    case List() => List()\n+    case l => l.filter(_ == l.head) +: groupEquals(l.filterNot(_ == l.head)) ","path":"labs/src/main/scala/org/scalalabs/basic/lab03/RecursionPatternMatchingExercise.scala","position":36,"original_position":36,"commit_id":"b7c06fef8ce8ed5ef8d7ca842ae581aad663d59e","original_commit_id":"b7c06fef8ce8ed5ef8d7ca842ae581aad663d59e","user":{"login":"ellenfkh","id":3672564,"avatar_url":"https://avatars.githubusercontent.com/u/3672564?v=2","gravatar_id":"3055e6035a7b91944c29f998cc13b7d3","url":"https://api.github.com/users/ellenfkh","html_url":"https://github.com/ellenfkh","followers_url":"https://api.github.com/users/ellenfkh/followers","following_url":"https://api.github.com/users/ellenfkh/following{/other_user}","gists_url":"https://api.github.com/users/ellenfkh/gists{/gist_id}","starred_url":"https://api.github.com/users/ellenfkh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ellenfkh/subscriptions","organizations_url":"https://api.github.com/users/ellenfkh/orgs","repos_url":"https://api.github.com/users/ellenfkh/repos","events_url":"https://api.github.com/users/ellenfkh/events{/privacy}","received_events_url":"https://api.github.com/users/ellenfkh/received_events","type":"User","site_admin":false},"body":"Cool, I didn't know about filterNot.  I just had to filter with a predicate and then its opposite every time I wanted to partition a list. :(","created_at":"2014-09-17T07:45:16Z","updated_at":"2014-09-17T07:45:16Z","html_url":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11#discussion_r17649984","pull_request_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/comments/17649984"},"html":{"href":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11#discussion_r17649984"},"pull_request":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11","id":21276254,"html_url":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11","diff_url":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11.diff","patch_url":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11.patch","issue_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/11","number":11,"state":"open","locked":false,"title":"Assignment 2: Alejandro Frias and Paul Dapolito","user":{"login":"PaulDapolito","id":4631910,"avatar_url":"https://avatars.githubusercontent.com/u/4631910?v=2","gravatar_id":"c64b49e8ebb0904d13b96173b7cb25a4","url":"https://api.github.com/users/PaulDapolito","html_url":"https://github.com/PaulDapolito","followers_url":"https://api.github.com/users/PaulDapolito/followers","following_url":"https://api.github.com/users/PaulDapolito/following{/other_user}","gists_url":"https://api.github.com/users/PaulDapolito/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulDapolito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulDapolito/subscriptions","organizations_url":"https://api.github.com/users/PaulDapolito/orgs","repos_url":"https://api.github.com/users/PaulDapolito/repos","events_url":"https://api.github.com/users/PaulDapolito/events{/privacy}","received_events_url":"https://api.github.com/users/PaulDapolito/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-09-16T04:41:05Z","updated_at":"2014-09-17T07:45:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88a3e15057483d48c72b9e57d6ee098055e774c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11/commits","review_comments_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11/comments","review_comment_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/11/comments","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/statuses/b7c06fef8ce8ed5ef8d7ca842ae581aad663d59e","head":{"label":"AlejandroFrias:master","ref":"master","sha":"b7c06fef8ce8ed5ef8d7ca842ae581aad663d59e","user":{"login":"AlejandroFrias","id":3598338,"avatar_url":"https://avatars.githubusercontent.com/u/3598338?v=2","gravatar_id":"578d4d4c76dcb26ac753d80d15f4ae89","url":"https://api.github.com/users/AlejandroFrias","html_url":"https://github.com/AlejandroFrias","followers_url":"https://api.github.com/users/AlejandroFrias/followers","following_url":"https://api.github.com/users/AlejandroFrias/following{/other_user}","gists_url":"https://api.github.com/users/AlejandroFrias/gists{/gist_id}","starred_url":"https://api.github.com/users/AlejandroFrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlejandroFrias/subscriptions","organizations_url":"https://api.github.com/users/AlejandroFrias/orgs","repos_url":"https://api.github.com/users/AlejandroFrias/repos","events_url":"https://api.github.com/users/AlejandroFrias/events{/privacy}","received_events_url":"https://api.github.com/users/AlejandroFrias/received_events","type":"User","site_admin":false},"repo":{"id":24033705,"name":"practice-scala","full_name":"AlejandroFrias/practice-scala","owner":{"login":"AlejandroFrias","id":3598338,"avatar_url":"https://avatars.githubusercontent.com/u/3598338?v=2","gravatar_id":"578d4d4c76dcb26ac753d80d15f4ae89","url":"https://api.github.com/users/AlejandroFrias","html_url":"https://github.com/AlejandroFrias","followers_url":"https://api.github.com/users/AlejandroFrias/followers","following_url":"https://api.github.com/users/AlejandroFrias/following{/other_user}","gists_url":"https://api.github.com/users/AlejandroFrias/gists{/gist_id}","starred_url":"https://api.github.com/users/AlejandroFrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlejandroFrias/subscriptions","organizations_url":"https://api.github.com/users/AlejandroFrias/orgs","repos_url":"https://api.github.com/users/AlejandroFrias/repos","events_url":"https://api.github.com/users/AlejandroFrias/events{/privacy}","received_events_url":"https://api.github.com/users/AlejandroFrias/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlejandroFrias/practice-scala","description":"","fork":true,"url":"https://api.github.com/repos/AlejandroFrias/practice-scala","forks_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/forks","keys_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/teams","hooks_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/hooks","issue_events_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/issues/events{/number}","events_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/events","assignees_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/assignees{/user}","branches_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/branches{/branch}","tags_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/tags","blobs_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/languages","stargazers_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/stargazers","contributors_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/contributors","subscribers_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/subscribers","subscription_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/subscription","commits_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/issues/comments/{number}","contents_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/contents/{+path}","compare_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/merges","archive_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/downloads","issues_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/issues{/number}","pulls_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/labels{/name}","releases_url":"https://api.github.com/repos/AlejandroFrias/practice-scala/releases{/id}","created_at":"2014-09-14T21:18:40Z","updated_at":"2014-09-14T23:49:09Z","pushed_at":"2014-09-16T23:57:10Z","git_url":"git://github.com/AlejandroFrias/practice-scala.git","ssh_url":"git@github.com:AlejandroFrias/practice-scala.git","clone_url":"https://github.com/AlejandroFrias/practice-scala.git","svn_url":"https://github.com/AlejandroFrias/practice-scala","homepage":null,"size":4610,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"hmc-cs111-fall2014:master","ref":"master","sha":"5c7ab76a6abf468ebbea80e2caf1b5a77c333782","user":{"login":"hmc-cs111-fall2014","id":8164020,"avatar_url":"https://avatars.githubusercontent.com/u/8164020?v=2","gravatar_id":null,"url":"https://api.github.com/users/hmc-cs111-fall2014","html_url":"https://github.com/hmc-cs111-fall2014","followers_url":"https://api.github.com/users/hmc-cs111-fall2014/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2014/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2014/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2014/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2014/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2014/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2014/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2014/received_events","type":"Organization","site_admin":false},"repo":{"id":23520704,"name":"practice-scala","full_name":"hmc-cs111-fall2014/practice-scala","owner":{"login":"hmc-cs111-fall2014","id":8164020,"avatar_url":"https://avatars.githubusercontent.com/u/8164020?v=2","gravatar_id":null,"url":"https://api.github.com/users/hmc-cs111-fall2014","html_url":"https://github.com/hmc-cs111-fall2014","followers_url":"https://api.github.com/users/hmc-cs111-fall2014/followers","following_url":"https://api.github.com/users/hmc-cs111-fall2014/following{/other_user}","gists_url":"https://api.github.com/users/hmc-cs111-fall2014/gists{/gist_id}","starred_url":"https://api.github.com/users/hmc-cs111-fall2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmc-cs111-fall2014/subscriptions","organizations_url":"https://api.github.com/users/hmc-cs111-fall2014/orgs","repos_url":"https://api.github.com/users/hmc-cs111-fall2014/repos","events_url":"https://api.github.com/users/hmc-cs111-fall2014/events{/privacy}","received_events_url":"https://api.github.com/users/hmc-cs111-fall2014/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmc-cs111-fall2014/practice-scala","description":"","fork":false,"url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala","forks_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/forks","keys_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/teams","hooks_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/hooks","issue_events_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/events{/number}","events_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/events","assignees_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/assignees{/user}","branches_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/branches{/branch}","tags_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/tags","blobs_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/languages","stargazers_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/stargazers","contributors_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/contributors","subscribers_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/subscribers","subscription_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/subscription","commits_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/comments/{number}","contents_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/contents/{+path}","compare_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/merges","archive_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/downloads","issues_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues{/number}","pulls_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/labels{/name}","releases_url":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/releases{/id}","created_at":"2014-08-31T18:59:21Z","updated_at":"2014-09-11T04:22:55Z","pushed_at":"2014-09-12T17:59:21Z","git_url":"git://github.com/hmc-cs111-fall2014/practice-scala.git","ssh_url":"git@github.com:hmc-cs111-fall2014/practice-scala.git","clone_url":"https://github.com/hmc-cs111-fall2014/practice-scala.git","svn_url":"https://github.com/hmc-cs111-fall2014/practice-scala","homepage":null,"size":5252,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":12,"forks":11,"open_issues":12,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11"},"html":{"href":"https://github.com/hmc-cs111-fall2014/practice-scala/pull/11"},"issue":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/11"},"comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/hmc-cs111-fall2014/practice-scala/statuses/b7c06fef8ce8ed5ef8d7ca842ae581aad663d59e"}}}}