• Home
  • All Posts
  • Tags
  • About
  • Atom feed
BJ's writing place

Backend

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Cache

Common Caching Strategies and How to Choose November 4, 2024 3 minute read

I recently read an article that introduces various caching strategies. This was also my first time using NotebookLM. This tool significantly enhanced my understanding of the topic. You can ask questions in this notebook: NotebookLM

Common Caching Strategies and How to Choose

1. Read-Through Caching

  • With read-through caching, the application first checks the cache for the requested data.
  • If the data is not in the cache, it’s fetched from the original source, added to the cache, and then returned to the client.
  • Benefits: This approach ensures data is always available, even if it’s not initially... read more

ChatGPT

How ChatGPT changed the way I work as a Software Engineer? June 30, 2024 1 minute read

I used to rely heavily on Google to search for answers to technical problems. However, since the advent of ChatGPT, it has significantly boosted my efficiency in solving problems and learning new technical skills: ChatGPT. In this post, I will explain how I’ve integrated ChatGPT into my workflow and the steps I follow to approach solutions using this AI assistant.

Step 1: Question Definition

The first step is to determine whether or not to use ChatGPT to solve a particular problem. I use the following matrix to make this decision:

  • Syntax in Programming Languages While I can... read more

Curriculum

The curriculum to learn machine learning August 7, 2024 2 minute read

I would like to learn more about machine learning and build something interesting in my free time. Problem is I am so done with the online courses, because those classes requires you to take the bundle of courses and to learn something I might have known before. As a result, I looked up the discussions from reddit and found a curriculum here The goal of the curriculum is to learn how to build and deploy a ML application in the end. Since most of them are reading materials, I could pick up what I want and tailer those resource... read more

Docker

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Fullstack

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Linkedin Learning

Summary for the linkedin learning lecture - Motivation February 18, 2025 2 minute read

Science behind motivations

  • If-then rewards (e.g., “If you do this, then you get that”) are highly effective for simple tasks with short time horizons.
  • These same rewards are less effective for complex tasks with longer time horizons because they narrow focus and limit creativity.
  • Organizations should apply if-then rewards for simple tasks but use different motivational strategies for complex, long-term tasks to foster enduring motivation and creativity.
  • money matters, so pay fairly

Purpose

  • two types of purpose
    • making a significant impact, like solving major global issues
    • making a contribution in everyday tasks, like improving... read more
Summary for the linkedin learning lecture - Work Smarter, Think Sharper, Live Better: 15 Tips for Igniting Your Potential February 12, 2025 4 minute read

Work Smarter

Configure your day

Match tasks to your energy levels:

  • Peak (morning): Focus on analytic work that requires concentration and vigilance.
  • Trough (early to mid-afternoon): Handle routine tasks that don’t require much brainpower.
  • Recovery (late afternoon/evening): Engage in creative work when your mood is up but vigilance is lower.

Set priorities

  • Identify your Most Important Task (MIT): Each day, determine your most important task and complete it before anything else.
  • Create a To-Don’t List: List three things that waste your time and energy, and make sure to avoid them.
  • Focus on Top Goals:... read more

MERN

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Machine Learning

What I learned in Kaggle course - Machine Learning Explainability December 9, 2024 3 minute read

Why do we need to explain feature in machine learning?

We need the answer to the question:

What features have the biggest impact on predictions?

Problem 1: Why permutation importance?

  • fast to calculate,
  • widely used and understood, and
  • consistent with properties we would want a feature importance measure to have.

What did I learn?:

  • How do we get the feature importance?

    If I randomly shuffle a single column of the validation data, leaving the target and all other columns in place, how would that affect the accuracy of predictions... read more

What I learned in Kaggle course - feature engineering December 9, 2024 9 minute read

Why do we need feature engineering?

For a feature to be useful, it must have a relationship to the target that your model is able to learn.

Feature engineering is a process to transform the features to make their relationship to the target. Problem is:

how do you identify features in the dataset that might be useful to combine?

Problem 1: What is Mutual Information(MI)?

What we’re calling uncertainty is measured using a quantity from information theory known as “entropy”. The entropy of a variable means roughly: “how many yes-or-no questions you would... read more

