作者: remo

  • ROG 魔霸9 9955hx3d 5070ti 更换显卡液金为霍尼韦尔7958SP

    ROG 魔霸9 9955hx3d 5070ti 更换显卡液金为霍尼韦尔7958SP

    省流:用时约40分钟,更换前后温度基本不变。

    新买的电脑,使用约一周。

    更换硅脂前,125w CPU功耗下一直会顶功耗墙95°。双烤CPU约50w功耗释放,CPU约75°左右,GPU在x0甜甜圈下功耗约100w约68-70°。

    开始更换 霍尼韦尔7958SP 。全部螺丝卸下后小幅度扭动两侧上方把手,用点劲即可拆下散热模组。此时需要额外注意残留在散热模组上的液态金属。

    拆下后可以明显观察到不少液金溢出,但是大概是拆的时候挪动的。

    散热模组上有海绵垫隔绝液金溢出,保护性还不错。

    用酒精和棉条将液金擦除,这个过程需要耐心,弄了大概20分钟。

    最终清理干净。

    然后更换散热硅脂。合盖结束。

    最终烤机温度与更换前基本一致。是的你没看错,是基本一致。

    并且可以通过垫高获得额外接近4°的提升。因此何乐而不为呢?

  • 风格化卡通体积云

    风格化卡通体积云

    function getCloudColor(
        viewVector,      // 视线方向
        skyColor,        // 背景天空色
        basePos,         // 射线起点
        samples,         // 采样次数
        umbral,          // 阈值,用于剔除低噪声
        brightFactor,    // 高光强度
        dither,          // 抖动参数
        CLOUD_PARAMS     // 各种云层平面、中心、厚度等常量
    ):
        // 1. 如果视线朝下,直接返回天空色
        if viewVector.y0:
            return skyColor
    
        // 2. 计算射线与上下云层平面的交点 t0、t1
        t0 = (CLOUD_BOTTOM - basePos.y) / viewVector.y
        t1 = (CLOUD_TOP    - basePos.y) / viewVector.y
    
        // 3. 生成采样起点 p 和步长 stepV
        p     = basePos + viewVector * t0
        pEnd  = basePos + viewVector * t1
        stepV = (pEnd - p) / samples
        p    += stepV * dither  // 加入少量抖动,减少条带
    
        // 4. 沿射线采样,累积“云厚度” cv 和“首次击中深度” den
        cv       = 0          // 累计的云体积分量
        den      = 0          // 首次进入云层的相对位置(0~1)
        firstHit = true
        totalRange = (CLOUD_CENTER - CLOUD_BOTTOM) + (CLOUD_TOP - CLOUD_CENTER)
    
        for i in 0 .. samples-1:
            // 4.1 采样噪声(height field)
            noiseHi = sampleNoiseHeight(p.xz, timeOffsetHigh)
            noiseLo = sampleNoiseHeight(p.zx, timeOffsetLow)  // 可选多层混合
            noise   = mixAndSmooth(noiseHi, noiseLo)
    
            // 4.2 根据阈值计算云层上下边界
            v    = (noise - umbral) / (1 - umbral)
            inf  = CLOUD_CENTER - v * (CLOUD_CENTER - CLOUD_BOTTOM)
            sup  = CLOUD_CENTER + v * (CLOUD_TOP    - CLOUD_CENTER)
    
            // 4.3 判断当前采样点 p.y 是否在云层内部
            if inf < p.y < sup:
                cv += min(stepLength, sup - inf)
                if firstHit:
                    den      = (sup - p.y) / totalRange
                    firstHit = false
            else if withinSoftEdge(p.y, inf, sup, CLOUD_EDGE_WIDTH):
                // 边缘过渡:软添加一点积累
                cv += softBlendAmount(p.y, inf, sup) 
                if firstHit:
                    den      = (sup - p.y) / totalRange
                    firstHit = false
    
            p += stepV
    
        // 5. 归一化累积值和深度
        opacity   = clamp(cv / (2 * CLOUD_EDGE_WIDTH / viewVector.y), 0, 1)
        density   = clamp(den, 0.0001, 1)
    
        // 6. 按 density 分层选色:低—中—高
        if density < 0.33:
            baseColor = COL_SH  // 云底色
        else if density < 0.66:
            baseColor = COL_MD  // 中层色
        else:
            baseColor = COL_HI  // 云顶色
    
        // 7. 视向高光:只有高密度部分才额外提亮
        if density > 0.66:
            highlight = dot(computeNormal(density), -viewVector)
            baseColor = mix(baseColor, COL_HI, highlight * brightFactor)
    
        // 8. 自阴影:越厚越暗
        baseColor *= mix(1.0, 0.85, density^2 * 0.5)
    
        // 9. 边缘描边:根据深度场梯度增强轮廓
        edgeFactor = computeEdgeFactor(opacity)
        baseColor  = mix(baseColor, OUTLINE_COLOR, edgeFactor * 0.3)
    
        // 10. 根据天空亮度在夜间适当暗化
        nightFactor = computeNightFactor(skyColor)
        baseColor  *= nightFactor
    
        // 11. 最终混合:云层覆盖背景
        alpha = opacity * clamp((viewVector.y - 0.05) * 5.0, 0, 1)
        return mix(skyColor, baseColor, alpha)
    
    JavaScript
  • Prevent ‘Zone.Identifier’ Files from Appearing in WSL2

    When using Windows Subsystem for Linux 2, we access our Linux file system using Windows Explorer. When we copying and pasting files, might notice addition files like ‘xxx Zone.Identifier‘.

    The ‘Zone.Identifier‘ file is a Windows Attachment Manager feature that stores security information about files. However, since WSL2 uses an ext4 file system, Windows cannot store ADS natively. Instead, it creates a visible ‘Zone.Identifier‘ file in the same directory.

    1. Delete Existing Files

    If you already have ‘Zone.Identifier‘ files in your WSL2 directories, use one of the following methods to remove them.

    find ~/[Your Path] -name "*:Zone.Identifier" -delete
    Bash

    2. Disable Windows from Generating ‘Zone.Identifier

    If you frequently access WSL2 files from Windows and want to permanently stop Windows from attaching ‘Zone.Identifier’, you can disable this feature via Group Policy or Registry Editor.

    Press Win + R, type gpedit.msc, and hit Enter.

    Configuration → Administrative Templates → Windows Components → Attachment Manager
    用户配置 → 管理模板 → Windows 组件 → 附件管理器(In Chinese)

    Enable “Do not preserve zone information in file attachments

  • [Leetcode]4 Mar. 2025. Count Trailing Zeros in Factorial

    Description:

    Given an integer $n$ , return the number of trailing zeros in $n!$ (n factorial).

    Factorial is defined as:
    $$
    n! = n \times (n – 1) \times (n – 2) \times \dots \times 3 \times 2 \times 1
    $$

    Examples:

    Example 1:
    Input: n = 3
    Output: 0
    Explanation: 3! = 6, which has no trailing zeros.

    Example 2:
    Input: n = 5
    Output: 1
    Explanation: 5! = 120, which has one trailing zero.

    Example 3:
    Input: n = 0
    Output: 0

    Constraints:

    • $0 \leq n \leq 10^4$

    class Solution {
    public:
        int trailingZeroes(int n) {
            int count;
            while(n >= 5){
                n = n / 5;
                count += n;
            }
            return count;
        }
    };
    
    /*
    ## Counting 5 as a factor.
    
    We Need To Determine how many times "10" appears as a factor in the product.
    
    10 is formed by multiplying 2 & 5, we can only count 5 as a factor.
    
    eg:
    - 3! = 3*2*1 = 6 -> +0
    - 5! = 5*4*3*2*1 = 120 -> +1
    - 10! = 10*9*...*3*2*1 = 3628800 -> +2
    */
    C++

  • Typst就是个半成品。。

    Typst就是个半成品。。

  • 真三国无双起源 貂蝉mod

    真三国无双起源 貂蝉mod

    使用方法: 把文件解压放在根目录就可以了. 服装使用默认. 如果想换回初始角色, 删除dll即可.

  • Copy-Paste Between VMware Virtual Machine and Host (Shared Clipboard)

    To enable copy-paste between a VMware virtual machine and the host system, follow these steps:

    Install the necessary tools:

    sudo apt install open-vm-tools
    sudo apt install open-vm-tools-desktop
    Bash

    Go to: VMware > Virtual Machine > Settings > Options > Guest Isolation

    Enable the Copy and Paste feature.

    Then, Restart your system.

    sudo reboot
    Bash

zh_CNCN