“Stop Wasting Time”

A month into life in Silicon Valley and I find myself wasting too much time on things that don’t matter. I don’t feel like I am making full use of my time in a productive manner. As a result here are a few of the things I would want to focus more on.

Level up as a developer.

(I think this goal has been repeated over and over again in my blog.)

My role at EasilyDo has been more on backend, providing support roles for internal tools etc. It isn’t as exciting as my time spent at ShopBack where my code directly affects customers, but there is still much to learn.

The different roles that a software engineer plays greatly affects the different skill sets they learn. For example, a client side engineer (mobile, frontend web) will focus more on iteration, customer interaction and A/B testing. Whereas a backend engineer focuses more on business logic, data and software architecture.

For my current role, it seems that I am doing unimportant work that is of little value. However if we take a step back to look at the grander scheme of things, for one to thrive as a full-stack engineer, he/she definitely has to be exposed to both side of the story. Which is why I still find my current work fulfilling, albeit the lack of excitement.

Level up as a Computer Science undergrad.

This is one part of my life that I’ve been ignoring. I felt this very strongly the previous semester when I was busy with Letterbox and neglected my Database and Network modules. My priorities right now should be student first, developer second. After all, I am still learning and college is the best time to learn. Putting things together to make an awesome application sure is exciting and fulfilling, but the theory and concepts of a computer science education is not to be neglected.

Parallel computing has always been something I wish to venture in, but have not exposed myself to yet. Abdulla brought up a good point at work the other day, “why exactly are you interested in parallel computing?”

I realise I couldn’t answer that.

Perhaps I should start looking at more papers and hot topics on parallel computing, and get started with being familiar with the current problems and issues faced by people in the field.

One of the greatest mistakes I will ever make in university is to jump into a focus area that sounds interesting to me, but doesn’t exactly pique me.

A resolution for myself: read a chapter of any computer science fundamentals textbook everyday and digest what you’ve read. 

A chapter a week doesn’t sound hard until we actually start doing it. A couple of interesting books to digest would be CLRS and the OS textbook. (couldn’t recall the name, but I have it loaded in my iPad)

Health and Fitness

Well come to ‘Murica right? Where the obesity is a huge problem. Given the scrawny little guy I am right now, what do I have to worry about? Gaining more mass healthily.

I got my 24-Hour Fitness membership lately and I guess that’s the start of a brand new routine. The previous time I tried to bulk up by hitting the gym was in the army, and that did not really turn out well. One of the best part about the 24H Fitness near my house is an indoor basketball court. I foresee myself spending lots of time there when things get really tough. 🙂

Besides that, cooking has been a breeze. Eggs are dirt cheap and the meat are really nice and fatty. Which makes cooking much much easier. Shall post pictures of several dishes I’ve made soon!

Once again I have a game plan laid out ahead of me. Now it’s time to make it happen. 🙂

Silicon Valley

The past two weeks of NOC has been a whirlwind ride. It stretches from looking for housing to finally settling down. There was a bit of drama here and there, but I am glad that we’re all settled down nicely now.

Having heard so many stories about NOC, I have experienced for myself the struggle that people go through while looking for housing, transportation, insurance and setting up finances. It is further made difficult by the fact that we are working and attending classes at Stanford at the same time.

So far, I’ve settled down in a little nice corner of Sunnyvale (South Bay Area) together with 7 other batch mates.

Keeping an Open Mind

Everyone departed for NOC with this goal in mind. “To go with an open mind.” I think it is important to always question periodically how open am I. Many times I like to retreat into my own enclave and tell myself this is my way of doing things, and I’ll keep to it.

Be flexible, be understanding, be forgiving.

Opened a fortune cookie after lunch at Chef Chu’s today and it read “Be prepared to modify your plan. It’ll be good for you!” It’s probably a sign that I should relax and take a chill pill. Plans do change and when they do, I need to take them in my stride.

