除了20D機身,還購入三顆鏡頭,分別是:16-35mm F2.8L、50mm F1.8、100mm F2.8 MACRO,總共是116,500元。

Forth 發表在 痞客邦 留言(0) 人氣()

將四歲的v8088移給我娘使用,自己敗入k700i,因為選擇條件之一是能收聽ICRT,好貴的收音機,哈哈。

Forth 發表在 痞客邦 留言(0) 人氣()

This is my first Ruby script to fetch photos from TaipeiLink.
#!/usr/local/bin/ruby
require "net/http"
if ARGV.length == 0
puts "tplink.rb <account>"
exit
end

ARGV.delete("tplink.rb")
ARGV.each { |account|
puts "Fetching photos from #{account}..."
Dir.mkdir(account) if !FileTest.exist?(account)
Net::HTTP.start("photo.taipeilink.net", 80) { |http|
http.get("/#{account}").body.scan(/<a href="http://photo.taipeilink.net/#{account}?st=album&pg=(d*)"/) { |pg|
Dir.mkdir("#{account}/#{pg}") if !FileTest.exist?("#{account}/#{pg}")
http.get("/#{account}?st=album&pg=#{pg}").body.scan(/<a href="http://photo.taipeilink.net/#{account}/(d*-d*-d*-d*)?m=0&pg=(d*)"/) { |fileName, pg|
url = "/#{account}/#{fileName}?m=1&pg=#{pg}"
response = http.head(url)
if response["content-type"] == "image/gif"
fileName += ".gif"
else
fileName += ".jpg"
end
fileName = "#{account}/#{pg}/#{fileName}"
if FileTest.exist?(fileName)
puts "Skip #{fileName}"
else
puts "Fetch #{fileName}"
response = http.get(url)
file = File.new(fileName, "w")
file.write(response.body)
file.close()
end
}
}
}
}

Forth 發表在 痞客邦 留言(0) 人氣()

public class WorkQueue {
private final int nThreads;
private final PoolWorker[] threads;
private final LinkedList queue;
public WorkQueue(int nThreads) {
this.nThreads = nThreads;
queue = new LinkedList();
threads = new PoolWorker[nThreads];
for (int i=0; i < nThreads; i++) {
threads[i] = new PoolWorker();
threads[i].start();
}
}
public void execute(Runnable r) {
synchronized(queue) {
queue.addLast(r);
queue.notify();
}
}
private class PoolWorker extends Thread {
public void run() {
Runnable r;
while (true) {
synchronized(queue) {
while (queue.isEmpty()) {
try {
queue.wait();
} catch (InterruptedException ignored) {
}
}
r = (Runnable) queue.removeFirst();
}
// If we don't catch RuntimeException,
// the pool could leak threads
try {
r.run();
} catch (RuntimeException e) {
// You might want to log something here
}
}
}
}
}

Forth 發表在 痞客邦 留言(0) 人氣()

PreparedStatement l_stmt = null;
PreparedStatement l_stmtFetch = null;
PreparedStatement l_stmtClose = null;
ResultSet l_rset = null;
try { //exception
try { //finally
//open the cursor
l_stmt = m_dbcon.prepareStatement("DECLARE FOO CURSOR FOR SELECT BAR FROM FOOBAR");
l_stmt.execute();
l_stmtFetch = m_dbcon.prepareStatement("FETCH FORWARD 10 FROM FOO");
while (true) {
//perform a fetch from the cursor (possibly multiple fetches will be done)
l_rset = l_stmtFetch.executeQuery();
l_rows = 0;
while (l_rset.next()) {
String l_bar = l_rset.getString(1);
//do something useful with the data
l_rows++;
}
l_rset.close();
l_rset = null;
if (l_rows == 0) {
//no more rows, so we are done
break;
}
}
//don't forget to close the cursor
l_stmtClose = m_dbcon.prepareStatement("CLOSE FOO");
l_stmtClose.execute();
} finally {
if (l_rset != null) {
l_rset.close();
}
if (l_stmt != null) {
l_stmt.close();
}
if (l_stmtFetch != null) {
l_stmtFetch.close();
}
if (l_stmtClose != null) {
l_stmtClose.close();
}
}
} catch (SQLException l_se) {
//do something useful here
}

Forth 發表在 痞客邦 留言(0) 人氣()

您可以從PostgreSQL網站下載最新的版本,目前是7.2版。下載後,建立一個叫postgres 的使用者,然後建立/usr/local/pgsql目錄,並將擁有者設為postgres,再將/usr/local/pgsql/bin加入postgres的PATH,再以postgres身分進行安裝。如果不要編譯JDBC driver的話可以不用--with-java,JDBC driver可以由jdbc.postgresql.org下載。
$ cd /tmp
$ tar xzf postgresql.7.2.tar.gz
$ cd /tmp/postgresql-7.2
$ ./configure --enable-locale --enable-multibyte --enable-nls --with-java
$ make all install
$ setenv PGDATA /usr/local/pgsql/data
$ setenv PGLIB /usr/local/pgsql/lib
$ setenv LD_LIBRARY_PATH /usr/local/pgsql/lib
$ initdb
$ postmaster -i &
$ createdb -E UNICODE dbname

Forth 發表在 痞客邦 留言(0) 人氣()

PointBase發表PointBase Micro、PointBase Embedded和PointBase Server等產品的4.1版。新的版本支援了Java Transaction API(JTA)、XADataSource、XAConnection和2-phase commit。

Forth 發表在 痞客邦 留言(0) 人氣()

如果要同時用Big5、MS950、GB2312和Shift-JIS等charset,JSP、Servlet、EJB container的charset要設為 ISO-8859-1,資料庫的charset用SQL_ASCII,JDBC URL用 jdbc:postgresql://hostname/database?charSet=ISO-8859-1,如果不加charSet,PostgreSQL的JDBC driver會因資料庫的charset是SQL_ASCII而將client端的charset當成ASCII,這樣會把第8個bit去掉。

Forth 發表在 痞客邦 留言(0) 人氣()

啟動PostgreSQL前設定PGCLIENTENCIDING的話,PostgreSQL會先將資料轉換成PGCLIENTENCODING所指定的charset,再傳送給client端,同樣的,server會將client端送來的資料一律視為   PGCLIENTENCODING所指定的charset,在儲存前會轉換成資料庫所使用的charset。client端是用Java程式如JSP、Servlet、EJB且container是用Big5或MS950做為編碼格式(setenv LC_CTYPE zh_TW.Big5),資料庫的編碼可以用UNICODE,在啟動PostgreSQL前不設定PGCLIENTENCODING,JDBC URL用jdbc:postgresql://hostname/database?charSet=UTF-8,這樣JDBC driver就會將資料以UTF-8格式送到server端,如果要用簡體中文,只要將container的設charset定為GB2312就可以了。

Forth 發表在 痞客邦 留言(0) 人氣()

EJB 2.0的CMP教學文章:Enterprise JavaBeans 2.0 Container-Managed Persistence Example

Forth 發表在 痞客邦 留言(0) 人氣()

JScape發表了iNet Factory,iNet Factory是一組功能強大的TCP/IP網路元件,支援的通訊協定包括FTP、HTTP、SMTP、POP3、TELNET、NNTP等。

Forth 發表在 痞客邦 留言(0) 人氣()

TCCybersoft(TCC)於今天發表Rexip AppServer 1.0版,Rexip AppServer遵循Servlet 2.3和JSP 2.2格範,並且提供叢集、負載平衡與容錯功能。

Forth 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。