What I learned in Kaggle course - intermediate machine learning November 21, 2024 3 minute read

After completing Lesson 2 in the Intermediate Machine Learning course on Kaggle, I categorized my learning journey into six problems.

Problem 1: Handling Missing Values in Input Data

What did I learn?:

  1. Drop the columns with missing values
    • Cons: This can lead to loss of valuable information and potential bias.
  2. Impute with mean value or other existing common value
    • Cons: It may not always be clear which value to impute.
  3. Add an additional column to indicate imputation

Tips:

  • Remember to add the columns and index back... read more

MongoDB

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

NodeJS

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Reading Digest

The Ultimate Start-Up Guide March 7, 2025 2 minute read

After reading this book, I found even if I don’t start up a business, I could improve the way I think about my career path and the way I talk to others in a presentation.

How to generate idea?

  • Start with why(customers’ need) instead of what(technology)
    • customers’ need: the hole in market
  • Two component to develop:
    • Vision
      • to investors
        • is there disruption? -> create new market/customers
    • Function spectrum
      • to target audience
        • is there any relevance? -> will it solve my problem?
    ... read more
Undoctored March 6, 2025 6 minute read

I found this book insightful, but I am not quite sure if the recipes in the book are tasty. So, let me just share some ideas from the book.

Chap. 2: Who Took the “Health” out of Health Care?

Health care is the system created to deliver the greatest revenue-generating products and procedures to address illness, but not provide health

The unspoken secret is that providers prefer treatment over prevention, expensive over inexpensive, patent-protectable over non-patent-protectable, billable procedure over non billable procedure, BMW over Toyota Prius.

More free time is nice. More love among... read more

Typescript

MERN project setup: setup Nodejs server and Typescript July 19, 2024 1 minute read

This is a tutorial about MERN stack setup. Through this article, we could understand the directory structure of MERN project, how to setup backend environments. In next article, I will detail more about how to set up frontend and how to dockerize each services including database.

Outlines

  • Initialize server and client directories in MERN directory
  • Install NodeJS packages in server directory
  • Spin up MongoDB docker container and connect the container

Directories structure

Firstly, we could just make two directories client and server in the project root directory, which is usually the directory... read more

Working

How ChatGPT changed the way I work as a Software Engineer? June 30, 2024 1 minute read

I used to rely heavily on Google to search for answers to technical problems. However, since the advent of ChatGPT, it has significantly boosted my efficiency in solving problems and learning new technical skills: ChatGPT. In this post, I will explain how I’ve integrated ChatGPT into my workflow and the steps I follow to approach solutions using this AI assistant.

Step 1: Question Definition

The first step is to determine whether or not to use ChatGPT to solve a particular problem. I use the following matrix to make this decision:

  • Syntax in Programming Languages While I can... read more

Writing

The Ultimate Start-Up Guide March 7, 2025 2 minute read

After reading this book, I found even if I don’t start up a business, I could improve the way I think about my career path and the way I talk to others in a presentation.

How to generate idea?

  • Start with why(customers’ need) instead of what(technology)
    • customers’ need: the hole in market
  • Two component to develop:
    • Vision
      • to investors
        • is there disruption? -> create new market/customers
    • Function spectrum
      • to target audience
        • is there any relevance? -> will it solve my problem?
    ... read more
Undoctored March 6, 2025 6 minute read

I found this book insightful, but I am not quite sure if the recipes in the book are tasty. So, let me just share some ideas from the book.

Chap. 2: Who Took the “Health” out of Health Care?

Health care is the system created to deliver the greatest revenue-generating products and procedures to address illness, but not provide health

The unspoken secret is that providers prefer treatment over prevention, expensive over inexpensive, patent-protectable over non-patent-protectable, billable procedure over non billable procedure, BMW over Toyota Prius.

More free time is nice. More love among... read more

Change Jekyll Theme without forking the theme repository November 17, 2024 1 minute read

Context:

Originally, I have a jekyll with default theme. But, in this theme, I can not categorize the blog posts. So, I want to change the theme to support categories.

