Hi, this is greed, the missing topcoder arena plugin for algorithm contest.
- No CodeProcessor+FileEdit+blah blah, no tons of jars, just Greed
- No need to set up all the messes, just set your workspace, end of story
- Seamless migration between OS and enviroments, since all stuff are kept in workspace, in your line of sight
- Manage your code, in different folders, based on the contest and problem you're in
- Generate code based on a fully-customizable template
- Generate robust testing code, which BTW, is also customizable
- Multi language support, including Java, C++, C#(thanks to @jbransen) adn Python(thanks to @wookayin). Support for Java includes package declaration removing, helping you organize your code without worrying about the submission.
The latest version has been put into the dist
directory in the repository, get it here!
For previous versions, go to Github's original download page.
- Python support. Thanks to @wookayin, now Greed is one of the first plugins who support Python!
- Major template bug fix , thanks to @ashashwat
- Template bug when allocating large space, thanks to @wookayin
- unit test code generation for C#(NUnit) and Java(JUnit), thanks to @tomtung
- major rewriting
- minor bug fix, mainly fix bugs on "long long" in C++, C#, and Java
- update C# version, thanks to @jbransen
- major bug fix
-
Go to Downloads, and download my latest version
-
Open Topcoder arena -> Login -> Options -> Editor -> Add
OK! Remember to check Default and At startup. -
Select me, click Configure.
Fill in your workspace full path. -
All set! Go get your rating! Let me worry about the rest crap.
Everything in greed is configuable.
I'm bundled with some default config, which should be enough for most of you. But if you're not satisfied, go set me.
Start with creating a file called greed.conf
under your workspace root.
Things you can do with this config,
Change where I store your code, via greed.codeRoot = ???
, this path is relative to your workspace root.
Default set to .
, which means workspace root.
This tells me where I generate and fetch your code, for different contest and problem.
The default is ${Problem.Name}.cpp/java
in ${Contest.Name}
. Take TableSeating
in SRM 249 DIV 1
, you can find your code in workspace/code root/SRM 249/TableSeating.cpp
.
This is especially useful for Java developers, since Java resolves packages by folder structure.
You can declare your package in your code template(described below),
and do the same in pathPattern
, like src/${Contest.Name;string(lower,removespace)}
.
Write your code with your favorite IDE. That's beyond awesome!
Package declaration will be auto removed while compiling and submitting in the arena.
For specifying your own template file for your preferred language, Just set this to the relative path of your template file in your workspace, done!
The default template for java, FYI, is
public class ${ClassName} {
public ${Method.ReturnType} ${Method.Name}(${Method.Params}) {
return ${Method.ReturnType;ZeroValue};
}
${CutBegin}
${<TestCode}
${CutEnd}
}
Cannot be simpler, can it?
This is where the magic happens!
You can do meta programming with your testing code template.
There're several built-in test templates.
Resource path | Language | Tested on | Comment |
---|---|---|---|
res:/GCCTest.cpp |
C++ | GCC on Mac OS X & Cygwin GCC on Windows | Each testcase run in different instance. Runtime error is not detected and terminates the whole program. Pass testcases numbers to run by command-line arguments, none means all testcases. |
res:/Test.java |
Java | JDK7 on Mac OS X | Each testcase run in different instance. Runtime exception detected. Pass testcases numbers to run by command-line arguments, none means all testcases. |
res:/Test.cs |
C# | Mono on Mac OS X | Same as Java vesrion |
res:/Test.py |
Python | Python 2.7 on Windows7 | |
If you're not satisfied with the default template, consider DIY your own! | |||
See the Templates page on my wiki. |
And please, please, contribute good templates to me, including templates for different environments, and with more functionalities. Everyone will benefit from your templates. How cool is this!
If you've got a powerful IDE with great unit testing and debugging support, why mingle test code with your solution? For C# and Java, set greed.test.unitTest
to true
, and the unit tests will be generated in a separate file according to greed.templates.<lang>.unitTestTmplFile
(If not set or invalid, I will fallback to normal test code generation). Then you can link both files to an existing IDE project:
and you'll be able to utilize the IDE to easily test and debug each or all test cases:
Go to my wiki.
You'll learn how to config all the functionalities, like
- all available binded info in config, like
${Problem.Score}
- setting the
begin cut
andend cut
format - how to write your own templates, including test templates
When you found a bug in me, or need a new feature, raise an issue here. Please, with the problem you're solving and the room you're in, to better identify the problem.
I'll try to repair myself ASAP.
Or, consider helping me!
Currently, I'm still immature, and under development. Any help is helpful and greatly appreciated.
You can contribute to me in 2 ways:
- Fork me, modify me, and send a pull request. Oh, you're not familiar with this style, well, you should. Read this article.
- Be a collaborators with my developers
Copyright 2012 Greed
Licensed under Apache License, Version 2.0. You may obtain a copy of the license in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.