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
;; golang | |
(add-to-list 'load-path "~/.emacs.d/go-mode") | |
(require 'go-mode) | |
(require 'go-mode-load) | |
(require 'go-autocomplete) | |
(require 'auto-complete-config) | |
(setq gofmt-command "goimports") | |
(load-file "~/.emacs.d/go-autocomplete.el") | |
(add-hook 'before-save-hook 'gofmt-before-save) |
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
package main | |
import "fmt" | |
// send the sequence of 2, 3, 4, .... to returned channel | |
func generate() chan int { | |
ch := make(chan int) | |
go func() { | |
for i := 2; ; i++ { | |
ch <- 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 <stdio.h> | |
int main() | |
{ | |
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 <algorithm> | |
#include <ctime> | |
#include <iostream> | |
int main() | |
{ | |
// generate data | |
const unsigned arraySize = 32768; | |
int data[arraySize]; |
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
/******************************************************************************* | |
* | |
* @name : DELEGATE_H | |
* | |
* @author : BigBird (peng@nextopsoftware.com) | |
* @date : 2012-10-16 21:58:04 | |
* | |
* @brief : | |
* |
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
mysqldump --opt -h192.168.0.156 -uusername -ppassword --skip-lock-tables databasename > database.sql | |
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
# Class Tree | |
# ruby prog.rb > class.dot;dot -Tpng class.dot -o class.png; | |
def readable(str) | |
if str.length >= 30 | |
return false | |
end | |
for k in 0..str.length-1 | |
s = str[k] | |
if not ((s>='a' and s<='z') or (s>='A' and s<='Z') or (s >='0' and s<='9')) |
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
//http://en.wikipedia.org/wiki/XOR_linked_list | |
//use one pointer to construct double-link list | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
struct item{ | |
void* nextprev; |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/token" | |
"io/ioutil" | |
"os" |
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> | |
#include <string> | |
#include <vector> | |
#include <set> | |
#include <stdio.h> | |
#include <assert.h> | |
using namespace std; | |
enum OpType { |
OlderNewer