I found a template that looks good to me. Problem is most of the themes mentioned that we need to fork their repository and copy-paste all of the posts. However, I don’t want to fork the new theme repository. Instead, I want to reuse my original repository.

I found a SO. I followed the instruction to create a new branch:

git checkout --orphan... read more
					

health

Undoctored March 6, 2025 6 minute read

I found this book insightful, but I am not quite sure if the recipes in the book are tasty. So, let me just share some ideas from the book.

Chap. 2: Who Took the “Health” out of Health Care?

Health care is the system created to deliver the greatest revenue-generating products and procedures to address illness, but not provide health

The unspoken secret is that providers prefer treatment over prevention, expensive over inexpensive, patent-protectable over non-patent-protectable, billable procedure over non billable procedure, BMW over Toyota Prius.

More free time is nice. More love among... read more

issue solved

Rails clean precompiled asset August 27, 2024 less than 1 minute read

Context:

In ruby on rails project, I would like to live compile the assets on production. But, newly added CSS is not applied to the production. I found there is a setting config.assets.compile = false, which means the production is using precompiled assets.

However, after setting config.assets.compile = true, it is still not working. This post is to navigate this situation.

Trial:

Clean the precompiled assets RAILS_ENV=production rake assets:clean It is still not working, because there is still public/assets in the project directory.

Solution:

Another command: RAILS_ENV=production... read more

jekyll

Change Jekyll Theme without forking the theme repository November 17, 2024 1 minute read

Context:

Originally, I have a jekyll with default theme. But, in this theme, I can not categorize the blog posts. So, I want to change the theme to support categories.

I found a template that looks good to me. Problem is most of the themes mentioned that we need to fork their repository and copy-paste all of the posts. However, I don’t want to fork the new theme repository. Instead, I want to reuse my original repository.

I found a SO. I followed the instruction to create a new branch:

git checkout --orphan... read more
					

kaggle

What I learned in Kaggle course - Machine Learning Explainability December 9, 2024 3 minute read

Why do we need to explain feature in machine learning?

We need the answer to the question:

What features have the biggest impact on predictions?

Problem 1: Why permutation importance?

  • fast to calculate,
  • widely used and understood, and
  • consistent with properties we would want a feature importance measure to have.

What did I learn?:

  • How do we get the feature importance?

    If I randomly shuffle a single column of the validation data, leaving the target and all other columns in place, how would that affect the accuracy of predictions... read more

What I learned in Kaggle course - feature engineering December 9, 2024 9 minute read

Why do we need feature engineering?

For a feature to be useful, it must have a relationship to the target that your model is able to learn.

Feature engineering is a process to transform the features to make their relationship to the target. Problem is:

how do you identify features in the dataset that might be useful to combine?

Problem 1: What is Mutual Information(MI)?

What we’re calling uncertainty is measured using a quantity from information theory known as “entropy”. The entropy of a variable means roughly: “how many yes-or-no questions you would... read more

What I learned in Kaggle course - intermediate machine learning November 21, 2024 3 minute read

After completing Lesson 2 in the Intermediate Machine Learning course on Kaggle, I categorized my learning journey into six problems.

Problem 1: Handling Missing Values in Input Data

What did I learn?:

  1. Drop the columns with missing values
    • Cons: This can lead to loss of valuable information and potential bias.
  2. Impute with mean value or other existing common value
    • Cons: It may not always be clear which value to impute.
  3. Add an additional column to indicate imputation

Tips:

  • Remember to add the columns and index back... read more

live style

Undoctored March 6, 2025 6 minute read

I found this book insightful, but I am not quite sure if the recipes in the book are tasty. So, let me just share some ideas from the book.

Chap. 2: Who Took the “Health” out of Health Care?

Health care is the system created to deliver the greatest revenue-generating products and procedures to address illness, but not provide health

The unspoken secret is that providers prefer treatment over prevention, expensive over inexpensive, patent-protectable over non-patent-protectable, billable procedure over non billable procedure, BMW over Toyota Prius.

More free time is nice. More love among... read more

rails

Advantages of using ReactJS in Rails project May 29, 2025 2 minute read

Foreword

