Giter Site home page Giter Site logo

topcoder-greed's Introduction

  • Abstraction is great, but not too much.
  • Optimize for simplicity, but not easy.
  • Pick the right defaults, opt-in vs opt-out.

topcoder-greed's People

Contributors

andreazevedo avatar jbransen avatar kentskinner avatar liuchang0812 avatar orthographic-pedant avatar tatsuyafujisaki avatar tomtung avatar tylovescodes avatar vexorian avatar wookayin avatar zen0wu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topcoder-greed's Issues

Greed 2.0 individual testing via passing argument does not work as expected

In Greed 1.5 and below, we could run individual test-cases by passing arguments.

→ ./a.out 0  # Expected to run first test case.  

In Greed 2.0, individual test cases ordering is changed.

→ ./a.out 0
MarblesInABag (1000 Points)


Passed : 0/1 cases
Time   : 0 minutes 21 secs
Score  : 999.85 points

→ ./a.out 0
MarblesInABag (1000 Points)

  Testcase #0 ... FAILED! (0.00 seconds)
       Expected: 0.333333
       Received: 0

Passed : 0/1 cases
Time   : 4 minutes 6 secs
Score  : 979.69 points

As in, to run 1st test case, we give argument 1 now instead of 0. But topcoder sample inputs are 0-index based.

A CWD issue with regarding to filetest template

Well, Greed 2.0 now accepts and encourages the filetest template as a default way to run the test cases -- this is great compared to the legacy test template.

But there is a slight problem wrt the filetest template, especially for IDE users -- I thought we could discuss on it to find a great solution, if any.

The problem

Using filetest template, we read the testcase input file from the current working directory (CWD). This is slightly problematic on IDE environment, for example, Eclipse or Visual Studio.

Usually IDE users (and I) use a single workspace, solution or project to solve topcoder problems, then CWD of the running program is usually the directory where the workspace/project is located. However, the input file is located at the same directory as the source code; under this environment, the testcase input file is not found, hence no tests are run.

Well, one can customize his template and workspace settings, but as long as the template is default, this might be confusing to most users.

A solution?

I think, if possible, we could provide a great way such that wherever the testcase is located and whatever the current working directory is, the test cases from the input file could be successfully loaded.

Possibly, I am devising a way using __FILE__ macro (for C++ and python) to get the absolute path of the source code, assuming the test input and the source code are located in the same directory. But no way for Java and C#.

Add support for Java language

Including a source code template, a test code template without crashing like C++, via exception catching. And code processing, including package name remover...

Template dependency

Explicitly defined dependencies between templates,
making it easier to track the correctness and ordering of the templates,
and also make the configuration more complicated

Python bug

In python template and testing template generates code like
def getmin(self, string S):
but not
def getmin(self, S):

DSL Configuration syntax - "bultin" is awkward.

For example, in greed.conf, we have

greed.language.cpp.templateDef {
    source.templateFile = "builtin testcase/testcases.tmpl"
}

The builtin prefix is introduced in fd29504, and it seems not documented anywhere.

Previously (in 1.x), it was res:/, and it is now builtin ....
Unfortunately, I don't like this, it seems quite awkward and not intuitive.

Respecting an idea of DSL, we would find templateFile = builtin("testcase/testcases.tmpl"), builtin:/... or something similar better.
Well, although I doubt typesafe-config support this, I suggest this configuration schema could be modified before public release.

What do you guys think?

Custom test should be the same as the example one

the code to run the custom test case should be consistent with the example one
currently all the custom test are run after the example test all at once
you cannot run a specific custom test through a test number

afterFileGen Hooks in separate thread

It seems to me that one of the most popular uses for AfterFileGen hook is to automatically open editor after the files are created. There is a slight practical issue with this and it is that if the editor / IDE doesn't automatically create a new thread when called, the editor will be closed automatically by greed.

The workaround is easy - create a script file to call the program in another thread and make greed call the script. But it is a bit too complicated and I am not sure if windows-friendly.

So we could have an option to make greed run the hook in a separate thread and not care about the exit code. Like:

                afterFileGen {
                    execute = /home/vx/dev/topcoder/threadcodeblocks.sh
                    arguments = ["${GeneratedFilePath}"]
                            separateThread = true
                }

Get already submitted code

From what I see, Greed creates a new file based on a template. But, is there any way to get already submitted code?

