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
%% Erlang Programming Exercise 3-10 | |
%% https://gist.github.com/yamasushi/69d6f5ab6cd7115ab525fe011ec67dfe | |
-module(ex310). | |
-export([test_data/0,fill/2,justify/2]). | |
fill(Words,Width) -> | |
GW = gather_words_acc(Words,Width,0,0,[],[]), | |
%% io:format("~p~n",[GW]), | |
lists:foreach(fun(K)->io:format("~s~n",[K]) end , | |
lists:map(fun({_,L}) -> fill_line(L) end, GW)). |
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
#https://gist.github.com/yamasushi/355dec4cf1bf644a758279a80ff1cafa | |
open(`ls -a`) do p | |
while !eof(p) println(readline(p)) end | |
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
# https://gist.github.com/yamasushi/873992c10d8ac74750f3fa9d3ec039f4 | |
# https://qiita.com/yamasushi/items/fc0d4c77d26bb5d05ed3 | |
using DataFrames | |
using Primes | |
n=30 | |
@show(n) | |
gcds = gcd.(n,1:n) | |
df=DataFrame( |
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
module DynamicalSystem | |
using ColorTypes | |
export make_seq , push_points! | |
struct Seq{P} | |
initial::P | |
fn::Function | |
end | |
Base.iterate(ds::Seq, pt=ds.initial ) = (pt, ds.fn(pt) ) |
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 gosh | |
; https://gist.github.com/yamasushi/4c4353a6e710758acec9 | |
(use gauche.parseopt) | |
(use file.util) | |
(use srfi-11) | |
(define (main args) (let-args (cdr args) | |
( (help "h|help") |
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 gosh | |
; https://gist.github.com/yamasushi/f9a42af9936805d1cc2f | |
(use gauche.parseopt) | |
(use gauche.lazy) | |
; cat | |
; files ----> port ----> lseq | |
(define (main args) (let-args (cdr args) |
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 gosh | |
; https://gist.github.com/yamasushi/b088d332b6b211a8a01a | |
(use gauche.parseopt) | |
(use srfi-13) | |
(use srfi-14) | |
(use gauche.lazy) | |
(use gauche.collection) | |
(use gauche.sequence) | |
(use srfi-27) |
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 gosh | |
; https://gist.github.com/yamasushi/47c5496ba69eb26d0599 | |
(use srfi-13) | |
(use srfi-14) | |
(use gauche.lazy) | |
(use gauche.collection) | |
(define cs-kanji #[々〇〻\x3400;-\x9FFF;\xF900;-\xFAFF;\x20000;-\x2FFFF;] ) | |
(define cs-hirakana #[ぁ-ん]) |
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 gosh | |
; https://gist.github.com/yamasushi/0e6a039ced73d19dcca6 | |
(use gauche.parseopt) | |
(use gauche.sequence) | |
(use gauche.lazy) | |
(use srfi-27) | |
(define rand (make-random-source)) | |
(random-source-randomize! rand) |
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 gosh | |
;https://gist.github.com/yamasushi/4e39c4d5cc3016b469aa | |
(use gauche.lazy) | |
(use gauche.parseopt) | |
(define (main args) (let-args (cdr args) | |
((nchr "n=i" 140) . files ) | |
$ list->string |