Recently, I have been working on a feature to display a list of file records stored in various data repositories. The goal is to present different data repositories along with their corresponding file records on a single page. The user interface consists of a tab widget for switching between data repositories, and within each tab’s content, there is a table widget listing all the file records.

It’s important to note that a file record can also represent a folder. When a user clicks on a folder record in the table, the table content needs to be refreshed. To... read more

Rails clean precompiled asset August 27, 2024 less than 1 minute read

Context:

In ruby on rails project, I would like to live compile the assets on production. But, newly added CSS is not applied to the production. I found there is a setting config.assets.compile = false, which means the production is using precompiled assets.

However, after setting config.assets.compile = true, it is still not working. This post is to navigate this situation.

Trial:

Clean the precompiled assets RAILS_ENV=production rake assets:clean It is still not working, because there is still public/assets in the project directory.

Solution:

Another command: RAILS_ENV=production... read more

reactJS

Advantages of using ReactJS in Rails project May 29, 2025 2 minute read

Foreword

Recently, I have been working on a feature to display a list of file records stored in various data repositories. The goal is to present different data repositories along with their corresponding file records on a single page. The user interface consists of a tab widget for switching between data repositories, and within each tab’s content, there is a table widget listing all the file records.

It’s important to note that a file record can also represent a folder. When a user clicks on a folder record in the table, the table content needs to be refreshed. To... read more

startup

The Ultimate Start-Up Guide March 7, 2025 2 minute read

After reading this book, I found even if I don’t start up a business, I could improve the way I think about my career path and the way I talk to others in a presentation.

How to generate idea?

  • Start with why(customers’ need) instead of what(technology)
    • customers’ need: the hole in market
  • Two component to develop:
    • Vision
      • to investors
        • is there disruption? -> create new market/customers
    • Function spectrum
      • to target audience
        • is there any relevance? -> will it solve my problem?
    ... read more

summary

What I learned in Kaggle course - Machine Learning Explainability December 9, 2024 3 minute read

Why do we need to explain feature in machine learning?

We need the answer to the question:

What features have the biggest impact on predictions?

Problem 1: Why permutation importance?

  • fast to calculate,
  • widely used and understood, and
  • consistent with properties we would want a feature importance measure to have.

What did I learn?:

  • How do we get the feature importance?

    If I randomly shuffle a single column of the validation data, leaving the target and all other columns in place, how would that affect the accuracy of predictions... read more

What I learned in Kaggle course - feature engineering December 9, 2024 9 minute read

Why do we need feature engineering?

For a feature to be useful, it must have a relationship to the target that your model is able to learn.

Feature engineering is a process to transform the features to make their relationship to the target. Problem is:

how do you identify features in the dataset that might be useful to combine?

Problem 1: What is Mutual Information(MI)?

What we’re calling uncertainty is measured using a quantity from information theory known as “entropy”. The entropy of a variable means roughly: “how many yes-or-no questions you would... read more

What I learned in Kaggle course - intermediate machine learning November 21, 2024 3 minute read

After completing Lesson 2 in the Intermediate Machine Learning course on Kaggle, I categorized my learning journey into six problems.

Problem 1: Handling Missing Values in Input Data

What did I learn?:

  1. Drop the columns with missing values
    • Cons: This can lead to loss of valuable information and potential bias.
  2. Impute with mean value or other existing common value
    • Cons: It may not always be clear which value to impute.
  3. Add an additional column to indicate imputation

Tips:

  • Remember to add the columns and index back... read more
  • Backend (1)
  • Cache (1)
  • ChatGPT (1)
  • Curriculum (1)
  • Docker (1)
  • Fullstack (1)
  • Linkedin Learning (2)
  • MERN (1)
  • Machine Learning (4)
  • MongoDB (1)
  • NodeJS (1)
  • Reading Digest (2)
  • Typescript (1)
  • Working (1)
  • Writing (4)
  • health (1)
  • issue solved (1)
  • jekyll (1)
  • kaggle (3)
  • live style (1)
  • rails (2)
  • reactJS (1)
  • startup (1)
  • summary (3)

    2025 © Bao-Jhih Shao

    Posts
    Tags
    About