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
# orig: http://qiita.com/doxas/items/477fda867da467116f8d | |
IMAGE_WIDTH = 512 | |
IMAGE_HEIGHT = 512 | |
IMAGE_DEPTH = 256 | |
EPS = 0.0001 | |
MAX_REF = 4 | |
class Vec | |
def initialize(x: Float, y: Float, z: Float) |
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
def conv(txt) | |
txt.gsub(/&Vec<(.+?)>/) do | |
"&[#{$1}]" | |
end | |
end | |
ARGV.each do |path| | |
txt = conv File.read(path) | |
File.write(path, txt) | |
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
; ModuleID = 'examples/mandel.sk.bc' | |
source_filename = "main" | |
%Void = type <{}> | |
%Math = type <{}> | |
%Object = type <{}> | |
@"::ITER" = internal unnamed_addr global i1 false | |
@"::Void" = internal unnamed_addr global %Void* null | |
@"::LIMIT_SQUARED" = internal unnamed_addr global double 0.000000e+00 |
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
; ModuleID = 'main' | |
source_filename = "main" | |
%Void = type <{}> | |
%Math = type <{}> | |
%Object = type <{}> | |
@"::ITER" = internal global i32 0 | |
@"::Void" = internal global %Void* null | |
@"::LIMIT_SQUARED" = internal global double 0.000000e+00 |
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
; ModuleID = 'main' | |
source_filename = "main" | |
%"Meta:A" = type <{}> | |
%A = type <{}> | |
%Object = type <{}> | |
%Math = type <{}> | |
@"::A" = internal global %"Meta:A"* null | |
@"::H" = internal global i32 0 |
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
; | |
; Chibiのsyntax-rules実装を動かしてみる | |
; | |
; original: ~/research/chibi-scheme/lib/init-7.scm | |
(import (scheme base) (scheme write) (chibi)) ; (chibi syntax-case)) | |
(define (syntax-rules-transformer expr rename compare) | |
(let ((ellipsis-specified? (identifier? (cadr expr))) | |
(count 0) | |
(_er-macro-transformer (rename 'er-macro-transformer)) |
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
/Users/yhara/proj/qmk_firmware/lets_yhara % ./write.sh [263/405] | |
QMK Firmware 0.6.385 | |
WARNING: | |
Some git sub-modules are out of date or modified, please consider running: | |
make git-submodule | |
You can ignore this warning if you are not compiling any ChibiOS keyboards, | |
or if you have modified the ChibiOS libraries yourself. | |
Making lets_split/rev2 with keymap yhara and target avrdude | |
avr-gcc (GCC) 7.2.0 | |
Copyright (C) 2017 Free Software Foundation, Inc. |
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
; original: ~/research/chibi-scheme/lib/init-7.scm | |
(import (scheme base) (scheme write) (chibi)) ; (chibi syntax-case)) | |
(define (syntax-rules-transformer expr rename compare) | |
(let ((ellipsis-specified? (identifier? (cadr expr))) | |
(count 0) | |
(_er-macro-transformer (rename 'er-macro-transformer)) | |
(_lambda (rename 'lambda)) (_let (rename 'let)) | |
(_begin (rename 'begin)) (_if (rename 'if)) | |
(_and (rename 'and)) (_or (rename 'or)) |
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
require 'tempfile' | |
# File.openを使う処理 | |
def write_hello(path) | |
File.open(path, "a") do |file| | |
file.write "hello" | |
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
HOOK = proc{} | |
class A | |
def foo | |
ObjectSpace.define_finalizer self, HOOK | |
end | |
end | |
A.new.foo | |
10.times{GC.start} | |
p ObjectSpace.each_object(A).to_a #=> [#<A:0x00007fbae28ef1f8>] |