Description:
add thousand separater for mem reportt
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r439:22297d4b2aee - - 2 files changed: 3 inserted, 3 deleted

@@ -1,31 +1,31
1 %style{type: "text/css"}
1 %style{type: "text/css"}
2 = @css_style
2 = @css_style
3
3
4 %h1= "Submission: #{@submission.id}"
4 %h1= "Submission: #{@submission.id}"
5
5
6 %p
6 %p
7 User:
7 User:
8 = "(#{@submission.user.login}) #{@submission.user.full_name}"
8 = "(#{@submission.user.login}) #{@submission.user.full_name}"
9 %br/
9 %br/
10 Problem:
10 Problem:
11 - if @submission.problem!=nil
11 - if @submission.problem!=nil
12 = "(#{@submission.problem.name}) #{@submission.problem.full_name}"
12 = "(#{@submission.problem.name}) #{@submission.problem.full_name}"
13 - else
13 - else
14 = "(n/a)"
14 = "(n/a)"
15 %br/
15 %br/
16 = "Number: #{@submission.number}"
16 = "Number: #{@submission.number}"
17 %br/
17 %br/
18 = "Submitted: #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})"
18 = "Submitted: #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})"
19 %br/
19 %br/
20 = "Points: #{@submission.points}/#{@submission.problem.full_score}"
20 = "Points: #{@submission.points}/#{@submission.problem.full_score}"
21 %br/
21 %br/
22 = "Comment: #{@submission.grader_comment}"
22 = "Comment: #{@submission.grader_comment}"
23 %br/
23 %br/
24 - = "Runtime (ms): #{@submission.max_runtime}"
24 + = "Runtime (s): #{@submission.max_runtime}"
25 %br/
25 %br/
26 - = "Memory (kb): #{@submission.peak_memory}"
26 + = "Memory (kb): #{number_with_delimiter(@submission.peak_memory)}"
27
27
28 %b Source code (first 10kb)
28 %b Source code (first 10kb)
29 //%div.highlight{:style => "border: 1px solid black;"}
29 //%div.highlight{:style => "border: 1px solid black;"}
30 =@formatted_code.html_safe
30 =@formatted_code.html_safe
31
31
@@ -1,79 +1,79
1 :css
1 :css
2 .hof_user { color: orangered; font-style: italic; }
2 .hof_user { color: orangered; font-style: italic; }
3 .hof_language { color: green; font-style: italic; }
3 .hof_language { color: green; font-style: italic; }
4 .hof_value { color: deeppink;font-style: italic; }
4 .hof_value { color: deeppink;font-style: italic; }
5
5
6 %h2 Overall
6 %h2 Overall
7
7
8 - if @best
8 - if @best
9 %b Best Runtime:
9 %b Best Runtime:
10 by #{link_to @best[:runtime][:user], controller:'users', action:'profile', id:@best[:memory][:user_id]}
10 by #{link_to @best[:runtime][:user], controller:'users', action:'profile', id:@best[:memory][:user_id]}
11 using <span class="hof_language">#{@best[:runtime][:lang]}</span>
11 using <span class="hof_language">#{@best[:runtime][:lang]}</span>
12 with <span class="hof_value">#{@best[:runtime][:value] * 1000} milliseconds</span>
12 with <span class="hof_value">#{@best[:runtime][:value] * 1000} milliseconds</span>
13 at submission
13 at submission
14 = link_to("#" + @best[:runtime][:sub_id].to_s, controller: 'graders', action: 'submission', id:@best[:runtime][:sub_id])
14 = link_to("#" + @best[:runtime][:sub_id].to_s, controller: 'graders', action: 'submission', id:@best[:runtime][:sub_id])
15 %br/
15 %br/
16
16
17 %b Best Memory Usage:
17 %b Best Memory Usage:
18 by #{link_to @best[:memory][:user], controller:'users', action:'profile', id:@best[:memory][:user_id]}
18 by #{link_to @best[:memory][:user], controller:'users', action:'profile', id:@best[:memory][:user_id]}
19 using <span class="hof_language">#{@best[:memory][:lang]}</span>
19 using <span class="hof_language">#{@best[:memory][:lang]}</span>
20 with <span class="hof_value">#{@best[:memory][:value]} kbytes </span>
20 with <span class="hof_value">#{@best[:memory][:value]} kbytes </span>
21 at submission
21 at submission
22 = link_to("#" + @best[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id:@best[:memory][:sub_id])
22 = link_to("#" + @best[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id:@best[:memory][:sub_id])
23 %br/
23 %br/
24
24
25 %b Shortest Code:
25 %b Shortest Code:
26 by #{link_to @best[:length][:user], controller:'users', action:'profile', id:@best[:length][:user_id]}
26 by #{link_to @best[:length][:user], controller:'users', action:'profile', id:@best[:length][:user_id]}
27 using <span class="hof_language">#{@best[:length][:lang]}</span>
27 using <span class="hof_language">#{@best[:length][:lang]}</span>
28 with <span class="hof_value">#{@best[:length][:value]} bytes</span>
28 with <span class="hof_value">#{@best[:length][:value]} bytes</span>
29 at submission
29 at submission
30 = link_to("#" + @best[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:length][:sub_id])
30 = link_to("#" + @best[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:length][:sub_id])
31 %br/
31 %br/
32
32
33 %b First solver:
33 %b First solver:
34 #{link_to @best[:first][:user], controller:'users', action:'profile', id:@best[:first][:user_id]} is the first solver
34 #{link_to @best[:first][:user], controller:'users', action:'profile', id:@best[:first][:user_id]} is the first solver
35 using <span class="hof_language">#{@best[:first][:lang]}</span>
35 using <span class="hof_language">#{@best[:first][:lang]}</span>
36 on <span class="hof_value">#{@best[:first][:value]}</span>
36 on <span class="hof_value">#{@best[:first][:value]}</span>
37 at submission
37 at submission
38 = link_to("#" + @best[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:first][:sub_id])
38 = link_to("#" + @best[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:first][:sub_id])
39 %br/
39 %br/
40
40
41
41
42 %p
42 %p
43 This counts only for submission with 100% score <br/>
43 This counts only for submission with 100% score <br/>
44 Right now, java is excluded from memory usage competition. (Because it always uses 2GB memory...)
44 Right now, java is excluded from memory usage competition. (Because it always uses 2GB memory...)
45
45
46 %h2 By language
46 %h2 By language
47
47
48 %table.info
48 %table.info
49 %thead
49 %thead
50 %tr.info-head
50 %tr.info-head
51 %th Language
51 %th Language
52 %th Best runtime (ms)
52 %th Best runtime (ms)
53 %th Best memory (kbytes)
53 %th Best memory (kbytes)
54 %th Shortest Code (bytes)
54 %th Shortest Code (bytes)
55 %th First solver
55 %th First solver
56 %tbody
56 %tbody
57 - @by_lang.each do |lang,value|
57 - @by_lang.each do |lang,value|
58 %tr{class: cycle('info-even','info-odd')}
58 %tr{class: cycle('info-even','info-odd')}
59 %td= lang
59 %td= lang
60 %td
60 %td
61 = link_to value[:runtime][:user], controller: 'users', action: 'profile', id: value[:runtime][:user_id]
61 = link_to value[:runtime][:user], controller: 'users', action: 'profile', id: value[:runtime][:user_id]
62 = "(#{(value[:runtime][:value] * 1000).to_i} @"
62 = "(#{(value[:runtime][:value] * 1000).to_i} @"
63 = "#{link_to("#" + value[:runtime][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:runtime][:sub_id])} )".html_safe
63 = "#{link_to("#" + value[:runtime][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:runtime][:sub_id])} )".html_safe
64 %td
64 %td
65 = link_to value[:memory][:user], controller: 'users', action: 'profile', id: value[:memory][:user_id]
65 = link_to value[:memory][:user], controller: 'users', action: 'profile', id: value[:memory][:user_id]
66 - = "(#{value[:memory][:value]} @"
66 + = "(#{number_with_delimiter(value[:memory][:value])} @"
67 = "#{link_to("#" + value[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:memory][:sub_id])} )".html_safe
67 = "#{link_to("#" + value[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:memory][:sub_id])} )".html_safe
68 %td
68 %td
69 = link_to value[:length][:user], controller: 'users', action: 'profile', id: value[:length][:user_id]
69 = link_to value[:length][:user], controller: 'users', action: 'profile', id: value[:length][:user_id]
70 = "(#{value[:length][:value]} @"
70 = "(#{value[:length][:value]} @"
71 = "#{link_to("#" + value[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:length][:sub_id])} )".html_safe
71 = "#{link_to("#" + value[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:length][:sub_id])} )".html_safe
72 %td
72 %td
73 - if value[:first][:user] != '(NULL)' #TODO: i know... this is wrong...
73 - if value[:first][:user] != '(NULL)' #TODO: i know... this is wrong...
74 = link_to value[:first][:user], controller: 'users', action: 'profile', id: value[:first][:user_id]
74 = link_to value[:first][:user], controller: 'users', action: 'profile', id: value[:first][:user_id]
75 = "(#{value[:first][:value]} @"
75 = "(#{value[:first][:value]} @"
76 = "#{link_to("#" + value[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:first][:sub_id])} )".html_safe
76 = "#{link_to("#" + value[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:first][:sub_id])} )".html_safe
77
77
78 - else
78 - else
79 %h3 No submissions
79 %h3 No submissions
You need to be logged in to leave comments. Login now