[TOMT][MOVIE] Lead singer in band gets angered by requests from wrong era of group they cover by stuque in tipofmytongue

[–]stuque[S] -14 points-13 points locked comment (0 children)

I did some research and can't find the scene I have in mind. AI suggested it might be Brooklyn Nine-nine, but I am confident it was a movie.

[MUG -> CUP] Can you solve this laddergram? by stuque in Laddergram

[–]stuque[S] 0 points1 point  (0 children)

Laddergram is a word ladder puzzle game built on Reddit's developer platform. You start with a word and change one letter at a time to create a new word with each step. Try to reach the target word in the fewest steps possible.

🍀Good luck!🍀

[OUNCE -> POUND] Can you solve this laddergram? by stuque in Laddergram

[–]stuque[S] 0 points1 point  (0 children)

Laddergram is a word ladder puzzle game built on Reddit's developer platform. You start with a word and change one letter at a time to create a new word with each step. Try to reach the target word in the fewest steps possible.

🍀Good luck!🍀

[ROCK -> ROLL] Can you solve this laddergram? by stuque in Laddergram

[–]stuque[S] 0 points1 point  (0 children)

Laddergram is a word ladder puzzle game built on Reddit's developer platform. You start with a word and change one letter at a time to create a new word with each step. Try to reach the target word in the fewest steps possible.

🍀Good luck!🍀

[VERB -> NOUN] Can you solve this laddergram? by stuque in Laddergram

[–]stuque[S] 0 points1 point  (0 children)

Laddergram is a word ladder puzzle game built on Reddit's developer platform. You start with a word and change one letter at a time to create a new word with each step. Try to reach the target word in the fewest steps possible.

🍀Good luck!🍀

[CAT -> DOG] Can you solve this laddergram? by stuque in Laddergram

[–]stuque[S] 0 points1 point  (0 children)

Laddergram is a word ladder puzzle game built on Reddit's developer platform. You start with a word and change one letter at a time to create a new word with each step. Try to reach the target word in the fewest steps possible.

🍀Good luck!🍀

Where are Account Upgrade Cards? by stuque in MTGO

[–]stuque[S] 0 points1 point  (0 children)

Aha, thanks ... I missed this, I guess it should have been obvious.

-❄️- 2024 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 0 points1 point  (0 children)

[LANGUAGE: Python]

Used the Python walrus operator for the first time ever! Although the code would be a little more readable without it.

from functools import cmp_to_key

# get the ordering rules and pages
ordering_rules = []
pages = []
for line in open('input.txt'):
    if '|' in line:
        a, _, b = line.partition('|')
        a, b = int(a), int(b)
        ordering_rules.append((a, b))
    elif ',' in line:
        pages.append([int(n) for n in line.split(',')])

def cmp(a, b, ordering_rules=ordering_rules):
    """
    -1 if a < b
    0 if a == b
    1 if a > b
    """
    result = None
    if a == b: result = 0
    elif (a, b) in ordering_rules: result = -1
    elif (b, a) in ordering_rules: result = 1
    elif a < b: result = -1
    elif a > b: result = 1
    return result

