Skip to content

Instantly share code, notes, and snippets.

View fantasticmao's full-sized avatar
🎧
After Rain -Scarlet ver.-

Mao Mao fantasticmao

🎧
After Rain -Scarlet ver.-
View GitHub Profile
@fantasticmao
fantasticmao / BugCheckCode.csv
Last active May 19, 2024 19:37
Windows 10 蓝屏 WinDbg 分析
BugCheckCode Count Reference
KERNEL_DATA_INPAGE_ERROR 4 https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/bug-check-0x7a--kernel-data-inpage-error
INTERNAL_POWER_ERROR 1 https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/bug-check-0xa0--internal-power-error
SYSTEM_SERVICE_EXCEPTION 2 https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/bug-check-0x3b--system-service-exception
CRITICAL_PROCESS_DIED 2 https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/bug-check-0xef--critical-process-died
DRIVER_VERIFIER_DETECTED_VIOLATION 1 https://learn.microsoft.com/zh-cn/windows-hardware/drivers/debugger/bug-check-0xc4--driver-verifier-detected-violation
package cn.fantasticmao.demo.java.lang.concurrent.simulation;
import java.util.concurrent.atomic.AtomicInteger;
public class TurnPrint {
private static class Task implements Runnable {
private final char c;
private final int remainder;
private final AtomicInteger count;
@fantasticmao
fantasticmao / SumNative.java
Created June 5, 2020 07:39
Java JNI 简单实践
package cn.fantasticmao.jni;
public class SumNative {
static {
System.loadLibrary("sum");
}
public native int sum(int a, int b);
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@fantasticmao
fantasticmao / favorite-apps.md
Last active April 21, 2024 10:12
My favorite applications on macOS and Windows

关系型数据库设计的三大范式:

  • 第一范式:要求表中的每个列的值都是原子的、不可再分的;
  • 第二范式:要求表中的每个列都要和表的主键有完全依赖关系;
  • 第三范式:要求所有非主键属性都只和主键有相关性,非主键属性之间应该是独立无关的。
@fantasticmao
fantasticmao / GC Options Notes.md
Last active November 29, 2018 16:35
Factors Affecting Garbage Collection Performance
@fantasticmao
fantasticmao / synchronized 关键字优化.md
Last active May 14, 2022 17:45
synchronized 关键字优化:Biased Lock、Lightweight Lock、Heavyweight Lock
  1. fat lock: http://hg.openjdk.java.net/corde-tools/jol/file/03064c057dc9/jol-samples/src/main/java/org/openjdk/jol/samples/JOLSample_14_FatLocking.java
@fantasticmao
fantasticmao / LinkedList.java
Created August 6, 2018 08:05
Comments for java.util.LinkedList base on JDK8
package java.util;
......
public class LinkedList<E>
extends AbstractSequentialList<E>
implements List<E>, Deque<E>, Cloneable, java.io.Serializable
{
// 链表中的节点个数
transient int size = 0;
@fantasticmao
fantasticmao / ArrayList.java
Created August 6, 2018 08:05
Comments for java.uitl.ArrayList base on JDK8
package java.util;
......
public class ArrayList<E> extends AbstractList<E>
implements List<E>, RandomAccess, Cloneable, java.io.Serializable
{
// 内部数组的默认容量
private static final int DEFAULT_CAPACITY = 10;