Skip to content

Instantly share code, notes, and snippets.

@akirayou
akirayou / acckerman-link.mac
Created November 20, 2017 21:20
ackerman link calculation for maxima
@akirayou
akirayou / acchi.cs
Created November 20, 2017 21:31
あっちの窓の行列forUnity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WindowCamCont : MonoBehaviour {
public Vector3 eyePos = new Vector3(0, 0, 0);
public Camera targetCamera;
public float displayWidth = 0.29f;
public float displayHeight = 0.16f;
public float nearPlane = 0;
@akirayou
akirayou / heater.rb
Created November 20, 2017 21:34
PCBヒータをkicadで作るスクリプト
#!/usr/local/bin/ruby
# -*- coding: utf-8 -*-
$width= 1.8 #配線太さ(mm)
$T=18.0 #銅箔厚み(um)
$cu=1.72E-08 #銅電気伝導度
#縦方向サイズ関連
$step= $width * 2 + 1.6 #行って帰ってくるまでに縦方向に動く段差(配線ピッチの2倍)
$start=100 #描画開始y座標
<?php
header('Content-type: text/plain; charset=utf-8');
$uploaddir = '/home/akira/public_html/up/';
$id= uniqid();
if(isset($_POST['name']) && (0==preg_match("/[^0-9a-zA-Z]/",$_POST['name']) )){
$id=$_POST['name'];
}
$uploadfile = $uploaddir .$id.".bin";
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 13 14:07:38 2016
@author: a-noda
"""
import numpy as np
data=np.random.randn(3*10000,1000).astype(np.float32)
y=0
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
#Need libpython, you have to build python with enable-shared
ONFIGURE_OPTS="--enable-shared" pyenv install 3.6.4
pyenv local 3.6.4
@akirayou
akirayou / cbi.py
Last active March 23, 2018 00:31
Class Random choice iterator for chainer , Class is not Label. For example, It's for multi sample from one target object. this target's ID is class.
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 27 02:01:52 2016
@author: a-noda
"""
import numpy as np
from chainer.dataset import iterator
class ClassRandomIterator(iterator.Iterator):
'''
@akirayou
akirayou / bi.py
Created March 23, 2018 00:33
Label Balanced Iteretor for chainer
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 27 02:01:52 2016
@author: a-noda
"""
import numpy as np
from chainer.dataset import iterator
class BlanceIterator(iterator.Iterator):
'''
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 8 10:53:59 2018
@author: akira
"""
"""
from maxima