Nathaniel’s Blog

Personal blog for Nathaniel Cantwell; opinions are mine

  • My Guacamole Recipe

    Many in my personal circle have asked for it, so here’s my guacamole recipe.

    Ingredients

    • 3 medium Hass avocados (not too soft, not too hard)
    • 1/2 red onion, diced finely (can also use white/yellow onion)
    • 2-3 jalapenos, seeds removed and diced (leave membrane if you want more heat)
    • Juice of 2-3 limes (start with 1.5)
    • 1 medium bunch Cilantro
    • Salt (around 1tsp to start)
    • (Optional) 1 roma (or other) tomato, seeds/juice removed and diced

    Finely dice onion and jalapeno and put into a bowl. Cut avocados in half, remove seed, and scoop the inside into the bowl. I like to remove any brown/bruised bits of avocado.

    Read more…
  • Finding the Longest Cold-Snap

    Here’s a simple programming question:

    Given a time-series of temperature measurements, what is the longest continuous sequence of days during which the temperature was below freezing?

    Pretty straightforward, right? It’s the type of question you might expect to see during a technical interview or a first-year lesson on how arrays work. My motivation for discussing this goes deeper, however.

    I first encountered a modified version of this problem during an internship between my third and fourth year studying Computer Engineering. While I came up with a fairly obvious solution using an imperative language, it was clunky because I had to unload the data from a database, find these rule-based sub-sequences of adjacent rows, and load the result back into a database. I was (mildly) haunted by the idea of answering this in pure SQL, with no need to drag the data out and into a database.

    Read more…