星期六, 十二月 04, 2004

如何关闭最顶级IE窗口,避免提示确认的麻烦?

问题:如果非window.open打开的窗口用window.close();或self.close()关闭,由于安全理由.

IE会提示你确认是否关闭.在B/S应用中这是非常麻烦的,因为它可能改变导航的流程.

所以必须可以用javascript直接关掉.以下代码在IE6.0SP2上测试通过.

加红色的字是关键语句

<script>

function closeself()

{

opener='"';

}

</script>

<body onload="closeself()">

<h1>Welcome</h1><a href="javascript:window.close();">close</a>

<a href="javascript:opennew();">open</a>

<script>

function opennew(){

aw=window.open("2.html","aaa");

aw.opener=this;

}

</script>


星期四, 十二月 02, 2004

在MYSQL中如何得到group by对应最大值的哪条记录呢?

In ANSI SQL, I'd do it with a subquery like this:

SELECT article, dealer, price
FROM shop s1
WHERE price=(SELECT MAX(s2.price)
FROM shop s2
WHERE s1.article = s2.article);


在Mysql 4.1 以下的版本,不支持嵌套select的使用,所以你必须想别的的办法如下:
通过 "MAX-CONTACT 跳票"模式来实现.
SUBSTRING(MAX(CONTACT(Fileld_name_with_max_value,other FIled)),length(Fileld_name_with_max_value));
如此递归,则可以把包含最大值字段对应的记录的其他字段的值都读出来了.
一个实际的例子:
SELECT empid,substring(max(concat(effectivedate,paycatagorycode)),11) as paycatagorycode,max(effectivedate) as effectivedate,substring(max(concat(effectivedate,basicSalary)),11) as basicSalary, substring(max(concat(effectivedate,bankBranchCode)),11) as bankBranchCode, substring(max(concat(effectivedate,currencyCode)),11) as currencyCode, substring(max(concat(effectivedate,payCatagoryCode)),11) as payCatagoryCode,substring(max(concat(effectivedate,salaryPolicyType)),11) as salaryPolicyType,substring(max(concat(effectivedate,remarks)),11) as remarks FROM emp_M_SalaryBasicInfo group by empid

星期三, 十二月 01, 2004

如何制作Intel主板启动splash Screen

Keyword:USB Memory stick bootable,Bios Recovery,Intel 865PERL


建立USB 启动U盘及更新Intel BIOS Splash Screen 启动画面

我的主板是Intel 865PERL,以下以此主板为例。

由于Intel BIOS Splash Screen更新目前只能在DOS下进行,所以首先建立一个可以启动的DOS盘是必备条件.但目前很多机器支持USB启动,而没有安装软驱。所以要完成BIOS启动画面的更新有几种方法可以选择:
a. 光碟启动到DOS下.访问U盘,并更新BIOS
b. U盘直接启动,完成升级BIOS任务.
以下为如何制作从U盘启动升级BIOS启动画面的过程
1. 建立可启动U盘.
目前最好用的工具当属HP公司的HP USB Disk Storage Format Tool
据说Ghost 2003也可以制作U盘启动盘,没有用过,不确定.
下载: http://h18007.www1.hp.com/support/files/hpcpqdt/us/download/20306.html
用HP的工具来制作启动U盘,需要准备好DOS的几个启动文件
io.sys,command.com和msdos.sys几个文件
MSDOS的启动文件包可以从这里下载:
http://www.nu2.nu/bootdisk/network/

将U盘插上后,启动HP Format工具,并指定MSDOS文件存放的目录,就可以格式化U盘了,HP Format会自动检测文件是否齐全.这样就可以制作可启动的U盘了.
2. Enabled USB BOOT.
必须在CMOS中允许通过USB启动.Intel主板是按下F2进入BIOS设置.
这步完成后,可以测试一下U盘确实可以启动,然后再进行下面的步骤.

c. 下载Intel(R) Integrator Toolkit
http://www.intel.com/design/motherbd/itk.htm
1. Intel Iflash BIOS Update 下载
http://www.intel.com/design/motherbd/genbios.htm 选择你对应的Intel主板类型。不要选择错了!下载Iflash版本,不要下载Express版本.
下载的.exe文件可以用winrar打开.

sw.exe 是个包文件.P19-0085.ITK是Intel(R) Integrator Toolkit需要的文件
SW.EXE 包含我们需要的主板BIO文件P19-0085.BIO和更新BIOS的主要程序IFLASH.EXE文件。如图

