Skip to content

Instantly share code, notes, and snippets.

View htfy96's full-sized avatar
🐢
WFH

Zheng Luo htfy96

🐢
WFH
View GitHub Profile
@htfy96
htfy96 / build.sh
Created October 12, 2019 01:57
libwasmfoo
_deps/wasiclang-src/opt/wasi-sdk/bin/clang --sysroot _deps/wasiclang-src/opt/wasi-sdk/share/wasi-sysroot stb_vorbis.c -c -o stb_vorbis.
_deps/wasiclang-src/opt/wasi-sdk/bin/clang -Wl,--export-all --sysroot _deps/wasiclang-src/opt/wasi-sdk/share/wasi-sysroot *.o -o lib.wasm
cargo/release/lucetc --bindings _deps/mod_lucet-src/lucet-wasi/bindings.json --reserved-size 256MiB lib.wasm -o libwasmfoo.so --opt-level 2
@htfy96
htfy96 / childexit-pipe.c
Created September 23, 2019 23:30
Detecting child exit with pipe
#include <stdio.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <assert.h>
#include <sys/select.h>
#include <stdbool.h>
@htfy96
htfy96 / discrete.cpp
Created October 4, 2018 14:47
discrete
#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> a {1, 3, 3, 2, 5};
vector<int> b;
for (int i=0; i<a.size(); ++i)
b.push_back(i);
@htfy96
htfy96 / proof.md
Created September 19, 2018 05:08
Proof of identication

I hereby claim:

  • I am the person who sends Wechat messages and moments at Sept 18 22:07 - 22:17 PDT from account @VicLuo96

To claim this, I sign this message with my pubkey 0x98809CA08BF5662A:

I hereby claim:

- I am the person who sends Wechat messages and moments at Sept 18 22:07 - 22:17 PDT from account @VicLuo96
set shell=/bin/bash
syntax on
if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
filetype on
filetype plugin on
set autoindent
set nolazyredraw
set number
@htfy96
htfy96 / A-small-attempt-3.out
Created July 29, 2018 12:50
GCJ Kickstart Round D Problem A: Solution and sample data
Case #1: 13
Case #2: IMPOSSIBLE
Case #3: 2
Case #4: 386239
Case #5: IMPOSSIBLE
Case #6: IMPOSSIBLE
Case #7: IMPOSSIBLE
Case #8: 84609596512776
Case #9: 0
Case #10: 1155268877829
@htfy96
htfy96 / IteratedRun.sol
Last active June 17, 2018 04:42
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract IteratedRun {
struct City {
bytes32 name;
bool visited;
}
address owner;
City[] cities;
@htfy96
htfy96 / strong-datas.md
Last active June 2, 2018 14:45
839-strong-datas

2000 strings, all 'aaaaaaaaa'

["aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaaaa", "aaaaaaa
@htfy96
htfy96 / bad_rendering_results.md
Last active December 27, 2017 09:19
A collection of my bad rendering results

living_room_1000x1000_0

living_room_1000x1000_0

living_room_1000x1000_0

living_room_1000x1000_0

cs

@htfy96
htfy96 / gdb_cquery.log
Created November 19, 2017 06:40
GDB log for cquery
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7f7c5e0c3740 (LWP 11427) "querydb" 0x00007f7c5a696756 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
2 Thread 0x7f7c5936a700 (LWP 11428) "stdin" 0x00007f7c598caa98 in read () from /usr/lib/libc.so.6
3 Thread 0x7f7c58b69700 (LWP 11429) "stdout" 0x00007f7c5a696756 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
4 Thread 0x7f7c48368700 (LWP 11430) "completequery" 0x00007f7c5a69143d in pthread_join () from /usr/lib/libpthread.so.0
5 Thread 0x7f7c53fff700 (LWP 11431) "completeparse" 0x00007f7c5a69143d in pthread_join () from /usr/lib/libpthread.so.0
6 Thread 0x7f7c537fe700 (LWP 11432) "indexer0" 0x00007f7c5a696756 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
7 Thread 0x7f7c52ffd700 (LWP 11433) "indexer1" 0x00007f7c5a696756 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
8 Thread 0x7f7c527fc700 (LWP 11434) "indexer2