Skip to content

Instantly share code, notes, and snippets.

the number of significant digits displayed in floating point numbers.
precision = 14|12
当float超过14|12位时会自动用科学计数法表示,所以需要用$num = springf("%.0f", $number)
microtime()=>return a string
microtime(true)=>return a float
echo sprintf("$.0f", $microtime() * 1000000)
ssh connect slow:
change /etc/ssh/ssh_config to add
GSSAPIAuthentication no
run a shell in every 3 miniutes
*/3 * * * * /bin/bash /path/to/shell/script
sudp cp /usr/share/application/empathy.desktop eclipse.desktop
@baijian
baijian / android-learning
Created July 7, 2013 08:13
some summary of developing android.....
fragment
=====
* initComponents
* initEvents
* initLogic
* onLoadComplement
* onItemClick
@baijian
baijian / gist:5464990
Last active December 16, 2015 16:40
mysqldump
命令导出数据库表or数据:
>mysqldump -u用戶名 -p密码 -d 數據库名 表名 脚本名;
导出数据库所有表结构
>mysqldump -uroot -password -d dbname > db.sql
导出数据库table表接口
>mysqldump -uroot -ppassword -d dbname table > table.sql
@baijian
baijian / login to the server without passcode
Last active December 16, 2015 11:39
when want to login without password, pay attention to the authority of directory and file
>client
ssh-keygen,一直Enter,得到一对rsa的公钥私钥对.
scp id_rsa.pub user@server.com:~/
>server
确保/root权限为750
@baijian
baijian / team develop
Last active December 16, 2015 01:38
develop project using vagrant
### Install virtualbo
https://www.virtualbox.org/wiki/Downloads
### Install vagrant
http://downloads.vagrantup.com/
###
```
> vagrant init
this command just generate a Vagrantfile, this file describe the kind of machine and
```
sudo apt-get install build-essential autoconf automake \
libtool libfcgi-dev spawn-fcgi \
libssl-dev nginx git-core
```
###fcgiwrap
```
git clone https://github.com/gnosek/fcgiwrap.git
cd fcgiwrap/
autoreconf -i
>> crontab -e
* * * * * env > ~/env.tmp
bash shell
>>env > ~/env.tmp2
compare two file: evn.tmp and env.tmp2, you will know why your job can run through shell but can't run through cron.
===
pom.xml file is essentially the project's metadata file
that describes the various aspects of the project.
It describes the project's name, group, version,
dependecies, and many other things.
===
Ok, as we have create a project with maven and
import it into eclipse, when we develop the project
we want to use a jar file in our local repository(for example jzmq.jar),
so we add the jar file into our local repository first,
@baijian
baijian / create a project with maven
Last active December 11, 2015 08:59
maven is a good thing to manage java project...
before we start to create a project using maven,
maybe we should set a proxy.....
we can use maven archetype plugin to help us to
create a maven project , you can see archtype
as a existing template.
>>mvn archetype:generate
then terminal will prompt you to choose a number(choose a template),
because there are a lot of choices, so you can use filter to
filter some like input "quick", then you can see