Comments (10)
This is actually a pretty awesome idea!
Definitely gonna have this!
The type should be a string array I guess, according to the current use case.
Do you think this is enough?
Maybe we need
options {
multiprocess = true
timeout = 3 seconds
}
But this will make things more complicated, and I'm not even sure if the template can support things like 3 seconds
in the if statement. Likely not. :-|
from topcoder-greed.
That's enough. Of course a more flexible syntax would be better but I know that's hard and we need to avoid making things too complicated.
You can do ${if ssss = 3}, but it doesn't work with many variables. It is very odd that it randomly works or not.
Of course, in that idea , it would be better if you defined things that are not just for ${if, but also for printing in the template. If you could print ${options.timeout}, that would be cool. But so far if only the boolean flags thing is possible, that's good.
from topcoder-greed.
Of course, for setting theme options maybe something like:
options { backgroundColor = #eee forrgroundColor = #111 }
Would be nice, but it does get more complicated.
from topcoder-greed.
No, that would be a bad idea, but maybe if we could use:
problemdesc { options { styleSheet = 'somecustompath.css' } }
So that coder could use own style sheet it would be cool.
from topcoder-greed.
About the syntax (and if we agree with it, I can try implementing it as it is a wonderful unbusy time I am having). There are two things I think would be wonderful to be able to have.
- Boolean conditions (So that we can do ${if}, ${else}.
- String fields. I didn't think of this at first, but I think it would be very important to be able to determine what to type in some parts of template.
I think the answer to do this both is something like this:
- A part related to template definition declares the variables it has available.
- Initially, all variables are initialized with null.
- default.conf possibly shouldn't set any of the variables that are meant to be used with ${if} (leave them as null). This way, if someone's config file doesn't set them, they are null too, but this someone can set them to non-null.
If we could do string comparisons inside ${if} it would be easier, but I tried and jmte doesn't seem to like them.
@wookayin : More opinions would be good.
from topcoder-greed.
In my opinion, a options map from string to string is enough. For example,
options {
multiprocess = true
theme = dark
}
If jmte can recognize ${if options.multiprocess}
iff it has a non-null value, any value is fine.
In this way, the string->(boolean | string)
map is expressive enough, I think.
from topcoder-greed.
If default.conf has:
options { multiprocess = true }
And greed.conf has:
options { theme = dark }
Will options.multiprocess still be "true"?
from topcoder-greed.
Yes, that's a problem.
But according to jmte doc, user can set it to false, and it will be false.
When evaluating if
condition, it checks if it's null or toString resulting in false
.
http://jmte.googlecode.com/svn/trunk/doc/index.html
from topcoder-greed.
Yes, that's a problem.
Do you mean that options.multiprocess will be "true" ? That's actually very good.
from topcoder-greed.
Oh, I misunderstood you.
Yes, in your situation it will be true.
I thought you meant user may not able to disable the multiprocess, so I looked up the doc of jmte and it turns out the user can disable it by setting the value to false
.
from topcoder-greed.
Related Issues (20)
- Cannot configure pathPattern and fileNamePattern HOT 7
- Not recognizing config file HOT 1
- Config error: Config object needed, ConfigString found HOT 3
- The return value of long[] is attached with "L" in testcase.sample HOT 3
- Question: Is it possible to detect "practice room"? HOT 5
- Allow camelCase properties in templates
- Ecosystems for community-created contents (templates) HOT 5
- Code generation fails on SRM 627 Div 2 500 point problem HOT 3
- Is it possible to get a hook when the contest starts or to get contest time when generating code?
- Is it possible to get a raw string of the problem description? HOT 3
- Is there a support to generate the tests by supplying the problem statement offline?
- Grid containing whitespaces are not displayed in HTML properly HOT 1
- Submission from terminal without going to arena HOT 1
- Tests are not working in Xcode 6.1 (Passed : 0/0 cases) HOT 1
- About Release and Roadmap plans HOT 1
- OverWrite existing workspace
- SRM 676 div2 Farmville the test code does not work
- Filtering source code before submit
- Is the default language configurable?
- "data" causes compile error in C++17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from topcoder-greed.