WTF Bites
-
Watched Alien: Covenant the other day, and it didn't give me quite as much cancer as I had expected it too, which is nice.
However, it's good to see future space Americans still haven't figured out the Metric System
-
Found in our code:
function addLeadingZeros($input) { $length = strlen($input); if ($length == 5) return $input; elseif ($length == 4) return '0'.$input; elseif ($length == 3) return '00'.$input; elseif ($length == 2) return '000'.$input; elseif ($length == 1) return '0000'.$input; elseif ($length == 0) return '00000'; }
If string length is more than 5, it returns nothing
FileUnder: What's str_pad ?
-
hands @timebandit a
-
@timebandit said in WTF Bites:
Found in our code:
function addLeadingZeros($input) { $length = strlen($input); if ($length == 5) return $input; elseif ($length == 4) return '0'.$input; elseif ($length == 3) return '00'.$input; elseif ($length == 2) return '000'.$input; elseif ($length == 1) return '0000'.$input; elseif ($length == 0) return '00000'; }
If string length is more than 5, it returns nothing
FileUnder: What's str_pad ?
You may have accidentally installed a virus known as PHP.
-
Went to add a Card to one of my YouTube videos and accidentally hit Shift at the same time as Enter. Suddenly a new window opened,
https://www.youtube.com/cards_ajax?v=<my-vide-id>
, with just a textarea full of JSON, which I assume is the response or something? It's a full HTML page with just the title "JSON" so I assume it must be a debugging feature that I accidentally discovered? So, YouTube has debugging in productionEDIT: Apparently it's a Chrome feature I never knew about.
-
Went to add a Card to one of my YouTube videos and accidentally hit Shift at the same time as Enter. Suddenly a new window opened,
https://www.youtube.com/cards_ajax?v=<my-vide-id>
, with just a textarea full of JSON, which I assume is the response or something? It's a full HTML page with just the title "JSON" so I assume it must be a debugging feature that I accidentally discovered? So, YouTube has debugging in productionThat's not a debugging feature. Chrome uses Shift-Enter to submit the form to a new window instead of the current one. Forms that are handled through JavaScript usually avoid this behaviour, but I don't know for sure when it fires and which events get a chance to run beforehand.
-
@scarlet_manuka said in WTF Bites:
I'm assuming that Notepad doesn't have any idea of its own font, so whenever you change the font it just sets some system default text font somewhere. (Without any indication that this is more than a temporary change for the document you're looking at, or any confirmation, naturally.)
...TRWTF in that screenshot is "Show more fonts", which is just a hyperlink that opens
Control Panel\Appearance and Personalization\Fonts
in Windows Explorer...
-
@anotherusername said in WTF Bites:
@scarlet_manuka said in WTF Bites:
I'm assuming that Notepad doesn't have any idea of its own font, so whenever you change the font it just sets some system default text font somewhere. (Without any indication that this is more than a temporary change for the document you're looking at, or any confirmation, naturally.)
...TRWTF in that screenshot is "Show more fonts", which is just a hyperlink that opens
Control Panel\Appearance and Personalization\Fonts
in Windows Explorer...You expected intelligent behavior from Notepad? We're already talking about software that can't even comprehend LF, only CRLF. Before I discovered Notepad++, I opened exactly one config file with Notepad, said 'hell naw', and told everything to open with WordPad.
-
@pie_flavor as far as I can tell, it's the system font selection dialog:
Notepad customizes it to hide the "Effects" group and the message about it being an OpenType font. The link is built-in, and is actually how it's designed:
the new Windows 7 ChooseFont template ... contains a link control that the user can click to launch the Fonts Control Panel window
-
Oh hey, new VSCode update. What's this about JavaScript/TypeScript refactoring?
(title of the page is "Internal Server Error", btw)Ok, I guess I'm supposed to click the link instead of dragging it to a browser. But they could have expected someone to do this and dealt with it a little better.
Edit: the base URL should have been https://code.visualstudio.com/updates/v1_16/ instead of https://code.visualstudio.com/raw/
-
Btw: HTML tag auto closing... let's just say is doesn't quite work for me.
With
"html.autoClosingTags": false
:Let's say you have this in your editor, where | is the cursor.
<ul> <li>Option 1</li> |Option 2
Type
<
<ul> <li>Option 1</li> <|Option 2
Autocomplete suggests
</ul
†. Haha, that's a cute suggestion. I see you tried.Type
li>
<ul> <li>Option 1</li> <li>|Option 2
Autocomplete suggests
</li
†. A decent suggestion, but you can just keep typing or "arrow key" away or whatever.
Now let's do this the other way around. Start at then end of the line.
<ul> <li>Option 1</li> Option 2|
Type
<
<ul> <li>Option 1</li> Option 2<|
Autocomplete suggests
</ul
†. Nice try, but that's not what I want!Type
/
<ul> <li>Option 1</li> Option 2</|
Autocomplete suggests
/ul
†, as you'd expect.Keep typing
li
.<ul> <li>Option 1</li> Option 2</li|
Autocomplete suggestion goes away. (it doesn't go away right after you press
l
becauseul
also has anl
in it)
Now with
"html.autoClosingTags": true
:<ul> <li>Option 1</li> |Option 2
Press
<
<ul> <li>Option 1</li> <|Option 2
Autocomplete suggests
/ul
†. Nothing new here.Press
li>
<ul> <li>Option 1</li> <li></li>|Option 2
What? No!
Ctrl+Z
. Yes, autoclosing did exactly what its job is, but I didn't want to trigger it there. Oof, at least Ctrl+Z works nicely and only deletes the closing tag.<ul> <li>Option 1</li> <li>|Option 2
Now the other way around.
<ul> <li>Option 1</li> Option 2|
Press
<
.<ul> <li>Option 1</li> Option 2<|
Autocomplete suggests
/ul
†, as before. It is a good suggestion. I just don't want it.Press
/
<ul> <li>Option 1</li> Option 2</ul>|
What? "/" made it accept the suggestion?
Ctrl+Z
!<ul> <li>Option 1</li> Option 2</|
Sheesh.
† None of the autocomplete suggestions showed the closing
>
in the popup, but they all added it on insertion.
-
Damn you. Went to move my mouse and "what the hell, why isn't it moving!?!"
-
@zecc
RESOLVED ASDESIGNED
as Visual Studio and most other text editors with an auto-close feature behave the exact same way. It doesn't work the way you expect while editing existing markup, but it works the way almost everyone else expects when creating new markup.
-
Type
/
<ul> <li>Option 1</li> Option 2</|
Autocomplete suggests
/ul
†, as you'd expect.Keep typing
li
.<ul> <li>Option 1</li> <li>Option 2</li|
Autocomplete suggestion goes away. (it doesn't go away right after you press
l
becauseul
also has anl
in it)Did it just add the
<li>
opening tag for "Option 2"?
-
HTML auto close is a bit buggy. It can and will trigger an auto close as you undo/redo edits.
-
@coderpatsy said in WTF Bites:
HTML auto close is a bit buggy. It can and will trigger an auto close as you undo/redo edits.
Why would that even be a thing the system can do? When would you ever want undo/redo to run any sort of script?
-
@ben_lubar Yeah it's all a big . I like that they gave it a debt label.
-
Did it just add the
- opening tag for "Option 2"?
You've obviously misread my post.
Nice quoting there, btw.
-
Did @apapadimoulis reinstall Discourse for the front page articles?
-
Did it just add the
- opening tag for "Option 2"?
You've obviously misread my post.
Nice quoting there, btw.
(I was just wondering if it was a typo or if that's really what auto-tagging did.)
-
It's 2017 and our mandatory security training requires Flash.
-
@greybeard said in WTF Bites:
It's 2017 and our mandatory security training requires Flash.
The kids are calling it "bling" these days.
-
Fun fact: if your
<assemblyBinding>
section is syntactically incorrect, IIS will predictably throw a web.config parsing error. But if it's semantically incorrect even in a single place - for example, if a bad merge had you end up with twobindingRedirect
elements in onedependentAssembly
- Fusion will just silently ignore the entire section (and then usually barf with a version mismatch).
-
the fundamental architecture of PGP is such a pain to use that when Ars' Lee Hutchinson e-mailed PGP creator Phillip Zimmermann in PGP format, Zimmermann refused to read the message that way—because his PGP key was not on his phone:
-
-
This isn't some custom software or whatever. WTF would I need download insurance? Why couldn't I just download it again later, like every other piece of commercial off-the-shelf software? Especially at that price.
-
This isn't some custom software or whatever. WTF would I need download insurance? Why couldn't I just download it again later, like every other piece of commercial off-the-shelf software? Especially at that price.
Supposedly, it's paying for the cloud servers that will continue to host said download. I guess.
What did the little magnifying glass have to say about it?
-
@tsaukpaetra said in WTF Bites:
This isn't some custom software or whatever. WTF would I need download insurance? Why couldn't I just download it again later, like every other piece of commercial off-the-shelf software? Especially at that price.
Supposedly, it's paying for the cloud servers that will continue to host said download. I guess.
What did the little magnifying glass have to say about it?
2 Year Software Download Insurance
Protect yourself with download insurance! Never worry about losing your CD(s) again, we will retain a backup copy of your digital file/download for 2 years.Note 1: This is a download, not a CD (there's an option to add a "Backup DVD" for another $14.99).
Note 2: I'm pretty sure you can just download the trial version and enter your key if you lose your download.
-
@tsaukpaetra said in WTF Bites:
This isn't some custom software or whatever. WTF would I need download insurance? Why couldn't I just download it again later, like every other piece of commercial off-the-shelf software? Especially at that price.
Supposedly, it's paying for the cloud servers that will continue to host said download. I guess.
What did the little magnifying glass have to say about it?
2 Year Software Download Insurance
Protect yourself with download insurance! Never worry about losing your CD(s) again, we will retain a backup copy of your digital file/download for 2 years.Note 1: This is a download, not a CD (there's an option to add a "Backup DVD" for another $14.99).
Note 2: I'm pretty sure you can just download the trial version and enter your key if you lose your download.So, in other words, it's a scam amounting to "yo dawg, I heard you liked downloads, so I provided you a download for your download so you can download your downloads and sometimes later download your downloads again on the down low."?
-
-
@tsaukpaetra said in WTF Bites:
@tsaukpaetra said in WTF Bites:
This isn't some custom software or whatever. WTF would I need download insurance? Why couldn't I just download it again later, like every other piece of commercial off-the-shelf software? Especially at that price.
Supposedly, it's paying for the cloud servers that will continue to host said download. I guess.
What did the little magnifying glass have to say about it?
2 Year Software Download Insurance
Protect yourself with download insurance! Never worry about losing your CD(s) again, we will retain a backup copy of your digital file/download for 2 years.Note 1: This is a download, not a CD (there's an option to add a "Backup DVD" for another $14.99).
Note 2: I'm pretty sure you can just download the trial version and enter your key if you lose your download.So, in other words, it's a scam amounting to "yo dawg, I heard you liked downloads, so I provided you a download for your download so you can download your downloads and sometimes later download your downloads again on the down low."?
Yup.
-
@timebandit said in WTF Bites:
"Backup DVD" for another $14.99
burn it on a blank DVD for about $0.25
Adding it into an already existing 3-2-1 backup scheme would probably be cheaper than what they want, too
-
@timebandit said in WTF Bites:
"Backup DVD" for another $14.99
burn it on a blank DVD for about $0.25
Adding it into an already existing 3-2-1 backup scheme would probably be cheaper than what they want, too
That reminds me, I really need to get one going for my home stuff. Any good guides for those who don't have much more than ~1.2 Tb of stuff to keep safe?
-
Malwarebytes, either make it a time picker that puts in the format for me, or be more accepting of "malformed" time formats.
-
@chaostheeternal said in WTF Bites:
Malwarebytes, either make it a time picker that puts in the format for me, or be more accepting of "malformed" time formats.
Hol' up.
M/d/yyyy?
How, in the name of sanity, can you write a date without at least two digits for both month and day?
-
@pie_flavor said in WTF Bites:
write a date without at least two digits for both month and day?
1/1/1970
-
@pie_flavor said in WTF Bites:
M/d/yyyy
Dates should be written in format yyyy-MM-dd. Everybody who says otherwise should be burned at stake.
-
@pie_flavor said in WTF Bites:
M/d/yyyy
Dates should be written in format yyyy-MM-dd. Everybody who says otherwise should be burned at stake.
What's wrong with MM/dd/yy(yy)?
-
@pie_flavor said in WTF Bites:
What's wrong with MM/dd/yy(yy)?
The fact that on one side of the pond they write dd/MM/yy and on the other MM/dd/yy, so if you see 10/11/12, you don't know what it is supposed to mean. dd.MM.yyyy is better, because MM.dd.yyyy is rare, but unfortunately not completely non-existent.
yyyy-MM-dd is unambiguous. Plus its string order coincides with chronological order.
PS: At $work, we settled for dd-MMM-yyyy (e.g. 10-Nov-2012) for messages in TFS (which does not date them itself—). GRRRR! But at least it is unambiguous.
-
@pie_flavor said in WTF Bites:
What's wrong with MM/dd/yy(yy)?
The fact that on one side of the pond they write dd/MM/yy and on the other MM/dd/yy, so if you see 10/11/12, you don't know what it is supposed to mean. dd.MM.yyyy is better, because MM.dd.yyyy is rare, but unfortunately not completely non-existent.
yyyy-MM-dd is unambiguous. Plus its string order coincides with chronological order.
PS: At $work, we settled for dd-MMM-yyyy (e.g. 10-Nov-2012) for messages in TFS (which does not date them itself—). GRRRR! But at least it is unambiguous.
Unambiguous? 1506406959. There, now there's no months, days, or years to fuck around with!
-
-
@pie_flavor said in WTF Bites:
@pie_flavor said in WTF Bites:
M/d/yyyy
Dates should be written in format yyyy-MM-dd. Everybody who says otherwise should be burned at stake.
What's wrong with MM/dd/yy(yy)?
Well, it is wrong. ;)
-
-
@pie_flavor said in WTF Bites:
What's wrong with MM/dd/yy(yy)?
The fact that on one side of the pond they write dd/MM/yy and on the other MM/dd/yy, so if you see 10/11/12, you don't know what it is supposed to mean. dd.MM.yyyy is better, because MM.dd.yyyy is rare, but unfortunately not completely non-existent.
yyyy-MM-dd is unambiguous. Plus its string order coincides with chronological order.
PS: At $work, we settled for dd-MMM-yyyy (e.g. 10-Nov-2012) for messages in TFS (which does not date them itself—). GRRRR! But at least it is unambiguous.
Maybe it's dd/MM/yyyy that's wrong, not the other way around.
-
@pie_flavor said in WTF Bites:
What's wrong with MM/dd/yy(yy)?
What's right about it?
It's slash.
-
@tsaukpaetra said in WTF Bites:
It's slash.
-
@pie_flavor said in WTF Bites:
not the other way around.
indeed anything that has dates in non-chronological order is wrong.
-
@pie_flavor said in WTF Bites:
not the other way around.
indeed anything that has dates in non-chronological order is wrong.
What do you mean chronological order?
-
@pie_flavor said in WTF Bites:
@pie_flavor said in WTF Bites:
not the other way around.
indeed anything that has dates in non-chronological order is wrong.
What do you mean chronological order?
I think he meant magnitude order?
-
@tsaukpaetra said in WTF Bites:
@pie_flavor said in WTF Bites:
@pie_flavor said in WTF Bites:
not the other way around.
indeed anything that has dates in non-chronological order is wrong.
What do you mean chronological order?
I think he meant magnitude order?
We'll never know.