Skip to content

Instantly share code, notes, and snippets.

View enukane's full-sized avatar
🏠
Working from home

naoya Kaneko enukane

🏠
Working from home
View GitHub Profile
package my.hoge;
public class Hoge {
public Hoge()
{
}
public void printHoge(){
System.out.println("Hoge!");
}
package my.hoge;
public class HogeBack {
private int num;
private native int callbackMethod(int num);
public void HogeBack()
{
num = 0;
package scalatest;
class Hoge{
def printHoge():Unit = println("Hoge in scala!")
def getHoge():String = "Hoge"
def add(i:Int, j:Int):Int = i + j
def getMsg(msg:String):String = "Hoget is " + msg
@native def callbackMethod(num:Int):Int = { 18}
def invokeMethod(num:Int):Int = {
println("Invoking Method");
@enukane
enukane / gist:1432135
Created December 5, 2011 03:11
AESNI support detect test code
#include <stdio.h>
#include <stdlib.h>
int main()
{
int _ecx = 0;
int is_aes = 0;
int is_avx = 0;
asm ( "movl $1, %eax;" );
@enukane
enukane / gist:1432141
Created December 5, 2011 03:12
AESNI AESENC test (not working)
#include <stdio.h>
#include <stdint.h>
//#include <cpuid.h>
#include <emmintrin.h>
//#include <smmintrin.h>
typedef union {
__attribute__ ((aligned(16))) unsigned int i[4];
__m128i m;
} m128i;
@enukane
enukane / gist:1469945
Created December 13, 2011 01:19
vimproc compile failed in netbsd5.0
% make -f make_gcc.mak
gcc -W -O2 -Wall -Wno-unused -std=gnu99 -pedantic -shared -fPIC -o autoload/proc.so autoload/proc.c -lutil
autoload/proc.c:43:22: error: libutil.h: No such file or directory
autoload/proc.c: In function 'vp_pty_open':
autoload/proc.c:564: warning: implicit declaration of function 'openpty'
autoload/proc.c:571: warning: implicit declaration of function 'forkpty'
autoload/proc.c: In function 'vp_waitpid':
autoload/proc.c:750: warning: implicit declaration of function 'WIFCONTINUED'
autoload/proc.c: In function 'vp_decode':
autoload/proc.c:856: warning: array subscript has type 'char'
@enukane
enukane / gist:1670149
Created January 24, 2012 13:20
spaces between # and define
# include<stdio.h>
# define HOGE 1
#ifdef HOGE
# define HUGA 2
#else
# define HUGA 3
#endif
int
main()
@enukane
enukane / gist:1941350
Created February 29, 2012 14:56
PowerUSB : プラグして、アプリを立ち上げて少し放置
<?xml version='1.0'?>
<!-- This file was generated by SnoopyPro -->
<snoopyprolog>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
@enukane
enukane / gist:1941373
Created February 29, 2012 15:03
PowerUSB : プラグして、アプリを立ち上げて、OUTLET1をonに
<?xml version='1.0'?>
<!-- This file was generated by SnoopyPro -->
<snoopyprolog>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>
@enukane
enukane / gist:1941481
Created February 29, 2012 15:16
PowerUSB : プラグして、アプリを立ち上げて、OUTLET3をoffに, 再度OUTLET3をonに
<?xml version='1.0'?>
<!-- This file was generated by SnoopyPro -->
<snoopyprolog>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>