Author: mattchung

  • Advanced operating system course starts today

    CS 6210 (Advanced Operating Systems) is a graduate level course that covers in detail many advanced topics in operating system design and implementation. It starts with topics such as operating systems structuring, multi-threading and synchronization and then moves on to systems issues in parallel and distributed computing systems. There is no textbook for this course. Rather, we will read and discuss a number of important research papers related to these topics. For each paper that is covered in class , students are expected to gain a solid understanding of the problem that is addressed by the paper, and the solution proposed by the authors.

    Today is officially first day of Fall 2020. We’re still in the midst of COVID19 but given that that my online masters program in computer science has always been conducted fully remote (i.e. distance education), there’s no changes for me, really (as it relates to education). This semester, I’ll be taking advanced operating systems1, a course that’s really focused on distributed systems.

    Before jumping into watching the video lectures, I’m going to take a brief assessment2 that’s required of us students. This pre-assessment helps us students gain a better understanding of the prerequisite concepts necessary for success in this course”. Then I’ll download the syllabus, set up my workstation (for projects and lab environment), then if I’m lucky, watch a video lecture videos.

    References

    1.  https://omscs.gatech.edu/cs-6210-advanced-operating-systems-course-videos
    2. https://www.cc.gatech.edu/~rama/CS6210-External/cs6210_diagnostic.pdf

    Appendix

    Didn’t sleep well last night for whatever reason. Probably because so many thoughts were racing through my mind (like starting this semester) and as a result, my brain woke up at around 04:30 AM. Oh well. I’m going to get the day started early since today is also my first day back at work after taking a (much needed) one week vacation. Better get cracking now because Elliott will be waking up any minute now.

  • Weekly Review – 2020/08/09 – 2020/08/16

    Past Week

    • Published 8 blog posts within a week. I’m developing a cadence, aiming for one (very) short blog posts a day and one medium blog post per week. I think this target is manageable and S.M.A.R.T and will help force me to get in the habit of shipping small fragments instead of never shipping (in)complete blog posts.
    • Took a 3 day vacation with wolf pack at Suncadia, a hotel resort in eastern Washington. This was the first “holiday” (if you can call it that) since COVID19 hit. So … that’s about 6 months and I totally needed it, since I felt my mental health was deteriorating and it was impacting not just work but my personal life: my patience for others was wearing thin and found myself snapping at almost everyone (especially at Jess, no fair to her). Overall, unplugging for the past week has been great not just for me but the for the entire family. Able to spend quality time despite being in the midst of a pandemic and able to help more around the house
    • Hit with tennis coach on Sunday, my first lesson in about 8 months? I had considered cancelling the lesson the day of given that the weather was blistering, 99 degrees (and probably hotter on the tennis court).
    • Bathed Elliott every night this week. Finding joy in these fleeting moments. She’s growing up so fast and although I’m almost always tired, she’s worth it.
    • Refined my organization and writing workflow. Started creating a digital library, scanning about 10 of my books using my recently purchased ScanSnap.
    • Finding that my slimmed down GTD (getting things done) system is kind of working. Needs some tuning – probably need to incorporate a tickle file to remind me of projects, goals, etc.
    • Cooked a couple decent tasting meals. Always feels good to eat clean plant based meals and feels good to help Jess out
    • Still haven’t mustered up the courage to reach out to my dad. I think about him daily but him and I are entangled, like two cowboys about to fast draw but nobody will make the first move

    Next week

    • Start advanced operating systems next week (i.e. Monday). Will need to switch back on into academic mode
    • First day back in office after a week long (much needed) vacation.
  • Creating my own digital library

    After reading Daniel Wessel’s post1 on creating a virtual library, I’ve decided take the leap and convert the majority of my books — classic literature will remain sitting on my book shelf — into digital form. To accomplish this, I invested in a Fujitsu ScanScan IX500.  The scanner runs for about $400.00. I selected this model based off of the many reviews2 touting that this scanner scans fast (duplex scan takes about 1 second for front and back), produces high-quality documents, and provides an easy to use intuitive touch screen interface. And after receiving and unpacking the equipment last night, I agree wholeheartedly.

    (more…)

  • I’m a messy person: it’s time for a change.

    I’m pretty embarrassed of how disorganized and messy our house looks and feels. I forget the color of the bathroom tile since its hidden from view due to dirty clothes sprawled out across the entire floor. I’m afraid of raising my standing desk for fear of a monitor toppling over due a caught wire and afraid of one of the many mugs spilling four day old tea. I cannot wipe down the kitchen counter because of the mega sized Maggi Soy Sauce (super delicious, by the way) towering over the stacked, dirty (or maybe clean) plates. By living this way, we’re sort of disrespecting our house, not taking care of it and looking after it in the way we should.

    It’s time for a change.

    My messy desk. Just one example of how disorganized the house is.

    (more…)

  • Guitar practice journal #1

    Today I practiced my guitar for 20 minutes, a generous amount of time these days (if you are parent you’ll understand). During this practice session, I worked ear training: I looped the song The Funeral (Band of Horses) on my iPhone and played along, plucking the individuals notes in chord progression on my Traveler’s acoustic guitar.

    Just before my 20 minute practice guitar session: jamming with Elliott
    Just before my 20 minute practice guitar session: jamming with Elliott

    During the practice session, I was able to nail down all the notes from the first two chords (triads) and was also able to determine that song was written in the key of G# (thanks music theory). However, I am a bit confused because the 2 of a major key, normally a minor chord, was played as a major. Is this swap of minor and major chord an example of modal mixture?

    Ultimately, I was unable to play the entire chord progression by ear and ended up finding a guitar tutorial1; uploaded on YouTube. Despite that, I’m happy with the progress I’ve made over the last two years of working on my music craftsmanship.

    References

  • Logical Writing & Steven Pinker’s Coherence Relations

    Have you ever read a passage that flows (i.e. has cohesion) but it just … doesn’t make any sense, no matter how many times you read it? You can lexically parse the passage (i.e. makes grammatically sense) but you cannot grasp the meaning? If so, the passage probably lacks coherence.

    What is coherence?

    According to Joseph Williams2, author of Style – Ten Lessons in Clarity & Grace, a passage is coherent when the sentences merge into a unified passage. The passage’s author not only needs to link pairs of individual sentences, but they need to sequence the sentences so that together, the sentences are unified. To this end, Joseph Williams suggests focusing the topics to a limited number of concepts. By doing so, the author helps prevent scattering the reader’s sense of what a passage is globally about. Moreover, Joseph Williams suggests using “connectives”, helper words that link one sentence to the next, words such as: and, but, or, therefore, nonetheless, however, even though, despite.

    But it’s … not that simple. Should connectives always be sued? According to Steven Pinker1, using too many connectives will belabor the obvious and potentially water down the material, patronizing the reader. On the other side of the spectrum, using an insufficient number of connectives can leave the reader puzzled and confused as to how one statement follows from the last.

    Wanting to better understand how to achieve a coherence, I read the chapter “Coherence” in Steven Pinker’s book. In the section that follows, I’ll share the 13 of the different ways one sentence can flow to another. These different methods are also known as coherence relations.

    (more…)

  • A healthy (no oil), quick (15 minutes prep, 15 minutes cook), plant based instant pot dish

    If you are looking for a quick, delicious, healthy (no oil), plant based meal that takes only 30 minutes (15 of those minutes are waiting for the dish to cook in an instant pot) to whip up, look no further. Check out Jill McKeever’s video on “The Red Lentil Stew From Instant Pot”:

    I’ve taken her recipe and slightly modified it, changing the proportions of the ingredients. More specifically, I kick up the number of potatoes. In the video, you’ll see she tosses only in 1 potatoes or so; I like my dish a little more starchy and tend to chop up and throw in in twice the amount (about 4 or 5 potatoes). And occasionally, I’ll mix it up with a zucchini (or as my British wife calls it: “Courgettes”).

    So the modified recipe is as follows:

    • 4 carrots
    • 4 potatoes
    • 1 teaspoon of paprika
    • 1 tablespoon of coriander
    • 1 medium-sized yellow onion
    • 2 garlic
    • 6 cups of vegetable stock
    • 1 cup of lentils (I don’t wash them but she does)
    • 3 ounces of tomato paste

    Definitely try this out. It’s so easy and so delicious! Bon Appetit!

  • A No-Excuses Guide to Blogging – Excuse #5 – “I don’t want to be wrong”

    Many people (including myself) fear that we will be perceived as a fool if we publish on a post blog that contains a mistake, a public mistake. Nobody wants to be humiliated publicly. This fear is encapsulated inside of a quote that Sacha shares:

    “Better to remain silent and be thought a fool than to speak and remove all doubt.”

    But like Sacha, I’d rather know when I’m being a fool. At work, I never shy away from asking “dumb questions”. I’ve come to realize that there’s normally at least one other person who has the same question but they often shy away from asking it for fear of looking stupid. I’ve been that person and I later kick myself in my butt for not speaking up.

    If you don’t put your thoughts into words — verbally or written — then its very easy to convince yourself that you understand something, when you really don’t. So many times in both my career and personal life I thought I understood some topic but when I started forming those thoughts into my own words, I realized I had gaping holes in my understanding. For example, my co-worker asked how and why we prefetch in our code base, and when I started explaining, I realized I had to refresh my memory on the cost of certain instructions and CPU pipelining.

    In summary, do yourself a favor and when you are learning something, try and explain it someone. You might discover gaps in your understand. And that’s perfectly okay because your writing becomes a “history of change and learning”. This allows us to take a step back and honor our progress and allow us to remember our mistakes and lessons learned along the way.

    References

    Chua, Sacha. 2014. A No-Excuses Guide to Blogging.

  • What vacation looks like with a 10 month year old

    Summary

    I never could’ve imagine what being a parent (to a 10 month year old) looks like while on a vacation at the Suncadia Hotel (in the midst of a pandemic). When our daughter sleeps sprawled out on the cloud like king size bed, us two parents are quietly scarfing down our cold dinner while watching an episode of “Westworld” off an iPhone that’s balanced behind the bathroom sink.

    Our lives revolve around Elliott’s sleeping schedule

    Before becoming parents, my wife and I lived a life with almost no constraints. If we wanted to spontaneously watch a movie at the theaters, we’d pop open our laptops, check the next show time, and then walk downhill for literally 5 minutes to the local theater. It was that simple.

    But those days are gone.

    Life is a little more complicated nowadays. Our schedules tend to revolve around Elliott’s sleeping schedule. This strict adherence applies even when we are away for a vacation.

    But why do we follow a sleeping schedule to begin with?

    It’s quite simple, actually. The bi-conditional logical connectivity is as follows: If and only if Elliott sleeps well can we (her parents) sleep well. And a night with lack of quality sleep makes everyone miserable. Therefore, it is in our best interest to ensure that Elliott clocks enough sleep.

    Sleeping environment at a hotel

    To that end, we need to transform our hotel room to an environment that’s conducive for sleeping. That means rendering the room pitch black by covering all the windows with the curtains, allowing no single ray of sun to shine through. This combined with a white noise machine — blasted at max volume that penetrates even the deaf — soothes the baby to sleep.

    On top of blackening out the room and pumping the sound machine, we need to remove as many distractions as possible. And at Elliott’s age (and probably moving forward), pretty much everything in sight is a distraction: including me. So while Jess puts Elliott down, I tip toe out of the hotel room, flicking off the lights on my way out, and then make my way down to the hotel communal area (still wearing a mask), my laptop in hand. And for this short period of time, about 30-45 minutes, I double down and focus and chip away at writing on my blog (like this post). And then I sneak back into the room once Elliott hits her deep sleep.

    Dinner in the bathroom

    What does dinner look like while at a hotel resort? Well, that depends. If Elliott is awake, then we take the opportunity and eat an early dinner (around 5:00 pm), the three of us squatting over a wooden dining table that’s a shoulder height of Elliott. But if Elliott is asleep, then dinner takes a different turn.

    In this scenario, you’ll find (as mentioned above) the room blacked out and two parents (Jess and myself) huddling in the hotel bathroom, the door shut closed so that we can whisper to one another without fear of waking Elliott up. While in the bathroom, we both pop in our air pods, sync them to an iPhone (since the wifi signal sucks in our room), and proceed to watch an episode of “Westworld” while slurping down our noodles:

    Jess and I quietly eating our dinner while Elliott is sleeping in the bedroom
  • Swapping values of two variables with XOR

    As programmers, we know that we can swap two variables by using a temporary variable. That’s fairly simple and intuitive: given two variables (x and y) that you want to swap, you store x in a temporary variable z, copy y to x, then finally copy z (the temporary) to y. But I learned recently (in my compiler’s course) that you can swap two variables without allocating a temporary variable, by using three xor operations. Here’s a little C program that demonstrates that idea:

    # include<stdio.h>
    void
    swap(int *x, int *y)
    {
         *x ^= *y;
         *y ^= *x;
         *x ^= *y;
    }
    
    int
    main(int argc, char *argv[])
    {
        int x = 123;
        int y = 234;
        printf("x=%d;y=%d\n", x, y);
        swap(&x, &y);
        printf("x=%d;y=%d\n", x, y);
    }
    ./xor-swap
    x=123;y=234
    x=234;y=123

    Neat, right?! But why would you ever want to take this approach? Especially if the underlying CPU instructions are more expensive with the xor approach. That is, the typical process for swapping two variables consists of 3 MOV instructions and the total number of cycles is 3 — one cycle per MOV instruction. Whereas 3 XOR instructions takes 9 cycles (3 cycles per instruction).

    Well, one explanation is that compiler writer is making a tradeoff: we’re sacrificing CPU cycles but in return we free up a register, which is especially important for the register allocator. In other words, we’re reducing register allocation pressure.

    Anyways, the last thing I want to demonstrate for you (and really, for myself) is to see 3 XOR operations at the binary level

    XOR at the binary level

    Although the code (above) proves that we can swap two variables using three XOR operations without a temporary variable, I wanted to actually carry out the XOR operations at the binary level to see for myself (cause seeing is believing, right?)

    For the example below, assume that we have two registers ebx (1101)and eax (0001).

    First operation – xor %ebx, %eax

    1101
    0001
    ====
    1100

    The xor operation yields 1100 and is then store into ebx.

    Second operation – xor %eax, ebx

    0001
    1100
    ====
    1101

    This operation yields 1101 which is then stored eax.

    Third operation – xor %ebx, %eax

    1100
    1101
    ====
    0001

    And hooray — the final xor yields: 0001.

    References

    http://www.asciitable.com
    https://c9x.me/x86/html/file_module_x86_id_330.html