WTF Bites
-
The only thing that's often distributed as scripts (yes, this is a generalization, but at least 83% accurate) are developer tools or other tools for advanced users. Those almost always come with instructions on how to start them from the command line. And in this case, that's a good thing, since it signals to the inexperienced user that they're doing something advanced.
Also unlike Windows, Unix binaries don't indicate whether they expect user to be able to interact over stdin/stdout/stderr, so the launcher does not know whether it should run them in a terminal or not. And that in turn means trying to run most scripts from a graphical launcher makes no sense anyway.
-
@blakeyrat said in WTF Bites:
var requestIP = GetClientIpAddress(HttpContext.Current.Request.RequestContext.HttpContext.Request); // Srsly .NET? That's the shortest way to get a HttpRequestBase from a HttpRequest?
@ben_lubar said in WTF Bites:
@tsaukpaetra said in WTF Bites:
@blakeyrat I'm going to assume that
HttpContext.Request
is not exposed like that right at the top?The first
HttpContext
is a class, not a property.And that, mon amis, clearly demonstrates why the .NET naming convention was a big, big mistake, especially when the scoping and member access operators are the same.
What a different convention would help with? It's not like you can confuse one with the other easily if you're actually programming in C#.
-
@gąska Well, when you don't have semantic analyser-backed syntax highlight you clearly can.
The division between types and things is the one that makes biggest difference, so that is the boundary that most deserves change in naming convention.
-
@gąska Well, when you don't have semantic analyser-backed syntax highlight you clearly can.
As I said, you'll never gonna confuse it if you're actually programming in C#.
-
@blakeyrat said in WTF Bites:
A creator code of "TEXT" would be very confusing and probably not allowed by Apple, because it'd be way too confusing when one of the most common file types was also "TEXT". (Apple's text editor creator code was, "ttxt" for SimpleText.)
Initially (and more sensibly) it was
ttxt
for TeachText. Apple recycled the creator code when they replaced that application with SimpleText around Mac OS 8.@blakeyrat said in WTF Bites:
AFAIK the only way to get from the HttpContext to the HttpRequest is to walk down the chain like I did: Context.Current -> Request -> RequestContext -> HttpContext -> Request
-
My main credit card expires next month. One of my normal monthly bill payment websites gave me a warning that it's about to expire, and refused to let me use my perfectly-valid and not-expired card unless I update it now. Except I can't, because my bank hasn't sent me the updated card yet, so...
-
@timebandit said in WTF Bites:
@benjamin-hall said in WTF Bites:
GNOME Is Removing the Ability to
Typical Gnome: removing ability instead of adding
Courageous!
-
My main credit card expires next month. One of my normal monthly bill payment websites gave me a warning that it's about to expire, and refused to let me use my perfectly-valid and not-expired card unless I update it now. Except I can't, because my bank hasn't sent me the updated card yet, so...
I'd write them a nice email explaining in detail why you're not going to pay them this month.
-
My main credit card expires next month. One of my normal monthly bill payment websites gave me a warning that it's about to expire, and refused to let me use my perfectly-valid and not-expired card unless I update it now. Except I can't, because my bank hasn't sent me the updated card yet, so...
I'd write them a nice email explaining in detail why you're not going to pay them this month.
Oh! Speaking of! Google decided I needed to be reminded that in auto-paid account needs to be paid today!
Filed under: This is not useful to me right now
-
Banking and Security: two separate concept
-
My main credit card expires next month. One of my normal monthly bill payment websites gave me a warning that it's about to expire, and refused to let me use my perfectly-valid and not-expired card unless I update it now. Except I can't, because my bank hasn't sent me the updated card yet, so...
They probably just rationally assumed that no credit card has ever made it to its expiration date without:
- being invalidated by some asshole company having their database dumped
- being lost
- getting too physically worn-out to work on any card readers
I've for sure never had one last that long.
-
Millennials
-
@tsaukpaetra said in WTF Bites:
Oh! Speaking of! Google decided I needed to be reminded that in auto-paid account needs to be paid today!
It might also be an AI trying to warn you that you still have an account with the Bank of America. The only reason why it didn't circle the bank name and ask you "what the hell is wrong with you?" is because it's still learning.
-
@timebandit Do journalists understand that "millenials" are like just a few years away from middle aged?
Like I'm only a couple years older than the first "millenial", and I'm getting worried that if I lose my job age discrimination might be a factor next time I have to interview. I have grey hairs.
I guess the only people left in journalism are people like 5 years or less from retirement, so it's all still whippersnappers to them.
-
-
@tsaukpaetra said in WTF Bites:
Oh! Speaking of! Google decided I needed to be reminded that in auto-paid account needs to be paid today!
It might also be an AI trying to warn you that you still have an account with the Bank of America. The only reason why it didn't circle the bank name and ask you "what the hell is wrong with you?" is because it's still learning.
I have not yet used them in a manner that their terrible horrible practices have (outwardly) affected me get.
-
@timebandit Yeah my skull's too lumpy. I've crewcut before but never gone full-bald.
-
@blakeyrat said in WTF Bites:
getting too physically worn-out to work on any card readers
I have to replace this card about once a year because the chip quits working. They always send me a replacement of the same card so the numbers/expiration/code thingy on the back don't change.
-
Because the original implementation wasn't cool enough, or something…
To quote my currently favourite song,
♫ I spoke to God today
and she said that she's ashamed
What have I become.
What have I done ♫
-
Oh yeah, I definitely think that hurting people's ability to succeed based on their ethnicity is the most important aspect of making YouTube the best.
-
@lb_ I like how fixing Content ID isn't any of the options.
-
@timebandit said in WTF Bites:
Millennials
This reminded me of something I saw at work today. Which made me contemplate, how does the creation and promotion of homogeneous, race-, gender- religion- and/or ethnicity-specific employee groups improve diversity?
-
Status: Trying to track down a powershell weirdness.
I have the following code:
$UpdateResponse = Invoke-WebRequest -Uri ( "https://" + $MasterServerHost + "/api/KillAllVMs") -Method GET -Headers @{ Authorization = ("Bearer " + $token)} -TimeoutSec 1600 -UseBasicParsing if($UpdateResponse.StatusCode -eq 200) { Write-Output "Success!" } else { Write-Output "Failed!" Write-Output $UpdateResponse }
What do you expect should happen if the underlying connection is broken (say, I kill the web server while it's waiting for the request to complete)?
What I didn't expect is for the
Invoke-WebRequest
command to continue waiting until the TimeoutSec passed.What do you expect should happen if the underlying request completes at all (You know, the normal thing that happens)?
If you said "wait until TimeoutSec has passed, of course!", congratulations! You win a PowerShell to the face!
-
@timebandit said in WTF Bites:
Millennials
The advice I've always heard around here is that the only way to make sure you keep moving upward is by changing jobs frequently (but not too frequently). So why the eye roll?
-
@tsaukpaetra said in WTF Bites:
What do you expect should happen if the underlying request completes at all (You know, the normal thing that happens)?
If you said "wait until TimeoutSec has passed, of course!", congratulations! You win a PowerShell to the face!Testing a simpler one (
Invoke-WebRequest -Uri "http://google.com" -TimeoutSec 60
) returns almost immediately. Problem might lie elsewhere?Same with a closer line:
Invoke-WebRequest -Uri ("https://" + "www." + "google.com") -Method GET -Headers @{ "User-Agent" = ("wtdwtf-test") }-TimeoutSec 1600 -UseBasicParsing
-
Testing a simpler one (
Invoke-WebRequest -Uri "http://google.com" -TimeoutSec 60
) returns almost immediately. Problem might lie elsewhere?Yeah, I use very similar syntax all the time and it doesn't wait out the timeout.
What's your
$PSVersionTable
, @Tsaukpaetra?
-
@heterodox said in WTF Bites:
Testing a simpler one (
Invoke-WebRequest -Uri "http://google.com" -TimeoutSec 60
) returns almost immediately. Problem might lie elsewhere?Yeah, I use very similar syntax all the time and it doesn't wait out the timeout.
What's your
$PSVersionTable
, @Tsaukpaetra?PS C:\Users\BobTheBuilder> $PSVersionTable Name Value ---- ----- PSVersion 5.1.16299.251 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.16299.251 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
I seem to have fixed the 200-timeout problem by adding an unrelated log entry in the webserver. It essentially says "I got a request to kill all the VMS!" and "I finished killing all the VMs!" at the end.
Somehow that got it to fucking work on success.
Still breaks if it's 500 due to an error, but that's a little less likely to happen now, so we'll see....
-
@tsaukpaetra said in WTF Bites:
@heterodox said in WTF Bites:
Testing a simpler one (
Invoke-WebRequest -Uri "http://google.com" -TimeoutSec 60
) returns almost immediately. Problem might lie elsewhere?Yeah, I use very similar syntax all the time and it doesn't wait out the timeout.
What's your
$PSVersionTable
, @Tsaukpaetra?PS C:\Users\BobTheBuilder> $PSVersionTable Name Value ---- ----- PSVersion 5.1.16299.251 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.16299.251 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
FWIW:
PS C:\Users\BobTheBuilder> $PSVersionTable Name Value ---- ----- PSVersion 5.1.17134.48 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.17134.48 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
I seem to have fixed the 200-timeout problem by adding an unrelated log entry in the webserver. It essentially says "I got a request to kill all the VMS!" and "I finished killing all the VMs!" at the end.
Somehow that got it to fucking work on success.
Still breaks if it's 500 due to an error, but that's a little less likely to happen now, so we'll see....
Sounds like maybe the program was getting rid of the connection before it was finished, and now it has time to finish?
-
Sounds like maybe the program was getting rid of the connection before it was finished, and now it has time to finish?
Dunno. This is the start of the cascade tree:
private static async void AuthorizeAndRespond(HttpRequestEventArgs context) { try { AwaitedAuthorize(context); } catch (Exception e) { //This is a dummy handler for the wacks that try to access the master server outside a game client. IPAddress senderaddress = context.Request.RemoteEndPoint.Address; string serverinternalerror = string.Format("MasterServerWebServer: Internal error [{0}] with url [{1}] sent by [{2}]", e.Message, context.Request.Url.LocalPath, senderaddress.ToString()); GlobalFunctions.Log("Web Server", serverinternalerror, MainLogVerbosity.Warning); Hipchat.Warn(serverinternalerror); try { var buf = Encoding.ASCII.GetBytes("Oops"); context.Response.StatusCode = 500; context.Response.ContentType = "text/plain"; if (context.Request.HttpMethod != "HEAD") { context.Response.WriteContent(buf); } } catch (Exception) { } } try { context.Response.Close(); } catch (Exception) { } }
AwaitedAuthorize
has a tree of functions that are all expected to send some content out (or not);Perhaps the request gets closed on accident (i.e. not by the server's code here) and that generates an error when trying to close it twice (hence the ugly catch-and-drop) but that's not happening either...
-
@blakeyrat said in WTF Bites:
var requestIP = GetClientIpAddress(HttpContext.Current.Request.RequestContext.HttpContext.Request); // Srsly .NET? That's the shortest way to get a HttpRequestBase from a HttpRequest?
@ben_lubar said in WTF Bites:
@tsaukpaetra said in WTF Bites:
@blakeyrat I'm going to assume that
HttpContext.Request
is not exposed like that right at the top?The first
HttpContext
is a class, not a property.And that, mon amis, clearly demonstrates why the .NET naming convention was a big, big mistake, especially when the scoping and member access operators are the same.
Not really. It's successfully prevented the problem of keywords breaking public APIs, which is what it's there for.
-
@tsaukpaetra said in WTF Bites:
Sounds like maybe the program was getting rid of the connection before it was finished, and now it has time to finish?
Dunno. This is the start of the cascade tree:
private static async void AuthorizeAndRespond(HttpRequestEventArgs context) { try { AwaitedAuthorize(context); } catch (Exception e) { //This is a dummy handler for the wacks that try to access the master server outside a game client. IPAddress senderaddress = context.Request.RemoteEndPoint.Address; string serverinternalerror = string.Format("MasterServerWebServer: Internal error [{0}] with url [{1}] sent by [{2}]", e.Message, context.Request.Url.LocalPath, senderaddress.ToString()); GlobalFunctions.Log("Web Server", serverinternalerror, MainLogVerbosity.Warning); Hipchat.Warn(serverinternalerror); try { var buf = Encoding.ASCII.GetBytes("Oops"); context.Response.StatusCode = 500; context.Response.ContentType = "text/plain"; if (context.Request.HttpMethod != "HEAD") { context.Response.WriteContent(buf); } } catch (Exception) { } } try { context.Response.Close(); } catch (Exception) { } }
AwaitedAuthorize
has a tree of functions that are all expected to send some content out (or not);Perhaps the request gets closed on accident (i.e. not by the server's code here) and that generates an error when trying to close it twice (hence the ugly catch-and-drop) but that's not happening either...
Weird. Can you trace it to see if it ever reaches the
Close()
?
-
Because the original implementation wasn't cool enough, or something…
To quote my currently favourite song,
♫ I spoke to God today
and she said that she's ashamed
What have I become.
What have I done ♫But does it have a proper API?
-
@tsaukpaetra said in WTF Bites:
Sounds like maybe the program was getting rid of the connection before it was finished, and now it has time to finish?
Dunno. This is the start of the cascade tree:
private static async void AuthorizeAndRespond(HttpRequestEventArgs context) { try { AwaitedAuthorize(context); } catch (Exception e) { //This is a dummy handler for the wacks that try to access the master server outside a game client. IPAddress senderaddress = context.Request.RemoteEndPoint.Address; string serverinternalerror = string.Format("MasterServerWebServer: Internal error [{0}] with url [{1}] sent by [{2}]", e.Message, context.Request.Url.LocalPath, senderaddress.ToString()); GlobalFunctions.Log("Web Server", serverinternalerror, MainLogVerbosity.Warning); Hipchat.Warn(serverinternalerror); try { var buf = Encoding.ASCII.GetBytes("Oops"); context.Response.StatusCode = 500; context.Response.ContentType = "text/plain"; if (context.Request.HttpMethod != "HEAD") { context.Response.WriteContent(buf); } } catch (Exception) { } } try { context.Response.Close(); } catch (Exception) { } }
AwaitedAuthorize
has a tree of functions that are all expected to send some content out (or not);Perhaps the request gets closed on accident (i.e. not by the server's code here) and that generates an error when trying to close it twice (hence the ugly catch-and-drop) but that's not happening either...
Weird. Can you trace it to see if it ever reaches the
Close()
?Yeah.
It was when I was probing around for some potential async weirdness (which led me to adding those log lines).
-
My poor laptop is having its GPU worked to death doing... something?
Apparently OBS is now doing 3D things, I guess...
-
@tsaukpaetra said in WTF Bites:
-TimeoutSec
It disappoints me this argument isn't named
-TimeoutSecs
.
-
@tsaukpaetra said in WTF Bites:
-TimeoutSec
It disappoints me this argument isn't named
-TimeoutSecs
.I thought that's what it would be myself, but sadly...
-
I am rather worried about the CORS motion. While I am quite confident allowing all origins for static (or more precisely non-varying read-only) resources is safe and should usually be done by default, I am also pretty sure allowing it for anything authenticated is a serious security issue.
Update: but it fortunately seems the browsers are actually smart about this and don't accept wildcard and authentication together when doing POST.
@https://gitlab.com/gitlab-org/gitlab-ce/issues/41755:
Then the browser throws its error
Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'https://isomorphic-git.github.io' is therefore not allowed access.
-
Because the original implementation wasn't cool enough, or something…
No. Because there are not two JavaScript implementations already.
(ok, one with a fork)
-
No. Because there are
nottwo JavaScript implementations already.I actually considered making one myself, mostly as a means to learning git's internals.
Then I laughed at the crazy stupid idea.
-
@tsaukpaetra said in WTF Bites:
Apparently OBS is now doing 3D things, I guess...
I'm guessing OBS is doing something with shaders? So even if it's just 2D compositing and maybe some computations (video encoding? I don't know OBS well enough for that), that will still show up as "3D".
-
@tsaukpaetra said in WTF Bites:
Apparently OBS is now doing 3D things, I guess...
I'm guessing OBS is doing something with shaders? So even if it's just 2D compositing and maybe some computations (video encoding? I don't know OBS well enough for that), that will still show up as "3D".
Who knows...
-
@timebandit said in WTF Bites:
Millennials
How DARE the new blood not have any loyalty towards their emlpoyer that has fuck all loyalty to it's employees
-
@hardwaregeek said in WTF Bites:
how does the creation and promotion of homogeneous, race-, gender- religion- and/or ethnicity-specific employee groups improve diversity?
I'd answer, but we're not in
The Garage
...
-
video encoding?
Typically video encode and decode are either software based (like libx264), or with hardware encoders/decoders they show up in the other two categories in @Tsaukpaetra's screenshot.
-
How DARE the new blood not have any loyalty towards their emlpoyer that has fuck all loyalty to it's employees
That depends on the employer
I've had some that didn't give a fuck about employees, and some that really care about them.
I never stayed for long at the ones that don't.
-
Click a link in an email from Office 365 for a cancelled meeting
Thanks for the informative error message, I guess
-
The Quest for a Bank Account:
Chapter 1:
* goes to the local branch of $BANK*
: Hello. How can we help you today?
: Hello ... bla bla ... I would like to open an account .. bla bla
: Ah. Yes. Unfortunately, our nation-wide IT system is down today, so we are unable to help you today. But I can give you information about what you need to open a bank account.
: Uh ... sure. Your services are totally inspiring me with confidence at this moment.
: You need the following documents {list}
: Got those.
: Then, we need to schedule an appointment; opening a bank account is of course not something we can do without a scheduled appointment.
* has definitively opened bank accounts in several places without any prior appointments, but whatever*
: Yeah, ok, can we schedule an appointment then?
: Ah .. yes.
: As I told you, our IT system is down today, so we cannot even schedule any appointments.
: ...
: But, the system should be fixed by tomorrow, so if you want, you can call our customer service and they will set up an appointment for you.
* hands over generic business card with the number to customer support*Chapter 2:
o o O { This is probably a bad idea. }
* prepares mentally for calling customer service*: Bzeep. Plz navigate maze of automatic answers via the keys on you dial pad. Bzeep.
*one automatic telephone labyrinth later*
: Hello, I am ${name}. How can I help you?
: I would like to schedule an appointment for opening a bank account.
: Yes. Since we are speaking English at the moment, I will need to refer you to the international help desk.*waiting*
: Hello, international desk here. How can I help you?
: I would like to schedule an appointment for opening a bank account.
: Yes. Do you have ${list of items}?
: Yep.
: Great. Can I have your email address? We will send an email with a list of the relevant documents so that we can schedule the appointment.
: ${email_address}
: We will send you the email momentarily. Thank you for calling and have a nice day.Chapter 3:
* lands in inbox.*Dear
Thank you for your interest to open a bank account at $bank.
In order to schedule an appointment, we need to determine if you meet the bank's requirements as an international customer.
Please provide us with a scanned copy of the following documents (as PDF files) and information:
${list}
We will respond to your email within 2 business days provided all of the required documents and information are included in your response.
When the information you provide is incomplete, please note that we cannot complete the process.
In case you have any questions, please do not hesitate to contact us.Next day:
Dear
Thank you for your request to open a bank account at $bank.
We advise you to call our colleagues at the customers service at ${phone I called previously} to schedule an appointment at an branch of your preference.
Please note that you are only able to apply for a bank account through the customer service when you can provide ${stuff that I provided in my email and cannot provide over a phone}.
We take your privacy seriously and therefore all sent documents will be deleted.
We wish you a pleasant day.+
And this is apparently the
most reliableleast unreliable option when it comes to banking in this place.
-
@cvi Have you considered that they're trying to keep you from opening an account? If you're touching the US banking regulations for international accounts (which are a whole separate gigantic pile of to the infinity power), I've heard that many banks will avoid that at all costs.
-
@cvi One word.
Run.
-
Ah. Yes. Unfortunately, our nation-wide IT system is down today
I wasn't aware that TSB had branched out to foreign climes...