Library

On Tuesday I misread that the Papers We Love meet up that scheduled to take place on 11/19 was actually happening today. I think I messed up because I only looked at the day instead of the date. Silly me.

This mix-up gave me an excuse (like I needed one) to read a research paper on the bus ride back from work. I chose to read “Threads Cannot Be Implemented As a Library” by Hans-J.Boehm.

The main argument laid forth in this paper is that for concurrency to be defined and used correctly in a language it must be part of the language specification and cannot be bolted on as a library. The motivating example used throughout the paper is that of C and the Pthreads library. Pthreads was probably my first introduction to concurrency (it might have been Java threads; I don’t remember) which is one of the reasons why I thought this paper was really interesting. It’s also something that I’ve not really thought of — I know that Pthreads is just a library but for some reason I felt that it was a part of C.

To illustrate his point the author gives three categories of errors that arise when threads are a library. In essence all three errors stem from compiler optimizations. Because the compiler is not aware of threading/concurrency semantics (because it is not a part of the language specification) it makes optimizations that can lead to performance boosts in single threaded programs, but could cause problems in multi-threaded programs. The paper ends with a section on performance showing how expensive concurrency primitives are, and what can be done in C++ to come up with a standard for threading. You can find details about the C++11 memory model here.

This paper is short (10 pages!) and very easy to read. Even though it is about 10 years old the ideas and thoughts presented in it are still valid, especially if you’re coding in C. Or if you plan on inventing a new programming language. I highly recommend reading it.

Live

Concerts I’m going to this year —

  • 9/24: SF Symphony Opening Gala
  • 10/4: The Fratellis
  • 10/6: Alcest (unfortunately Hiatus Kaiyote are playing on the same day)
  • 10/14: Trivium, and Tremonti
  • 10/20: Judas Priest, and Mastodon (2nd time seeing Mastodon)
  • 10/22: Florence and the Machine (2nd time seeing them)
  • 10/30: Shakey Graves and Tennis (4th time seeing Tennis)
  • 11/20: TesseracT, Erra, The Contortionist, and Skyharbor (I bought VIP tickets for this event)
  • 11/28: Between The Buried And Me

Help

Prior to heading out to MHacks I envisioned having the time to catch up on some tech and non-tech reading over the course of the event. However, this was not to be.

(And no, I’m not disappointed in the slightest that I was occupied the entire time)

I spent a majority of my time helping and mentoring teams participating in the event. I had volunteered to answer any web development related questions. Here are some of the problems I helped solve and technical concepts I explained:

  • How to architect a website that used in-browser video conferencing as a key component. I suggested using WebRTC as it is something that I’ve used in the past. The team chose to use the excellent PeerJS library as an abstraction over WebRTC.
  • How Ajax + callbacks work in JavaScript. The team’s algorithm needed nested callbacks (3 levels of nesting if I recall correctly) because of dependency issues, and the phrase “callback hell” did come up.
  • Given a set of documents, how do you determine, for a particular document, what are the similar documents? This is the problem of semantic similarity. I also explained some basic NLP concepts to the team.
  • How to create a website so that it has a responsive design. My suggestion was to use Bootstrap (I love this framework) and have it do the almost all the heavy lifting.
  • How to use Flask to build backends that are not coupled to the frontend (web v.s. text message)

This was probably the most mentoring I’ve ever done at a hackathon. It was a great experience, and I would definitely do it again.

 

Shoes

My Adidas Powerlift 2.0s showed up over the weekend and I got a chance to workout with them for the first time yesterday. I immediately felt a difference in my lifts. It was easily the most physically stable I’d ever felt.

I think this is the first pair of blue and white shoes that I've bought in a long time.
I think this is the first pair of blue and white shoes that I’ve bought in a long time.

I noticed that in my running shoes I had the problem that I used to tilt forward/backward at times, especially for the heavier weights. This problem was completely eliminated while wearing these shoes. The stability and support offered by these shoes helped me squat 260 lb, a personal best.

After lifting in these I can’t imagine wearing anything else.

Oh, I’ve also started reading while resting between sets at the gym. I think it’s a great use of time where I was essentially doing nothing. Well, nothing mentally engaging (most of the time, unless I’m talking to/texting someone) anyways.

Feel

At the beginning of 2015 I made a conscious decision to be less shy. My rationale was simple — I felt that I’d held back in the past and didn’t want to make the same mistakes again. While this was pretty hard for the first few months I gradually got more comfortable being open with my feelings. I think the turning point for me was when I realized that I’d rather live with the consequences of saying what I wanted than living with the regret of being silent.

Sitting on a rock near Multnomah Falls this weekend I had a chance to think a bit more about this. Maybe being less shy had lead me to wearing my heart on my sleeve. Maybe I should be more prudent and gauge and understand the situation better, and not not hold back sometimes.

Sure, this might be the more sensible thing to do. But at the end of the day it’s not who I am, or who I’ve chosen to be. Doing so would not be the reflection of the self that I’m aiming to become. I feel that people are less and less honest with each other in our society these days and this makes me sad. While always speaking your heart out is certainly the opposite end of the spectrum, it’s the end that I’d much rather be on.

For now I’m just going to embrace my current outlook and philosophy, be cognizant of the consequences, and move on. Who knows, maybe a few years down the line I realize that I’ve been a complete and utter idiot and decide to keep things to myself again. But today is not that day.

Warmth

Returned back to a much warmer San Francisco this morning. It was one of those rare SF days where I wished I had air conditioning in my house. I worked from home for most of the day but realized I wasn’t feeling my usual cheerful, awesome self (euphemism for I was feeling a bit sick) and decided to sleep/rest for the remainder of the day. I blame not getting enough sleep last night (my flight from Portland was at 6:44am) and then not being able to sleep on the flight.

My brief stay in Portland was a lot of fun. Or as my friend would say, it was “hella fun”.

I’m about a third of the way through in Immortality. This is the first Milan Kundera book I’ve read. I quite enjoy his style. This book has already given me a lot to think about.

Cart

Got a chance to check out Portland’s food cart scene today. I was quite impressed. I’ve eaten at a lot of food trucks in San Francisco so I was looking forward to trying something new/different in Portland. I was not disappointed.

The first cart I ate at was Mumbo Gumbo. Their seafood gumbo was quite excellent. I was starving and totally forgot to take a picture. But it was delicious.

Cart #2 was Kargi Gogo. I’ve never had food from the country of Georgia before so this was a first for me. I ordered the khinkali and it was amazing. It reminded me of xiaolongbao, another dish that I absolutely adore. Highly, highly recommend trying this place out.

So good.
So good.