WTF Bites
-
Another design fail log-in screen. How the am I supposed to read this ligh-gray-on-white shit?
And no, when I type text it doesn't actually change to black.
-
@anonymous234 said in WTF Bites:
Wow, Edge really has streamlined its user interface!
Hey, they just copied the new Reddit!
That empty
div
is on every page. Thank godold.reddit
still works for now.
-
Having seen the code to work with them at the low level, creator codes and file types were dead weird. They were little-endian packed 32-bit words, not strings in any sort of a conventional sense, even though they were often written as something that looked like a string.
Little endian, SRSLY?! Even though MacOS came from the M68k? That's just
Those four-letter-word-but-actually-longint are common in some container formats; the first was probably EA's IFF format, the latest Google's WebP.
All of those are big endian though, AFAIK.All byte strings are little-endian if you look at them as a larger-than-a-byte data size. The 8-bit characters are stored according to index, with the lowest index first.
-
When you know that magic constants are bad but sometimes forget about it.
projectExtension = "*.project" for project in glob.glob(location + "/" + projectExtension): pathParts = project.split("/") depth = len(pathParts) libs.append(pathParts[depth - 1].split(".project")[0])
-
@pie_flavor said in WTF Bites:
There can be no sane reason why the department-level final assignment for English should be distributed as a DOCX instead of a PDF.
Probably laziness/ineptitude/forgetfulness on behalf of the person who generated it.
I've done similar in the past, by mistake.
Corrected when people started contacting me asking "wtf is .ods?"
I once encountered a job application form that said "We accept applications in the following formats: .doc, .docx, .pdf, .odt" so I happily submitted my application as .odt so I wouldn't have to bother saving a .doc copy. Got response back a bit later of "I can't open this file, please resubmit as a .doc.".
-
@tsaukpaetra said in WTF Bites:
I wasn't given that context, my snippet works in a webapi class.
You didn't provide a snippet. If you have a better way, then by all means show me.
-
cafeteria schedule
monday: normal hours (starting at 7)
finals week (wednesday onward): starting at 6 because people get up early
study day (today): you'd think it's 6 or 7, right?
nah. 9.
I got out of bed for this. Goddamn. And there's no signs anywhere.
-
@blakeyrat said in WTF Bites:
@tsaukpaetra said in WTF Bites:
I wasn't given that context, my snippet works in a webapi class.
You didn't provide a snippet. If you have a better way, then by all means show me.
Oh, sorry, did online reformatted text not appear to you? Let's try giving help again in a not-a-coding-help-thread/thread:
@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?
@tsaukpaetra said in WTF Bites:
@blakeyrat is the following not sufficient?
var requestIP = GetClientIpAddress(HttpContext.Request):
Of course, this depends on where this is getting called in. In my case it seems to work fine inside a WebApi class method (at least, it compiles , that's as far as I got with testing). YMMV if you don't have some similar wrapper thing going on.
-
@tsaukpaetra google "HttpContext", go to MSDN page, follow the properties and their types and you'll see what's the problem and why your code makes no sense. The two
HttpContext
s are of different, unrelated types.
-
@tsaukpaetra google "HttpContext", go to MSDN page, follow the properties and their types and you'll see what's the problem and why your code makes no sense. The two
HttpContext
s are of different, unrelated types.I just typed it into Visual Studio and hit compile. Well, my original post anyways. You expected me to expend effort in the WTF Bites thread?
-
"Hey Ben, would you recommend a friend or colleague physically steals your computer?"
what
-
@tsaukpaetra said in WTF Bites:
Oh, sorry, did online reformatted text not appear to you?
Honestly no. Was there some?
@tsaukpaetra said in WTF Bites:
var requestIP = GetClientIpAddress(HttpContext.Request):
I don't have access to that codebase right now but the problem is my "get the client's IP helper" requires a HttpRequestBase and HttpContext.Request ain't one.
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
Which is fucking ridiculous, thus the comment.
-
-
@cursorkeys said in WTF Bites:
Thank
godCthulhuold.reddit
still works for now.Seems more appropriate for anything Reddit.
-
@tsaukpaetra said in WTF Bites:
Might desire to be refactored?
Sure I should just delete my working code and start over because some dumbshit on the internets says so.
-
@blakeyrat PHP's solution is far more easier
$_SERVER['REMOTE_ADDR']
-
@timebandit said in WTF Bites:
$_SERVER['REMOTE_ADDR']
That works in .NET too (with the requisite syntax changes), but it doesn't consider forwarding from load balancers like CloudFlare or AWS's elastic load balancer or whatever. Simple doesn't help if it doesn't work.
-
@blakeyrat said in WTF Bites:
but it doesn't consider forwarding from load balancers like CloudFlare or AWS's elastic load balancer or whatever
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; }
-
@blakeyrat said in WTF Bites:
@timebandit said in WTF Bites:
$_SERVER['REMOTE_ADDR']
That works in .NET too (with the requisite syntax changes), but it doesn't consider forwarding from load balancers like CloudFlare or AWS's elastic load balancer or whatever. Simple doesn't help if it doesn't work.
??
-
status: wondering why were attempting to helping someone in the WTF Bites thread. Are we TRWTF?
-
@timebandit The
X_FORWARDED_FOR
header can contain multiple IPs. Still wrong.@tsaukpaetra said in WTF Bites:
??
That article acknowledges that
X_FORWARDED_FOR
can contain multiple IP addresses but doesn't bother trying to parse out the correct one.
-
@tsaukpaetra said in WTF Bites:
status: wondering why were attempting to helping someone in the WTF Bites thread. Are we TRWTF?
Yes but I'm also laughing because all of these "solutions" are wrong. No wonder software's so shitty!
-
@blakeyrat said in WTF Bites:
@tsaukpaetra said in WTF Bites:
status: wondering why were attempting to helping someone in the WTF Bites thread. Are we TRWTF?
Yes but I'm also laughing because all of these "solutions" are wrong. No wonder software's so shitty!
I'd argue that trying to get the client IP is wrong. So long as you have a connection back to them, who cares?
Not only that, but is it handling just IPv4 or is it good enough for IPv6? What if you're behind a proxy? A VPN?
It sounds like you're executing a solution in search of a problem here.
-
@tsaukpaetra said in WTF Bites:
I'd argue that trying to get the client IP is wrong.
I'm looking for abusive behavior on a public-facing API.
@tsaukpaetra said in WTF Bites:
Not only that, but is it handling just IPv4 or is it good enough for IPv6?
The code I have handles either.
@tsaukpaetra said in WTF Bites:
What if you're behind a proxy? A VPN?
Then the planet Earth explodes into particles of dust, why not.
@tsaukpaetra said in WTF Bites:
It sounds like you're executing a solution in search of a problem here.
I think you're just bitter that you have idea idea how to solve this problem, therefore it must not actually be a problem worth solving. It's like the programming equivalent of the "you don't need that" Linux defense.
-
@blakeyrat said in WTF Bites:
It's like the programming equivalent of the "you don't need that" Linux defense.
You're in the fucking WTF Bites thread. I might remind the denizens thusly up to three more times, but not less than zero.
-
@tsaukpaetra said in WTF Bites:
You're in the fucking WTF Bites thread.
... ok?
@tsaukpaetra said in WTF Bites:
I might remind the denizens thusly up to three more times, but not less than zero.
Remind them why? What are you talking about?
-
@blakeyrat said in WTF Bites:
@tsaukpaetra said in WTF Bites:
You're in the fucking WTF Bites thread.
... ok?
@tsaukpaetra said in WTF Bites:
I might remind the denizens thusly up to three more times, but not less than zero.
Remind them why? What are you talking about?
@blakeyrat said "this isn't a topic in the help categories! I didn't ask for help!"
-
@tsaukpaetra said in WTF Bites:
@blakeyrat said "this isn't a topic in the help categories! I didn't ask for help!"
I didn't ask for help. I still don't get what your point is.
I'm not the one who posted potential but broken solutions to the problem, but I don't see any problem with them being here since they are also WTFs. None of the solutions posted here so far work correctly.
-
@blakeyrat said in WTF Bites:
None of the solutions posted here so far work correctly.
Including your own?
-
@tsaukpaetra said in WTF Bites:
Including your own?
I didn't post my method here because, as far as I know, it works and thus is not a "WTF Bite".
-
@blakeyrat said in WTF Bites:
@tsaukpaetra said in WTF Bites:
@blakeyrat said "this isn't a topic in the help categories! I didn't ask for help!"
I didn't ask for help. I still don't get what your point is.
You've been known to screech about the same.
-
@blakeyrat said in WTF Bites:
@tsaukpaetra said in WTF Bites:
Including your own?
I didn't post my method here because, as far as I know, it works and thus is not a "WTF Bite".
Just because "it works" doesn't make it a WTF Bite. Hell, the picture I posted about returning true if a response was "true" or" false" technically works just fine, but is still a WTF Bits.
-
@ben_lubar said in WTF Bites:
"Hey Ben, would you recommend a friend or colleague physically steals your computer?"
what
I got that too. I told them that I do indeed recommend that people build their own computer like I did.
-
@timebandit said in WTF Bites:
@blakeyrat said in WTF Bites:
but it doesn't consider forwarding from load balancers like CloudFlare or AWS's elastic load balancer or whatever
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; }
You need to check whether you trust who forwarded it, though.
-
@ben_lubar said in WTF Bites:
"Hey Ben, would you recommend a friend or colleague physically steals your computer?"
what
No, I do not recommend my PC to anyone on the base that most of the hardware is 7+ years old by now. Even if this was the year 2011 I still wouldn't recommend it, even to myself, as it would have been prohibitively expensive for little gains outside of anyone able to make full use of a maxed out HEDT computer.
-
@ben_lubar said in WTF Bites:
You need to check whether you trust who forwarded it, though.
That's easy: I don't trust anybody :face_with_stuck-out_tongue:
-
@ben_lubar said in WTF Bites:
"Hey Ben, would you recommend a friend or colleague physically steals your computer?"
what
I got that too. I told them that I do indeed recommend that people build their own computer like I did.
A cousin of mine, while assembling his own PC, managed to physically break his motherboard in 2 pieces.
-
Just noticed on the (old) oscilloscope we have:
-
@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.
-
"I can't open this file, please resubmit as a .doc."
I had the impression recent Microsoft Office can read OpenDocuments.
-
-
@bulb Iirc that common version in use at the time required a plugin for OpenDocument files.
-
* mons amis
-
@ben_lubar said in WTF Bites:
"How likely are you to recommend..."
"Not at all likely. I'm not the sort of person who randomly recommends random stuff."
-
Presented without comment:
-
Presented without comment:
-
@scarlet_manuka said in WTF Bites:
Presented without comment:
I have good news for you.
Google, Microsoft, and Mozilla are teaming up to remove the concept of passwords from the internet.
If you have a security key, you can try it out right now in Firefox nightlies: https://webauthn.io/
-
Not sure if or not:
-
@benjamin-hall
Not a WTF IMO. On Linux, almost nobody (except recent Windows converts) will even try to double-click on an executable file during normal usage.Software is distributed either via the official package repositories or as a downloadable package. Those will install
.desktop
files to ensure they're launchable via GNOME Shell and every other application menu out there.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.
Bottom line: I cannot see a really compelling use case for double-clicking executables in the file manager on Linux and removing that feature prevents people from doing that accidentally. Sounds like a good idea.
-
@benjamin-hall said in WTF Bites:
GNOME Is Removing the Ability to
Typical Gnome: removing ability instead of adding