2. 制作定制的包含新的启动屏幕BIOS
重要提示:首先准备一份BIOS恢复盘.将SW展开的文件全部复制到软盘上,如上图.
Intel(R) Integrator Toolkit 的具体操作可以参看所带的chm帮助,进入主界面后,找到定制启动屏幕的BIOS选项,如图:

选择Edit Module后,出现图形编辑界面,你可以选择你要作为splash screen的图片;
注意:经过实验Intel 865PERL支持4位(16色),8位(256色),24位(16M颜色)的格式图片,要注意的是不能使用压缩的图片.如果用BMP必须画笔保存为16/256/24位颜色的DIB格式的BMP图片.
如果用JPG必须要采用最佳质量的图片!用PS保存的JPG质量最佳图片,如果保留了调色板信息,最好用Acesee再保存一次,去掉有关调色板的信息.



图片的大小不要超过BIOS的空间,如果超出空间,在状态栏上会出现红色的提示.容量大小会超过100%.如果出现红色提示,必须缩减图片大小

然后在File菜单中生成ini文件和BIO文件,在从Tools菜单里选择Generate Media在指定的USB启动盘或软盘上生成更新所要的ini和BIO文件及启动的autoexec.bat文件.
重新启动机器,从USB或软盘引导就开始了更新,更新完成后,机器启动,然后在黑屏下可以听到
10声喇叭的声音.然后机器会关闭。拿出软盘或USB启动盘,
重新启动后,就可以看到新的启动屏幕了。
JPG 24色的图的大小远小于DIB格式的BMP图片,所以采用JPG是最优选择.

重要提示

如果更新的时候因为掉电等原因机器不能再启动,必须首先拔掉主板上BIOS设置的三脚的跳线把模式设置为Recovery Model,启动机器会从软盘引导,插入准备好的BIOS恢复软片,就可以恢复BIOS了.
这是我的主板BIOS启动画面,24位JPG,78K,我去掉了所有网卡启动的有关BIOS.




Javascript文件操作Exception

<script>
function writeData()
{
try
{
//alert(counterValue);
var dataFileObj = fsObj.createtextfile(DataFile, true);
dataFileObj.WriteLine(status);
dataFileObj.Close();
return(true);
}
catch (err)
{
return(false);
}

}

function init()
{
try
{
this.fsObj = new ActiveXObject('Scripting.FileSystemObject');
}
catch (err) {
msg="";
for(var i in err)msg=i+":"+err[i];
alert(msg);
}

if (this.fsObj != null)
{
if (!writeData())alert('写数据时候有错误发生');
}
}
</script>

星期一, 十一月 29, 2004

Java Session setAttribute 不能传递HTML tag的问题.

解决方法.1
1.服务器Servlet里,使用:
request.getSession().setAttribute("statusMsg",
java.net.
URLEncoder.encode(
debugMsg.toString(), "UTF-8"));

2.在JSP 里使用:
<%=java.net.URLDecoder.decode((String)request.getSession().getAttribute("statusMsg"),"UTF-8")%>

JAVA中如何计算时间差.

基本算法:

得到两个时间之间的所差时钟数目(MillionSecond ,nanoseconds),然后根据需要输出的结果
计算并格式化数据.


Example:


import java.util.*;
import java.text.*;

public class Timecalc2 {

public static long MS_SECOND = 1000L;
public static long MS_MINUTE = 60L * MS_SECOND;
public static long MS_HOUR = 60L * MS_MINUTE;
public static long DAY = 24L;

public static long parseDT(String s1, String s2) throws ParseException
{
DateFormat formatter = new SimpleDateFormat("MM.dd.yy HHmm");
Date d1 = formatter.parse(s1);
Date d2 = formatter.parse(s2);
long dateDiff = d2.getTime() - d1.getTime();
return dateDiff;
}

public static String formatMilli(long value)
{
//DecimalFormat is used to display at least two digits
DecimalFormat nf = new DecimalFormat( "00" );

//calculate hours, minutes
long remainder = 0;
long hours = (value / MS_HOUR);
remainder = value % MS_HOUR;
long minutes = remainder / MS_MINUTE;

//build "hh:mm:ss"
StringBuffer buffer = new StringBuffer();
buffer.append(nf.format(hours));
buffer.append( ":" );
buffer.append(nf.format(minutes));

return buffer.toString();
}

public static void main(String[] args)
{
String start = "01.14.03 1730";
String end = "01.17.03 1927";
try
{
long dateDiff = parseDT(start, end);
String answer = formatMilli(dateDiff);
System.out.println(answer);
} catch (ParseException pe)
{
System.out.println("You must use the format: MM.dd.yy HHmm");
}
}
}

