Today

  • First day at Recurse
  • Creative Coding Kickoff (1pm)
  • Pairing workshop (2pm)

QOTD

“Linux is only free if your time isn’t worth anything” - @sufianrhazi

Eueler Problem 3

Today’s problem is about prime factorization and is another chance to learn about and use generators! This time I need a generator to generate an infinite sequence of prime numbers:

function isPrime(n: number, knownPrimes: number[]): boolean {
    if (n == 2) {
        return true
    }
 
    for (const prime of knownPrimes) {
        if (n % prime == 0) {
            return false
        }
    }
 
    return true
}
 
function* primes() {
    yield 2
 
    let knownPrimes: number[] = [2]
    let currentNumber = 3
 
    while (true) {
        if (isPrime(currentNumber, knownPrimes)) {
            knownPrimes.push(currentNumber)
            yield currentNumber
        }
 
        currentNumber += 1
    }
}

Generators are neat! One thing I wonder about, though is caching. I’m going to need to use the prime generator several times and I wonder if there’s a cached generator that I could use so that I don’t have to re-find primes everytime I need them. It feels like I could implement a generic memoization on top of generators that looks up the answer in an array orrrrrr it runs the internal generator to get the next available value. Hmmmmm.

Here’s my complete solution to problem 3

Creative Coding time

Today’s prompt is: home

I learned A LOT about p5 in doing this.

I’m liking the structure of doing something like:

function setup() {
  createCanvas(800, 400);
 
}
 
function draw() {
  background("#EDEBE9");
 
 
  update();
}
 
function update() {
}

I’m missing the type safety of typescript, though. I’m trading off type safety for the ability to have a like p5 window right next to the code which shows updates in real time. I wouldn’t have been able to work on this otherwise.

I did a lot of thinking and doodling on this sketch on paper before I started working on bringing it to life. I’m trying to show the contrast between the outside world and noise and safety and expansiveness of home. I was thinking about shapes that feel “familiar” and shapes that feel “dangerous”. For some reason triangles feel dangerous and fraught.

A notebook page with many colored lines and words thinking about what home is

Here’s a bunch of questions I was sitting with:

  • What does home look like?
  • Who is wanted in home?
  • How am I different at home and in the world?
  • What does it mean to regulate up or down and which happens at home?
  • If home was a season what season would it be?
  • What thoughts and feelings are allowed at home that don’t fit in other spaces?
  • What is safe about home? If safety was a shape, which one? If danger was a shape, which one?
  • What does it mean to “come home”? Is it a place or a feeling or a person or something else?
  • What colors feel like home? Which ones don’t feel like home?

Group Presentations for Creative Coding

There were presentations from everyone who did the creative coding prompt and they were all amazing. A couple I’m still thinking about:

  • Someone made a map that as you click on it it gets more or less opaque. The closer you get to home, the clearer the map.
  • Someone made a music toy that you can play with your keyboard and can be tuned to different scales (because music reminds them of home). I didn’t know that there was so much power to build musical instruments in the browser.

Introduction to the Recurse space

Much of my day was spent getting used to the Recurse space. It’s SO cool.

This morning we did a tour of the two floors. The downstairs is for more social time and has a kitchen, vintage computers, a couple of conference rooms, and some creative space. The upstairs is quiet work space and has a library (IT’S SO COOL, someone has put spine labels with call numbers on all of the reading material), couches and smells of eucalyptus.

The morning was loud and busy and I tried to meet people but quickly was overwhelmed and feeling shaky. I took a quick break to do some programming (the Euler exericse) and then found a group in the Turing room that I spent time with. It made me feel so welcomed.

End of day

Today I worked:

A couple of ideas that I’m thinking about at the end of the day:

  • What capabilities are built into the browser, like webAudio, that don’t get used much but unlock creativity?
  • How can I be flexible in what I’m learning and the conversations I am having while I’m still focused on thinking about the project I would like to wrok on?
  • What does it mean to program “comfortably”? Some people use editors like neovim while others are using IDEs like VSCode. Some people are programming while wearing AR glasses. Some people have their computer set to grayscale so that they can stay focused. What does it mean to be comfortable?

Full notebook page for the day with lots more details: https://notes.nicole.computer/daily/2024-11-06

Tomorrow

I think tomorrow I will:

  • Do a Euler problem
  • Spend some time with the creative coding book
  • Pair for a bit (maybe on education stuff?)
  • Get started on the undo project