GithubHelp home page GithubHelp logo

amirasaad / codejam-commandline Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 332 KB

Automatically exported from code.google.com/p/codejam-commandline

License: Apache License 2.0

Python 99.28% C++ 0.72%

codejam-commandline's People

Watchers

 avatar  avatar

codejam-commandline's Issues

Submission failure

Immediately after this failed, I tried it on the website where it worked.

krka@kristofer:~/dev/codejam/2012-04-14$ ./gcj_submit_solution.py B small 0
-------------------------------------------------------------------------------
Small output for "B - Dancing With the Googlers" at "source/B-small.out"
-------------------------------------------------------------------------------
Getting status of contest 1460488 from "code.google.com"...
200 OK, 585 bytes read from server (1021 uncompressed).
Getting user status at contest 1460488 from "code.google.com"...
200 OK, 99 bytes read from server (162 uncompressed).
You cannot submit B-small, the timer expired or you did not download this input.

Original issue reported on code.google.com by [email protected] on 14 Apr 2012 at 10:37

  • Merged into: #20

Line ending weirdness

What steps will reproduce the problem?
1. Download input files in Cygwin (using Cygwin's python interpreter)

What is the expected output? What do you see instead?
I expect input files with UNIX line endings, I get DOS line endings

What version of the product are you using? On what operating system?
This works properly in real Linux, but something interesting is happening with 
Cygwin's python.

I fixed this behaviour by modifying "lib/input_downloader.py", line 101, to use 
mode 'w' instead of 'wt'.  These should mean the same thing (I think), but at 
least for me, 'wt' causes DOS line endings with Cygwin python (2.6.7).  AFAIK 
changing this to 'w' shouldn't break anything on other platforms.

I also changed line 94 of "lib/data_manager.py" in a similar way, for the sake 
of aesthetics.

Original issue reported on code.google.com by [email protected] on 9 Jun 2012 at 9:10

The solved time is blank if there are 2 large inputs

What steps will reproduce the problem?
1. Participate in a contest with some problem having 2 large (or small) inputs 
like Problem C of Qualification Round of 2013
2. Run gcj_get_status.py.
3. The solved time of the second large input is blank.

I tracked the running process, and found that the input_id field of 
UserSubmission of large2 in HTTP response is 1.  However, 2 is correct.

Original issue reported on code.google.com by [email protected] on 23 Apr 2013 at 3:06

Indentation in user_config.py unallowed ?

What steps will reproduce the problem?
1. $ ./gcj_init_contest.py 433101
2. $ ./gcj_download_input.py

What is the expected output? What do you see instead?
Traceback (most recent call last):
  File "../cl/gcj_download_input.py", line 263, in <module>
    main()
  File "../cl/gcj_download_input.py", line 94, in main
    if not contest_manager.IsInitialized():
  File "/mnt/hgfs/Projects/jam/1a/cl/lib/contest_manager.py", line 238, in IsInitialized
    current_config = data_manager.ReadData()
  File "/mnt/hgfs/Projects/jam/1a/cl/lib/data_manager.py", line 161, in ReadData
    user_data = _ReadDataImpl(user_config_path)
  File "/mnt/hgfs/Projects/jam/1a/cl/lib/data_manager.py", line 62, in _ReadDataImpl
    return eval(file_data, {}, {})
  File "<string>", line 2
    {
    ^
IndentationError: unexpected indent

What version of the product are you using? On what operating system?
Version : codejam-commandline-1.0-beta3.zip
Ubuntu 10.10 32 bits

Please provide any additional information below.
Here is the user_config.py
# -*- coding: utf-8 -*-
    {
    'host'                : 'code.google.com',
    'user'                : '****@gmail.com',
    'password'            : '****',
    'data_directory'      : '../A/',
    'input_name_format'   : '{problem}-{input}-{id}.in',
    'output_name_format'  : '{problem}-{input}-{id}.out',
    'source_names_format' : ['main.cpp'],
    }
Apparently, everything get fixed when I unindent everything like this
# -*- coding: utf-8 -*-
{
'host'                : 'code.google.com',
'user'                : '****@gmail.com',
'password'            : '****',
'data_directory'      : '../A/',
'input_name_format'   : '{problem}-{input}-{id}.in',
'output_name_format'  : '{problem}-{input}-{id}.out',
'source_names_format' : ['main.cpp'],
}
This is why it previously said : 
File "<string>", line 2
    {
    ^
Anyway, I think it would be great to support indentation because many editors 
want to put them.

Thank you so much for this tool !

Original issue reported on code.google.com by [email protected] on 20 May 2011 at 9:33

gcj_submit_solution.py ignores base_dir option (patch attached)

What steps will reproduce the problem?
1. download input with python ../gcj/gcj_download_input.py --base_dir=. a small 
0
2. generate a-small-0.out
3. try to submit solution with python ../gcj/gcj_submit_solution.py 
--base_dir=. a small 0

What is the expected output? What do you see instead?

* Expected: solution submitted ok

* Actual result: ConfigurationError: Contest is not initialized, please 
initialize the contest before trying to download intput files.

What version of the product are you using? On what operating system?

* svn r8, win7 x64 + py 2.6.6 32bit

Please provide any additional information below.

* patch attached (and tested) - also the confusing error message is updated

Original issue reported on code.google.com by [email protected] on 21 May 2011 at 6:34

Attachments:

#!/usr/bin/python2 should be replaced with #!/usr/bin/env python

What steps will reproduce the problem?
1. Attempt to execute any of the python files

What is the expected output? What do you see instead?

The program runs.

/usr/bin/python2: bad interpreter: No such file or directory

What version of the product are you using? On what operating system?

1.0-beta2, Ubuntu 11.04

Please provide any additional information below.

PEP-394 specifies the presence of /usr/bin/python2 interpreter, but it's two 
months old, so it's not in most distributions-- at least, not Ubuntu 11.04.



Original issue reported on code.google.com by [email protected] on 7 May 2011 at 1:09

Command line tools work for practice mode only

What steps will reproduce the problem?

It seems that the scripts only work in practice mode for me.
$ ./gcj_download_input.py B small 0
$ ./gcj_get_status.py

What is the expected output? What do you see instead?

gcj_download_input.py always shows ServerError in competition mode (it works in 
practice mode though):

-------------------------------------------------------------------------------
Small input for "B - Space Emergency" at "source/B-small-0.in"
-------------------------------------------------------------------------------
Getting status of contest 1128486 from "code.google.com"...
200 OK, 71 bytes read from server (60 uncompressed).
Getting user status at contest 1128486 from "code.google.com"...
200 OK, 32 bytes read from server (12 uncompressed).
Downloading practice input file.
Getting input file "source/B-small-0.in" from "code.google.com"...
200 OK, 0 bytes read from server.
ServerError: No response received from the server. This generally happens when:
  - You try to download a small input but it is already solved.
  - You try to download the large input before solving the small input.
  - You try to redownload the large but its timer already expired.


gcj_get_status.py simply shows error messages:

Getting user status at contest 1128486 from "code.google.com"...
200 OK, 32 bytes read from server (12 uncompressed).
Getting events of contest 1128486 from "code.google.com"...
200 OK, 695 bytes read from server (1407 uncompressed).
Traceback (most recent call last):
  File "./gcj_get_status.py", line 171, in <module>
    main()
  File "./gcj_get_status.py", line 143, in main
    user_status.FixStatusWithSubmissions(status, submissions, input_spec)
  File "/home/svn/public/codejam/lib/user_status.py", line 240, in FixStatusWithSubmissions
    for problem_status in status.problem_inputs:
AttributeError: 'NoneType' object has no attribute 'problem_inputs'

What version of the product are you using? On what operating system?

$ python -V
Python 2.6.6

$ uname -a
FreeBSD cn1.leeym.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 
UTC 2011     [email protected]:/usr/obj/usr/src/sys/GENERIC  i386

Please provide any additional information below.

My account is '[email protected]' which is not @gmail.com account. Not sure if it 
matters.

Original issue reported on code.google.com by leeym%[email protected] on 22 May 2011 at 11:17

Relative paths ("../" or "~/") don't work in data_directory config

What steps will reproduce the problem?
1. Change the data_directory configuration value to "../src/"
2. Initialize the contest and try to download an input
3. Server returns a 302 error and no input is downloaded

What is the expected output? What do you see instead?
Expected to have the input file downloaded properly. Instead, ServerError 
occurs, see the full output in the addl information section below


What version of the product are you using? On what operating system?
1.2 beta1
OSX 10.9.2


Please provide any additional information below.

Full shell output:
codejam-commandline-1.2-beta1 $ python2 gcj_download_input.py A small 0
-------------------------------------------------------------------------------
Small input for "A - Magic Trick" at "../src/2014/qual/A-small-0.in"
-------------------------------------------------------------------------------
Getting status of contest 2974486 from "code.google.com"...
200 OK, 584 bytes read from server (1017 uncompressed).
Getting user status at contest 2974486 from "code.google.com"...
200 OK, 103 bytes read from server (169 uncompressed).
Downloading practice input file.
Getting input file "../src/2014/qual/A-small-0.in" from "code.google.com"...
302 Found, 578 bytes read from server.
ServerError: Error while communicating with the server, cannot download input. 
Check that the host, username and contest id are valid.

Original issue reported on code.google.com by [email protected] on 25 Apr 2014 at 3:16

list index out of range when trying to download input

(It worked fine to download through the website)

krka@kristofer:~/dev/codejam/2012-04-14$ ./gcj_download_input.py D small 0
-------------------------------------------------------------------------------
Small input for "D - Hall of Mirrors" at "source/D-small.in"
-------------------------------------------------------------------------------
Getting status of contest 1460488 from "code.google.com"...
200 OK, 579 bytes read from server (1021 uncompressed).
Getting user status at contest 1460488 from "code.google.com"...
200 OK, 105 bytes read from server (168 uncompressed).
Traceback (most recent call last):
  File "./gcj_download_input.py", line 263, in <module>
    main()
  File "./gcj_download_input.py", line 208, in main
    problem_input_state = problem_inputs[problem_index][input_index]
IndexError: list index out of range

Original issue reported on code.google.com by [email protected] on 14 Apr 2012 at 10:35

  • Merged into: #20

Won't Work Unless Less Secure Apps Allowed

What steps will reproduce the problem?
1. Put user email in user_config.py. Account with 2FA but without less secure 
apps allowed.
2. Run gcj_init_contest.py.
3. Enter correct password.

What is the expected output?
Successfully logged into "code.google.com" with user "<username>"
Followed by initialization of contest

What do you see instead?
Traceback (most recent call last):
  File "./gcj_init_contest.py", line 81, in <module>
    main()
  File "./gcj_init_contest.py", line 63, in main
    contest_manager.Initialize(-1, contest_id, options.password)
  File "/vagrant/command/lib/contest_manager.py", line 232, in Initialize
    code_jam_login.Login(password)
  File "/vagrant/command/lib/code_jam_login.py", line 306, in Login
    _, cookie = MakeLogin(host, user, password)
  File "/vagrant/command/lib/code_jam_login.py", line 160, in MakeLogin
    host, 'HOSTED_OR_GOOGLE', user, password, 'ah', application_name, False)
  File "/vagrant/command/lib/google_login.py", line 199, in Login
    source)
  File "/vagrant/command/lib/google_login.py", line 123, in _GetGoogleAuthtoken
    response_dict = _ParseBodyAsDict(e.read())
  File "/vagrant/command/lib/google_login.py", line 69, in _ParseBodyAsDict
    return dict(line.split('=') for line in body.split('\n') if line)
ValueError: dictionary update sequence element #1 has length 5; 2 is required

Receive an email subject: "Google Account: sign-in attempt blocked"
Included in text: "You can switch to an app made by Google such as Gmail to 
access your account (recommended) or change your settings at 
https://www.google.com/settings/security/lesssecureapps so that your account is 
no longer protected by modern security standards."

What version of the product are you using? On what operating system?
1.2-beta1, win8

Please provide any additional information below.

Workaround is to set my Google account so that it is no longer protected by 
modern security standards.

Original issue reported on code.google.com by [email protected] on 18 Mar 2015 at 1:11

Patch for /trunk/README

Proofread of the README

Change "a confirmation" to "for confirmation".
Also, should line 158 be ".cpp, library.cpp, and library.cpp as the source 
files" (include template.txt)? 
"at which input has been solved" to "at which each input was solved" (the usage 
of input for "correct outputs for a given input" is somewhat confusing, but 
it's clear enough)

Original issue reported on code.google.com by [email protected] on 21 May 2011 at 3:38

Attachments:

Working directory requirement is overly restrictive

What steps will reproduce the problem?
1. Call program from another directory (e.g. 
'../submitTool/gcj_init_contest.py')

What is the expected output? What do you see instead?

Error is expected (mentioned in documentation that scripts must be called from 
the proper directory) -- I get an error message mentioning failure to find 
config file.  See below (additional information) for how I feel the program 
should work & reasons why.

What version of the product are you using? On what operating system?

Beta2, linux x86 (Python 2.7.1)

Please provide any additional information below.

It would be more user-friendly if we could call the scripts from within the 
source file directory (either typing in the relative path or using an alias).  
This would obviate the need to configure the source file location, and 
facilitate the submission of files from different directories corresponding to 
different contests.  The contest-id corresponding to a given source directory 
could also be stored in a specially-named config file in that directory, 
minimizing the configuration required to participate in a different contest.  

IOW contest-specific configuration should be contained in the source directory 
and located based on where the program is called from (+ an optional 
commandline parameter) while site-specific configuration should stay where it 
currently is.

I don't know Python but surely it's possible for the script to discover where 
it is located in the filesystem and thus find the 'config' directory no matter 
where it's called from?


Original issue reported on code.google.com by [email protected] on 8 May 2011 at 4:36

Commandline tool gets checker comment

What steps will reproduce the problem?
1. Make an incorrect submition for problem C-small of yesturday's round

What is the expected output? What do you see instead?

Only word Incorrect. But I got information like "In test 13 6-th can see 9-th 
but should see 8-th".

What version of the product are you using? On what operating system?

Windows 7, version dowloadable in downloads, beta4.
But --version says 1.0-beta3. 


Original issue reported on code.google.com by [email protected] on 27 May 2012 at 6:12

Readme

Readme is permeated with many syntax and grammer errors
I can fix it and send a revised version if you guys want, but, then again I'll 
bet google has at least one unemployed grammarian at any given time.

Original issue reported on code.google.com by [email protected] on 8 May 2011 at 2:49

Exception "AttributeError: can't set attribute" instead of error message on invalid credentials

What steps will reproduce the problem?
1. Put user email in user_config.py
2. Run gcj_init_contest.py
3. Enter invalid password

What is the expected output?
"Invalid user email or password" error message

What do you see instead?
Traceback (most recent call last):
  File "gcj\gcj_renew_login.py", line 79, in <module>
    main()
  File "gcj\gcj_renew_login.py", line 61, in main
    code_jam_login.Login(options.password)
  File "gcj\lib\code_jam_login.py", line 306, in Login
    _, cookie = MakeLogin(host, user, password)
  File "gcj\lib\code_jam_login.py", line 160, in MakeLogin
    host, 'HOSTED_OR_GOOGLE', user, password, 'ah', application_name, False)
  File "gcj\lib\google_login.py", line 199, in Login
    source)
  File "gcj\lib\google_login.py", line 125, in _GetGoogleAuthtoken
    e.headers, response_dict)
  File "gcj\lib\google_login.py", line 38, in __init__
    self.reason = args["Error"]
