This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'net/imap' | |
require 'kconv' | |
SVR='sample.server.com' | |
USR='user' | |
PWD='pppppp' | |
ADR='[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
require 'rubygems' | |
require 'yaml' | |
require 'date' | |
require "google/api_client" | |
oauth_yaml = YAML.load_file('.google-api.yaml') | |
client = Google::APIClient.new({:application_name => "gcalxx",:application_version => "1.0"}) | |
client.authorization.client_id = oauth_yaml["client_id"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 | |
require 'rubygems' | |
require 'tesseract-ocr' | |
engine = Tesseract::Engine.new{ |engine| | |
engine.language = :jpn | |
} | |
puts "==== 画像全体から文字を取得します" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'opencv' | |
capture = OpenCV::CvCapture.open | |
mat = capture.query.to_CvMat | |
mat.save('output.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'opencv' | |
require 'em-websocket' | |
require 'base64' | |
EM::run do | |
cap = OpenCV::CvCapture.open | |
det_file = "/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml" | |
det = OpenCV::CvHaarClassifierCascade::load det_file | |
connections = Array.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebCam</title> | |
</head> | |
<body> | |
<div id="capture-area"> | |
</div> | |
<script src="http://codeorigin.jquery.com/jquery-2.0.3.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:latest | |
MAINTAINER vivahiraj | |
ENV ADD_USER tomato | |
ENV USER_PWD tomato | |
RUN yum update -y | |
RUN yum -y install openssh-server | |
RUN sed -ri 's/required pam_loginuid.so/optional pam_loginuid.so/g' /etc/pam.d/sshd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:latest | |
MAINTAINER vivahiraj | |
RUN yum -y install vi | |
RUN echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock | |
RUN cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime | |
RUN yum groupinstall -y japanese-support | |
RUN echo 'LANG="ja_JP.UTF-8"' > /etc/sysconfig/i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_modulus10(v) | |
val = v.reverse | |
pos = total_even = total_odd = 0 | |
val.split(//).each do |d| | |
pos = pos + 1 | |
(pos % 2) == 0 ? total_even += d.to_i : total_odd += d.to_i | |
end | |
digit = 10 - (total_even + total_odd * 3).to_s[-1,1].to_i | |
digit = 0 if digit == 10 | |
return digit.to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#システム全体で利用できるようにrbenvをインストールするメモ | |
#CentOSにインストールすることを前提にしている | |
su - | |
#インストールに必要なものをインストール | |
yum install -y git gcc gcc-c++ openssl-devel readline-devel | |
#rbenvのインストール | |
cd /usr/local |
OlderNewer