{"action":"created","comment":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/24797145","id":24797145,"diff_hunk":"@@ -0,0 +1,91 @@\n+package ru.fizteh.fivt.students.MaximGotovchits.Parallel.base.commands;\n+\n+import ru.fizteh.fivt.students.MaximGotovchits.Parallel.interpreter.Command;\n+import ru.fizteh.fivt.students.MaximGotovchits.Parallel.objects.ObjectStoreable;\n+import ru.fizteh.fivt.students.MaximGotovchits.Parallel.objects.ObjectTable;\n+import ru.fizteh.fivt.students.MaximGotovchits.Parallel.objects.ObjectTableProvider;\n+import java.io.*;\n+import java.nio.charset.StandardCharsets;\n+import java.text.ParseException;\n+\n+public class Use extends Command {\n+    @Override\n+    public String getCmdName() {\n+        return \"use\";\n+    }\n+\n+    @Override\n+    public boolean execute(String[] cmd) throws Exception {\n+        if (cmd.length == 2) {\n+            useFunction(cmd[1], CommadTools.usingTableName);\n+            return true;\n+        }\n+        return false;\n+    }\n+\n+    public boolean useFunction(String tableName, String oldTableName) throws Exception {\n+        if (!tableName.equals(oldTableName)) {\n+            String outputName = tableName;\n+            String tablePath = CommadTools.DATA_BASE_NAME + File.separator + tableName;\n+            File file = new File(tablePath);\n+            if (file.exists()) {\n+                CommadTools.usingTableName = tableName;\n+                if (CommadTools.tableIsChosen) {\n+                    new FillTable().execute(null);\n+                    CommadTools.currentTable.storage.get().clear();\n+                    CommadTools.currentTable.commitStorage.clear();\n+                }\n+                CommadTools.currentTable = new ObjectTable(CommadTools.DATA_BASE_NAME + File.separator\n+                        + CommadTools.usingTableName);\n+                for (Integer i = 0; i < CommadTools.DIR_NUM; ++i) {\n+                    for (Integer j = 0; j < CommadTools.FILE_NUM; ++j) {\n+                        tablePath = CommadTools.DATA_BASE_NAME + File.separator + tableName + File.separator\n+                                + i + CommadTools.DIR_EXT + File.separator + j + CommadTools.FILE_EXT;\n+                        if (new File(tablePath).exists()) {\n+                            fillStorage(tablePath, file);\n+                            PrintWriter writer = new PrintWriter(new File(tablePath));\n+                            writer.print(\"\");\n+                            writer.close();\n+                        }\n+                    }\n+                }\n+                System.out.println(\"using \" + outputName);\n+                CommadTools.tableIsChosen = true;\n+            } else {\n+                System.err.println(tableName + \" not exists\");\n+                return false;\n+            }\n+        } else {\n+            System.out.println(\"using \" + oldTableName);\n+        }\n+        CommadTools.usingTableName = CommadTools.currentTable.getName();\n+        return true;\n+    }\n+\n+    void fillStorage(String datName, File file) throws IOException, ParseException {\n+        DataInputStream stream = new DataInputStream(new FileInputStream(datName));\n+        file = new File(datName);","path":"src/ru/fizteh/fivt/students/MaximGotovchits/Parallel/base/commands/Use.java","position":67,"original_position":67,"commit_id":"674eeece79e88de8b9c73980a0af036f26056bf5","original_commit_id":"674eeece79e88de8b9c73980a0af036f26056bf5","user":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=3","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},"body":"Это всё тоже должно уехать в пакет базы","created_at":"2015-02-17T07:19:13Z","updated_at":"2015-02-17T07:19:13Z","html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/585#discussion_r24797145","pull_request_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585","_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/comments/24797145"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/585#discussion_r24797145"},"pull_request":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585"}}},"pull_request":{"url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585","id":26552995,"html_url":"https://github.com/dkomanov/fizteh-java-2014/pull/585","diff_url":"https://github.com/dkomanov/fizteh-java-2014/pull/585.diff","patch_url":"https://github.com/dkomanov/fizteh-java-2014/pull/585.patch","issue_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/585","number":585,"state":"open","locked":false,"title":"Готовчиц Максим, 396, Parallel","user":{"login":"MaximGotovchits","id":8759433,"avatar_url":"https://avatars.githubusercontent.com/u/8759433?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximGotovchits","html_url":"https://github.com/MaximGotovchits","followers_url":"https://api.github.com/users/MaximGotovchits/followers","following_url":"https://api.github.com/users/MaximGotovchits/following{/other_user}","gists_url":"https://api.github.com/users/MaximGotovchits/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximGotovchits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximGotovchits/subscriptions","organizations_url":"https://api.github.com/users/MaximGotovchits/orgs","repos_url":"https://api.github.com/users/MaximGotovchits/repos","events_url":"https://api.github.com/users/MaximGotovchits/events{/privacy}","received_events_url":"https://api.github.com/users/MaximGotovchits/received_events","type":"User","site_admin":false},"body":"No Tests Edition","created_at":"2014-12-24T10:10:53Z","updated_at":"2015-02-17T07:19:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb47ef30334df5284f67c12fd4e5f621a76523a0","assignee":{"login":"vpavlenko","id":1491908,"avatar_url":"https://avatars.githubusercontent.com/u/1491908?v=3","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/585/commits","review_comments_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585/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/585/comments","statuses_url":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/674eeece79e88de8b9c73980a0af036f26056bf5","head":{"label":"MaximGotovchits:Parallel","ref":"Parallel","sha":"674eeece79e88de8b9c73980a0af036f26056bf5","user":{"login":"MaximGotovchits","id":8759433,"avatar_url":"https://avatars.githubusercontent.com/u/8759433?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximGotovchits","html_url":"https://github.com/MaximGotovchits","followers_url":"https://api.github.com/users/MaximGotovchits/followers","following_url":"https://api.github.com/users/MaximGotovchits/following{/other_user}","gists_url":"https://api.github.com/users/MaximGotovchits/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximGotovchits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximGotovchits/subscriptions","organizations_url":"https://api.github.com/users/MaximGotovchits/orgs","repos_url":"https://api.github.com/users/MaximGotovchits/repos","events_url":"https://api.github.com/users/MaximGotovchits/events{/privacy}","received_events_url":"https://api.github.com/users/MaximGotovchits/received_events","type":"User","site_admin":false},"repo":{"id":26563334,"name":"fizteh-java-2014","full_name":"MaximGotovchits/fizteh-java-2014","owner":{"login":"MaximGotovchits","id":8759433,"avatar_url":"https://avatars.githubusercontent.com/u/8759433?v=3","gravatar_id":"","url":"https://api.github.com/users/MaximGotovchits","html_url":"https://github.com/MaximGotovchits","followers_url":"https://api.github.com/users/MaximGotovchits/followers","following_url":"https://api.github.com/users/MaximGotovchits/following{/other_user}","gists_url":"https://api.github.com/users/MaximGotovchits/gists{/gist_id}","starred_url":"https://api.github.com/users/MaximGotovchits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaximGotovchits/subscriptions","organizations_url":"https://api.github.com/users/MaximGotovchits/orgs","repos_url":"https://api.github.com/users/MaximGotovchits/repos","events_url":"https://api.github.com/users/MaximGotovchits/events{/privacy}","received_events_url":"https://api.github.com/users/MaximGotovchits/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MaximGotovchits/fizteh-java-2014","description":"","fork":true,"url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014","forks_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/forks","keys_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/teams","hooks_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/hooks","issue_events_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/issues/events{/number}","events_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/events","assignees_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/assignees{/user}","branches_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/branches{/branch}","tags_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/tags","blobs_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/git/refs{/sha}","trees_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/statuses/{sha}","languages_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/languages","stargazers_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/stargazers","contributors_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/contributors","subscribers_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/subscribers","subscription_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/subscription","commits_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/commits{/sha}","git_commits_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/git/commits{/sha}","comments_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/comments{/number}","issue_comment_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/issues/comments/{number}","contents_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/contents/{+path}","compare_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/merges","archive_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/downloads","issues_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/issues{/number}","pulls_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/pulls{/number}","milestones_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/milestones{/number}","notifications_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/labels{/name}","releases_url":"https://api.github.com/repos/MaximGotovchits/fizteh-java-2014/releases{/id}","created_at":"2014-11-13T00:42:39Z","updated_at":"2014-11-13T00:42:42Z","pushed_at":"2015-02-13T19:23:15Z","git_url":"git://github.com/MaximGotovchits/fizteh-java-2014.git","ssh_url":"git@github.com:MaximGotovchits/fizteh-java-2014.git","clone_url":"https://github.com/MaximGotovchits/fizteh-java-2014.git","svn_url":"https://github.com/MaximGotovchits/fizteh-java-2014","homepage":null,"size":8719,"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":"4ecc81cf57f5b235dfc95abeee235da65c181ed2","user":{"login":"dkomanov","id":1158662,"avatar_url":"https://avatars.githubusercontent.com/u/1158662?v=3","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=3","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-12-27T19:21:06Z","pushed_at":"2014-12-27T15:00:31Z","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":35831,"stargazers_count":8,"watchers_count":8,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":52,"forks":84,"open_issues":52,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585"},"html":{"href":"https://github.com/dkomanov/fizteh-java-2014/pull/585"},"issue":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/585"},"comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/issues/585/comments"},"review_comments":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/pulls/585/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/585/commits"},"statuses":{"href":"https://api.github.com/repos/dkomanov/fizteh-java-2014/statuses/674eeece79e88de8b9c73980a0af036f26056bf5"}}}}