Goal Tracking: April Edition

At the beginning of the year I published a post outlining what some of my goals for the year were. In the spirit of being transparent, here is the progress I made on them over the course of April –

  1. Was mostly available, except for the last week of April. Sorry.
  2. Zero volunteering. Sigh.
  3. Procrastination was zero.
  4. Continued my trend of always being honest and open.
  5. No progress made on learning Rust.
  6. I read only one book over the course of April: Trigger Warning (I loved it! I hadn’t read a book of short stories in a long time and this was perfect)
  7. I read 2 research papers.
  8. I wrote 7 posts.
  9. I learned to play 3 new songs on the guitar. I also started reading up on music theory.
  10. (a) I ran an 8 min (7m 52s to be precise) mile!
    (b) (goal achieved)
    (c) (goal achieved)
    (d) I signed up for the SF half marathon. I’m already nervous about this.
    (e) (goal achieved)

Think

(working through more Hacker News backlog)

I just finished Think OS: A Brief Introduction to Operating Systems. It had been sitting in my browser for quite some time now and I decided to read through the book this afternoon.

The book stays true to its title and gives a short and sweet introduction to (some) OS and systems programming fundamentals. While it doesn’t dive deep into any topic (for example — TLBs are not mentioned in the chapter about Virtual Memoryit does a good job of laying a foundation for people who have never taken a systems programming / OS course before and are trying to gain an understanding of the fundamentals. That being said there are links to resources (like an explanation on how dlmalloc is implemented) scattered throughout the book that allow the reader to gain a deeper understanding of the topic at hand.

If you’ve never done any systems programming before and are looking to write some low level code this book is a good place to begin to understand how the OS and kernel work. If you’re looking for something more in-depth I’d highly recommend reading Operating Systems: Three Easy Pieces.

Goal Tracking: February + March Edition

(combined post for February and March since I forgot to do one for February)

At the beginning of the year I published a post outlining what some of my goals for the year were. In the spirit of being transparent, here is the progress I made on them over the course of February –

  1. Due to personal reasons I don’t think I made myself as available as I could have. I’m sorry. 

  2. Zero volunteering.
  3. Procrastination was almost zero.
  4. Continued my trend of always being honest and open.
  5. I read the third chapter of the Rust book.
  6. I read 2 books over the course of February: Do Androids Dream of Electric Sheep? and Fahrenheit 451 (a short intense love affair)
  7. I read 0 research papers.
  8. I wrote 8 posts, including what I think is one of my best posts so far.
  9. I made very good progress at playing the guitar. I recorded a video of myself singing + playing “Can You Feel The Love Tonight” by Elton John for Valentines Day and it wasn’t entirely terrible.
  10. (a) Did not run an 8 minute mile.
    (b) Did a handstand!
    (c) Did a 315 lb squat! The next day was quite painful.
    (d) Did not run a half marathon.
    (e) (goal achieved in January)

Here is the progress I made on them over the course of March –

  1. I made myself available to all those who needed me. I hope I was helpful.
  2. Zero volunteering. Three months of failing at a 2016 goal feels terrible.
  3. Zero procrastination.
  4. 100% honesty.
  5. No progress made towards learning Rust.
  6. I read 3 books over the course of March: Ghostwritten (I LOVED it. What a great book! It grabbed me and refused to let me go), The Mathematics of Love: Patterns, Proofs, and the Search for the Ultimate Equation (a super fun read), and White Teeth (funny and thought-provoking).
  7. Read a paper on Maglev.
  8. I wrote 4 posts in March.
  9. I can play Like Light To The Flies, including ~2/3rd of the solo.
  10. (a) Did not run an 8 min mile.
    (b) (goal achieved in February; see above)
    (c) (goal achieved in February; see above)
    (d) Did not run a half marathon.
    (e) (goal achieved in January)

Train

(NOTE: These are my thoughts and opinions on working out and diets. There’s no science backing this. This is what works for me. Your mileage may vary)

A few weeks ago I realized that I had two fitness-related events, SF Spartan Sprint and Bay to Breakers, coming up soon that I needed to start training for. The fact that these events are back to back will make for a painful weekend in May.

While I’ve been going to the gym regularly for the past 2-3 years I felt that I had to make some changes to my workout routines in order to do well at both these events. Similarly, my diet would also require some tweaking.


My workouts have typically been very lifting heavy (pun intended), with cardio being almost non-existent most of the time. Since both these events are cardio heavy I needed to change that. At the same time I couldn’t eliminate strength training completely because the Spartan Sprint does have a strength component.

The fix was easy — do more cardio!

I’ve started running 4-5 days a week after my strength training. I’m currently doing 4 miles a day (9-10 minutes per mile), and aim to be able to run 8 miles before Bay to Breakers. Since I have a finite amount of time I can spend at the gym I can see myself having less and less time to work on strength training. And I’m OK with that — as long as I do the minimal amount of strength training to maintain whatever muscle and definition I have I’m happy.

I’m not a huge fan of running long distances (I once said “Cardio is my arch nemesis”) and get bored while running. In the past I’ve listened to music but for the longer distances (3+ miles) I’ve found that watching videos makes the time fly by faster. So far I’ve seen Scala/Odyssey, Groundhog Day, and a few episodes of Cosmos: A Spacetime Odyssey. I plan on watching some TED Talks next.

I’ve also changed my strength training a bit. I’ve reduced the weight I use for squats (310 lb to 270 lb) so that my legs are not extremely sore and I can still run. I’ve also started doing more weighted push ups (currently 50 with no weights and 50 with +20 lb) and pull ups (currently 25 with no weights and then 20 with +20, +40, +50, +60 lb)

Lastly, I’ve also started doing more abs and core workouts because it’s not something that I really focused on in the past. I currently do 50 crunches and 50 leg raises post running and stretching.


In an effort to shed some weight (180+ lb in 2013 to 155 lb today) I had became extremely strict about my diet. I greatly reduced my consumption of fried food and desserts, and completely eliminated soda from my diet. I tried to keep my meals as simple as possible and stayed away from rich, heavy food items during the week. During the weekend / if I went out I was less strict on myself.

All this seems quite reasonable.

But I also did something that hurt me when I started doing more cardio workouts — I reduced my consumption of carbs (rice, pasta, bread, etc.). Most of my meals in the past used to be very protein heavy, with little to no carbs on my plate. As you know, carbohydrates are a source of energy. While the lack of carbs in my diet didn’t really affect me when I was lifting, it definitely did when I started running 3+ miles everyday.

I felt weak. I felt tired. I felt foolish for not eating carbs.

So I changed that. My plate was reintroduced to brown rice, quinoa, and (occasionally) waffles. The results have been excellent — I no longer feel completely drained of energy post working out. And my weight has stayed pretty constant too, with only the usual plus/minus 2 lb fluctuations.


Overall I think this is the best I’ve every felt in my life — physically, mentally, and even emotionally.

 

TOAST

The other day I was working through my (quite massive) backlog of saved Hacker News stories and read this gem — Introduction to PostgreSQL physical storage. As someone who has loved databases forever, and has spent over a year building LinkedIn’s next generation distributed graph database, I found this post absolutely fascinating.

As the title suggests this article talks about how data in PostgreSQL tables and databases are actually stored on disk and how free space (to figure out where to store incoming data) is managed. The diagram of the page structure is very helpful in understanding how data is stored in a page. I also really liked the use of PostgreSQL queries used throughout the article to explain the topic at hand by examining a real PostgreSQL instance. The author does a great job at explaining concepts at just the right amount of detail, with several links provided for those interesting in learning more.

(Relevant side bar: the PostgreSQL source code documentation is amazing)

Cache

One long standing issue that I’ve had with the LinkedIn GitHub page that I helped design was that it because it relied on the GitHub public API to fetch all the data, if the user accessed the page from a rate-limited IP address the rendered page would be blank as no data would be returned by the API. I had some time on my hands today and decided to fix this bug.

The simplest fix for this bug is to cache the GiHub API response in a file, and when you get rate-limited by the GitHub API fall back to reading from a cached API response. Since the raw API response contained lots of information that was not required to generate the website, I decided to add an intermediate filtering step to only extract the relevant information from the raw GitHub API response. The JSON data generated by this filtering step is the final cache used by the webpage.

To test the code I’d written and to make sure everything works as expected I needed to rate limit myself. This was easily done using the (amazing) Python Requests library.

You can find my fix for this bug here.

Update — I realized that my original patch failed to use the GitHub API response when the user was not rate limited. My last commit should fix this.