| Message |
|
|
今天找到了JGS goodsolutions GmbH一篇比較OLAT和Moodle的文章, OLAT-Moodle comparison,對於想要找Open Source e-Learning Platform的人可以做個參考。
|
 |
|
|
JForum 2.x以前的版本都是使用自己的MVC架構來開發,唯一有使用的framework就是 freemarker這個template engine。而template就是在html頁面上加上一些輸出控制碼,這些控制碼在系統執行時可以與運算資料一起結合而轉譯成真正的html標籤,變成真正顯示出來的web page。但如果直接用瀏覽器器開啟這些檔案,因為並未透過系統執行,故本質上就是副檔名為.htm的一個文字檔而已,但瀏覽器看到.htm的副檔名,卻會以正常的網頁方式處理,結果就是那些非html標籤的輸出控制碼就變成你看到的東西了。所以直接用IE去開/templates/default/底下的這些htm檔是沒有意義的。
|
 |
|
|
預先安裝函式庫: Apache Commons HttpClient 3.x, Apache Commons Codec, Apache Commons Logging
程式碼:
httpclient.jsp:
<%@ page contentType="text/html;charset=big5" %>
<%@ page import="org.apache.commons.httpclient.*" %>
<%@ page import="org.apache.commons.httpclient.methods.*" %>
<%@ page import="org.apache.commons.httpclient.params.HttpMethodParams" %>
<%@ page import="java.io.*" %>
<%
String url = "http://tw.stock.yahoo.com/";
String stockId = request.getParameter("stock_id");
if (stockId != null) {
url += "q/q?s="+stockId;
}
// Create an instance of HttpClient.
HttpClient client = new HttpClient();
// Create a method instance.
HttpMethod method = new GetMethod(url);
// Provide custom retry handler is necessary
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
try {
// Execute the method.
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getStatusLine());
}
// Read the response body.
byte[] responseBody = method.getResponseBody();
// Deal with the response.
// Use caution: ensure correct character encoding and is not binary data
//System.out.println(new String(responseBody));
String result = new String(responseBody, "Big5");
if (stockId != null) {
result = result.substring(result.indexOf("nowrap><b>")+"nowrap><b>".length());
result = result.substring(0, result.indexOf("</b>"));
out.println(stockId + " Price Now: " + result);
} else {
out.println(result);
}
} catch (HttpException e) {
System.err.println("Fatal protocol violation: " + e.getMessage());
e.printStackTrace();
} catch (IOException e) {
System.err.println("Fatal transport error: " + e.getMessage());
e.printStackTrace();
} finally {
// Release the connection.
method.releaseConnection();
}
%>
參考資料:
http://hc.apache.org/httpclient-3.x/tutorial.html
|
 |
|
|
edwin wrote:你好, 我是第一次來的, 我近期需要編寫一個web mail system, 但是 自動forward 我老是想不通logic 是怎樣, 若然定時login , 那不是對系統有一定負荷, 還是另有logic 呢?! 可唔不可以指教一下呢(又或者提議一些網站給我自學呢)?!
1.自動forward:一般是在mail server的主機上,自己的家目錄下設定一個.forward檔,可以參考底下這篇的說明
http://www.phys.sinica.edu.tw/computer_lab/forward.htm
還有,樓主的webmail近期老是connection fail or invalid account, 不論是透過您的webmail 網頁或者我download下來用本人的tomcat也是一樣, 早一陣子還是行的, 是不是本人電腦或者isp的問題呢? thx
2.本站的webmail我用來登入HiNet信箱是正常的,不知道您是用來登入哪裡?
|
 |
|
|
1. PING不到Gateway(default router)
檢查並修改/etc/defaultrouter
如果有修改,需重新啟動
sync; sync; sync; init 6
2.PING不到同一個LAN上的某部主機
檢查是否有設定static route
$ netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
172.16.244.0 172.16.244.240 U 1 35 ce0
224.0.0.0 172.16.244.240 U 1 0 ce0
default 172.16.244.254 UG 1 268
127.0.0.1 127.0.0.1 UH 3 287 lo0
如果有UGH的Flags,可透過route delete destination gateway的方式來刪除
3.PING不到其他不同LAN上的主機
可能原因很多,如果兩邊都各自PING得到Gateway,先檢查防火牆設定看看
如果防火牆設定有允許PING,則可用traceroute指令追蹤看看
如果是由防火牆後的內部網段主機PING外面Internet主機,因需配發一個Public IP給該主機出去的封包,故要順便檢查防火牆有沒有設定為NAT mode,如果是routing mode則需對每部要連出去的主機設定一個mapping IP。
|
 |
