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
var argc = WScript.Arguments.Count(); | |
if (argc !== 2) { | |
WScript.Echo('unzip.js [input file] [output folder]'); | |
WScript.Quit(1); | |
} | |
var objShell = new ActiveXObject("shell.application"); | |
var inputFileName = WScript.Arguments(0); | |
var outputFolderName = WScript.Arguments(1); |
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
function error(message) { | |
excel.Quit(); | |
excel = null; | |
WScript.Echo(message); | |
WScript.Quit(1); | |
} | |
var argc = WScript.Arguments.Count(); | |
if (argc !== 2) { | |
WScript.Echo('xls2csv.js [source file] [target file]'); |
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
Set objParm = Wscript.Arguments | |
If objParm.Count < 1 Then | |
WScript.Echo "play.vbs [path]" | |
WScript.Quit | |
End If | |
Set wmp = WScript.CreateObject("WMPlayer.OCX") | |
Sub waitWMPlayerStop() |
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
struct data { | |
float a; | |
float b; | |
}; | |
static jint com_example_test(JNIEnv *env, jobject thiz, jobject buffer) { | |
struct data* pbuf = (data *)env->GetDirectBufferAddress(buffer); | |
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
// ref: https://groups.google.com/forum/#!topic/android-developers/M-g3LqIY_xM | |
private String getProperty(String name, String defaultValue) { | |
ArrayList<String> processList = new ArrayList<String>(); | |
String line; | |
Pattern pattern = Pattern.compile("\\[(.+)\\]: \\[(.+)\\]"); | |
Matcher m; | |
try { | |
Process p = Runtime.getRuntime().exec("getprop"); |
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
func carray2slice(array *C.int, len int) []C.int { | |
var list []C.int | |
sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&list))) | |
sliceHeader.Cap = len | |
sliceHeader.Len = len | |
sliceHeader.Data = uintptr(unsafe.Pointer(array)) | |
return list | |
} |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import sys | |
sys.stdout.write("run\n") | |
sys.stdout.write(">> ") | |
for line in iter(sys.stdin.readline, ""): |
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
// kernel/kernel/printk.c | |
// before | |
#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) | |
// after | |
#define __LOG_BUF_LEN (4 << CONFIG_LOG_BUF_SHIFT) |
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
// kernel/kernel/printk.c | |
static int kmsg_level = 0; | |
void set_kmsg_lebel(int level) | |
{ | |
kmsg_level = level; | |
} | |
void kmsg_write(const char *fmt, ...) |
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 T::method() { | |
return 0; | |
} | |
// static member function | |
void *T::threadStart(void *obj) { | |
int ret; | |
T *me = reinterpret_cast<T *>(obj); | |
ret = me->method(); | |
return (void *)ret; |