{"action":"created","comment":{"url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/comments/60849729","id":60849729,"diff_hunk":"@@ -36,25 +38,28 @@ public static void main(String args[]) {\n \n         for (ExamMarks ex : list){\n             String clazz = ex.getClass().getName();\n-            t1 = t2 = time = 0;\n             System.out.println(\"#--------------------------------------------------\");\n             System.out.println(\"#  \\t\\t\" + clazz.replaceFirst(\"problems.problem2.\", \"\") + \" implementation.\");\n             System.out.println(\"#--------------------------------------------------\");\n             for (int t = SIZE_INI; t <= SIZE_FIN; t += SIZE_INCR) {\n-                //The mark should be random and not predefined\n-                int mark = (int)(Math.random()*(MAX_ARRAY - 1));\n-                vector = generateIncreasingRandoms(t, MAX_ARRAY);\n-                t1 = System.nanoTime();\n-                int n = ex.numberOfMarks(vector, mark);\n-                t2 = System.nanoTime();\n-                time += t2 - t1;\n-                //The boolean correct check if the algorithm work correctly\n-                boolean correct = (vector[vector.length-n-1]<=mark && vector[vector.length-n]>mark);\n-                System.out.printf(Locale.US, \" %1$8d %2$8.0f μs      %3$8d %4$8b\\n\",\n-                        t,\n-                        time / 1e3,\n-                        n,\n-                        correct);\n+                //Reset time\n+                time = 0;\n+                //The boolean correct check if the algorithm work correctly. Is correct until proven otherwise.\n+                boolean correct = true;\n+                for(int r = 0; r < REPETITIONS; r++) {\n+                    //The mark should be random and not predefined\n+                    int mark = random.nextInt(MAX_ARRAY-1);\n+                    vector = generateIncreasingRandoms(t, MAX_ARRAY);\n+                    t1 = System.nanoTime();\n+                    int n = ex.numberOfMarks(vector, mark);\n+                    t2 = System.nanoTime();\n+                    time += t2 - t1;\n+                    if(!(vector[vector.length-n-1]<=mark && vector[vector.length-n]>mark)){","path":"java/test/problems/problem2/NumberOfMarksCost.java","position":54,"original_position":54,"commit_id":"bba072b77100a93f85f725ee6cbb3541c1cc31bd","original_commit_id":"bba072b77100a93f85f725ee6cbb3541c1cc31bd","user":{"login":"tonilopezmr","id":5845622,"avatar_url":"https://avatars.githubusercontent.com/u/5845622?v=3","gravatar_id":"","url":"https://api.github.com/users/tonilopezmr","html_url":"https://github.com/tonilopezmr","followers_url":"https://api.github.com/users/tonilopezmr/followers","following_url":"https://api.github.com/users/tonilopezmr/following{/other_user}","gists_url":"https://api.github.com/users/tonilopezmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonilopezmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonilopezmr/subscriptions","organizations_url":"https://api.github.com/users/tonilopezmr/orgs","repos_url":"https://api.github.com/users/tonilopezmr/repos","events_url":"https://api.github.com/users/tonilopezmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonilopezmr/received_events","type":"User","site_admin":false},"body":"![](https://i.embed.ly/1/display/resize?key=1e6a1a1efdb011df84894040444cdc60&url=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv379%2Fcatsrluv%2FGIF%2Ftumblr_ln4fgbMfFP1qzk2upo1_500.gif)\r\n\r\nxD you are a fucker, it's not about if work correctly or not, it's about good code o 💩 code.","created_at":"2016-04-24T18:57:35Z","updated_at":"2016-04-24T18:57:35Z","html_url":"https://github.com/tonilopezmr/Algorithms/pull/27#discussion_r60849729","pull_request_url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/comments/60849729"},"html":{"href":"https://github.com/tonilopezmr/Algorithms/pull/27#discussion_r60849729"},"pull_request":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27","id":67645123,"html_url":"https://github.com/tonilopezmr/Algorithms/pull/27","diff_url":"https://github.com/tonilopezmr/Algorithms/pull/27.diff","patch_url":"https://github.com/tonilopezmr/Algorithms/pull/27.patch","issue_url":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/27","number":27,"state":"open","locked":false,"title":"My implementation and clean code in the test, I think...","user":{"login":"josegarm","id":18008078,"avatar_url":"https://avatars.githubusercontent.com/u/18008078?v=3","gravatar_id":"","url":"https://api.github.com/users/josegarm","html_url":"https://github.com/josegarm","followers_url":"https://api.github.com/users/josegarm/followers","following_url":"https://api.github.com/users/josegarm/following{/other_user}","gists_url":"https://api.github.com/users/josegarm/gists{/gist_id}","starred_url":"https://api.github.com/users/josegarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegarm/subscriptions","organizations_url":"https://api.github.com/users/josegarm/orgs","repos_url":"https://api.github.com/users/josegarm/repos","events_url":"https://api.github.com/users/josegarm/events{/privacy}","received_events_url":"https://api.github.com/users/josegarm/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-24T18:17:32Z","updated_at":"2016-04-24T18:57:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"acc50363fcabf7e14ba37a4bc10eaa1da649f577","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27/commits","review_comments_url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27/comments","review_comment_url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/27/comments","statuses_url":"https://api.github.com/repos/tonilopezmr/Algorithms/statuses/bba072b77100a93f85f725ee6cbb3541c1cc31bd","head":{"label":"josegarm:master","ref":"master","sha":"bba072b77100a93f85f725ee6cbb3541c1cc31bd","user":{"login":"josegarm","id":18008078,"avatar_url":"https://avatars.githubusercontent.com/u/18008078?v=3","gravatar_id":"","url":"https://api.github.com/users/josegarm","html_url":"https://github.com/josegarm","followers_url":"https://api.github.com/users/josegarm/followers","following_url":"https://api.github.com/users/josegarm/following{/other_user}","gists_url":"https://api.github.com/users/josegarm/gists{/gist_id}","starred_url":"https://api.github.com/users/josegarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegarm/subscriptions","organizations_url":"https://api.github.com/users/josegarm/orgs","repos_url":"https://api.github.com/users/josegarm/repos","events_url":"https://api.github.com/users/josegarm/events{/privacy}","received_events_url":"https://api.github.com/users/josegarm/received_events","type":"User","site_admin":false},"repo":{"id":56886067,"name":"Algorithms","full_name":"josegarm/Algorithms","owner":{"login":"josegarm","id":18008078,"avatar_url":"https://avatars.githubusercontent.com/u/18008078?v=3","gravatar_id":"","url":"https://api.github.com/users/josegarm","html_url":"https://github.com/josegarm","followers_url":"https://api.github.com/users/josegarm/followers","following_url":"https://api.github.com/users/josegarm/following{/other_user}","gists_url":"https://api.github.com/users/josegarm/gists{/gist_id}","starred_url":"https://api.github.com/users/josegarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josegarm/subscriptions","organizations_url":"https://api.github.com/users/josegarm/orgs","repos_url":"https://api.github.com/users/josegarm/repos","events_url":"https://api.github.com/users/josegarm/events{/privacy}","received_events_url":"https://api.github.com/users/josegarm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josegarm/Algorithms","description":"Solutions for some common algorithm problems written in Python, Swift and Java for EDA University subject.","fork":true,"url":"https://api.github.com/repos/josegarm/Algorithms","forks_url":"https://api.github.com/repos/josegarm/Algorithms/forks","keys_url":"https://api.github.com/repos/josegarm/Algorithms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josegarm/Algorithms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josegarm/Algorithms/teams","hooks_url":"https://api.github.com/repos/josegarm/Algorithms/hooks","issue_events_url":"https://api.github.com/repos/josegarm/Algorithms/issues/events{/number}","events_url":"https://api.github.com/repos/josegarm/Algorithms/events","assignees_url":"https://api.github.com/repos/josegarm/Algorithms/assignees{/user}","branches_url":"https://api.github.com/repos/josegarm/Algorithms/branches{/branch}","tags_url":"https://api.github.com/repos/josegarm/Algorithms/tags","blobs_url":"https://api.github.com/repos/josegarm/Algorithms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josegarm/Algorithms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josegarm/Algorithms/git/refs{/sha}","trees_url":"https://api.github.com/repos/josegarm/Algorithms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josegarm/Algorithms/statuses/{sha}","languages_url":"https://api.github.com/repos/josegarm/Algorithms/languages","stargazers_url":"https://api.github.com/repos/josegarm/Algorithms/stargazers","contributors_url":"https://api.github.com/repos/josegarm/Algorithms/contributors","subscribers_url":"https://api.github.com/repos/josegarm/Algorithms/subscribers","subscription_url":"https://api.github.com/repos/josegarm/Algorithms/subscription","commits_url":"https://api.github.com/repos/josegarm/Algorithms/commits{/sha}","git_commits_url":"https://api.github.com/repos/josegarm/Algorithms/git/commits{/sha}","comments_url":"https://api.github.com/repos/josegarm/Algorithms/comments{/number}","issue_comment_url":"https://api.github.com/repos/josegarm/Algorithms/issues/comments{/number}","contents_url":"https://api.github.com/repos/josegarm/Algorithms/contents/{+path}","compare_url":"https://api.github.com/repos/josegarm/Algorithms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josegarm/Algorithms/merges","archive_url":"https://api.github.com/repos/josegarm/Algorithms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josegarm/Algorithms/downloads","issues_url":"https://api.github.com/repos/josegarm/Algorithms/issues{/number}","pulls_url":"https://api.github.com/repos/josegarm/Algorithms/pulls{/number}","milestones_url":"https://api.github.com/repos/josegarm/Algorithms/milestones{/number}","notifications_url":"https://api.github.com/repos/josegarm/Algorithms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josegarm/Algorithms/labels{/name}","releases_url":"https://api.github.com/repos/josegarm/Algorithms/releases{/id}","deployments_url":"https://api.github.com/repos/josegarm/Algorithms/deployments","created_at":"2016-04-22T21:23:42Z","updated_at":"2016-04-22T21:23:43Z","pushed_at":"2016-04-24T18:16:19Z","git_url":"git://github.com/josegarm/Algorithms.git","ssh_url":"git@github.com:josegarm/Algorithms.git","clone_url":"https://github.com/josegarm/Algorithms.git","svn_url":"https://github.com/josegarm/Algorithms","homepage":null,"size":99,"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":"tonilopezmr:master","ref":"master","sha":"a11e027c87cc31884ea12afc6a462a9483b761fe","user":{"login":"tonilopezmr","id":5845622,"avatar_url":"https://avatars.githubusercontent.com/u/5845622?v=3","gravatar_id":"","url":"https://api.github.com/users/tonilopezmr","html_url":"https://github.com/tonilopezmr","followers_url":"https://api.github.com/users/tonilopezmr/followers","following_url":"https://api.github.com/users/tonilopezmr/following{/other_user}","gists_url":"https://api.github.com/users/tonilopezmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonilopezmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonilopezmr/subscriptions","organizations_url":"https://api.github.com/users/tonilopezmr/orgs","repos_url":"https://api.github.com/users/tonilopezmr/repos","events_url":"https://api.github.com/users/tonilopezmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonilopezmr/received_events","type":"User","site_admin":false},"repo":{"id":51225691,"name":"Algorithms","full_name":"tonilopezmr/Algorithms","owner":{"login":"tonilopezmr","id":5845622,"avatar_url":"https://avatars.githubusercontent.com/u/5845622?v=3","gravatar_id":"","url":"https://api.github.com/users/tonilopezmr","html_url":"https://github.com/tonilopezmr","followers_url":"https://api.github.com/users/tonilopezmr/followers","following_url":"https://api.github.com/users/tonilopezmr/following{/other_user}","gists_url":"https://api.github.com/users/tonilopezmr/gists{/gist_id}","starred_url":"https://api.github.com/users/tonilopezmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonilopezmr/subscriptions","organizations_url":"https://api.github.com/users/tonilopezmr/orgs","repos_url":"https://api.github.com/users/tonilopezmr/repos","events_url":"https://api.github.com/users/tonilopezmr/events{/privacy}","received_events_url":"https://api.github.com/users/tonilopezmr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonilopezmr/Algorithms","description":"Solutions for some common algorithm problems written in Python, Swift and Java for EDA University subject.","fork":false,"url":"https://api.github.com/repos/tonilopezmr/Algorithms","forks_url":"https://api.github.com/repos/tonilopezmr/Algorithms/forks","keys_url":"https://api.github.com/repos/tonilopezmr/Algorithms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonilopezmr/Algorithms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonilopezmr/Algorithms/teams","hooks_url":"https://api.github.com/repos/tonilopezmr/Algorithms/hooks","issue_events_url":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/events{/number}","events_url":"https://api.github.com/repos/tonilopezmr/Algorithms/events","assignees_url":"https://api.github.com/repos/tonilopezmr/Algorithms/assignees{/user}","branches_url":"https://api.github.com/repos/tonilopezmr/Algorithms/branches{/branch}","tags_url":"https://api.github.com/repos/tonilopezmr/Algorithms/tags","blobs_url":"https://api.github.com/repos/tonilopezmr/Algorithms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonilopezmr/Algorithms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonilopezmr/Algorithms/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonilopezmr/Algorithms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonilopezmr/Algorithms/statuses/{sha}","languages_url":"https://api.github.com/repos/tonilopezmr/Algorithms/languages","stargazers_url":"https://api.github.com/repos/tonilopezmr/Algorithms/stargazers","contributors_url":"https://api.github.com/repos/tonilopezmr/Algorithms/contributors","subscribers_url":"https://api.github.com/repos/tonilopezmr/Algorithms/subscribers","subscription_url":"https://api.github.com/repos/tonilopezmr/Algorithms/subscription","commits_url":"https://api.github.com/repos/tonilopezmr/Algorithms/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonilopezmr/Algorithms/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonilopezmr/Algorithms/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonilopezmr/Algorithms/contents/{+path}","compare_url":"https://api.github.com/repos/tonilopezmr/Algorithms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonilopezmr/Algorithms/merges","archive_url":"https://api.github.com/repos/tonilopezmr/Algorithms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonilopezmr/Algorithms/downloads","issues_url":"https://api.github.com/repos/tonilopezmr/Algorithms/issues{/number}","pulls_url":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls{/number}","milestones_url":"https://api.github.com/repos/tonilopezmr/Algorithms/milestones{/number}","notifications_url":"https://api.github.com/repos/tonilopezmr/Algorithms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonilopezmr/Algorithms/labels{/name}","releases_url":"https://api.github.com/repos/tonilopezmr/Algorithms/releases{/id}","deployments_url":"https://api.github.com/repos/tonilopezmr/Algorithms/deployments","created_at":"2016-02-06T22:42:37Z","updated_at":"2016-04-21T09:50:20Z","pushed_at":"2016-04-24T18:17:33Z","git_url":"git://github.com/tonilopezmr/Algorithms.git","ssh_url":"git@github.com:tonilopezmr/Algorithms.git","clone_url":"https://github.com/tonilopezmr/Algorithms.git","svn_url":"https://github.com/tonilopezmr/Algorithms","homepage":null,"size":98,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":12,"forks":5,"open_issues":12,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27"},"html":{"href":"https://github.com/tonilopezmr/Algorithms/pull/27"},"issue":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/27"},"comments":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/tonilopezmr/Algorithms/statuses/bba072b77100a93f85f725ee6cbb3541c1cc31bd"}}}}