WTF Bites
-
@anonymous234 said in WTF Bites:
https://douchebags.com/summer-editions
Douchebags?
I'm disappointed. If they'd been those little bags for toiletries that would have been an actually witty name.
-
@HardwareGeek said in WTF Bites:
javascript is rather typefluid
What pronouns does it use?
undefined
-
@HardwareGeek said in WTF Bites:
javascript is rather typefluid
What pronouns does it use?
shit / flamingbagofshit
-
@HardwareGeek said in WTF Bites:
javascript is rather typefluid
What pronouns does it use?
They're out of date before anyone's learned them.
-
-
a minor bug where typing a forward slash into a text field would paste the contents of your clipboard instead
Can anyone conceive of a plausible explanation?
-
a minor bug where typing a forward slash into a text field would paste the contents of your clipboard instead
Can anyone conceive of a plausible explanation?
Debug code left over.
-
Reset the password on the online portal for my car insurance. Used a password generated by KeePassXC.
Logged in afterwards only to find the page not loading properly. Logged out, back in, nothing. Tried it again.
-
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
it was getting deleted anyways
Shit like this is also getting deleted.
Why are you double-checking if a thing was null and then if it is null or empty (or less than empty)?!?!
There is a reason: the application is multi-threaded, and the Events property can be updated from many threads, from many places, from virtually anywhere in the application.
So, some when in the past, bad things happened, and the property changed its value in between 2 sequential accesses...(Of course, that's not the correct way to make the property thread-safe.)
-
@loopback0 said in WTF Bites:
Reset the password on the online portal for my car insurance. Used a password generated by KeePassXC.
Logged in afterwards only to find the page not loading properly. Logged out, back in, nothing. Tried it again.
Strange, #'"- do not even require UTF8 encryption, a common ANSI encryption would already work.
-
@BernieTheBernie said in WTF Bites:
UTF8 encryption
I think the word you're looking for is "encoding".
-
@BernieTheBernie said in WTF Bites:
UTF8 encryption
I think the word you're looking for is "encoding".
No, of course not "encoding" - we are talking about passwords! And passwords must be encrypted, not encoded.
-
I don't want to belong to any club that would accept me as a member.
I'm a member of all clubs that don't accept me as a member.
-
@HardwareGeek said in WTF Bites:
javascript is rather typefluid
What pronouns does it use?
[object Object]
-
@BernieTheBernie said in WTF Bites:
No, of course not "encoding" - we are talking about passwords! And passwords must be encrypted, not encoded.
That's for the fake of security!
Ehm wait, what did I write? "fake"? Is that a Freudian flip?
-
@BernieTheBernie said in WTF Bites:
@BernieTheBernie said in WTF Bites:
No, of course not "encoding" - we are talking about passwords! And passwords must be encrypted, not encoded.
That's for the fake of security!
Ehm wait, what did I write? "fake"? Is that a Freudian flip?
You meant to invoke a traditional Japanese drink, as such is always useful when considering “security”.
-
@dkf sakerity?
-
a minor bug where typing a forward slash into a text field would paste the contents of your clipboard instead
Can anyone conceive of a plausible explanation?
Debug code left over.
Well, I can imagine that pressing slash did CTRL-V instead, but how did it also tweaked the "mirror vertically" at the same time?
-
I don't want to belong to any club that would accept me as a member.
I'm a member of all clubs that don't accept me as a member.
Mr Russel would like to have a word with you.
-
-
-
Who should be shot? The guy who decided that JSON must not have trailing commas, or the guy who decided that JSON is a good format for writing templates (that require a lot of hand editing)?
Inb4
Inb4₂: it's not JSON anyway—it allows comments
-
Who should be shot? The guy who decided that JSON must not have trailing commas, or the guy who decided that JSON is a good format for writing templates (that require a lot of hand editing)?
Inb4
Inb4₂: it's not JSON anyway—it allows comments
-
We already have HJSON. And JSonnect. And YAML. And TOML.
-
-
So the Tizen browser has trouble playing video. It kind of works, when the video is full screen, there's only one video and there are no overlapping DOM elements. Miss one of these conditions and various artifacts appear, the playback is choppy and things suck in general. Out of curiosity I googled 'tizen poor video rendering', only to find this gem
These exceptional folks don't even think it's a problem, because you know, in 2019 videos are normally played by Flash. And we don't support Flash anyway, so what's your problem, eh?
-
TIL
Interesting, because I was under the impression that I had learned about it from you. O_O
It was a TDWTFer bot writer in any case. Perhaps @accalia.
-
@BernieTheBernie said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
it was getting deleted anyways
Shit like this is also getting deleted.
Why are you double-checking if a thing was null and then if it is null or empty (or less than empty)?!?!
There is a reason: the application is multi-threaded, and the Events property can be updated from many threads, from many places, from virtually anywhere in the application.
So, some when in the past, bad things happened, and the property changed its value in between 2 sequential accesses...(Of course, that's not the correct way to make the property thread-safe.)
Nope, not multi threaded at all! (though by the looks of things the developer thought it might have been)
Probably the same guy who did a try-fail-try-once-more-then-just-fail function for deleting folders.
-
@BernieTheBernie said in WTF Bites:
@BernieTheBernie said in WTF Bites:
No, of course not "encoding" - we are talking about passwords! And passwords must be encrypted, not encoded.
That's for the fake of security!
Ehm wait, what did I write? "fake"? Is that a Freudian flip?
ITYM "fuck security"
-
Java:
public class Main { static int Test() { try { return 1; } finally { } return 2; } public static void main(String[] args) { System.out.println(Test()); } }
Did you expect Test to return 1?
Well, actually what you get is a compilation error because the second return is unreachable.
Now do this:
public class Main { static int Test() { try { return 1; } finally { return 2; } } public static void main(String[] args) { System.out.println(Test()); } }
Now did you expect a compilation error to be returned because the second return is unreachable?
Nope.
Did you at least expect 1 to be returned by Test, because the 2 ought only be returned if there was an eventual exception forcing an early return of the
try
block?Nope again. It returns 2. The return value of a finally block takes precedence (or it overrides the previous return, if you want to look at it that way).
-
@Zecc other than "unreachable code" being hard error rather than a warning, I don't really find any of that surprising (think about what the generated bytecode must look like - there's really only one answer). But yes, it would be better to disallow
return
infinally
.
-
Status: $deity damnit!
-
@Tsaukpaetra said in WTF Bites:
TweenAlpha Transform
Sounds like some plot elements from MTV's TweenWolf.
-
We already have HJSON
TIL, but
JSON5 npm weekly downloads: 30M
HJSON npm weekly downloads: 177kOn the other hand HJSON maintains implementations in C++, Java, C# (.нет), Python (2+3), Rust, Go, JavaScript, PHP and Ruby and IDE support for Code, Atom, SublimeText, TextMate, ViM and Visual Studio. JSON5 only maintains one for JavaScript and the Go and .нет repos are archived.
-
Did you at least expect 1 to be returned by Test, because the 2 ought only be returned if there was an eventual exception forcing an early return of the
try
block?It is a finally, not a catch. It is executed always, exception or not, that's the catch. So it is certainly reachable, always executes and, um, as long as it is allowed to return there, it kind of logically preempts the return from the try block that is still pending at that point.
-
@Zerosquare said in WTF Bites:
@anonymous234 said in WTF Bites:
Douchebags?
Maybe they know their customers very well?
From their about page https://douchebags.com/about
What’s in a name?
*The name “Douchebags” was conceived and dismissed in an early brainstorming session. Then Jon asked his audience what the company should be called, and “Douchebags” came up again and again. They liked that it was irreverent and brought a playfulness to their otherwise polished branding. With one chance to succeed, they knew they needed to be memorable. After much debate they finally decided: Douchebags it is.
I think you're right...
Edit: also:
“With a name like Douchebags, we had to be good.”
-
(think about what the generated bytecode must look like - there's really only one answer)
In retrospect, yes. The return instruction from
finally
is inserted before the return instruction fromtry
, along with the wholefinally
block, right between the evaluation of the expression intry
's return (1 in this case) and the return instruction itself.So it is certainly reachable, always executes and, um,
Indeed: um.
I mean, I get it. Yes, saying the second return is unreachable was a mistake on my part; I know it's not.
But it's a really strange behaviour from the compiler. At the very least it should issue a warning. Clearly someone meant to return the result of an expression from the
try
block, but even if the expression is still evaluated, side effects and all, its value is being thrown away.
-
It is executed always, exception or not, that's the catch
Knowing the mechanics of finally, I can understand why this is the outcome, but it's still a WTF. No normal coder is going to look at that and expect the 'return 1' not to end the method.
I'm struggling to think of a legitimate reason to return from a finally - if the exception doesn't get thrown you can return from inside the try or after the whole expression. It should probably just not be allowed.
-
@bobjanova said in WTF Bites:
it's still a WTF. No normal coder is going to look at that and expect the 'return 1' not to end the method.
What did you expect? It's Java after all. There is plenty of things that normal coder is not going to expect, but Java does them nevertheless.
-
(think about what the generated bytecode must look like - there's really only one answer)
In retrospect, yes. The return instruction from
finally
is inserted before the return instruction fromtry
, along with the wholefinally
block, right between the evaluation of the expression intry
's return (1 in this case) and the return instruction itself.In the general type theory of these things, returns are a special kind of exception that can only be caught by exiting the function. The finally intercepts that, and can replace that exception with another one (but don't do that because it is confusing as hell). The implementation converts the logical exception into jump threading and so on, so the cost of building the exception information is never needed, but at the logical level it still exists (since you can't name the exception type, you can't actually intercept and inspect the exception, and if you could, the jump threading would detect the case and cause the exception to be built for real; this is one of the cases where adding debugging code would fundamentally change the generated code).
Most programmers never think about this aspect of the type system. It's usually only of interest to people developing language implementations.
-
Let's kick it up a notch (although this is entering "why would you ever do that?" territory):
public class Main { static int Test(int i) { while(i --> 0) { try { System.out.println(i); return i; } finally { System.out.println("PSYCHE!"); continue; } } System.out.println("FIN"); return 42; } public static void main(String[] args) { System.out.println(Test(10)); } }
Try to guess the output from the compiler and program (if compilable)
Z:\> javac .\Main.java Z:\> java Main 9 PSYCHE! 8 PSYCHE! 7 PSYCHE! 6 PSYCHE! 5 PSYCHE! 4 PSYCHE! 3 PSYCHE! 2 PSYCHE! 1 PSYCHE! 0 PSYCHE! FIN 42 Z:\>
You've probably guessed correctly given this discussion, but good luck realizing this is a realistic codebase.
-
-
-
FWIW the better Java fails to compile, reporting
CS0157 Control cannot leave the body of a finally clause
.( after replacing
System.out.println
withConsole.WriteLine
)
-
while(i --> 0) {
I hate you.
Never forget the “slides to” operator, either. And other humourous variations:
This is
athe case where I must begrudgingly admit programming ligatures aren’t always in your best interest, though
-
FWIW the order of execution when an assignment is involved is as expected given the above.
public class Main { static int I; static int Report(String where, int i) { System.out.println(String.format("%s: %d", where, i)); return i; } static int Test() { try { I = 1; return I = Report("try return", 2); } finally { return Report("finally return", 3); } } public static void main(String[] args) { Report("Main test", Test()); Report("Main I", I); } } --- Z:\> javac .\Main.java Z:\> java Main try return: 2 finally return: 3 Main test: 3 Main I: 2 Z:\>
And thus concludes the time I've alotted to myself to waste on this for now.
-
Me vs NetBeans.
NB: I can't find Java.lang!
Me: Ok, let's check the Java Platforms.
NB: /usr does not contain Java.
Me: No, that's because Java is in /usr/lib/jvm so can I change that?
NB: No, to change the path you need to remove the old platform, then add a new platform with the same name and the new path.
Me: Can I remove the old one?
NB: No.
Me: So then I create a new one with the same name.
NB: Ok!
Me And remove the old one.
NB: No, can't remove the old one.
Me: Can I change the default?
NB: No.
Me: Ok, so I remove the new one and create a new platform with a different name.
NB: Ok!
Me: Can you use the new one if I tell you to use that one instead?
NB: Still can't find Java.lang.
Me: Are you using the new platform?
NB: Yes! (No, I'm really just pretending.)
Me: So how do I change the default platform or the path?
NB: I wont tell!
Me: asks Google
: You need to open the netbeans.conf file and change the path there.
Me: Really...
NB: Oh, hey, I found Java.lang now!
Me: Why is your UI so useless and/or lying?
NB: Because fuck you that's why!
-
@kazitor I'm a fan of the =! operator. It also extends to other variations, of which "=+" is a personal favourite.
-
if (std::isnan(inputs[i])) { outputs[i] = inputs[i]; } else { ...
I'm slightly bothered by the unnecessary double read.
-
@Gąska Unless the code does something silly in-between (i.e., you're showing a slightly sanitized version here), compilers should optimize that to a single memory read. (Modulo volatile of course, but hopefully it isn't.)
Edit: Although ... why are you copying values only if they are nan? Nan-tagging?