星期四, 十一月 25, 2004

如何修改Intel 主板开机画面

Modify Intel Bios MainBoard boot splash .
1.下载定制工具包:Intel? Integrator Toolkit

URL:
http://www.intel.com/design/motherbd/itk.htm

2.下载对应主板的可生机BIOS.
http://developer.intel.com/design/motherbd/rl/rl_bios.htm
在DOS下执行的.exe文件里有后缀为.TLK的文件.可以用winrar打开.
我的Intel 865PERL主板对应的BIOS为:ftp://download.intel.com/design/motherbd/rl/RL86510A.86A.0085.P19.IB.EXE

3.按照操作.


星期三, 十一月 24, 2004

MySQL 常用命令(1)

MySQL 4.1.7 Tune Performance Common Command
1. SHOW INNODB STATUS and the InnoDB Monitors
mysql> SHOW INNODB STATUS\G (Caution:must be end with \G);

2. insert into table(column_name) select clause...
INSERT INTO Table1 (latin1_column) SELECT USER();
3.显示当前MYSQL Version
select version()

星期一, 十一月 22, 2004

书写跨平台代码的一些小技巧

1.目录分隔符号.
使用File.separator
2.Text文件Line-carriage
Reader in=new Reader(..)
in.readLine().repace(System.getProperty("line.separator"),"&");
System.getProperty("line.separator")在window下为\n\r
Unix/Linux下为:\n

星期六, 十一月 20, 2004

MySQL 4.1 Production Level release!

真没想到.MySQL 4.1 从Development-->Production,时间如此之短.
看来MySQL 加强了开发力量了.真是值的祝贺的事情.
现在可以支持DBCS了通过UTF8和UCS2两种方式.

啊.想当初为了用ISO8859-1来保存DBCS的痛苦了.真是可惜啊.大量的来做ISO-8859-1->UTF8
和UTF8->ISO-8859-1的代码没用了