Getting a car was an interesting experience. Although in the end I took a huge risk by purchasing a car without first sending it for mechanic check. (Probably should do it this weekend) It was a calculated risk though, considering that it’s relatively new with low mileage, plus it’s a Japanese car. It should last me for at least half a year! It’s called the Platypus. Shall take a picture with it soon.

Oh and yes I forgot to turn off the headlights on the first night I got the car, and had to find a security vehicle in the rain at the parking space to jump start the car. What an adventure.

The advice given to me long ago should still hold:

Engineers cannot panic. Don’t panic.

Work has been pretty smooth, and I am not sure if that is good. I am still learning, but at a much slower pace than I expected. Maybe it’s time to focus more and cut out distractions.

Stanford lessons were really amazing. There’s this whiff of excitement every week that I step into Stanford. There are really bright students in class but I think it is important to calm down to gather your thoughts before speaking. It is tempting to raise my hand at every opportunity to express my views, but a well-thought out answer is always better preferred compared to a winged answer.

It’s going to be nearly a month here, and I look forward to way more adventures ahead! 😀

NOC: Prelude

As most of you already know, I departed for NOC a day ago. It still feels pretty surreal that I am here in Silicon Valley, where I dreamed of going ever since I fell in love with programming.

I think it’s important to set the goals and aspirations straight for NOC. It’s a very unique and special program and there are different ways of approaching it. So here’s just one humble goal I wish to achieve.

Level up, more.

I’ve been keeping this goal for every semester in NUS and it’s something that I really value. Keep levelling up. First semester I had CS1101S, which challenged the way I think about programming. Then I went on to fulfil my thirst for software engineering by contributing to NUSMods during my first winter break.

In the following semester, I took on a project of my own, which was compiling an EPUB version of SICP in JavaScript. Although it wasn’t perfect, it still taught me many valuable lessons about web development. Also coupled with an accelerated algorithms course (CS2020) which once again proved to be challenging.

Then in my freshman year’s summer, I felt the need to take on something on a bigger scale, of more importance and challenge. I joined ShopBack and was part of the UI redesign and reimplementation. It was a really fruitful 3 months spent despite the tough times. In the most recent semester, I took up the challenge of CS3216 and I learned and achieved more than I could ever imagine, at the cost of my other grades.

The thirst to level up pushed me through all these tough times. None of the above made my life easy, but I believe it was through the struggles and pains that I am able to improve and better myself. I am glad of where I am today, and I am excited for where I will go in the future.

Looking forward to NOC, it shall be a whole year of level-ing up. Taking on a role of Platform Engineer at EasilyDo, something I am totally not familiar with considering that I came from mostly a frontend background.

Work should not be the only source of learning, spending a year in Silicon Valley, the Mecca of software engineering and innovation, should also open my eyes to more engineering and startup culture.

Be like a sponge, absorb. Learn and imitate what is good, improve what is bad.

Keep quenching this thirst to improve, keep setting higher expectations for myself. This is what the next year’s gonna be about. 🙂

Y2S1 – A Whirlwind Ride

Results came out earlier today and I wouldn’t say I’m very satisfied with them. The entire semester has been a whirlwind ride, here are some reflections.

Work is manageable, time isn’t.

This has to be the greatest lesson learnt. Modules are actually pretty straightforward and easy to understand if I had put in consistent effort weekly for the entire semester.

Focus on what is important

I would say that most of my time were not spent being productive on the things that matters. In other words, I spend too much time thinking rather than doing. It’s a habit that I should try get rid of as soon as possible. CS3216 did take up most of my time this semester but I have to admit that the remaining time were not well spent. This was pretty evident when I screwed up midterms big time because I did not do my revision according to plan.

Being more proactive

Resources are out there to be utilised. I’ve gotten a bit more lazy this semester in terms of actively seeking out help from tutors and professors on help. I would gladly use CS3216 as a convenient excuse for me to have ‘no time’. But I am quite certain this isn’t the case. It all goes back to the part on time management.

Exercise, don’t neglect it

