This file contains hidden or 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
/** | |
* datespinner "yyyy/mm/dd" | |
*/ | |
$.widget( "ui.datespinner", $.ui.spinner, { | |
options: { step: 60*60*24*1000, page: 60*60*24*1000 }, | |
_parse: function( value ) { | |
if ( typeof value === "string" ) { | |
if ( Number( value ) == value ) { | |
return Number( value ); | |
} |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import cv2 | |
import numpy as np | |
print "opencv-" + cv2.__version__ + "\n" | |
cap = None | |
image_index = None |
This file contains hidden or 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
/** | |
* # cvCascade.cpp | |
* | |
* ## CMakeLists.txt | |
* ``` | |
* cmake_minimum_required(VERSION 2.8) | |
* project( cvCascade ) | |
* find_package( OpenCV REQUIRED ) | |
* add_executable( cvCascade cvCascade.cpp ) | |
* target_link_libraries( cvCascade ${OpenCV_LIBS} ) |
This file contains hidden or 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
# | |
# CMakeLists.txt to generate a Makefile for a simple c++ project using OpenCV. | |
# | |
# cmake -D OpenCV_DIR="C:/opencv" ../source | |
# | |
cmake_minimum_required(VERSION 2.8) | |
project( <project-name> ) | |
find_package( OpenCV REQUIRED ) | |
add_executable( <executable-name> cvCascade.cpp ) | |
target_link_libraries( <executable-name> ${OpenCV_LIBS} ) |
This file contains hidden or 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
import sys | |
import numpy as np | |
import cv2 | |
import pylab as plt | |
capL = cv2.VideoCapture(int(sys.argv[1])) | |
capR = cv2.VideoCapture(int(sys.argv[2])) | |
imgL = np.zeros((480,640,3), np.uint8) | |
imgR = np.zeros((480,640,3), np.uint8) | |
while True: |
This file contains hidden or 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
#include "stdafx.h" | |
#include <string> | |
//VC++ SJIS string を utf-8のstringに変換する | |
string sjis2utf8(const string& sjis) { | |
string utf8_string; | |
//一旦SJISからutf-16へ変換 | |
LPCCH pSJIS = (LPCCH)sjis.c_str(); | |
int utf16size = ::MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, pSJIS, -1, 0, 0); |
This file contains hidden or 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
#include <Windows.h> | |
BOOL IsRunningOnX64() | |
{ | |
BOOL isRunningOnX64 = FALSE; | |
typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); | |
LPFN_ISWOW64PROCESS IsWow64Process = | |
(LPFN_ISWOW64PROCESS)GetProcAddress( | |
GetModuleHandle(TEXT("kernel32")), "IsWow64Process"); | |
if (IsWow64Process != 0) { | |
IsWow64Process(GetCurrentProcess(), &isRunningOnX64); |
This file contains hidden or 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
<?php | |
/** | |
* e-mail address specification. | |
* | |
* http://blog.livedoor.jp/dankogai/archives/51189905.html | |
* | |
* RFC-2822 3.4.1 Addr-spec specification | |
* https://www.ietf.org/rfc/rfc2822.txt | |
*/ | |
class RFC2822_AddrSpec { |
This file contains hidden or 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
$.fn.uitext = function() { | |
this.addClass("ui-spinner-input") | |
.css({'margin-right':'.4em'}) | |
.appendTo( | |
$('<span/>') | |
.addClass("ui-spinner") | |
.addClass("ui-widget") | |
.addClass("ui-widget-content") | |
.addClass("ui-corner-all") | |
.insertBefore(this)); |
This file contains hidden or 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
<?php | |
if(count($argv) != 2) { | |
exit; | |
} | |
$executable_suffixies = array("cmd", "bat", "dll", "exe"); | |
$filename = $argv[1]; | |
$no_suffix = !has_suffix($filename, $executable_suffixies); | |
$pathes = preg_split('/;/', getenv('PATH')); | |
foreach( $pathes as $path ) { | |
echo_file_exists("$path\\$filename"); |