Skip to content

Instantly share code, notes, and snippets.

View nkymut's full-sized avatar

Yuta Nakayama nkymut

  • Design Incubation Centre, National University of Singapore
  • Singapore
View GitHub Profile
@nkymut
nkymut / Belanda01.dot
Last active December 5, 2021 05:34
Water_Irrigation
digraph G {
compound=true;
subgraph cluster_IKEA_BOX_0 {
//style=filled;
color=gray;
//node [style=filled,color=cyan];
Parsley_0,Parsley_1,Tulsi_0,Sage_0;
label = "IKEA_BOX_0";
labeldistance= "3";
@nkymut
nkymut / shikenfix.py
Last active August 12, 2021 08:40
自炊した四間飛車を指しこなす本 を読めるように直すスクリプト
#四間飛車を指しこなす本を直すスクリプト
#!pip install pypdf2
#参考:https://realpython.com/pdf-python/
from PyPDF2 import PdfFileReader, PdfFileWriter
#本文最初のPDFページ数
start_page = 8
#本文最後のPDFページ数
%
(1001)
(T1 D=3 CR=0 - ZMIN=-0.01 - flat end mill)
#100=400 (Feed Speed)
#101=50 (Circle Diameter)
#102=1 (Min circle diameter)
#103=3 (offset)
N10 G90 G94 (Absolute -> Relative Positioning)
N20 G17 (Set XY Plane)
N30 G21 (Metric System)
@nkymut
nkymut / installArduino.bat
Last active August 5, 2020 05:08
Silent install script for Arduino Driver and Arduino IDE
cd /D "%~dp0"
@echo off
setlocal enabledelayedexpansion
rem Silent install script for Arduino Driver and Arduino IDE
rem https://forum.arduino.cc/index.php?topic=582294.0
set ARDUINOINSTALLER=arduino-1.8.13-windows.exe
set DEST_DIR="C:\Program Files (x86)\Arduino"
/* Anti-PowerSave Light
rage against the stupid auto-turn off timer.
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
float light = 0;
@nkymut
nkymut / cv2glet.py
Created June 8, 2018 04:53
convert opencv image to pyglet image
"""
convert opencv image to pyglet image
"""
import pyglet
import cv2
from PIL import Image
import numpy as np
def cv2glet(img,format):
@nkymut
nkymut / mjpegTest.py
Created June 8, 2018 04:50
Retrieving mjpeg video stream from an IP Camera with opencv python
import cv2
cap = cv2.VideoCapture('http://admin:password@127.0.0.1/video/mjpg.cgi')
while True:
ret, frame = cap.read()
print(frame.shape)
cv2.imshow('Video', frame)
if cv2.waitKey(1) == 27:
exit(0)