Seems greed.conf cannot modify override behaviour

I noticed this earlier yesterday with few minutes before the match when source was accidentally set to force instead of skip... I tried to fix the issue by modifying greed.conf and it wasn't working. I eventually had to modify the default.conf file.

Now I am confirming it with the problem-desc template. My greed.conf sets override to backup, but it is not creating backups.

null workspace at startup

when first time running and the workspace has not been specified, a weird folder called 'null' will be generated somewhere in the file system.

Idea: Custom Files

Hello, I have an idea that requires more work than a simple commit.

The template engine is very powerful, we can even create unit tests.

I think it would be useful to allow Greed to create other kinds of files, not just unit tests or source, but anything according to configuration.

In configuration:

cpp {
        customFile1 { 
              filePattern = "${Problem.Name}.in"
              template = "InputTemplate.in"
              override = false
        }
}

So now a file called ProblemName.in will be generated in the folder. When generating it the template engine will use file "InputTemplate.in" .

So in this specific case, the template file would be the necessary template to generate an ACM-style input file for the problem. This should be possible with the template engine. Although maybe we need an array length replacement variable. Then the user would call a custom tester template that reads test cases from a file.

There should be support for more than one custom file. For example, input and output.

There are many uses for this. For example generating project files. Or run scripts, and whatever the user could think about.

Greed current revision build failure

I tried to build greed from current revision [1] and the build failed.

→ ./gradlew build
Downloading http://services.gradle.org/distributions/gradle-1.10-bin.zip
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Unzipping /Users/shashwat/.gradle/wrapper/dists/gradle-1.10-bin/6oa4rff9viiqskhgd6uns5v1f8/gradle-1.10-bin.zip to /Users/shashwat/.gradle/wrapper/dists/gradle-1.10-bin/6oa4rff9viiqskhgd6uns5v1f8
Set executable permissions for: /Users/shashwat/.gradle/wrapper/dists/gradle-1.10-bin/6oa4rff9viiqskhgd6uns5v1f8/gradle-1.10/bin/gradle
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:processResources
:classes
:jar
:fatJarPrepareFiles
:fatJar
:assemble
:compileTestJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
1 warning
:processTestResources UP-TO-DATE
:testClasses
:test

greed.conf.ConfigSerializerTest > testSerialize FAILED
greed.conf.ConfigException at ConfigSerializerTest.java:17

28 tests completed, 1 failed
:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Volumes/CoreHD/Codes/topcoder-greed/build/reports/tests/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 43.137 secs

Apart from this, greed failed to generate anything with the exception java.io.FileNotFoundException: /templates/testcase/testcases.tmpl. The last build (somewhere in mid dec) worked perfectly for me. I do need to check if it is some misconfiguration on my part or some change broke something.

Here is error log,

[Jan 04 05:09:01] [greed.Greed.<init>@L49] Greed[INFO]: Greed Plugin
[Jan 04 05:13:19] [greed.util.FileSystem.createFolder@L29] FileSystem[INFO]: Create folder [Logs]
[Jan 04 05:15:38] [greed.util.FileSystem.createFolder@L29] FileSystem[INFO]: Create folder [Logs]
[Jan 04 05:15:42] [greed.util.FileSystem.getResource@L12] FileSystem[INFO]: Getting resource: /templates/testcase/testcases.tmpl
[Jan 04 05:15:42] [greed.Greed.setProblem@L314] Greed[ERROR]: Fatal error, cannot find resource greed.util.ResourcePath@2d0e7adf, with an java.io.FileNotFoundException: /templates/testcase/testcases.tmpl
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          greed.util.FileSystem.getResource(FileSystem.java:17)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          greed.Greed.setProblem(Greed.java:293)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          greed.Greed.generateCode(Greed.java:149)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          greed.ui.GreedEditorPanel.actionPerformed(GreedEditorPanel.java:102)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]          java.awt.Component.processMouseEvent(Component.java:6505)
[Jan 04 05:15:42] [greed.Greed.setProblem@L314]           and 30 more ...
[Jan 04 05:15:42] [greed.Greed.generateCode@L152] Greed[ERROR]: Set problem error, with an java.lang.IllegalStateException: java.io.FileNotFoundException: /templates/testcase/testcases.tmpl
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          greed.Greed.setProblem(Greed.java:315)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          greed.Greed.generateCode(Greed.java:149)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          greed.ui.GreedEditorPanel.actionPerformed(GreedEditorPanel.java:102)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          java.awt.Component.processMouseEvent(Component.java:6505)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]          javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
[Jan 04 05:15:42] [greed.Greed.generateCode@L152]           and 29 more ...

