Skip to main content

Activity for randy.pub

Active on:

Loading activity...

Posted: Maybe it doesn’t imply it but it’s been known to wink suggestively in a discussion section when the impact factor is rightBluesky network
Posted: It’s crazy to me that we got a 17 million line proof of a century-plus old unsolved math problem from an alien and some peoples first react…Bluesky network
Posted: First time I can remember where I haven’t played any of the GOTY noms, not counting OG OoT of course More and more of my gaming time has …Bluesky network
PostedBluesky network

My family had newer computers that I used before this but the first computer that was MINE was one of these Commodore XTs that I salvaged from my Dad's shelf of spare parts and busted computers

PostedBluesky network

nice

PostedBluesky network

This joke goes nuts if you, like me, are the son of a evangelical pastor who became an epidemiologist

PostedBluesky network

Ooof

PostedBluesky network
  • [grossed out] --dangerously-skip-permissions
[interested] auto mode
Posted: Anthropic’s marketing department must be ecstaticBluesky network
PostedBluesky network
  • vince mcmahon meme format:
MDPI is predatory
Frontiers is predatory
Elsevier is predatory
Publishing as a model is predatory
PostedBluesky network

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

PostedBluesky network

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

PostedBluesky network

The flexibility of `geom_polygon` lets you do basically whatever you want with your plots, e.g. (code: gist.github.com/rdboyes/7a7f...)

Posted: Cool study, and I’m convinced they’re generally correct. Very high lizardman quotient in this figure though - if you’re not getting 100% st…Bluesky network
Posted: Average programming language enjoyer: there are two hard things, cache invalidation and naming things #julialang programmers:Bluesky network
PostedBluesky network

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

PostedBluesky network

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]];
    }),
);
  • var input_matrix = require("fs")
  .readFileSync("data/2025/4.txt", "utf-8")
  .split(/\r?\n/)
  .filter((line) => line.trim().length > 0)
  .map(function (line: string) {
    return line.split("").map(function (char) {
      if (char == "@") {
        return 1;
      } else {
        return 0;
      }
    });
  });

var count = 0;
var remove = [];
var exit = false;

while (exit == false) {
  for (const target of remove) {
    input_matrix[target[0]][target[1]] = 0;
  }
  var remove = [];

  for (var i = 1; i < input_matrix.length - 1; i++) {
    for (var j = 1; j < input_matrix.length - 1; j++) {
      if (
        input_matrix[i - 1]
          .slice(j - 1, j + 2)
          .concat(
            input_matrix[i].slice(j - 1, j + 2),
            input_matrix[i + 1].slice(j - 1, j + 2),
          )
          .reduce((a, b) => {
            return a + b;
          }, 0) <= 4
      ) {
        if (input_matrix[i][j] == 1) {
          count++;
          remove.push([i, j]);
        }
      }
    }
  }
  if (remove.length == 0) {
    exit = true;
  }
}

console.log(count);
PostedBluesky network

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),
);
PostedBluesky network

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);