|
|
今天花了一整天終於把現有的OLAT由5.2.2升級至5.2.3, 步驟如下:
cd ~/download
mv olat3 olat-5.2.2
wget http://www.olat.org/downloads/stable/OLAT-5.2.3.zip
unzip OLAT-5.2.3.zip
mv OLAT-5.2.3-PUBLIC-* olat3
cd olat3
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/www\/olatdata/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=mail.andowson.com/" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat5/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "48c\server.modjk.enabled=true" \
-e "86,108d" \
-e "1,$$s/#db/db/g" \
-e "s/instantMessaging.enable=false/instantMessaging.enable=true/" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/" \
-e "s/instantMessaging.generateTestUsers=false/instantMessaging.generateTestUsers=true/" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=olat/" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=olat/" build.properties.default > build.properties
ant install
ant jsmath
sudo /etc/init.d/tomcat stop
mv ~/www/olat /tmp/olat-5.2.2
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sed -i -e "13c\ <\!-- default session timeout -->" ~/www/olat/WEB-INF/web.xml
rm -rf ~/www/olat/WEB-INF/src
rm -rf ~/www/olat/WEB-INF/patchesSrc
chgrp -R tomcat ~/www/olat
chgrp -R tomcat ~/www/olatdata
chmod 775 ~/www/olat/static
sudo /etc/init.d/tomcat start
|
 |
|
|
|
|
 |
|
|
CSS Tab Designer is a freeware that let you visually make css-based list / tabs.
Various styles and colors are included (currently, there are 60+ different styles and colors included).
You may see that JForum uses the tabs10 style for Poll and Attachments Options on adding a new post.
Download from:
http://www.highdots.com/products/css-tab-designer/
|
 |
|
|
廠商幫忙安裝好的Solaris 9,預設只能使用/etc/hosts內的設定去找到主機名稱對應的IP,如果要一一設定一些常用的網站的IP,將是個大工程跟苦差事,最簡單的方法還是使用DNS來解析主機名稱,方法很簡單,先自己產生/etc/resolv.conf,再將/etc/nsswitch.conf改為使用dns來解析hosts。
cd /etc
vi resolv.conf
nameserver 168.95.1.1
nameserver 168.95.192.1
cp nsswitch.dns nsswitch.conf
注意:順序很重要!我就遇到先執行cp nsswitch.dns nsswitch.conf再vi resolv.conf而無法正常運作的狀況。
如果遇到上述的問題,可以執行下列的動作還原回來:
rm -rf /etc/resolv.conf
cp /etc/nsswitch.files /etc/nsswitch.conf
|
 |