[1] afc6a83

greed.conf folder location

Hello!

First and foremost: thanks for the wonderful tool! This has definitely made my TopCoder experience exponentially better.

I am on a win7 x64 system using VS 2012. I cannot access the greed.conf file because the configuration directory is assigned with the Linux style folder structure ("/") as opposed to windows ("") . This is a slightly modified message from the TopCoder applet:

Reloading your configuration from "...\Visual Studio 2012\Projects\TopCoder/greed.conf"

Because of that I'm not able to customize. Other than that it seems to work like a charm. Thanks again!

Better control of created directory structure

I want Greed to generate files in directory
{Workspace}/499/
instead of
{Workspace}/SRM 499/

I looked through documentation and code and could not find a way to do it.
I think some special named renderer might help here.
Like 'substring' or 'word'.

Set problem error, message says "null" (NPE)

This is a tiny bug I've encountered.

How to reproduce

Have a wrong (or missing) file path in greed.conf.

filetest.templateFile = "builtin filetest/cpp.tml"

Then the arena says:

Set problem error, message says "null"

Cause, and fixes

The log message explains everything. We have unhandled null streams, when the resource is not found. Needed to explicitly handle the cases. I am working on a patch.

Log message

[Nov 25 21:39:16] [greed.Greed.generateCode@line 122] Greed[ERROR]: Set problem error, with an java.lang.NullPointerException
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          java.io.Reader.<init>(Unknown Source)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          java.io.InputStreamReader.<init>(Unknown Source)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          greed.template.TemplateEngine.readStream(TemplateEngine.java:44)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          greed.template.TemplateEngine.render(TemplateEngine.java:33)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          greed.Greed.setProblem(Greed.java:171)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          greed.Greed.generateCode(Greed.java:119)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          greed.ui.GreedEditorPanel.actionPerformed(GreedEditorPanel.java:112)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
[Nov 25 21:39:16] [greed.Greed.generateCode@line 122]          javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

What to do with problem statement template

In #112 @shivawu talks about maybe simplifying this template and that there seem to be alignment issues in it.

  • Circle decorations around example cases might be a bit excessive.

    They don't really make the template too complex but they do add make customization need more options and tweaking. Color scheme needs to declare extra colors for them, and we have a whole new option to disable them.

    Also, since they are now based completely on CSS we can get rid of them by default and let the people put them back in custom CSS.

  • Regarding the alignment issues. They can be fixed, although I don't notice them. This is probably browser-dependent. It would help to have a screenshot of what it looks like and how would you like it to look like.

  • I think the markup itself is fine and simple enough. The complications come from the CSS, the current markup could stay the way it is as it allows many possibilities through custom CSS tricks.

  • Something we could do away with is the input, output and comment tags. They are the things that force the complicated float:left layout, they require extra color and font options in CSS and extra options to remove them. Adding an -> or Returns: before expected result and including variable names already makes it clear what thing is what in the statement. We could leave the input/output/comment divs in the markup (they are useful when the style is disabled and people who like something like them can still enable them through CSS), but hide them with CSS.

Log directory name becomes 'null'.

Under the bleeding edge version of the Greed, when log is enabled, we have a directory null in the root of the workspace, as well as Logs. This seems to be a log folder - something became null in our codes.

./Logs/greed-11-30.log
./null/greed-11-30.log

I will inspect the cause later.

Powered by Greed UNKNOWN

This is a minor bug, but should be fixed :)

All the actually submitted code does not display the plugin's version correctly, as follows:

class YourCode {
   // ...
};

// Powered by Greed UNKNOWN

Reproducible in greed 1.3, and in the current 1.4.
Lower versions are not tested though, but all versions are supposedly affected too.

Let me guess the cause: in AppInfo.java, the following line finds the file named version which is not present if the plugin runs as a JAR, hence always throws an exception.

BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("version")));

The version information file should be together in the JAR archive (in the classpath root or MANIFEST, or something else).

It will be not too hard to fix it, but lacking in time for the moment,
I am going to make a patch and a pull request soon. Thanks.

