{"id":19469600,"url":"https://github.com/hackerkid/codejam-commandline","last_synced_at":"2026-06-16T00:35:03.009Z","repository":{"id":29869155,"uuid":"33414316","full_name":"hackerkid/codejam-commandline","owner":"hackerkid","description":"Automatically exported from code.google.com/p/codejam-commandline","archived":false,"fork":false,"pushed_at":"2015-04-04T17:47:17.000Z","size":308,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T14:39:52.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackerkid.png","metadata":{"files":{"readme":"README","changelog":"CHANGES","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-04T17:43:59.000Z","updated_at":"2015-04-04T17:45:26.000Z","dependencies_parsed_at":"2022-09-06T11:33:05.544Z","dependency_job_id":null,"html_url":"https://github.com/hackerkid/codejam-commandline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hackerkid/codejam-commandline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerkid%2Fcodejam-commandline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerkid%2Fcodejam-commandline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerkid%2Fcodejam-commandline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerkid%2Fcodejam-commandline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackerkid","download_url":"https://codeload.github.com/hackerkid/codejam-commandline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackerkid%2Fcodejam-commandline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34386320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T18:52:54.536Z","updated_at":"2026-06-16T00:35:02.993Z","avatar_url":"https://github.com/hackerkid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"GCJ Commandline submit tool, v1.0-beta4\nCopyright 2010 Google Inc. All Rights Reserved.\n\nDownload and submit tool for the Google Code Jam\n-------------------------------------------------------------------------------\nTABLE OF CONTENTS:\n\n0. Disclaimer\n1. Prerequisites\n2. Basic usage\n  a. Configuring the system\n  b. Initializing the contest\n  c. Downloading an input\n  d. Submitting a solution\n  e. Checking your status\n  f. Cleaning the contest\n3. Configuration files\n4. Executable files\n  a. Contest crawler\n  b. Login agent\n  c. Input downloader\n  d. Solution submitter\n  e. Contest cleaner\n\n-------------------------------------------------------------------------------\n0. DISCLAIMER\n\nGCJ Commandline submit tool, v1.0-beta3\nCopyright 2010 Google Inc. All Rights Reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\n-------------------------------------------------------------------------------\n1. PREREQUISITES\n\nTo install this software, just copy these files into any folder and execute the\npython scripts from the main folder (the one that contains this file).\n\nTo run the scripts, you will need Python 2.6, which can be downloaded from\n\u003chttp://www.python.org/download/releases/\u003e. This was developed and tested using\nPython 2.6.5, so we recommend using 2.6.5 or later.\n\n-------------------------------------------------------------------------------\n2. BASIC USAGE\n\nTo use this tool, open a terminal in the main folder (the one that contains\nthis file). The scripts in this directory expect to be run from this directory,\notherwise, they will not find the configuration files in the config/ directory.\n\n\n2a. Configuring the system\n\nBefore attempting to run a script included with this software, you should\nconfigure the system by writing some needed information in the user\nconfiguration file, located at config/user_config.py. This file is formatted as\na Python dict structure, but a basic one is be included with this software.\nThree values are needed to run the software:\n\n- host: The name of the website hosting the contest. For normal contests and\n  for the remaining of this example, the host is 'code.google.com'.\n\n- user: Your google account, for example 'myaccount@gmail.com'.\n\n- source_names_format: This is a list of strings that specify the default\n  sources to be included with an output file. In this example, we will assume\n  we use C++ and set it to ['{problem}-{input}-{id}.cpp']. Remember to change it\n  before a contest or you might end submitting the included source code by\n  accident!\n\nLook at Section 3 for more information about these and many more configuration\nparameters.\n\n\n2b. Initializing the contest\n\nThe first step to use this software is initializing the contest. To do this\nyou have to specify the contest id, which can be found in the dashboard URL\nfor that contest. For example, for the GCJ 2010 Qualification Round the\ndashboard URL is:\n\nhttp://code.google.com/codejam/contest/dashboard?c=433101\n\nso you can initialize the contest executing:\n\n$ ./gcj_init_contest.py 433101\n\nDuring this step, the software logs into Code Jam servers (it may ask for your\npassword) and extracts information from the contest, including problem ids,\nnames and the middleware tokens required to transfer information.\n\nThen, all this information, including the login cookie and the information in\nthe user configuration file, is stored in the current configuration file (found\nat config/current_config.py).\n\nIf you don't specify a contest id for this script, it will attempt to initialize\nthe tool for the current contest. If no contest is running it will print an\nerror message.\n\nNOTE: Your password is not stored in the current configuration file if you did\nnot entered it in the user configuration file.\n\n\n2c. Downloading an input\n\nOnce you have implemented a solution and think you got it right, you may\ndownload an input file using the gcj_download_input.py script. This script\nreceives the problem letter (A, B or C for the GCJ10 Qual), the I/O set name and\nan id to differentiate it from other attempts.\n\nIf a problem has only one small I/O set it will be called \"small\", but if it has\nmultiple small I/O sets they will be called \"small1\", \"small2\", \"small3\", and so\non (all quotes for clarity). Large I/O sets are named in the same way.\n\nFor example, to download a small input for the problem A, Snapper Chain, you\ncan execute:\n\n$ ./gcj_download_input.py A small 0\n\nwhich will download the input file and store it in source/A-small-0.in. Now\nit is time to run your solution and generate the output file.\n\nNOTE: Downloading an input file twice in the same attempt will just redownload\nthe same input file if its timer has *NOT* expired. Otherwise, it will download\nanother input and start another attempt for small I/O sets. However, if this is\nthe case it will ask for confirmation from the user.\n\n\n2d. Submitting a solution\n\nAfter running your solution and generating the output, it is time to submit the\noutput file with the source files using the gcj_submit_solution.py script. This\nscript receives the problem letter, the I/O set name and the id used when the\ninput was downloaded. See section 2c for I/O set naming.\n\nFor example, to submit the solution for the small I/O set of problem A, Snapper\nChain, you can execute:\n\n$ ./gcj_submit_solution.py A small 0\n\nwhich will submit the file source/A-small-0.out as the answer and\nsource/A-small-0.cpp as the only source file. If you want to add extra source\nfiles, you may use the -a flag as many times you need. For example, if you want\nto submit two extra files called library.cpp and template.txt you can execute:\n\n$ ./gcj_submit_solution.py -a library.cpp -a template.txt A small 0\n\nwhich will submit the file source/A-small-0.out as the answer and\nsource/A-small-0.cpp, library.cpp and template.txt as the source files. If you\nadd a directory using the -a option, the program will compress it into a zip\nfile before submitting it.\n\nAfter submitting the file, the Code Jam server will answer with a message\nstring. The most important values are:\n\n- 'Incorrect: Wrong Answer': Your solution for the small input was wrong, try\n  again.\n- 'Correct: Good Job!': Your solution for the small input was right,\n  congratulations!\n- 'Submitted: Your answer has been received and will be judged at the end of\n  the contest.': This is received after submitting the output for a large input.\n- 'Rejected: \u003creason\u003e': Your submission was rejected for some reason, please\n  try again. This attempt did not count as a wrong answer.\n\n\n2e. Checking your status\n\nDuring the contest you can check your status by using the gcj_get_status.py\nscript, which will show you your current rank, number of points, time at which\neach input was solved, number of wrong attempts per input and remaining time for\ncurrent attempts.\n\nTo run this script you should execute:\n\n$ ./gcj_get_status.py\n\nwhich will show an output like this one:\n\nRank: 194 (66 points)\nProblem: Snapper Chain\n  small: 00:15:16 (2 wrong tries)\n  large: 00:19:11\nProblem: Fair Warning\n  small: --:--:-- (1 wrong try) \u003c\u003c 2:31 left\n  large: --:--:--\nProblem: Theme Park\n  small: 01:42:45\n  large: 01:47:18 \u003c\u003c 6:38 left\n\n\n2f. Cleaning the contest\n\nAfter the contest is over, you can clean all contest-related information using\nthe ./gcj_clear_contest.py script, which receives no parameters. This script\nwill not delete your source code, input or output files.\n\n-------------------------------------------------------------------------------\n3. CONFIGURATION FILES\n\nThis tool needs one configuration file to run, which can be located at\nconfig/user_config.py. This file is formatted as a python dict structure and\nmay have the following keys:\n\n- 'host' : The name of the website hosting the contest. For normal contests,\n  it is 'code.google.com'.\n\n- 'user' : Your google account, the '@gmail.com' might be omitted for contests\n  in 'code.google.com'.\n\n- 'password' : The password for your google account. This value is optional, if\n  it is not found the executables will ask for it when necessary.\n\n- 'data_directory' : Directory where input files are written and the output and\n  main source file is read from. This value is optional, if not specified it\n  will default to './source'.\n\n- 'input_name_format' : Format used to generate filenames for input files,\n  where '{problem}' will be substituted for the problem letter, '{input}' for\n  the input type (small or large) and '{id}' for the submit id. This value is\n  optional, if not specified it will default to '{problem}-{input}-{id}.in'.\n\n- 'output_name_format' : Format used to generate filenames for output files,\n  whose format is similar to the input format. This value is optional, if not\n  specified it will default to '{problem}-{input}-{id}.out'.\n\n- 'source_names_format' : List with filename formats for the source files\n  included by default; each list value must be formatted in the same way as the\n  input name format. This value is *NOT* optional, to prevent accidental\n  submits of outputs with no source files.\n\nAll these values (with the exception of 'host', 'user' and\n'source_names_format') can be overriden in the scripts by using command line\noptions. When these values are specified on the command line, the values in the\nconfiguration files and the default values are ignored.\n\nFor the input, output and source format the final filename is generated using\nthe Python str.format() function.\n\nIf you want to change the path of the configuration file, look at the\nlib/constants.py file and change the respective variables. Remember that those\npaths are relative to the current directory, not to the lib directory. You could\nalso use absolute paths or use the placeholder '{base_dir}' (quotes for\nclarity); this placeholder will be substituted by the directory where the tool\nis in the filesystem.\n\nIMPORTANT: Scripts stores information from the current contest along with the\nuser information in the current configuration file (config/current_config.py).\nHowever, any change you make in the user configuration file will be recognized\nby the scripts, even if the current configuration file is not updated. This\nimplies that the user should update their information in the user configuration\nfile, otherwise the scripts will not see the change.\n\n-------------------------------------------------------------------------------\n4. EXECUTABLE FILES\n\nThis tool is composed by four executable scripts, one to initialize the tool\nfor a contest, one to download inputs, one to submit solutions and finally one\nto login in the Google servers, just in case the authentication cookie becomes\ninvalid.\n\nAll scripts provide a --version and a --help options. These options will show\nthe current tool version and a list with all the possible options for the\nscript, including a brief description of each one.\n\nAll scripts might require your Google password if you do not specify it in the\nconfiguration file. Another option is to pass the password using the option\n--passwd, just be careful that specifying the password this way will be visible\nin your screen and will be stored in the commands history.\n\nThe scripts to download input and submit outputs support a --login option; if\nthis option is specified the current login cookie will be ignored and a new one\nwill be requested. Also, if the cookie has expired the scripts will\nautomatically try to renew it. Beware that this might cause the executables to\nask for your password. Also, these scripts ask confirmation from the user before\ndownloading an input that will start a new timer and before resubmitting a\nsolution for a large input. These confirmations can be skipped by passing the\n--force option.\n\n\n4a. Contest crawler\n\nThis script is the gcj_init_contest.py script and receives one optional\npositional argument which is the contest id (see Section 2b for instructions on\nhow to retrieve a contest id), that is used to retrieve the important\ninformation of the contest, i.e., number of problems, middleware authentication\ntokens, problem ids, etc.\n\nIf no contest id is specified in the arguments, this script will retrieve the\nid of the current contest and initialize the tool for it. If there is no running\ncontest an error message will be shown to the user.\n\nThis script should be run once before each contest, so the correct information\nis retrieved. Otherwise, all other scripts might fail because no contest data\nwill be found.\n\n\n4b. Login agent\n\nThis script is the gcj_renew_login.py script and receives no positional\narguments, and will renew the login cookie in the current configuration file\nwith a new one.\n\nThis script should not be used under regular operation, this is just included\nin case your login cookie expires or becomes invalid during a contest.\n\n\n4c. Input downloader\n\nThis script is the gcj_download_input.py script and receives three positional\narguments, the problem letter, the input size ('small' or 'large') and a submit\nid. The problem letter and the input size are always converted to uppercase and\nlowercase before using them, respectively, but the id is case-sensitive.\n\nThis script downloads the specified input and stores it in a file inside the\ndata directory. However, the flags --data-directory and --input-name are\nprovided to override the default values and the ones in the configuration files.\n\n\n4d. Solution submitter\n\nThis script is the gcj_submit_solution.py script and receives three positional\narguments, the problem letter, the input size ('small' or 'large') and a submit\nid. Similar to the input downloader, both the problem letter and the input size\nare converted to uppercase and lowercase before using them, respectively, but\nthe id is case-sensitive.\n\nIf a directory is specified as an output file, this executable will zip it into\na file before submitting, so the whole folder can be sent to the server.\n\nBy default this script submits the specified output files along with the\nadditional default source files specified in the configuration file. However,\nthis script provides many options to alter its default behaviour:\n\n- Similar to the input downloader, the --data-directory option can be used to\n  choose another data directory, and the --output-name option can be used to\n  change the default name of the output file.\n\n- If additional source files are needed, the --add-source option can be used to\n  submit them along with the output files.\n\n- If the source files being uploaded are too big, the --zip-sources option can\n  be used to zip all the source files into a single file before submitting. This\n  options is smart and will not zip already zipped files.\n\n- The --ignore-zip option will indicate that all zip files inside a included\n  directory should be ignored, otherwise they will be added. However, zip files\n  specified directly in the source configuration or using the --add-source will\n  be included.\n\n- The --ignore-default-source option will indicate that all default source files\n  in the configuration file should be ignored, and only source files specified\n  through the --add-source option should be sent.\n\n- There are two different encondings to send the output to the server. If the\n  --gzip-content flag is specified the output and the source files will be\n  sent using gzip; if the --nogzip-content flag is specified the output and the\n  source files will be sent using text/plain. If no flag is specified, the data\n  will be sent using gzip.\n\n\n4e. Contest cleaner\n\nThis script is the gcj_clear_contest.py script and receives no positional\narguments. When this script is executed all contest-related information will be\nremoved from the system, which does not include your source code, input or\noutput files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerkid%2Fcodejam-commandline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackerkid%2Fcodejam-commandline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackerkid%2Fcodejam-commandline/lists"}