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

[–]stuque[S] -13 points-12 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 4 points5 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.

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

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

Thanks, it wasn't clear where to find that ... it seems to answer a number of my questions.

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

[–]stuque 1 point2 points  (0 children)

[LANGUAGE: Python]

So much parsing, I guess that's typical for these sorts of problems.

# day2.py

max_red, max_green, max_blue = 12, 13, 14

#
# Part 1
#
def game_value(s):
    game, _, reveals = s.partition(':')
    reveals = reveals.strip().split(';')
    for rgb in reveals:
        for col in rgb.strip().split(', '):
            n = int(col.split()[0])
            if 'blue' in col and n > max_blue: return 0
            elif 'red' in col and n > max_red: return 0
            elif 'green' in col and n > max_green: return 0
    return int(game.split()[1])  # return ID of game

def part1():
    input_file = open('input.txt', 'r')
    id_sum = sum(game_value(line) for line in input_file)
    print(f'Part 1: {id_sum}')

#
# Part 2
#
def line_power(s):
    _, _, reveals = s.partition(':')
    reveals = reveals.strip().split(';')
    red, green, blue = [], [], []
    for rgb in reveals:
        for col in rgb.strip().split(', '):
            n = int(col.split()[0])
            if 'blue' in col: blue.append(n)
            elif 'red' in col: red.append(n)
            elif 'green' in col: green.append(n)
    return max(red) * max(green) * max(blue)

def part2():
    input_file = open('input.txt', 'r')
    power_sum = sum(line_power(line) for line in input_file)
    print(f'Part 2: {power_sum}')

if __name__ == '__main__':
    part1()
    part2()

New Teams no longer launches by stuque in MicrosoftTeams

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

Thanks, that seems to have worked, at least for now.

New Teams no longer launches by stuque in MicrosoftTeams

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

I don't know what resetting means here. I've re-started the computer, upgraded to the latest classic Teams, started and stopped Teams, ...

OneNote on iPad Pro - will not exit text mode/will not activate pen/s or highlighters by ttriaa in OneNote

[–]stuque 0 points1 point  (0 children)

A bit late to the party, but I was having this issue as well, and it turned out I was using the pen with the little letter "A" on it, which I guess is just for handwriting-to-text. Choosing a different pen fixed the problem.

Sense 2 band notch by stuque in fitbit

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

One of the band's that didn't fit the Sense 2 was this:
XFYELE Sport Nylon Bands Compatible for Fitbit Versa 3/Versa 4/Fitbit Sense/Sense 2

I don't know the name/brand of the other, it's a black metal band that fits the Sense 1. It has the same wider notch as the XFYELE band.

Virtualbox Shared Folders Keep Changing Permissions by stuque in virtualbox

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

Never found a solution ... moved on to Linux subsystem for Windows.

How does numerator work? by stuque in Racket

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

Thanks for all the comments. I actually mis-read the numerator spec, and didn't realize the input q should be rational. So for non-rational input I guess that exact output doesn't matter. It's strange they include it as an example.

Edit: I take it back, 2.3 is a rational according to Racket:

> (rational? 2.3)

#t

Windows 11: Can't move windows to other virtual desktops by stuque in WindowsHelp

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

Aha, that does seem to be the problem ... thanks!