:(.

星期四, 十一月 11, 2004

JavaRanch Big Moose Saloon: How can MDB listen a remote queue ?

JavaRanch Big Moose Saloon: How can MDB listen a remote queue ?

Re: [JBoss-user] How to get messages from a remote JMS server

Re: [JBoss-user] How to get messages from a remote JMS server: "> Hello all, > I am trying to set up deployment descriptors for some MDB in jboss. I need to > subscribe to topics from a remote JMS server. I have added the remote JMS MBean > into jboss.jcml as was described in the documentation : > > name=':service=JMSProviderLoader,name=RemoteJMSProvider'> > RemoteJMSProvider > org.jboss.jms.jndi.JBossMQProvider > remote.com:1099 > > > and I got the server to start. The only thing I have left to do is to actually > write the deployment descriptor to look up the topics in the remote server. > I know that the syntax for doing so for topics in jboss.xml is : > > > topic/MyTopicj > > is this the same syntax for all such servers?"
另外一篇文章,详细描述了如何用Jboss MDB 访问webSphere的消息bean
http://sourceforge.net/tracker/index.php?func=detail&aid=753022&group_id=22866&atid=376687

Business Process Management (BPM) Tutorial - What is BPM?

Business Process Management (BPM) Tutorial - What is BPM?: "What is Business Process Management (BPM)?"

星期一, 十一月 08, 2004

如何在Javascript中得到多纬数族字符串下标

在Javascript中所有Object都是Hashtable对象的包装.
常用的数组用法:
一纬数组用法:
遍历数组:
MyObject=new Array();
MyObject=["a","b","c"];
for(var i=0;i<g;MyObject.length;i++)document.write(Myobject[i]);

多纬数组用法:
遍历数组:
MyObject = new Array();
MyObject[0]=["a","b","c"];
MyObject[10]=["a1","b1","c1"];

for(var i=0;i<g;MyObject[0].length;i++)document.write(Myobject[0][i]);

得到以定义的所有多纬数组的下标:
MyObject = new Array();
MyObject["name"]=["a","b","c"];
MyObject["high"]=["a1","b1","c1"];

用for..in 得到name,和high下标
for (var i in MyObject) {
document.write(i);
结果为:name,high

星期五, 十一月 05, 2004

Amazon Search Bar for FireFOx Enabled.

AmaZon的搜索条为FireFox的定做已经发布了,很好看.
不过在中国暂时无法使用.

遗憾.

下载地址:
http://toolbar.a9.com/

星期六, 十月 30, 2004

Groovy如何返回值?

在数据库或.groovy脚本程序文件中,只写入一个整数或其他字符串.
groovy将认为会把这个整数或字符串作为结果返回.

比如:test.groovy 包含:
//here is PayItem Business code.
3000;

用groovy.bat test.groovy 得到记过3000

星期三, 十月 13, 2004

如何用Java软件来开发射频身份识别自动识别方案?

Oct 12, 2004
原文

如何用Java软件来开发射频身份识别 自动识别方案



本文主要描述怎么使用Sun Java 系统RFID软件来开发RFID解决方案.同时帮助开发人员理解架构,设计和实现.
文章也包括的一个可以下载的应用例子,sampleRFID.同同文档一起的ReadME描述的如何同给定接口编码的细节,并且如何配置平台.

什么是RFID和Auto-ID?

射频身份识或RFID使用射频波来识别唯一对象的一种方法.RFID是对下一代条码技术的需求作出的反应.
用最简单的术语来说,RFID系统有标签(应答器)和阅读器(询问器)组成.RFID技术处理用射频通讯收集储存在标签里的远程信息.

储存在标签里的信息范围从一个表示数字到数K的数据可以被写入和读出,动态的信息比如温度的历史在标签中维护.

自动识别或Auto-ID是一个广泛的术语,包括数据数据的方法和无人工干预直接进入计算机系统.
技术传统上认为Auto-ID的部分包括条码,生物测定学,RFID,和声音识别技术.

Auto-ID 技术提供系列方法用来追踪任何物体,任何时间,任何地点.Auto-ID系统基于上面低花费的聪明标签和阅读器,及唯一的对象表示模式.Auto-ID的目标是可以替代UPC条码系统而使用不贵的RFID标签嵌入到产品包装里.或更加好的方式比如嵌入到产品里面.虽然条码不会很快消失.有许多应用如果使用RFID标签将变的更加复杂和增加成本,而使用条码就比较完美。在可见的将来,将是条码和RFID标签共存的时期.

Auto-ID网络由数个使用Auto-ID系统的贸易伙伴组用来追踪供应链上的项目.这将提供商业上空前的实时资产和任何地方的库存视图.并且能提供有重大意义的商标保护努力.Auto-ID网络提供的好处在于定位伪造,串改,恐怖主义和其他的要求的操作的有效性


标准

EPCglobal是Auto-ID的创造中心.它的标准内容基于EPCglobal网络采用的EPC技术.Epglobal 网络包括一组允许及时,自动标识和共享供应链项目信息的技术.EPCglobal网络使用射频标识(RFID)技术是供应链项目信息可见性成为可能.这个网络有5个基本元素组成:

* 电子产品代码 (EPC)
* ID系统(EPC 标签和阅读器)
* EPC 中间件
* 对象命名服务(ONS)
* 物理标记语言

EPC编号系统:
如同统一产品代码(UPC)或条码,EPC是EPC网络上的物理对象的基本标识.
EPC标识厂商,产品,版本和序列号.并且使用额外的数字组表示唯一项目.
EPC标签数据标准规范版本1.1定义了电子产品代码(EPC)在RFID芯片上的编码.也定义如何被EPC网络信息系统层使用的编码(比如RFID信息服务器).

EPC标签和阅读器和接口协议:
EPC标签是带天线的微芯片.EPC被保存在这个标签里,这是在制造过程就被应用了.
EPC标签使用射频标识(RFID)来传递他们的EPC到EPC阅读器.EPC阅读器同EPC标签通讯通过无线电波并且通过EPC中间件发送信息到本地商业信息系统.
这是Auto-ID阅读器协议规范1.0定义的关于阅读器和EPC中间件的通讯的标准协议.

阅读器管理规范扩展了阅读器协议规范,定义了在大的网络上如何管理RFID的标准.

标签可以分类为被动,主动和半被动的.被动标签没有电池及当有提示的时候简单"反射".而活跃标签自带电池并且是通讯发起者.
半被动标签有一个电池,但是也是属于"反射"通讯.它不会启动一个通讯.
可以想象被动和半被动标签作为一个用来传送光的镜子 ,当有光照在它们上面的时候.今天,EPCglobal网络集中精力在被动标签标准上.我们可以期望EPCNetwork关于积极标签的标准很快建立.

EPC中间件:
EPC 中间件过去也叫做Savant.它是关于实时事件管理,EPC数据过滤和收集规范的标准.它覆盖了新的EPCglobal规范,当前作为过滤和收集规范的参考.

EPC信息服务:
EPC信息服务允许用户同使用EPC的商业伙伴交换数据

对象命名服务(ONS):
给你能力来定位包含关于世界上特定任何地方EPC信息的服务器.商业信息系统需要一种方法匹配EPC和货物关联的信息.
ONS是提供通过指明在www上的计算机来提供自动的网络服务.它为包含产品属性及相关属性被维护的的IP地址制定了一个标准.

物理标志语言:(PML)
用做通用语言在EPCglobal网络中,用来定义物理对象的数据.PML的目标是提供一般收集,标准表达词汇和分布信息到
EPC网络可用的对象.PML 核心规范1.0定义了PML标准.

介绍Sun Java 系统RFID软件.

Sun Java系统RFID软件是Sun唯一RFID中件间平台提供提供基于广泛被接受的工业标准也包括在EPCglobal中定义的标准.
它为公司使用EPC网络提供了一个基础. 它的设计规范是提供一个高层次高可靠性和扩充能力的EPC网络同时可以简化同多个
已经存在的后台企业系统整合的任务

Sun java系统RFID软件负责在EPC阅读器和标签之间的EPC数据和事件的通讯和处理,及后台供应链系统ERP.和RFID软件包含
两个基本的部件:1).RFID事件管理 2)RFID信息服务器.两个都可以下载.这两个组件基于Jini 2.0,Rio 3.0.1,及Java Web Service Developer pack 1.3和Sun Application server 7构造.

