Skip to content

Instantly share code, notes, and snippets.

@lxfly2000
lxfly2000 / important-directx-sdk-version.md
Last active June 20, 2025 02:09
几个比较重要的DirectX SDK版本下载

几个比较重要的DirectX SDK下载地址

目前Windows操作系统只有Win10/11是微软仍在支持的,这两个系统支持的DirectX运行版本支持到12.

  • 最后一个含有DirectX8.0(仅32位,不含D3DX8)以及之前版本的SDK为2007年8月版本,推荐安装环境:WinXP+VS2005,因为这两个都已被官方停止支持所以不推荐使用DirectX8.0,下载链接(已失效)(与Windows SDK同时使用会引起冲突)
  • 最后一个含有DirectX9.0版本的SDK为2010年6月版本,推荐安装环境:Win7+VS2010,下载链接
  • 之后版本的DirectX SDK被集成到了Windows SDK中并且不再提供D3DX的组件,推荐安装环境:Win8.1+VS2013,下载链接
  • Windows 10 SDK加入了DirectX12的组件,推荐安装环境:Win10+VS2015或更高版本,下载链接

其中使用Win8或更新版本SDK开发的DirectX11.1程序在Win7上运行需要安装KB2670838更新。

win7

@lxfly2000
lxfly2000 / jstest.cpp
Created March 17, 2025 14:56
VC++ and JS interop using Chakra
#include<Windows.h>
#include<jsrt.h>
#pragma comment(lib,"jsrt.lib")
int WINAPI wWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hPrevInst, _In_ LPWSTR param, _In_ int iSW)
{
JsRuntimeHandle runtime;
JsContextRef context;
JsValueRef result;
unsigned currentSourceContext = 0;
@lxfly2000
lxfly2000 / geoatlas_download.py
Created January 4, 2025 05:32
下载阿里云DataV.GeoAtlas的地图数据(到县级)
# python 3.11
import os
import json
from urllib import request
from urllib.error import HTTPError
def save_json(str,path):
print("保存至\""+path+".json\"")
open(path+".json","wb").write(str)
@echo off
setlocal ENABLEDELAYEDEXPANSION
if "%~1"=="" (
echo No path specified.
goto:eof
)
call:listcd %1
goto:eof
:listcd
@lxfly2000
lxfly2000 / js-blacklist.txt
Last active April 1, 2025 05:43
JavaScript网站黑名单
www.baidu.com 广告 强制跳转
m.baidu.com 广告 强制跳转
image.baidu.com
cn.bing.com 广告
weibo.com
s.weibo.com
m.weibo.cn
www.zhihu.com 强制登录
blog.csdn.net 广告
sina.cn
@lxfly2000
lxfly2000 / wer.reg
Created November 13, 2023 10:48
Win10中错误报告默认是关闭的,此项用于开启
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting]
"DontShowUI"=dword:00000000
@lxfly2000
lxfly2000 / fix_you_srt_tl.py
Last active October 23, 2023 13:11
修复YouTube下载的字幕时间轴重叠问题
# Python 3.11
import sys
#00:00:00,000
def srt_time_to_ms(str):
return ((int(str[0:2])*60+int(str[3:5]))*60+int(str[6:8]))*1000+int(str[9:12])
def ms_to_srt_time(ms):
milli=ms%1000
@lxfly2000
lxfly2000 / restore_bili_video.py
Last active October 12, 2023 12:38
恢复B站UWP下载的加密视频(可将该脚本放在sendto文件夹下)
# Python 3.9
import sys
def restore_bili_video(video_path):
print("Restoring... "+video_path)
ext=video_path[video_path.rfind("."):]
fin=open(video_path,"rb")
if fin.read(1)!=b"\xff":
print("This file is not encrypted by bilibili.")