Skip to content

Instantly share code, notes, and snippets.

@bonprosoft
bonprosoft / result
Last active September 11, 2017 07:35
Validation of cuDNN dropout function behavior
False
True
import cProfile
import random
import cupy
from cupy import cudnn
libcudnn = cudnn.cudnn
N_LAYER = 10
N_TESTCASE = 1000
@bonprosoft
bonprosoft / convert_image.sh
Last active February 26, 2017 09:55
utility script for image converting (wmf/emf to pdf, ImageMagick is required)
#!/bin/bash
# CONFIGURATION
IN_DIR="fig_raw"
OUT_DIR="fig"
TARGET=("wmf" "emf") # NOTE: emf is only available under windows.
BASEDIR=`dirname $0`
BASEDIR=`(cd "${BASEDIR}"; pwd)`
@bonprosoft
bonprosoft / AggressiveInlining.cs
Created January 16, 2017 18:03
AggressiveInliningしたい
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace InlineConstant
{
public class BaseClass
{
protected virtual int GetConstValue()
{

Keybase proof

I hereby claim:

  • I am bonprosoft on github.
  • I am bonprosoft (https://keybase.io/bonprosoft) on keybase.
  • I have a public key ASBbRLjzVR5Me9usSUt_2llTR4F3thx66jk3ujFK_v1jKAo

To claim this, I am signing this object:

@bonprosoft
bonprosoft / fizzbuzzvbcpp.vb
Created December 1, 2012 14:35
FizzBuzz Sample on VBCPP AST
Imports VBCPP
Imports VBCPPPlugin
Imports VBCPPPlugin.Exceptions
Imports VBCPPPlugin.Tables
Imports VBCPPPlugin.AST
Imports VBCPPPlugin.AST.AST_Class
Imports VBCPPPlugin.AST.AST_Enum
Module FizzBuzz
Sub Main()
@bonprosoft
bonprosoft / helloworld2.vb
Created November 27, 2012 15:23
HelloWorld on VBCPP AST(Another)
' ポイントはNewを殆ど使わず、メソッドチェーンで内容を付与していく点です。
' この式では、なるべくカッコは使いたくなかったので、リストなどを作る際、子を作り終わったらDefineで親に戻ります。
' LINQに触れてみて、感動したので、それに影響されたところがあります。
'★長所: (他の式に比べて)なかなか書きやすい!★
'★短所: Defineをしないうちは、別の中間生成物として表される必要が有るため、クラスが結構増える
Dim tree As New VBCPP_Program
tree.AddMethod( _
VBCPP_Method.CreateNew("SampleMethod",System.Reflection.MethodAttributes.Static Or Reflection.MethodAttributes.Public,LangName,Line,FileName) _
.SetBody _
@bonprosoft
bonprosoft / gist:4025694
Created November 6, 2012 16:06
VBCPP StdBuilder SampleCode
&&entry = "Main"
&&<code language="VB">
Public Sub Main()
Console.WriteLine("VB: Hello,World! Hey,Brainf**k!")
Console.Write("Brainf**k: ")
'Brainf**kのプログラムを呼び出します
BFHello()
End Sub
&&</code>
&&<comment>Hello,World!を出力した後、echoを行います。</comment>
@bonprosoft
bonprosoft / hello,ast.vb
Created November 6, 2012 16:02
Hello,World on VBCPP AST
Imports VBCPP
Imports VBCPPPlugin
Imports VBCPPPlugin.Tables
Imports VBCPPPlugin.AST
Imports VBCPPPlugin.AST.AST_Class
Imports VBCPPPlugin.AST.AST_Enum
Module HelloWorld
Sub Main()
@bonprosoft
bonprosoft / skype4com_sample1.vb
Created July 8, 2012 16:22
Skype4COMでメッセージを編集したイベントを拾うには...
Option Strict On
'今回は単に編集した情報を拾うだけなので、非常に原始的な方法でやってます...!
'(記事: http://www.bonprosoft.com/modules/blog/?p=282 )
Public Class Form1
Public WithEvents oSkype As SKYPE4COMLib.Skype
Private m_status As ReplyStatus
Private m_timeStamp As Integer