Run tests in separate thread

Topcoder runs tests in separate threads. Using globals though a bad practice is pretty common in TC contests. So we need to write extra code to clear globals.

Is it possible to have a testing template so that we don't need to clear globals.
It is not a mandatory feature but a nice to have.

Definition in problem statement template?

Does anyone else think this feature could be useful? Adding the definition section to the problem statement template.

Good things:

  • Generated Problem statement HTML will be a stand-alone description of the problem (currently you need to read the generated source code to know the return type).
  • Coders are familiarized with it.
  • Quickly knowing the return type as opposed to waiting till you read code is useful in solving process: If the return type is long it can be a hint.

Bad things:

  • Problem statement would be longer (Can fix this by making it possible to hide the definition section through options).
  • It is actually complicated to implement. I was trying to add it myself, I forgot that this section is very language specific. So far it appears that the cleanest way to do this is to have a problem-definition template as a requirement for the problem-desc template. (Will template requirements automatically call a requirement if none is defined?) Since this requirement of an extra template will complicate things and configuration, that's why I am asking...

Update:
In reality, it appears it is quite possible to make a template that works in all the C-like languages. Python and VB would need separate templates. It still requires us to have a separate problem-definition template for each language, though.

Update 2:
Python might be an issue to do even with a separate template. An alternative would be to make a different HTML renderer for each language. The python HTML renderer should turn integer type to "integer" as opposed to just empty. There could also be a method HTML renderer. This might be too much of an issue, indeed.

Smart backup

when greed.options.override is set to true, and the file to be generated exists, the plugin will make a backup of the original one.
this will sometimes results in tons of backup files having the same content with each other, since the plugin will be run each time user close and reopen a problem in the arena, and such action would be quite frequent.
a smart backup policy is to check for the already existed backup files and if duplicates are found then no new backup will be created.

Template options

Maybe we can make templates have their own configuration options that can be used inside ${if } statements.

Use cases:

  • Setting the color theme of HTML template, without having to use multiple HTML templates.
  • Configuring some of the format of the output (measure time, show score, etc?).
  • Having toggle-able mult process ability in default template . So that we don't have to maintain two templates and always add features and solve bugs in both.
  • Deciding between compact mode and non-compact mode in my dualcolor templates :)
  • Whatever the makers of future templates can need.

My idea, template has:
${if options.multiprocess} A ${else} B ${end}

If Configuration has:

            filetest {
                override = false
                outputKey = TestCode
                transformers = [ empty-block, cont-blank-line ]
                options = [ multiprocess, showtime ]
            }

Template will render A.

Else if options doesn't contain "multiprocess" , template will render B. So these options are just boolean flags. I suspect it would be difficult to make these options any kind of type.

Greed problem statement HTML does not render some symbols correctly.

SRM 424 D2 Hard, Problem - BestRoads

Expected statement:
The road connecting cities A and B, where A < B, has a higher priority than the road connecting cities C and D, where C < D, if either A < C or (A = C and B < C).

Rendered statement:
The road connecting cities A and B, where A < B, has a higher priority than the road connecting cities C and D, where C < D, if either A < C or (A = C and B < D).

Replacing "&lt;" with "<" in HTML file fixes this.

"Regenerate code" behavior

I set greed.override = false in my conf file since I don't want my file being replaced automatically (even if it is backed up).
however, there may be occasions when I press "regenerate code" button in the arena, but it says the files will not be replaced according to my settings in conf file.
I suggest that the "regenerate code" button will backup and replace the file regardless of the settings.
when user explicitly click the button, mostly probably they truly want to do that, instead of being notified to change the settings.
I don't see any reason a person will click this button when they don't actually want their file to be replaced but only want to check his replacement policy, unless he's crazy.
it's quite different between explicit action of the use and automatic action of the program.
any way, the file will be backed up, so there will be no way for user to lose anything.

Cannot instanitate Greed: version 1.3a

Hello, thanks for the nice plugin.

I've experienced a configuration error with the plugin version 1.3a.
Once I set up the editor as told, the arena says

Could not instantiate the editor Greed (see the java console for details).

witth the following log:

java.lang.InstantiationError: Cannot instantiate Greed. java.lang.ClassNotFoundException: greed.Greed
        at com.topcoder.client.contestApplet.editors.DynamicEditor.instantiationError(Unknown Source)
