This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function b(max) { | |
| const B = Array(max + 1).fill(0); | |
| B[0] = 1; | |
| B[1] = 1/2; | |
| for (let n = 2; n <= max; n += 2) { | |
| let sum = 0; | |
| let c = 1; | |
| for (let j = 0, j2 = n; j <= n / 2; j += 2, j2 -= 2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Go, Chan, Lock } from "./go"; | |
| const chan = Chan<number>(); | |
| const sumPromise = Go(async ($: WaitFn) => { | |
| let sum = 0; | |
| for await (const msg of chan.receive()) { | |
| console.log('Received', msg); | |
| sum += msg; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local o = vim.opt | |
| local map = vim.keymap.set | |
| local api = vim.api | |
| local nvim_create_autocmd = api.nvim_create_autocmd | |
| local nvim_create_augroup = api.nvim_create_augroup | |
| -- ============================================================================= | |
| -- Global Options | |
| -- ============================================================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::arch::asm; | |
| use core::ptr::null_mut; | |
| // https://github.com/torvalds/linux/blob/276f98efb64a2c31c099465ace78d3054c662a0f/arch/x86/entry/syscalls/syscall_64.tbl | |
| const SYS_RSEQ: u64 = 334; | |
| // https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno-base.h | |
| const EINVAL: i64 = 22; | |
| // https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/errno.h | |
| const ENOSYS: i64 = 38; |
OlderNewer