Source favicon22:57 Fires at midnight - Blackmore's Night » 欢乐波|JoyWave
I stood out here once before
With my head held in my hands
For all that I had known of this place
I could never understand…

On the hills the fires burned at midnight
Superstition plagued the air
Sparks fly as the fires burn at midnight
The stars are out and magic is here…

I wished the seven sisters
Bring to me wisdom of the age
All that's locked within the book of secrets
I longed for the knowledge of the sage…

On the hills the fires burned at midnight
Superstition plagued the air
Sparks fly as the fires burn at midnight
Stars are out the magic is here
The stars are out the magic is here…

So, the sisters smiled to themselves
And they whispered as they shone
And it was from that very instant
I knew I would never be alone…

While on the hills
The fires burned at midnight
Superstition plagued the air
Sparks fly as the fires burned at midnight
Stars are out and magic is here
The stars are out and the magic is here…
Many stars were forgotten
Many faded and became ghosts
Still my sisters glittered down from heaven
Always there when I needed them most…

And on the hills the fires burned at midnight
Superstition plagued the air
Sparks fly as the fires burn at midnight
Stars are out and magic is here
The stars are out and magic is here…

I stood here once before
With my head in my hands
For all that I had known of this place
I could never understand

On the hills the fires burned at midnight
Superstition plagued the air
Sparks fly as the fires burn at midnight
Stars are out and magic is here
Stars are out and magic is here
Stars are out and magic is here
Stars are out and magic is here
Source favicon22:22 青岛原产的青岛啤酒 » Andy's blog

青岛啤酒这几年和华润一样,在全国各地大量收购中小啤酒企业。所以,你在当地喝的青岛啤酒不一定是青岛原产的(上海松江就有青岛啤酒分公司),即使是工艺一样,原料一样,那么水还不一样呢,口感当然有差别。最近常去联华买这种青岛原产的青岛啤酒,比上海松江产的青岛清爽啤酒贵一点儿,但口感好多了。Classic Tsingtao beer:D

Source favicon22:13 用Java进行基于浏览器的桌面应用程序开发(Browser-based desktop application development with java) » Andy's blog

