Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

naoya Kaneko enukane

🏠
Working from home
View GitHub Profile
View Hoge.java
package my.hoge;
public class Hoge {
public Hoge()
{
}
public void printHoge(){
System.out.println("Hoge!");
}
View HogeBack.java
package my.hoge;
public class HogeBack {
private int num;
private native int callbackMethod(int num);
public void HogeBack()
{
num = 0;
View Hoge.scala
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 Dec 5, 2011
AESNI support detect test code
View gist:1432135
#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 Dec 5, 2011
AESNI AESENC test (not working)
View gist:1432141
#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 Dec 13, 2011
vimproc compile failed in netbsd5.0
View gist:1469945
% 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 Jan 24, 2012
spaces between # and define
View gist:1670149
# include<stdio.h>
# define HOGE 1
#ifdef HOGE
# define HUGA 2
#else
# define HUGA 3
#endif
int
main()
@enukane
enukane / gist:1941350
Created Feb 29, 2012
PowerUSB : プラグして、アプリを立ち上げて少し放置
View gist:1941350
<?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 Feb 29, 2012
PowerUSB : プラグして、アプリを立ち上げて、OUTLET1をonに
View gist:1941373
<?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 Feb 29, 2012
PowerUSB : プラグして、アプリを立ち上げて、OUTLET3をoffに, 再度OUTLET3をonに
View gist:1941481
<?xml version='1.0'?>
<!-- This file was generated by SnoopyPro -->
<snoopyprolog>
<urb sequence="1">
<function>GET_DESCRIPTOR_FROM_DEVICE</function>