{"action":"created","comment":{"url":"https://api.github.com/repos/yurii9999/hw/pulls/comments/192772787","pull_request_review_id":125612335,"id":192772787,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mjc3Mjc4Nw==","diff_hunk":"@@ -0,0 +1,148 @@\n+package group144.kuzmin;\n+\n+public class Calculator {\n+    /**\n+     * Calculate expression, don't check is expression correct, don't know about brackets\n+     *\n+     * @param expression correct expression you want to calculate\n+     * @return\n+     */\n+    public static String calculate(String expression) {\n+        String[] tokens = split(expression);\n+\n+        for (int i = 0; i < tokens.length; i++) {\n+            if (isFirstPriorityOperation(tokens[i])) {\n+                tokens[i + 1] = String.valueOf(calculate(tokens[i - 1], tokens[i + 1], tokens[i]));\n+                tokens[i - 1] = null;\n+                tokens[i] = null;\n+            }\n+        }\n+\n+        tokens = removeNulls(tokens);\n+\n+        for (int i = 0; i < tokens.length; i++) {\n+            if (isSecondPriorityOperation(tokens[i])) {\n+                tokens[i + 1] = String.valueOf(calculate(tokens[i - 1], tokens[i + 1], tokens[i]));\n+                tokens[i - 1] = null;\n+                tokens[i] = null;\n+            }\n+        }\n+\n+        return tokens[tokens.length - 1];\n+    }\n+\n+    /**\n+     * Method remove all nulls' tokens from Tokens array\n+     *\n+     * @param tokens array that you want to clear\n+     * @return tokens array without nulls' elements\n+     */\n+    private static String[] removeNulls(String[] tokens) {\n+        int amountNulls = 0;\n+        for (int i = 0; i < tokens.length; i++)","path":"sem2/hw5/p5-3/src/main/java/group144/kuzmin/Calculator.java","position":42,"original_position":42,"commit_id":"50f09c1d844c557bcb6c64571a406e41581ce410","original_commit_id":"50f09c1d844c557bcb6c64571a406e41581ce410","user":{"login":"jzuken","id":705678,"node_id":"MDQ6VXNlcjcwNTY3OA==","avatar_url":"https://avatars1.githubusercontent.com/u/705678?v=4","gravatar_id":"","url":"https://api.github.com/users/jzuken","html_url":"https://github.com/jzuken","followers_url":"https://api.github.com/users/jzuken/followers","following_url":"https://api.github.com/users/jzuken/following{/other_user}","gists_url":"https://api.github.com/users/jzuken/gists{/gist_id}","starred_url":"https://api.github.com/users/jzuken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzuken/subscriptions","organizations_url":"https://api.github.com/users/jzuken/orgs","repos_url":"https://api.github.com/users/jzuken/repos","events_url":"https://api.github.com/users/jzuken/events{/privacy}","received_events_url":"https://api.github.com/users/jzuken/received_events","type":"User","site_admin":false},"body":"а это можно красиво и компактно записать одной строчкой через стримы","created_at":"2018-06-04T15:01:40Z","updated_at":"2018-06-04T15:02:38Z","html_url":"https://github.com/yurii9999/hw/pull/56#discussion_r192772787","pull_request_url":"https://api.github.com/repos/yurii9999/hw/pulls/56","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/comments/192772787"},"html":{"href":"https://github.com/yurii9999/hw/pull/56#discussion_r192772787"},"pull_request":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/56"}}},"pull_request":{"url":"https://api.github.com/repos/yurii9999/hw/pulls/56","id":189195334,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MTk1MzM0","html_url":"https://github.com/yurii9999/hw/pull/56","diff_url":"https://github.com/yurii9999/hw/pull/56.diff","patch_url":"https://github.com/yurii9999/hw/pull/56.patch","issue_url":"https://api.github.com/repos/yurii9999/hw/issues/56","number":56,"state":"open","locked":false,"title":"P5 3","user":{"login":"yurii9999","id":33332442,"node_id":"MDQ6VXNlcjMzMzMyNDQy","avatar_url":"https://avatars3.githubusercontent.com/u/33332442?v=4","gravatar_id":"","url":"https://api.github.com/users/yurii9999","html_url":"https://github.com/yurii9999","followers_url":"https://api.github.com/users/yurii9999/followers","following_url":"https://api.github.com/users/yurii9999/following{/other_user}","gists_url":"https://api.github.com/users/yurii9999/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii9999/subscriptions","organizations_url":"https://api.github.com/users/yurii9999/orgs","repos_url":"https://api.github.com/users/yurii9999/repos","events_url":"https://api.github.com/users/yurii9999/events{/privacy}","received_events_url":"https://api.github.com/users/yurii9999/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-19T16:23:14Z","updated_at":"2018-06-04T15:02:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60109dfbcde1e713e049c72254b7701b94b3cf55","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/yurii9999/hw/pulls/56/commits","review_comments_url":"https://api.github.com/repos/yurii9999/hw/pulls/56/comments","review_comment_url":"https://api.github.com/repos/yurii9999/hw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yurii9999/hw/issues/56/comments","statuses_url":"https://api.github.com/repos/yurii9999/hw/statuses/50f09c1d844c557bcb6c64571a406e41581ce410","head":{"label":"yurii9999:p5-3","ref":"p5-3","sha":"50f09c1d844c557bcb6c64571a406e41581ce410","user":{"login":"yurii9999","id":33332442,"node_id":"MDQ6VXNlcjMzMzMyNDQy","avatar_url":"https://avatars3.githubusercontent.com/u/33332442?v=4","gravatar_id":"","url":"https://api.github.com/users/yurii9999","html_url":"https://github.com/yurii9999","followers_url":"https://api.github.com/users/yurii9999/followers","following_url":"https://api.github.com/users/yurii9999/following{/other_user}","gists_url":"https://api.github.com/users/yurii9999/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii9999/subscriptions","organizations_url":"https://api.github.com/users/yurii9999/orgs","repos_url":"https://api.github.com/users/yurii9999/repos","events_url":"https://api.github.com/users/yurii9999/events{/privacy}","received_events_url":"https://api.github.com/users/yurii9999/received_events","type":"User","site_admin":false},"repo":{"id":111015612,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEwMTU2MTI=","name":"hw","full_name":"yurii9999/hw","owner":{"login":"yurii9999","id":33332442,"node_id":"MDQ6VXNlcjMzMzMyNDQy","avatar_url":"https://avatars3.githubusercontent.com/u/33332442?v=4","gravatar_id":"","url":"https://api.github.com/users/yurii9999","html_url":"https://github.com/yurii9999","followers_url":"https://api.github.com/users/yurii9999/followers","following_url":"https://api.github.com/users/yurii9999/following{/other_user}","gists_url":"https://api.github.com/users/yurii9999/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii9999/subscriptions","organizations_url":"https://api.github.com/users/yurii9999/orgs","repos_url":"https://api.github.com/users/yurii9999/repos","events_url":"https://api.github.com/users/yurii9999/events{/privacy}","received_events_url":"https://api.github.com/users/yurii9999/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yurii9999/hw","description":null,"fork":false,"url":"https://api.github.com/repos/yurii9999/hw","forks_url":"https://api.github.com/repos/yurii9999/hw/forks","keys_url":"https://api.github.com/repos/yurii9999/hw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yurii9999/hw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yurii9999/hw/teams","hooks_url":"https://api.github.com/repos/yurii9999/hw/hooks","issue_events_url":"https://api.github.com/repos/yurii9999/hw/issues/events{/number}","events_url":"https://api.github.com/repos/yurii9999/hw/events","assignees_url":"https://api.github.com/repos/yurii9999/hw/assignees{/user}","branches_url":"https://api.github.com/repos/yurii9999/hw/branches{/branch}","tags_url":"https://api.github.com/repos/yurii9999/hw/tags","blobs_url":"https://api.github.com/repos/yurii9999/hw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yurii9999/hw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yurii9999/hw/git/refs{/sha}","trees_url":"https://api.github.com/repos/yurii9999/hw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yurii9999/hw/statuses/{sha}","languages_url":"https://api.github.com/repos/yurii9999/hw/languages","stargazers_url":"https://api.github.com/repos/yurii9999/hw/stargazers","contributors_url":"https://api.github.com/repos/yurii9999/hw/contributors","subscribers_url":"https://api.github.com/repos/yurii9999/hw/subscribers","subscription_url":"https://api.github.com/repos/yurii9999/hw/subscription","commits_url":"https://api.github.com/repos/yurii9999/hw/commits{/sha}","git_commits_url":"https://api.github.com/repos/yurii9999/hw/git/commits{/sha}","comments_url":"https://api.github.com/repos/yurii9999/hw/comments{/number}","issue_comment_url":"https://api.github.com/repos/yurii9999/hw/issues/comments{/number}","contents_url":"https://api.github.com/repos/yurii9999/hw/contents/{+path}","compare_url":"https://api.github.com/repos/yurii9999/hw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yurii9999/hw/merges","archive_url":"https://api.github.com/repos/yurii9999/hw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yurii9999/hw/downloads","issues_url":"https://api.github.com/repos/yurii9999/hw/issues{/number}","pulls_url":"https://api.github.com/repos/yurii9999/hw/pulls{/number}","milestones_url":"https://api.github.com/repos/yurii9999/hw/milestones{/number}","notifications_url":"https://api.github.com/repos/yurii9999/hw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yurii9999/hw/labels{/name}","releases_url":"https://api.github.com/repos/yurii9999/hw/releases{/id}","deployments_url":"https://api.github.com/repos/yurii9999/hw/deployments","created_at":"2017-11-16T19:54:07Z","updated_at":"2018-06-04T14:27:48Z","pushed_at":"2018-06-04T14:27:47Z","git_url":"git://github.com/yurii9999/hw.git","ssh_url":"git@github.com:yurii9999/hw.git","clone_url":"https://github.com/yurii9999/hw.git","svn_url":"https://github.com/yurii9999/hw","homepage":null,"size":898,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"yurii9999:master","ref":"master","sha":"b7ea9600b8f4272ae302f88fe26a6132b1a12284","user":{"login":"yurii9999","id":33332442,"node_id":"MDQ6VXNlcjMzMzMyNDQy","avatar_url":"https://avatars3.githubusercontent.com/u/33332442?v=4","gravatar_id":"","url":"https://api.github.com/users/yurii9999","html_url":"https://github.com/yurii9999","followers_url":"https://api.github.com/users/yurii9999/followers","following_url":"https://api.github.com/users/yurii9999/following{/other_user}","gists_url":"https://api.github.com/users/yurii9999/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii9999/subscriptions","organizations_url":"https://api.github.com/users/yurii9999/orgs","repos_url":"https://api.github.com/users/yurii9999/repos","events_url":"https://api.github.com/users/yurii9999/events{/privacy}","received_events_url":"https://api.github.com/users/yurii9999/received_events","type":"User","site_admin":false},"repo":{"id":111015612,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEwMTU2MTI=","name":"hw","full_name":"yurii9999/hw","owner":{"login":"yurii9999","id":33332442,"node_id":"MDQ6VXNlcjMzMzMyNDQy","avatar_url":"https://avatars3.githubusercontent.com/u/33332442?v=4","gravatar_id":"","url":"https://api.github.com/users/yurii9999","html_url":"https://github.com/yurii9999","followers_url":"https://api.github.com/users/yurii9999/followers","following_url":"https://api.github.com/users/yurii9999/following{/other_user}","gists_url":"https://api.github.com/users/yurii9999/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii9999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii9999/subscriptions","organizations_url":"https://api.github.com/users/yurii9999/orgs","repos_url":"https://api.github.com/users/yurii9999/repos","events_url":"https://api.github.com/users/yurii9999/events{/privacy}","received_events_url":"https://api.github.com/users/yurii9999/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yurii9999/hw","description":null,"fork":false,"url":"https://api.github.com/repos/yurii9999/hw","forks_url":"https://api.github.com/repos/yurii9999/hw/forks","keys_url":"https://api.github.com/repos/yurii9999/hw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yurii9999/hw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yurii9999/hw/teams","hooks_url":"https://api.github.com/repos/yurii9999/hw/hooks","issue_events_url":"https://api.github.com/repos/yurii9999/hw/issues/events{/number}","events_url":"https://api.github.com/repos/yurii9999/hw/events","assignees_url":"https://api.github.com/repos/yurii9999/hw/assignees{/user}","branches_url":"https://api.github.com/repos/yurii9999/hw/branches{/branch}","tags_url":"https://api.github.com/repos/yurii9999/hw/tags","blobs_url":"https://api.github.com/repos/yurii9999/hw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yurii9999/hw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yurii9999/hw/git/refs{/sha}","trees_url":"https://api.github.com/repos/yurii9999/hw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yurii9999/hw/statuses/{sha}","languages_url":"https://api.github.com/repos/yurii9999/hw/languages","stargazers_url":"https://api.github.com/repos/yurii9999/hw/stargazers","contributors_url":"https://api.github.com/repos/yurii9999/hw/contributors","subscribers_url":"https://api.github.com/repos/yurii9999/hw/subscribers","subscription_url":"https://api.github.com/repos/yurii9999/hw/subscription","commits_url":"https://api.github.com/repos/yurii9999/hw/commits{/sha}","git_commits_url":"https://api.github.com/repos/yurii9999/hw/git/commits{/sha}","comments_url":"https://api.github.com/repos/yurii9999/hw/comments{/number}","issue_comment_url":"https://api.github.com/repos/yurii9999/hw/issues/comments{/number}","contents_url":"https://api.github.com/repos/yurii9999/hw/contents/{+path}","compare_url":"https://api.github.com/repos/yurii9999/hw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yurii9999/hw/merges","archive_url":"https://api.github.com/repos/yurii9999/hw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yurii9999/hw/downloads","issues_url":"https://api.github.com/repos/yurii9999/hw/issues{/number}","pulls_url":"https://api.github.com/repos/yurii9999/hw/pulls{/number}","milestones_url":"https://api.github.com/repos/yurii9999/hw/milestones{/number}","notifications_url":"https://api.github.com/repos/yurii9999/hw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yurii9999/hw/labels{/name}","releases_url":"https://api.github.com/repos/yurii9999/hw/releases{/id}","deployments_url":"https://api.github.com/repos/yurii9999/hw/deployments","created_at":"2017-11-16T19:54:07Z","updated_at":"2018-06-04T14:27:48Z","pushed_at":"2018-06-04T14:27:47Z","git_url":"git://github.com/yurii9999/hw.git","ssh_url":"git@github.com:yurii9999/hw.git","clone_url":"https://github.com/yurii9999/hw.git","svn_url":"https://github.com/yurii9999/hw","homepage":null,"size":898,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/56"},"html":{"href":"https://github.com/yurii9999/hw/pull/56"},"issue":{"href":"https://api.github.com/repos/yurii9999/hw/issues/56"},"comments":{"href":"https://api.github.com/repos/yurii9999/hw/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yurii9999/hw/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/yurii9999/hw/statuses/50f09c1d844c557bcb6c64571a406e41581ce410"}},"author_association":"OWNER"}}
{"actor":{"display_login":"jzuken"}}