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
(defn fix-distance | |
[base desire distance] | |
(let [angle (vec2/angle (vec2/- desire base))] | |
(vec2/rotate base angle (vec2/+ base [distance 0])))) | |
(def limb | |
^(assoc (meta line) :handles { | |
:draw (get (get (meta line) :handles) :draw) | |
:drag (fn [{:id id :pos p :delta-pos dp :params [from to]}] | |
(let [length 100] |
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
(defn line-polar | |
{:params [{:label "length" :type "number"} | |
{:label "rot" :type "angle"}] | |
:handles {:draw (fn [{:params [l r]}] | |
[{:id "edge" :type "point" :pos (vec2/* [(cos r) (sin r)] [l l])}]) | |
:drag (fn [{:id id :pos p :prev-pos pp :params [l r]}] [(vec2/dist [0 0] p) (+ r (calc-dragged-rotation :pos p :prev-pos pp))]) | |
} | |
} | |
[l r] | |
(transform (rotate r) |
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
(defn hand | |
{:params [{:label "length" :type "number"} | |
{:label "rot" :type "angle"}] | |
:handles {:draw (fn [{:params [l r]}] | |
[{:id "edge" :type "point" :pos (vec2/* [(cos r) (sin r)] [l l])}]) | |
:drag (fn [{:id id :pos p :params [l r]}] [(vec2/dist [0 0] p) (vec2/angle p)]) | |
} | |
} | |
[l r] | |
(transform (rotate r) |
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
(defn on-same-line? [A B C] | |
(< .99 (abs(vec2/dot (vec2/normalize (vec2/- B A)) | |
(vec2/normalize (vec2/- C A)))))) | |
(defn circumcenter [A B C] | |
(let [a (vec2/dist B C) | |
b (vec2/dist C A) | |
c (vec2/dist A B) | |
a2 (* a a) b2 (* b b) c2 (* c c) | |
a-len (* a2 (+ (- a2) b2 c2)) |
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
最近 | |
- | |
最近 エクスが楽しくて | |
- | |
チームっぽい | |
- | |
やったやった |
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
お疲れです | |
- | |
急遽 急遽ですが集まりましたね | |
- | |
太子堂出張所 アイリス 花 | |
- |
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
#pragma once | |
#include <functional> | |
class Once | |
{ | |
public: | |
using Work = std::function<void()>; | |
Once(){} | |
Once(Work work) { |
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
<html lang="ja"> | |
<head> | |
<title>othello</title> | |
<style type="text/css"> | |
.cell { | |
margin: 0 -1px -1px 0; | |
position: relative; | |
display: inline-block; | |
width:30px; | |
height:30px; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>limit.maxfiles</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>launchctl</string> | |
<string>limit</string> |
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 | |
set -e | |
echoDots(){ | |
sleep 0.1 # Waiting for a brief period first, allowing jobs returning immediatly to finish | |
while isRunning $1; do | |
for i in $(seq 1 10); do | |
echo -ne . |