... (ommitted)

However, it works fine with the version 1.3.

Although the root cause is ClassNotFoundException, I can see the class Greed inside the problematic jar file.

My environment is : Windows 7, JRE 1.7.0_1, and Topcoder Arena Version 7.0.3.

Thanks.

${Method.ReturnType;ZeroValue} not working in Greed 2.0 Beta.

Instead of ZeroValue, Greed 2.0 beta returns return type.

For SRM 204, D2 1000,

Generated code (class stub)

class MarblesInABag {
    public:
    double
    getProbability(int redCount, int blueCount) {
        return double;
    }
};

Expected code (class stub)

class MarblesInABag {
    public:
    double
    getProbability(int redCount, int blueCount) {
        return 0.0;
    }
};

Feature Request: Generate HTML of problem statement.

A lot of plugin allow you to save problem statement as HTML. IMHO viewing problem statement in TC arena is not ideal, I prefer seeing the problem in browser.
I have been using Greed since last 4 SRMs and quite happy with it but this is the one thing I truly miss.

Idea: Vertical mode

By this thread: http://apps.topcoder.com/forums/?module=Thread&threadID=801908&start=0 there is a (difficult to find) Arena functionality that makes problem statment / editor split vertically instead of horizontally. It looks like this: https://dl.dropboxusercontent.com/u/95690732/screenshots/greedvertical.png (took the liberty to put a green circle over the button that makes this feature possible)

It is already very useful for greed because it allows us to read both the entire log and the statement without issue. But it would be better if there was a config setting to move the buttons to below the log instead of the left.

Can't get greed2 working

On 32-bit Windows 7 with:
$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) Client VM (build 20.12-b01, mixed mode)

I can't get it working. I suppose this is a Java 6 vs Java 7 problem, because I get something like java.lang.ClassNotFoundException: greed.Greed, the same as I had before on a different, see http://apps.topcoder.com/forums/?module=Thread&threadID=760010

When I try to build greed myself from the github sources I also cannot get it working. It sort of builds (modulo some test failures because the return codes of java an cat are different, which seem innocent to me), I then can add greed as an editor, but when I press configure I get another exception: java.lang.ClassNotFoundException: com.typesafe.config.ConfigMergeable (and of course a long stacktrace and no configure window)

Can you try to build the .jar with the jdk6 again so that the download works, and do you have a clue what the problem can be when I compile from source?

Greed 2.0 not working.

Practice Room - SRM 408, Division 2 - 1000.

Error thrown by java console:

java.lang.IllegalArgumentException: Invalid roundID: 15801
    at com.topcoder.client.contestant.impl.ContestantImpl.getRoundModel(Unknown Source)
    at com.topcoder.client.contestant.impl.ResponseProcessorImpl.phaseData(Unknown Source)
    at com.topcoder.client.contestant.impl.MessageProcessorImpl.receive(Unknown Source)
    at com.topcoder.client.netClient.ContestResponseHandler$DispatchThread.processResponse(Unknown Source)
    at com.topcoder.client.netClient.ContestResponseHandler$DispatchThread.run(Unknown Source)

Directory structure

shashwat-mbp: /Volumes/CoreHD/Repository/devTC            ▸▸▸▸▸▹▹▹▹▹
→ pwd
/Volumes/CoreHD/Repository/devTC

shashwat-mbp: /Volumes/CoreHD/Repository/devTC            ▸▸▸▸▸▹▹▹▹▹
→ ll
total 848
-rw-r--r--@ 1 shashwat  staff   962B Nov 13 09:44 ContestAppletProd.jnlp
-rw-r--r--  1 shashwat  staff   3.3K Nov 13 09:38 greed.conf
-rw-r--r--@ 1 shashwat  staff   411K Nov 13 09:37 Greed-2.0-beta.jar

shashwat-mbp: /Volumes/CoreHD/Repository/devTC            ▸▸▸▸▸▹▹▹▹▹
→ diff -u greed.conf /Volumes/CoreHD/Codes/topcoder-greed/src/main/resources/default.conf 
--- greed.conf  2013-11-13 09:38:51.000000000 +0530
+++ /Volumes/CoreHD/Codes/topcoder-greed/src/main/resources/default.conf        2013-11-12 21:54:46.000000000 +0530
@@ -2,7 +2,7 @@
     codeRoot    = "."

     logging {
-        logLevel    = DEBUG
+        logLevel    = OFF
         logToStderr = true
         logFolder   = Logs
     }

