Skip to content

Instantly share code, notes, and snippets.

View wenhoujx's full-sized avatar

Wenshuai Hou wenhoujx

  • Washington, DC
View GitHub Profile
@wenhoujx
wenhoujx / fds-2.map.json
Created July 11, 2023 19:26
fds-2.map.json
{
"in_connections": {
"dtrip_fermate_anag": {
"type": "local_file",
"filename": "/Users/justin/ct/fdsdata/qb/dtrip_fermate_anag.jsonl"
},
"dtrip_fermate": {
"type": "local_file",
"filename": "/Users/justin/ct/fdsdata/qb/dtrip_fermate.jsonl"
},
@wenhoujx
wenhoujx / fds-map.json
Created July 6, 2023 16:18
fds-map.json
{
"in_connections": {
"dtrip_fermate_anag": {
"type": "local_file",
"filename": "/Users/wenshuaihou/code/ct-data/fds/dtrip_fermate_anag.jsonl"
},
"dtrip_fermate": {
"type": "local_file",
"filename": "/Users/wenshuaihou/code/ct-data/fds/small/dtrip_fermate.jsonl"
},
@wenhoujx
wenhoujx / generator_safety_2.py
Created October 30, 2014 14:56
make generator safe.
"""
generator are not thread safe, two or more thread accessing the same generator
causes an error:
@wenhoujx
wenhoujx / generator_safety.py
Last active August 29, 2015 14:08
how to trigger a generator thread safety error.
"""
generator are not thread safe, two or more thread accessing the same generator
causes an error:
@wenhoujx
wenhoujx / wraps.py
Created October 30, 2014 14:28
decorator and pickle and wraps
from functools import wraps
import pickle
import sys
@wenhoujx
wenhoujx / wraps.py
Created October 30, 2014 14:28
decorator and pickle and wraps
1 from functools import wraps
2 import pickle
3 import sys
4
@wenhoujx
wenhoujx / closure_2.py
Created October 30, 2014 14:06
closure_2
from functools import wraps
import pickle
import sys
@wenhoujx
wenhoujx / closure_1.py
Created October 29, 2014 15:22
closure
def foo(x):
def bar():
return x**2
return bar
@wenhoujx
wenhoujx / joblib_tut01.py
Created October 23, 2014 04:13
joblib_tut01
#!/usr/bin/env python
# encoding: utf-8
import joblib as jl
@wenhoujx
wenhoujx / bo.c
Last active August 29, 2015 14:02
buffer overflow example
#include <stdio.h>
#include <string.h>
int main(void) {
char buff[15];
int passed = 0;
printf("Pleaes enter your password \n" ) ;
gets(buff) ;
// equal strings return 0