顯示包含「互聯網」標籤的文章。顯示所有文章
顯示包含「互聯網」標籤的文章。顯示所有文章

2011年7月7日

怎樣修改 Blogger 中的 title 來提升被搜尋率

今日無意中看到一篇文章提及怎樣修改 Blogger 中的 title 來提升被搜尋率。 這個有用呢!  各位可以到這裡看看: http://widgetsforfree.blogspot.com/2009/08/change-title-tags-in-blogger-for-more.html 以下是大致內容:
  • 到 Blogger 中的 "設計"
  • 到 "修改 HTML"
  • 在 "修改範本" 中,找出這一句:
    <title><data:blog.pageTitle/></title>
  • 然後用這句替換:
    <b:if cond='data:blog.pageType == &quot;index&quot;'> <title><data:blog.title/></title> <b:else/> <title><data:blog.pageName/> | <data:blog.title/></title> </b:if>
  • 儲存範本完成

2011年6月3日

以後唔使怕係 Browser 入料時突然無晒所有入咗嘅資料

有沒試過喺 Browser 入料時突然無晒所有入咗嘅資料,而因為:
  1. 唔覺意回到上一頁?
  2. 唔覺意 Close 咗 Browser?
  3. Browser Halt/Crash 咗?
  4. 電腦突然 Halt/Crash 咗?
以上情況我有好幾次經驗了,有啲網站有"自動儲存"還好,可惜大部份都沒有"自動儲存"功能呢。
想一下,會不會有 browser plugin 幫手自動 save 起我打過吧內容呢?

2011年4月30日

個人(網站)密碼的管理方法

近年,互聯網發展及普及真的很快。而很多網站都須要登入才能使用。這導致密碼管理變得越來越煩人。而且,密碼太簡單又怕黑客盜用。那麼,密碼的產生及管理就變得迫切了。

所幸,現在有些免費軟件幫忙管理密碼,不過,單靠軟件還不足夠。我們須要的,是一套恆常使用的方法 -- 一套平衡了安全性跟實用性為原則的方法。

2011年4月22日

2011年4月13日

開設網站的二三事

近日,多了朋友問我有關開設 (公司) 網站的事宜。有見及此,我把一些心得寫下,方便一下大家。

思想準備

首先,你要有以下的心理準備:
  1. 開設成本可高可低,但網站維護成本絕對不可低估 -- 主要在於人力、時間方面。
  2. 網站用起來易,看似間單,背後卻可以很複雜的。 (真的須要 IT 技術人員支援呢)
  3. 網站是你的,整個架設要高度參與,不可假手於人。(這可是一般人的誤解喲~~)
  4. 網站維護是沒完沒了的.......
然後,你要清楚/問自己:
  1. 網站有什麼功能? (是一個 Blog? 網上商店?...etc)
  2. 網站給什麼人看? (即 Target Audience)
  3. 內容須要時常更新嗎? (十年都唔做更新就用得 Frontpage 啦)
  4. 瀏覽者連不上網站時有幾要緊? 又或者等太等久? 
  5. 網站資料有幾要緊? 會擔心跟另人共用一台服務器 (電腦) 嗎 ~ 即使告訴你安全的話?
  6. 須要有自己的域名嗎? (如: yourcompany.com )

開設網站主要步驟

好了,以下是開設網站的一些主要步驟:

Top 7 Myths about HTTPS

 Copied Content Below: 

Myth #7 – HTTPS Never Caches

People often claim that HTTPS content is never cached by the browser; perhaps because that seems like a sensible idea in terms of security. In reality, HTTPS caching is controllable with response headers just like HTTP.
Eric Lawrence explains this succinctly in his IEInternals blog:
It comes as a surprise to many that by-default, all versions of Internet Explorer will cache HTTPS content so long as the caching headers allow it. If a resource is sent with a Cache-Control: max-age=600 directive, for instance, IE will cache the resource for ten minutes. The use of HTTPS alone has no impact on whether or not IE decides to cache a resource. (Non-IE browsers may have different default behavior for caching of HTTPS content, depending on which version you’re using, so I won’t be talking about them.)

2009年6月8日

ZK Webflow and GenericForwardComposer

Problem:
Autowire's component/bean declared in Java class (extending GenericForwardomposer) fail to bind view's component when using ZK Webflow

Symptom:
  1. Example, there are two zul page which handled by FlowHandler. First from with 1 textbox (Login Name) and 2 buttons (Next page, Login).
  2. In the Java, there is autowire for Login Name. So, the method onClick$login() is able to get the value from the textbox when the login button is clicked.
  3. If the "Next page" button is clicked (e.g. self="@{action(next) }" is assigned). Next ZUL is show without any problem.
  4. However, if the flow go back to first page or reach end-state (in XML). For whatever I type in the textbox, the value cannot be read from the java. It will read previous data/instance I typed.
Solution:
  • Create a session managed bean (note: implements Serializable). It can be managed by either (1) Spring, or (2) FlowScope
  • Save the data from component values to a bean attributes. Handled by - on Transit.
  • If it is necessary, the bean value can be retrieved from ZUL
  • In the Java file, setup the autowire variable so it can be accessed by the class methods.
Note:
  • "session.invalidate()" mehtod will invalidate the session so the Controller class will be initialized once again. Therefore, the autowire will be setup once again too. It can be called like
  • To initialize the bean within the flowScope, place the initializer in , example:
  • To initialize the bean within Spring, put the tag in application-context.xml, example:

2009年3月2日

美國HOSTING公司都係不外如是 (Nothing special with American Hosting company)

