(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"sync" | |
"time" | |
) |
@ExperimentalPagerApi | |
@Composable | |
fun WormHorizontalPagerIndicator( | |
pagerState: PagerState, | |
modifier: Modifier = Modifier, | |
activeColor: Color = LocalContentColor.current.copy(alpha = LocalContentAlpha.current), | |
inactiveColor: Color = activeColor.copy(ContentAlpha.disabled), | |
indicatorWidth: Dp = 8.dp, | |
activeIndicatorWidth: Dp = 25.dp, | |
indicatorHeight: Dp = indicatorWidth, |
/** @param sampleRate {number} */ | |
/** @param channelBuffers {Float32Array[]} */ | |
function audioBufferToWav(sampleRate, channelBuffers) { | |
const totalSamples = channelBuffers[0].length * channelBuffers.length; | |
const buffer = new ArrayBuffer(44 + totalSamples * 2); | |
const view = new DataView(buffer); | |
const writeString = (view, offset, string) => { | |
for (let i = 0; i < string.length; i++) { |
// >>> DatHost Competitive Config 0.1 <<< // | |
// Reset from Practice to Competitive | |
sv_cheats "false" // Disable cheats | |
mp_ct_default_grenades "" // Spawn CTs without grenades | |
mp_t_default_grenades "" // Spawn Ts without grenades | |
sv_showimpacts "0" // Don't show bullet impacts | |
sv_falldamage_scale "1" // Enable fall damage | |
sv_full_alltalk "0" // Disable voice chat with anyone |
(draft; work in progress)
See also:
async function generateOneTimePassword(rawKey: Uint8Array, counter: number): Promise<number> { | |
const data = new DataView(new ArrayBuffer(8)); | |
data.setBigUint64(0, BigInt(Math.floor(counter)), false); | |
const algo = { name: 'HMAC', hash: 'SHA-1' }; | |
const key = await crypto.subtle.importKey('raw', rawKey, algo, false, ['sign']); | |
const hmacHash = new Uint8Array(await crypto.subtle.sign(algo, key, data.buffer)); | |
const offset = hmacHash[hmacHash.byteLength - 1] & 0x0f; | |
const hotp = (hmacHash[offset] & 0x7f) << 24 |
{ stdenv, autoPatchelfHook }: | |
stdenv.mkDerivation rec { | |
pname = "wasmcloud-binaries"; | |
version = "1.0"; | |
src = ./.; # Assuming the binaries are in the current directory | |
nativeBuildInputs = [ autoPatchelfHook ]; |
2020年初因为新冠肺炎爆发,所以在家办公,公司给配置了L2TP的VPN,但是我不想所有流量都走VPN(VPN比较慢而且也节省流量),于是想到用路由表给VPN分流。
具体的方案就是公司内网的流量走VPN,外网流量走默认网关。
我是在macOS上操作的,其他平台应该也差不多。
假设:
公司内网 192.168.10.0/24
家里网络 192.168.1.0/24
你已经配置好VPN并且可以使用了。
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
import { decode } from "blurhash" | |
export function blurHashToDataURL(hash: string | undefined): string | undefined { | |
if (!hash) return undefined | |
const pixels = decode(hash, 32, 32) | |
const dataURL = parsePixels(pixels, 32, 32) | |
return dataURL | |
} |