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
#!/usr/bin/env perl | |
################################################################################ | |
# Vyattaのhoeg{~~~}形式をset ~~~形式に変換するスクリプト | |
################################################################################ | |
use strict; | |
use warnings; | |
use constant true => 1; | |
use constant false => 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
fun op ** (a, b) = let | |
val succ = fn x => x + 1 | |
val pred = fn x => x - 1 | |
val c = if a < b then succ a else pred a | |
in | |
if a = b then [a] else a::(op ** (c ,b)) | |
end; | |
infix **; | |
fun op *** (a, b) = let |
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
.align 8 | |
.text | |
.globl linux_fast_abs64 | |
linux_fast_abs64: | |
movq %rdi, %rax # rax <- x | |
sarq $63, %rax # rax <- rax >> 63 | |
xorq %rax, %rdi # rdi <- rdi ^ rax | |
subq %rax, %rdi # rdi <- rdi - rax | |
movq %rdi, %rax # rax <- rdi | |
retq |
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
ffmpeg -y -i input.ts -movflags faststart \ | |
-f mp4 -vcodec libx264 -fpre /usr/local/share/ffmpeg/libx264.ffpreset -r 30000/1001 \ | |
-aspect 16:9 -s 1440x1080 -bufsize 20000k -maxrate 25000k -vsync 1 \ | |
-acodec libfaac -ac 2 -ar 48000 -ab 320k output.mp4 -map "0.0" -map "0.1" | |
# ffmpeg -y -i input.ts -movflags faststart -f mp4 -vcodec libx264 -fpre -r | |
# 14839.19s user 26.57s system 691% cpu 35:49.17 total |
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
class HTTP_Digest | |
def initialize(uri) | |
@uri = uri | |
req = Net::HTTP::Get.new(@uri.path) | |
res = Net::HTTP.new(@uri.host, @uri.port).start { |http| | |
http.request(req) | |
} | |
@digest_hash = {} |
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 <sstream> | |
#include <cmath> | |
template<typename T> | |
struct Vector2DBase | |
{ | |
T x, y; | |
Vector2DBase() : x(0.0), y(0.0) {} | |
Vector2DBase(T x, T y) : x(x), y(y) {} |
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
(* MLton用 ORD_KEY signature *) | |
(* | |
signature ORD_KEY = | |
sig | |
type ord_key | |
val compare : (ord_key * ord_key) -> order; | |
end; | |
*) | |
(* 2分木のシグネチャ *) |
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
(* MLton用 ORD_KEY signature *) | |
(* | |
signature ORD_KEY = | |
sig | |
type ord_key | |
val compare : (ord_key * ord_key) -> order; | |
end; | |
*) | |
(* 2分木のシグネチャ *) |
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
# Cygwin環境 | |
if [ `uname -a | grep 'Cygwin' | wc -c` -ne 0 ]; then | |
# Standard ML | |
export SMLNJ_HOME="$(cygpath -u 'C:\Program Files\SMLNJ')" | |
function _sml() | |
{ | |
export CM_PATHCONFIG="$(cygpath -w ${SMLNJ_HOME}/lib/pathconfig)" | |
${SMLNJ_HOME}/bin/.run/run.x86-win32.exe @SMLload="$(cygpath -w ${SMLNJ_HOME}/bin/.heap/sml.x86-win32)" | |
} | |
alias sml=_sml |