Skip to content

Commit

Permalink
Remove trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Oct 25, 2013
1 parent 068222a commit cd95a47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cpc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def submit(user, args)
if problem
problem = File.basename(problem)
end

problem_dir = "#{$problem_loc}/#{default_contest}/#{problem}"

if !problem
puts 'Must specify problem.'
false
Expand All @@ -101,16 +101,16 @@ def error_string(error_id)
def submissions(user, args)
contest = default_contest()
sql = 'SELECT problem.name, time, status, errorId, score
FROM submission
FROM submission
JOIN problem ON problem.id = submission.problem
JOIN contest ON contest.id = problem.contest
WHERE user = ? AND contest.alias = ?'

opts = GetoptLong.new(
['--user', '-u', GetoptLong::REQUIRED_ARGUMENT],
['--contest', '-c', GetoptLong::REQUIRED_ARGUMENT]
)

opts.each do |opt, arg|
case opt
when '--user'
Expand All @@ -119,7 +119,7 @@ def submissions(user, args)
contest = arg
end
end

db = SQLite3::Database.new 'cpc.db'
db.execute(sql, user, contest) do |row|
printf("%-15s %-50s %s %s", row[0], DateTime.strptime(row[1],"%s").strftime("%H:%M %Y/%m/%d"), status, status == "SUCCESS" ? row[2] : error_string(row[3]));
Expand Down

0 comments on commit cd95a47

Please sign in to comment.