Skip to content

Instantly share code, notes, and snippets.

View harujoh's full-sized avatar
💭
I'm fine.

harujoh

💭
I'm fine.
View GitHub Profile
@harujoh
harujoh / GetUsbCameraSerialID.cs
Created February 3, 2016 06:20
USBカメラのシリアルIDをDXDiagを使って取得する。8秒程かかり非常に低速だが、汎用性は高い。
using System;
using System.Diagnostics;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication3
{
@harujoh
harujoh / GetUsbCameraSerialIdWMI.cs
Last active February 9, 2016 23:40
WMIを使ってUSBカメラのシリアルIDを取得する。※メーカーによっては機能しないBUFFAL◯の広角はダメだった。logicoolのハイエンド機は使用可。
using System;
using System.IO;
using System.Management;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
import numpy as np
class MLP (object):
"""
3 Layered Perceptron
"""
def __init__( self, n_input_units , n_hidden_units, n_output_units):
self.nin = n_input_units
self.nhid = n_hidden_units
self.nout = n_output_units
@harujoh
harujoh / MLP.cs
Last active March 21, 2016 09:54
using System;
using System.Linq;
using NumNet;
namespace MatrixNN
{
class Program
{
static void Main()
{
using System;
namespace HandWriteNN
{
class Program
{
static void Main(string[] args)
{
double lr = 0.1;
using System;
namespace HandWriteNN2
{
class Program
{
static void Main(string[] args)
{
double lr = 0.1;
# -*- coding: utf-8 -*-
from chainer import cuda
from chainer import optimizers
import chainer
import chainer.functions as F
import data
import numpy as np
import time
import six
import numpy as np
from chainer import Function, Variable, optimizers
from chainer import Chain
import chainer.functions as F
import chainer.links as L
class NN(Chain):
def __init__(self):
initial_W1 = np.array([[[[1.0, 0.5,0.0],[0.5, 0.0,-0.5],[0.0, -0.5,-1.0]]],
@harujoh
harujoh / GestureCanceler.cs
Created December 21, 2016 10:08
タブレットのジェスチャ入力を無効化する
private const int WM_GESTURE = 0x0119;
protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case WM_GESTURE:
m.Result = IntPtr.Zero;
break;
default:
base.WndProc(ref m);
[DllImport("user32")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetGestureConfig(IntPtr hWnd, int dwReserved, int cIDs, ref Gestureconfig pGestureConfig, int cbSize);
[StructLayout(LayoutKind.Sequential)]
private struct Gestureconfig
{
public int dwID;
public int dwWant;
public int dwBlock;