MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

This problem is a poll (and a little bit of "white hat hacktivism" as well) regarding Cody users sentiment about the use of regexp to reduce the size/score of Cody solutions.

Your function should return one the following strings, reflecting your opinion on the question: *would you like the regexp (?@cmd) functionality to be banned in Cody?*

'no!' 'no' 'yes' 'yes!'

*note1*: the score of your solution will be 10 for 'no!' 20 for 'no', 30 for 'yes' and 40 for 'yes!' (so that a quick glance at the solution scores should give you an idea of the poll responses). If you want to solve this problem but do not have an opinion on this question -or if you are *really* interested in getting a low score-, just return an empty string (and you will get a 0 score).

*note2*: the question regards only the use of dynamic expressions of the form (?@cmd), it does not ask whether you would like *regexp* to be banned entirely)

**Description:**

The syntax:

regexp '' '(?@a=1)'

is equivalent to

eval 'a=1'

Hiding the functionality inside an eval or a regexp string allows Cody players to achieve a very low score regardless of the true complexity of the evaluated syntax. While the function *eval* is banned in Cody, the function *regexp* is too useful to be banned entirely, so it is not uncommon to see the leading solution to *many* Cody problems using this regexp trick.

There are, nevertheless, relatively simple ways to ban the use of dynamic expressions of the form (?@cmd), while still allowing the rest of the functionality of *regexp*. This poll asks your opinion about having such a ban in Cody.

**Hacktivism**:

This problem testsuite includes a little hack that temporally disallows the use of dynamic expressions of the form (?@cmd) **in all of Cody** (not just this problem), while allowing the rest of regexp functionality to work normally. And your vote decides whether to implement or not this temporal fix:

- If you answer
*'Yes!'*to this problem, one Cody server will stop accepting (?@cmd) solutions (it will return an error to any solution attempting to use dynamic expressions of the form (?@cmd)) - If you answer
*'No!'*to this problem, one Cody server will start accepting them again. - all other answers will have no effect

There are typically around 5 Matlab servers running Cody solutions, and these are reset every hour approximately, so each "hack" will have a relatively short lifespan, and it will also only apply to a small proportion of all Cody solutions (but note that the effect is cumulative, answering ~5 'Yes!' questions is going to disallow the use of (?@cmd) dynamic expressions for all solutions sent to Cody for ~1 hour; answering ~5 'No!' questions is going to revert to the normal behavior).

This allows Cody users to not only express their opinions but also assert some form of 'decentralized' control over Cody behavior (which might, or might not be after all, a good idea). For now I am planning to leave this behavior only for a short time as a small 'hacktivism campaign', and revert this problem to being a pure poll (no longer affecting solutions to other Cody problems) after that. Feel free to take a look at the testsuite to explore how this is implemented (and please use responsibly), and/or leave your thoughts in the comments.

113 correct solutions
22 incorrect solutions

Last solution submitted on May 20, 2015

9 players like this problem

7 players like this solution

2 Comments

J.R.! Menzinger
on 6 Dec 2013

HAHAHAHA!!
I had fun with this paradox! ;-)

James
on 6 Dec 2013

Mind...BLOWN!

1 Comment