The exercise counter for this semester is close to zero. Apart from the weekly captain’s ball sessions, I’ve not been doing any exercise of my own. (Not to mention there’s IPPT coming up tomorrow)

Let go of thoughts

Sometimes thoughts are toxic, and they affect the way I function on a daily basis. Many times this semester there was a need to empty and gather back my thoughts. It helps me reconsider what matters and what doesn’t. These thoughts stems from every aspect of my daily life and it’s important to let go and ignore them sometimes.

Overall it wasn’t a pleasant semester, but I’m excited for the next stage of my life in Silicon Valley for a year.

Looking forward! 🙂

API Rate Limiting

Since WordPress’s new admin site is so awesome <insert emoji with heart eyes>, I think I should document my little learning notes here instead. Shall use a sub-domain for this WordPress in time to come!

Letterbox’s traffic went a bit off today, causing our instance’s CPU usage to spike. Apparently people were spamming API calls to our server, resulting in some form of DoS attack, well but it didn’t exactly crash/overload it.

Do things that don’t scale, right? It probably slipped our mind when designing the API, thinking that all users would be angels and not do weird stuff like that. Clearly we were wrong. Also this would be needed in time to come when the API calls start to exceed Facebook’s API rate limit.[1]

API Rate Limiting is basically restricting the number of times a particular end user is able to call the endpoint. There are a couple of ways to do this, and the way that we chose would be to utilize a Redis cache.

The idea is to have a key-value pair (user ID as the key and times accessed as value) that will update everytime a call is made, and Redis is perfect for handling little tasks like that.

There’re many considerations to take into account for such a simple implementation. A cursory look online points to having to deal with HTTP headers (agh damn networking), different time buckets and also pipelining. It is certainly good to dive more into the details in time to come, but then there’s finals.

So instead of reinventing the wheel, I opted to use express-limiterIt’s already written and works right out of the npm box. [2] The task is done in around 10 lines of code.

var redisClient = require('redis').createClient();
var limiter = require('express-limiter')(app, redisClient);

 path: '/matches',
 method: 'all',
 lookup: ['user.id', 'connection.remoteAddress'],
 total: 50,
 expire: 60000

These few lines of code simply set a 50 call limit to /match endpoint, and sends a 429 if there are anymore calls from the same user IP thereafter. It does not seem like much but I think as a frontend developer since forever, I’ve not been able to appreciate such backend concepts.

A little something I learnt today, besides SQL, DRC/TRC and Relational Algebra. Yup CS2102 is coming up next.

Oh and I realized at the end of writing this post why I wouldn’t document more craft related post here. Typing code into WordPress is still pretty painful. 




[1] Well… a problem for next time.
[2] Loses a lot of flexibility though.


Where the Actual Learning Takes Place

Just came back from lunch in a pretty cool suite and it gave me a little musing/flashback.

As my Economic teacher in Junior College used to tell us when we’re in the middle of a chaotic discussion about any concepts:

Go ahead. Discuss. This is where the actual learning takes place.

It’s been three semesters in NUS and I’ve been studying in solitude for the exams every single time. Perhaps the modules I did the best for were ones that I actively participated in discussions about concepts.

CS1101S only got slightly more interesting towards the end where I actively discussed with Alex about the concepts. CS1231, CS2100 and CS2020 was fun throughout since Ryan and gang were there for me. Those modules which I did the worse for were those that I did alone, like Calculus and General Biology. For this semester, Computer Networking was a total nightmare that will probably come back to bite me in the ass.

I remember writing a blog post way back during army that learning alone is tough. I was struggling with C++. There wasn’t anybody to direct your concerns to, nor have a casual conversation about concepts and ideas. True learning takes place best when there is active discussion.

Maybe this is something I missed out, and I wish I hadn’t. It is difficult to step out of this bubble that you surrounded yourself with.

Also, I feel it’s important to keep myself grounded. Remove myself from the attention that I’ve been getting lately and focus on personal growth and development. I’m not that great.

Afterall, glory isn’t permanent, skills are.