|
UraniumAnchor posted:From a few pages back but I worked on a game where certain computers would mishandle a rig calculation and lock the player's head in the exact opposite angle that it should have been. It's also not unheard of for very high performance code to select different implementations at runtime depending on available CPU features, but I don't know how much if that you tend to see in games.
|
# ? Oct 8, 2016 01:04 |
|
|
# ? May 29, 2024 13:53 |
|
Ralith posted:Was it the same build of the game, byte-for-byte? Often compiler optimizations that treat floats as real numbers are to blame for this sort of thing, and those can be sensitive to small changes in build configuration or code or compiler version or ... It was Unity based so it's entirely possible it was some weird JIT thing with Mono, but otherwise was the same package, yes. It would only happen on certain computers, but it would reliably happen there.
|
# ? Oct 8, 2016 01:06 |
|
hobbesmaster posted:Because reinterpret_cast worked so well for C++ reinterpret_cast works perfectly well, it's a big red flag that says "PAY ATTENTION" in code reviews(/port-mortem debugging)
|
# ? Oct 8, 2016 01:22 |
|
I was really tired at the end of the day earlier this week and wrote code:
|
# ? Oct 8, 2016 02:19 |
|
UraniumAnchor posted:It was Unity based so it's entirely possible it was some weird JIT thing with Mono, but otherwise was the same package, yes. It would only happen on certain computers, but it would reliably happen there. Man, who even knows what weird nondeterminisms lurk in Unity's ancient version of Mono's JIT. It almost certainly wasn't the CPU's fault. The real problem in this sort of situation is usually that you're using a numerically unstable algorithm. Correct behavior in most applications shouldn't depend on exact error characteristics.
|
# ? Oct 8, 2016 02:24 |
|
Saw this in a piece of code that my driver interacts with.code:
|
# ? Oct 8, 2016 07:19 |
|
Apex Rogers posted:Saw this in a piece of code that my driver interacts with. It's conceivable that ! was overloaded... although it's a pointer, so that would probably require !(*device)?
|
# ? Oct 8, 2016 07:34 |
|
Dr. AA Hazredstein posted:It's conceivable that ! was overloaded... although it's a pointer, so that would probably require !(*device)? You assume it's a raw pointer and -> isn't overloaded as well. If it works though that moves the horror to whoever defined the behavior of those operators.
|
# ? Oct 8, 2016 07:45 |
|
hobbesmaster posted:You assume it's a raw pointer and -> isn't overloaded as well. If it works though that moves the horror to whoever defined the behavior of those operators. Good point. Horror-worthy code either way.
|
# ? Oct 8, 2016 07:52 |
|
http://jazcash.com/a-javascript-journey-with-only-six-characters/ The following is valid, executable javascript. Run it in your browser console if you don't believe me. [][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+(+(!+[]+!+[]+!+[]+[!+[]+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+![]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(+![]+[![]]+([]+[])[([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]](!+[]+!+[]+!+[]+[!+[]+!+[]+!+[]])+(!![]+[])[+[]]+(![]+[])[+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])()
|
# ? Oct 8, 2016 15:23 |
|
Carbon dioxide posted:http://jazcash.com/a-javascript-journey-with-only-six-characters/ Allowing JavaScript but disallowing alphanumeric characters is almost daring those people to make up things like that.
|
# ? Oct 8, 2016 17:12 |
|
JS's unicode support also produces fun stuff: http://thedailywtf.com/articles/javascript-obfuscation
|
# ? Oct 8, 2016 17:46 |
|
Carbon dioxide posted:if you don't believe me. I know better than to doubt horrors in this thread.
|
# ? Oct 8, 2016 18:12 |
This... interesting means of loading a value from a database was recently found in our code.code:
|
|
# ? Oct 10, 2016 07:40 |
|
Arson Fire posted:This... interesting means of loading a value from a database was recently found in our code. Is this not equivalent to the inner-most expression? lol
|
# ? Oct 10, 2016 12:35 |
|
I came across this little gem recently. I don't know if it used to do something and the functionality gradually got removed, or if it was a joke or just stupidity/ignorance or what.code:
Stoatbringer fucked around with this message at 21:02 on Oct 10, 2016 |
# ? Oct 10, 2016 20:59 |
|
leper khan posted:Is this not equivalent to the inner-most expression? lol It is until there's that one weird bug that makes it not equivalent. Of course, there will be no unit test for this behavior.
|
# ? Oct 10, 2016 21:11 |
|
Stoatbringer posted:On a similar note, I also found (and removed) something which took a String, parsed it to an Integer, took the intvalue and converted it back to a String. For some reason. Maybe the intention was to take a string that had int-y bits and non-int-y bits, and just get the int-y bits? Depending on how that particular parser works, anyway.
|
# ? Oct 10, 2016 21:26 |
|
Stoatbringer posted:I came across this little gem recently. I don't know if it used to do something and the functionality gradually got removed, or if it was a joke or just stupidity/ignorance or what. It should be calling getEmptyStr() instead of appending that magic value
|
# ? Oct 10, 2016 23:16 |
|
Stoatbringer posted:On a similar note, I also found (and removed) something which took a String, parsed it to an Integer, took the intvalue and converted it back to a String. For some reason.
|
# ? Oct 11, 2016 10:25 |
|
Apparently there is still a payment gateway that requires ActiveX - I truly hope that what I saw on my bosses screen is for research purposes only, as I'm not too keen to be integrating that.
|
# ? Oct 11, 2016 14:40 |
|
canis minor posted:Apparently there is still a payment gateway that requires ActiveX - I truly hope that what I saw on my bosses screen is for research purposes only, as I'm not too keen to be integrating that. edit: at least not the latest version of any browser
|
# ? Oct 11, 2016 15:40 |
|
Volte posted:Considering there's not a single browser that still supports ActiveX I don't think you have much to worry about. I'm imagining scenario where we tell the users to install ActiveX to continue with their payment
|
# ? Oct 11, 2016 17:24 |
|
canis minor posted:Apparently there is still a payment gateway that requires ActiveX - I truly hope that what I saw on my bosses screen is for research purposes only, as I'm not too keen to be integrating that. maybe it's south korean
|
# ? Oct 11, 2016 18:24 |
|
Su-Su-Sudoko posted:maybe it's south korean It probably is.
|
# ? Oct 11, 2016 19:11 |
|
SupSuper posted:I see this used a lot with numbers and dates in an attempt to discard unwanted parts from the data. They never use CultureInvariant either. A project I'm maintaining does something like this all over: code:
Not sure if the original dev didn't know how to properly initialize decimals or something... maybe he tried something like code:
code:
and just did the string parsing because it worked. I keep seeing this randomly throughout the project because my region settings use a comma as the decimal point, so it keeps throwing exceptions at the most unexpected times, because they obviously didn't use InvariantCulture either.
|
# ? Oct 11, 2016 21:12 |
|
beuges posted:A project I'm maintaining does something like this all over: i have heard of some places banning using decimal/float/double/etc literals for whatever loving reason, so maybe that was his workaround?
|
# ? Oct 11, 2016 21:53 |
|
When confronted with static typing some people jam everything into string literals to shut the compiler up. It's basically a form of weak typing. I've seen numbers, bools, and what ought to be enumerations handled this way.
|
# ? Oct 12, 2016 01:40 |
|
HappyHippo posted:When confronted with static typing some people jam everything into string literals to shut the compiler up. It's basically a form of weak typing. I've seen numbers, bools, and what ought to be enumerations handled this way. That's when you encourage them to pursue a career closer to their proclivities.
|
# ? Oct 12, 2016 01:54 |
|
Dr. AA Hazredstein posted:That's when you encourage them to pursue a career closer to their proclivities. TCL programmer?
|
# ? Oct 12, 2016 02:20 |
|
Fergus Mac Roich posted:TCL programmer? TCL, Python, Javascript, Visual Basic, anything away from your code!
|
# ? Oct 12, 2016 02:29 |
|
HappyHippo posted:When confronted with static typing some people jam everything into string literals to shut the compiler up. It's basically a form of weak typing. I've seen numbers, bools, and what ought to be enumerations handled this way. It's called "stringly typed"
|
# ? Oct 12, 2016 02:51 |
|
Dr. AA Hazredstein posted:That's when you encourage them to pursue a career closer to their proclivities. Weaving?
|
# ? Oct 12, 2016 03:14 |
|
vOv posted:Weaving? I do weaving and it's p chill and reminds me a lot of a more zen, visual version of programming, actually.
|
# ? Oct 12, 2016 03:17 |
|
Bongo Bill posted:It's called "stringly typed"
|
# ? Oct 12, 2016 04:04 |
Recently I've had to write some TCL stuff for my research, and I can't help but find the "everything is a string" thing kind of endearing.
|
|
# ? Oct 12, 2016 06:28 |
|
TCL is nice for programs of up to maybe 50 lines. Shell also does "everything is a string", but much worse.
|
# ? Oct 12, 2016 07:33 |
|
Bongo Bill posted:It's called "stringly typed" I worked in the team that invented this term, seriously. It was hell.
|
# ? Oct 12, 2016 08:47 |
Ugh, I'd never encountered "stringly typed" in the wild until I caught the most egregious coding horror version of it - someone was using a string as a makeshift tuple. I threw up a little in my mouth when I realized exactly what was going on there.
|
|
# ? Oct 12, 2016 14:08 |
|
|
# ? May 29, 2024 13:53 |
|
ChickenWing posted:Ugh, I'd never encountered "stringly typed" in the wild until I caught the most egregious coding horror version of it - someone was using a string as a makeshift tuple. I threw up a little in my mouth when I realized exactly what was going on there. It was standard practice for a different team at the place I used to work to do this: code:
|
# ? Oct 12, 2016 14:27 |