erlbattle http://code.google.com/p/erlbattle/wiki/EbStepByStep
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
原文 GG 了請參考 archive | |
https://web.archive.org/web/20090221093708/http://d.hatena.ne.jp/yuki_neko_nyan/20090217/1234850409 | |
以下備份 | |
2009-02-17 | |
■ループが書けなくなる(或いは再帰依存症)レベル10 15:00 ループが書けなくなる(或いは再帰依存症)レベル10 - 猫的怠惰Days | |
level 0 |
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 <stdio.h> | |
#define progn(...) ({ __VA_ARGS__ ;}) | |
#define cond0 (argc < 2) | |
#define cond1 (argc < 3) | |
#define cond2 (argc < 4) | |
#define cond3 (argc < 5) | |
#define a progn(printf("do something\n"), "a") |
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
diff --git a/Makefile b/Makefile | |
index 9207d9e..4acade0 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -1,6 +1,6 @@ | |
ALL=re2 pcre onig boost | |
CC=$(CXX) | |
-CXXFLAGS=-O5 | |
+CXXFLAGS=-O3 | |
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
palindrome = lambda s: s[len(s)/2:][::-1].find(s[:len(s)/2])!=-1 | |
palindrome = lambda s: s[len(s)/2:][::-1].startswith(s[:len(s)/2]) | |
palindrome = lambda s: reduce(lambda a,b: a and (b[0]==b[1]), zip(s,s[::-1]), True) | |
palindrome = lambda s: reduce(lambda a,b:a and b,map(lambda x:x[0]==x[1],zip(s,s[::-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
REGEDIT4 | |
[HKEY_CLASSES_ROOT\*\shell] | |
[HKEY_CLASSES_ROOT\*\shell\Emacs] | |
@="Edit with &Emacs" | |
[HKEY_CLASSES_ROOT\*\shell\Emacs\command] | |
@="D:\\Programs\\emacs\\bin\\emacsclientw.exe --no-wait --alternate-editor=D:/Programs/emacs/bin/runemacs.exe \"%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
(with-current-buffer "abc" | |
(with-output-to-temp-buffer "*result*" | |
(goto-char (point-min)) | |
(let* ((template (concat "<!-- 一篇推文開始 --> | |
<section> | |
<a class=\"username\" href=\"https://twitter.com/%s\">%s</a> | |
<a class=\"date\" href=\"%s\">%s</a> | |
<div class=\"tweetcontent\">%s</div> | |
</section> |
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
(defun self-hater () | |
(font-lock-add-keywords | |
nil `(("\\(\\<self\\>\\)" | |
(0 (progn (compose-region | |
(match-beginning 1) (match-end 1) | |
"(╯°□°)╯︵ ┻━┻") | |
nil)))))) | |
(add-hook 'python-mode-hook #'self-hater) |
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
(defun dired-show-only (regexp) | |
(interactive "sFiles to show (regexp): ") | |
(dired-mark-files-regexp regexp) | |
(dired-toggle-marks) | |
(dired-do-kill-lines)) |