AttributeError: can't set attribute

What version of the product are you using? On what operating system?
1.2-beta1, win7 x64

Original issue reported on code.google.com by [email protected] on 16 Apr 2014 at 4:51

How about adding an option to download the example input and output given with the problems?

This can be done rather simply by adding two files in the server

example.in and example.out and adding an option to download them from the 
script, that way the whole stage can be automated something like this

iterate on stages
    get example.in and downed_example.out

    while not passed stage (example.out != downed_example.out)
        run the code

    get small.in run script and submit small.out and source
    get large.in run script and submit large.out and source

print a nice message to say the contest is over

Original issue reported on code.google.com by [email protected] on 9 May 2011 at 11:30

Add support for two factor authentication

What steps will reproduce the problem?
1. Put user email in user_config.py. Use one with enabled 2FA.
2. Run gcj_init_contest.py.
3. Enter correct password.

What is the expected output?
Prompt to enter 6-digit 2FA time/sms code.

What do you see instead?
Traceback (most recent call last):
  File "gcj\gcj_renew_login.py", line 79, in <module>
    main()
  File "gcj\gcj_renew_login.py", line 61, in main
    code_jam_login.Login(options.password)
  File "gcj\lib\code_jam_login.py", line 306, in Login
    _, cookie = MakeLogin(host, user, password)
  File "gcj\lib\code_jam_login.py", line 160, in MakeLogin
    host, 'HOSTED_OR_GOOGLE', user, password, 'ah', application_name, False)
  File "gcj\lib\google_login.py", line 199, in Login
    source)
  File "gcj\lib\google_login.py", line 125, in _GetGoogleAuthtoken
    e.headers, response_dict)
  File "gcj\lib\google_login.py", line 38, in __init__
    self.reason = args["Error"]
