programming Programming Why I Prefer Exceptions to Error Values
Jump
  • OmnipotentEntity OmnipotentEntity 4 days ago 83%

    A problem that only affects newbies huh?

    Let's say that you are writing code intended to be deployed headless in the field, and it should not be allowed to exit in an uncontrolled fashion because there are communications that need to happen with hardware to safely shut them down. You're making a autonomous robot or something.

    Using python for this task isn't too out of left field, because one of the major languages of ROS is python, and it's the most common one.

    Which of the following python standard library functions can throw, and what do they throw?

    bytes, hasattr, len, super, zip

    4
  • science Science Magical equation unites quantum physics, general relativity in a first
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%
  • space Space Highest-resolution black hole images ever taken usher in a new era
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%

    Oh, I'll try to describe Euler's formula in a way that is intuitive, and maybe you could have come up with it too.

    So one way to think about complex numbers, and perhaps an intuitive one, is as a generalization of "positiveness" and "negativeness" from a binary to a continuous thing. Notice that if we multiply -1 with -1 we get 1, so we might think that maybe we don't have a straight line of positiveness and negativeness, but perhaps it is periodic in some manner.

    We can envision that perhaps the imaginary unit, i, is "halfway between" positive and negative, because if we think about what √(-1) could possibly be, the only thing that makes sense is it's some form of 1 where you have to use it twice to make something negative instead of just once. Then it stands to reason that √i is "halfway between" i and 1 in this scale of positive and negative.

    If we figure out what number √i we get √2/2 + √2/2 i

    (We can find this by saying (a + bi)^(2) = i, which gives us (a^(2) - b^(2) = 0 and 2ab = 1) we get a = b from the first, and a^(2) = 1/2)

    The keen eyed observer might notice that this value is also equal to sin(45°) and we start to get some ideas about how all of the complex numbers with radius 1 might be somewhat special and carry their own amount of "positiveness" or "negativeness" that is somehow unique to it.

    So let's represent these values with R ∠ θ where the θ represents the amount of positiveness or negativeness in some way.

    Since we've observed that √i is located at the point 45° from the positive real axis, and i is on the imaginary axis, 90° from the positive real axis, and -1 is 180° from the positive real axis, and if we examine each of these we find that if we use cos to represent the real axis and sin to represent the imaginary axis. That's really neat. It means we can represent any complex number as R ∠ θ = cos θ + i sin θ.

    What happens if we multiply two complex numbers in this form? Well, it turns out if you remember your trigonometry, you exactly get the angle addition formulas for sin and cos. So R ∠ θ * S ∠ φ = RS ∠ θ + φ. But wait a second. That's turning multiplication into an addition? Where have we seen something like this before? Exponent rules.

    We have a^(n) * a^(m) = a^(n+m) what if, somehow, this angle formula is also an exponent in disguise?

    Then you're learning calculus and you come across Taylor Series and you learn a funny thing, the Taylor series of e^x looks a lot like the Taylor series of sine and cosine.

    And actually, if we look at the Taylor series for e^(ix) is exactly matches the Taylor series for cos x + i sin x. So our supposition was correct, it was an exponent in disguise. How wild. Finally we get:

    R ∠ θ = Re^(iθ) = cos θ + i sin θ

    3
  • space Space Highest-resolution black hole images ever taken usher in a new era
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%

    What god formula?

    3
  • neurodivergence Neurodivergence Why Anti-Authoritarians Are Diagnosed as Mentally Ill
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%

    It's not a mental disorder to simply be anti-authority, but it can be pathological. Not to take away from your point or anything, but I have a true story about a kid who went to college with my wife.

    He was a real prat who didn't like being told what to do, and he seemed to take perverse pleasure in antagonizing authority figures who couldn't directly punish him and who he considered to be beneath him. For instance, he would frequently leave his messy plates out at the dining hall, because he knew there would be no consequences for him, and he wanted the staff to have to clean up after him.

    Or this one time where the RA in the dorm was explaining how to choose a room for next year because everyone had to move out, he had a zippo lighter and was just throwing it up and catching it, and occasionally letting it fall to the ground and make a loud noise. He ignored instructions to stop doing that because it's obnoxious, because the RA was an authority with no power, so was beneath him.

    All in all, cowardly behavior, and while I'm not a psychiatrist, and I cannot diagnose him, it certainly sounds like ODD to me.

    Anyway, this piece of shit's name is Stephen Miller.

    12
  • space Space Highest-resolution black hole images ever taken usher in a new era
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%

    No, I just understand math. So yes.

    3
  • space Space Highest-resolution black hole images ever taken usher in a new era
    Jump
  • OmnipotentEntity OmnipotentEntity 2 weeks ago 100%

    Well, 13 microarcseconds is the resolution they claim to be shooting for. The nearest star is 4.2 light-years away. 13 microarcseconds at 4.2 light-years is 2500km, the earth is about 12742 km in diameter. So we can theoretically take an approximately 5x5 pixel image of Proxima Centauri b.

    5
  • gaming Gaming Game Dependency Graph of The Curse of Monkey Island (LucasArts, 1997)
    Jump
  • OmnipotentEntity OmnipotentEntity 3 weeks ago 100%

    If you are taking requests, I am curious how ridiculous The Longest Journey would be.

    4
  • politics Politics Biden-Harris Admin Quickly Staffs DOJ Ahead of Election
    Jump
  • OmnipotentEntity OmnipotentEntity 3 weeks ago 100%

    Good effort. But I don't know if it will be particularly effective considering Project 2025 has playbook stuff specifically about doing end runs around staffers.

    The article is stupid as hell though.

    1
  • theonion The Onion Conservative Who Has Been Complaining About Grocery Prices Says Harris’ Price-Gouging Ban is Communism
    Jump
    memes Memes Conservative kid know a lot this days 🧒
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    No one tell OP that the ml in lemmy.ml is for Marxist Leninists.

    1
  • technology Technology US senators claim car makers sold driver data for pennies
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    Too bad you'll never receive that option from any manufacturer.

    2
  • environment Environment Chinese nuclear reactor is completely meltdown-proof
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    Iirc, some SMR designs also have this property designed, though this is the very first I've heard of it actually being tested at scale.

    7
  • technology Technology How a North Korean Fake IT Worker Tried to Infiltrate Security Awareness Firm KnowBe4
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 92%

    The scam is that they are actually doing the work, getting paid well

    Listen. I know that there are some really shitty stuff going on in North Korea, and very real threats that their government is capable of, and it sucks for the people living there who have to do this work under threat of death.

    But if you say that "the scam" is they're doing work and receiving full pay for work done, I'm going to make fun of you. Oh no, someone outside of the West did work and was slightly less exploited by capital than usual in the process. Horror upon horror.

    12
  • memes Memes Never tire of winning
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    Most recently, other than Trump, George HW Bush lost the election while incumbent. Prior to that it was Jimmy Carter.

    The next most recent person to win the election but lose the popular vote was George W Bush, prior to that is was Harrison back in 1888.

    23
  • programmer_humor Programmer Humor Companies updating their websites
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    Please don't tell me you, unironically, actually use the Carmack rsqrt function in the year of our Linux Desktop 2024.

    Also if you like, you can write unsafe Rust in safe Rust instead.

    2
  • programmer_humor Programmer Humor Companies updating their websites
    Jump
  • OmnipotentEntity OmnipotentEntity 2 months ago 100%

    std::mem::transmute

    2
  • fuck_cars Fuck Cars G.M. Sold Millions of Cars That Were More Polluting Than Allowed, E.P.A. Says| The agency reached a settlement with the automaker over the sales of S.U.V.s and pickups that emitted excess CO₂
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    6 million cars, the fine is $140 million. That's $24 or so per car. There's no way that GM saved only $24/car doing this. So the fine is just a cost of doing business.

    EDIT:

    The company has also voluntarily retired about 50 million tons of carbon dioxide pollution credits, which are issued by the E.P.A. and used by auto companies to make it easier to comply with increasingly stringent federal tailpipe emissions standards. G.M. estimates the value of the loss of the credits at about $300 million, reflecting what it paid for them a decade or so ago. However, the market value of those carbon credits varies, and a more recent government estimate of $86 per credit would put the value at about $4.6 billion.

    This is probably where the actual sting to them is.

    18
  • memes Memes *Permanently Deleted*
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    Orb mommy 🔮🔮🔮🔮

    1
  • politics Politics Who Won The First Biden-Trump Presidential Debate [of 2024]?
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%
    1
  • memes Memes *Permanently Deleted*
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    (please attend to primaries next time...)

    So... should I have voted for Marianne Williamson or Dean Phillips, keeping in mind Dean Phillips formally withdrew from the race before my state's primary, and Marianne Williamson couldn't have won if she had sweeped every state after and including mine?

    I think the problem is mostly that the US system of elections is turbo mega fucked.

    1
  • news World News Israeli Attack on Rafah Tent Camp Kills Dozens, Wounds 50
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    In 2-3 days the New York Times is going to breathlessly report that Biden called up Netanyahu, scolded him, and gave him yet another ultimatum.

    9
  • environment Environment In Wyoming, Bill Gates moves ahead with nuclear project aimed at revolutionizing power generation
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    Solar attached to homes is not really a scalable solution on its own. For one thing, it's a massive liability for the utility. Power is produced on an as needed just in time fashion. Putting extra power onto the grid just means that the load is less predictable, and if the utility doesn't have storage, this extra power could be excess, and there isn't a convenient and safe way to dump persistent excess power on a grid level, and they can't phone you up to ask you to shut down your solar arrays either.

    This is why you see negative energy prices from time to time. Oversupply is a problem and it can wreck equipment.

    2
  • programming Programming Malicious VSCode extensions with millions of installs discovered
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    Not quite. Their "malicious" extension only got a few hundred installs. Using the data gathered by that extension and via other means they were able to locate other actually malicious extensions. Those total in the millions of installations.

    Through this process, they have found the following:

    1,283 with known malicious code (229 million installs).
    8,161 communicating with hardcoded IP addresses.
    1,452 running unknown executables.
    2,304 that are using another publisher's Github repo, indicating they are a copycat.
    
    7
  • technology Technology Adobe Announces That They Can Use Your Content for AI
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    To add, let's do some math!

    Let s be the total annual salary of every employee using Adobe. Our goal is to find the productivity ratio r such that changing to Gimp and open source more generally is a net positive from the standpoint of productivity and labor.

    s/r will be the total annual salary after changing over, because (for instance) if r = 0.8 then LTT will need to either hire or work his existing hires 1/0.8 times longer, giving (at best, ignoring overtime and so on) s/r as the new labor cost.

    We then subtract the current labor cost to get the switching cost s/r - s, and if this is greater than $10,000 then the switch is not worth it.

    For instance, let's say LTT employs 1 person at $50k/year. He's a bit of a skinflint. We solve for r and arrive at a ratio of 5/6 or 83.33%.

    If we have a different world where LTT hires 10 people and pays each of them $100k, we solve for r and get about 99%.

    In other words, the switch is worth it only if the labor cost is small, so the extra labor is not very expensive, or the difference between the two software is negligible.

    1
  • programmerhumor Programmer Humor Introducing Resuscitate
    Jump
  • OmnipotentEntity OmnipotentEntity 3 months ago 100%

    For those curious: Gothic 1.

    I've never heard of it before and it doesn't look like my type of game. Anyone played it?

    8
  • linux Linux KDE's Amarok 3.0 Music Player Released After Six Year Hiatus - Now Ported To Qt5
    Jump
  • OmnipotentEntity OmnipotentEntity 4 months ago 100%

    What about Elisa? I was under the (potentially mistaken) assumption that Elisa was the successor of Amarok.

    6
  • linux Linux If all kernel bugs are security bugs, how do you keep your Linux safe?
    Jump
  • OmnipotentEntity OmnipotentEntity 5 months ago 80%
    3
  • technology Technology Ask ChatGPT to pick a number between 1 and 100
    Jump
  • OmnipotentEntity OmnipotentEntity 5 months ago 100%

    A human made the graph

    10
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    I am sorryI am sorryI am sorryI...

    9
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    So like, it's really easy to armchair and just say that they should ignore the haters and so on, but having been on the opposite end of a small Internet hate mob, even if you only have like a dozen people telling you that you're a crook, or a piece of shit, or your stupid or dishonest, or whatever, it doesn't really matter how accurate any of that is, it really does start to get to you, no matter who you are.

    The only healthy option is to log out at that point.

    13
  • privacy Privacy Glassdoor Wants to Know Your Real Name
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    Wow, your name is my name too.

    3
  • fuck_cars Fuck Cars Hey remember wanting to be able to shop for a car online?
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%
    1
  • piracy Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ Is the SNES emulator Snes9x no longer trusted?
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    Most closely matches the behavior of actual SNES consoles.

    This requires very careful emulation of the timings of the various buses and co-processors, as well as on-cart chips which may or may not be present. For instance, a Speedy Gonzales game has a button in the final stage which crashes almost every emulator because enters an infinite loop reading from an open bus and waiting for the value to attain a specific pattern. However reading from an open bus is generally specified to be the last value loaded into the bus, which in this case is the load instruction itself, $18. So the value is read to be $1818 by most emulators, which doesn't match the pattern expected.

    However, this is only if you're emulating with instruction level accuracy. It is possible for the value of the bus to change in between the instruction being loaded and the value of the bus being loaded due to an HDMA load being triggered, but this requires a cycle accurate emulator.

    8
  • foss Free and Open Source Software I've been playing xonotic and DAMN is it fun
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    You may already know this, but Xonotic was forked from Nexiuz after the original code owner sold the GPLed code to some publisher to make a for pay game.

    6
  • programming Programming EBNF Grammar for ANSI C (+ Guide on reading EBNF)
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    Trigraphs are handled by the preprocessor, so if you're not handling that, then that's fine. Digraphs are handled by the tokenizer, however.

    1
  • programming Programming EBNF Grammar for ANSI C (+ Guide on reading EBNF)
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    Are digraphs and trigraphs deprecated?

    Did you reference the standard?

    2
  • memes Memes Hard earned
    Jump
  • OmnipotentEntity OmnipotentEntity 6 months ago 100%

    1001st, technically

    2
  • memes Memes I will use it until End
    Jump
  • OmnipotentEntity OmnipotentEntity 7 months ago 100%

    You give me hope.

    11
  • chat Chat Hi, bees! Outside of news and politics, what kind of topics would you like to see more on Beehaw?
    Jump
  • OmnipotentEntity OmnipotentEntity 7 months ago 100%

    https://online-go.com/user/view/109570

    Send me a friend request

    2
  • technology
    Technology OmnipotentEntity 7 months ago 100%
    Hallucination is Inevitable: An Innate Limitation of Large Language Models (arxiv preprint) https://arxiv.org/abs/2401.11817

    Abstract: Hallucination has been widely recognized to be a significant drawback for large language models (LLMs). There have been many works that attempt to reduce the extent of hallucination. These efforts have mostly been empirical so far, which cannot answer the fundamental question whether it can be completely eliminated. In this paper, we formalize the problem and show that it is impossible to eliminate hallucination in LLMs. Specifically, we define a formal world where hallucina- tion is defined as inconsistencies between a computable LLM and a computable ground truth function. By employing results from learning theory, we show that LLMs cannot learn all of the computable functions and will therefore always hal- lucinate. Since the formal world is a part of the real world which is much more complicated, hallucinations are also inevitable for real world LLMs. Furthermore, for real world LLMs constrained by provable time complexity, we describe the hallucination-prone tasks and empirically validate our claims. Finally, using the formal world framework, we discuss the possible mechanisms and efficacies of existing hallucination mitigators as well as the practical implications on the safe deployment of LLMs.

    103
    37
    gaming
    Gaming OmnipotentEntity 7 months ago 100%
    Ur-Quan Masters released on Steam (for free) store.steampowered.com

    You might know the game under the name Star Control 2. It's a wonderful game that involves wandering around deep space, meeting aliens, and navigating a sprawling galaxy while trying to save the people of Earth, who are being kept under a planetary shield.

    53
    5
    support
    Beehaw Support OmnipotentEntity 1 year ago 100%
    Please add a redirect from the www. subdomain 🐝

    Sometimes, because I am ancient, I automatically type in www. before I type in beehaw.org into my address bar. It would be nice and comfy to have that give a CNAME redirect instead of just completely failing to DNS resolve.

    44
    4
    news
    World News OmnipotentEntity 1 year ago 99%
    Missing Titan submersible is operated by a cheap game controller https://videogames.si.com/news/missing-sub-gamepad-controller

    > the Logitech F710 is a solid controller to get if you’re on a tight budget, but perhaps not exactly the type of equipment you want to stake your life on. [...] Reviewers on sites like Amazon frequently mention issues with the wireless device's connection. > The reporter, who followed an expedition of the Titan from the launch ship, wrote that “it seems like this submersible has elements of MacGyver jerry-riggedness.”

    143
    103