Skip to content

Instantly share code, notes, and snippets.

View kongliangzhong's full-sized avatar

kongliangzhong kongliangzhong

View GitHub Profile
@kongliangzhong
kongliangzhong / scala-java-clojure-etc
Last active October 5, 2015 11:48
jvm base langs stuff
##### SCALA LANGUAGE #####
1) Can someone tell me why this does not work?
case class XY(enum: MyEnum)
object MyEnum extends Enumeration {
val OP1, OP2 = Value
}
Error: not found: type MyEnum
@kongliangzhong
kongliangzhong / windows-phone-8-and-C#
Created March 27, 2013 02:38
windows phone 8 dev in c#
C#:
1) output debug info in console:
System.Diagnostics;
...
Debug.WriteLine("");
2) a regex that matchs html link:
var regEx = new Regex(
@kongliangzhong
kongliangzhong / temp-text
Last active December 15, 2015 11:09
stractch text
java compile error: illegal character: \65279
save file without BOM can fix this problem.
in emacs, just open the file and run: M-x set-buffer-file-coding-system, and save the file.
thrift
1) download thrift
2) cd $thrift-home
3) ./configure --with-ruby=no
@kongliangzhong
kongliangzhong / linux-stuff
Last active December 15, 2015 11:09
linux-stuff
######### ubuntu linux #########
1) host file:
127.0.0.1 localhost
127.0.1.1 zhongkongliang-desktop
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
@kongliangzhong
kongliangzhong / emacs-stuff
Last active December 15, 2015 11:09
emacs tips
#### EMACS TIPS ####
### cscope: ###
;; * Keybindings:
;;
;; All keybindings use the "C-c s" prefix, but are usable only while
;; editing a source file, or in the cscope results buffer:
;;
;; C-c s s Find symbol.
;; C-c s d Find global definition.
@kongliangzhong
kongliangzhong / db-stuff
Last active December 15, 2015 11:09
db stuff
############### mongodb: ################
1) not master and slaveok=false
在写多读少的应用中,使用Replica Sets来实现读写分离。通过在连接时指定或者在主库指定slaveOk,由Secondary来分担读的压力,Primary只承担写操作。
对于replica set 中的secondary 节点默认是不可读的,
[mongodb@rac4 bin]$ mongo 127.0.0.1:28019
MongoDB shell version: 2.0.1
connecting to: 127.0.0.1:28019/test
SECONDARY>
SECONDARY>
SECONDARY> db.yql.find()
@kongliangzhong
kongliangzhong / miscellaneous
Last active December 15, 2015 17:49
miscellaneous
##### github related #####
---- emacs gist ----
git://github.com/defunkt/gist.el.git
# What's new in 1.0 ?
gist.el now maintains a local cache so as to not go to the gist server every now and then.
multi-files gist support (indicated by a '+' in the gist list)
improved gist-list buffer, based on tabulated-list.el (same codebase as package.el) New keybindings:
g : reload the gist list from server
e : edit current gist description
@kongliangzhong
kongliangzhong / J2EE-STUFF.txt
Last active December 19, 2015 04:48
J2EE stuff
J2EE STUFF
=== JMX ===
===========
=== MAVEN ===
1. use plugin short name:
add following content in ~/.m2/settings.xml:
<profile>
@kongliangzhong
kongliangzhong / parallel-computing.txt
Last active August 29, 2015 14:12
parallel-computing
### Docker ###
1) hello world:
sudo docker run ubuntu:14.04 /bin/echo "hello, world!"
2) interactive:
sudo docker run -t -i ubuntu:14.04 /bin/bash
3) daemonized hello world:
sudo docker run -d ubuntu:14.04 /bin/bash -c "while true; do echo hello world; sleep 1; done"
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0