Skip to content

Instantly share code, notes, and snippets.

@hiromiso
hiromiso / shrink.cpp
Created July 17, 2012 23:18
画像の縮小テスト
#include <stdio.h>
#include <math.h>
#include <vector>
#include <opencv2/opencv.hpp>
// 最近傍法
void NearestNeighbor(const IplImage *src, IplImage *dst)
{
float wf = (double)src->width / dst->width;
float hf = (double)src->height / dst->height;
@hiromiso
hiromiso / nameko machine
Last active October 11, 2015 17:57
なめこ収穫機
#!/usr/bin/python
# Author: hiromiso
# Licence: BSD
import time
from nxt.locator import *
from nxt.motor import *
from nxt.sensor import *
@hiromiso
hiromiso / akiba58
Created October 26, 2012 09:40
/etc/munin/plugins/akiba58
#!/usr/bin/perl
use strict;
my $result = `/usr/local/bin/temper`;
if (defined $ARGV[0] and $ARGV[0] eq 'config') {
print <<EOT;
graph_title Room Temperatures
graph_vtitle Celsius
@hiromiso
hiromiso / akiba58
Created October 26, 2012 09:40
/etc/cron.hourly/akiba58
#!/bin/sh
/usr/local/bin/temper |/usr/bin/awk 'match($0,/,.*/){print substr($0,RSTART+1,RLENGTH)}' |/usr/bin/logger -t akiba58 -p local2.info >/dev/null 2>&1
@hiromiso
hiromiso / shogizumen.js.diff
Created December 5, 2017 01:15
1筋への移動が強調されないので修正
--- shogizumen.js.org 2017-12-05 10:07:30.160864300 +0900
+++ shogizumen.js 2017-12-05 10:07:46.829194159 +0900
@@ -116,10 +116,10 @@
if( (mr=re.exec(text))!=null ){
var mx=-100;
if( (c=0+mr[1])>0){ mx=8-c;}
- else if( (c=ZenSuuji.indexOf(mr[1]))>0 ){ mx=8-c; }
+ else if( (c=ZenSuuji.indexOf(mr[1]))>=0 ){ mx=8-c; }
if( (c=0+mr[2])>0){ mx+=c*9;}
- else if( (c=ZenSuuji.indexOf(mr[2]))>0 ){ mx+=c*9; }