*RFID事件管理器同EPC标签阅读器通讯来出来大量的EPC数据进入系统.事件管理器也同后台系统通讯并向RFID信息服务器记录
EPC数据和事件.RFID事件管理器是Jnin-Based的事件管理系统.它容易铺捉,过滤和保存由连接到网络上的RFID阅读器产生的EPC事件.
它的主要目标是同RFID阅读器的接口,收集EPC事件,过滤多余信息,并且产生送往迎来RFID信息服务器的相关事件或者其他
EPR软件以备处理.RFID事件管理器Jini服务通过Rio被管理,Rio是一个开源的Jini服务组件包容器.

*RFID信息服务器负责储存和聚集围绕给定的EPC事件关系的业务数据.RFID信息服务器J2EE应用用做一个接口来俘获和查询EPC
相关数据.EPC相关数据包括:来自事件管理器的检查数据也包括映射EPCS到较高级别的商业数据的信息.
RFID 信息服务器是典型的用来转换低级检查到高级商业功能.RFID信息服务器运行在Sun Java系统Application Server 7.
其他信息系统应用接口通过XML信息交换.信息系统支持HTTP和JMS信息输送.
信息系统保存所有数据到关系数据库中.

这两个组件扮演了关键的角色在EPCglobalo 定义的EPC网络中


Sun Java系统RFID软件技术描述

Sun Java 系统RFID事件管理器收集RFID阅读器的信息,过滤信息并且提供大量的信息到RFID信息服务器或第三方的ERP系统.

Figure 1 描述 RFID事件管理器和RFID信息服务器怎样适合EPC Global网络



Figure 1: Sun Java System RFID软件和EPCglobal网络

RFID事件管理器由控制工作站和一个或多个执行代理组成在图2中描述



Figure 2: Sun Java System RFID事件管理器架构

计算机系统可以运行一个或多个执行代理并且每个执行代理可以完成一个或多个工作量.每个执行代理在启动的时候向控制工作站
注册.

控制工作站保存可使用的执行代理注册,监视它们的状态,分配工作量并且帮助他们完成工作量.

一个执行代理包含一个Adapter,一个Logger和Filter组件.每个执行代理可以组成Adapter的馈给信息送到一个或多个filter或
logger,并且没个filter馈给信息给一个或多个logger.Adapter是个Java代码片同实际的RFID阅读器接口.

Sun Java系统RFID 事件管理器 来自被包装的预定义了编码的Adapter.它能理解EPC-顺从的RFID阅读器使用的指定的通讯协议.
这些阅读器 Adapter可以看做计算机系统里同周围外部设备通讯的设备驱动程序.
目前,没有标准的通讯协议可以被RFID阅读器使用来同消费它们的RFID事件的软件通讯.
RFID阅读器是独立的一片(典型的)硬件用来同RFID标签基于无线电频率通讯.
Adpater(适配器A)获得RFID标签的EPC并且产生一个事件包含时间戳和时间源(阅读器和天线发现标签).
事件被传送到处理事件的一组监听器.监听器是filter或logger.Filter可以平滑数据,扔掉先前探测信息或到其他
filter或logger的路由信息.过滤后的数据被传送作为一个事件到感兴趣的listener.Listener可以被其他有更多的数据的filter或logger作为一个连接器到第三方消费RFID信息的应用

