Jamie's Blog

  • Home
  • About me
  • Blogs

Blogs

Backend Development

Difference between JUnit 5 an JUnit 4

JUnit 5 aims to adapt the Java 8 style of coding and to be more robust and flexible than JUnit 4. In this post, JUnit 5 vs JUnit 4, we will focus on some major differences between JUnit 4 and JUnit 5. 1. Read more…

By jamie, 2 years6 November 2023 ago
Frontend Development

Pass Context between Siblings Using Context in React

export const NumberContext = React.createContext(); function App() { const [foo, changeFoo] = useState('foo') return ( <NumberContext.Provider value={{ foo, changeFoo }}> <TheButton /> <Display /> </NumberContext.Provider> ); } function TheButton() { const { changeFoo } = useContext(NumberContext) return ( <button onClick={() Read more…

By jamie, 2 years3 November 2023 ago
CSS

Image Height adaptive and consistent with the Width of the parent div in CSS

<div class="box"> <img src="upimg/comm.png"/> </div> <div class="box"> <img src="upimg/comm1.png"/> </div> <div class="box"> <img src="upimg/comm2.png"/> </div> .box{ width: 100%; margin: 20px auto; background: skyblue; position: relative; padding-bottom: 56%; // change this overflow: hidden; } .box>img{ width: 100%; position: absolute; top: 0; Read more…

By jamie, 2 years31 October 2023 ago
Frontend Development

React Error: Can’t perform a React state update on an unmounted component.

In my project, I jumped to another page before the web request was returned and found that the console reported an error: Warning: Can’t perform a React state update on an unmounted component. This is a no-op, but it indicates Read more…

By jamie, 2 years31 October 2023 ago
Frontend Development

The useState asynchronous Callback in React Hook can’t Get the Latest Value and the Solution

First of all, setState has two ways of passing parameters: Pass the new value directly: setState(options) const [state, setState] = useState(0); setState(state + 1); Pass in the callback function: setState(callBack) const [state, setState] = useState(0); setState((prevState) => prevState + 1); Read more…

By jamie, 2 years31 October 2023 ago
Backend Development

MySQL Strings Segmentation

SUBSTRING_INDEX(str, delim, count) str: the string to be split. delim: the delimiter. count: the position of the delimiter. A positive number means extract from left to right, a negative number means extract from right to left. For example: SELECT SUBSTRING_INDEX('100-200-300-400', Read more…

By jamie, 2 years26 October 2023 ago
Backend Development

Mybatis gets the primary key returned by the insert operation

When using mybatis as a persistence layer, insert, update, delete, sql statements do not return the primary key of the record being operated on by default, but rather the number of records being operated on. When we want to get Read more…

By jamie, 2 years20 October 2023 ago
CSS

Five ways to achieve ‘Sticky Footer’ in CSS

The purpose of a sticky footer is that it “sticks” to the bottom of the browser window. But not always, if there is enough content on the page to push the footer lower, it still does that. But if the Read more…

By jamie, 2 years6 September 2023 ago
eslint

[eslint] Delete `CR` [prettier/prettier]

When Prettier is used in conjunction with ESLint, ESlint detects the crlf and cr differences between the code runtime and the project creator to the point where all ends of lines errors are reported. Reason For historical reasons, windows and Read more…

By jamie, 2 years6 September 2023 ago
Frontend Development

Deploy a React project to server (II) – Router

Last time, I deployed a React.js project on a server. But I found the router doesn’t work. I click the menu to other child pages. It always returns a 404 page. I did some search and found the reason. When Read more…

By jamie, 2 years28 August 2023 ago

Posts pagination

Previous 1 … 3 4 5 … 9 Next
Categories
  • AWS (2)
  • Backend Development (36)
  • Bootstrap (1)
  • Computer Science (3)
  • Crawler (1)
  • CSS (3)
  • Database (11)
  • Design Model (1)
  • Docker (12)
  • Elasticsearch (2)
  • eslint (1)
  • Frontend Development (25)
  • git (1)
  • Gradle (1)
  • Gson (1)
  • hibernate (1)
  • HTML (1)
  • Jackson (2)
  • Java (13)
  • javascript (3)
  • json (2)
  • junit (4)
  • Linux (7)
  • Mybatis (4)
  • MySQL (7)
  • Networks (3)
  • Nginx (1)
  • prettier (1)
  • Pyppeteer (1)
  • React (16)
  • Spring (2)
  • Springboot (2)
  • Strapi (2)
  • version control (1)
  • wordpress (2)
  • About me
  • Blogs
  • Front Page
Hestia | Developed by ThemeIsle