Think like a bird, live like a frog

The paper proposes the initial algorithm of Perlin Noise, and a few variations of the algorithm to simulate a variety of randomnesses in nature.

The technique produces organic randomness appears in nature. It proposes an algorithm to produce random look, which is made uniformly distributed by a narrow bandpass limit in frequency. This statistic character of the randomness maintains unchanged with varying domains. Because the algorithm satisfies statistical invariances under rotation and translation.

The most beautiful part of the paper is the description of Perlin Noise: an organized array, when associated with the gradient of the organized array and an augmentation value, both are stochastic, is transformed to a stochastic value which is used together with the gradient to interpolate areas between the stochastic value of the current organized array and the ones of other organized arrays. NOTE: the augmentation arguments for all organized arrays determines the generated stochastic values. The distribution of the augmentation arguments of all organized arrays determines the uniformness of the generated stochastic values.

The paper devises a system to allow user create Pollock-like painting with a painting material simulator which allows user paint without using real material, and with real-time feedback of fractal properties of the ongoing painting, which gives user an awareness of the similarity between the fractal dimension of the ongoing painting and those of Pollock’s painting. That means, the user is capable of creating Pollock-like painting by keeping the similarity high.

The paper points out that fractal dimension is incapable of distinguishing fractal and nonfactual images, and proposes an new metric, uniformity, to alleviate the limitation. Uniformity indicates the similarity between the fractal dimension of a subregion and those of the entire painting. But, in what way does uniformity distinguish fractal and nonfactual images better than fractal dimension does?

Emotion is majorly expressed from a combination of color and stroke. The paper analyzes color, stroke denotation style, and region turbulence to transform them to emotions. It can be found in Section 4.2 Rendering Parameters:

Scary faces comes from a question that “what if the character you control is on the dark side?”

Principles of expressing emotions using landscape composition:

Openness, happiness: if the fog is pushed away from the player, the view becomes clear, which makes player feel happier; on the other hand, if the fog is close to the player, the blurry view makes the player feel scary

Blue sky is used to award the player at the end of the game. Green skies were used earlier as a random alternative of the blue sky, from what the artist said

Dreamy and high quality light is used to make the player feel magical at the end of the game

The purpose of this blog is to record the turning points of fixing a crashed web app on Azure, which works locally.

Background

The web app is built with ExpressJS as the backend, sequelize as the ORM, Azure PostgreSQL as the database, React and Redux as frontend. It’s hosted on Azure.

Problem

The web app runs on local browser, but crashes on Azure after it’s deployed. The broken website on Azure shows “HTTP ERROR 500”.

Turning Points

Azure log stream

Log stream printed out a detailed error when the deployed web app is browsed from azure portal: “TypeError: Cannot read property ‘use_env_variable’ of undefined”. This error happens on the first line of the following code block on model/index.js:

Specifically, `var` is `development` on local machine, but is `production` on Azure. Whereas the config.json file specifying database configuration doesn’t have the `production` key.

Thoughts

Looking back, I realize the key to fix the “HTTP ERROR 500” error of the Azure web app is precisely identifying the problem. That means, I needed to figure out on which line of code and which vars didn’t work as expected. This statement holds firmly because that’s the nature of an application wrote by a programming language.

Then, what’s the most effective way of precisely identifying the problem? Turns out using debugging tool to log as much related values of the application as possible is the right way, at least for this case.

However, I didn’t take the most effective approach at the first sight! Specifically, for “HTTP ERROR 500”, I searched online, and got hints of logging application states. That directed me to check Azure’s log stream. But for “TypeError: Cannot read property ‘use_env_variable’ of undefined”, I had wrong guess of the cause of the issue: I imagined the compilers on Azure and on my local machine are different – the compiler on local machine ignores the TypeError detected on Azure. Even worse, I firmly believed my imagination of the cause of the issue is true.. It was me randomly logged the var values that helped me unveiling the real issue.

The native approach I took to fix the problem unveils some mistakes I made for solving tech problems:

I should’ve realized “TypeError: Cannot read property ‘use_env_variable’ of undefined” means “config” is undefined, and should’ve logged out related vars of “config”, instead of imagining the difference between local machine and Azure compiler. I think what I really miss here is that for a web app, the first priority of debugging is logging out vars, then consider system and compilers issues. But learning “TypeError: Cannot read property ‘use_env_variable’ of undefined” was necessary too.

So, a couple lessons here to solve an issue

Learn the error by googling

Use the right debugging tool to precisely identify the issue – it should be specific to code level