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
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 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
first_name | gender | |
---|---|---|
ธนชิต | M | |
วงศธร | M | |
กิตติศักดิ์ | M | |
รุจ | M | |
ทศวรรษ | M | |
ธนพล | M | |
รัตนา | F | |
ธนรัตน์ | F | |
สุดาพร | F |
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
#include <Keyboard.h> | |
#include <math.h> | |
#define BLUE 3 | |
#define GREEN 5 | |
#define RED 6 | |
void setup() | |
{ | |
pinMode(RED, OUTPUT); |
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
$ th sample.lua cv/lm_lstm_epoch22.73_0.6392.t7 -gpuid -1 -temperature 0.8 -primetext เต่าถุย -length 20000 | |
creating an lstm... | |
seeding with เต่าถุย | |
-------------------------- | |
เต่าถุยมากลายครั้ง. | |
บางคนที่เธอสุดท้าย, อะไรทะเลอยไม่, ความออกมันจำไกลแแล้ว, ต้นครีเที่ตัวเองผู้นั้นไม่ว่า, นอนที่ทุกคนตัน, รอยยับสวยงาม, ที่เธอรักตัวอ่อนไม่มี. | |
ความสุขทำจากกันมาให้ดอกไม้ให้ดูดวงดาวออกจากหายไป. | |
ฉันได้มีความสุข. | |
การรอคอยทะเลดีเสียใจที่ไม่รัก | |
ฉันพอใจก็ความสิ่งที่กับความหมาย, วันธีน้ำตาหาน์, เปล่า, ความพบว่าสำหรับเท้านั้น, พูดกัด, หนึ่งมันสุดน้ำตามีหาไม่ไม่มีความสุขตาย |
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
ส่งครบ 5 คนแล้ว ขอปิดกล่องนะครับ :-) ขอบคุณที่มาเล่นด้วย สนุกดี |
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
"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 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
#!/bin/bash | |
export LD_PRELOAD=libumem.so.1 | |
export UMEM_DEBUG=default | |
export UMEM_LOGGING=transaction | |
./"$1" |
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 MySQLdb as mdb | |
import HTMLParser | |
import random | |
import urllib2 | |
import urlparse | |
from bs4 import BeautifulSoup | |
from os import path | |
class ImageMigrator: |
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
!/bin/bash | |
# Debugging .. print all commands executed | |
set -x | |
for f in * | |
do | |
# Replace all occurrences of '%20' with ' ' (single space) | |
newname=${f//%20/ } | |
# We're safer with quotes around .. | |
mv "$f" "$newname" |
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
// UpaV8PerfTest.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
using namespace v8; | |
std::string readSourceFile(std::string fileName) | |
{ | |
std::ifstream t(fileName); |
NewerOlder