WTF Bites
-
@cartman82 Someone grabbed code from a code base that needed to support IE < 11 - console doesn't exist if the development tools aren't open.
@blakeyrat said in WTF Bites:
Is that JavaScript?
Nothing in the DOM or JS spec requires a global object named "console" to exist, so that error check is prudent. (Or defining your own global "console" if the browser hasn't provided one.)Hmm... Ok. Fair point.
-
i'm assuming enterprise needs
Depends on the enterprise. We have managed to get rid of virtually everything that requires old IE (driven by the insistence of budget-holding users on using iPhones to access things, that and the fact that there wasn't much budget in the first place for producing IE-specific sites).
-
(driven by the insistence of budget-holding users on using iPhones to access things, that and the fact that there wasn't much budget in the first place for producing IE-specific sites).
well...
if nothing else this iphone mania has done away with the idea that only supporting IE is a good thing.....
of course the "mobile frienldy" monstrosities that get created are possibly worse than the IE only activeX sites they replaced....
-
of course the "mobile frienldy" monstrosities that get created are possibly worse than the IE only activeX sites they replaced....
We've got a lot of users of OSX and Linux, enough that we simply can't get away with a true monoculture. The closest we get is with some of the Dell DRAC cards we use, which require the user to have old IE and J++ installed in order to use the only client software that works reliably with them. Actually, that's bad enough, but we just run those monstrosities in a VM and they only annoy some of the sysadmins…
-
I'd just upgrade my users computers
I have suggested it might be cheaper for my company to send a technician with the regional manager to each of our clients on XP and install Chrome for them then it would be to pay our devs to support IE7 anymore.
-
I find this baffling. This is c#
decimal oneTwentyFourth = System.Decimal.Divide(1, 24);
-
I find this baffling. This is c#
decimal oneTwentyFourth = System.Decimal.Divide(1, 24);
Well obviously they wanted to allow 1/24 to possibly change.
-
@Tsaukpaetra 1, 24 and 1/24 are magic numbers. OneTwentyForth isn't
-
I wonder it was written that way because the author didn't know how to write a literal decimal value in an equation. Looking at the surrounding code everything's a bit, I dunno, primitive? Like it was someone who was still fairly fresh to the c# thing.
-
they're already using Chrome
At least they are not stuck at FireFox 22 ...
FF22 has console. Hrpmph.
-
I wonder it was written that way because the author didn't know how to write a literal decimal value in an equation. Looking at the surrounding code everything's a bit, I dunno, primitive? Like it was someone who was still fairly fresh to the c# thing.
1/24 isn't exact in a decimal representation, and it's not obviously correct upon a casual inspection. I tend to do stuff like this instead of a literal for the clarity and simplicity.
But then I don't C#, so maybe I'm too.
-
This post is deleted!
-
Google has decided to silently ignore half of my query
-
@boomzilla said in WTF Bites:
1/24 isn't exact in a decimal representation,
decimal oneTwentyFourth = 1/24m;
there, now it's the same value as originally written except now it's a compile time constant.
still a crappy name for a variable though.
-
@blakeyrat said in WTF Bites:
This is one of those occasions where stupid people bitch about IE not having "console" even though IE was following the spec exactly; "console" isn't required to be compliant. But, hey, any excuse to bitch about Microsoft, right?
But all good browsers have console. I would just assume console is present and ignore any loser using IE (or Edge)
-
if(window && !window.console){ location.replace('http://www.getfirefox.com'); }
-
if(window && !window.console){ location.replace('https://www.google.com/chrome/browser/desktop/index.html'); }
FTFY
-
if(window && !window.console){ location.replace('https://ftp.mozilla.org/pub/firefox/releases/22.0/'); }
LTFY
-
@Luhmann An https "ftp", ?
-
@anonymous234 said in WTF Bites:
Google has decided to silently ignore half of my query
Google is not evil, it just values its
customerproduct's sanity.
-
@groo
The second was free of charge ... thanks to the kind folks at Mozilla.org. Keep up the good work!
-
Installing a crappy program, it suggested me to install in it's default directory, that is inside "C:\Program Files (x86)", then it claims that "(" is an invalid character in a path and it can't do that.
-
@JBert Well excuse me for wanting to contribute something to the world! How are you even going to write your ASP.NET pages in Befunge if I don't write a CIL compiler for it?
-
@anonymous234 BEFUNGE.NET coming when?
-
@groo Yeah well some software developers like to code for the spec instead of just getting to the point of "works on my machine!" then releasing it.
Especially hypocritical for web developers who bitched for years and years that IE wasn't following the spec.
-
24m
Ah, that'd be my inexperience with C#. Didn't know there was a way to write a decimal literal.
-
@boomzilla said in WTF Bites:
24m
Ah, that'd be my inexperience with C#. Didn't know there was a way to write a decimal literal.
yep. you can also write it in full decimal notation, except that 1/24 is non terminating in decimal.... so fraction form and let the compiler convert. :-D
-
-
@anonymous234 said in WTF Bites:
Google has decided to silently ignore half of my query
Maybe you should stop shouting at it? It's probably attenuated you or something...
Edit:
Google is not evil, it just values its customerproduct's sanity.
How did we get two almost completely different results sets?
-
-
@Tsaukpaetra I am going to posit that the different language settings (Spanish vs English) might have some bearing.
-
@ScholRLEA said in WTF Bites:
@Tsaukpaetra I am going to posit that the different language settings (Spanish vs English) might have some bearing.
SSHHHH!!!!
-
@Tsaukpaetra said in WTF Bites:
@anonymous234 said in WTF Bites:
Google has decided to silently ignore half of my query
Maybe you should stop shouting at it? It's probably attenuated you or something...
Edit:
Google is not evil, it just values its customerproduct's sanity.
How did we get two almost completely different results sets?
welcome to the search bubble
-
@Tsaukpaetra said in WTF Bites:
@anonymous234 said in WTF Bites:
Google has decided to silently ignore half of my query
Maybe you should stop shouting at it? It's probably attenuated you or something...
Edit:
Google is not evil, it just values its customerproduct's sanity.
How did we get two almost completely different results sets?
welcome to the search bubble
Sorry, from the context it may have sounded like I was personally surprised, but in fact I was nodding to the differences in our online personas.
-
@anonymous234 said in WTF Bites:
Why? It's just an egg timer.
Filed under: Awkward times and places for an egg timer to go off
-
"Should I spend another minute to align these buttons? Nah, this is good enough"
-
@cartman82 They're aligned. They just have different borders.
-
@cartman82 They're aligned. They just have different borders.
...... I.... I can't even
-
Never mind. I'm going to get some coffee.
-
innovation I stumbled upon recently in our app's code, the
&& ||
operator:That ain't no innovation. It's been used in perl already in the last millennium.
-
@ScholRLEA said in WTF Bites:
Yes, I am aware of at least some of the historical reasons it wasn't done at the beginning, and how hard it would be to retrofit it on now, but seriously, the file systems for ITS, VMS, and TENEX handled this better than NTFS and ext4fs do now
Btrfs is supposed to add snapshots, but it's been in development for 9 years and not getting anywhere.
-
It's been used in perl already in the last millennium.
Ah, but nobody was able to read it and discover the fact before!
-
@cartman82 said in WTF Bites:
WTF python people? Why not some "weak import" thing? Why do you have to ruin everything?
It would require some kind of late binding. That in turn would require delayed compilation of the function bodies. And I don't think CPython is anywhere close to being able to do that.
Only way to deal with that: persuade the people in charge of the import system to make it blow up if people use it circularly.
It does. Or rather, it does except in few special cases where nothing actually depends on the content of the module that is being imported recursively, because during the recursive import the content of the module is not known yet. Because in python, importing a module requires executing it. As it does in basically any other dynamic language.
-
Because in python, importing a module requires executing it. As it does in basically any other dynamic language.
There's executing and then there's executing. Importing a module (in general) means adding the definitions in that module's API to the set of definitions available to the current program. In dynamic languages, this is done by running some code; in sane modules, all that code really does is say “here are the definitions I'm providing and these are my dependencies” though there can be a bit more than that in complex scenarios (for example, loading a configuration is another thing that can happen).
When someone decides that importing the module should do significantly more than that, that's when the WTF Radar should be pinging like heck.
-
So you know how normally in Windows
sc
is Service Control - a.k.a. a command-line tool to uninstall, stop, start, etc. your services? Very useful and very ubiquitous thing.Well, unless your command line of choice is PowerShell, in which case
sc
is an alias forSet-Content
.I wonder how many files named
stop
orstart
I have in various folders because I forget to callsc.exe
instead.
-
Also, Oracle Universal Installer seems rather sad to see me leave.
Aww, there, there, you know I can't quit you. (I also can't do much else since Exit is OUI's way to finish the install).
-
@Maciejasjmj
net start / stop not good enough for you?
-
They do release patch notes, and they are going to make the tile take you to the update history.
...
But you're right that this should been happening a looooong time ago.Well, they have been doing it for looooong time, but in a totally idiotic way. The description always just says "This update resolves issues with Windows" and then you have to click and it will launch another window and open a web page with a text that would (or at least its important part would) comfortably fit in the update description. But no, you have to click through it like an idiot.
-
@Maciejasjmj said in WTF Bites:
Oracle Universal Installer seems rather sad to see me leave.
Is the universe correctly installed now? (inb4 No, Oracle still exists…)
-
There's executing and then there's executing.
As far as I can tell, in dynamic languages there is only one kind of executing.
In dynamic languages, this is done by running some code; in sane modules, all that code really does is say
The language interpreter can't, however, rely on sanity of the module. Neither in python, nor in any other dynamic language I know.
However, the problem in python is actually somewhat different. In languages where the code is straight up interpreted there is actually not much problem as long as the modules refer to each other only inside functions (as the sane ones do), because the functions bodies will only run long after the declarations are processed and the module is finalized. But python is actually not straight-up interpreted. It is compiled to bytecode first and this bytecode compilation includes checking for undefined symbols. It is this check that makes circular dependency between modules not work.