If chance were different
Could I be a tree
Stay there
Waiting for the wind
Getting the rain
Wearing the snow
Besides of the quiet lake
Or..
A cat
Kept by kind people
Chocolate and coffee everyday
And sunshine
Warm~
If chance were different
Could I be a tree
Stay there
Waiting for the wind
Getting the rain
Wearing the snow
Besides of the quiet lake
Or..
A cat
Kept by kind people
Chocolate and coffee everyday
And sunshine
Warm~
I’m not sure what I’m chasing,
But it’s certainly something beautiful.
…
It’s there, just the shape is blurry.
It’s a beautiful feeling.
…
That makes up my whole world.
Brighten my sky.
Use Express backend to send email from a gmail account.
Use nodemailer to send email with OAuth2 for obtaining access token, during which “two-legged OAuth” (2LO) is used for signature, which directly obtain the access token without manual user consent.
[1] Google API NodeJS Client. https://github.com/google/google-api-nodejs-client
[2] Preparing to Make an Authorized API Call. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests
[3] Explanation of Two-Legged OAuth (2LO) in nodemailer. http://nodemailer.com/smtp/oauth2/#oauth-2lo
[4] Using access token for HTTP request. “HTTP/REST” section of https://developers.google.com/identity/protocols/OAuth2ServiceAccount#callinganapi
[5] Example of using access token in nodemailer. http://nodemailer.com/smtp/oauth2/#oauth-2lo
[6] Nodemailer. https://nodemailer.com/about/
[7] Create Service Account in Google. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount
[8] Authorize domain-wide authorization to the service account. The G Suite Account used in domain-wide authorization contains the gmail used to send email from Express backend. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority
不是一瓶酒
不是一罐药
是踩着现实的泥潭阔步向前的韧劲
Ken Perlin. An Image Synthesizer.
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.
Sangwon Lee, Sven C. Olsen, Bruce Gooch. Simulating and Analysing Jackson Pollock’s Painting
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?
Maria Shugrina, Margrit Betke, John Collomoss. Empathic Painting: Interactive stylization through observed emotional state
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:
Express Emotion in Region Turbulence
Express Emotion in Color
Express Emotion in Stroke Denotation Style
Characters are segmented to make it possible to animate.
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:
Book link:
https://www.amazon.com/Art-Journey-Matthew-Nava/dp/0985902213
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
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:
if (config.use_env_variable) {
var sequelize = new Sequelize(process.env[config.use_env_variable], config);
} else {
var sequelize = new Sequelize(config.database, config.username, config.password, config);
}
The real issue was unveiled by seeing different value of the same var `env` when assessing var values related to “config” in the import-header section:
var env = process.env.NODE_ENV || ‘development’;
var configFile = require(__dirname + ‘/../config/config.json’);
var config = configFile[env];
var db = {};
console.log(“[DEBUGGING] __dirname”, __dirname);
console.log(“[DEBUGGING] configFile: “, configFile);
console.log(“[DEBUGGING] env: “, env);
console.log(“[DEBUGGING] config: “, config);
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:
So, a couple lessons here to solve an issue
With GLSL implementation of atmospheric scattering, it’s easy to change aesthetics of sky and see the effect on the fly.
Normal Sky:
Dreamy Sky with Aesthetic Changes:
Lastly, a sunrise animation created in a few seconds benefited from the real-time performance of GLSL: