戴了數年的眼鏡,鏡片鍍膜已經磨損、龜裂,所以下午就跑去換鏡片。等待的時候,順便問了一些隱形眼鏡的問題,本來想買日拋式,可是雙眼度數不同,要買就得買雙份,還在考慮的時候,老闆就說送我一副625度的季拋式試試看。所以,花了600元,不但換好鏡片,還得到隱形眼鏡、保養液、食鹽水。

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

在Wicket程式用Spring,要在web.xml加入設定:
<context -param>
<param -name>contextConfigLocation</param>
<param -value>/WEB-INF/spring*.xml</param>
</context>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

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

應用程式內嵌Jetty運行webapp時,希望程式和webapp共用同一個spring context,在web.xml設定context loader listener時,要改用自定的MyContextLoaderListener。
JettyServer.java:
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class JettyServer implements ApplicationContextAware {
private ApplicationContext applicationContext;
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
public void start() throws Exception {
int port = Integer.parseInt(System.getProperty("jetty.port", "8080"));
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
Server server = new Server();
server.addConnector(connector);
WebAppContext context = new WebAppContext();
context.setClassLoader(applicationContext.getClassLoader());
context.setAttribute("applicationContext", applicationContext);
context.setServer(server);
context.setContextPath("/");
context.setWar("src/main/webapp");
server.addHandler(context);
server.start();
}
}

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

Maven repository沒有Terracotta和Terracotta Maven Plugin,所以要在pom.xml加入:
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>terracotta-repository</id>
<url>
http://www.terracotta.org/download/reflector/maven2
</url>
</repository>
</repositories>
<pluginrepositories>
<pluginrepository>
<id>terracotta-snapshots</id>
<url>
http://www.terracotta.org/download/reflector/maven2
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginrepository>
</pluginrepositories>
<build>
<plugins>
<plugin>
<groupid>org.terracotta.maven.plugins</groupid>
<artifactid>tc-maven-plugin</artifactid>
<version>1.0.3</version>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupid>org.terracotta</groupid>
<artifactid>terracotta</artifactid>
<version>2.5.1</version>
</dependency>
</dependencies>

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

全靠Wayback Machine和Google,花了7個小時剪剪貼貼之後,總共救回117篇文章。

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

放在遙遠的樓梯間機房裡的server在除夕夜9:38斷線,10點多趕到時,發現攝影機被破壞,樓梯間鐵門被撬開,機房裡的server和監視器主機都消失了。已經工作七年的server配備Intel Pentium III 700MHz CPU、512MB RAM、160GB HDD,上面運行著bento.tw、cert.tw、ruby.tw、zbwei.net,不但有email、blog、wiki、forum、電子書,最重要的是,還有大家都喜歡的神秘圖片。目前正在靠archive.org和google慢慢整裡公開的blog和wiki內容,其餘的資料就安心上路吧!blog暫時搬到http://forth.wordpress.com/,FeedBurner亦已修改至新位置。

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

沒想到在2008年竟然能看見Apple IIc開箱照,能從1988年5月5日完整保存至今,實在太神奇了。eBay才真的是什麼都有、什麼都賣、什麼都不奇怪。

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

RubyHelp.java:
public class RubyHelper {
static {
System.setProperty("jruby.home", new File("").getAbsolutePath());
}
private RubyHelper() {
}
public static Object create(String className, Class interfaceClazz, String scriptFileName) {
InputStream scriptInputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFileName);
if (null == scriptInputStream) {
throw new RuntimeException("Could not find " + scriptFileName);
}
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
try {
for (int n; (n = scriptInputStream.read(buf)) != -1;) {
sb.append(new String(buf, 0, n, "UTF-8"));
}
scriptInputStream.close();
} catch (IOException e) {
throw new RuntimeException("Error loading " + scriptFileName + ": " + e.getMessage());
}
Ruby runtime = JavaEmbedUtils.initialize(new ArrayList());
runtime.eval(runtime.parse(sb.toString(), scriptFileName, runtime.getCurrentContext().getCurrentScope(), 0, false));
return JavaEmbedUtils.rubyToJava(runtime, runtime.evalScriptlet(className + ".new"), interfaceClazz);
}
}

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


rails
mongrel
mongrel_cluster
acts_as_cached
acts_as_ferret
capistrano
fcgi
gettext
sqlite3-ruby
mechanize
ruby-net-ldap
ruby-openid
sendfile
log4r
rspec
ZenTest

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

入手!

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

簡單記錄時間,供以後參考。
03:00從新竹出發,中途在永和把小白撿上車花了半小時,扣掉這段時間,從新竹走二高、臺七甲線、臺八線到福壽山的車程大約是四小時。
07:40在梨山加油,里程數約250公里。
08:00到達福壽山農場。

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

博客來客戶資料外流受害者

既然連我都接到詐騙集團通知,怎麼可以這樣放過博客來,一定要幫博客來打一下廣告。
我的身份證號、電話、地址、電郵、歷年訂購記錄,這些資料完完整整的被詐騙集團建檔囉。照博客來公關所說,是被客戶電腦中的木馬程式偷取,我好想知 道,木馬程式是怎麼從客戶的電腦偷到博客來網站上未開放查詢的歷年訂購記錄?就我的案子來說,絕對不是因為木馬程式,那麼,原因可能就是:一、博客來被入 侵,資料庫被人幫忙做備份;二、博客來不肖員工幫忙做備份(不太可能);三、收單銀行被入侵,資料庫被……(極不可能);四、收單銀行不肖員工……(極不 可能);五、數字超商的系統被……;六、數字超商不肖員工……;七、物流公司的系統被......;八、汪汪汪……。不管博客來的資料是被誰做備份,身為 博客來客戶的我,是在接到好心(?)的大陸姑娘(?)打來的電話時,才知道個人資料被盜。

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

Blog Stats
⚠️

成人內容提醒

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

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