Skip to content

Instantly share code, notes, and snippets.

afjk afjk

Block or report user

Report or block afjk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MazeMaker.cs
using UnityEngine;
using System.Collections;
public class MazeMaker : MonoBehaviour {
public delegate void MazeMakerEventHandler(object sender );
public event MazeMakerEventHandler MakeComplete;
public int randomSeed = -1;
public int xMax;
View MazeMakerGrow.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MazeMakerGrow : MonoBehaviour {
public bool growOnStart = false;
public int xMax = 11;
public int yMax = 11;
public int zMax = 11;
View MazeMakerGrowInObj.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MazeMakerGrowInObj : MonoBehaviour {
public bool growOnStart = false;
public int xMax = 11;
public int yMax = 11;
public int zMax = 11;
@afjk
afjk / ios_cocos3d_device_camera.m
Created Jan 25, 2015
iOS cocos3d cameraを端末の姿勢に合わせて制御する
View ios_cocos3d_device_camera.m
#import <CoreMotion/CoreMotion.h>
-(void) initMotionManager{
// 1.CMMotionManagereより、端末の姿勢情報を取得
_motionManager = [[CMMotionManager alloc] init];
// 更新の間隔を設定する
_motionManager.deviceMotionUpdateInterval = 1.0f / 30.0f;
// ハンドラを設定する
CMDeviceMotionHandler deviceMotionHandler;
@afjk
afjk / csl_motor.m
Last active Aug 29, 2015
変形CSL関数
View csl_motor.m
- (void) doMonitoring{
// Δφ0(t)=-gi/K*Δφ1(t)+gf*Δφ0(t-1)
const float gi = 0.5f;
const float gf = 1.4f;
const float Kinv = 10.0f;
const float MAX_VOL = 2.0f; //角速度最大値
// 現在の角度
btScalar angle = pHinge->getHingeAngle();
@afjk
afjk / CSL.v
Last active Aug 29, 2015
Defying Gravity - A Minimal Cognitive Sensorimotor Loop Which Makes Robots With Arbitrary Morphologies Stand Up からの引用
View CSL.v
reg [17:0] voltage;
reg [16:0] timer;
always @(posedge ADC_CLK)
case (state)
0 : begin // sense -----------------------------------
if (ADC_DAT == 1)
begin
if ($signed(voltage) < $signed(18'h1FFFF))
voltage <= voltage + 1; // if not saturated
end
View autoInput.rb
require 'open3'
#-------------------------------------------------------------------------------
LOG_FILE = 'inputlog.log'
#-------------------------------------------------------------------------------
# Androidでの入力のログファイルへの出力
#-------------------------------------------------------------------------------
def recordToLogFile
Open3.popen3('adb shell') do |stdin,stdout,stderr,thread|
@afjk
afjk / command.txt
Created Jun 22, 2013
command sample
View command.txt
コマンド
■Android Shell
●Android アプリ名からプロセスを探してKill(ただし、UNIXシェルから実行。WindowsからならMinGWとか使う)
adb shell ps|grep <プロセス名> |awk '{ print $2 }' | xargs adb shell kill
●圧縮ファイル解凍
busybox unzip -x <圧縮ファイル名>.zip
■Linux
View del_comment.py
# -*- coding: CP932 -*-
# コメントの削除
import re
import codecs
import csv
import os
import string
DIR_NAME = r"D:\src"
MOD_DIR_NAME = r"D:\dest"
@afjk
afjk / dir.py
Created Jun 21, 2013
指定フォルダ以下の指定拡張子のファイルリストを表示
View dir.py
# -*- coding: CP932 -*-
# 指定フォルダ以下の指定拡張子のファイルリストを表示
import re
import os
def main():
print os.path.realpath(".")
for root, dirs, files in os.walk(r"D:¥work¥src"):
for fname in files:
if( fname[-4:] == ".cpp" ) or ( fname[-2:] == ".c" ) or ( fname[-2:] == ".h" ):
You can’t perform that action at this time.