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


(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.