This Week I Learned (2016-02-16)

Things I learned this week.

Last week I stumbled across a post by Diana Kimball on Medium, encouraging readers to “Write About What You’ve Learned Lately.” It was good timing—I’m taking two web development classes this semester and TA-ing for a third, so I’m happily up to my ears in learning about some of my favorite things. In the spirit of, as Diana writes, “celebrat[ing] the process of learning itself, implicitly inviting others to do the same,” here’s my first edition of This Week I Learned (TWIL):

  • Soy sauce, rice vinegar, honey, and sriracha make a pretty good salad dressing, especially if you’re searching for something to go with leftover baked tofu, mixed greens, shredded carrot, and slivered red onion.
  • The countifs function in Google sheets or Excel will let you count the cells in a range that match a certain criterion—and here’s the cool part—if a cell in another range matches a different criterion. Magic.
  • Giant rabbits are real, and can weigh over 20 pounds.
  • The differences between Number(), parseInt(), and parseFloat() in JavaScript. Specifically:
    • Number() handles Booleans appropriately; parseInt() returns NaN
    • parseInt() returns the first number if multiple numbers are separated by spaces; Number() returns NaN
    • parseInt() can take a second parameter specifying the radix (base: i.e., 16 for hexadecimal or 8 for octal). Number() can’t take a second parameter, but automatically assumes:
      • hexadecimal for numbers starting with 0x
      • octal for numbers starting with 0 (note: as of ECMAScript 5, parseInt() *should* interpret these automatically as decimal, rather than octal, if not given a radix parameter, but browsers haven’t caught up yet, so you should always specify a radix when using parseInt())
  • How to use scope to associate table headers with data