話說我一直用開美國HOSTING公司,近來為了慳點錢,我選擇了一個較平的 Registrar ,可惜,當想買一個 Domain 時,系統卻出現問題,Send email 去 Billing service 問,竟然一個月都唔覆! 期間都 send o左三四次。好,想著開張 ticket,結果都係一樣....
最後當然係放棄,死心了。我再 check  下呢一間公司係 WebHostingStuff 既REVIEW.... OMG.. 差不多全部都係 Negative!!!

講了一大推,咁呢間係邊一間呢? 答案就係: HOSTWAY (http://www.hostway.com)

============
As I am using the America Hosting company, I switched to use a registrar to save some money.  However, I got very bad experience from this company when I tried to purchase the domain.  I got an error during the billing process. So, I send an email to billing service to resolve the problem.  I waited for a month without any response.  I sent more than 3 email to them and finally I created the service ticket.  Of course, the result is the same.

Finally, I gave up!  I therefore visit WebHostingStuff. I wonder that MOST of the reviews are negative!  So, I am not the one having this problem.

So, what is this hosting company?  The answer is: HOSTWAY (http://www.hostway.com)

2009年2月17日

Studying WebSpere Community Edition (2)

After installed the WebSphere CE, it is time to try the sample.

- Download the Sample Package "wasce_samples-2.1.1.1.zip" from IBM
- Read the readme.txt:
Prerequisites
-------------------
- IBM or Sun Java SE 5 SDK supported by the WASCE Server runtime
- Apache Maven v2.0.9
- WASCE Server runtime supported OS which is also supported by the above tools
- Internet connection to download required Maven artifacts
- Since I did not install Maven, download the Maven and install.
=================
= Install Apache Maven
=================
- Download Maven from HERE, the file is "apache-maven-2.0.9-bin.tar.gz"
- Login the server as root
- Place it in server and extract:
# tar xvf apache-maven-2.0.9-bin.tar.gz

- A directory is created apache-maven-2.0.9"
# mkdir /opt/apache
# mv apache-maven-2.0.9 /opt/apache/
# chmod -R 755 /opt/apache/apache-maven-2.0.9
# chown -R root:root /opt/apache/apache-maven-2.0.9
# ln -s apache-maven-2.0.9 maven

-Create the profile.d file for environment setup for apache stuffs
# touch /etc/profile.d/apache.sh
# chmod 755 /etc/profile.d/apache.sh
# chown 755 /etc/profile.d/apache.sh
- Edit the file content for Maven (append):
if ! echo ${PATH} | grep -q /opt/apache/maven/bin ; then
export PATH=/opt/apache/maven/bin:${PATH}
fi
export MAVEN_HOME=/opt/apache/maven
- Also copy for different shell:
# cp apache.sh apache.csh
# cp apache.sh apache.bash

=================
= Install Apache Maven
=================
- login as root
- Download the sample code to server and extract to an directory:
/opt/IBM/WebSphere/AppServerCommunityEdition/samples

# chmod -R 755 samples
# chown -R root:root samples

- Build the sample
# cd samples
# mvn install

- Note: it will download some components from web. Please enable the web connection in the server. .... and IT TAKES TIME~!!

2009年2月12日

Studying WebSpere Community Edition (1)

For many reason, start learning latest J2EE now.

For startup, I need to pick a J2EE application server. I know JBoss for free long time ago. However, many company use enterprise software in HK like Weblogic and Websphere. Those are very expensive software. But now, IBM release a community edition for non-commercial use. It is a good way to start, isn't it?

In the following, I will log my installation step for sharing:

- My Linux Server is Ubuntu 2.6.27-11-server

- Download package from here. I download wasce_ibm150sdk_setup-version-ia32linux.tar.bz2
- Copy the downloaded file to Ubuntu.
- Change root
# sudo su -

- Extract package and setup permission
# bzip2 -d wasce_ibm60sdk_setup-2.1.1.1-ia32linux.tar.bz2
# chmod 755 wasce_ibm60sdk_setup-2.1.1.1-ia32linux.bin

- Execute the installer in console mode
# ./wasce_ibm60sdk_setup-2.1.1.1-ia32linux.bin -i console -r responseFile.properties

- Accept the license agreement
- Accept the default path then start install
- Verify the installation:
# ls /opt/IBM/WebSphere/AppServerCommunityEdition

- Start the server:
# cd /opt/IBM/WebSphere/AppServerCommunityEdition/bin
# ./startup.sh
Using GERONIMO_BASE: /opt/IBM/WebSphere/AppServerCommunityEdition
Using GERONIMO_HOME: /opt/IBM/WebSphere/AppServerCommunityEdition
Using GERONIMO_TMPDIR: var/temp
Using JRE_HOME: /usr/lib/jvm/java-6-openjdk/jre
Using GERONIMO_OUT: /opt/IBM/WebSphere/AppServerCommunityEdition/var/log/server.out

Server started in background. PID: 13120
- However, when checking the listening port, it is overlapped with TomCat

=== To solve out , uninstall Tomcat6
- check the packages:
# dpkg-query -l |grep -i "tomcat"
ii libtomcat6-java 6.0.18-0ubuntu3 Servlet and JSP engine -- core libraries
ii tomcat6 6.0.18-0ubuntu3 Servlet and JSP engine
ii tomcat6-admin 6.0.18-0ubuntu3 Servlet and JSP engine -- admin web applicat
ii tomcat6-common 6.0.18-0ubuntu3 Servlet and JSP engine -- common files
ii tomcat6-docs 6.0.18-0ubuntu3 Servlet and JSP engine -- example web applic
ii tomcat6-examples 6.0.18-0ubuntu3 Servlet and JSP engine -- example web applic
- Remove the packages
# apt-get remove tomcat6-*