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
0001 0000 000d 0080 0003 0050 4646 544d | |
677b a7e4 0001 f8d4 0000 001c 4744 4546 | |
03b6 0006 0001 f8b4 0000 0020 4f53 2f32 | |
2fbe dc40 0000 0158 0000 0056 636d 6170 | |
e71d f3d3 0000 0fd4 0000 0152 6761 7370 | |
ffff 0003 0001 f8ac 0000 0008 676c 7966 | |
ef6a f641 0000 183c 0001 bb84 6865 6164 | |
fccd 45ef 0000 00dc 0000 0036 6868 6561 | |
04a1 03e6 0000 0114 0000 0024 686d 7478 | |
11cb 2e4b 0000 01b0 0000 0e24 6c6f 6361 |
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
require 'thread' # for Mutex: Ruby doesn't provide out of the box thread-safe arrays | |
class ThreadPool | |
def initialize(max_threads = 10) | |
@pool = SizedQueue.new(max_threads) | |
max_threads.times{ @pool << 1 } | |
@mutex = Mutex.new | |
@running_threads = [] | |
end |
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
// 4 spaces to 2 spaces | |
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g | |
// Tab to 2 spaces | |
:%s/\t/ /g |
OlderNewer