The two tables below list the supported filters and loggers and their main functionality.
下列两个表列出了支持的filter和logger及它们主要的功能.

Table:1 Filters 由SunJava系统RFID事件管理器实现.
Filter Type Description
BandPass BandPass在阅读器EPC执行滤过器,来自阅读器的事件匹配EPC掩码被放行到listener,其他的则放弃.
Delta 报告标签进入和留下的视野
EPCFilter 同BandPass.
Smoothing Smoothing creates a union of EPC's discovered over the number of specified N cycles. If an EPC was discovered in cycle N, it is reported, if it hasn't been seen in more than the last N cycles, it is not reported. This is necessary because the RFID readers do not report tags with 100% tag accuracy.

Table 2: Loggers 由Sun Java系统RFID事件管理器实现.
名称 描述
FileLogger Logger that writes out PML Core to a file
HttpPmlLogger Logger thats write out PML Core to an HTTP connection
JMSLogger Logger that writes out PML Core to a JMS Queue or Topic
SocketLogger Creates a Socket connection and starts writing PML Core to the connection
SsocketLogger Creates a Server Socket connection and starts writing PML Core to the connection

The user configures the adapters, filters and loggers properties through an XML configuration file. The adapters, filters and loggers are tied to one another by use of a special tag in the configuration file. Figure 3 below illustrates the design and syntax of the XML configuration file. The dotted lines imply that the associated elements or components are optional. Zero or more of each can be present.


Figure 3: Illustration of Sun Java System RFID Event Manager Configuration File

The following attributes define the Adapters of the RFID Event Manager:

1. name: The unique name for the component.
2. classname: The name of the Java class that implements the component.
3. LogLevel: The LogLevel parameter specifies the detail of logging information to be generated by the Adapter. The settings follow java.util.logging conventions established in the J2SE release of the Java VM.
4. properties: A sequence of name value pairs.
5. outputs: a sequence of component names that will be registered as event listeners to this adapter. The outputs normally designate one or more filters, or loggers.

Some of the common properties include:

1. Reader Hostname
2. Reader EPC identifier
3. Log Level


Anatomy of an EPC
EPC can be represented as a URI (Uniform Resource Identifier) to enable the data exchange between software systems. EPC URI are based on the EPC Tag Data Standards defined by EPCglobal. These standards define completely that portion of EPC tag data that is standardized, including how that data is encoded on the EPC tag itself (that is, the EPC Tag Encodings), as well as how it is encoded for use in the information systems layers of the EPC Systems Network (the EPC URI or Uniform Resource Identifier Encodings). The EPC Tag Encodings include a Header field followed by one or more Value Fields. The Header field defines the overall length and format of the Values Fields. The Value Fields contain a unique EPC Identifier and optional Filter Value when the latter is judged to be important to enable effective and efficient reading of the EPC tags.

The EPC encoded in an RFID tag can identify the manufacturer, product, version and serial number, and also provides an extra set of digits to identify unique items.

For various industries, the EPC identifier specifies various coding schemes:

* General Identifier (GID)
* Serialized version of the EAN.UCC Global Trade Item Number (GTIN)
* EAN.UCC Serial Shipping Container Code (SSCC)
* EAN.UCC Global Location Number (GLN)
* EAN.UCC Global Returnable Asset Identifier (GRAI)
* EAN.UCC Global Individual Asset Identifier (GIAI)

Given EPC data, its header field indicates which coding scheme can be applied. The standard URI representation of EPCs has 4 categories:

1. URIs for pure identities (also called canonical forms) which contains only the EPC fields to identify a physical object. For example, a pure identity URI for GID can be "urn:epc:id:gid:10.1002.2" and a URI for GRAI can be "urn:epc:id:grai:0652642.12345.1234."
2. URIs for EPC Tags which represents the tag encodings. These URIs can be used by application software to write a tag. An example for a Serialized GTIN 64-bit encoding is "urn:epc:tag:sgtin-64:3.0652642.800031.400."
3. URIs for Raw Bit Strings which represent invalid bit-level patterns as a single decimal number. For example: "urn:epc:raw:64.20018283527919."
4. URIs for EPC Patterns. Each pattern URI refers to a set a EPCs for the EPC filtering purpose. For example: a pattern "urn:epc:pat:sgtin-64:3.0652642.[1024-2047].*" refers to any SGTIN Identifier 64-bit tag with Filter value as 3, Company Prefix as 0652642, Item Reference in the range from 1024 to 2047 and any Serial Number.

