Skip to content

Instantly share code, notes, and snippets.

View mactkg's full-sized avatar
🍼
I'm feeding milk...

mactkg mactkg

🍼
I'm feeding milk...
View GitHub Profile
#include <math.h>
#define _USE_MATH_DEFINES
#include <iostream>
double LengthCos(double t1,t2,t3,f1,f2,f3) {
return sqrt(((t1-f1)*(t1-f1)+(t3-f3)*(t3-f3)))/sqrt(((t1-f1)*(t1-f1)+(t2-f2)*(t2-f2)+(t3-f3)*(t3-f3)));
}
double LengthDegree(double t1,t3,f1,f3) {
return sqrt((t1-f1)*(t1-f1))/sqrt(((t1-f1)*(t1-f1)+(t3-f3)*(t3-f3)));
@mactkg
mactkg / shibuya_ni.txt
Created June 2, 2011 11:25 — forked from fullmated/shibuya_ni.txt
shibuya_ni
一歳半のちびっ子が認識しない件
Kinect本はKinect-Hackにぴったりです
OpenNI
Generator
MetaData
NITE
Session
Detector
idea
@mactkg
mactkg / shibuya_ni.txt
Created June 2, 2011 12:04 — forked from fullmated/shibuya_ni.txt
shibuya_ni
一歳半のちびっ子が認識しない件
Kinect本はKinect-Hackにぴったりです
OpenNI
Generator
MetaData
NITE
Session
Detector
idea
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<title>mind-catch</title>
<script type="text/javascript" src="./jquery-1.7.min.js"></script>
<script type="text/javascript">
var canvas;
var context;
var socket;
#include<stdio.h>
main(){
unsigned long long a[3]={0L,1L,1L},b,c=0;
printf("%d\n%d\n",a[1],a[2]);
for(b=0;b-98;b++){
c=0;
a[b%3]=a[(b+1)%3]+a[(b+2)%3];
if(!(a[b%3]%3))printf("Fizz"),c=1;
if(!(a[b%3]%5))printf("Buzz"),c=1;
if(!c)printf("%lld",a[b%3]);
@mactkg
mactkg / gist:3076555
Created July 9, 2012 13:27
はいれつ
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <limits.h>
#define NUM 100000
#define N 2147483647L
int main(void){
long long int i;
clock_t start,end;
@mactkg
mactkg / jinkouchinou.py
Created October 17, 2012 16:29 — forked from salexkidd/jinkouchinou.py
やったー!Pythonでも人工知能できたよー!\(^o^)/
# -*- coding:utf-8 -*-
import random
def main():
word_list = [u'マジで', u'ヤバい', u'ウケるー', ]
while True:
raw_input(">>>")
print random.choice(word_list)
@mactkg
mactkg / fft.py
Last active December 12, 2015 08:39 — forked from sgk/fft.py
import math
def fft(n, data):
theta = math.pi * 2 / n
def scramble(k, i):
while True:
i ^= k
if i >= k:
return i
@mactkg
mactkg / light.ino
Created December 2, 2013 06:28 — forked from anonymous/light.ino
void setup(){
pinMode(2,INPUT);
pinMode(9,OUTPUT);
}
int last_sw;
void loop(){
int sw = digitalRead(2);
int light=0;
//===============================
// arduino
//===============================
void setup(){
Serial.begin(9600);
pinMode(13,INPUT);
}
void loop(){