GitHub PullRequestReviewCommentEvent at 2014-11-01 11:24:18
Repository: fizteh-java-2014
Actor: volodden
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/19703651","id":19703651,"diff_hunk":"@@ -0,0 +1,121 @@\n+package ru.fizteh.fivt.students.ekaterina_pogodina.multiFileMap;\n+\n+import ru.fizteh.fivt.students.ekaterina_pogodina.filemap.Parser;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.Scanner;\n+\n+public class Interpreter {\n+    private String dir;\n+    public Interpreter() throws Exception {\n+        List<String> cmdWithArgs = new ArrayList<String>();\n+        dir = System.getProperty(\"fizteh.db.dir\");\n+        TableManager table = new TableManager(dir);\n+        try {\n+            try (Scanner sc = new Scanner(System.in)) {\n+                while (true) {\n+                    System.out.print(\"$ \");\n+                    String line = \"\";\n+                    if (sc.hasNext()) {\n+                        line = sc.nextLine();\n+                    } else {\n+                        System.exit(0);\n+                    }\n+                    String[] commands = line.split(\" ; \");\n+                    for (String command: commands) {\n+                        int index;\n+                        index = 0;\n+                        for (int i = 0; i < command.length(); i++) {\n+                            if (command.charAt(i) == ' ') {\n+                                cmdWithArgs.add(command.substring(index, i));\n+                                index = i + 1;\n+                            }\n+                        }\n+                        cmdWithArgs.add(command.substring(index, command.length()));\n+                        String[] arg = new String[cmdWithArgs.size()];\n+                        for (int i = 0; i < arg.length; i++) {\n+                            arg[i] = cmdWithArgs.get(i);\n+                        }\n+                        try {\n+                            Parser.parse(arg, table);\n+                        } catch (Exception e) {\n+                            System.err.println(e.getMessage());\n+                        }\n+                        cmdWithArgs.clear();\n+                    }\n+                }\n+            } catch (Exception e) {\n+                System.err.println(e.getMessage());\n+                System.exit(1);\n+            }\n+        } catch (Exception e) {\n+            System.err.println(e.getMessage());\n+            System.exit(1);\n+        }\n+    }\n+\n+    public Interpreter(String[] args) {\n+        TableManager table;\n+        List<String> cmdWithArgs = new ArrayList<String>();\n+        try {\n+            table = new TableManager(System.getProperty(\"fizteh.db.dir\"));\n+            if (args.length > 0) {\n+                try {\n+                    String line = \"\";\n+                    for (int i = 0; i < args.length; i++) {\n+                        line = line.concat(args[i]);\n+                        if (i != args.length - 1) {\n+                            line = line.concat(\" \");\n+                        }\n+                    }\n+                    String[] commands = line.split(\" ; \");\n+                    for (String command: commands) {\n+                        int index;\n+                        index = 0;\n+                        for (int i = 0; i < command.length(); i++) {\n+                            if (command.charAt(i) == ' ') {\n+                                cmdWithArgs.add(command.substring(index, i));\n+                                String[] buff = cmdWithArgs.get(cmdWithArgs.size() - 1).trim().split(\"\\\\s+\");\n+                                cmdWithArgs.remove(cmdWithArgs.size() - 1);\n+                                for (int k = 0; k < buff.length; k++) {\n+                                    if (!buff[k].equals(\" \")) {\n+                                        cmdWithArgs.add(buff[k]);\n+                                    }\n+                                }\n+                                index = i + 1;\n+                            }\n+                        }\n+                        cmdWithArgs.add(command.substring(index, command.length()));\n+                        String[] arg = new String [cmdWithArgs.size()];\n+                        for (int i = 0; i < arg.length; i++) {\n+                            arg[i] = cmdWithArgs.get(i);\n+                        }\n+                        try {\n+                            Parser.parse(arg, table);\n+                            Table curTable = table.tables.get(table.currentTable);\n+                            for (int i = 0; i < 16; i++) {\n+                                for (int j = 0; j < 16; j++) {\n+                                    if (curTable.tableDateBase[i][j] != null) {\n+                                        curTable.tableDateBase[i][j].close();\n+                                    }\n+                                }\n+                            }\n+                        } catch (Exception e) {\n+                            System.err.println(e.getMessage());\n+                            System.exit(1);\n+                        }\n+                        cmdWithArgs.clear();\n+                    }\n+                } catch (Exception e) {\n+                    System.err.println(e.getMessage());\n+                    System.exit(1);\n+                }\n+            }\n+        } catch (Exception e) {\n+            System.err.println(e.getMessage());\n+            System.exit(1);\n+        }\n+","path":"src/ru/fizteh/fivt/students/ekaterina_pogodina/multiFileMap/Interpreter.java","position":119,"original_position":119,"commit_id":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","original_commit_id":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","user":{"login":"volodden","id":8759062,"avatar_url":"https://avatars.githubusercontent.com/u/8759062?v=2","gravatar_id":"","url":"https://api.github.com/users/volodden","html_url":"https://github.com/volodden","followers_url":"https://api.github.com/users/volodden/followers","following_url":"https://api.github.com/users/volodden/following{/other_user}","gists_url":"https://api.github.com/users/volodden/gists{/gist_id}","starred_url":"https://api.github.com/users/volodden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volodden/subscriptions","organizations_url":"https://api.github.com/users/volodden/orgs","repos_url":"https://api.github.com/users/volodden/repos","events_url":"https://api.github.com/users/volodden/events{/privacy}","received_events_url":"https://api.github.com/users/volodden/received_events","type":"User","site_admin":false},"body":"Пусто. :)\r\nМежду закрывающимися скобками лучше не делать пустых строчек - они не нужны. Между командами можно.","created_at":"2014-11-01T11:24:18Z","updated_at":"2014-11-01T11:24:18Z","html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273#discussion_r19703651","pull_request_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273","_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/19703651"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/273#discussion_r19703651"},"pull_request":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273"}}},"pull_request":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273","id":23267711,"html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273","diff_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273.diff","patch_url":"https://github.com/dkomanov/fizteh-java-2014/pull/273.patch","issue_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273","number":273,"state":"open","locked":false,"title":"Погодина Екатерина, 397, multifile","user":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-10-23T23:34:56Z","updated_at":"2014-11-01T11:24:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4242958ed030a79f82e3d5edbadb17c571d604c","assignee":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=2","gravatar_id":"","url":"https://api.github.com/users/vpavlenko","html_url":"https://github.com/vpavlenko","followers_url":"https://api.github.com/users/vpavlenko/followers","following_url":"https://api.github.com/users/vpavlenko/following{/other_user}","gists_url":"https://api.github.com/users/vpavlenko/gists{/gist_id}","starred_url":"https://api.github.com/users/vpavlenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vpavlenko/subscriptions","organizations_url":"https://api.github.com/users/vpavlenko/orgs","repos_url":"https://api.github.com/users/vpavlenko/repos","events_url":"https://api.github.com/users/vpavlenko/events{/privacy}","received_events_url":"https://api.github.com/users/vpavlenko/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/commits","review_comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/comments","review_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273/comments","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","head":{"label":"EkaterinaPogodina:master","ref":"master","sha":"83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489","user":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"repo":{"id":24531500,"name":"fizteh-java-2014","full_name":"EkaterinaPogodina/fizteh-java-2014","owner":{"login":"EkaterinaPogodina","id":8936131,"avatar_url":"https://avatars.githubusercontent.com/u/8936131?v=2","gravatar_id":"","url":"https://api.github.com/users/EkaterinaPogodina","html_url":"https://github.com/EkaterinaPogodina","followers_url":"https://api.github.com/users/EkaterinaPogodina/followers","following_url":"https://api.github.com/users/EkaterinaPogodina/following{/other_user}","gists_url":"https://api.github.com/users/EkaterinaPogodina/gists{/gist_id}","starred_url":"https://api.github.com/users/EkaterinaPogodina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EkaterinaPogodina/subscriptions","organizations_url":"https://api.github.com/users/EkaterinaPogodina/orgs","repos_url":"https://api.github.com/users/EkaterinaPogodina/repos","events_url":"https://api.github.com/users/EkaterinaPogodina/events{/privacy}","received_events_url":"https://api.github.com/users/EkaterinaPogodina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014","description":"Екатерина Погодина, 397, FileMap","fork":true,"url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014","forks_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/EkaterinaPogodina/fizteh-java-2014/releases{/id}","created_at":"2014-09-27T12:40:16Z","updated_at":"2014-10-10T17:57:27Z","pushed_at":"2014-10-27T08:57:04Z","git_url":"git://github.com/EkaterinaPogodina/fizteh-java-2014.git","ssh_url":"git@github.com:EkaterinaPogodina/fizteh-java-2014.git","clone_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014.git","svn_url":"https://github.com/EkaterinaPogodina/fizteh-java-2014","homepage":"","size":3001,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"dkomanov:master","ref":"master","sha":"8090ce0a1f8720575c93a4792f5d8baa9c4d3dd0","user":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=2","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"repo":{"id":23866876,"name":"fizteh-java-2014","full_name":"dkomanov/fizteh-java-2014","owner":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=2","gravatar_id":"","url":"https://api.github.com/users/dkomanov","html_url":"https://github.com/dkomanov","followers_url":"https://api.github.com/users/dkomanov/followers","following_url":"https://api.github.com/users/dkomanov/following{/other_user}","gists_url":"https://api.github.com/users/dkomanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dkomanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkomanov/subscriptions","organizations_url":"https://api.github.com/users/dkomanov/orgs","repos_url":"https://api.github.com/users/dkomanov/repos","events_url":"https://api.github.com/users/dkomanov/events{/privacy}","received_events_url":"https://api.github.com/users/dkomanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dkomanov/fizteh-java-2014","description":"","fork":false,"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014","forks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/releases{/id}","created_at":"2014-09-10T08:32:49Z","updated_at":"2014-10-23T21:36:51Z","pushed_at":"2014-10-27T21:01:47Z","git_url":"git://github.com/dkomanov/fizteh-java-2014.git","ssh_url":"git@github.com:dkomanov/fizteh-java-2014.git","clone_url":"https://github.com/dkomanov/fizteh-java-2014.git","svn_url":"https://github.com/dkomanov/fizteh-java-2014","homepage":null,"size":16233,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":87,"forks":85,"open_issues":87,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/273"},"issue":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273"},"comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/273/comments"},"review_comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/comments"},"review_comment":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/273/commits"},"statuses":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/83354d993bae88a9f6fcb8ccd7b3b72ec5ef5489"}}}}