For further details, EPC TagData Standards Specification.

Anatomy of a PML message

The RFID Event Manager loggers output PMLCore XML messages, conformant to version 1.0 of the specification published by the Auto-ID Center. The specifications can be located here. The snippet below is a PML message sent by the Event Manager corresponding to a TagsIn event, ie, when a tagged item comes in view of an antenna. A similar event with a command TagsOut is sent when a tagged item goes out of view of an antenna.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- The root element of PML Core -->
<Sensor xmlns="urn:autoid:specification:interchange:PMLCore:xml:schema:1">
<!--The EPC of the reader specified in the RFID Event Manager configuration file for the Reader adapter -->
<ns1:ID xmlns:ns1="urn:autoid:specification:universal:Identifier:xml:schema:1">urn:epc:id:gid:1.1.3</ns1:ID>
<!-- The root element for an observation -->
<Observation>
<ns2:ID xmlns:ns2="urn:autoid:specification:universal:Identifier:xml:schema:1">4</ns2:ID>
<!-- The time when the observation was recorded by the RFID Event Manager -->
<DateTime>2004-05-27T15:36:25.758-07:00</DateTime>
<!--If the PML is generated from a Delta Event, the value of Command is either TagsIn or TagsOut -->
<Command>TagsIn</Command>
<!-- A tag observation -->
<Tag>
<!-- The EPC of the observed tag -->
<ns3:ID xmlns:ns3="urn:autoid:specification:universal:Identifier:xml:schema:1">urn:epc:id:gid:1.1.209</ns3:ID>
</Tag>
</Observation>
</Sensor>

The Sensor element is the main interchange element for PML Core messaging. This element is a composite element comprised of the following subordinate elements:

* ID element
* one or more Observation elements

The Sensor element captures sensor information. A sensor is considered any device that makes measurements and observations. Sensors in the EPC Network are identified by an identifier code. The default identification scheme should be the EPC.

The ID element follows EPC as the default identification scheme to uniquely identify sensors and tags. The use of other identification scheme is supported, but is not encouraged. The EPC is represented as a URI as specified in [EPC] or later versions of this specification.

Each Observation element contains data that are the result of a measurement by a particular sensor. Each observation must be labeled with date and time. It can also be equipped with a unique ID, and a reference to the kind of command that was issued to make the observation. The Observation element consists of the following:

* an optional ID element
* an optional Command element
* DateTime element
* zero or more Data elements
* zero or more Tag elements

The DateTime element captures the date and time when the observation was made. It is based on the [XSD] data type. The Command element can be used to specify the command that was issued to trigger the observation. The Tag element is a special kind of observed value introduced with recognition of the importance of automatic identifications in the EPC network. The tag entity represents any device that can be detected by a sensor. The Tag element consists of the following elements:

* ID element
* optional Data element
* zero or more Sensor elements

All ID elements follow the EPC as the default identification scheme to uniquely identify sensors and tags.

urn:epc:id:gid:1.1.3 is the unique ID of the Reader and Antenna encoded in the GID EPC scheme. A reader can have a unique EPC for each associated antennae, or if the EPC for each antennae is not specified, all antennae will inherit the reader EPC. If the unique EPC for each Reader-antenna is mapped to the location of the antenna, it can be used to track the location of the tagged item as it is scanned by the antenna. urn:epc:id:gid:1.1.209 is the unique EPC number of the tagged item read by the RFID reader represented in GID URI format.

RFID Implementation Hurdles

Theoretically, automating product scanning should make RFID simpler to operate than bar-code technology. However, in many ways, the technology's increased capabilities make it more challenging.

The most basic challenge is managing data. Unlike bar-code technology, where information is scanned only when someone passes a printed label in front of a reader, RF scanning is always on. Consequently, RFID systems must filter data that is constantly streaming in. Additionally, these systems must contend with physical factors that may interfere with RFID's use of radio waves. Warehouses and plants that have electric motors and metal obstructions can have electromagnetic interference. Product materials?liquids or metals?may absorb or reflect RF signals.

As with supply chain integration, RFID technology has the potential to allow suppliers, customers, and other firms in the industry access to critical competitive information. However, with RFID it could be used to gather the information clandestinely because it is so anonymous.

