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

help-circle







  • It’s insane to me how stock prices are basically entirely disconnected from how a company is performing and are dictated by stock market buying and selling pressures.

    You could pick literally any publicly traded company and make its stock price soar just by convincing enough people to buy it, with no relation whatsoever to how the company is performing or forecasted to perform. See: GameStop.

    Nvidia tanked because a bunch of people sold Nvidia stock. Full stop. They may have been motivated by news of deepseek or whatever, but that’s not what moved the stock price. Had no one sold it would’ve stayed exactly where it was.

    Frankly baffling that anyone can look at it and think “yes, this is how it should work and I don’t see any problems with it.”


  • Counter point: The removal of your desktop environment should not under any circumstances be within the possibility space of side effects for trying to install a common piece of desktop software, regardless of the warnings provided or confirmations required.

    This was an issue with the OS, and the Pop_OS! team fixed it in an update very soon after this. A month earlier or later and Linus would not have encountered it.



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