If you run into this error: unauthorized_scope_error when trying to call certain LinkedIn APIs, here is a reference of which permissions you can use and cannot use with LinkedIn when you first create an application through https://www.linkedin.com/developers/

APIs using Authorization Code Flow (3-legged OAuth)

All APIs using Client Credential Flow (2-legged OAuth) are not available for use through the LinkedIn Developer Portal initially. You will need to go through certain Partner Programs to obtain access.

You will need to enable Sign in with LinkedIn Product to have the user grant permission to your application.

r_liteprofile — Required to retrieve name and photo for the authenticated user.


Python random.random() on Linux.

If computers are deterministic, how the hell does it calculate randomness? After traversing through blogs and forums, I could not find all encompassing article that went through the steps from input to output for this:

import randomrandom.random()

Explore with me as I dive into the concepts and the code on computing randomness. I am using Python 3.7 on Linux.

Disclaimer: Take this article as exploratory technical journalism, not as an authoritative source — I am more interested in concepts rather than precise details. I look at the happy path and do not cover any…

Photo by Zach Reiner on Unsplash

Dear Monty,

“This is a Hongmen Banquet” — “这是鸿门宴啊!”. This is a pretty fun idiom as this is jam packed with ancient history. Basically, you would use this idiom to describe a situation where it appears to be festive, celebratory, fun, an opportunity for pacification, but it is really a situation that is dire, dangerous, or even deadly. A situation that is created under false pretenses, expressed with a lie through one’s teeth, harboring ulterior motives. …

Photo by Guillaume de Germain on Unsplash

Dear Monty,

沉默是金 translates to “silence is golden”.

In modern English, silence is golden can mean it is better to keep quiet in order to not incriminate someone or yourself, similarly how lawyers tell their clients that loose lips sink ships. Or it could mean silence is a blissful state, kind of like how parents feel when all their children are finally asleep. Or it could provide cover to an introvert’s temperament, a justification for why we opt to quietly observe instead of engaging in verbal diarrhea spitting out every thought the moment it develops in the mind. …

When running MySQL8.0.18 on Mac OS X 10.14.6 Mojave, I tried executing this command:

mysql> SELECT ... INTO OUTFILE file;

I then ran into this error:

The MySQL server is running with the --secure-file-priv option so it cannot execute this statement secure_file_priv

When I ran this:

mysql> SHOW VARIABLES LIKE 'secure_file_priv';

I got this:

+------------------+-------+| Variable_name    | Value |+------------------+-------+| secure_file_priv | NULL  |+------------------+-------+

So I thinking that I just need to change the value assigned to secure_file_priv, I did this:

mysql> set @@secure_file_priv = '';

Then I got this:

ERROR 1238 (HY000): Variable 'secure_file_priv' is a…

This writing is just in case you get stuck following this tutorial from MySQL -> https://dev.mysql.com/doc/refman/8.0/en/loading-tables.html

When loading data into a table using a .txt file using mysql, the MySQL Command-Line Client that comes with the MySQL 8.0.18 package and executing this command:

mysql> LOAD DATA LOCAL INFILE 'path/file.txt' INTO TABLE table_name LINES TERMINATED BY '\r';

you may encounter this error:

ERROR 1148 (42000): The used command is not allowed with this MySQL version

A possible solution is to ensure that the MySQL server and mysql Command-Line client is enabled to read files locally. …

What I write here is not my teaching, but my study; it is not a lesson for others, but for me. — Montaigne

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store