AttributeError: can't set attribute

What version of the product are you using? On what operating system?
1.2-beta1, win7 x64

Workaround.
Currently we have to use application-specific password for codejam-commandline, 
https://accounts.google.com/b/0/IssuedAuthSubTokens?hide_authsub=1.

Original issue reported on code.google.com by [email protected] on 16 Apr 2014 at 4:57

Getting the example

I would like to be able to get the example as if it was a set (I call it the 
"micro" set) :
gcj_download_input.py A micro 0

I am not sure if it is possible, but it would be nice.

Original issue reported on code.google.com by [email protected] on 20 May 2011 at 6:45

  • Merged into: #6

Release is in 'zip bomb' format

What steps will reproduce the problem?
1. unzip line-beginning-position

Instead of a folder being created, as expected, my current directory is spammed 
with files.

Version 1.0-beta2.


Original issue reported on code.google.com by [email protected] on 7 May 2011 at 1:28

Cannot get middleware tokens from "code.google.com"

What steps will reproduce the problem?
1. ./gcj_init_contest.py 1158485

What is the expected output? What do you see instead?

Getting middleware tokens from "code.google.com"...
500 Internal Server Error, 1339 bytes read from server (2972 uncompressed).
ServerError: Error while communicating with the server, cannot get middleware 
tokens. Check that the host, username and contest id are valid.

What version of the product are you using? On what operating system?
GCJ Commandline submit tool, v1.0-beta4
Ubuntu 11.10

Please provide any additional information below.
The contest URL has changed: 
- http://code.google.com/codejam/contest/dashboard?c=433101
+ http://code.google.com/codejam/contest/1158485/dashboard

Original issue reported on code.google.com by [email protected] on 20 Mar 2012 at 3:41

Outdated README file.

There is some problems in the README file:

1. The version number being used is not up to date 
   The line number 1 "GCJ Commandline submit tool, v1.0-beta4". 
   The line number 28 "GCJ Commandline submit tool, v1.0-beta3"

2. The licencing information in the README (GPL) file and the project home page 
(Apache) are not conform.

Original issue reported on code.google.com by [email protected] on 14 Sep 2012 at 7:25

Assumption of existance of python2

krka@kristofer:~/dev/codejam/2012-04-14$ ./gcj_init_contest.py 1460488
/usr/bin/env: python2: No such file or directory

Workaround: sudo ln -s /usr/bin/python /usr/bin/python2

Maybe mention this in the README?

Original issue reported on code.google.com by [email protected] on 14 Apr 2012 at 10:38

missing 4th question from the server side of this tool

What steps will reproduce the problem?
try to download the 4th problem in the qualification round

What is the expected output? What do you see instead?
file should be downloaded to input directory instead I get an error message 
that .

What version of the product are you using? On what operating system?
windows 7
python 27
V1.0B2

Addition information:
Perhaps this was not reported because of issue #18


Original issue reported on code.google.com by [email protected] on 15 Apr 2012 at 2:28

Proxy support

Since most of the participants are college students, it is recommended to have 
the proxy support. I don't think it is implemented currently.



Original issue reported on code.google.com by [email protected] on 13 Apr 2014 at 4:17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.