WTF Bites
-
@Benjamin-Hall said in WTF Bites:
What if the definition of 1 changes?
I love the fact that this was actually a real concern in some old languages.
Isn't it possible in Java too? I'm sure I've seen some horrible abuse of reflection that lets you assert that 4+2==7
-
@Gąska It should connect to a cloud-hosted Node.js SpaaS provider paddr.io, so that your padding is uniform across all your Kubernetes.
-
Of all the retarded things Fortran does, this might be in the top 10.
Ah, but what value is that really after you've reassigned it?
(No more modern language does this. There might be a reason for that…)
-
Isn't it possible in Java too? I'm sure I've seen some horrible abuse of reflection that lets you assert that 4+2==7
You can change the actual value in a boxed value, if you try very hard and disable a bunch of security checks. Don't do that.
-
-
Isn't it possible in Java too? I'm sure I've seen some horrible abuse of reflection that lets you assert that 4+2==7
You can change the actual value in a boxed value, if you try very hard and disable a bunch of security checks. Don't do that.
I looked it up after posting that. You can modify what's in the integer cache, which will affect the outcome of boxing and thing like
Integer.ValueOf()
but not actual use of primitives
-
No more modern language does this. There might be a reason for that…
Insanity aside, I also cannot believe this isn't both more work to implement in the compiler and slower at runtime.
-
@topspin pass by reference. Fortran, like many other languages, allows passing literals to a function by reference - and to create reference, the value needs to have a memory location. So Fortran allocates memory for all literals that you take reference of so you can pass their addresses around - with the unfortunate consequence that nothing stops you from writing to those references.
-
private static string GetFromCache(int width) { if(!cache.ContainsKey(width) { cache.Add(width, new String(SpacerBase, width)); } return cache[width]; }
I spy a race condition! Here, let me "fix" that:
private static string GetFromCache(int width) { lock (cache) { if(!cache.ContainsKey(width) { cache.Add(width, new String(SpacerBase, width)); } } return cache[width]; }
-
-
@Gąska yeah, but that’s only half the insanity. The other half is using the same constant “5” globally (I.e. interning it) instead of just pushing a 5 onto the stack and then passing a reference to the stack.
At least I think it does that.
-
@topspin that's what I meant. But then, memory was much more precious back then. Having only one copy of zero saved quite a lot of bytes, I imagine...
-
I also cannot believe this isn't both more work to implement in the compiler and slower at runtime.
Fortran's Different.™
It does have some advantages elsewhere IIRC, such as being able to tell for sure if values are aliased or not, which makes a fundamental difference to what you can do with optimisation. Or maybe I'm wrong… but there's something really critical involved like that.
-
I also cannot believe this isn't both more work to implement in the compiler and slower at runtime.
Fortran's Different.™
It does have some advantages elsewhere IIRC, such as being able to tell for sure if values are aliased or not, which makes a fundamental difference to what you can do with optimisation. Or maybe I'm wrong… but there's something really critical involved like that.
They’re never aliased. That’s good for the optimizer and why people think they can write faster code in Fortran (although C can use
restrict
if absolutely necessary), but then write shit code because it has neither basic algorithms nor data structures.
-
with the unfortunate consequence that nothing stops you from writing to those references.
Depends. Sun's Fortran compiler on Solaris used to (back in the day when I worked in a company that still had tens of millions of lines of horrible Fortran) put them in read-only sections.
-
@Steve_The_Cynic AFAIK read-only sections weren't even invented when Fortran first appeared. I'm sure they'd have used them otherwise.
-
@Steve_The_Cynic AFAIK read-only sections weren't even invented when Fortran first appeared. I'm sure they'd have used them otherwise.
You're probably right. I'd say it's more a question of the necessary hardware protection not existing, in fact. Curiously, the company also had roughly equivalent AIX machines (from IBM, duh)(1), and their compiler put these constants into writeable sections.
(1) AIX or Solaris, they were, nevertheless, big machines, of the 192-CPU, 192 GB RAM per machine kind (in 2004-8), and many dozens of machines.
-
That’s good for the optimizer and why people think they can write faster code in Fortran (although C can use restrict if absolutely necessary), but then write shit code because it has neither basic algorithms nor data structures.
QFT. This summarizes my experiences with Fortran codebases rather accurately.
-
@Steve_The_Cynic said in WTF Bites:
Curiously, the company also had roughly equivalent AIX machines (from IBM, duh)(1), and their compiler put these constants into writeable sections.
My bet is on "some big IBM customer had some prehistoric piece of code that wouldn't run otherwise".
-
pattern I keep seeing in our legacy code:
Iterate over values in the database, switch-case each value and output different content.
You can manage the database entries from the web interface, but the code requires a deployment. If you actually want to change the text on the webpage, you have to modify both the code and the database records simultaneously. If you edit just one or the other, shit breaks.
-
pattern I keep seeing in our legacy code:
Iterate over values in the database, switch-case each value and output different content.
You can manage the database entries from the web interface, but the code requires a deployment. If you actually want to change the text on the webpage, you have to modify both the code and the database records simultaneously. If you edit just one or the other, shit breaks.
Has someone from my workplace infected yours? Or maybe the other way around...
-
@Zerosquare said in WTF Bites:
@Steve_The_Cynic said in WTF Bites:
Curiously, the company also had roughly equivalent AIX machines (from IBM, duh)(1), and their compiler put these constants into writeable sections.
My bet is on "some big IBM customer had some prehistoric piece of code that wouldn't run otherwise".
You lose. Those machines (Sun or IBM) actually ran the production code (with a standalone doodad that ran on clients' machines as a UI), but there was a policy of making sure the code wasn't infested by platform-specific oddities, achieved by the simple expedient of running it on two different platforms. (AIX and Solaris are sufficiently different, and the hardware architectures certainly are, to make it a reasonable test of bogosity.)
An attempt to introduce a third platform failed miserably because of performance issues, although the need to write a binary-to-binary recompiler didn't help. That is, the platform-porting group had to write a compiler that would read already-compiled .o files from one of the two existing architectures and write out an equivalent .o for the new one. They eventually gave up and built new source code that would do the same things as those .o files, the original source having long since been lost.
Sort of like why Windows Write was replaced by WordPad on Windows 95 - as I heard it, none of the original source could be found, and they couldn't just keep patching the binaries to upgrade things like "Which version of Windows am I built to run on?" and occasional bug fixes. Why? Because it was all 16-bit code, and that just wouldn't do on the new Win32-supporting Win95.
-
-
@Benjamin-Hall said in WTF Bites:
They've redefined everything else, why not basic physical/mathematical constants?
You are aware of various attempts to legislate the value of π, yes?
-
Wanted to leave a comment on Raymond's blog for once. You need to log in with one of these SSO thingies. Tried Google, got this wonderful error message:
https://devblogs.microsoft.com/oldnewthing/wp-login.php?registration=disabled
Well then, I guess not.
-
- Open YouTube video
- Zoom out
- Video gets bigger
-
Wiped a machine, reinstalled Windows 10, go to run all updates, get the usual Windows Update runs forever loop.
Reboot, go to try Microsoft's nifty troubleshooter they put in Windows 10 just for this purpose (instead of fixing Windows Update to begin with, let's make a troubleshooter that fixes all the problems that it has, brillant!!).
Troubleshooter has been stuck doing its thing for 90+ minutes.
I am going to just let it run and see what happens. I am going to assume that it will not fix its issues and I am going to have to go through the normal process of killing services and deleting the SoftwareDistribution folder.
Linux almost never has this issue. Why doesn't Microsoft steal what they do? They steal everything else, why not updating mechanisms? Instead, they steal the dumb shit.
-
@Polygeekery said in WTF Bites:
Troubleshooter has been stuck doing its thing for 90+ minutes.
I can count on zero hands the number of times when one of those things has actually resolved my problem.
Filed under: Except when it resets my network adapter, but I can do that faster without the troubleshooter.
-
@error yeah, the computer ended up crashing. So, is there a hardware issue, or did the troubleshooter end up blue screening the PC?
-
-
@Polygeekery said in WTF Bites:
@error yeah, the computer ended up crashing. So, is there a hardware issue, or did the troubleshooter end up blue screening the PC?
Stop using Linux hardware
-
WhyTF does my espresso machine take longer to boot up than my laptop?
Filed under: Time between hitting power and the UI becoming responsive, not even heating the water yet.
-
We were asked to monitor an employee's internet and machine usage. So far today, 98 minutes spent on Reddit, about 3.5 hours of the machine sitting idle. The owner is about to blow a gasket.
-
@Polygeekery said in WTF Bites:
We were asked to monitor an employee's internet and machine usage. So far today, 98 minutes spent on Reddit, about 3.5 hours of the machine sitting idle. The owner is about to blow a gasket.
*checks machine for monitoring software*
-
checks machine for monitoring software
What we use for this doesn't really show up in the easy to look places. In fact, it usually has to be whitelisted in antivirus before it is deployed.
-
@Polygeekery said in WTF Bites:
We were asked to monitor an employee's internet and machine usage.
One of the most amusing things about when we are asked to do this is that it is fucking amazing how many people constantly Google to find logins that they use every day.
They are basically the grandparents that always have to Google "facebook login" to find Facebook.
-
@Polygeekery said in WTF Bites:
In fact, it usually has to be whitelisted in antivirus before it is deployed.
Joke's on you. I'm not running any (third party) antivirus software.
-
I remember an incident some years back where some random site managed to get better SEO than Facebook for that query and thousands of users were unable to log in to Facebook.
I don't think they were phishers but what a missed opportunity.
-
@error I thought of exactly that, which is why I wrote what I did.
-
He has sent zero emails today. He has made zero calls. He is a salesperson. Holy fuck.
-
-
@TimeBandit Nah. He is on /r/Damnthatsinteresting/
Also, he has spent 14m23s doing work so far today.
-
Hey, you know what else is damn interesting? Initrode's WTFSuite
-
@Polygeekery said in WTF Bites:
We were asked to monitor an employee's internet and machine usage. So far today, 98 minutes spent on Reddit, about 3.5 hours of the machine sitting idle. The owner is about to blow a gasket.
-
@Polygeekery said in WTF Bites:
he has spent 14m23s doing work so far today
That's probably more than the average user of this forum
-
@TimeBandit technically, me spying on him is work, and I am billing the client for it. It is like getting paid to watch a slow motion train wreck occur.
The bad part is, this could easily end up as a workplace violence event. No joking around on that one. Dude is likely to come unhinged. I already told them that we will not schedule anyone to be in the day that he is termed.
-
I'm going to post this here instead of the News thread. Imagine if Elon Musk got into CPU design... A startup company claims to have a CPU design that's faster than Intel's, smaller than ARM's, uses 10x less power (than what? Doesn't say), and is 3x cheaper (again, cheaper than what?). And it achieves this by
data travels over very short wires, mitigating the “slow wires problem.”
-
@Polygeekery said in WTF Bites:
Dude is likely to come unhinged.
Let us know what day, we'll watch the news
-
@Polygeekery said in WTF Bites:
He has sent zero emails today. He has made zero calls. He is a
salespersonfreeloader. Holy fuck.FTFY
-
I was typing a command in a CLI window, and a UAC prompt appeared about 8ms before my finger hit enter. I have no idea what I just approved/denied.