There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

dylanTheDeveloper , in 0.30000000000000004
@dylanTheDeveloper@lemmy.world avatar

Quaternions scare me more

Aelar64 , in 0.30000000000000004
@Aelar64@kbin.social avatar
Metal_Zealot , in Welp, guess I'm going to hell
@Metal_Zealot@lemmy.ml avatar

“It seems you have an ad blocker enabled. In order the enjoy the full benefits of heaven, please disable it and accept our cookies”

xusontha OP ,

bro who is selling ads in heaven

Metal_Zealot ,
@Metal_Zealot@lemmy.ml avatar

Google Adsense has a further reach that you think

JoCrichton , in Welp, guess I'm going to hell

Guess I’m continuing to use Firefox in hell then

xusontha OP ,

Join the club!

merc , in 0.30000000000000004

It’s not + that’s scary, it’s =.

maniacal_gaff ,

==

merc ,

Sometimes…

user224 , in Welp, guess I'm going to hell
@user224@lemmy.sdf.org avatar

“Best viewed with Netscape navigator”

xusontha OP ,
user224 ,
@user224@lemmy.sdf.org avatar

The image embed doesn’t work. Lemmy supports embedding media only if HTTPS is used. This website is HTTP.

xusontha OP ,

I already fixed it, but I didn’t know that! That’s really cool!

mounderfod ,
@mounderfod@lemmy.sdf.org avatar

it’s not just lemmy; HTTPS websites aren’t allowed to serve HTTP content
developer.mozilla.org/en-US/docs/…/Mixed_content

user224 ,
@user224@lemmy.sdf.org avatar

Sorry, my bad. And thanks for the info.

mounderfod ,
@mounderfod@lemmy.sdf.org avatar

No worries, I find the intricacies of protocols like this super interesting 😊

user224 ,
@user224@lemmy.sdf.org avatar

You can also embed images inside links, by the way (click the button):
https://getfirefox.com

