This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mname := brook | |
$(mname)-objs := main.o | |
obj-m := $(mname).o | |
KERNELDIR := /lib/modules/`uname -r`/build | |
all: | |
$(MAKE) -C $(KERNELDIR) M=`pwd` modules | |
clean: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/any.hpp> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
using namespace boost; | |
void test_any() | |
{ | |
std::vector<any> a; | |
a.push_back(2); | |
a.push_back(string("test")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int IsOdd(int x) | |
{ | |
return x & 1; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
for (int i = 0; i < 1000; i++) IsOdd(i); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <jni.h> | |
#include "HelloWorld.h" | |
#include <stdio.h> | |
JNIEXPORT void JNICALL Java_HelloWorld_sayHello (JNIEnv *env, jobject obj) { | |
printf("Hello,the World!!!\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <jni.h> | |
int main (int argc, char *argv[]) | |
{ | |
JavaVM *jvm; /* 宣告一個java machine */ | |
JNIEnv *env; /* JNI的環境 */ | |
JavaVMInitArgs vm_args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
struct foo | |
{ | |
static int count; | |
int id; | |
foo() : id(++count) | |
{ | |
std::cout << "Constructing! " << id << std::endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
int main() | |
{ | |
void *p = malloc(10); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "deleter.h" | |
void delete_object(Object* p) | |
{ | |
delete p; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index 1a06ae2..ef440ea 100644 | |
--- a/_config.yml | |
+++ b/_config.yml | |
@@ -33,7 +33,7 @@ destination: public | |
plugins: plugins | |
code_dir: downloads/code | |
category_dir: blog/categories | |
-markdown: rdiscount | |
+markdown: kramdown | |
pygments: false # default python pygments have been replaced by pygments.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
printf("Hello World!\n"); | |
return 0; | |
} |
OlderNewer