It's strange that this solution could pass the test.
you are right this is strange, judging from the error messages ('rm: No such file or directory') it is likely that this solution benefited from sharing the same linux session as another solution that may have change the linux path (e.g. setenv trick). This would be interesting because it might open up the possibility of exchanging info between different solutions, got to find out how cody distributes solutions among different matlab and linux sessions...
after digging up a little more it seems that at any time there are around five (probably virtual) servers running Cody solutions, and that solutions run on the same server will in fact share the same linux AND matlab session. The workspace seems to be cleared for every new solution but you can still make it so that one solution creates a function that is then available to other solutions (I made a practical demonstration of this in problem 1774). The servers will last for a while (perhaps up to an hour or so) and there may be some main control process that keeps things running smoothly (I managed to break the Cody pipeline on one of the servers by accident once and it soon disappeared an a new server was spawn in its place; btw sorry Matlab admins about this, my bad)... in any way, I will update if I find out more about all this.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
get = me();
y = rand(1,12345);
!rm now.m
!rm assert.m
assert(get == now)
[Warning: Function /users/msssystem18/assert.m has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.]
[> In me at 5
In verifyCode>evaluateCode at 227
In verifyCode at 40
In fevalJSON at 14
In workspacefunc at 7]
/bin/bash: rm: No such file or directory
[Warning: Function /users/msssystem18/assert.m has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.]
[> In verifyCode>evaluateCode at 227
In verifyCode at 40
In fevalJSON at 14
In workspacefunc at 7]
/bin/bash: rm: No such file or directory
[Warning: Function /users/msssystem18/assert.m has the same name as a MATLAB builtin. We suggest you
rename the function to avoid a potential name conflict.]
[> In verifyCode>evaluateCode at 227
In verifyCode at 40
In fevalJSON at 14
In workspacefunc at 7]
|
2500 Solvers
3894 Solvers
Project Euler: Problem 1, Multiples of 3 and 5
1492 Solvers
367 Solvers
525 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!