Skip to content

Instantly share code, notes, and snippets.

@wbminsssss
wbminsssss / extractjdk.bat
Last active December 29, 2024 08:17
从exe文件中提取用于Windows (Java 8以下)的Oracle JDK
@echo off
rem
rem Extract an Oracle JDK for Windows (up to Java 8) from the EXE file
rem (c) Olivier Gérardin 2018 [email protected]
rem Adapted from https://stackoverflow.com/questions/1619662/how-can-i-get-the-latest-jre-jdk-as-a-zip-file-rather-than-exe-or-msi-installe
rem 在这个脚本基础上修改 https://gist.github.com/ogerardin/8f6797186e80e504542680a01594be95
rem 在 AI(gemini-1.5-pro-latest) 和我的努力下完成
rem 新建一个文件夹,里面应该包含 7z.exe、jdk-*-windows-x64.exe、extractjdk.bat(内容为当前脚本),将exe文件拖拽用这个脚本打开
rem
@wbminsssss
wbminsssss / VirtualThreadPool
Created May 28, 2024 06:05
创建一个虚拟线程池
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* @author wubo
*/
@wbminsssss
wbminsssss / tool
Last active May 28, 2024 06:05
控制台输出一个进度条
/**
* 控制台输出一个进度条
* 例如 测试 => [##################################################] 12/12 (100%)
*
* @param prefixStr 进度条前缀
* @param total 总进度
* @param current 当前进度
*/
public static void consoleProgressBar(String prefixStr, int total, int current) {
int percent = (int) ((double) current / total * 100);