Skip to main content

Activity for randy.pub

Active on:

Loading activity...

I wish claude would just admit it doesn't know instead of attempting to gaslight me

Bluesky network2d ago

Bruce only likes to chew toys while holding them over the edge of the couch, and gets very upset when he drops them

Bluesky network17d ago
Bluesky network1mo ago

Cool study, and I’m convinced they’re generally correct. Very high lizardman quotient in this figure though - if you’re not getting 100% strong agreement that “betting (real money)” is a form of gambling, something is off, and the SVK sample “strong agree” for that item is <50%

@mkarhulahti.bsky.social avatarVeli-Matti Karhulahti@mkarhulahti.bsky.social

behold, we found great variation in how people think! Many activities that we thought would be “gaming” weren't & vice versa, eg half of the participants interpreted ‘gambling’ to be ‘gaming’. Ergo: surveying ‘gaming’ without defining it creates data mess

Bluesky network3mo ago

Average programming language enjoyer: there are two hard things, cache invalidation and naming things #julialang programmers:

@goldwagnathan.bsky.social avatarNathan Goldwag @goldwagnathan.bsky.social

mods are asleep post forbidden greek letters

Bluesky network4mo ago

Only had time to finish part 1 of #adventofcode today - hoping to get back to p2 on the weekend though!

Bluesky network5mo ago

Two #adventofcode solutions for the price of one today, since I was too busy working yesterday. TypeScript feeling ok, but how is array.sum() not a thing!?

function solve(line: string, bat_length: number) {
  const arr = line.split("").map(function (char: string) {
    return Number(char);
  });

  let end: number = arr.length - bat_length + 1;
  let start: number = 0;
  let digits: number[] = [];

  while (digits.length < bat_length) {
    const selected = Math.max(...arr.slice(start, end));
    digits.push(selected);
    end += 1;
    start += 1 + arr.slice(start, end).indexOf(selected);
  }

  return digits
    .reverse()
    .map(function (n, i) {
      return n * 10 ** i;
    })
    .reduce((a, b) => {
      return a + b;
    }, 0);
}

console.log(
  require("fs")
    .readFileSync("data/2025/3.txt", "utf-8")
    .split(/\r?\n/)
    .filter((line) => line.trim().length > 0)
    .map(function (line: string) {
      return [solve(line, 2), solve(line, 12)];
    })
    .reduce(function (a, b) {
      return [a[0] + b[0], a[1] + b[1]];
    }),
);
Bluesky network5mo ago

TypeScript #adventofcode Day 2 complete! Rocky one, really missing some of the builtin functions from my "home languages", but we got there

const range = (start: number, stop: number): number[] =>
  Array.from({ length: 1 + stop - start }, (_, i) => start + i);

function chunkString(str: string, length: number) {
  return str.match(new RegExp(".{1," + length + "}", "g"));
}

const divisors = (num: number) =>
  [...Array(num)].map((x, i) => i).filter((x) => num % x === 0);

function solve(id_range: string): number {
  const arr_range = id_range.split("-");
  const possibles = range(Number(arr_range[0]), Number(arr_range[1]));

  const ans = possibles
    .map(function (element: number): number {
      let id_string = `${element}`;

      const checks: number[] = divisors(id_string.length).map((num) => {
        return new Set(chunkString(id_string, num)).size;
      });

      if (Math.min(...checks) == 1) {
        return element;
      } else {
        return 0;
      }
    })
    .reduce((a, b) => {
      return a + b;
    }, 0);

  return ans;
}

console.log(
  require("fs")
    .readFileSync("data/2025/2.txt", "utf-8")
    .split(",")
    .map(function (id_range: string) {
      return solve(id_range);
    })
    .reduce((a, b) => {
      return a + b;
    }, 0),
);
Bluesky network5mo ago

Doing #adventofcode in TypeScript this year since I need to learn it for work... missing #julialang but it's not too bad. Day 1:

Typescript solution to advent 2025 day 1. Code: class Dial {
  current: number = 50;
  zeros: number = 0;
  pass_zero: number = 0;

  turn(s: string): void {
    if (s[0] == "R") {
      this.current += Number(s.substring(1));
      if (this.current >= 100) {
        this.pass_zero += Math.trunc(this.current / 100);
        this.current = this.current % 100;
      }
    } else {
      if (this.current == 0) {
        this.pass_zero -= 1;
      }
      this.current -= Number(s.substring(1));
      if (this.current <= 0) {
        this.pass_zero += -Math.trunc(this.current / 100) + 1;
        this.current = 100 + (this.current % 100);
      }
    }
    if (this.current == 0 || this.current == 100) {
      this.zeros += 1;
      this.current = 0;
    }
  }
}

var p1 = new Dial();

require("fs")
  .readFileSync("data/2025/1.txt", "utf-8")
  .split(/\r?\n/)
  .forEach(function (line: string) {
    p1.turn(line);
  });

console.log(p1.zeros);
console.log(p1.pass_zero);
Bluesky network5mo ago

accidentally opening the app formerly known as twitter

a group of star wars characters standing next to each other with a robot in the background
Bluesky network6mo ago

Exploring some ideas for how to create a macro-free (or macro-light) implementation of the tidyverse in #julialang (get out the jolly roger 🏴‍☠️): www.randy.pub/posts/piracy/

Bluesky network7mo ago

I’m doing my honest best to listen to this with an open mind but hooiiioill There are so many words said that have absolutely no bearing on the facts of the case podcasts.apple.com/ca/podcast/t...

The Law, such as it is
Bluesky network8mo ago

I miss being able to just buy a thing and have it, I hate paying for subscriptions

@yeeeerika.bsky.social avatarerika@yeeeerika.bsky.social

i don't want to hear your most boomer complaint. what's your most millennial complaint?

Bluesky network8mo ago

Am I the only one who thinks Liquid Glass actually looks kinda good

Bluesky network8mo ago