WTF Bites
-
@anonymous234 said in WTF Bites:
@Gąska So just add a Real-User-Agent header. Genius!
But would only PHP websites work then? How will we support the burgeoning node.js ecosystem?
-
Oh well. In code reviews I've been discouraged from using that wrapper sort of thing. I can't exactly be told to and it wasn't important enough to discuss at length. I see them as equal, though I might avoid the wrapper for everybody's peace of mind. Seeing as it sort of cropped up here I thought I'd ask...
-
How will we support the burgeoning node.js ecosystem?
Burn it to the ground
-
Fetch message from empty queue: exception.
Check if queue is empty? Not possible.Lovely… though it's correct on one level in that retrieves can't actually be guaranteed to succeed from queues that have multiple consumers; there's an inherent race condition.
Sure, but returning null, or some structure with false flag, would be... too sane for IBM I guess.
Whole IBM library for MQ is full of stuff like this. Browsing decompiled sources is quite a ride - it looks like they hired a 5 year old for this.
-
Come on. No self-respecting five-year old would work for IBM.
-
@Zerosquare said in WTF Bites:
Come on. No self-respecting five-year old would work for IBM.
I was going to say, that sounded like slander...against five-year olds.
-
decompiled sources
That may not be a good indicator of what the original source code looked like.
-
-
@loopback0 said in WTF Bites:
@loopback0 no repro. You must've googled a lot for random applications for Android.
Different computer, Incognito mode, same results:
Confirmed.
-
decompiled sources
That may not be a good indicator of what the original source code looked like.
Yeah, it was a lot worse.
Another fine example: every state. every choice, every name, etc, is a constant value. Not that bad you think? Better than strings, right? Except they are not enums, just numbers, which you have to look up on IBM website.
So, when you want to do something, you look at documentation or some tutorial and there is:
"It's simple, all you have to do is call CreateFrobnicator with IBMMQ_ISTW_ALQ_MAYBE!"
Which is not defined anywhere in code, of course, and you have to search for it.
Or, when reading source code, you constantly see stuff likeCreateFrobnicatorFactory(someHandle, 11, 7, 2, 32412, 84, false);
-
-
Why would I pay an extra two dollars (much less multiple times!) in order to get a duplicate of a document that I will be receiving as a PDF in my email? I can just print off the original as many times as I want.
This morning (pre-caffeine) when I first read this post, it took a little while for the extent of the to sink in. Now I'm wondering how many people have paid.
-
@loopback0 said in WTF Bites:
Now I'm wondering how many people have paid.
There's a sucker born every minute
-
Except they are not enums, just numbers, which you have to look up on IBM website.
That reminds me very much of how IBM mainframe software traditionally worked, except with less in the way of websites and more in the way of a wall of manuals where the codes were actually a multi-dimensional index into that wall.
-
decompiled sources
That may not be a good indicator of what the original source code looked like.
Yeah, it was a lot worse.
Another fine example: every state. every choice, every name, etc, is a constant value. Not that bad you think? Better than strings, right? Except they are not enums, just numbers, which you have to look up on IBM website.
So, when you want to do something, you look at documentation or some tutorial and there is:
"It's simple, all you have to do is call CreateFrobnicator with IBMMQ_ISTW_ALQ_MAYBE!"
Which is not defined anywhere in code, of course, and you have to search for it.
Or, when reading source code, you constantly see stuff likeCreateFrobnicatorFactory(someHandle, 11, 7, 2, 32412, 84, false);
Nuke it from orbit!
-
@Tsaukpaetra said in WTF Bites:
Edit: Wait, didn't it say it only needed 1.6 or higher? What garbage...
It updated in between. BLEEDING EDGE FOR ALL!
-
@boomzilla said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Status: Can I tell you where I have installed the java runtime? No? Ok fine...
In your roaming appdata directory?
Ooh, a old new problem? I'll necro it with my own experience. Eight years ought to be enough for positive change, right?
-
I don't know if this is an April Fools joke or if Windows thinks I'm in Europe, despite having already changed the clock over a few weeks ago:
It's 5:22 (ok 5:23 now) in Eastern, the one true time zone. Get it right, Windows
-
@hungrier
why should this be a problem?I'm in Europe and some of our APC UPS's think that we've switched to "Summertime" ~2 Weeks ago...
/fails to see the error :-)
-
@iKnowItsLame said in WTF Bites:
@hungrier
why should this be a problem?I'm in Europe and some of our APC UPS's think that we've switched to "Summertime" ~2 Weeks ago...
/fails to see the error :-)
There's no "summertime" in Canada. Duh.
-
found the culprit ?
-
@iKnowItsLame uh...what?
-
@boomzilla
I'll just blame Canada
-
Get it right, Windows
: Sure thing! Lemme just install some updates for that, BRB
-
-
@Applied-Mediocrity said in WTF Bites:
@anonymous234 said in WTF Bites:
I wish I could just write @ process.Kill() to suppress common errors.
Do you want
@Application.Run()
? Because that's how you get@Application.Run()
.Now, I agree exceptions do not make sense in many cases and writing a try-catch block for every such little thing is a chore that also harms code readability (among other things). But I have no serviceable idea what the solution should look like (inb4 with Rust).
Hi! In Rust, intended-to-be-handled errors are a return type, and the
?
operator either evaluates to the value or returns the error depending on whether the operand was successful or erroneous. There are also try-blocks (an unstable feature) which essentially provide a local scope for this, so you can use the?
operator without your function having to returnResult
. So you can 'ignore' errors like so:fn foo(arg: &str) -> Result<i32, Box<dyn Error>> { let x = arg.parse::<i32>()?; Ok(x + 1) }
and then the try-block variant of this looks like:
fn foo(arg1: &str, arg2: &str) -> i32 { let x = try { arg1.parse::<i32>()? + arg2.parse::<i32>()? } if let Ok(x) = x { x } else { 0 } }
As a bonus, the
?
operator auto-converts errors. Notice that the error type in the first example isBox<dyn Error>
despitestr::parse
's error type beingParseError
.
-
It is still insisting the folder is empty. You have one job Outlook!
-
@Cursorkeys TRWTF is all of those unread emails.
-
@loopback0 said in WTF Bites:
@Cursorkeys TRWTF is all of those unread emails.
Accelerated testing for some things that send email via GPRS.
-
@anonymous234 said in WTF Bites:
The line between what's an exception and what's just a different result is still too blurry for my comfort.
It's not blurry. It just depends on what you're actually doing, and can't really be 100% generic. Working with subprocesses is usually like that…
It depends on the language. In Python exceptions are not heavily skewed towards not being thrown, catching on the hot path is considered OK, and consequently all abnormal returns are via exception and it is not blurry and 100% generic.
It is also possible to go in the other direction and use exceptions for obvious internal errors only (i.e. when the condition indicates a bug in the code) and never for anything environment-dependent.
But C# (and Java) are trying to use some middle path and that is not generic, because you never know what is actually exceptional in current context.
-
It is also possible to go in the other direction and use exceptions for obvious internal errors only (i.e. when the condition indicates a bug in the code) and never for anything environment-dependent.
Arguably you should be using something stronger than exceptions for that, or at least not catch these kinds of exceptions, because at that point everything is messed up already. Depends on use case, of course.
-
@pie_flavor said in WTF Bites:
So you can 'ignore' errors like so:fn foo(arg: &str) -> Result<i32, Box<dyn Error>> { let x = arg.parse::<i32>()?; Ok(x + 1) }
That's propagating, not ignoring. Ignoring would be
arg.parse::<i32>().unwrap_or(0)
.and then the try-block variant of this looks like:
fn foo(arg1: &str, arg2: &str) -> i32 { let x = try { arg1.parse::<i32>()? + arg2.parse::<i32>()? } if let Ok(x) = x { x } else { 0 } }
… or you can use the combinators, though something like
arg1.parse::<i32>().and_then(|x| arg2.parse::<i32>().map(|y| x + y))
is on the edge of starting to look ugly (but it's stable).
-
… or you can use the combinators, though something like
arg1.parse::<i32>().and_then(|x| arg2.parse::<i32>().map(|y| x + y))
is on the edge of starting to look ugly (but it's stable).Both can be done more simply. I'm just showing the features.
-
It is also possible to go in the other direction and use exceptions for obvious internal errors only (i.e. when the condition indicates a bug in the code) and never for anything environment-dependent.
Arguably you should be using something stronger than exceptions for that, or at least not catch these kinds of exceptions, because at that point everything is messed up already. Depends on use case, of course.
Rust, which uses that approach, has the exceptions—called panics here—watered down to error message (it's a bug; if you had a clue what happened, you'd have handled it, so there is not much use of structured information), made relatively hard to catch (there is no construct for it, just a wrapper function), and they put locked locks in ‘poisoned’ state (if you panicked under lock, you probably left the data inconsistent, so the bug spreads to anything else that touches the data). And they can be turned into aborts with a compiler option. So yes, it's stronger there.
However in most languages exceptions are used for both bugs and abnormal conditions to be handled. And a mess like checked and unchecked exceptions in Java come out of that.
-
Never let security get in the way of getting things done!
-
I guess one USB port is worth $6.50 and losing out on some power delivery
-
Never let security get in the way of getting things done!
BUT WHAT IF THE THINGS THAT GET DONE HAVE ISSUES THAT THE SECURITY COULD HAVE FOUND?
-
In Python exceptions are not heavily skewed towards not being thrown, catching on the hot path is considered OK, and consequently all abnormal returns are via exception and it is not blurry and 100% generic.
The expensive part of exception handling (in all languages where this can meaningfully apply) is construction and recording of the stack trace. Alas, it's also important as it provides an actually good tool for tracking down what really failed…
-
@LoudHoward said in WTF Bites:
BUT WHAT IF THE THINGS THAT GET DONE HAVE ISSUES THAT THE SECURITY COULD HAVE FOUND?
That happens?
-
@LoudHoward said in WTF Bites:
BUT WHAT IF THE THINGS THAT GET DONE HAVE ISSUES THAT THE SECURITY COULD HAVE FOUND?
That happens?
SOMETIMES. IT'S BETTER TO BE SAFE THAN SORRY.
-
BUT USUALLY IT IS BETTER TO ASK FORGIVENESS THAN PERMISSION!
-
@Bulb Yep. The threats due to Loss of Opportunity are usually more profound and more capable of destroying your job than the threats due to insecure access. Not always, of course, but any organization that rates the cost of missed opportunities as zero is deeply moribund.
-
@dkf This is just a huge organization where access to the internet from the internal network is via a proxy that requires authentication. An NTLM one. But since most utilities (like curl and such, used in the Yocto build) don't support that, every developer has to run their own proxy that has their credentials in the configuration and forward to the upstream proxy. And so does the build-server, using credentials of whoever set it up.
But I am a subcontractor. I have direct internet access, and access into the internal network through a proxy. It is also an authenticating one, but it uses some normal http authentication scheme. Nevertheless because I (and my colleagues) must only use it for the resources in the internal network, we have to run our own proxies that forward to it and know for which domains they should and for which not.
Now the project involves an IoS device and a Cloud™ it connects to. Except the Cloud™ is not accessible in the internal network directly. It might be accessible through the proxy, but setting up proxy for all the bits on the IoS device that need it—optionally, because it is not needed for the devices not in the internal network—is so insane that… well, it's already proxies all the way down and we still don't know how to get it to work.
TL;DR: working on IoS devices is just as shit as the result.
-
BUT USUALLY IT IS BETTER TO ASK FORGIVENESS THAN PERMISSION!
Why are we yelling??!??
Filed under: Easier to get away with things if they're not noticed by REEEE
-
-
@loopback0 said in WTF Bites:
@Tsaukpaetra said in WTF Bites:
Why are we yelling??!??
doesn't look like there's a lot to do.
Lol someone wasn't anticipating users with very-wide screens...
-
The wonders of the planning tool never ceases to amaze. There is a list. Every row gets alternating colors for easier readability. All good.
Now, you can mark rows on the list as unhandled, which removes them from the list. Now, what happens to the row coloring then?
It gets all fucked up, of course, because every row's color is set in stone based on order in the original list.
-
Wow was that popup temperamental. The content kept resetting the name somehow and I'm still not sure why. Ended up having to just freeze the function that hid it again so I could get my changes in. The
<br><br>
was there originally, mind you.
-
So, as of late, I've been having a lot of problems with my PowerShell sessions "eating" spaces when I've just pressed shift for a recent keystroke. Turns out that the problem is not, in fact, the sensitivity of the gaming-keyboard I use at work:
It's a CYOA for best WTF:
- They deployed version 2.0.0+beta2 of the underlying library as part of the 1809 system cumulative update
- They fixed the problem 6 months ago, within a couple weeks of the 1809 update release
- They haven't deployed it yet and won't deploy it until the 1903 system cumulative update, which means there will be 4-6 more months of lag before the fix is widely deployed.
-
Wow was that popup temperamental. The content kept resetting the name somehow and I'm still not sure why. Ended up having to just freeze the function that hid it again so I could get my changes in. The
<br><br>
was there originally, mind you.Does the problem only occur if you give WTDWTF a bad review?