Skip to content

Instantly share code, notes, and snippets.

View JotaroS's full-sized avatar
🙃
Out of memory

Jotaro JotaroS

🙃
Out of memory
View GitHub Profile
@JotaroS
JotaroS / servo.ino
Created February 1, 2021 13:54
servo.ino
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
import seaborn as sns
import matplotlib.pyplot as plt
file = open ('input.txt', 'r')
lines = file.readlines()
values = []
for l in lines:
if(l.find('Free heap')!=-1):
print(l)
using UnityEngine;
using System.Threading.Tasks;
public class SampleAwait : MonoBehaviour
{
public bool flag = false;
// Start is called before the first frame update
void Start()
{
MyTask();
@JotaroS
JotaroS / speech.swift
Created April 15, 2020 18:01
easy speech recognition with command-line based swift app
import Foundation
import AppKit
class Dispatcher: NSObject, NSSpeechRecognizerDelegate {
var stop: Bool
override init () {stop = false}
func speechRecognizer(_ sender: NSSpeechRecognizer, didRecognizeCommand command: String)
{
print("command: \(command)")
stop = true
}
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
@JotaroS
JotaroS / DataLogger.cs
Last active June 22, 2017 08:39
Logs data of transform/rotation of the Gameobject
public class DataLogger : MonoBehaviour {
private StreamWriter sw;
private FileInfo fi;
private DateTime date;
// Use this for initialization
void Start () {
date = DateTime.Now;
}
@JotaroS
JotaroS / Touch.cs
Created May 6, 2017 14:23
smooth tracking.
// attaching this code is more stable than OVRCameraRig/L,RHandAnchor.
using UnityEngine;
using System.Collections;
public class Touch : MonoBehaviour {
public OVRInput.Controller controller;
// Update is called once per frame
@JotaroS
JotaroS / Grab.cs
Created May 6, 2017 14:23
Wanna grab somtin in VR?
using UnityEngine;
using System.Collections;
public class Grab : MonoBehaviour {
public OVRInput.Controller controller;
// Use this for initialization
private GameObject grabbedObject;
private bool grabbing;
public const float THRES_GRAB = 0.55f;
@JotaroS
JotaroS / epipolar.py
Created February 23, 2017 12:47
Pythonを用いたエピポーラ幾何のチュートリアル(バグ修正版)
#coding:utf-8
import cv2
import numpy as np
from matplotlib import pyplot as plt
img1 = cv2.imread('./left.jpg',0) #queryimage # left image
img2 = cv2.imread('./right.jpg',0) #trainimage # right image
sift = cv2.SIFT()
import math
pistr = '31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989'