I’ve made terrible purchases since living alone. I should’ve avoided non-stick cookware from the beginning. I bought a non-stick wok which I used for everything (what a terrible mistake that was) and it just failed to do a proper job at anything as expected. Non-stick coating quickly wore off and seasoning it was a nightmare, not to mention unsafe. Then I bought a non-stick pan which was fine for a while, until I made the mistake of leaving it empty on stove that was on medium for 30 minutes. It had what looked like melted non-stick coating marks all over, which I tried to clean with salt WITHOUT OIL. I rubbed too hard with the salt DRY which got most of the stains off, but I think it completely ruined the pan (which I suspect was already ruined).

Then I bought a stainless steel pan, larger one for stir-fry and general purpose. First attempts at frying egg ended up in terrible mess with egg sticking everywhere. Then I tried seasoning it with veggie oil at high heat and I had almost the non-stick -like pan without all the teflon. Seasoning is pretty delicate thing — I am still learning how to make a good seasoning. I will probably trash the non-stick wok and pan I bought since they’re not only terrible at their jobs but also dangerous in my health because of the residues that go into the food. I learned that adding stir-fry sauce and simmering is not that great for the seasoning. Subsequent cooking of egg on the stainless steel pan was not that great. I don’t know if this is because of acidic properties of soy sauce or my scrubbing was too hard with hot water.

However, I like stir-frying and it seems like the pan can’t do both. I might just get another stainless steel pan for frying eggs :/.


Parsing: Expression Recursion

Expression Node in most language grammars is going to have to be as convoluted as ever since it could evaluate to many things… This is what boring saturday night leads to:

Edit: Source is available at

I’ve stopped working on this due to.. living life, but may come back to it someday later, maybe not in this form, but for sure for better.


Screenshot from 2015-03-14 21:02:45 Screenshot from 2015-03-14 21:02:52

Making Compiler: Lexer (Continued) and Parser

Latest progress…  I’m well into the parser now, for which I estimate I’ve done 35%-ish. It’s actually gotten a lot more fun as it feels like coding building blocks that work together nicely. The hand written, recursive descent parsing takes a bit of effort for debugging ambiguities and understanding what is going on, but at least it is fun. Initially I suspected recursion depth _might_ be a problem, but seeing the testcases, I suppose it’s not that big of a deal (at least from my unit tests).

Some excerpts:

Screenshot from 2015-03-14 02:32:02 Screenshot from 2015-03-14 02:32:48 Screenshot from 2015-03-14 02:32:53Screenshot from 2015-03-14 02:35:53

Compiler: Motivation for my own toy language and Handwriting Lexer

I wanted a language that combined the likeable features of Python, C, and functional programming. I replaced somethings in Python such as ‘:’ and indent for braces and kept heterogeneous element containers. I especially liked how Python exposes fundamental container data types so natively, so I kept all the brace notations such as [],(),{},set(). Grammar is still being worked out, to add more desirable features that Python lacked such as operator overloading (variable length operator too!), complex switch statement, and perhaps more functional list comprehension which I dubbed as iterator, which works more like Mathematical set notation.

Imagine if you could write code like

for {float f| |f| < 10, stepSize(0.01), isReal, otherFilters}
//do stuff with f

I had to revive my old memories about writing a lexer, from days of university. At the same time, I wanted to practice using C++11 features. I decided to handwrite a lexer using C++11 features. I unfortunately did not implement the main logic using NFA->DFA transformation for additional performance, but I suspect this won’t be a typical performance bottleneck in the pipeline.

Screenshot from 2015-03-08 01:59:51

Stop pulling hair out with git

To help understand how git works, I scrambled this post on what I know about simple workflow in git. I first started my project locally and then I added VCS using ‘git init’ in the existing project’s root directory.

Then I wanted to host it on github. I did this by creating
git push -u

But if I want to skip adding “-u” everytime I push, I can do:
git remote add up

If I want to compare my local current branch commits to my remote’s branch, I need to do:
git branch –set-upstream master up/master  //replace master with your branch

To see your tracked files:
git ls-files

To see your modifications, here is neat coloured output:
git log –pretty=format:”%Cblue%h:%Cred%ce: %Cgreen%s” –name-status –graph

Make alias of above in your .gitconfig in default home directory.
hist = log –pretty=format:\”%Cblue%h:%Cred%ce: %Cgreen%s\” –name-status –graph

