Skip to content

Instantly share code, notes, and snippets.

View pazworld's full-sized avatar

pazworld pazworld

View GitHub Profile
@pazworld
pazworld / 00-README-ffmpeg-merge-makefile-sample.md
Last active October 21, 2019 00:52
Makefile merge two videos vertically with FFmpeg

Description

Makefile that merge two videos vertically with FFmpeg.

Tools

  • youtube-dl
  • FFmpeg
  • ffprobe
*.beam
@pazworld
pazworld / slow.go
Last active October 3, 2019 10:56
slow pager first show stdin with fullspeed, then slow down
// slow pager
// show fullspeed duaring full_speed_period, then show with wait_per_line sleep
package main
import (
"bufio"
"flag"
"fmt"
"os"
*.beam
*~
include Math
def main
puts "6 digits"
check_range((100..999), 1000)
puts "10 digits"
check_range((10000..99999), 100000)
end
#!/bin/sh
# calculate maximum drawdown.
awk '
START {max=0;maxdrawdown=0}
max<$3 {max=$3;print "set max",$1,max}
{drawdown=max-$3}
@pazworld
pazworld / irrpas2.erl
Last active August 29, 2015 14:06
「上と左の合計」をErlangで(横へな22) その2 ref: http://qiita.com/pazworld/items/03a9d342025961e6e9ff
-module ( irrpas2 ).
-compile ( export_all ).
solve ( DataString ) ->
[ { Width, Height } | ConcatCells ] = parse_input_string ( DataString ),
TargetCellValueWithMemo = get_value ( Width - 1, Height - 1, ConcatCells, [] ),
get_right_two_digit ( element ( 1, TargetCellValueWithMemo ) ).
parse_input_string ( InputString ) ->
NumberStrings = string:tokens ( lists:delete ( $x, InputString ), ":," ),
@pazworld
pazworld / irrpas.dot
Last active August 29, 2015 14:06
「上と左の合計」をErlangで(横へな22) ref: http://qiita.com/pazworld/items/ccc5e9c4d8bda7675a8c
digraph irrpas {
start -> tokens [ label="Data" ];
subgraph cluster_solve {
label="solve";
tokens [ label="string:tokens\n':'で分ける", fontname="IPAexGothic" ];
tokens -> parse_size [ label="SizeStr" ];
tokens -> parse_concat_list [ label="ConcatListStr" ];
parse_size [ label="parse_size\n文字列→サイズ", fontname="IPAexGothic" ];
parse_size -> init_dep_map [ label="Size" ];
parse_size -> get_renum_map [ label="Size" ];
@pazworld
pazworld / 18notfork.factor
Created June 11, 2014 03:53
「フォークじゃない」をFactorで(横へな18) ref: http://qiita.com/pazworld/items/32c057194365b9339d71
USING: arrays generalizations kernel math
math.parser sequences sorting strings ;
IN: 18notfork
SYMBOL: o ! 客を表す記号
SYMBOL: x ! 絶望的に長くかかる客を表す記号
: throughput ( -- seq ) { 2 7 3 5 2 } ; ! 各レジの処理能力
: shortest ( regi -- n ) ! 最も短いレジを探す とは
@pazworld
pazworld / 21lesson.factor
Created June 3, 2014 10:22
「レッスンは何曜日?」をFactorで(横へな21) ref: http://qiita.com/pazworld/items/017cf70768356a43f064
USING: kernel sequences sequences.deep math math.order math.parser
arrays splitting assocs sorting ;
IN: 21lesson
! 希望リストから配属候補を求める
: wish-list>candidate ( wish-list -- candidate )
{ 1 2 3 4 5 } swap [
[ second first over = ] filter
[ first ] map swap drop
] curry map ;