Skip to content

Instantly share code, notes, and snippets.

View qnighy's full-sized avatar

Masaki Hara qnighy

View GitHub Profile
@qnighy
qnighy / Makefile
Created May 4, 2019 13:42
GCJ2019 Qual
#!/usr/bin/make -f
EXECS = a b d
CXX = g++
CXXFLAGS = -O2 -Wall -Wextra -g -std=gnu++14
all: $(EXECS)
clean:
$(RM) $(EXECS)
@qnighy
qnighy / boxed-closure-impls.md
Created February 11, 2019 01:39
Docs removed from https://github.com/rust-lang/rust/pull/55431 (under src/doc/unstable-book/src/library-features)

boxed_closure_impls

The tracking issue for this feature is #48055


This includes the following blanket impls for closure traits:

package main
func main() {
ch := make(chan int)
x := make([]int, 10)
go (func() {
y := make([]int, 10)
for i := 0; i < 1000000; i++ {
z := x
z[len(z)-1] = -1
// ==UserScript==
// @name BigQuery auto validate
// @namespace https://qnighy.info/
// @version 0.1
// @description saikou
// @author Masaki Hara
// @match https://bigquery.cloud.google.com/*
// @grant none
// ==/UserScript==
@qnighy
qnighy / rust-patterns.md
Last active March 6, 2025 19:03
Rustのパターンっぽいやつメモ

パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。

ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
@qnighy
qnighy / infer.rb
Created May 31, 2018 14:59
Great Ruby Type Inference
puts "BasicObject except Exception" if system("ruby -c "+ARGV[0])
@qnighy
qnighy / README.md
Created May 19, 2018 16:42
GCJ2018 Round2
  • A small/large
  • B small
  • C small
  • D small/large

GCJ2018 Qual D 考察

原点が立方体の中心だと面倒なので立方体の頂点において問題を次のように定式化する:

Minimize/Maximize Area(Span({O, Ce1, Ce2, Ce3, C(e1+e2), C(e2+e3), C(e3+e1), C(e1+e2+e3)}))
Subject to
  B: 3x3 signed orthogonal matrix
  C = [1 0 0; 0 1 0] * B
@qnighy
qnighy / cd..sh
Last active March 30, 2018 16:04
For those who often mistype `cd. .`.
#!/bin/bash
cd.() {
local x="$1"
shift
cd ".$x" "$@"
}

SATySFiコミッターポリシー提案

用語

  • gfnさん = gfnさん
  • コミッター = コミット権限のある人
  • コントリビューター = SATySFiへのPRを出している人・出した人

PRについて