This file contains hidden or 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 outlook = WScript.CreateObject('Outlook.Application'); | |
| var olFolderInbox = 6; | |
| var nameSpace = outlook.GetNamespace('MAPI'); | |
| var folder = nameSpace.GetDefaultFolder(olFolderInbox); | |
| var isOpend = !!outlook.ActiveWindow; | |
| if (!isOpend) { | |
| folder.Display(); | |
| outlook.ActiveWindow.WindowState = 1 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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, ...) |