作者:Andy(http://blog.xintiantang.com/andy),版权所有,转载请先联系我

这篇文章于2005/08/30 20:00开始,计划在一个月内完成,所以将会人工置顶。内容有点儿乱,先把想的和做的记下来,然后再慢慢整理。同时欢迎提出你的看法。更新记录:2005/08/30 20:00,2005/08/31 14:45,2005/08/31 21:21,2005/09/01 16:24,2005/09/01 21:53,2005/09/02 22:13

对于普通用户来说,使用传统的桌面应用程序(可能采用不同语言和工具开发的)可能存在这样那样的限制,比如界面风格千变万化、操作习惯不统一、学习难度大、无法或很难和外部应用通信等。而传统的服务器端应用程序或网站也存在许多限制,比如网络连通可能出现问题、响应速度慢、不能保证服务器端始终可用、担心数据安全和个人隐私问题、不够灵活、使用不方便等。

 而基于浏览器的桌面应用程序正是综合桌面应用程序和服务器端应用程序的功能产生的。它包含以下优点:

基于浏览器的桌面应用程序(Browser-based desktop application)的定义:一个包含嵌入式网站服务器(Embedded web server)的能够在浏览器内的客户端的独立运行(Stand alone)的应用程序。

我把基于浏览器的桌面应用程序(Browser-based desktop application)简称为BBDA。其实BBDA和AJAX技术一样,也是一个buzzword,而不是什么新技术,只不过把几种通用的软件或技术组合在一起而已。和传统的重量级的Portal系统不同的是,BBDA是轻量级网络应用(Light weight web application),XML(Feed / RSS / XML-RPC / SOAP)是联系各个服务或应用的纽带。

其实,BBDA很符合目前热炒的WebOS(基于网络浏览器的操作系统)的特性,这方面Google做了个最好的Demo:Google Desktop, 在GD中,一切内容的表现都是网页(虽然隐藏了浏览器),并且很容易和Google网站进行通信(比如同时搜索本地和搜索Web,利用Feed(RSS)或XML-PRC或SOAP之类的协议读新闻、邮件、天气预报、股票行情等,微软该称RSS为Feed好像很有道理吧?)。现在GDS(Google Desktop Search)只是GD的一个模块而已,百度的桌面搜索只是单纯地模仿了GDS,却没有猜到原来Google是要做GD,好傻的百度。Google这几年的收购和挖人活动(Google Net, Google Browser等),看来一切都是为了WebOS而努力。这里顺便说一下Yahoo刚收购的Konfabulator,Konfabulator和GD有很大不同,我觉得它只是包含许多小软件或和网站交互的工具,只是个玩具箱而已,要做WebOS靠这个可以吗?看来Yahoo的眼光似乎始终不如Google。找到这篇文章:GoogleOS? YahooOS? MozillaOS? WebOS? 居然和我的想法如此相似(写这个之前我绝对没看过这篇文章)!

由于我主要做Java开发,所以只列出可能涉及的Java软件包:Browser(IE/FireFox), JDK, Tomcat/Jetty, HSQLDB/Apache Derby, Hibernate, Spring, Groovy, DOM4J,Apache Http Client, Lucene, Struts/WebWork/JSF/Tapestry/Wicket, DWR(AJAX), Apache Web Services(SOAP/XML-RPC), Apache POI(Word/Excel/ PDF), MP3 ID TAG 3 lib ,JPEG EXIF lib...

我的目的是组合几种通用的JAVA软件,用来进行快速的BBDA开发。对于开发者而言,只要选好合适的软件,并合理组合起来,完全可以达到或超过Ruby on rails的功能和开发效率。同时,对于普通用户而言,只要打开浏览器输入http://localhost就会进入Dashboard(ProtoPage是个很好的Prototype^_^,Start也不错),然后就可以管理日记(blog)、日历、通讯录、照片(flickr?)、音乐(itunes?)、文件、网摘(delicious?)、阅读订阅的RSS(bloglines?)、查看邮件(web mail)、新闻之类等,并可以进行搜索、共享、发布、与外部应用或网站同步等,构成一个完整的个人门户系统(Personal portal),XML(Feed / RSS / XML-RPC / SOAP)是联系各个服务或应用的纽带。

画了个草图(持续完善中):

BBDA

接下来我会发布一个开发BBDA的基础软件包(将会包含一个简单的相册的BBDA),下面是我对基础软件包的说明。

关于嵌入式网站服务器(Embedded web server):

我这几天试用了Jetty和Tomcat。总以为Jetty很小呢,最适合做BBDA呢,结果发现软件包也很大了,另外很多功能不如Tomcat,Tomcat Embed 5.5由于使用Ecipse JDT,现在已经很小了(3M左右),而且标准,所以选了Tomcat Embed(这里下载)。下面的代码是Tomcat Embed的启动程序。

Start.java:

package com.terac.tomcat;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.apache.catalina.Context;
import org.apache.catalina.Engine;
import org.apache.catalina.Host;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.startup.Embedded;

public class Start {
 public static void main(String[] args) {
  try {
   String path = System.getProperty("SERVER_HOME");
   if(path!=null&&!"".equals(path)){    
    int port = Integer.parseInt(System.getProperty("SERVER_PORT","8080"));
    startTomcat(path,port);
   }   
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
 private static void startTomcat(String path,int port) throws UnknownHostException,
   LifecycleException {
  System.setProperty("catalina.home", path);
  Embedded embedded = new Embedded();
  Engine engine = embedded.createEngine();
  engine.setName("Engine");
  Host host = embedded.createHost("localhost", "web");
  Context rootContext = embedded.createContext("", "");
  rootContext.setPrivileged(true);
  host.addChild(rootContext);
  engine.addChild(host);
  engine.setDefaultHost("localhost");
  embedded.addEngine(engine);
  Connector connector = embedded.createConnector((InetAddress) null,port, false);
  embedded.addConnector(connector);
  embedded.start();
 }
}

start.bat:

@set classpath=./lib/所有的jar文件
@java -DSERVER_HOME=%cd% -DSERVER_PORT=80 -classpath %classpath% com.terac.tomcat.Start

关于嵌入式数据库(Embeded database):

Apache Derby虽然比HSQLDB强大,但还是太大了,尤其是当用到IBM的JDBC Driver时。所以只好选HSQLDB。下面的代码是利用ServerContextListener在Web应用程序启动时启动HSQLDB服务器。

HSQLDBServletContextListener.java:

package com.terac.hsqldb;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class HSQLDBServletContextListener implements ServletContextListener {
 public void contextInitialized(ServletContextEvent evt) {
        try {
            ServletContext context = evt.getServletContext();
            String params = "port=9001;silent=true;trace=false;database.0=" +
                context.getRealPath("/") + "/WEB-INF/hsqldb/terac";
            org.hsqldb.Server server = new org.hsqldb.Server();
            server.putPropertiesFromString(params);
            server.setLogWriter(null);
            server.setErrWriter(null);
            server.start();
        } catch (Exception e) {
            System.err.println(e);
        }
    }
    public void contextDestroyed(ServletContextEvent evt) {
        Connection conn = null;
        try {
            Class.forName("org.hsqldb.jdbcDriver");
            conn = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:9001",
                    "sa", "123456");
            Statement stmt = conn.createStatement();
            stmt.executeUpdate("SHUTDOWN;");
        } catch (Exception e) {
            //
        }
    }
}

web.xml中需要加入listener:

com.terac.hsqldb.HSQLDBServletContextListener

关于全文检索引擎(Full text search engine):

Apache Lucene应用广泛,也足够强大,高亮显示(Highlighting)需要自己实现,自动摘要(autosummarize)需要Classifier4j 。下面是常用类的封装代码:

Indexer.java:

还未整理好

Searcher.java:

还未整理好

关于Shell:

有些时候,用户不满足已经有的服务,需要更灵活的、或者定制的功能,一个简单的、易学的、解释性的、交互式的Shell就显得很必要,比如Windows提供的cmd或Linux里的bash。研究了一下,发现Groovy正好能满足需要,“for (ch in "Hello world!") {println ch}”,这个稍微复杂点儿的Hello world很好懂吧?

关于时间服务(Time Service):

Windows里有计划任务(Schedule task),Linux里有Cron job,这个对于WebOS也是必须的,比如定时检查邮件,定时抓新闻等等都需要定时器(Timer),Spring framework封装了好几种Time service,足够了。

关于对象关系映射工具(OR mapping tools):

Hibernate是最常用最强大的工具。下面是Hibernate Session的封装代码(也可以利用Spring framework来管理):

HibernateUtil.java:

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.Session;
import net.sf.hibernate.cfg.Configuration;
import org.apache.log4j.Logger;

public class HibernateUtil {
 private static Log log = LogFactory.getLog(HibernateUtil.class); 
 public static final ThreadLocal threadSession = new ThreadLocal();
 private static final SessionFactory sessionFactory;
 static {
  try {
   sessionFactory = new Configuration().configure().buildSessionFactory();
  } catch (Throwable ex) {
   // We have to catch Throwable, otherwise we will miss
   // NoClassDefFoundError and other subclasses of Error
   log.error("Building SessionFactory failed.", ex);
   throw new ExceptionInInitializerError(ex);
  }
 }
    public static Session currentSession() throws HibernateException {       
        Session s = (Session) threadSession.get();
        if (s == null) {
            s = sessionFactory.openSession();
            threadSession.set(s);
        }
        return s;
    }
    public static void closeSession() throws HibernateException {
        Session s = (Session) session.get();
        session.set(null);
        if (s != null)
            s.close();
    }
}

关于模型-视图-控制框架(MVC framework):

现在的MVC framework太多了,传统的有Struts/WebWork,新的有JSF/Tapestry/Wicket/Flex&Laszlo(Flash RIA) ,Wicket网站列出了55种之多!我试过JSF,始终不能另我满意,正在研究WicketRIFE(这两个都支持AJAX)。

待续。。。

Source favicon17:39 Google Local for China » Danwei RSS 1.0

Google's location-based search service now has a Mainland China version that supports Chinese language searches. It's at bendi.google.com. The service allows you to search for businesses and services in specific places, such as wireless Internet café in Chaoyang District, Beijing (无线上网 咖啡厅 北京朝阳区).

Source favicon17:01 Beijing Media Top Stories: arms control, three legs infant and student loan ... » Danwei RSS 1.0
TBN050902S.jpg
The Beijing News' cover, features a picture of the three legs infant in hospital.

1. China issues a white paper Thursday on the Chinese Government's policies and positions on arms control;

2. A 1 year old hermaphrodite with three legs to become female after the operation;

3. The universities which can not provide enough loans to students to be limited for enrollments;

4. Regular consumers' complaints to be handled within nine days;

5. The pork under standards sold in Carrefour Guozhan shop.

Source favicon15:16 FeedSky大变脸 » 未完成 - Incomplete
吕欣欣在几个星期前就兴奋地对我说过Feedsky二版正在加紧进行中,而且会是对第一版的很大改进,用他的话说“彻底与Feedburner决裂了”。昨天从吕欣欣传给我先睹为快的Feedsky二版的界面中,我的确感觉到了这次的改版对于Feedsky是个革命性的改变。 从界面上看,二版的Feedsky有几个主要的改变。其中最重要和最大的变化莫过于引入社会化网络的概念,这也是与Feedburner决裂的关键点。在Feedsky中,用户可以分享自己收藏的feed(像豆瓣分享书籍那样?),添加好友关系、创建小组等等。Feedsky摇身变成了一个基于Feed的SNS,或许Feedsky日后会变成一个发现优秀Feed的重要来源,实现herock的FeedChoice的部分目标。 Feedsky加强的第二个很有吸引力的功能是可多个Feed合烧,将多个Feed聚合成一个Feed是不少人都希望实现的功能,只是Feedburner与第一版的Feedsky都只能聚合一个blog feed与网摘及Flickr的Feed,而不能聚合多个blog,所以也出现了不少这类多Feed聚合的小工具,而现在Feedsky的这个多Feed合烧功能相信也会吸引一些Blogger来使用他们的服务。 Tag功能在Feedsky目前的版本中就有,只是一来使用了“自建目录” 这样一个怪异的名字,二来每个人所定义的tag在Feedsky中也没有找到用武之地,还是按照传统的目录方式进行浏览与查找(在目录页面发现有很多人利用Feedsky烧录自己的keso Feed)。不过在二版中,Tag已经成了Feedsky的一个重要组成部分。以后基于Tag的Feed发现应该也会成为找到优秀中文Feed的一个好途径。但原来已经烧好的Feed的作者倒是未必有动力再去编辑自己的Feed,不知道在Feedsky中是否用户可以为并非自己创建的Feed打tag呢? Feedsky的一个基本服务:Feed统计功能也在二版中得到了不小的改进,除了原有的订阅人数与页面访问统计外,还新增加了浏览器分析和爬虫统计等功能,而且统计的时间范围也可以自由定义了。 从界面中似乎还发现了一个搜索页面,难道是对Feed内容的检索?Blog搜索引擎?也可能是对Tag的搜索?从界面上一时判断不出实际的功能。 Feedburner这几天正好也在变脸,不过主要只是使用界面上的改变,对用户更加友好和明了。相信不久Feedsky也就会变脸了,而且的确是个大变脸,不会再简单地被人认为是Feedburner的中文抄袭版了,而是一个全新的Feed SNS服务。 ps.文章中的判断都是基于吕欣欣给我看到的界面,由于并非实际使用,因此对其功能的判断可能存在不准确之处。
Source favicon14:40 No, you may not change my f'ing home page! » Jeremy Zawodny's blog
In CNet's article Yahoo IM users get more than they bargained for: If you're one of the tens of millions of Yahoo users asked to upgrade your instant-messaging software this week, be on your toes: The update can open the door to unwanted PC houseguests--and setting changes--by default. By accepting Yahoo's "typical" installation of YIM with Voice, it will also download Yahoo's Search Toolbar with anti-spyware and anti-pop-up software, desktop and system tray shortcuts, as well as Yahoo Extras, which...
Source favicon13:58 Yahoo domains now for $1.99 » Tim Yang's Geek Blog

They dropped it to $4.95 a couple months back before it returned to $9.95.

Source favicon12:43 The most frustrating job at Google » Tim Yang's Geek Blog

After I posted about Philipp Lenssen’s poll of Blogspot blog’s, I thought: the guy who has to come up with a new “Blogs of Note” for Blogger’s dashboard every day must have the most frustrating job in the whole of Google. Half of the blogs he has to survey (and I reckon he must go through hundreds each day) is spam. Poor bastard.

Source favicon11:03 我的五个怪癖 » 妮妮
从昨天开始,研究院内部就开始点怪癖的办公室游戏:大家写下五个自己的怪癖、奇怪的嗜好、异于常人的习惯,谁先写完了可点其他人。今天收到ada的点名,再次公布一下妮妮的怪癖: 1、出门口令。出门一般都会说:手机、钥匙、钱、妮妮。然后摸一边东西是否都在,还要摸摸自己才算。但即使这样,也会有忘记带手机的时候。 2、一段时间醉心于一件事件,兴趣过后决不再碰。 3、爱买明信片,走哪买哪。 每到一个地方,一般都要去邮局买明信片,寄不寄不一定,但是一定是要买的。 4、看小说先看结局,看电视一定要问谁是好人谁是坏人谁是最后的凶手、看比赛要先知道哪一队会赢。 5、一开始就不喜欢的人,基本不会理。 我点: 尹小松:超级志趣相投的朋友。 FOOLPOOR:最最懂生活爱生活! 背包客:勇者,地平线俱乐部的头头! 阿咪:永远阳光的阿咪姐姐。 葱头:好男人好朋友好哥们儿!...
Source favicon09:21 Lesbian Spanking Stories Made My Life Easier » Jeremy Zawodny's blog
I was looking at my referral logs recently and noticed a couple hits from google searches for "lesbian spanking stories" hitting one of my pages. Wondering what the heck could have cause Google to think I had written about lesbian spanking stories, I checked the page. Sure enough, there was an old bit of comment spam I had missed. Amusingly, the spam didn't provide any links back to the pr0n site but did put me relatively high in the ranking...
Source favicon03:19 The machines do the translating » Google Blog




This year, Google entered the National Institute of Standards and Technology (NIST) Machine Translation evaluation, an event that has taken place annually since 2001 to support research in this area and to improve the state of the art. Participants included university labs, industrial labs, government labs and commercial machine translation companies from all over the world.



Our approach was to use statistical translation models learned from parallel text, that is, sets of documents and their translations. The system learns a model automatically from the parallel data. This approach differs from the rule-based approach used by many existing commercial machine translation companies which is based on large sets of handwritten translation rules.



We're very pleased with the results of this evaluation. Our computing infrastructure allows us to do a lot of experiments and work with huge data sets very easily.
Source favicon03:18 Gmail Notifier for Mac OS X » Google Blog




I'm a Mac user. Most of my friends are Mac users. After a little coaxing, most of my family are now Mac users. So I decided to spend 20% of my time here on a small application that may help all of the Mac users in my life: a Gmail Notifier for Mac OS X.



The app is small and nonintrusive, but hopefully still has all the features a Mac user would want. With it you can:



- view messages without opening a browser

- open Gmail in your browser without forcing you to log in again

- make Gmail your default email program

- even more...



Though this is the first, it won't be the last native Mac application that Google delivers. So please, Mac users, stay tuned!
Source favicon01:47 No More Automated Daily Link Digest Posts » Jeremy Zawodny's blog
The feedback from my experiment has been more negative than positive, so I'm going to cease those postings. If you want to subscribe to my links, please use the linkblog RSS feed. A few folks said they're like a way of commenting on them. I've got a solution for that coming soon, so stay tuned. If nothing else, this has been a fun little MT hacking project. Thanks for the public and private feedback. It sure beats trying to read...

^==Back Home: www.chedong.com

<== 2005-09-01

==> 2005-09-03