最近一年, 每天都非常難熬, 因為每天都要轉換幾種思維去寫唔同的程序. 程序好似寫了唔少了, 從html, css, javascript, 到java, php. 可以講自己已經無所不通了, 但總是覺得自己冇咩積累. 尤其之前自己設計的一個框架, 雖然思想與大部分框架一致, 但事實上設計很簡陋, 令到自己十分沮喪. 然后又加深了自己的認識, 更加覺得冇豐富的編程經驗, 系冇可能寫得出優秀框架的. (開始懷疑那些連程序都冇掂過的system designer 究竟可以設計出咩垃圾框架出來). 雖然有自建的standalone wiki, 但始終唔喜歡用wiki, 因為not html friendly. 于是就促成了這個空間的來由.
當自己現在開始累積的時候, 卻發覺自己的知識都很多, 但沒有一個系統的整理. 雖然系在遇到問題的時候, 可以很快的trouble shooting and solving. 但以后呢? 所以要在將來空閑的時間來整理一下, 至少對career一定有用的.
盼望空閑時間的來臨…
PS: 最近, 或者講一直很討厭microsoft的編程語言的出品, 或者系缺少例如Jame Gosling這種編程大師吧. VB, C#, 一見到啲syntax就想作嘔… syntax同design上的問題就唔使講啦, 還要dot net唔系開源的, 想查問題出在邊都查唔到…
from http://www.nabble.com/jQuery-%2B-Prototype-on-newest-release-%281.2.6%29-td17811639s27240.html#a17811639
Actually, there is an issue with noConflict and older versions of
Scriptaculous but not jQuery v1.2.6 and the most recent Scriptaculous.
You can check out the whole threads here:
http://groups.google.com/group/jquery-en/browse_thread/thread/69cb41d2e3710c70/f707b1df7821d026?hl=en&#f707b1df7821d026
http://groups.google.com/group/jquery-en/browse_thread/thread/dde6b91c3ad00ecc/25465bb7850810fa?hl=en%E6%8D%B9bb7850810fa
The issue wasn’t so much a problem with jQuery as it was with
Scriptaculous overwriting the call() method with custom functionality
solely in effects.js. The script the implement is seen here:
Array.prototype.call = function() {
var args = arguments;
this.each(function(f){ f.apply(this, args) });
}
That is most likely the conflict you’re experiencing. They’ve since
fixed that in the latest version of scriptaculous.
If after reading that and upgrading accordingly, if you still have a
problem, could you post up a test case so we can check it out?
Rey…
Just a note: If you have to use IIS and CakePHP together, however, you don’t have any privileges to the setting on production server, especially on shared hosting server, this is for you.
Just uncomment this line
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
And change to
Configure::write('App.baseUrl', env('SCRIPT_NAME')."?");
And the url will become pretty, at lease not ugly.
/context/index.php?/controller/action/param1/param2
Version: 1.2.x
Just a note of different anchors as following:
- href=’#’ will function the same as scroll to the top. This just draw me another attention that DO NOT put # in you file name!
- href=’?’ will trigger the browser to refresh the same page. just a shorter coding if you don’t want to type the whole url.
- href=’javascript:void(0)’ will do nothing. the same meaning as href=’javascript: return false;’.
Just a note of gears in Firefox which will help a great deal in facilitating your web development.
Firebug: very handy extension which will help in figuring out the CSS and Javascript bugs.
YSlow: Y(Why) slow? It’s a really a good name which will clearly identify the performance problems in your web page. Why Google pages can response in seconds? YSlow will tell you the secret. For more information on this topic, go to YSlow support.
Live HTTP Headers: for those who feel more comfortable of working with http headers, this is it! Different from Firebug which provides console monitoring for Ajax interaction, Live HTTP Headers can give you more!
From http://kb.mozillazine.org/About_protocol_links
There are a few special URLs, which begin with about:, that you can type into the Location Bar. (In Thunderbird, which has no Location Bar, or in SeaMonkey, you can also use them as “Mail Start Page”.)
- about: — The same page as “Help -> About”.
- about:about — Lists all these about: URLs (Mozilla Suite/SeaMonkey only).
- about:blank — A blank page. Useful for setting as your homepage.
- about:bloat — Displays BloatView output (disabled in release builds).
- about:bloat?new
- about:bloat?clear
- about:buildconfig — Reveals details about your Mozilla build options.
- about:cache — Displays cache statistics and disk cache directory location.
- about:cache?device=memory — Lists memory cache entries.
- about:cache?device=disk — Lists disk cache entries.
- about:cache-entry — Shows information about a cache entry. Used in about:cache links. Requires parameters.
- about:config — GUI for modifying user preferences.
- about:crashes — List of Breakpad crash reports, with links and datestamps. Only in products based on Gecko 1.9 or later (Firefox 3, Thunderbird 3, SeaMonkey 2).
- about:credits — The list of contributors to the Mozilla projects.
- about:logo — Displays the application logo (Mozilla Suite, SeaMonkey, and Firefox 3).
- about:kitchensink — Was never included in Mozilla for the reasons listed in Bug 122411 (“Mozilla does not have a kitchen sink”). You can install an extension that adds it though :)
- about:license — shows the Mozilla Public License and the Netscape Public License for the piece of software. ( Only in products based on Gecko 1.8 or later)
- about:mozilla — The famous Book of Mozilla.
- about:plugins — Lists all your plugins as well as other useful information.
- about:robots — Easter egg, see bug 417302. Beginning with March 8th, 2008 trunk builds, it’s now available on Firefox 3.0b5..
Extensions
Certain extensions add a few additional about: URLs.
External Links
Just a note to remind me not to repeat the same mistakes again.
1. Never let View layer throw out any exceptions, ‘cuz they will display on the screen immediately. It’s really bad to show others errors, since people will just reckon that your application is not reliable and secure at all.
So keep in mind that once you develop tag library, remember to catch exception in anywhere possible. And implement to separate the View and Business layer, also to reduce logical stuff in View layer like calculation. Since this will just stop you from making exceptions that might be thrown from View layer.
2. Logger should be placed in anywhere you see, especially in try-catch statement. To use logger.isDebugable() in debug phase, this statement will just improve the performance of logger on production server and skip outputting debug information.
3. Try to reduce the usage of implementation classes of Map or List, if you can use DTO instead.
(to be extended…)
Recently, I just started to learn how to use the services from Google to improve the page ranking, not only for myself, but also for my client.
First of all, go to http://www.google.com/analytics/ to signup your website and insert the generated script into your pages, then google will start to analyse every visit to your pages. One interesting feature is the demographic which can tell you who from which area on the earth is visiting your website.
However, in order to improve page ranking, you can not count on Google analytics, since it will not tell you what is wrong or is not fitting with Google’s crawling rules. So we have to signup another service which is http://www.google.com/webmaster/ to help us with the diagnosis. Going through the signup, you have to verify that you are the owner of the website, and to provide a sitemap xml file to Google. They’re easy steps. Which might draw your concerns is the sitemap xml, you can find a sitemap xml generator from http://www.xml-sitemaps.com/
Yep, these are where I am up to… continued…
PS: refer http://www.sitemaps.org/ whose sitemaps protocol is used by search engine like Google, Yahoo…
set_time_limit(0);
function _rand() {
$length=26;
$chars = “0123456789abcdefghijklmnopqrstuvwxyz”;
$max = strlen($chars) – 1;
mt_srand((double)microtime() * 1000000);
$string = ”;
for($i = 0; $i < $length; $i++) {
$string .= $chars[mt_rand(0, $max)];
}
return $string;
}
$HTTP_SESSION=_rand();
echo $HTTP_SESSION;
$HTTP_Server=“www.baidu.com”;
$HTTP_URL=“/”;
$ch = curl_init();
curl_setopt ($ch,CURLOPT_URL,“http://”.$HTTP_Server.$HTTP_URL);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_USERAGENT,“Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)”);
$res = curl_exec($ch);
curl_close ($ch);
print_r($res);
A:
艾–Ai
安–Ann/An
敖–Ao B:
巴–Pa
白–Pai
包/鲍–Paul/Pao
班–Pan
贝–Pei
毕–Pih
卞–Bein
卜/薄–Po/Pu
步–Poo
百里–Pai-li
C:
蔡/柴–Tsia/Choi/Tsai
曹/晁/巢–Chao/Chiao/Tsao
岑–Cheng
崔–Tsui
查–Cha
常–Chiong
车–Che
陈–Chen/Chan/Tan
成/程–Cheng
池–Chi
褚/楚–Chu
淳于–Chwen-yu
D:
戴/代–Day/Tai
邓–Teng/Tang/Tung
狄–Ti
刁–Tiao
丁–Ting/T
董/东–Tung/Tong
E:
(无)
F:
范/樊–Fan/Van
房/方–Fang
费–Fei
冯/凤/封–Fung/Fong
符/傅–Fu/Foo
G:
盖–Kai
甘–Kan
高/郜–Gao/Kao
葛–Keh
耿–Keng
弓/宫/龚/恭–Kung
勾–Kou
古/谷/顾–Ku/Koo
桂–Kwei
管/关–Kuan/Kwan
郭/国–Kwok/Kuo
公孙–Kung-sun
公羊–Kung-yang
公冶–Kung-yeh
谷梁–Ku-liang
端木–Duan-mu
东郭–Tung-kuo
东方–Tung-fang
H:
海–Hay
韩–Hon/Han
杭–Hang
郝–Hoa/Howe
何/贺–Ho
桓–Won
侯–Hou
洪–Hung
胡/扈–Hu/Hoo
花/华–Hua
宦–Huan
黄–Wong/Hwang
霍–Huo
皇甫–Hwang-fu
呼延–Hu-yen
I:
(无)
J:
纪/翼/季/吉/嵇/汲/籍/姬–Chi
居–Chu
贾–Chia
翦/简–Jen/Jane/Chieh
蒋/姜/江/–Chiang/Kwong
焦–Chiao
金/靳–Jin/King
景/荆–King/Ching
讦–Gan
K:
阚–Kan
康–Kang
柯–Kor/Ko
孔–Kong/Kung
寇–Ker
蒯–Kuai
匡–Kuang
L:
赖–Lai
蓝–Lan
郎–Long
劳–Lao
乐–Loh
雷–Rae/Ray/Lei
冷–Leng
黎/郦/利/李–Lee/Li/Lai/Li
连–Lien
廖–Liu/Liao
梁–Leung/Liang
林/蔺–Lim/Lin
凌–Lin
柳/刘–Liu/Lau
龙–Long
楼/娄–Lou
卢/路/陆鲁–Lu/Loo
伦–Lun
罗/骆–Loh/Lo/Law/Lam/Rowe
吕–Lui/Lu
令狐–Lin-hoo
M:
马/麻–Ma
麦–Mai/Mak
满–Man/Mai
毛–Mao
梅–Mei
孟/蒙–Mong/Meng
米/宓–Mi
苗/缪–Miau/Miao
闵–Min
穆/慕–Moo/Mo
莫–Mok/Mo
万俟–Moh-chi
慕容–Mo-yung
N:
倪–Nee
甯–Ning
聂–Nieh
牛–New/Niu
农–Long
南宫–Nan-kung
O:
欧/区–Au/Ou
欧阳–Ou-yang
P:
潘–Pang/Pan
庞–Pang
裴–Pei/Bae
彭–Phang/Pong
皮–Pee
平–Ping
浦/蒲/卜–Poo/Pu
濮阳–Poo-yang
Q:
祁/戚/齐–Chi/Chyi/Chi/Chih
钱–Chien
乔–Chiao/Joe
秦–Ching
裘/仇/邱–Chiu
屈/曲/瞿–Chiu/Chu
R:
冉–Yien
饶–Yau
任–Jen/Yum
容/荣–Yung
阮–Yuen
芮–Nei
S:
司–Sze
桑–Sang
沙–Sa
邵–Shao
单/山–San
尚/商–Sang/Shang
沈/申–Shen
盛–Shen
史/施/师/石–Shih/Shi
苏/宿/舒–Sue/Se/Soo/Hsu
孙–Sun/Suen
宋–Song/Soung
司空–Sze-kung
司马–Sze-ma
司徒–Sze-to
单于–San-yu
上官–Sang-kuan
申屠–Shen-tu
T:
谈–Tan
汤/唐–Town/Towne/Tang
邰–Tai
谭–Tan/Tam
陶–Tao
藤–Teng
田–Tien
童–Tung
屠–Tu
澹台–Tan-tai
拓拔–Toh-bah
U:
(无)
V:
(无)
W:
万–Wan
王/汪–Wong
魏/卫/韦–Wei
温/文/闻–Wen/Chin/Vane/Man
翁–Ong
吴/伍/巫/武/邬/乌–Wu/NG/Woo
X:
奚/席–Hsi/Chi
夏–Har/Hsia/(Summer)
肖/萧–Shaw/Siu/Hsiao
项/向–Hsiang
解/谢–Tse/Shieh
辛–Hsing
刑–Hsing
熊–Hsiung/Hsiun
许/徐/荀–Shun/Hui/Hsu
宣–Hsuan
薛–Hsueh
西门–See-men
夏侯–Hsia-hou
轩辕–Hsuan-yuen
Y:
燕/晏/阎/严/颜–Yim/Yen
杨/羊/养–Young/Yang
姚–Yao/Yau
叶–Yip/Yeh/Yih
伊/易/羿–Yih/E
殷/阴/尹–Yi/Yin/Ying
应–Ying
尤/游–Yu/You
俞/庾/于/余/虞/郁/余/禹–Yue/Yu
袁/元–Yuan/Yuen
岳–Yue
云–Wing
尉迟–Yu-chi
宇文–Yu-wen
Z:
藏–Chang
曾/郑–Tsang/Cheng/Tseng
訾–Zi
宗–Chung
左/卓–Cho/Tso
翟–Chia
詹–Chan
甄–Chen
湛–Tsan
张/章–Cheung/Chang
赵/肇/招–Chao/Chiu/Chiao/Chioa
周/邹–Chau/Chou/Chow
钟–Chung
祖/竺/朱/诸/祝–Chu/Chuh
庄–Chong
钟离–Chung-li
诸葛–Chu-keh