Skip to content

Instantly share code, notes, and snippets.

View 0V's full-sized avatar
🛌
Always sleeping

G2 0V

🛌
Always sleeping
View GitHub Profile
@echo off
set /P waittime="Log off: Input wait time [sec]> %waittime%"
set /A mintime=waittime/60
echo Log off : %mintime% [min] (%waittime% [sec])
timeout /t %waittime%
shutdown /l
@0V
0V / wallis_formula.rb
Last active August 29, 2015 14:11
Wallis' Formula by Ruby
module MathUtil
#
# Wallis の公式によって円周率を求めます。
#
# [count]
# 計算回数を指定します。
#
# 使用例
# print(MathUtil.wallis_formula(10000000))
# >> 3.1415925750808533
@0V
0V / app.config
Last active August 29, 2015 14:11
Log4net.Async 用設定ファイル例
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type=" log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<!-- <appender name="rollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> -->
<appender name="rollingLogFileAppender" type="Log4Net.Async.AsyncRollingFileAppender,Log4Net.Async">
namespace Util
{
public class FileUtility
{
/// <summary>
/// ファイル名として使用可能な形にする。
/// </summary>
/// <param name="name">元のファイル名</param>
public static string ValidFileName(string name)
{
@0V
0V / EnumTest.cs
Last active August 29, 2015 14:12
enum の挙動ちょっと怖い
using System;
public class Test
{
enum T{
A,
B,
C = A,
D,
E,
}
@0V
0V / 平均律.cs
Last active August 29, 2015 14:13
/// <summary>
/// 値の単位は Hz
/// </summary>
public enum TemperamentEqual : int
{
無音 = 0,
ド = 440,
ド_シャープ = 466,
レ_フラット = ド_シャープ,
レ = 494,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Util
{
public class RandomWordMatch
{
@0V
0V / CaptureIO.cs
Last active August 29, 2015 14:16
OpenCvSharp で Web カメラから動画を保存
using OpenCvSharp;
using OpenCvSharp.CPlusPlus;
using System;
namespace OpenCvSharpSample.Samples
{
public class CaptureIO
{
public static void CameraSave(int cameraId, int fps, int second, bool putText = true)
@0V
0V / DynamicBackgroundSubtractorCapture.cs
Last active August 29, 2015 14:17
OpenCvSharp で動的背景差分検出(From Web Camera)
using OpenCvSharp.CPlusPlus;
using System;
namespace OpenCvSharpSample
{
class Program
{
static void Main(string[] args)
{
DynamicBackgroundSubtractorCapture(0);
@0V
0V / ColorExtraction.cs
Last active December 25, 2016 08:28
OpenCvSharp で色領域抽出 (C++ API で)
using OpenCvSharp;
using OpenCvSharp.CPlusPlus;
using System;
namespace OpenCvSharpSample
{
class Program
{
static void Main(string[] args)
{