小知识备忘

MYSQL:

GRANT ALL PRIVILEGES ON bbs.* TO test@localhost IDENTIFIED BY 'test';

set global wait_timeout=100;

show variables like 'max_allowed_packet';

 

python IDE:

PyScripter
PyCharm
Eclipse pydev
PythonWin
IDLE

 

Java通信框架:

comet     mina     netty

 

nginx rewrite:

if ($host = "tsw202.com"){rewrite ^/(.*)$ http://www.tsw202.com/$1 permanent;}
if ($host = "tsw202.cn"){rewrite ^/(.*)$ http://www.tsw202.com/$1 permanent;}
if ( $host ~* "^(.*)\.tsw202\.cn$") { 
set $domain $1;
rewrite ^/(.*) http://$domain.tsw202.com/$1 break; 
}

 

破解小知识:

破解VC的用 IDA OllyDbg SoftSnoop Api Monitor
破解C#的用.net reflector
破解Delphi的用Dede IDA OllyDbg
破解VB的用vb_decompiler vb_injector OllyDbg

 

经纬度记录筛选:

$lat=20;
$lon=20;//执行查询,算出该用户与所有其他用户的距离,取出最近的10个
$sql='select * from users_location order by ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((latitude * 3.1415) / 180 ) COS(('.$lat.' * 3.1415) / 180 ) * COS((latitude * 3.1415) / 180 ) *COS(('.$lon.' * 3.1415) / 180 - (longitude * 3.1415) / 180 ) ) * 6380 asc limit 10';

 

iframe父/子页面:

iframe中子页面给父页面的Div赋值
parent.window.document.getElementByIdx_x('id').innerHTML='';
调用父页面的方法
window.parent.window.methodName();
刷新父页面
window.parent.location.reload();
--------------------------------------------------------------
父页面调用iframe内的JS的方法,无须给iframe加id,只需用Jq选中iframe就行了
$("#id").find("iframe")[0].contentWindow.func()

 

PHP写utf8 BOM头:

fwrite($fp,"\xEF\xBB\xBF"); 
fwrite($f, pack("CCC", 0xef,0xbb,0xbf));

 

posted on 2015-11-21 11:36  咚..咚  阅读(149)  评论(0编辑  收藏  举报

导航