• 5 Posts
  • 225 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle

  • It’s the capability of a program to “reflect” upon itself, I.E. to inspect and understand its own code.

    As an example, In C# you can write a class…

    public class MyClass
    {
        public void MyMethod()
        {
            ...
        }
    }
    

    …and you can create an instance of it, and use it, like this…

    var myClass = new MyClass();
    myClass.MyMethod();
    

    Simple enough, nothing we haven’t all seen before.

    But you can do the same thing with reflection, as such…

    var type = System.Reflection.Assembly.GetExecutingAssembly()
        .GetType("MyClass");
    
    var constructor = type.GetConstructor(Array.Empty<Type>());
    
    var instance = constructor.Invoke(Array.Empty<Object>());
    
    var method = type.GetMethod("MyMethod");
    
    var delegate = method.CreateDelegate(typeof(Action), instance);
    
    delegate.DynamicInvoke(Array.Empty<object>());
    

    Obnoxious and verbose and tossing basically all type safety out the window, but it does enable some pretty crazy interesting things. Like self-discovery and dynamic loading of plugins, or self-configuration of apps. Also often useful when messing with generics. I could dig up some practical use-cases, if you’re curious.






  • I think the big reasons for most people boil down to one or both of two things:

    A) People having 0 trust in Google. I.E. people do not believe that paying for their services will exempt them from being exploited, so what’s the point?

    B) YouTube’s treatment of its content creators. Which are what people actually come to YouTube for. Advertisers and copyright holders (and copyright trolls) get first-class treatment, while the majority of content creators get little to no support for anything.






  • JakenVeina@lemm.eetoMemes@lemmy.mlI hate these icons
    link
    fedilink
    English
    arrow-up
    21
    arrow-down
    1
    ·
    1 month ago

    Anyone else this there’s actually nothing at all wrong with the “New” row of icons? Except for the triangle one, which is terrible in its “Original” version as well, as it indicates absolutely nothing about its app (I believe it’s Google Drive, right?). All the rest are clearly distinguishable, and have relevance to what the app does.







  • Don’t take this the wrong way, but this made me bust out laughing…

    When you hold stock, don’t you need to sell it/liquidate it in order to make money?

    Boy, if that isn’t just a perfect example of the perversion of our economic system. “You can’t make ACTUAL money with it, you can only make money by participating the meta gambling game.”

    No, stock entitles you to dividends, which is just a fancy way of saying “a share of the profits”. Like, a company brings in A amount of money (gross income) in a year, spends B of that on payroll and whatnot (expenses), maybe puts away C of that into a savings or spending account, and everything that’s left, D, gets given to the owners. If you have stock in the company, that’s you.

    Of course, dividends are generally very small (like, think savings interest) compared to what you can make trading and speculating, so it’s never good enough for the rich.

    It’s also rather common for companies to pay no dividends, because they just put all the leftover money into C. Which isn’t even necessarily bad, it’s generally built on the idea that keeping the money in the company will give the company more room for growth, I.E. raising the stock price, with the assumption that that will be worth more than the dividends may have been. But for so many companies, that just never ends. Sooner or later, the growth won’t be sustainable, and many companies just collapse under their own weight, leaving the stock worthless.