Giter Club home page Giter Club logo

topcoder-greed's Introduction

Greed

Hi, this is greed, the missing topcoder arena plugin for algorithm contest.

Greed is good

  • 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.

Downloads

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.

Release Note

1.5

  • Python support. Thanks to @wookayin, now Greed is one of the first plugins who support Python!

1.4

  • Major template bug fix , thanks to @ashashwat
  • Template bug when allocating large space, thanks to @wookayin

1.3

  • unit test code generation for C#(NUnit) and Java(JUnit), thanks to @tomtung
  • major rewriting

1.2

  • minor bug fix, mainly fix bugs on "long long" in C++, C#, and Java

1.1

  • update C# version, thanks to @jbransen
  • major bug fix

Quick start

  1. Go to Downloads, and download my latest version

  2. Open Topcoder arena -> Login -> Options -> Editor -> Add
    Add greed
    OK! Remember to check Default and At startup.

  3. Select me, click Configure.
    Configure greed
    Fill in your workspace full path.

  4. All set! Go get your rating! Let me worry about the rest crap.

Go rock with config

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,

greed.codeRoot

Change where I store your code, via greed.codeRoot = ???, this path is relative to your workspace root. Default set to ., which means workspace root.

greed.templates.pathPattern and fileNamePattern

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.

greed.templates.<lang>.tmplFile

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?

greed.templates.<lang>.testTmplFile

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!

greed.test.unitTest

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:

VS Add File Menu

VS Link Existing File

and you'll be able to utilize the IDE to easily test and debug each or all test cases:

Resharper NUnit Debugging

Want to learn more?

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 and end cut format
  • how to write your own templates, including test templates

Bug Tracker

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!

Contribute to me

Currently, I'm still immature, and under development. Any help is helpful and greatly appreciated.

You can contribute to me in 2 ways:

  1. Fork me, modify me, and send a pull request. Oh, you're not familiar with this style, well, you should. Read this article.
  2. Be a collaborators with my developers

License

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.

topcoder-greed's People

Contributors

jbransen avatar liuchang0812 avatar tomtung avatar tylovescodes avatar wookayin avatar zen0wu avatar

Watchers

 avatar  avatar

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.