• 0 Posts
  • 143 Comments
Joined 2 years ago
cake
Cake day: June 26th, 2023

help-circle


  • vithigar@lemmy.catoProgrammer Humor@lemmy.mlWhat the F#
    link
    fedilink
    arrow-up
    2
    arrow-down
    1
    ·
    5 days ago

    i is still a value type, that never changes. Which highlights another issue I have with the explanation as provided. Using the word “reference” in a confusing way. Anonymous methods capture their enclosing scope, so i simply remains in-scope for all calls to those functions, and all those functions share the same enclosing scope. It never changes from being a value type.







  • C# .NET using reflection, integer underflow, and a touch of LINQ. Should work for all integer types. (edit: also works with char values)

    // this increments i
    private static T Increment<T>(T i)
    {
        var valType = typeof(T);
        var maxField = valType.GetField("MaxValue");
        var minField = valType.GetField("MinValue");
        if (maxField != null)
        {
            T maxValue = (T)maxField.GetValue(i);
            T minValue = (T)minField.GetValue(i);
    
            var methods = valType.GetTypeInfo().DeclaredMethods;
            var subMethod = methods.Where(m => m.Name.EndsWith("op_Subtraction")).First();
                   
            T interim = (T)subMethod.Invoke(
                null,
                [i, maxValue]);
    
            return (T)subMethod.Invoke(
                null, 
                [interim, minValue]);
        }
        throw new ArgumentException("Not incrementable.");
    }
    


  • I’m the primary developer for a third party tool for Elite Dangerous and this is basically my entire thought process when I want to work on it.

    I could work on Observatory…

    Or I could play some Elite…

    Or I could just stare at my screen ineffectually for several hours.

    Staring at the screen wins frighteningly often.






  • I don’t even understand the appeal for either of the involved parties. I don’t want things in or around my asshole, nor do I want any involvement with those of others. For reasons that completely elude me there seems to have been a cultural shift during my life from butt stuff being deviant behavior and fodder for jokes to almost a default expectation.

    I don’t actually believe that it is a common expectation in real life dating between actual non-terminally-online people, but it certainly seems to be portrayed as such.


  • I’m not sure where I argued to the contrary. The ships in Trek with self-destruct capabilities are all military (or pseudo-military) vessels that are explained as literally having a procedure such as you describe.

    In the preferred configuration, the starship undergoes rapid vaporization from thermal and mechanical shock caused by a deliberate release of warp engine reactants. Remote computer system decryption algorithms generate one final set of cascade failure commands, and all engine safety interlocks are compromised. Matter from the primary deuterium tankage and the total supply of antimatter from the storage pods on Deck 42 are expelled simultaneously, producing an energy release on the order of 10^15 megajoules.

    If the command links to the engine systems are severed, the secondary destruct system is automatically selected. Ordnance packages are located at key locations around the vehicle, including the antimatter storage pods. These are detonated in concert with intentional overloads of all fusion reaction chambers. The release yield of the secondary system is calculated to be 10^9 megajoules. The secondary destruct system becomes the primary system for the Saucer Module in Separated Flight Mode.



  • Most of your suggestions require working engines. Shaking the ship apart might make the ship itself unusable but doesn’t do anything about on board equipment or intel. A “scuttling” equivalent needs to work when the ship is mostly, or even completely, non-functional, and needs to either destroy everything aboard or make it not worth the effort of recovery.


  • The value proposition of satellite radio is so incredibly bad for the overwhelming majority of people I don’t understand how they’re still in business.

    Also the quality is awful. If I wanted audible compression artifacts I could dust off my late 90s mp3 collection.