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 fileencoding=utf-8 | |
"this line causes the long long latency for opening lagre file. | |
"set fileencodings=utf-8,ucs-bom,cp936,gb18030,utf-16,big5,gbk,ucs-bom,cp936,latin1 | |
"for vim-latex | |
"only for tex files. three <leader> to write and compile. view is reserved. | |
autocmd FileType tex map <leader><leader><leader> :w<cr><plug>Tex_Compile | |
"<plug>Tex_View | |
"C-L to automatically add \left and \right. Because <Alt+L> will key in special symbol. |
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
(defun matlab-shell-run-cell () | |
"Run the cell the cursor is in." | |
(interactive) | |
(let ((start (save-excursion (end-of-line);(forward-page -1) | |
(re-search-backward "\\(%%\\)\\|\\`") | |
(if (looking-at "function") | |
(error "You are not in a cell. Try `matlab-shell-save-and-go' instead")) | |
(point))) | |
(end (save-excursion (end-of-line) | |
(re-search-forward "\\(%%\\)\\|\\'") |
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
I just test on OS X 10.9.1 | |
You need homebrew first: http://brew.sh | |
Then: | |
brew tap homebrew/versions | |
brew install gcc48 | |
Long wait. |
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
/* | |
* Test fork(), pipe(), etc. | |
* Author: xcv58 | |
* Date: 2/2/2014 | |
*/ | |
#ifndef _STDIO_H_ | |
#define _STDIO_H_ | |
#include <stdio.h> | |
#endif |
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
SCRIPT_FILE=`which $0` | |
if [ -L $SCRIPT_FILE ]; then | |
SCRIPT_FILE=`readlink $SCRIPT_FILE` | |
fi | |
SCRIPT_PATH=`dirname $SCRIPT_FILE` | |
SCRIPT_FILE=`basename $SCRIPT_FILE` | |
echo Path: $SCRIPT_PATH | |
echo Filename: $SCRIPT_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
tell application "Safari" | |
activate | |
tell front window | |
set current tab to make new tab | |
end tell | |
end tell | |
tell application "System Events" | |
tell process "Safari" | |
click menu item 16 of menu 1 of menu item "User Agent" of menu 1 of menu bar item "Develop" of menu bar 1 | |
end tell |
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
import java.util.*; | |
import java.util.stream.*; | |
public class CustomHash { | |
public class Entry { | |
List<Object> list; | |
public Entry() { | |
list = new ArrayList<Object>(); | |
} |
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
import java.util.*; | |
import java.io.*; | |
public class Temp { | |
public enum TYPE { | |
INT, LONG, FLOAT, DOUBLE, STRING, DATE, DECIMAL, CHAR, VARCHAR | |
} | |
private List<TYPE> 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
global foundCount | |
global hideCount | |
global frontmostCount | |
on toggle(appPath) | |
if application appPath is running then | |
set foundCount to foundCount + 1 | |
if frontmost of application appPath then | |
if hideCount > 0 then return | |
set hideCount to hideCount + 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
/* | |
* Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 | |
* The President and Fellows of Harvard College. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* 2. Redistributions in binary form must reproduce the above copyright |
OlderNewer