My experience as an ACM ICPC Regional Judge

I competed in ACM-ICPC for last three years. I was also an ACM-ICPC World Finalist in 2016. That year was a peak in my ACM-ICPC career as I competed in six(!) contests: three local contests, two regionals, and the world finals.

This year I retired from competing in the ACM-ICPC. My main reason is that the ACM-ICPC takes too much time. (After concentrating during the five hour contest, I would not be productive for weeks). I want to focus more on my research topics. However, I still stay as volunteer for this year contets that my university hosts.

Simple SPA for old-time programmer (and maybe newer one)

Note: Somehow it is hard to keep a regular schedule on blogging. Mostly because I have nothing worthwhile to write

Single Page App (SPAs) is the rage nowadays. Everyone seems to do SPAs left and right, whether it fits their application or not. As with anything concerning web development, there are billions of tools, helpers and frameworks to choose from. Most popular one are Angularjs (12), Emberjs, React and Vuejs.

There are older one like backbone, etc. but we won’t be discussing them todays.

Overwhelm by Complexity

The very first programming framework I have ever used was CakePHP. That was around the time when MVC framework was hyped (around 8 years ago, if I remember correctly). But to say my experience with it is not so good. In fact, I remember I fought with it way more than I really used it.

The reason, if I am asked now, was that I hadn’t really developed really large web application before, and a lot of those helpers/indirections didn’t make sense to me at all. It just overwhelmed me. Really. There are lots of thing to learn: MVC, ORM, conventions etc etc etc. And that time I was very naive.

Refactor, not rewrite

Last October I wrote TypingMania, a type-along game on web based on TypingMania Odyssey of SightSeeker studio. It’s not quite polished (the menu screen could use some serious work), but I am happy with it (well, I wrote it because I want to use it).

That was my first Javascript project in a very long time (~6 years), and of course the web changed a lot in the recent years. If you reviewed the code you will see many old style code, callback spaghetti and many synchronising boolean that look like some bad shot at thread safety, of which Javascript doesn’t have one.

Even though UI is always the most time-consuming part in any game – or application, really – the most fragile part of this piece of code is audio processing. It should be able to show loading indicator to tell how much has it buffered, it must have perfect time synchronising to the type-along part, and it must run in browser.

WAV file player in pure Javascript

Web Audio API is one of the cutting edge technology Javascript has offered. (It isn’t even supported in IE11! But both Chrome and Firefox now support it without prefix). It allows direct low-level manipulation of audio data (to sample level).

While .wav file format is supported by all browsers (Support here is defined by ability to be decoded via AudioContext.decodeAudioData, which is normally the same as those supported in <audio> tag), many other format is not, such as MP3/AAC/Ogg due to various patent problems. Because audio codecs, as opposed to video codec, require very low power to decode, it has been done in pure Javascript before (jsMAD, etc). I actually aim to write some audio decoder in pure Javascript too, so the .wav file playing is the first stepping stone. (audiocogs/etc is Not Invented Here™)

tl;dr here’s the code: https://gist.github.com/innocenat/5c5a48365930b691c863 Read on for detail.

Introducing InnoWiki

Well, this is not actually planned, but it is simple enough that I can hacked things together in a couple of day (and yes, the code is very short, but very hackish)

Let meet InnoWiki: http://innowiki.innocen.at/ [GitHub]

Reasons to hate Copyleft license

Copyleft license stated that any code that incorporated works under copyleft license (“derived work”) need to be licensed under same license. Their purpose is to make everyone contribute back to community, as in “Free as in Freedom” phrase by RMS. This idea look very good, and is in fact a very good idea to promote free and open source software. But people do need to eat, drink have needs. They also need money to survive.

My First Contribution to an Open Source Project: A story

Although I have been programming for a while (~10 years since I first learn programming), I have not yet made any (significant) contributions to existing works. I have done many projects, but all of them are either myself only or me and another designer. This changed last October, when I start contributing to AviSynth+, a modern fork of original AviSynth project, seriously. For a note, AviSynth is a script-based, non-linear video editing program/library.

Basic Image Processing

In my most recent Introduction to Computer Programming (aka CS101), the instructor decided to shows us very simple image processing: blurring and secret image hiding. There are quite a number of things he did not mention because they are too complicated, but I think someone might be interested so I decided to write it here.

I am not talking about how to load image or save image, you can easily find documentation online for your favourite language. Our professors talk about two algorithm in class: blurring and secret image hiding. I am going to cover only these two here.

Some side project: Brainfuck-JIT

I actually have wondered how JIT (Just-In-Time compiling) works for quite a long time, because it is basic knowledge that code segment in memory is write-protected, and you cannot move CPU instruction pointer to stack frame or heap for to security reason. But to do JIT you need to generate new machine code in memory and instantly execute it. How?

I stumbled upon this article titled “The Joy of Simple JITs”, which get me started. Apparently, you can do mmap (POSIX) or VirtualAlloc (Win32) to allocate virtual file in memory. And you can write to this section. And you can execute it. Looking great?

Some side project: Brainfuck-JIT

I actually have wondered how JIT (Just-In-Time compiling) works for quite a long time, because it is basic knowledge that code segment in memory is write-protected, and you cannot move CPU instruction pointer to stack frame or heap for to security reason. But to do JIT you need to generate new machine code in memory and instantly execute it. How?

I stumbled upon this article titled “The Joy of Simple JITs”, which get me started. Apparently, you can do mmap (POSIX) or VirtualAlloc (Win32) to allocate virtual file in memory. And you can write to this section. And you can execute it. Looking great?

On Assembly Language Syntax

In case you do not know assembly, let me introduce it briefly. x86 Assembly, which is mnemonic version of underlying x86 machine code, has two main syntax: AT&T syntax (or GAS syntax) and Intel syntax.

On Assembly Language Syntax

In case you do not know assembly, let me introduce it briefly. x86 Assembly, which is mnemonic version of underlying x86 machine code, has two main syntax: AT&T syntax (or GAS syntax) and Intel syntax.

Reasons why I don't hate PHP

PHP is probably the most hated programming language, ever. Yet it is so widely used, easy to write and easy to deploy that most programmers nowadays have to learn it at some point.

Unless you count pure HTML, PHP is what introduced me to programming world years ago. Back then I don’t know better, and PHP is so easy to write that I begin to commit to it. I do have a few big project written in PHP (not open sourced). Not for long, I begin experiencing nightmares of PHP, first being magic_quotes. I need to implement a lot of workarounds, but I still use PHP because back then (and even now), many shared hosters only support PHP. (I just use VPS now, though)

Reasons why I don't hate PHP

PHP is probably the most hated programming language, ever. Yet it is so widely used, easy to write and easy to deploy that most programmers nowadays have to learn it at some point.

Unless you count pure HTML, PHP is what introduced me to programming world years ago. Back then I don’t know better, and PHP is so easy to write that I begin to commit to it. I do have a few big project written in PHP (not open sourced). Not for long, I begin experiencing nightmares of PHP, first being magic_quotes. I need to implement a lot of workarounds, but I still use PHP because back then (and even now), many shared hosters only support PHP. (I just use VPS now, though)