{"action":"created","comment":{"url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/comments/112729380","pull_request_review_id":34065689,"id":112729380,"diff_hunk":"@@ -0,0 +1,35 @@\n+const Node = require('../node');\n+\n+// Returns true if by adding a term you can simplify part of the function into an integer\n+// e.g. (2x+1)/(2x+3) -> True\n+// e.g. (2x+1)/(2x^2 + 3) -> False\n+function canFindDenominatorInNumerator(node) {\n+  if (!Node.Type.isOperator(node) || node.op !== '/' ) {\n+    return false;\n+  }\n+  if (node.args.length !== 2) {\n+    return false;\n+  }\n+\n+  let numerator = node.args[0];\n+  let denominator = node.args[1];\n+  if (Node.Type.isParenthesis(numerator)) {\n+    numerator = numerator.content;\n+  }\n+  if (Node.Type.isParenthesis(denominator)) {\n+    denominator = denominator.content;\n+  }\n+\n+  if (numerator.op !== '+') {\n+    return false;\n+  }\n+  if (!('args' in denominator)) {\n+    return false;\n+  }\n+  const numeratorFirstTerm = new Node.PolynomialTerm(numerator.args[0]);","path":"lib/checks/canFindDenominatorInNumerator.js","position":29,"original_position":29,"commit_id":"6135dad72a0572f157c378edb6735711b13fdd32","original_commit_id":"6135dad72a0572f157c378edb6735711b13fdd32","user":{"login":"evykassirer","id":5634097,"avatar_url":"https://avatars2.githubusercontent.com/u/5634097?v=3","gravatar_id":"","url":"https://api.github.com/users/evykassirer","html_url":"https://github.com/evykassirer","followers_url":"https://api.github.com/users/evykassirer/followers","following_url":"https://api.github.com/users/evykassirer/following{/other_user}","gists_url":"https://api.github.com/users/evykassirer/gists{/gist_id}","starred_url":"https://api.github.com/users/evykassirer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evykassirer/subscriptions","organizations_url":"https://api.github.com/users/evykassirer/orgs","repos_url":"https://api.github.com/users/evykassirer/repos","events_url":"https://api.github.com/users/evykassirer/events{/privacy}","received_events_url":"https://api.github.com/users/evykassirer/received_events","type":"User","site_admin":false},"body":"most of the time I think it'll be sorted so that the first term is the poly term, but I don't think this is guaranteed. you could have `(1+x) / (x+2)`. So we might need to have a step somewhere that sorts, or otherwise iterate through the arguments to find this poly term\r\n\r\nAlso, where do you make sure they have the same exponent? (i.e. for now that it's always 1)","created_at":"2017-04-21T16:38:07Z","updated_at":"2017-04-21T16:45:46Z","html_url":"https://github.com/socraticorg/mathsteps/pull/158#discussion_r112729380","pull_request_url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/comments/112729380"},"html":{"href":"https://github.com/socraticorg/mathsteps/pull/158#discussion_r112729380"},"pull_request":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158","id":116904889,"html_url":"https://github.com/socraticorg/mathsteps/pull/158","diff_url":"https://github.com/socraticorg/mathsteps/pull/158.diff","patch_url":"https://github.com/socraticorg/mathsteps/pull/158.patch","issue_url":"https://api.github.com/repos/socraticorg/mathsteps/issues/158","number":158,"state":"open","locked":false,"title":"#76 - Better break-up fraction. ","user":{"login":"eltonlaw","id":14999531,"avatar_url":"https://avatars1.githubusercontent.com/u/14999531?v=3","gravatar_id":"","url":"https://api.github.com/users/eltonlaw","html_url":"https://github.com/eltonlaw","followers_url":"https://api.github.com/users/eltonlaw/followers","following_url":"https://api.github.com/users/eltonlaw/following{/other_user}","gists_url":"https://api.github.com/users/eltonlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/eltonlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eltonlaw/subscriptions","organizations_url":"https://api.github.com/users/eltonlaw/orgs","repos_url":"https://api.github.com/users/eltonlaw/repos","events_url":"https://api.github.com/users/eltonlaw/events{/privacy}","received_events_url":"https://api.github.com/users/eltonlaw/received_events","type":"User","site_admin":false},"body":"fixes #76 \r\n\r\nThis is only solves the initial case posed of (2x+3)/(2x+2). The output is now\r\n(2x+2)/(2x+2) + (1)/(2x+2). ","created_at":"2017-04-21T03:21:28Z","updated_at":"2017-04-21T16:45:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aa3963c4a6c7e0b3f0ba14f7dabcec4ee259d4e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158/commits","review_comments_url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158/comments","review_comment_url":"https://api.github.com/repos/socraticorg/mathsteps/pulls/comments{/number}","comments_url":"https://api.github.com/repos/socraticorg/mathsteps/issues/158/comments","statuses_url":"https://api.github.com/repos/socraticorg/mathsteps/statuses/6135dad72a0572f157c378edb6735711b13fdd32","head":{"label":"eltonlaw:master","ref":"master","sha":"6135dad72a0572f157c378edb6735711b13fdd32","user":{"login":"eltonlaw","id":14999531,"avatar_url":"https://avatars1.githubusercontent.com/u/14999531?v=3","gravatar_id":"","url":"https://api.github.com/users/eltonlaw","html_url":"https://github.com/eltonlaw","followers_url":"https://api.github.com/users/eltonlaw/followers","following_url":"https://api.github.com/users/eltonlaw/following{/other_user}","gists_url":"https://api.github.com/users/eltonlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/eltonlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eltonlaw/subscriptions","organizations_url":"https://api.github.com/users/eltonlaw/orgs","repos_url":"https://api.github.com/users/eltonlaw/repos","events_url":"https://api.github.com/users/eltonlaw/events{/privacy}","received_events_url":"https://api.github.com/users/eltonlaw/received_events","type":"User","site_admin":false},"repo":{"id":88203848,"name":"mathsteps","full_name":"eltonlaw/mathsteps","owner":{"login":"eltonlaw","id":14999531,"avatar_url":"https://avatars1.githubusercontent.com/u/14999531?v=3","gravatar_id":"","url":"https://api.github.com/users/eltonlaw","html_url":"https://github.com/eltonlaw","followers_url":"https://api.github.com/users/eltonlaw/followers","following_url":"https://api.github.com/users/eltonlaw/following{/other_user}","gists_url":"https://api.github.com/users/eltonlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/eltonlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eltonlaw/subscriptions","organizations_url":"https://api.github.com/users/eltonlaw/orgs","repos_url":"https://api.github.com/users/eltonlaw/repos","events_url":"https://api.github.com/users/eltonlaw/events{/privacy}","received_events_url":"https://api.github.com/users/eltonlaw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eltonlaw/mathsteps","description":"Step by step math solutions for everyone","fork":true,"url":"https://api.github.com/repos/eltonlaw/mathsteps","forks_url":"https://api.github.com/repos/eltonlaw/mathsteps/forks","keys_url":"https://api.github.com/repos/eltonlaw/mathsteps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eltonlaw/mathsteps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eltonlaw/mathsteps/teams","hooks_url":"https://api.github.com/repos/eltonlaw/mathsteps/hooks","issue_events_url":"https://api.github.com/repos/eltonlaw/mathsteps/issues/events{/number}","events_url":"https://api.github.com/repos/eltonlaw/mathsteps/events","assignees_url":"https://api.github.com/repos/eltonlaw/mathsteps/assignees{/user}","branches_url":"https://api.github.com/repos/eltonlaw/mathsteps/branches{/branch}","tags_url":"https://api.github.com/repos/eltonlaw/mathsteps/tags","blobs_url":"https://api.github.com/repos/eltonlaw/mathsteps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eltonlaw/mathsteps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eltonlaw/mathsteps/git/refs{/sha}","trees_url":"https://api.github.com/repos/eltonlaw/mathsteps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eltonlaw/mathsteps/statuses/{sha}","languages_url":"https://api.github.com/repos/eltonlaw/mathsteps/languages","stargazers_url":"https://api.github.com/repos/eltonlaw/mathsteps/stargazers","contributors_url":"https://api.github.com/repos/eltonlaw/mathsteps/contributors","subscribers_url":"https://api.github.com/repos/eltonlaw/mathsteps/subscribers","subscription_url":"https://api.github.com/repos/eltonlaw/mathsteps/subscription","commits_url":"https://api.github.com/repos/eltonlaw/mathsteps/commits{/sha}","git_commits_url":"https://api.github.com/repos/eltonlaw/mathsteps/git/commits{/sha}","comments_url":"https://api.github.com/repos/eltonlaw/mathsteps/comments{/number}","issue_comment_url":"https://api.github.com/repos/eltonlaw/mathsteps/issues/comments{/number}","contents_url":"https://api.github.com/repos/eltonlaw/mathsteps/contents/{+path}","compare_url":"https://api.github.com/repos/eltonlaw/mathsteps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eltonlaw/mathsteps/merges","archive_url":"https://api.github.com/repos/eltonlaw/mathsteps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eltonlaw/mathsteps/downloads","issues_url":"https://api.github.com/repos/eltonlaw/mathsteps/issues{/number}","pulls_url":"https://api.github.com/repos/eltonlaw/mathsteps/pulls{/number}","milestones_url":"https://api.github.com/repos/eltonlaw/mathsteps/milestones{/number}","notifications_url":"https://api.github.com/repos/eltonlaw/mathsteps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eltonlaw/mathsteps/labels{/name}","releases_url":"https://api.github.com/repos/eltonlaw/mathsteps/releases{/id}","deployments_url":"https://api.github.com/repos/eltonlaw/mathsteps/deployments","created_at":"2017-04-13T20:29:35Z","updated_at":"2017-04-13T20:29:37Z","pushed_at":"2017-04-21T03:24:35Z","git_url":"git://github.com/eltonlaw/mathsteps.git","ssh_url":"git@github.com:eltonlaw/mathsteps.git","clone_url":"https://github.com/eltonlaw/mathsteps.git","svn_url":"https://github.com/eltonlaw/mathsteps","homepage":"https://socratic.org","size":661,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"socraticorg:master","ref":"master","sha":"a5813048a8fe4d14acfc89f36a279695ebc29be4","user":{"login":"socraticorg","id":4368132,"avatar_url":"https://avatars0.githubusercontent.com/u/4368132?v=3","gravatar_id":"","url":"https://api.github.com/users/socraticorg","html_url":"https://github.com/socraticorg","followers_url":"https://api.github.com/users/socraticorg/followers","following_url":"https://api.github.com/users/socraticorg/following{/other_user}","gists_url":"https://api.github.com/users/socraticorg/gists{/gist_id}","starred_url":"https://api.github.com/users/socraticorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socraticorg/subscriptions","organizations_url":"https://api.github.com/users/socraticorg/orgs","repos_url":"https://api.github.com/users/socraticorg/repos","events_url":"https://api.github.com/users/socraticorg/events{/privacy}","received_events_url":"https://api.github.com/users/socraticorg/received_events","type":"Organization","site_admin":false},"repo":{"id":74380149,"name":"mathsteps","full_name":"socraticorg/mathsteps","owner":{"login":"socraticorg","id":4368132,"avatar_url":"https://avatars0.githubusercontent.com/u/4368132?v=3","gravatar_id":"","url":"https://api.github.com/users/socraticorg","html_url":"https://github.com/socraticorg","followers_url":"https://api.github.com/users/socraticorg/followers","following_url":"https://api.github.com/users/socraticorg/following{/other_user}","gists_url":"https://api.github.com/users/socraticorg/gists{/gist_id}","starred_url":"https://api.github.com/users/socraticorg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socraticorg/subscriptions","organizations_url":"https://api.github.com/users/socraticorg/orgs","repos_url":"https://api.github.com/users/socraticorg/repos","events_url":"https://api.github.com/users/socraticorg/events{/privacy}","received_events_url":"https://api.github.com/users/socraticorg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/socraticorg/mathsteps","description":"Step by step math solutions for everyone","fork":false,"url":"https://api.github.com/repos/socraticorg/mathsteps","forks_url":"https://api.github.com/repos/socraticorg/mathsteps/forks","keys_url":"https://api.github.com/repos/socraticorg/mathsteps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socraticorg/mathsteps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socraticorg/mathsteps/teams","hooks_url":"https://api.github.com/repos/socraticorg/mathsteps/hooks","issue_events_url":"https://api.github.com/repos/socraticorg/mathsteps/issues/events{/number}","events_url":"https://api.github.com/repos/socraticorg/mathsteps/events","assignees_url":"https://api.github.com/repos/socraticorg/mathsteps/assignees{/user}","branches_url":"https://api.github.com/repos/socraticorg/mathsteps/branches{/branch}","tags_url":"https://api.github.com/repos/socraticorg/mathsteps/tags","blobs_url":"https://api.github.com/repos/socraticorg/mathsteps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socraticorg/mathsteps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socraticorg/mathsteps/git/refs{/sha}","trees_url":"https://api.github.com/repos/socraticorg/mathsteps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socraticorg/mathsteps/statuses/{sha}","languages_url":"https://api.github.com/repos/socraticorg/mathsteps/languages","stargazers_url":"https://api.github.com/repos/socraticorg/mathsteps/stargazers","contributors_url":"https://api.github.com/repos/socraticorg/mathsteps/contributors","subscribers_url":"https://api.github.com/repos/socraticorg/mathsteps/subscribers","subscription_url":"https://api.github.com/repos/socraticorg/mathsteps/subscription","commits_url":"https://api.github.com/repos/socraticorg/mathsteps/commits{/sha}","git_commits_url":"https://api.github.com/repos/socraticorg/mathsteps/git/commits{/sha}","comments_url":"https://api.github.com/repos/socraticorg/mathsteps/comments{/number}","issue_comment_url":"https://api.github.com/repos/socraticorg/mathsteps/issues/comments{/number}","contents_url":"https://api.github.com/repos/socraticorg/mathsteps/contents/{+path}","compare_url":"https://api.github.com/repos/socraticorg/mathsteps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socraticorg/mathsteps/merges","archive_url":"https://api.github.com/repos/socraticorg/mathsteps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socraticorg/mathsteps/downloads","issues_url":"https://api.github.com/repos/socraticorg/mathsteps/issues{/number}","pulls_url":"https://api.github.com/repos/socraticorg/mathsteps/pulls{/number}","milestones_url":"https://api.github.com/repos/socraticorg/mathsteps/milestones{/number}","notifications_url":"https://api.github.com/repos/socraticorg/mathsteps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socraticorg/mathsteps/labels{/name}","releases_url":"https://api.github.com/repos/socraticorg/mathsteps/releases{/id}","deployments_url":"https://api.github.com/repos/socraticorg/mathsteps/deployments","created_at":"2016-11-21T15:58:00Z","updated_at":"2017-04-20T02:58:51Z","pushed_at":"2017-04-21T07:59:54Z","git_url":"git://github.com/socraticorg/mathsteps.git","ssh_url":"git@github.com:socraticorg/mathsteps.git","clone_url":"https://github.com/socraticorg/mathsteps.git","svn_url":"https://github.com/socraticorg/mathsteps","homepage":"https://socratic.org","size":658,"stargazers_count":1305,"watchers_count":1305,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":118,"mirror_url":null,"open_issues_count":48,"forks":118,"open_issues":48,"watchers":1305,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158"},"html":{"href":"https://github.com/socraticorg/mathsteps/pull/158"},"issue":{"href":"https://api.github.com/repos/socraticorg/mathsteps/issues/158"},"comments":{"href":"https://api.github.com/repos/socraticorg/mathsteps/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/socraticorg/mathsteps/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/socraticorg/mathsteps/statuses/6135dad72a0572f157c378edb6735711b13fdd32"}}}}
{"actor":{"display_login":"evykassirer"}}