Skip to content

Instantly share code, notes, and snippets.

View thorikawa's full-sized avatar

Takahiro "Poly" Horikawa thorikawa

View GitHub Profile
@thorikawa
thorikawa / gist:8213383
Last active January 1, 2016 22:59
Google Glass's Camera Parameter
Horizontal FoV: 54.8
Vertical FoV: 42.5
>>> math.tan(math.radians(27.4))
0.5183507658105608
>>> math.tan(math.radians(21.25))
0.3888787318529897
focal_x
@thorikawa
thorikawa / gist:7611935
Last active December 29, 2015 03:59
Glass Sensor Info
D/HeadGestureDetector( 3078): 4:MPL Gyroscope:Invensense:1000:34.90656
D/HeadGestureDetector( 3078): 1:MPL Accelerometer:Invensense:1000:19.6133
D/HeadGestureDetector( 3078): 2:MPL Magnetic Field:Invensense:10000:9830.0
D/HeadGestureDetector( 3078): 3:MPL Orientation:Invensense:5000:360.0
D/HeadGestureDetector( 3078): 11:MPL Rotation Vector:Invensense:5000:1.0
D/HeadGestureDetector( 3078): 10:MPL Linear Acceleration:Invensense:5000:19.6133
D/HeadGestureDetector( 3078): 9:MPL Gravity:Invensense:5000:9.81
D/HeadGestureDetector( 3078): 5:LTR-506ALS Light sensor:LiteOn:0:64000.0
D/HeadGestureDetector( 3078): 11:Rotation Vector Sensor:Google Inc.:1000:1.0
D/HeadGestureDetector( 3078): 9:Gravity Sensor:Google Inc.:1000:19.6133
@thorikawa
thorikawa / gist:6576316
Last active December 23, 2015 03:49
result of context.sendOrderedBroadcast(buttonUp, "android.permission.CALL_PRIVILEGED") on galaxy nexus (Android 4.3 #JWR66Y)
D/CallNotifier( 593): RINGING... (new)
D/CallNotifier( 593): onNewRingingConnection(): state = RINGING, conn = { incoming: true state: INCOMING post dial state: NOT_STARTED }
D/IncomingBroadcastReceiver( 5656): state:RINGING
D/CallNotifier( 593): SignalInfoTonePlayer.run(toneId = 98)...
W/ActivityManager( 377): Unable to start service Intent { act=show_view cmp=com.anprosit.drivemode/.phone.service.LayerService (has extras) } U=0: not found
D/dalvikvm( 377): GC_EXPLICIT freed 1829K, 19% free 21509K/26500K, paused 14ms+9ms, total 136ms
D/PhoneStatusBar( 463): disable: < expand icons ALERTS* ticker system_info back home recent clock search >
D/AccelerometerListener( 593): enable(false)
E/HeadsetStateMachine( 879): terminateScoUsingVirtualVoiceCall:No present call to terminate
D/PhoneUtils( 593): answerCall(INCOMING)...
@thorikawa
thorikawa / Aerobics.java
Last active December 17, 2015 13:19
GCJ 2012 Round2Aerobics
package com.polysfactory.gcj2013;
import java.util.Arrays;
import java.util.Scanner;
public class Aerobics {
static class Entry implements Comparable<Entry> {
int r;
package com.polysfactory.gcj2013;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
@thorikawa
thorikawa / TreeTraversal.java
Created May 2, 2013 08:22
Implementation for non-recursive tree traversal
package com.polysfactory.treetraversal;
import java.util.Stack;
/**
* Implementation for tree traversal
*
* @author horikawa
*/
@thorikawa
thorikawa / ChromaticNumber.cpp
Created February 18, 2013 04:42
TCO 2012 Round 3A 250 ChromaticNumber
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <queue>
using namespace std;
#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
@thorikawa
thorikawa / detect_multiscale.cpp
Created January 15, 2013 09:36
Simple example for CascadeClassifier.detectMultiScale
#include <opencv2/opencv.hpp>
#include <vector>
using namespace cv;
using namespace std;
int main () {
Mat img = imread("lena.jpg");
CascadeClassifier cascade;
if (cascade.load("haarcascade_frontalface_alt.xml")) {
@thorikawa
thorikawa / matching_sift.cpp
Created August 19, 2012 23:37
SIFT keypoint matcher using OpenCV C++ interface
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
const double THRESHOLD = 400;
@thorikawa
thorikawa / matching_sift.cpp
Created August 19, 2012 10:41
Keypoints matching with SIFT
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using namespace cv;
const double THRESHOLD = 400;