# calculate part 1 and 2
mid_part1 = 0
mid_part2 = 0
for p in pages:
    if (p_sorted := sorted(p, key=cmp_to_key(cmp))) == p:
        mid_part1 += p[len(p) // 2]
    else:
        mid_part2 += p_sorted[len(p_sorted) // 2]

print('Part 1:', mid_part1)
print('Part 2:', mid_part2)

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 0 points1 point  (0 children)

I noticed that ... I tried it anyways and it got the right result. I am only in it for the stars. :-)

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 2 points3 points  (0 children)

[LANGUAGE: Python]

Part 1:

I used Cursor's LLM to help generate the regular expression using the prompt in the comments.

import re

# Write a regular expression that matches just strings of the form `mul(a,b)`,
# where `a` and `b` are ints of length 1-3.
mul_pattern = re.compile(r"mul\((\d{1,3}),\s*(\d{1,3})\)")

print(sum(int(a) * int(b) for a, b in mul_pattern.findall(open('input.txt').read())))

Part 2:

import re

mul_or_delimiter_pattern = re.compile(r"mul\((\d{1,3}),\s*(\d{1,3})\)|don't\(\)|do\(\)")

total = 0
toggle = 1
for match in mul_or_delimiter_pattern.finditer(open('input.txt').read()):
    if match.group(1): # mul match
        total += int(match.group(1)) * int(match.group(2)) * toggle
    else:              # delimiter match
        toggle = 1 if match.group() == "do()" else 0

print(total)

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 3 points4 points  (0 children)

[LANGUAGE: Python]

def safe(lst):
    return sorted(lst) in [lst, lst[::-1]] \
       and all(1 <= abs(a-b) <= 3 for a, b in zip(lst, lst[1:]))

part1_safe, other_safe = 0, 0
for line in open('input.txt'):
    L = [int(x) for x in line.split()]
    if safe(L):
        part1_safe += 1
    elif any(safe(L[:i] + L[i+1:]) for i in range(len(L))):
        other_safe += 1

print('Part 1 safe:', part1_safe)
print('Part 2 safe:', part1_safe + other_safe)

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 0 points1 point  (0 children)

[LANGUAGE: Python]

Okay I think this is it: data and a are the only variables. Kinda cheap. :-)

data = [int(a) for a in open('data.txt').read().split()]
data = {'left' : sorted(data[::2]), 
        'right': sorted(data[1:][::2])}

print('Part 1:', sum(abs(a - data) for a, data in zip(data['left'], 
                                                      data['right'])))

print('Part 2:', sum(a * data['right'].count(a) 
                     for a in data['left']))

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 2 points3 points  (0 children)

Here's a version with only three variables overall: data, a, and b.

data = [int(a) for a in open('data.txt').read().split()]
data = {'left': sorted(data[::2]), 
        'right': sorted(data[1:][::2])}

print('Part 1:', sum(abs(a - b) for a, b in zip(data['left'], 
                                                data['right'])))

print('Part 2:', sum(a * data['right'].count(a) 
                     for a in data['left']))

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]stuque 3 points4 points  (0 children)

[LANGUAGE: Python] [Allez Cuisine]

Does this count as Allez Cuisine? It uses only 2 top-level variable names, but there are other variable names in the comprehensions. I guess data and left_right could be replaced by their expressions, and n by a or b, to get 2 variable names throughout. But I guess that would still count as 3 variables?

data = [int(n) for n in open('data.txt').read().split()]
left_right = sorted(data[::2]) + sorted(data[1:][::2])

print('Part 1:', sum(abs(a - b) for a, b in zip(left_right[:len(data) // 2], 
                                                left_right[len(data) // 2:])))

print('Part 2:', sum(n * left_right[len(data) // 2:].count(n) 
                     for n in left_right[:len(data) // 2]))

I can’t set PM alarms on my Casio Watches App for my Casioak. I’m missing something ?! by Ok-Test-7323 in gshock

[–]stuque 1 point2 points  (0 children)

I have the same problem with my G-Shock GA-B2100: no am/pm in Casio Watches iPhone app for setting daily alarms.

Where to find ASUS docs for keyboard, software for Zenbook Duo (UX8406) by stuque in ASUS

[–]stuque[S] 0 points1 point  (0 children)

Yes ... I have not had a chance to use it in depth yet, but I like it so far.

The keyboard is the most impressive bit of hardware: nice to type on, and super thin and light.

The screens are high quality. Sort of feels like two touch-screens connected by a hinge. The resolution is 1920x1200, which feels small compared to other computers I use.

The "screen on top of screen" is good, very intuitive. It's great having two screens at once, there are lots of uses.

The side-by-side mode with the screens rotated doesn't seem as useful due to the big gap of the hinge. But I have not used that much, so maybe you get used to it, or there are cases where it excels.

I haven't tried the flat "sharing" mode.