Notes

Learn to Count in JS!

In the past few weeks, I suddenly recalled of an interesting problem I faced during my days in Competitive Programming world. It was called “Make*me-an+[integer!]“, a problem posted in Internet Problem Solving Contest 2015 problemset (link to problem)

The gist of the problem statement is as such:

Output a list of valid ECMA-262 expression of the number 0 to 1000 (inclusive) using only the characters !, [, ], +, , and/or *, in which the correctness is determined by the value and the type of the expression itself.

For example, !![] evaluates to the number 0 (this is a valid output), and +!![]+[+[]] evaluates to string “10” (this is invalid, as the output type need to be evaluated as type number too).

The problem has two subtasks: the easy subtask is to produce the outputs where each expression uses no more than 200 characters; and the hard subtask limits the expression to use no more than 75 characters.

During the competition itself, I solved the easy subtask, but now I was quite interested in solving the hard subtask because … why not? Hahaha. In total, I spents around 2 weeks (including the many off days in between as I wasn’t in the mood for coding).

So, let’s get into the problem.

This is not a thought

18 March 2018

Zen, isn’t it?

Recently, I have some encounters of this zen topics: on YouTube video, on a Geekcamp 2017 talk, and on a podcast.


Kurzgesagt: Emergence

The YouTube video that I encounter was a video by Kurzgesagt on the topic of emergence. It talks about when a living being is by itself, it is pretty stupid, but when it become collective, intelligence emerged.

  • There is no wet, but collectively, there is wetness.
  • There is no city, but collectively, there is a city.
  • There is no society, but collectively, there is a society.

Geekcamp: meta-circular programming language interpreter.

What if we make a programming language interpreter, using the programming language itself, and later use this interpreter to interpret it’s own source code. This is what is meant by meta-circular.

There is no program, the source code is representation of the program.

Similarly, there is no interpreter, the source code is representation of interpreter. Hence, if a source code of an interpreter of a language is written on the language itself, theoretically, it should be able to interpret itself, right?


Podcast. Radiotopia Showcase: Ways of Hearing.

The podcast series is about analog and digital recording.

Digital audio is for machine. Song recorded using analog recorder could have a faster beat around chorus. Digital made it even and regular, made the beats tied to a clock.

A record is a performance of the song at that time of recording. This means that there is no song, there is a representation of a song.


This is not a thought. This is a representation of a thought itself.

 

Code Practice

9 March 2018

Recently, at work, I have been participating in a big feature project; and halfway through, after the UIs were implemented, I swapped place with a colleague (i.e. his part become mine, and mine become his). Man, it was really hard to complete the rest of the code using his. It’s just that his style of code writing is so much different from mine. …

Radio

14 February 2018

I have an obsession with radio, especially BBC Radio 1.

I’ve started listening to BBC Radio 1 since 2011. I’m listening from UTC+7 and UTC+8 time zones. Because of that, I can only listen to daytime radio shows. Greg James is my favorite, as he has more similar music taste to me. Some other shows that are okay: Alice Levine. Danny Howard’s Dance Anthems were great too. This show plays song remixes only, and for first hour or two, it was usually good, but after a while, you kinda sick of remixes. …

Phone Notifications

tl;drAndroid notification settings is less controllable than that of Windows Phone


Back in 2014, I bought my first smartphone, a Nokia Lumia 1020, powered by Windows Phone 8 (if you didn’t count Nokia E72 with Symbian S60v3 as a smartphone). Windows Phone 8 have notification features, but it was just a toast and will be gone after a while. So, the way to check your phone real “notifications” is to go into each of the apps to check for updates (but it will be indicated at apps’ Live Tile). It was not long before my phone OS was upgraded into Windows Phone 8.1, where the toast notifications are collected at Notification Center until it was dismissed by the user.

But I was not a fan of notification.