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 <iostream> | |
// http://stackoverflow.com/questions/537303/binary-literals | |
template<char... digits> | |
struct conv2bin; | |
template <char... digits> | |
constexpr int operator"" _b() { | |
return conv2bin<digits...>::value; | |
} |
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
# usage: kindle eject|start | |
# The 'start' command works for Kindle, but I saw an error message. | |
# However, I'm not silencing it here. | |
alias kindle 'camcontrol devlist | grep Kindle |'\ | |
'sed -nE '\''s/^.*(pass[[:digit:]]+).*$/\1/p'\'' |'\ | |
'xargs -J% camcontrol \!:1 % -E' | |
# Any brief command of camcontrol(8) is supported actually; 'eject' | |
# and 'start' are enough. | |
complete kindle 'p/1/(eject start)/' |
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
--- driver/lock.c~ 2011-09-24 19:13:50.000000000 -0500 | |
+++ driver/lock.c 2012-09-26 05:03:57.116385782 -0500 | |
@@ -686,7 +686,7 @@ make_passwd_window (saver_info *si, | |
si->passwd_dialog, cmap, | |
pw->background, | |
&pw->logo_pixels, &pw->logo_npixels, | |
- &pw->logo_clipmask, True); | |
+ &pw->logo_clipmask, -1); | |
} | |
else /* On successive prompts, just resize the window */ |
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
--- ./src/lib/fcitx-gclient/fcitxclient.c~ 2012-09-12 08:39:35.000000000 -0500 | |
+++ ./src/lib/fcitx-gclient/fcitxclient.c 2012-09-16 09:21:47.061179876 -0500 | |
@@ -26,9 +26,13 @@ | |
#include "fcitxclient.h" | |
#include "marshall.h" | |
+#ifdef _DEBUG | |
#define fcitx_gclient_debug(...) g_log ("fcitx-client", \ | |
G_LOG_LEVEL_DEBUG, \ | |
__VA_ARGS__) |
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
#!/usr/bin/env python | |
# a solve to http://www.zhihu.com/question/20467075 | |
import random | |
def gen_seats(n): | |
ls = range(1, n + 1) * 2 | |
random.shuffle(ls) | |
return ls | |
def get_strategies(ls): |
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
/* Copyright (C) 2002 by Jilles Tjoelker */ | |
/* revised by Zhihao Yuan, 2012 */ | |
#include <sys/types.h> | |
#include <sys/event.h> | |
#include <sys/time.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <signal.h> |
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
--- configure~ 2012-06-09 04:40:02.045104538 -0500 | |
+++ configure 2012-04-10 17:22:13.567263417 -0500 | |
@@ -5326,27 +5326,37 @@ gcc_version=`${CC} --version \ | |
| $SED 's/i686-apple-darwin11//' \ | |
| $SED 's/^[^(]*([^)]*) *\([0-9.]*\).*$/\1/'` | |
+clang_version=`${CC} --version \ | |
+ | head -n 1 \ | |
+ | $SED 's/^.*version *\([0-9.]*\).*$/\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
--- VTPrsTbl.c~ 2012-04-26 04:04:37.000000000 -0500 | |
+++ VTPrsTbl.c 2012-06-06 21:02:22.242768878 -0500 | |
@@ -105,7 +105,7 @@ CASE_CR, | |
CASE_SO, | |
CASE_SI, | |
/* DLE DC1 DC2 DC3 */ | |
-CASE_IGNORE, | |
+CASE_ESC, | |
CASE_IGNORE, | |
CASE_IGNORE, |
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
--- charclass.c.orig 2009-11-05 17:46:15.000000000 -0600 | |
+++ charclass.c 2012-06-05 00:08:48.870241313 -0500 | |
@@ -116,18 +116,8 @@ init_classtab(void) | |
SetCharacterClassRange(0x200b, 0x27ff, IDENT); /* punctuation and symbols */ | |
SetCharacterClassRange(0x2070, 0x207f, 0x2070); /* superscript */ | |
SetCharacterClassRange(0x2080, 0x208f, 0x2080); /* subscript */ | |
- SetCharacterClassRange(0x3000, 0x3000, BLANK); /* ideographic space */ | |
- SetCharacterClassRange(0x3001, 0x3020, IDENT); /* ideographic punctuation */ | |
- SetCharacterClassRange(0x3040, 0x309f, 0x3040); /* Hiragana */ | |
- SetCharacterClassRange(0x30a0, 0x30ff, 0x30a0); /* Katakana */ |
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 <sys/types.h> | |
#include <sys/event.h> | |
#include <sys/mount.h> | |
#include <stdio.h> | |
int main() { | |
int kq = kqueue(); | |
struct kevent ki[1]; |