This file contains 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 MySQLdb as mdb | |
import HTMLParser | |
import random | |
import urllib2 | |
import urlparse | |
from bs4 import BeautifulSoup | |
from os import path | |
class ImageMigrator: |
This file contains 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
#!/bin/bash | |
export LD_PRELOAD=libumem.so.1 | |
export UMEM_DEBUG=default | |
export UMEM_LOGGING=transaction | |
./"$1" |
This file contains 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
"switch between .h / -inl.h / .cc / .py / .js / _test.* / _unittest.* with ,h | |
",i ,c ,p ,j ,t ,u | |
""(portion from old mail from David Reiss) | |
let pattern = '\(\(_\(unit\)\?test\)\?\.\(cc\|js\|py\)\|\(-inl\)\?\.h\)$' | |
nmap ,c :e <C-R>=substitute(expand("%"), pattern, ".cc", "")<CR><CR> | |
nmap ,h :e <C-R>=substitute(expand("%"), pattern, ".h", "")<CR><CR> | |
nmap ,i :e <C-R>=substitute(expand("%"), pattern, "-inl.h", "")<CR><CR> | |
nmap ,t :e <C-R>=substitute(expand("%"), pattern, "_test.", "") . substitute(expand("%:e"), "h", "cc", "")<CR><CR> | |
nmap ,u :e <C-R>=substitute(expand("%"), pattern, "_unittest.", "") . substitute(expand("%:e"), "h", "cc", "")<CR><CR> | |
nmap ,p :e <C-R>=substitute(expand("%"), pattern, ".py", "")<CR><CR> |
This file contains 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
#include <Keyboard.h> | |
#include <math.h> | |
#define BLUE 3 | |
#define GREEN 5 | |
#define RED 6 | |
void setup() | |
{ | |
pinMode(RED, OUTPUT); |
This file contains 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
first_name | gender | |
---|---|---|
ธนชิต | M | |
วงศธร | M | |
กิตติศักดิ์ | M | |
รุจ | M | |
ทศวรรษ | M | |
ธนพล | M | |
รัตนา | F | |
ธนรัตน์ | F | |
สุดาพร | F |
This file contains 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
def is_male(name): | |
if u"ศักดิ์" in name or name.endswith(u"วุฒิ"): | |
return True | |
elif name.endswith(u"พร") or name.endswith(u"พรรณ"): | |
return False | |
else: | |
return False | |
print(is_male(u"ณัฐวุฒิ")) # True | |
print(is_male(u"ณัฏฐ์พร")) # False |
This file contains 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
#include <dlfcn.h> | |
#include <execinfo.h> | |
typedef void (*cxa_throw_type)(void *, void *, void (*) (void *)); | |
cxa_throw_type orig_cxa_throw = 0; | |
void load_orig_throw_code() | |
{ | |
orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw"); | |
} |
OlderNewer