Screenshots

  • Greed configuration.

screen shot 2013-11-13 at 10 13 19 am

I created a clean folder to test the beta.

  • The error page.

screen shot 2013-11-13 at 10 02 57 am

Steps followed before taking the screenshot

  1. Open problem statement.
  2. Reload Configuration -- Noticeable fact, it is taking wrong path
  3. Regenerate problem statement.
  • After switching to standard mode.

screen shot 2013-11-13 at 9 50 59 am

I can see some code generated here, though nothing in my root directory.

Miscellaneous info.

Operating system: OS X Lion with Darwin kernel version 11.4.2

shashwat-mbp: /Volumes/CoreHD/Repository/devTC              ▸▸▸▸▹▹▹▹▹▹
→ sw_vers -productVersion
10.7.5

shashwat-mbp: /Volumes/CoreHD/Repository/devTC              ▸▸▸▸▹▹▹▹▹▹
→ uname -a               
Darwin shashwat-mbp-2.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386

Contest name renderer

I have an issue with contest names, which is caused by topcoder giving different names during SRMs than to practice rooms.

During the contest, the name of the srm is usually "Single Round Match 596".

But the name of the practice room is "SRM 596 DIV 1".

This means that if you separate by folder, you have to manually rename the "Single Round Match 596" after a match before entering practice.

(By the way, this also means that during a match, the division number detection doesn't actually work).

So what I've been thinking is to add a renderer. The renderer smartly translates "Single Round Match XXX" to "SRM XXX". Why stop there? Maybe we can find a way to normalize all TCO match names into "TCO 2009 Round 3C".

Or maybe better than a renderer is to have an Contest.AbreviatedName variable in addition to the Contest.Name one?

Change the syntax of named renderer

Related to wiki page [[Template-Engine]], section Named Renderers.

I suggest that we change the syntax of named renderers in the template engine. Currently we have

${data;renderer(param),renderer(param),...}
${Contest.Name;abbr,}

and my suggestion is:

${data | renderer(param) | renderer(..)}

This is like a pipe semantic in unix shells. I think this is very intuitive and looks clear. Some other template engine syntax uses this style (they call them filter usually).

Well, of course, I know the previously defined templates are using the legacy style {data;renderer}. But the new greed can inintroduce this syntax, and we can keep backward compatibilities but encouraging use of the new style.

Feedbacks are welcome. If acceptable, I'll submit a patch.

Just a note - related changes that can be followed:

  • ${Contest.Name;string(contestcategory100)} => ${Contest.Name | contestcategory(100)}

Some templates don't really need backups

Source code and samples are usually modified by user, so if new file is generated it is worth keeping a backup.

But HTML is unlikely to be modified by user. Maybe have a template option to disable backups?

            problem-desc {
                override = false
                backup = false
                outputFile = "${Problem.Name}.html"
                templateFile = "builtin problem/desc.html.tmpl"
            }

The issue with this would be that it would be best if it was considered "true" by default.

SRM 571 Greed Failure

The auto-generated test cases for SRM 571 Div-II Easy was wrong.

➜ Single Round Match 571 git:(master) ✗ g++ FoxAndGame.cpp
FoxAndGame.cpp: In function ‘bool do_test(std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, int, int)’:
FoxAndGame.cpp:74: error: declaration of ‘int result’ shadows a parameter
FoxAndGame.cpp:74: error: no matching function for call to ‘FoxAndGame::countStars(int&)’
FoxAndGame.cpp:48: note: candidates are: int FoxAndGame::countStars(std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >)

This is a serious issue, when you start losing points in the match due to Arena editor being broken it is a breaking deal.
The auto-generated code: http://codepad.org/dDr54Mn5

New arena time limit / memory limit feature.

Since latest arena update, problem statements now have a limits section. It is important we figure out a way for Greed to detect this section, so that problem statement template can use it.

Could also be useful for custom test templates to know the limits so that they could enforce them.

Flexible talking window

More flexible interface on talking window, including

  • support for indentation
  • support for non-newline text
  • ...

Matched block tag

sometimes it's more convenient to use a tag like to indicate the end of a block explicitly than doing this implicitly by creating a start of a new tag like

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.