Skip Navigation
Why I Prefer Exceptions to Error Values
  • 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

  • Highest-resolution black hole images ever taken usher in a new era
  • 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 θ

  • Why Anti-Authoritarians Are Diagnosed as Mentally Ill
  • 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.

  • Highest-resolution black hole images ever taken usher in a new era
  • No, I just understand math. So yes.

  • Highest-resolution black hole images ever taken usher in a new era
  • 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.

  • Game Dependency Graph of The Curse of Monkey Island (LucasArts, 1997)
  • If you are taking requests, I am curious how ridiculous The Longest Journey would be.

  • Mongolian officials "have the obligation" to arrest Vladimir Putin if he visits the country next week, the International Criminal Court (ICC) says
  • I would be impressed if they risk it. Literally half of Mongolia's population resides in their capital city Ulaanbaatar. If a country bordering Russia were to arrest the sitting Russian president and turn him over to Copenhagen then there's a non-zero possibility of a retaliatory airstrike on the capital, destroying their only major city and killing a significant percentage of the entire country's population.

  • Removed
    Biden-Harris Admin Quickly Staffs DOJ Ahead of Election
  • 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.

  • Removed
    Conservative kid know a lot this days 🧒
  • No one tell OP that the ml in lemmy.ml is for Marxist Leninists.

  • US senators claim car makers sold driver data for pennies
  • Too bad you'll never receive that option from any manufacturer.

  • Chinese nuclear reactor is completely meltdown-proof
  • 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.

  • How a North Korean Fake IT Worker Tried to Infiltrate Security Awareness Firm KnowBe4
  • 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.

  • Never tire of winning
  • 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.

  • Companies updating their websites
  • 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.

  • Companies updating their websites
  • std::mem::transmute

  • 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₂
  • 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.

  • Hallucination is Inevitable: An Innate Limitation of Large Language Models (arxiv preprint)

    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.

    42
    Avoiding fusion plasma tearing instability with deep reinforcement learning
    www.nature.com Avoiding fusion plasma tearing instability with deep reinforcement learning - Nature

    Artificial intelligence control is used to avoid the emergence of disruptive tearing instabilities in the magnetically confined fusion plasma in the DIII-D tokamak reactor.

    Avoiding fusion plasma tearing instability with deep reinforcement learning - Nature
    1
    Ur-Quan Masters released on Steam (for free)
    store.steampowered.com Free Stars: The Ur-Quan Masters on Steam

    Experience the award-winning space saga. Travel to hyperspace, discover alien worlds, and meet an eclectic cast of characters. Find out what happened after the Ur-Quan invasion. And if the war still rages, fight for Earth and the Alliance of Free Stars!

    Free Stars: The Ur-Quan Masters on Steam

    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.

    5
    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.

    0
    POOM - A Pico8 Doom port
    cohost.org This ain't your usual Doom port

    MEET POOM Hi everybody. Meet POOM [https://freds72.itch.io/poom]. It's not your everyday Doom port. It's one of the most bonkers takes on the game I have seen in a while. Join me as I briefly gush about how good this thing is. (obligatory: 56k warning, here be gifs aplenty; one of them has a bit o...

    1
    Missing Titan submersible is operated by a cheap game 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.”

    4
    OmnipotentEntity OmnipotentEntity @beehaw.org
    Posts 10
    Comments 174