[![Get Firefox](https://i.imgur.com/KpmYhB1.gif)](https://getfirefox.com)

Also if say you have image/animation/audio/video link without extension (e.g.: .jpg), you can fool Lemmy using a fragment identifier at the end of URL #.jpg which would usually be used to jump to the fragment id in document. e.g.: https://example.org/image#.jpg

xusontha OP ,

Wowzers that’s fancy, I’ll have to save that for the future

x4740N ,
@x4740N@lemmy.world avatar

Now I’m wondering if someone in bad faith could link an tracking image and just rip ip addressees in the background

I guess it depends on if lemmy clients query the link to fetch fetch images or just grab a cached copy of the image from the lemmy instance

user224 ,
@user224@lemmy.sdf.org avatar

Images in comments don’t get cached, so absolutely yes. But I mean, public IP + User Agent is like minimum of information anyway. Any website you visit gets it.

dullbananas ,
@dullbananas@lemmy.ca avatar

Vatican website

empireOfLove , in Welp, guess I'm going to hell

changes useragent to Chrome. Everything works perfectly on the site

Hmm. Interesting.

xusontha OP ,
lnsfw3 ,

Stroking intensifies

sj_zero ,
empireOfLove ,

Well, he was definitely stroking something.

Chais ,
@Chais@sh.itjust.works avatar

Which proves that M$ Teams definitely isn’t heaven, because some things actually don’t work with Firefox, as I recall.

starman ,
@starman@programming.dev avatar

Last time I tried to log in it said something about cookies and I had to use chrome.

empireOfLove ,

that’s your own fault for using teams though

also they don’t count since Microsoft changes all links to force open in Edge and there’s nothing you can do about it.

giffybiss ,

Most ppl don’t use Teams by way of personal choice

MonkderZweite ,

$ cat firefox.exe > edge.exe doesn’t work?

PoolloverNathan ,

enoent

marcos ,

Microsoft changes all links to force open in Edge

Or, that doesn’t work in Firefox either.

Chais ,
@Chais@sh.itjust.works avatar

Not like I had a choice

empireOfLove ,

You will use your corporate vendor lock-in garbage software and you will LIKE IT! THATS AN ORDER!!

I don’t really care what happens on my work machine tbh. I’ll use whatever they set to default.

marcos ,

Calls don’t work.

I does video meetings perfectly well. But not calls. And if you never used Teams, just try to guess the difference.

GrievingWidow420 ,

Doesn’t solve the problem tho, which makes editing the useragent nothing but a temporary solution not worth being smartass-megamind about

empireOfLove ,

What is the perceived problem, then? 99% of sites these days are all built with kits that support Firefox just as well as Chromium, the dev choice to not support or intentionally lock out Firefox is either just laziness (not wanting to deal with any potential problems or not given enough time to run full Firefox user tests) or incentive driven (middle manager has word from high manager that they can’t support firefox because highest manager makes bank from Chromium).

The technical limitation isn’t actually there in the modern web, it’s almost always a manufactured limitation. I think I’ve only ever encountered a single website that didn’t actually technically work on Firefox, and that was Weather Underground. Which they ended up fixing after 3 months or so.

GrievingWidow420 ,

What is the perceived problem, then?

Make sure to read this thoroughly this time.

[…]it’s almost always a manufactured limitation.

Doesn’t that sound like a good description of a problem?

I think I’ve only ever encountered a single website that didn’t actually technically work on Firefox[…]

There’s gonna be a hell of a lot more of them, buddy. You’re gonna have to hang your cat on your balcony to get an estimate of future weather if you want to avoid using one of them how-are-these-even browsers.

Imagine yourself as a homosexual man in Iran (should be easy). Would you say that hiding that big part of you from everyone and even go as far as marrying a woman you don’t even like just not to arouse suspicion makes the problem disappear? Just the fact that you need to spoof your useragent to view a shitty website, the developer of which would (should) die under a car one day 🤞, is a solid proof that you will soon be that homosexual man in Iran.

empireOfLove ,

Bro are you seriously comparing using a vendor locked web browser to being stoned for being gay in a conservative religious country 🤣🤣🤣

GrievingWidow420 ,

Aren’t you?

empireOfLove ,

…no.

GrievingWidow420 ,

Bummer

ndguardian ,

My SO just had something similar pop up yesterday. She was running into weird errors on her Chromebook, so I had her change her user agent to Chrome on Windows. Everything magically worked. Hmm…

idunnololz ,
@idunnololz@lemmy.world avatar

This is actually exactly how user agents evolved.

Chrome pretends to be safari.

IE pretends to be Netscape.

Safari pretends to be Firefox.

All popular browsers pretend to be at least one other browser for compatibility.

humanwhocodes.com/…/history-of-the-user-agent-str…

FinancesDrone98 ,

So it’s kind of like back in the Netscape days.

Men are men, women are men, boys are men, and little girls are FBI agents.

StarkillerX42 , in Markdown everywhere

One of these days, someone is going to invent a confluence alternative that only supports markdown and doesn’t have nay of confluences stupidity and it is going to EXPLODE and bankrupt Atlassian.

StarkillerX42 , in Always commit

No babe! I was busy doing review!

HKPiax , in 0.30000000000000004
@HKPiax@lemmy.world avatar

I’ve always tried understanding this floating point thing, but I never could. Could anyone here please ELI5?

jana ,

Computers are binary, yeah? So we have to represent fractional numbers with binary, too.

In decimal, numbers past the decimal point are 10^-1, 10^-2, … etc. In binary, they’re 2^-1, 2^-2, …

2^-1 is one half, so 0.1 in binary is 0.5 in decimal. 2^-2 is one quarter. 0.11 in binary is 0.75 in decimal. And of course you’ve got 0.01 = 0.25

The problem comes when representing decimal numbers that don’t have neat binary representations. For instance, 0.1 in decimal is actually a repeating binary number: 0.0001100110011…

Rentlar , (edited )

My ELI5 is this. Pretend you have a robotic pizza cutter, but the only thing it can do with a pizza or pizza slice is cut it in half. If you ask for a tenth of a pizza, well it can give you an 1/8 or a 1/16 by repeatedly cutting a slice.

It can also cut you a 1/16 slice, make 1/32, 1/256, 1/512 and 1/2048 slices separately, shift them together for you and be like: “There. Here’s 0.100098 of a pizza. You happy?”

(You can also think of it as the robot cutting the pizza into 2048 slices and mushing together 205 of them to make your “tenth”).

HKPiax ,
@HKPiax@lemmy.world avatar

This is absolutely brilliant. Perfect ELI5, thanks! Would you be so kind to make it so it’s about the binary thing with computers?

Rentlar ,

Sure I can try to connect the metaphors, in a binary number system you have numbers 1 or 0 to pick from. How it applies in this scenario is that you can only have up to one slice of each size. That works because if you want two of it, you would instead replace it with a one size bigger slice that is equivalent to 2x the smaller size.

For a general understanding of floating point I suggest you learn binary first and separately, because at the end of the day it’s just another way to write base-10 numbers. Floating point representation is useful because the basic principle is you pick some fraction that is so small relative to what you’re measuring, so you can do most math accurately. (e.g. If I say this dwarf planet is the size of our moon and a 20 tennis balls, the tennis balls don’t really change your idea of how big it is)

At the end of the day, FP is like scientific notation but with like 10 significant digits.

soggy_kitty ,

ChatGPT alarm bells

Rentlar ,

I ain’t ChatGPT. My comment there kind of sounds like it tho.

ruk_n_rul ,

People tend to forget ChatGPT learns from people’s comments, like yours.

merc ,
Psythik ,

My head hurts just trying to comprehend that article.

God I suck at math.

tetris11 , in 0.30000000000000004
>>> 0.1 + 0.2
0.30000000000000004
>>> 1e16 * (0.1 + 0.2)
3000000000000000.5

Yes.

maniel , in 0.30000000000000004
@maniel@lemmy.ml avatar

Python?

magic_lobster_party ,

IEEE 754

psud , in 0.30000000000000004

If working in currency, work in cents and divide by 100 and round to 2 decimals for output

Jajcus ,

If working with currency use types and formating functions appropriate for currency. Not float.

psud ,

I was recalling a project in perl, which doesn’t have a variety of types. If you add values, you get a scalar, which will be a float if the numbers are not integers.

I am aware my statement isn’t true in several languages

IWantToFuckSpez ,

Yeah round down and transfer the remainder to an account you own.

psud ,

Indeed, Lex

elbarto777 ,

No, not Lex. Gus!

Awesome movie, regardless!

psud , (edited )

I just recalled, in that project I did have to divide money, which would leave fractional cents

It was a budgeting program, I could put rogue cents where I liked. I think my solution made accounts due $12.553333333… (internally 1255.3333…) each pay period get 12.54, so after n/3 pay periods they’d be 2n cents over. I could deal with that imprecision.

redcalcium ,

Some programming languages use different rounding method. Might bite you in the ass if you’re not aware of it and using multiple programming language in your application to handle different areas.

janAkali ,

Most languages have decimal libraries to correctly handle floating point arithmetics, where precision is necessary.

Slotos ,

They are as incapable of handling one third of a dollar as binary positional notation is incapable of handling one fifth (0.2).

It’s not really a float problem. It’s a positional notation one. Some perfectly rational numbers refuse to squeeze into that mold.

szczuroarturo ,

Also decimal system is not exatcly that much better since you also cant write 1/3 in decimal

MJBrune ,

Even then that can contain bugs on large amounts.

CanadaPlus ,

You’re telling me there’s someone that has more than 20 million dollars? /s

If you’re handling people’s money you should probably be using arbitrary-precision arithmetic. I mean, you might get away with a long int, but finance is serious business and the amount of data you’re going to be processing relative to your funding is probably going to be small.

psud ,

Not the project I was thinking about above, but at work my team delivered software handling 13 digit numbers, but that’s in COBOL which does fine with money

Zikeji ,
@Zikeji@programming.dev avatar

That’s what I wound up doing on a work project. Works really well.

Buckshot ,

And remember not all currencies are 2dp so get a list and use the appropriate exponent.

I had to update our currency database this week because there’s new currencies. It’s almost as bad as timezones.

ruk_n_rul ,

[email protected] wake up, new currencies just dropped

xigoi , in 0.30000000000000004
@xigoi@lemmy.sdf.org avatar

If you’re working with floating point, you should be aware it’s just an approximation.

kevincox ,
@kevincox@lemmy.ml avatar

People think floats are too magical. Calling it an approximation is sort of leaning into this. Floats have limited precision like every other fixed size representation of a number.

This is sort of saying that integers are an approximation because int(1.6) + int(2.6) = 5. What do you mean‽ Clearly 1.6 + 2.6 = 4.2 ~= 4!

Floating points can’t perfectly represent 0.1 or 0.2 much like integers can’t represent 1.6. So it is rounded to the nearest representable value. The addition is then performed perfectly accurately using these values and the result is the rounded to the nearest representable value. (Much like integers division is “rounded”). That result happens to not be equal to the nearest representable value to 0.3.

It is definitely a bit surprising. And yes, because of rounding it is technically approximate. But the way people talk about floating point makes it sound like it is some nebulous thing that gives a different result every time or just sort of does the correct thing.

r00ty Admin ,
r00ty avatar

I think specifically, they have amazing precision. But the boundaries just don't fall perfectly on round numbers we humans would expect. That's what gets people confused.

Rounding can resolve these problems, or don't use float if you don't need to.

merc ,

The difference is that when you input a specific, precise floating point number, the number that’s stored isn’t what you entered.

When you enter integers and store them in ints, as long as the number is small enough, what’s stored is exactly what you entered.

If you tell your program that the radius of the circle is 0.2 units exactly, it says OK and stores 0.200000000000000011102230246251565404236316680908203125.

Of course everybody knows that there’s a limit to how many digits get stored. If you tried to store Pi, there’s obviously some point where it would have to be cut off. But, in life we’re used to cutting things off at a certain power of 10. When we say Pi is 3.14 the numbers after the 4 are all zero. If we choose 3.14159 instead, it’s the numbers after the 9 that are zero. If we represent these as fractions one is 314/100 the other is 314159/100000. The denominator is always a power of 10.

Since computers are base 2, their denominator is always a power of 2, so there’s a mismatch between the rounded-off numbers we use and the rounded-off numbers the computer uses.

empireOfLove , in 0.30000000000000004

Well just don’t ask a Pentium processor for it either…

Psythik ,

4195835/3145727 = 1.333739068902037589

slazer2au ,

Yes fellow program, Harbinger is the next stage in our evolution.

nixfreak ,

This is why ceiling and floor was invented.

empireOfLove ,

But where are the walls?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines