Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)
Posts
3
Comments
244
Joined
2 yr. ago

Permanently Deleted

Jump
  • I decided to use NAND instead of NOR, but it's effectively the same thing.

    Scala:

     scala
        
    //main
    @main
    def main(): Unit =
      var i = 15 //Choose any number here
      i = add(i, 1) //this increments i
      println(i)
    
    //Adds 2 numbers in the most intuitive way
    def add(a: Int, b: Int): Int =
      val pairs = split(a).zip(split(b))
      val sumCarry = pairs.scanLeft(false, false)((last, current) => fullAdder(current._1, current._2, last._2))
      return join(sumCarry.map(_._1).tail.reverse)
    
    //Converts an integer to a list of booleans
    def join(list: Seq[Boolean]): Int = BigInt(list.map(if (_) '1' else '0').mkString, 2).toInt
    
    //Converts a list of booleans to an integer
    def split(num: Int): Seq[Boolean] = num.toBinaryString.reverse.padTo(32, '0').map(_ == '1')
    
    //Adds 2 booleans and a carry in, returns a sum and carry out
    def fullAdder (a: Boolean, b: Boolean, c: Boolean): (Boolean, Boolean) =
      (NAND(NAND(NAND(NAND(a, NAND(a, b)), NAND(NAND(a, b), b)), NAND(NAND(NAND(a, NAND(a, b)), NAND(NAND(a, b), b)), c)), NAND(NAND(NAND(NAND(a, NAND(a, b)), NAND(NAND(a, b), b)), c), c)), NAND(NAND(NAND(NAND(a, NAND(a, b)), NAND(NAND(a, b), b)), c), NAND(a, b)))
    
    //The basis for all operations
    def NAND(a: Boolean, b: Boolean): Boolean = !a || !b
    
      

    EDIT: replaced Integer.parseInt with BigInt(...).toInt to fix NumberFormatException with negative numbers.

    try it online here

  • LocalSend. File transfer between any devices with (almost) any OS over LAN. No account required. The best file transfer app I've ever encountered by far.

    StreetComplete. Get motivated to go outside with quests to help complete OpenStreetMaps. Surprisingly addictive. Requires an OpenStreetMaps account.

    f.lux. Remove the blue light from your computer monitor in the evening to help you fall asleep more easily. Redshift. As above. Not quite as good, but works on some OS/System configurations that f.lux can't handle.

    Pulsar. A community version of the discontinued Atom text editor. Highly extendable and configurable. Great for small programming tasks or opening text files with an obscure syntax. Has most of the packages built for Atom.

    Home Assistant. For automating your house and more (controlling smart lights and appliances, monitoring solar panel output, weather forecasts, printer diagnostics, delivery tracking...). A dedicated device (Raspberry Pi, old laptop) is highly recommended. A bit of a learning curve, but hard to live without after using it.

  • There is a difference between climate concern, where you desperately want to do anything to fix the climate problems, and climate anxiety, where you are so overwhelmed by the climate issues that it interferes with your ability to take any action.

    I suspect this study is focusing only on the latter.

  • Be aware that an underpowered or stuck stepper motor can "skip", causing the position data to be incorrect.

    A servo motor has active feedback, so doesn't have this issue. Servos do have their own drawbacks too, so they are not always a suitable replacement.

  • You can always try Linux risk free in a virtual machine like VirtualBox.

    If you like what you see, and you have any valuable data backed-up, you can try dual booting. That way you get to use Linux as your primary operating system, but can switch back and forth as much as needed.

    I found I was dual booting Windows and Linux for over 3 years before I was comfortable enough to stop using Windows entirely. Switching to Linux doesn't have to be an all-or-nothing approach. You can take it as slow as you want.

  • If you are worried, a qualified medical practitioner is always more reliable than a web forum.

    Insufficient or poor quality sleep can cause problems with attention and memory, and can exacerbate existing conditions.

    Poor sleep could be caused by a medical condition (sleep apnoea), or psychological (stress). Often stress can be hard to identify, particularly if it's long term stress.

    Again, this might not be your problem, and finding the right doctor who actually listens to you is important. Don't be afraid to try more than 1 doctor if the first makes you uncomfortable.

  • Listen to the safety briefing. They wouldn't bother telling you if it wasn't important.

    Keep your seatbelt on for the entire flight. The pilots can't always predict turbulence, and hitting the ceiling hurts.