WTF Bites
-
@Jaloopa I'm thinking of making a language called C.
-
@bb36e what about an image format called Customizable Photoimage Packager?
-
@ScholRLEA said in WTF Bites:
@bb36e what about an image format called Customizable Photoimage Packager?
A text-based music interface definition file called "Extraordinary Xenia Extrapolation" file?
-
All acronyms courtesy of the advertising firm of Granger and Agnew
-
it's going to stand for @dkf's Lovely Language…
You're going to call it @ll?
-
-
@ben_lubar on Windows at least you only need a colon to access the hidden extra streams, and I tested and the names are definitely not restricted to 4 bytes. But they are mostly invisible.
Oh great, another incompatibility between Wandows and good OSes like Mac OS 6½. Can't Microsoft get anything right?
-
Filed under: Or
CR
LF
Holy shit, someone needs to invent a use for CRLF-terminated filenames.
-
@error Honestly if I made a language I'd just use emoji in the extension.
Like
myfile.😕😄😄
. Compatible with all modern OSes, incompatible with crappy OSes (that's a feature), and practically guaranteed to be unique.
-
-
@error You really can't use
NUL
. But ANSII terminal escape sequences…
-
A company for s
-
Prefix matching is hard.
-
-
@Zecc does it work if you add a trailing slash to the folder names?
-
@Jaloopa Yes! Thank you, that hadn't occur to me.
-
@Zecc If they can't get this basic shit right, why do you even want Android?
-
@Zecc does it still refuse to install in a path with spaces? I remember having to stick a junction point in to get things in program files back in the 2.3 days
-
and the names are definitely not restricted to 4 bytes.
He was talking about Mac resource forks, not NTFS A
DSCLs.
-
@error In 5th grade, a friend named Tom and I wrote a really basic tic-tac-toe program for the Apple 2. I had just discovered that control characters were valid in filenames and I thought it'd be funny to name the program tic^Ttac^Otoe^M.
It didn't work out so well.
-
@ben_lubar said in WTF Bites:
Holy shit, someone needs to invent a use for CRLF-terminated filenames.
They have. It's "trolling Linux newbs".
-
@blakeyrat said in WTF Bites:
If they can't get this basic shit right, why do you even want Android?
Right--instead you could get a Windows phone and just have no apps.
-
Great coding from Micro-Soft
brokenOpen TechnologyHardcoded user id and pushed it to the repo.
-
@TimeBandit What does it have to do with Microsoft other than someone using their name to refer to them?
Looks like Moodle is some opensource CMS?
-
@JBert This is from a Moodle plugin, not part of Moodle.
From the file: @copyright (C) 2014 onwards Microsoft, Inc. (http://microsoft.com/)Moodle is an open-source LMS
-
For those of you JavaScript/TypeScript coders who feel the
? :
operator is too mainstream, let me introduce you to an innovation I stumbled upon recently in our app's code, the&& ||
operator:return isOpen && "content/images/minus_menu.png" || "content/images/plus_menu.png"
(Note:
isOpen
is a boolean variable)Thanks to the wonder of truthy and falsy values in JavaScript, and the fact that in JavaScript
&&
and||
actually just mean "return my first or second operand, depending on the truthiness of the first operand", this abomination of logic that would cause Augustus DeMorgan to roll in his grave actually works as intended, as long as the second operand is never falsy.
-
@TimeBandit said in WTF Bites:
@JBert This is from a Moodle plugin, not part of Moodle.
From the file: @copyright (C) 2014 onwards Microsoft, Inc. (http://microsoft.com/)Moodle is an open-source LMS
Either way, you could have linked to the actual commit on Github because it looks like the original plugin does not contain this code. It's even in another location which suggests the file was copied and hacked up.
-
Either way, you could have linked to the actual commit on Github because
Actual commit is here: https://github.com/Microsoft/o365-moodle/commit/31a85c7ffc873bb3ccb1130b69935c94ea295a11
it looks like the original plugin does not contain this code. It's even in another location which suggests the file was copied and hacked up.
This is not the location of the original plugin. Here is the original: https://github.com/Microsoft/o365-moodle
What you link to is the "secondary" repo, where the stable individual plugin gets pushed once in a while. Which is a itself.
From the master repo:
At designated intervals, updated versions of these plugins are pushed to individual repos and updated in the moodle.org listings.File under: Micro-Soft all-the-way
-
For those of you JavaScript/TypeScript coders who feel the
? :
operator is too mainstream, let me introduce you to an innovation I stumbled upon recently in our app's code, the&& ||
operator:return isOpen && "content/images/minus_menu.png" || "content/images/plus_menu.png"
(Note:
isOpen
is a boolean variable)Thanks to the wonder of truthy and falsy values in JavaScript, and the fact that in JavaScript
&&
and||
actually just mean "return my first or second operand, depending on the truthiness of the first operand", this abomination of logic that would cause Augustus DeMorgan to roll in his grave actually works as intended, as long as the second operand is never falsy.So what would a chained
? :
look like?
-
@djls45
Assuming you mean something like
a ? const1 :
b ? const2 : const3as
a && const1 ||
b && const2 || const3well...
as much as I pray no one reads the following as a recommendation to adopt this pattern...
It works, as long as none of the values coming immediately after an && is falsy (which would prevent it from being returned even if the value to its left is truthy).Test cases:
aTbT -> const1 (Since a is true, a && const1 does not short-circuit, so returns const1. Since const1 is true, it short-circuits both || operators. b && const2 will already be evaluated by the time this occurs since && evaluates before || in JS.)
aTbF -> const1 (Same story as before.)
aFbT -> const2 (a short-circuits the first &&, (b && const2) returns const2 since b is false, a || const2 does not short-circuit since a is false, so returns const2, and const2 || const3 short-circuits and reduces const2.)
aFbF -> const3 (a && const1 and b && const2 both short-circuit, so we're left with a || b || const3, and since a and b are false, none of those || short-circuit, so we finally get const3.)Inductive proof that this property holds for larger chains is left as an exercise to the reader.
-
@TimeBandit said in WTF Bites:
Micro-Soft
It's funnier[1] if you go whole hog and spell it Micro$oft or MicroSloth or something.
[1] by which I mean only slightly dumber.
-
-
@TimeBandit Yes? Were you trying to get me to notice the part where it's been "Microsoft" since 1981?
-
For those of you JavaScript/TypeScript coders who feel the ? : operator is too mainstream, let me introduce you to an innovation I stumbled upon recently in our app's code, the && || operator:
You can use this to simulate
?.
from C#:return ob && ob.results && ob.results.user && ob.results.user.name || null;
Of course, there was no excuse for using it in your example.
-
Fun argument from PHP archives
This Remus is like redneck version of Linus. Worth watching.
Of course, both he and the OP are WTFs here.
-
@cartman82 PHP: this function does things this way because the developer behind it thought it would be nifty.
-
@Zecc does it still refuse to install in a path with spaces? I remember having to stick a junction point in to get things in program files back in the 2.3 days
I don't know, I haven't tried in a while, sorry.
-
For those of you JavaScript/TypeScript coders who feel the
? :
operator is too mainstream, let me introduce you to an innovation I stumbled upon recently in our app's code, the&& ||
operator:return isOpen && "content/images/minus_menu.png" || "content/images/plus_menu.png"
(Note:
isOpen
is a boolean variable)Thanks to the wonder of truthy and falsy values in JavaScript, and the fact that in JavaScript
&&
and||
actually just mean "return my first or second operand, depending on the truthiness of the first operand", this abomination of logic that would cause Augustus DeMorgan to roll in his grave actually works as intended, as long as the second operand is never falsy.This is how you do the ternary operator in Lua.
somevar = cond and trueValue or falseValue
-
This is how you do the ternary operator in Lua.
somevar = cond and trueValue or falseValue
So what happens when the
trueValue
is falsish?
-
Since when are "i.e." and "e.g." unknown terms? And "etc"?
-
@anonymous234 Just abbreviations? So stuff like ad hoc, ipso facto and bona fide are all fine?
-
@anonymous234 said in WTF Bites:
Since when are "i.e." and "e.g." unknown terms? And "etc"?
Why remove? Why not just add some "abbr" tag?
-
@cheong Because:
- people reading are "under stress or in a hurry"
- mobile
-
This is how you do the ternary operator in Lua.
somevar = cond and trueValue or falseValue
So what happens when the
trueValue
is falsish?You get
falseValue
, which is why the way you do the ternary operator in Lua sucks.
You should use it only when yourtrueValue
is "truey", if at all.
-
@Jaloopa And just Latin abbreviations. So I guess you can just use "i.o.w.", "f.e.", asf.
-
@Vault_Dweller said in WTF Bites:
@cheong Because:
- people reading are "under stress or in a hurry"
- mobile
And I thought people don't actually read news but let the news be read with text-to-speech readers.
-
@anonymous234 said in WTF Bites:
Since when are "i.e." and "e.g." unknown terms? And "etc"?
Many, many people do not know the difference between id est and exempli gratia. These are the same people who will use the redundant "etc. etc.".
-
"etc. etc." is only as redundant as "many, many"
-
-
@blakeyrat said in WTF Bites:
I'm 100% in Windows' camp on this one. The guys who came up with the extension for TypeScript did fuck up, and Windows is correct saying so.
It amuses me that both TypeScript and Windows were created by the same company.