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/)R
Posts
24
Comments
120
Joined
3 yr. ago

  • Oh man I loved my PSP back in the day, I played a ton in it. I had a modded one and I also installed PSX and GBA emulators.

    I remember that when I bought it, it came already modded but it wasn't a permanent mod. To activate the mod after rebooting I had to navigate to the images folder and load up a PNG (I think?) image that was called Chicken or something like that. The most annoying part was that it didn't work consistently, so often times it would cause the console to hang and I had to try again. It always blew my mind how an image could trigger the hack like that, looking back I guess it was a malicious payload or something and some race condition somewhere idk.

    If I remember correctly, after a couple years I was able to change the mod to a permanent one. I sold it like 10 years ago

  • Came here to say this

  • "Exploiting immigrants to deliver food"

    • One flew over the cuckoo's nest
    • Aftersun
    • The father
    • Manchester by the sea
    • Million dollar baby
  • Yeah, but back then no work, no responsibilities, friends not busy all the time...

  • Go

    Now I'm behind by 1 day, will try to catch up.

    For part 2 I spent a good while thinking about it, then when I convinced myself my plan could work, struggled a bit with the implementation. But it worked in the end. Basically grid[i][j] is how many different ways you can reach a cell. Start at 1 on the S cell, then propagate the values down and keep adding up the nums when you reach cells through different paths. The answer is the sum of the nums in the last row.

     
        
    func part2() {
    	// file, _ := os.Open("sample.txt")
    	file, _ := os.Open("input.txt")
    	defer file.Close()
    	scanner := bufio.NewScanner(file)
    
    	input := [][]rune{}
    
    	for scanner.Scan() {
    		line := []rune(scanner.Text())
    		input = append(input, line)
    	}
    
    	m := len(input)
    	n := len(input[0])
    	grid := make([][]int, m)
    	for i := range m {
    		grid[i] = make([]int, n)
    	}
    
    	for i := range m {
    		for j := range n {
    			c := input[i][j]
    			if i == 0 {
    				if c == 'S' {
    					grid[i][j] = 1
    				}
    				continue
    			}
    			if c == '^' {
    				grid[i][j-1] += grid[i-1][j]
    				grid[i][j+1] += grid[i-1][j]
    			} else {
    				grid[i][j] = grid[i][j] + grid[i-1][j]
    			}
    		}
    	}
    
    	paths := 0
    	for j := range n {
    		paths += grid[m-1][j]
    	}
    
    	fmt.Println(paths)
    }
    
      
  • Go

    Part 2: Read the whole input in a rune matrix. Scan it column by column, store the numbers as you go, ignoring all spaces, and store the operand when you find it. When you hit an empty column or the end, do the operation and add it to the total.

     
        
    func part2() {
    	// file, _ := os.Open("sample.txt")
    	file, _ := os.Open("input.txt")
    	defer file.Close()
    	scanner := bufio.NewScanner(file)
    
    	chars := [][]rune{}
    	for scanner.Scan() {
    		chars = append(chars, []rune(scanner.Text()))
    	}
    
    	m := len(chars)
    	n := len(chars[0])
    	var op rune
    	nums := []int{}
    	total := 0
    
    	for j := range n {
    		current := []rune{}
    		for i := range m {
    			if chars[i][j] == '+' || chars[i][j] == '*' {
    				op = chars[i][j]
    			} else if chars[i][j] != ' ' {
    				current = append(current, chars[i][j])
    			}
    		}
    		if len(current) > 0 {
    			x, _ := strconv.Atoi(string(current))
    			nums = append(nums, x)
    		}
    		if len(current) == 0 || j == n-1 {
    			result := 0
    			if op == '*' {
    				result = 1
    			}
    			for _, x := range nums {
    				if op == '+' {
    					result = result + x
    				} else {
    					result = result * x
    				}
    			}
    			total += result
    			nums = []int{}
    		}
    	}
    
    	fmt.Println(total)
    }
    
      
  • First I tried to to part 2 with a very poor regex strategy and the performance was abysmal. Switched to plain substrings and boom, instant result.

    Golang

     
        
    func part1() {
    	ranges := readInput()
    	invalidSum := 0
    
    	for _, r := range ranges {
    		parts := strings.Split(r, "-")
    		start, _ := strconv.Atoi(parts[0])
    		end, _ := strconv.Atoi(parts[1])
    
    		for num := start; num <= end; num++ {
    			current := strconv.Itoa(num)
    			n := len(current)
    			if n%2 != 0 {
    				continue
    			}
    			left := current[:n/2]
    			right := current[n/2:]
    			if left == right {
    				invalidSum += num
    			}
    		}
    	}
    
    	fmt.Println(invalidSum)
    }
    
    func part2() {
    	ranges := readInput()
    	invalidSum := 0
    
    	for _, r := range ranges {
    		parts := strings.Split(r, "-")
    		start, _ := strconv.Atoi(parts[0])
    		end, _ := strconv.Atoi(parts[1])
    
    		for num := start; num <= end; num++ {
    			current := strconv.Itoa(num)
    			n := len(current)
    
    			for index := 1; index <= n/2; index++ {
    				if n%index != 0 {
    					continue
    				}
    
    				left := 0
    				right := index
    				prefix := current[left:right]
    				isRepeated := true
    				for left < n && right < n {
    					left = right
    					right = right + index
    					next := current[left:right]
    					if next != prefix {
    						isRepeated = false
    						break
    					}
    				}
    
    				if isRepeated {
    					invalidSum += num
    					break
    				}
    			}
    		}
    	}
    
    	fmt.Println(invalidSum)
    }
    
      
  • Golang

     go
        
    func part1() {
    	// file, _ := os.Open("sample.txt")
    	file, _ := os.Open("input.txt")
    	defer file.Close()
    
    	scanner := bufio.NewScanner(file)
    	n := 100
    	current := 50
    	pointingAt0 := 0
    
    	for scanner.Scan() {
    		line := scanner.Text()
    		num, _ := strconv.Atoi(line[1:])
    		if line[0] == 'L' {
    			current = ((current-num)%n + n) % n
    		} else {
    			current = (current + num) % n
    		}
    		if current == 0 {
    			pointingAt0++
    		}
    	}
    
    	fmt.Println(pointingAt0)
    }
    
    func part2() {
    	// file, _ := os.Open("sample.txt")
    	file, _ := os.Open("input.txt")
    	defer file.Close()
    
    	scanner := bufio.NewScanner(file)
    	n := 100
    	current := 50
    	pointingAt0 := 0
    
    	for scanner.Scan() {
    		line := scanner.Text()
    		num, _ := strconv.Atoi(line[1:])
    
    		rounds := num / n
    		pointingAt0 += rounds
    		num = num % n
    		new := -1
    
    		if line[0] == 'L' {
    			new = ((current-num)%n + n) % n
    			if current != 0 && (new > current || new == 0) {
    				pointingAt0++
    			}
    		} else {
    			new = (current + num) % n
    			if current != 0 && (new < current || new == 0) {
    				pointingAt0++
    			}
    		}
    
    		current = new
    	}
    
    	fmt.Println(pointingAt0)
    }
    
      
  • Ohh so it was possible to use floats for this! I was "worried" that it would lead to precision errors haha so I ended up "cheating" with BigInt (Golang) to make all the multiplications first and one division at the end

  • Deleted

    Permanently Deleted

    Jump
  • Borges mentioned. Amazing writer.

  • I've seen Strawberry mentioned a lot but I'm definitely not a fan of its looks haha. Gapless on the other hand looks pretty sleek. It's a bit less intuitive perhaps but I might give it a shot

  • Thanks for this tip also, will check it out

  • Quod Libet looks great, thanks! Probably going to go with this one. Looks pretty similar to Rhythmbox and also does #3 from my list

  • Seems promising, thanks! I don't care about song position, just that it remembers which song.

  • Open Source @lemmy.ml

    Looking for music player in Linux

  • Oh man good memories from Simpsons Hit & Run, this is awesome!

  • Just pointing out that these 2 are not necessarily contradicting statements. Just because it hasn't taken any jobs yet, doesn't mean it won't take any in the next 10 years. Not that I really want to believe those numbers though. But yeah as others have pointed out, these studies need to be taken with a grain of salt.

  • Privacy @lemmy.ml

    AI wearables are quietly listening to everyone in Silicon Valley

    sfstandard.com /2025/08/05/ai-wearables-recording-devices/
  • Programmer Humor @programming.dev

    Seems someone out there is really mad about memory safety

  • Dumbphones @lemmy.world

    Phones used to have style

    imgur.com /gallery/2000s-all-forgotten-phones-had-quirks-class-kKkcWIq
  • Golang @programming.dev

    A 10x Faster TypeScript - MS is porting the compiler in Go

    devblogs.microsoft.com /typescript/typescript-native-port/
  • Comic Strips @lemmy.world

    This much nothing

  • Dumbphones @lemmy.world

    Olauncher - Minimal AF Launcher

    github.com /tanujnotes/Olauncher
  • Games @lemmy.world

    Shigeru Miyamoto comments on AI, says "Nintendo would rather go in a different direction"

    nintendoeverything.com /shigeru-miyamoto-comments-on-ai-says-nintendo-would-rather-go-in-a-different-direction/
  • Dumbphones @lemmy.world

    Academic paper on dumbphone adoption

    acris.aalto.fi /ws/portalfiles/portal/142144861/Swapping_5G_for_3G_-_Motivations_Experiences_and_Implications_of_Contemporary_Dumbphone_Adoption.pdf
  • Memes @lemmy.ml

    Smile!

  • Football (migrated to football@sopuli.xyz) @lemmy.world

    Bochum avoids relegation in epic playoff comeback against Düsseldorf

  • Privacy @lemmy.ml

    Got annoyed by my gym

  • Dumbphones @lemmy.world

    The Dumbphone Boom Is Real

    www.newyorker.com /culture/infinite-scroll/the-dumbphone-boom-is-real
  • Programmer Humor @lemmy.ml

    Sometimes you really need that vodka shot when things go wrong in the database

  • Programmer Humor @lemmy.ml

    Windows95Man to represent Finland in Eurovision. Linus Torvalds must be so disappointed

  • retrocomputing @lemmy.sdf.org

    Actually had to use this old friend at work the other day

  • Privacy @lemmy.ml

    The AirDrop flaw exploited by China, explained

    blog.cryptographyengineering.com /2024/01/11/attack-of-the-week-airdrop-tracing/
  • Privacy @lemmy.ml

    PhD thesis on mass surveillance (and strategies to counter it)

    research.tue.nl /en/publications/communication-in-a-world-of-pervasive-surveillance-sources-and-me
  • Games @lemmy.world

    Games with graphics resembling PS1 or PS2?

  • Programmer Humor @lemmy.ml

    Living the dream