A common thing is to compare my local branch to remote for unpushed commits. You can do this by:
git hist origin..      //this is implied as git hist origin..master


The converse, “git hist ..origin” would show how far your remote is ahead in commits.

The importance of learning and continued learning: Address the failings of institutionalized learning with Online Courses

I am a software engineer. It’s still hard to fathom how I got here from the days of studying at university, knowing only a fraction of what I know today. I never liked the course curriculum in university or highschool as they follow strict guideline on what to teach students and judge based on how students adapt to it, not allowing enough freedom. I, like most people, did struggle in university from rapid learning, testing, and demanding schedules. I think that did more damage to my learning process as that meant that to get a good marks, I selectively picked courses that I knew I could manage better and avoided courses that I knew I would have hard time in. Not only was this correct in experience, but the fact that I had to do this to avoid learning something so crucial was I think a failure in educational experience. You could argue that it entirely depends on student(I) to make the choice to learn or not, but when you are judged on how well you understand a difficult subject in limited time, a realist in student must make a choice.

That’s why I chose to instead pick online courses that I couldn’t comfortably pick in university. One such course I HIGHLY HIGHLY recommend is Algorithmic Thinking on Coursera. If you haven’t taken a course in university that teaches the fundamentals of computing (Most CS students will learn this, but engineering student me could only optionally take it), you should take this. It teaches you about all the fundamentals of computing, the tools and theories that empower you to approach most problems easily. It’s essential to being a programmer, so much so that if you weren’t taught this, I don’t know how you call yourself a programmer. Even if you weren’t, do learn this, and you become master of the tools to tackle any problems previously taught to be hard and trivialize them with few lines of python.

Transitioning from Windows to Linux Mint: Blender

It’s been sometime since I moved from using Windows to Linux Mint and for more than reasons I can currently describe, I am satisfied with what Linux has to offer. Some argue that the reason they stay on Windows is that there is no media softwares and games on Linux. I tell them if they knew what Blender is and what it’s capable of. The lack of games on Linux is more or less chicken and egg problem where game developers and publishers cite lack of market presence of gamers on Linux platform, hence refusing to develop on, let alone port their games to Linux. I don’t develop games (yet) and am probably not qualified to tell you which OS supports better environment for developing games. However, since using Linux from growing up through university and day job, I’ve quite grown fond of the extremely-dev-friendly environment that Linux has set up for its users.

I’ve disliked development offerings on Windows such as lack of a useful shell and compiler and the fact that to get anything done on Windows you need to buy proprietary software for anything. Sure, I could shell out a few thousand bucks for latest Visual Studios, Photoshop, etc., but the thought that I can never find a use case that would require proprietary software over a free one just seemed irrational. At first, like many others, I tried dual-booting Linux with Windows. But this process has caused me way more undeserved pains, so I eventually ended up just going pure Linux route.

I began searching for “replacement” tools on Linux that are equivalent in function in Windows. For office related tools, there was LibreOffice which more or less has everything I need. For video editing tools, I was pleasantly surprised that Blender is capable of this as well. Search youtube and you’ll find the power Blender gives to users on video sequence editing which supports multi-stream video/audio editing plus many mods which are scriptable through Python, which is one of the EASIEST and SIMPLEST scripting language you should and must master (without it, how do you even call yourself a programmer?). Learning how to use Blender was a lot of fun, discovering many things it can do: General 3D graphics editor, Video/Audio editor, Game Engine

If that weren’t enough, Linux let me experiment and learn how a server is setup. The whole thing is baked into the OS which is very nice. Seriously, it’s so easy to just grab a virtual server from cloud provider like digitalocean/cloudatcost, a domain name, and willingness to dig into server tools like apache, a little sudo apt-get install’s and you have a working private server which you could access anywhere you go. Nice thing about servers is that you get tons and tons of bandwidth that you can’t even get as a home internet service here in Canada. I have 15 Mbps down / 1 Mbps up bandwidth home internet. I measured 700 Mbps down/up from my virtual server.

If you were stuck on Windows, you’d never figure out how you can even start doing this. I’m still a novice in many vast areas, but Linux has shown me the light.

Here’s a crappy T-rex I made in blender 😀


All other blender works that I made are found here: