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
module Prawn | |
module Text | |
module Formatted #:nodoc: | |
# @private | |
class LineWrap #:nodoc: | |
def scan_pattern(encoding = ::Encoding::UTF_8) | |
ebc = break_chars(encoding) | |
eshy = soft_hyphen(encoding) | |
ehy = hyphen(encoding) | |
ews = whitespace(encoding) |
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/sh | |
while read f | |
do | |
echo "$f" | |
# ffmpeg -loglevel error -i "${f}" -f image2 -vcodec png -r 1 "%03d.png" | |
# https://unix.stackexchange.com/a/36411 | |
ffmpeg -loglevel error -i "${f}" -f image2 -vcodec png -r 1 "%03d.png" </dev/null | |
done <<EOF | |
a.mp4 |
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
;;;; http://bford.info/pub/lang/packrat-icfp02.pdf | |
;;;; Section 2.4 Packrat Parser | |
;;;; | |
;;;; Additive <- Multitive '+' Additive | Multitive | |
;;;; Multitive <- Primary '*' Multitive | Primary | |
;;;; Primary <- '(' Additive ')' | Decimal | |
;;;; Decimal <- '0' | ... | '9' | |
(defpackage pp1 |
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
;;;; http://bford.info/pub/lang/packrat-icfp02.pdf | |
;;;; Section 2.1 Recursive Dscent Parsing | |
;;;; 再帰下降パーサー | |
;;;; | |
;;;; Additive <- Multitive '+' Additive | Multitive | |
;;;; Multitive <- Primary '*' Multitive | Primary | |
;;;; Primary <- '(' Additive ')' | Decimal | |
;;;; Decimal <- '0' | ... | '9' | |
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
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
public class Child { | |
public static void main(String[] args) throws Exception { | |
try (ServerSocket sock = new ServerSocket()) { |
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
(in-package :cl) | |
(defpackage piecetable | |
(:use :cl) | |
(:shadow :cl :delete)) | |
(in-package :piecetable) | |
(defstruct span | |
in-add-buffer | |
start | |
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
(defpackage :sha1 | |
(:use :cl) | |
(:shadow :block) | |
(:export :init | |
:update | |
:digest | |
:hexdigest)) | |
(in-package :sha1) | |
(deftype u8 () '(unsigned-byte 8)) |
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
(defpackage :md5 | |
(:use :cl) | |
(:shadow :cl | |
:count | |
:block) | |
(:export :init | |
:update | |
:digest | |
:hexdigest)) | |
(in-package :md5) |
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
import java.nio.ByteBuffer; | |
public class BitStream { | |
private final byte[] bytes; | |
private final int numOfBits; | |
private int pos; | |
public BitStream(ByteBuffer buf) { | |
bytes = new byte[buf.remaining()]; |
NewerOlder