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
(defvar MOJIWARN-RE | |
(rx (| (any (?\u2F00 . ?\u2FDF) ; 康煕部首 | |
(?\u2E80 . ?\u2EF3) ; CJK部首補助 | |
(?\uFE10 . ?\uFE19) ) ; 縦書き用句読点 | |
(: nonl ?\u3099) ; NFDの濁点 | |
(: nonl ?\u309A) ; NFDの半濁点 | |
(category alpha-numeric-two-byte) ; 全角英数字 | |
(: upper upper lower) ))) ; double capitalize | |
(defvar MOJIWARN-FONT-LOCK-KEYWORDS |
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
#include <stdio.h> | |
int _add(int a, int b){ return a+b; } | |
int _sub(int a, int b){ return a-b; } | |
int _mul(int a, int b){ return a*b; } | |
int _div(int a, int b){ return a/b; } | |
struct { char c; int (*f)(int, int); } ops[] = | |
{ {'+', _add}, {'-', _sub}, {'*', _mul}, {'/', _div}}; |
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
これはbash-5.2にbash-5.1のリリース以降で追加された新機能の簡潔な説明です。いつもどおり、完全な説明を探しているのであればマニュアルページ(doc/bash.1)が目的の場所です。 | |
1. Bashの新機能 | |
a. bashの mallocは16バイト境界でアラインされたメモリを返します。 | |
b. 組込みコマンドreadのタイムアウトのために、新しい内部のタイマーフレームワークが使われています。 | |
c. コマンド置換をパースするコードは、パーサーを再帰的に呼び出してパースされたコマンドからコマンド文字列を再構成するよう書き直されました。これによりよりよい文法チェックと、早期のエラー検出が可能になります。これにともない、コマンド置換のパースが完了して読み込むべきヒアドキュメントが残っている場合に、シェルは警告メッセージを表示して、ヒアドキュメントの中身を現在の入力ストリームから読み込みます。 |
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
(defun visual-sleep-sort (lst) | |
(save-window-excursion | |
(let (r) | |
(with-temp-buffer | |
(switch-to-buffer (current-buffer)) | |
(dolist (i lst) | |
(princ (format "%s%d\n" (make-string i ?\ ) i) (current-buffer)) ) | |
(while (> (buffer-size) 0) | |
(beginning-of-buffer) | |
(while (not (eobp)) |
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
#!/usr/bin/env ruby | |
nums = [2, 3, 7, 9] | |
nums.permutation do |ns| | |
%i(+ - * /).repeated_permutation(ns.size - 1) do |ops| | |
begin | |
x, *xs = ns | |
z = ops.zip(xs).inject(Rational(x)) {|r, v| r.send(*v) } | |
p ns.zip(ops).flatten.compact if z == Rational(10) |
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
これはbash-5.1にbash-5.0のリリース以降で追加された新機能の簡潔な説明です。いつもどおり、完全な説明を探しているのであればマニュアルページ(doc/bash.1)が目的の場所です。 | |
1. Bashの新機能 | |
a. `bind -x'は異なる編集モードやキーマップごとに異なるキーバインディングをサポートするようになりました。 | |
b. Bashはサブシェルや`bash -c'からコマンドを実行したときにフォークの回数を最適化するよう試みます。 | |
c. ヒアドキュメントおよびヒアストリングでは、パイプのバッファサイズより小さければ展開したドキュメントにパイプを使うようになりました。大きければ元のようにテンポラリファイルを使います。 |
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/bash | |
R=36 | |
RATIO=2 | |
for ((y = -R; y <= R; y += RATIO)); do | |
x=$(dc -e "$R 2^${y/-/_} 2^-vp") | |
printf '%*s%*s%*s\n' $((R - x)) x $x '' $x x | |
done |
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
#!/usr/bin/env ruby | |
module PipeOperator | |
refine Array do | |
def |(x) | |
PipeLine.new(self) | x | |
end | |
end | |
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
define dsl | |
(use-modules (srfi srfi-1)) | |
(define targets '()) | |
(define (showtargets) | |
(string-join (reverse targets) "\n") ) | |
(define-macro (push! place item) | |
`(set! ,place (cons ,item ,place)) ) |
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
これはbash-5.0にbash-4.4のリリースから追加された新機能の簡潔な説明です。いつもどおり、完全な説明を探しているのであればマニュアルページ(doc/bash.1)が目的の場所です。 | |
1. Bashの新機能 | |
a. 組み込みコマンド`wait'は、最後に作られたプロセス置換の実行を待つようになりました。 | |
b. Unix紀元(Epoch)から秒数に展開される変数EPOCHSECONDSがあります。 | |
c. Unix紀元(Epoch)からのマイクロ秒数に展開される変数EPOCHREALTIMEがあります。 |
NewerOlder