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 clean(txt) | |
mark = true | |
txt.each_char.map { |x| | |
if x.ascii_only? and mark | |
mark = false | |
' ' | |
elsif x.ascii_only? | |
nil | |
else | |
mark = true |
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
class Operation < Struct.new(:name, :args, :block) | |
class << self | |
attr_accessor :opposite_operations | |
end | |
def self.define_opposite_operations(name, name_of_opposite) | |
@opposite_operations ||= {} | |
@opposite_operations[name] = name_of_opposite | |
@opposite_operations[name_of_opposite] = name | |
end |
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 <stdio.h> /* for printf */ | |
/* constants declaration */ | |
#define TOTAL 24.f | |
#define PRECISION 0.001f /* for float number comparison */ | |
#define MAX_POINT 13 | |
#define MIN_POINT 1 | |
#define NUM_CARDS 4 | |
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 | |
: << DOC | |
This script does scan all the photo from my phone and pull them out into a | |
temporary directory. After then, it will arrange the photos into special | |
directory by taken date, and if the target directory does not exist, the script | |
will create one to store such files. Subsequently and optionally, it could | |
convert all the photos imported into wiki image size and put the outputs into | |
another temporary directory, and show me them to deal. |
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 | |
extname=".jpg" | |
def_size_wid=1024 | |
new_wid=0 | |
[[ "$#" -lt "1" ]] && exit 0 | |
filename="$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
/* | |
A TURING MACHINE PROGRAM OF A SIMPLE INCREASER | |
(it does increase a binary number continously) | |
*/ | |
TYPE SYMBOL: | |
. 0 1 | |
TAPE: |
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
/* | |
A TURING MACHINE PROGRAM OF A SIMPLE INCREASER | |
(it does increase a binary number continously) | |
*/ | |
TYPE SYMBOL: | |
. 0 1 | |
TAPE: |
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
(define-macro do-times | |
(lambda (times . body) | |
(let ((rest-time (gensym)) | |
(loop-func-name (gensym))) | |
(begin | |
`(letrec ((,loop-func-name | |
(lambda (,rest-time) | |
(if (= ,rest-time 0) '() | |
(begin | |
,@body |
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
(define-macro my-let | |
(lambda (args . body) | |
(let ((names (map car args)) | |
(vals (map cadr args))) | |
(cons (cons 'lambda (cons names body)) vals)))) | |
(define-macro my-let-2 | |
(lambda (args . body) |
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
我崇敬挑戰龍而失敗的勇士,而不是皇帝。 | |
我期待的是一種平衡,一種可以維持永久的,自然而包容萬物的平衡,將世界置於其中,然後,把發現者燒死。 | |
我願意為機器賦予智慧,把所有人類的骸骨,變作空氣,把他們剩下的東西——如果有的話,完全消除。 | |
我熱愛的統一已不在遠處,我來了,我來了,我會把整個世界,壓縮入一個原子之中,讓不存在的東西,歸於混沌。 | |
我帶來的是劍,獻給我崇敬的挑戰龍的勇士。 |