Skip to content

Instantly share code, notes, and snippets.

View namachan10777's full-sized avatar
🤔
thinking_now

Nakano Masaki namachan10777

🤔
thinking_now
View GitHub Profile
let-block ctx +pn inner =
let len = get-font-size ctx *' font-ratio-cjk in
let ib-inner = read-inline ctx inner ++ inline-fil in
form-paragraph ctx ib-inner
@namachan10777
namachan10777 / cleardoublepage.satyh
Created February 20, 2020 09:27
cleardoublepage.satyh
let cleardoublepage ctx label =
let hook = line-break false false ctx
(hook-page-break (fun pbinfo _ -> (
let should-inser-new-page =
(!ref-inserted-page-number + pbinfo#page-number) mod 2 == 0
in
let () = ref-not-aligned <- !ref-not-aligned || should-inser-new-page in
if !ref-not-aligned
then (
if should-inser-new-page

Keybase proof

I hereby claim:

  • I am namachan10777 on github.
  • I am namachan10777 (https://keybase.io/namachan10777) on keybase.
  • I have a public key ASCA77WGnqzq6CarHz3qAwVWNAWMxlrcFA_xkQyANNBpPgo

To claim this, I am signing this object:

@namachan10777
namachan10777 / merge.ml
Created October 15, 2019 06:02
マージソート
let rec sort =
let rec divide = function
| x :: y :: tl ->
let (l, r) = divide tl in
(x :: l, y :: r)
| x -> (x, [])
in
let rec merge = function
| (l, []) -> l
| ([], r) -> r
@namachan10777
namachan10777 / todo.md
Last active May 9, 2019 15:54 — forked from puripuri2100/todo.md
SATySFiで作るパッケージ
@namachan10777
namachan10777 / rotate.py
Created February 19, 2018 01:32
延々回転させたCherry MXのフットプリントを作り続ける
import numpy as np
import math as m
import sys
def rotate(theta, x, y):
rad = m.radians(theta)
rmat = np.array([
[m.cos(rad), -m.sin(rad)],
[m.sin(rad), m.cos(rad)]
])
import std.stdio;
import std.math;
import std.algorithm.comparison;
struct List(alias N, T) {
private T[] arr;
auto opIndex(I : Interger!(B, T), alias B, alias T)(in I idx) {
static if (B >= 0 && T < N) {
return arr[idx.value];
//リストの長さNを型に埋め込む
struct SList(T, alias N) {
T[] arr;
}
//空リスト
auto nil(T)() {
SList!(T, 0) sl;
return sl;
}
type readable_int_t = int
member from_string = int_of_string
type readable_float_t = float
member from_string = float_of_string
let str_to str =
from_string str
import std.stdio;
import std.file;
import std.array;
import std.conv;
import std.algorithm.iteration;
enum Size = 3;
size_t idx (I)(I x, I y) {
return y * Size + x;