|
|
JSPWiki是一個開放原始碼的wiki engine,目前採用 LGPL授權,未來將會轉移到 Apache去,使用Java語言(JSP+Servlet)開發,wiki的精神就是每個人都可以編輯,所以滿適合用於公司內團隊的協同作業上,例如產生軟體開發專案相關的說明文件或是系統安裝、設定、操作的說明文件等,讓小組成員隨時參考。
安裝起來也滿方便的,首先我們先 下載目前stable的2.6.3版,並將其解壓縮後,放到 Tomcat的webapps目錄下,在我的環境上是symbolic link到使用者家目錄下的www目錄。
cd ~/download
wget http://www.ecyrd.com/~jalkanen/JSPWiki/2.6.3/JSPWiki-2.6.3-bin.zip
rm -rf JSPWiki
unzip JSPWiki-2.6.3-bin.zip
cd JSPWiki
mkdir ~/www/wiki
unzip JSPWiki.war -d ~/www/wiki/
mkdir ~/www/data/wikidata
unzip JSPWiki-corepages.zip -d ~/www/data/wikidata
sed -i -e "s/\/p\/web\/www-data\/jspwiki/\/home\/andowson\/www\/data\/wikidata/g" \
-e "s/\/tmp\/jspwiki.log/logs\/jspwiki.log/g" ~/www/wiki/WEB-INF/jspwiki.properties
sudo chmod 664 ~/www/wiki/WEB-INF/jspwiki.properties
sudo chgrp tomcat ~/www/wiki/WEB-INF/jspwiki.properties
sudo chmod 775 ~/www/data/wikidata
sudo chmod 664 ~/www/data/wikidata/*.txt
sudo chgrp -R tomcat ~/www/data/wikidata
接著修改/etc/httpd/conf.d/mod_jk.conf:
JkMount /wiki/* loadbalancer
重新啟動Apache和Tomcat,載入JSPWiki,
利用http://<myhost>/wiki/Install.jsp設定並產生admin的帳號及密碼(亂數產生),請登入後先修改密碼。
再來就可以參考網站上的文件進行編輯了。
|
 |
|
|
|
|
 |
|
|
http://www.opennet.ru/soft/ora_inst/
依 Oracle安裝說明文件:
Apply patch no. 3006854. You can download this patch from OracleMetaLink ( http://metalink.oracle.com). This patch creates the /etc/libcwait.so file and appends the following line to the /etc/ld.so.preload file:
/etc/libcwait.so
如果沒裝的話,執行runInstaller將會遇到類似下面的錯誤訊息:
Error occurred during initialization of VM
Unable to load native library: /tmp/OraInstall2008-01-10_10-23-48PM/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
安裝完成之後就可以成功執行Oracle Universal Installer了
資料來源:
http://www.itpub.net/viewthread.php?tid=386263
http://www.puschitz.com/InstallingOracle9i.shtml#RunningOracleInstallationOnRHELAS3
|
 |
|
|
有網友發現JForum 2.1.8版templates/default下的兩個htm檔案內含入(include)的檔名拼錯了,這兩個檔案是pm_review_message.htm和topic_review.htm,原來寫成:
<#include "highligther_js.htm"/>
正確的寫法應該是
<#include "highlighter_js.htm"/>
差別在哪裡不知道您發現了嗎?對了就是th和ht的順序錯了。
參考資料:
http://www.jforum.net/posts/list/4275.page
|
 |
|
|
The original post only supports URL in the form "www.youtube.com". However, if you change to another form, like "youtube.com" or "tw.youtube.com", it will not work. So, we need to modify the original bb_config.xml as follows:
<!-- YouTube -->
<match name="youtube">
<regex>
(?i)\[youtube\]http\:\/\/(.*?)youtube.com\/watch\?v\=(.*?)\[/youtube\]
</regex>
<replace>
<![CDATA[
<object width="450" height="370">
<param name="movie" value="http://$1youtube.com/v/$2"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://$1youtube.com/v/$2" type="application/x-shockwave-flash" wmode="transparent" width="450" height="370"></embed>
</object>
]]>
</replace>
</match>
Now, the new form of URL works.
See:
http://www.jforum.net/posts/list/4269.page
|
 |
|
|
大家好,今天是網站成立滿一年的日子,2007年的元旦假期讓我有時間把網站架起來,從2007年1月的月流量182名訪客成長到2007年12月的月流量4608名訪客,可以說每日的訪客數都大於第一個月整個月加起來的訪客數了。
去年的成果大致如下:
註冊會員數:423名
select count(*) from jforum_users where user_regdate < to_date('2008-01-01', 'yyyy-mm-dd')
已啟用帳號數:300人
select count(*) from jforum_users where user_active = 1 and user_regdate < to_date('2008-01-01', 'yyyy-mm-dd')
啟用率約為七成(300/423)
有發表文章人數:17人
select count(*) from jforum_users where user_regdate < to_date('2008-01-01', 'yyyy-mm-dd') and user_posts > 0
發文率約為5.67%(17/300)
發表文章數:222篇
select count(*) from jforum_posts where post_time < to_date('2008-01-01', 'yyyy-mm-dd')
今年的展望:
1.會員數成長到1000人,啟用率八成
2.發表文章數成長到500篇,發文率8%
希望大家多多發表自己練功的成果喔!
|
 |
|
|