Skip to content

Instantly share code, notes, and snippets.

@qdwang
qdwang / dt900prox-eq-fix.md
Created January 17, 2024 13:19
EQ Fix for DT 900 RPO X

Rtings

You can use filters 1-5 or 1-10. Apply preamp of -5.6 dB or -5.6 dB, respectively.

# Type Fc (Hz) Q Gain (dB) BW
1 LowShelf 105 0.7 7.7 1.917
2 Peaking 56 0.35 -3.9 3.331
3 Peaking 1335 1.43 2.3 0.989
4 Peaking 3931 2.47 7.3 0.580
5 Peaking 6380 0.92 -6 1.500
@qdwang
qdwang / rgba_issue.rs
Created October 24, 2023 19:00
cannot handle RGBA data with libjxl
#![allow(non_camel_case_types)]
use core::ffi::c_void;
const WIDTH: usize = 4;
const HEIGHT: usize = 4;
const NUM_CHANNELS: usize = 3; // 3 is ok, but 4 will cause the JXL_ENC_ERR_API_USAGE issue
fn main() {
let mut img_data = [255u8; WIDTH * HEIGHT * NUM_CHANNELS];
@qdwang
qdwang / error_msg
Created March 11, 2023 14:51
error_msg_rust_tch
error: linking with `link.exe` failed: exit code: 1169
|
= note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\qdwang\\AppData\\Local\\Temp\\rustcpAAM21\\symbols.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.11ab2gh1slc0cpa9.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.1403db1fyofum8sz.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.15pbjxcluvvrebgi.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.16oisqgfc92coauq.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.1fvzy55in8g7syor.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pytorch-test\\target\\debug\\deps\\rust_pytorch_test.1hm228yuu1rsz3ss.rcgu.o" "C:\\Users\\qdwang\\Desktop\\Codes\\rust-pyt
@qdwang
qdwang / pytorch_training_problem.py
Created March 9, 2023 07:46
pytorch_training_problem
import torch
from torch import nn, Tensor
from torch.nn.functional import *
class MyModel(torch.nn.Module):
def __init__(self) -> None:
super(MyModel, self).__init__()
self.encoder_input_layer = nn.Linear(3, 512)
self.decoder_input_layer = nn.Linear(1, 512)
self.output_layer = nn.Linear(512, 1)
@qdwang
qdwang / pytorch_learn_sin.py
Created March 8, 2023 14:07
pytorch learn sin
import torch
import random
from torch.nn.functional import *
device = "cuda"
class MyModel(torch.nn.Module):
def __init__(self, d_model, **args) -> None:
super(MyModel, self).__init__()
self.transformer = torch.nn.Transformer(d_model=d_model, **args)
@qdwang
qdwang / kaggle.md
Last active April 15, 2024 06:35
kaggle简要指南
@qdwang
qdwang / main.rs
Created October 17, 2022 06:39
fn vs trait for iterator
use std::iter::Map;
#[inline]
fn triple_iter(input: impl Iterator<Item = u16>) -> impl Iterator<Item = u16> {
input.map(|x| x * 3)
}
#[inline]
fn double_iter(input: impl Iterator<Item = u16>) -> impl Iterator<Item = u16> {
input.map(|x| x * 2)
}
@qdwang
qdwang / test_rust1.log
Created January 12, 2022 01:25
asm compare
Dump of file test_rust1.exe
File Type: EXECUTABLE IMAGE
0000000140001000: 55 push rbp
0000000140001001: 48 89 E5 mov rbp,rsp
0000000140001004: 48 89 4D 10 mov qword ptr [rbp+10h],rcx
0000000140001008: 48 89 55 18 mov qword ptr [rbp+18h],rdx
000000014000100C: 4C 89 45 20 mov qword ptr [rbp+20h],r8
@qdwang
qdwang / change-icon.js
Last active November 8, 2021 13:10
change-icon
const rcedit = require('rcedit')
rcedit("GUI/Build/win/abc.exe", {
"icon": "GUI/Asset/Texture/icon.ico",
"version-string": {
CompanyName: "QRP1",
ProductName: "QRP2",
FileDescription: "QRP3",
LegalCopyright: "QRP4",
LegalTrademarks: "QRP5"
},
@qdwang
qdwang / Makefile.static.win
Last active November 7, 2021 06:31
Makefile.static.win
all: library
CXX=clang++
CFLAGS=-target x86_64-w64-windows-gnu -I.
CFLAGS+=-Ofast -funroll-loops
# ZLIB support (FP dng)
CFLAGS+=-DUSE_ZLIB