Comments (2)
Hi mym0404, I had no idea that online judges ignore stderr
if stdout
is right. The current implementation of the local judge ignores stdout
if there is anything in stderr
. Thanks for bringing it up, love to solve it.
from autocp.
Yes many online judges treats stderr
as a error. So programmers remove debugging line before their submission.
But using stderr
as useful for debugging in local environment.
For example, this is my template.
#ifdef LOCAL
template<size_t S>
string to_string(const bitset<S> &x) { return x.to_string(); }
string to_string(const string &x) { return '"' + x + '"'; }
string to_string(char x) { return string{'\'', x, '\''}; }
string to_string(bool x) { return x ? "true" : "false"; }
template<class H, class T>
string to_string(const pair<H, T> &x) { return "(" + to_string(x.fi) + ", " + to_string(x.se) + ")"; }
template<class T>
string to_string(T x) {
string ret = "[";
for (const auto &i: x) ret += to_string(i) + ", ";
if (sz(ret) > 1) ret = ret.substr(0, sz(ret) - 2);
return ret += "]";
}
string to_string(const char *x) { return {x}; }
string to_string() { return ""; }
template<class H, class... T>
string to_string(H h, T... t) { return to_string(h) + ", " + to_string(t...); }
#define debug(...) sizeof( (char[]){#__VA_ARGS__} ) == 1 ? cerr << endl \
: cerr << "[" << #__VA_ARGS__ << "]: " << to_string(__VA_ARGS__) << endl
#else
#define debug(...) 1
#endif
If I define LOCAL
only my local machine, then OJ compiler doesn't matter.
It prints debugging line in only my local machine like the following.
Also I can submit this code without removing debug(1)
. Because OJ doesn't define LOCAL
macro.
AutoCP is local testing tool and seems to this behavior is incompatible in some case like me.
It will be wonderful if I can use stderr
for AutoCP also.
But it is your choice. Because I can configure AutoCP build command like without LOCAL
macro and it doesn't need delete code manually for AutoCP testing.
I just suggest this
from autocp.
Related Issues (20)
- Plugin is incompatible with the latest Intellij IDEA 2022.2.1 HOT 1
- Not able to compile with autoCp for java in intellij ultimate. It shows "Error : Test Framework quit unexpectedly" HOT 8
- Debug in Python HOT 1
- Default setup unfavorable for java HOT 1
- "IDE Internal Error Occurred" when opening settings HOT 1
- Not able to run with AutoCp for kotlin in IntelliJ Ultimate. It shows "Error : Test Framework quit unexpectedly" HOT 2
- Plugin is incompatible with the latest CLion Version 2022.3 HOT 3
- Doesn't work for Rust - invalid characters
- Nothing happens on clicking competitive companion icon HOT 15
- Alternate File Naming Option HOT 2
- Java Issues HOT 1
- Option to temporarily disable autocp
- Option to disable automatically add executable HOT 1
- Import test case only but generate file HOT 2
- Cannot run AutoCP HOT 1
- Build and run execute command in solution file directory? HOT 1
- Short desc of the bug HOT 1
- Not compatible with the version of your running IDE (IntelliJ IDEA 2022.1, PyCharm 2022.1.1) HOT 2
- Non-ascii letters support HOT 4
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 autocp.