The IDs on passive RFID cards can easily be stolen using a sniffer and a power source without the knowledge or consent of the ID's owner. One major problem with passive RFID systems is that the power source comes from the receiver, not from within the RFID tag itself. This makes the tags cheaper and more robust, but it also makes them vastly less secure. Unless the encryption is very good, the RFID unique identifiers can be duplicated.

Future
To date, only the EPC Tag Data Standards Version 1.1 is finalized. The term Savant is deprecated. Savant standards 1.0 are in the process of being replaced by specifications and standards focused on Event Manager, Reader Management, Reader Protocol, Filtering and Collection, and EPCIS.

References

[XSD] XML Schema Part 2: Datatypes W3C Recommendation, 02 May 2001 http://www.w3.org/TR/xmlschema-2/

[EPC] Michael Mealling and Ken Traub, The URI Representation of the Electronic Product Code and Related Types , Working Draft Version, 12 August 2003 EPC Global http://www.epcglobalinc.com

EPC Tag Data Standards Version 1.1 http://www.epcglobalinc.com/standards_technology/EPCTagDataSpecification11rev124.pdf

PML Core specification 1.0 http://www.epcglobalinc.com/standards_technology/Secure/v1.0/PML_Core_Specification_v1.0.pdf

Auto-ID Savant Specification 1.0 http://www.epcglobalinc.com/standards_technology/specifications.html

Auto-ID Reader Protocol Specification 1.0 http://www.epcglobalinc.com/standards_technology/specifications.html

Sun Java System RFID Software Product Documentation http://docs.sun.com/db/coll/RFID_04q3

EPC and RFID: Enabling the Next Level of Business Efficiencies http://wwws.sun.com/software/solutions/rfid/index.html

The Sun RFID Test Center http://wwws.sun.com/software/solutions/rfid/testcenter/index.html

The Sun" EPC Network Architecture http://wwws.sun.com/software/solutions/rfid/EPCNetArch_wp021304a.pdf

The RFID Journal http://www.rfidjournal.com/

Acknowledgements
The author would like to thank Ricardo Labiaga of the RFID engineering team at Sun for his input, help and guidance in writing this paper.

About the Authors

Alka Gupta is a member of the Technical Staff at Sun Microsystems. She's responsible for working with Sun's ISV's and partners to help them adopt the emerging Sun technologies and platforms quickly and efficiently. Alka has been in this industry for nearly 10 years. Alka graduated from the Indian Institute of Technology (IIT), India.

Mayank Srivastava is a Software Engineering Manager in Market Development Engineering, at Sun Microsystems. In this capacity, Mayank's group responsibilities include providing help to ISVs to adopt Sun's technology and systems.

星期六, 十月 09, 2004

如何在Java网络程序中动态使用Proxy Server?

如何在Java网络程序中动态使用Proxy Server?

方法一:

设置HTTP:

System.setProperty("http.proxyHost","proxy-server-ip");//代理服务器IP
System.setProperty("http.proxyPort","proxy-server-port");//代理服务器端口


设置HTTPS:

System.setProperty("https.proxyHost","proxy-server-ip");
System.setProperty("https.proxyPort","proxy-server-port");


Java应用程序命令行

java -Dhttp.proxyHost=proxy-server-ip -Dhttp.proxyPort=proxy-server-port filename
或者:
方法二:
System.getProperties().put( "proxySet", "true" );
System.getProperties().put( "proxyHost", "some_proxy" );
System.getProperties().put( "proxyPort", "8080" );
java -DproxySet=true -DproxyHost=some_proxy -DproxyPort=8080 SomeClass

Sun提供的基于Java的RSS功能包.

http://java.sun.com/developer/technicalArticles/javaserverpages/rss_utilities/

星期五, 十月 08, 2004

IE和FireFox 1.0 对Div align 对齐方式的差异

KeyWords:div,align.FireFox,Iexporer
IE 6.0 sp1和FireFox 1.0默认
对齐的方式刚好相反。
IE如果不显示指定对齐方式,是右对齐。而FireFox 1.0是左对齐。
:).
是指包含的内容对齐的方式.
所以如果有多个
嵌套,最好指明对齐方式.
通过style的float属性来指明.
如:
<div align="right" id="friendlist" style="float: right;border: 1px dotted #eeeeee;width:95%; z-index:3;overflow-y: scroll;">
这样就指明了div的边为一个象素的虚线宽度为空间的95%.