• 1 Post
  • 51 Comments
Joined 2 years ago
cake
Cake day: July 4th, 2023

help-circle




  • 18107@aussie.zonetoAsklemmy@lemmy.mlWhy has there not been a third attempt?
    link
    fedilink
    English
    arrow-up
    18
    arrow-down
    1
    ·
    1 month ago

    Trump is not what’s causing most of the issues in America. He may be a loose cannon and making everything worse, but the real damage is coming from a few very rich people bribing government officials to change laws, and they’ve been doing this for a long time.

    Even if you killed every person who made the system this bad, you’d still be left with a system designed to oppress the masses and make rich people richer. Assassinations aren’t a silver bullet (unless made of silver).





  • 18107@aussie.zonetoAsklemmy@lemmy.mlWhat’s your ultimate unpopular opinion?
    link
    fedilink
    English
    arrow-up
    23
    arrow-down
    3
    ·
    3 months ago

    Abortion should be mandatory.

    People keep arguing over whether abortion should be legal or not, but my opinion is that it should be forced on everyone whether they want it or not. Late term abortions up to 100 years after birth should also be considered for inclusion in this rule.

    One of my favourite activities is finding controversial opinions, then taking an opinion so extreme that it makes everyone else look like a centrist.



  • I wanted to install an extra hard drive in my computer, but the power supply didn’t have enough connectors. I actually had a spare power supply unit, but upon testing, the 24 pin cable was too short to reach the motherboard.

    I ended up using both PSUs. Only one had a power switch on it, so that was connected to the hard drives. I had to use a paperclip in the unused 24 pin connector to make it output power. The 2 PSUs had a wire running between the ground pins of a random unused connector, and they were on the same phase circuit.

    The hard drive PSU had to be turned on first at the switch. Once that was on, I could press the power button to turn on the computer. I think I used it for about a year before buying enough upgrade parts to effectively replace the entire computer.




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

    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