Skip to main content

other

Google AdSense

In the localhost development environment, the following error message are normal phenomenon.

Failed to load resource: the server responded with a status of 403 ()

JavaScript

!!,!![], !!undefined, !!null

!!null false

!!undefined false

!! true

!![] true

React

Check React version.

npm view react version

Npm

npm update --save $Package_Name

npm up $Package_Name@latest

Gradle

The source folder in the lib folder in eclipse gradle project

The problem is that the New Gradle Project dialog invokes the Gradle init task with the hard-coded argument --type java-library and that the project layout for Gradle versions higher than 6.6.1.

Using gradle init, remove include in the settings.gradle, move all of files in src to root path.

Could not run phased build action using connection to Gradle distribution

Delete C:\Users\$USER\.gradle

How to properly ignore Junit 4 in Gradle and Maven

testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}

But, it requires you to know which dependency brings unpleasant dependency for you. In this case, you can use this command to track:

./gradlew dependencyInsight --dependency "junit:junit" --configuration "testCompileClasspath

Another method:

It is easy to exclude a dependency in one particular place:

/* for all the configurations */
configurations {
all {
/* only junit 5 should be used */
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}

/* for a particular test module */
configurations {
testCompile {
/* only junit 5 should be used */
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testRuntime {
/* only junit 5 should be used */
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
}

Windows

Windows 11 Taskbar Locked at double tall size after upgrade from Windows 10

reset taskbar config.

reg delete HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\IrisService /f && shutdown -r -t 0

VSCode

Cmake

"cmake.cmakePath": "C:\\tc\\cmake-3.24.3-windows-x86_64\\bin\\cmake.exe",
"cmake.generator": "MinGW Makefiles",
"cmake.mingwSearchDirs": [
"${env:SystemDrive}\\tc\\mingw64\\bin"
]

VSCode debug AttributeError: module 'main' has no attribute 'xxx'

TailwindCSS

Setting up a Tailwind Project 101 - Visual Code on Windows

"npm install -g win-node-env" (may be installed already)

"build:tailwind-dev": "npx tailwind -i src/style.css -o dist/css/style.css --watch",
"build:tailwind-prod": "NODE_ENV=production postcss src/style.css -o dist/css/style.min.css"

MUI

AppBar component
display: flex, flex-direction: column

Toolbar component
display: flex, flex-direction: row

Button component
display: inline-block

Eclipse

# Code template to English
eclipse.ini
-Duser.language=en_US

Rename project

Right click project -> Refactor -> Rename project
pom -> <artifactId> and <finalName>
Web project: Right click project -> Properties -> Web Project Setting, Context root
Right click project -> Maven -> Update Project -> Force Update of Snapshots/Release enabled -> OK