niyue

Archive for the ‘programming’ Category

Lucene in Action出版了

In javaotherprogramming on 1月 11, 2005 at 7:14 上午

http://www.lucenebook.com/

Lucene In Action At Amazon

by Erik Hatcher, Otis Gospodnetic

Lucene in Action

Lucene is a gem in the open-source world–a highly scalable, fast search engine. It delivers performance and is disarmingly easy to use. Lucene in Action is the authoritative guide to Lucene. It describes how to index your data, including types you definitely need to know such as MS Word, PDF, HTML, and XML. It introduces you to searching, sorting, filtering, and highlighting search results. Lucene powers search in surprising places–in discussion groups at Fortune 100 companies, in commercial issue trackers, in email search from Microsoft, in the Nutch web search engine (that scales to billions of pages). It is used by diverse companies including Akamai, Overture, Technorati, HotJobs, Epiphany, FedEx, Mayo Clinic, MIT, New Scientist Magazine, and many others. Adding search to your application can be easy. With many reusable examples and good advice on best practices, Lucene in Action shows you how.

What’s Inside

  • How to integrate Lucene into your applications
  • Ready-to-use framework for rich document handling
  • Case studies including Nutch, TheServerSide, jGuru, etc.
  • Lucene ports to Perl, Python, C#/.Net, and C++
  • Sorting, filtering, term vectors, multiple, and remote index searching
  • The new SpanQuery family, extending query parser, hit collecting
  • Performance testing and tuning
  • Lucene add-ons (hit highlighting, synonym lookup, and others)
  • Foreword by Doug Cutting, the inventor of Lucene

WHAT THE READERS SAY ABOUT THIS BOOK…

“I bought the Lucene in Action ebook, which is excellent and I can strongly recommend [it]. …Thanks to the authors for Lucene in Action, it’s given me the high level best practices I was needing.” — Steve S.

ABOUT THE AUTHORS…

A committer on the Ant, Lucene, and Tapestry open-source projects, Erik Hatcher is coauthor of Manning’s award-winning Java Development with Ant. Otis Gospodnetić is a Lucene committer, a member of Apache Jakarta Project Management Committee, and maintainer of the jGuru’s Lucene FAQ. Both authors have published numerous technical articles including several on Lucene.

© 2005 Erik Hatcher & Otis Gospodnetić
正是我想要的书,不知道要多久中国才会引进,期待中…Amazon上面很多好书中国都看不到,语义网方面的书籍,除了宋炜博士的一本《语义网简明教程》就再也没有了,而且这个还不算是外国出版的书。科技慢人一步和科技书籍慢人一步是有一定联系的!

Eclipse 3.0常用快捷键

In programmingsoftware on 1月 3, 2005 at 11:19 上午

快捷键

作用

Ctrl+Alt+R Resources
Ctrl+J 以增量方式查找字符串
Alt+Shift+W 视图
Alt+/ 代码补全+创建getter setter辅助
Ctrl+Shift+Space 方法参数提示
Ctrl+1 重命名+Surround
Alt+Shift+UpArrow 根据语法的方式快速选择 Java 代码
Ctrl+Shift+P 寻找匹配括号
/**+CR 智能Javadoc
Ctrl+O Outline
Ctrl+T 层次结构
Alt+Shift+O 标记文件中出现变量、方法的出现位置

可以Step-back的IDE

In programmingsoftware on 12月 30, 2004 at 12:50 上午

今天在看TheServerSide.Com的时候发现了这么一条新闻:

X-develop – a multi-language IDE supporting Java and .NET

本来也不是特别感兴趣,因为Visual Studio.NetEclipse已经都发展到极至了感觉,要再想超越这两个IDE实在是很困难,但是还是去X-develop的网站看了一下:

X-develop is a new multi-language cross-platform IDE from Omnicore. X-develop targets the .NET platform, the Mono platform and the Java platform. It offers advanced code analysis, project wide on-the-fly error checking, refactoring, smart editing, fast code navigation capabilities and other productivity-boosting features for C#, Java, J# and Visual Basic.NET. X-develop is available for Windows and Linux.

从介绍的幻灯片来看,这个IDE的功能还是很强大的,基本和高级的功能基本都涵盖了,但是我感觉还是没有强大到使开发者更换IDE的程度,因为其他的IDE也都有这些功能或者可以由插件得到.不过它的有一个feature倒是很令我有点吃惊,它的Java Debugger是可以step-back的,也即可以在调试的时候往回退运行程序!有点Word里面”撤销”的感觉,虽然没用过这个IDE,但是这点实在太巧妙了.Silde里面自称是industry-leading,一点也不为过.

Back-in-time Java Debugger
Our industry-leading back-in-time Java debugger allows you to step back through your code and investigate what exactly caused a problem.

用XML构建Java Appilication的UI

In javaprogramming on 12月 28, 2004 at 12:58 上午

1.2

SwiXml, is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that are parsed at runtime and rendered into javax.swing objects.

SwingML
Swing Markup Language

SwingML is an effort to create a markup language to render in a web browser JFC/Swing based graphical user interfaces.

http://blogger.org.cn/blog/:: JGOODIES :: Java User Interface Design

:: Java User Interface Design ::

We make Java look good and work well

JGoodies focuses on Java look, UI design and usability. We provide articles, libraries, example applications, desktop patterns and a Swing application architecture.

Jelly : Executable XML

Jelly is a tool for turning XML into executable code. So Jelly is a Java and XML based scripting and processing engine. Jelly can be used as a more flexible and powerful front end to Ant such as in the Maven project, as a testing framework such as JellyUnit , in an intergration or workflow system such as werkflow or as a page templating system inside engines like Cocoon .

Thinlet is a GUI toolkit, a single Java class, parses the hierarchy and properties of the GUI, handles user interaction, and calls business logic. Separates the graphic presentation (described in an XML file) and the application methods (written as Java code).

JDesktop Network Components (JDNC)

The goal of the JDesktop Network Components (JDNC) project is to significantly reduce the effort and expertise required to build rich, data-centric, Java desktop clients for J2EE-based network services. These clients are representative of what enterprise developers typically build, such as SQL database frontends, forms-based workflow, data visualization applications, and the like.

JDNC leverages the power of J2SE and Swing while providing a higher level API, as well as an optional XML markup language, which enables common user-interface functionality to be constructed more quickly, without requiring extensive Swing or GUI programming skill. Additionally, JDNC simplifies the task of connecting a rich client to a J2EE backend, including JDBC and WebServices.

新的XML合并标准XInclude发布

In programming on 12月 23, 2004 at 12:14 上午

W3C于周一正式推荐可以取代目前过程复杂的XML文档联合工作的新标准XML Inclusions 1.0,简称XInclude。

W3C组织结构领域的领导人Phillippe Le Hegaret说,”Inclusion具有内容重用的功能,可以让我把类似版权声明的东西包含在公司的所有XML文档中。否则你只能做复制粘贴的工作,而粘贴之后也只是引用一下而已。”

XML开发人员们用来合并XML文档的方法还有更多更笨重的。最常用的一种方法是依靠文档类型定义(DTD),也就是通过服务器端的指令来解析XML文档,决定各元素之间的关系。

现在W3C正努力使XML远离DTD。2001年,W3C就开始推荐Schema来代替DTD,并使它在许多其它标准中占据了主导地位,比如SOAP 1.2和WSDL。如果XInclude能得到广泛的接受,DTD的废弃进程又进了一步。

“Schema终究会代替DTD的。”Le Hegaret说,“加上这次的标准,我们对DTD的依赖会越来越少。”

W3C XML核心工作小组主持了周一的发布。XInclude的主要制作人员包括微软的Jonathan Marsh,和BEA的David Orchard。

XML Inclusions (XInclude) Version 1.0

Firefox与IE,浏览器有什么不一样?

In programming on 12月 21, 2004 at 2:40 上午

以前一直没有觉得各个浏览器之间到底有什么不同,好像也就是有些什么快捷键或者插件不一样罢了,感觉都不是很大的差别。最近在看一些XSLT方面的东西,深入了一段时间以后终于想通了原来浏览器间有一个很关键的不同在于对W3的标准支持程度不同,应该说支持实现的标准越多,这个浏览器就越强大,至于其他的什么附加功能似乎都不是重点。在研究XSLT的这段时间里,接触了various的标准,很多都不知道是作什么用的到底。原来一直以为微软特立独行很多都是用自己的标准,而Firefox则唯W3马首是瞻,现在才发现原来恰好相反,微软反而支持更多的标准。同时这些标准实在是很多,根本没有浏览器全部支持的,即便是IE也才开了个小头,标准的制定速度似乎比标准的实现速度要快上很多,比如XInclude标准IE就没有实现,而Firefox甚至连XSL支持度都不高,sigh,要赶上IE,路漫漫其修远兮。

CSDN上面看到的一段评论,感觉很合胃口:

呵呵,我也主要使用firefox,但并不是因为它的技术有多么先进,而是因为它确实比较安全,不用太担心什么恶意脚本之类的东西。但我对一些人动不动就以标准说话很不以为然。为此我专门对IE与Firefox作了对W3C标准支持的对比。事实是IE对标准支持的数量远多于firefox。CSS1,CSS2除了个别关键字都给予了支持,而IE不支持的关键字FireFox也同样不支持。对XHTML的支持FireFox支持的多好IE就有多好。对XML+XSLT的支持IE比FireFox好的多。smil就更不用说了Firefox根本就不支持,IE却几乎完整的进行了实现。对DOM的支持IE也好于FireFox。

所以从对标准支持的数量上IE远好于FireFox,事实上相当多的标准制定都有Microsoft的参加,而Mozilla基金的参予却少的可怜。当然从质量上讲IE对CSS的一些关键字的实现上存在BUG,比如臭名昭著的3像素问题,也及对float的不同解释。但同样FireFox也有一些类似的问题。

对于私有技术就不用说了,VML,IE滤镜都极大的丰富了Web设计的手段。综合考虑IE在技术上要好于FireFox。但由于微软似乎不再打算发展独立的浏览器,所以IE的前途似乎不太好,但微软的动作谁又说的准呢?以IE目前的技术与市场优势,实在看不出被Firefox击败的理由。

XSLT技巧–绘制分形图

In programming on 12月 16, 2004 at 4:48 下午

使用IE 6.0(Firefox还不完全支持XSLT可惜 : < )浏览fractal.xml,就能够看到漂亮的分形图。fractal.xml

<?xml version=”1.0″?>
<?xml-stylesheet type=”text/xsl” xhref=”http://blogger.org.cn/blog/fractal.xsl&#8221; mce_href=”http://blogger.org.cn/blog/fractal.xsl&#8221;?>
<fractal depth=”6″ color=”orange” size=”3″/>

fractal.xsl

<?xml version=”1.0″?>
<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform“>

<xsl:template match=”fractal”>
<xsl:param name=”depth” select=”@depth”/>
<table border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td>
<xsl:call-template name=”iterate”>
<xsl:with-param name=”depth” select=”$depth”/>
</xsl:call-template>
</td>
</tr>
<tr>
<td>
<xsl:call-template name=”iterate”>
<xsl:with-param name=”depth” select=”$depth”/>
</xsl:call-template>
</td>
<td>
<xsl:call-template name=”iterate”>
<xsl:with-param name=”depth” select=”$depth”/>
</xsl:call-template>
</td>
</tr>
</table>
</xsl:template>

<xsl:template name=”iterate”>
<xsl:param name=”depth”/>
<xsl:choose>
<xsl:when test=”$depth > 0″>
<xsl:apply-templates select=”.”>
<xsl:with-param name=”depth” select=”$depth+(-1)”/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<table cellpadding=”0″ cellspacing=”0″ border=”0″ height=”{@size}” width=”http://blogger.org.cn/blog/{@size}”>
<tr><td bgcolor=”http://blogger.org.cn/blog/

{@color}”></td></tr>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

why XML?

In programming on 12月 16, 2004 at 4:36 下午

看到了论坛中的一个帖子,为什么要用XML呢到底?看到了回答满吃惊的,不过确实也赞同这种说法。

我曾经回答一个朋友提出的问题:如果不用xml我会损失什么。我回答说:你损失的仅仅是“格式标准的广认受性”。
至少在目前,xml数据的处理效率是远不及老式的数据存储和处理技术的。推动xm标准发展的主要原动力是数据交换标准化的需求。
至于
1。作为数据岛,就是一个极好的应用。
2。XML跟XSLT合作,可以让数据跟UI分离。
都不是非xml不可的,他们的出现只是因为有了xml。

而 批量数据传输。。。则更加不是xml数据的优势,xml是一种很耗费存储空间的数据格式。

看看现在主流的xml应用,如果不是为了信息交换标准化的原因,就没有必要使用xml了。

我做了六年xml开发,我喜欢他也仅仅是它具有“格式标准的广认受性”。

A Brief History of Computing- Complete Timeline

In otherprogramming on 12月 16, 2004 at 5:05 上午

A Brief History of Computing
– Complete Timeline

© Copyright 1996-2004, Stephen White

XSL Processors

In programming on 12月 5, 2004 at 4:05 上午

DocBook XSL:The Complete Guide

Chapter 2. XSL processors

An XSL processor is the software that converts an XML file into formatted output. There is a growing list of XSL processors to choose from. Each tool implements parts or all of the XSL standard, which actually has several components:

The XSL Standards

Extensible Stylesheet Language (XSL)
A language for expressing stylesheets written in XML. It includes the XSL formatting objects (XSL-FO) language, but refers to separate documents for the transformation language and the path language.

XSL Transformation (XSLT)
The part of XSL for transforming XML documents into other XML documents, HTML, or text. It can be used to rearrange the content and generate new content.

XML Path Language (XPath)
A language for addressing parts of an XML document. It is used to find the parts of your document to apply different styles to. All XSL processors use this component.

To publish HTML from your XML documents, you just need an XSLT processor. It will include the XPath language since that is used extensively in XSLT. To get to print, you need an XSLT processor to produce an intermediate formatting objects (FO) file, and then you need an XSL-FO processor to produce PostScript or PDF output from the FO file. A diagram of the DocBook Publishing Model is available if you want to see how all the components flow together.

XSLT processors

Currently there are three processors that are widely used for XSLT processing because they most closely conform to the XSLT specification:

Saxon
Saxon was written by Michael Kay, the author of XSLT Reference, one of the best books on XSLT. Saxon is a free processor written in Java, so it can be run on any operating system with a modern Java interpreter. It uses the Aelfred XML parser internally, which has some bugs, so many people substitute the Xerces parser.

Xalan
Xalan is part of the Apache XML Project. It has versions written in both Java and C++, both of them free. The Java version is described in this book because it is highly portable and more fully developed. Generally Xalan is used with the Xerces XML parser (Java or C++), also available from the Apache XML Project.

xsltproc
The xsltproc processor is written in C by Daniel Veillard. It is free, as part of the open source libxml2 library from the Gnome development project. It is considered the fastest of the processors, and is highly conformant to the specification. It is much faster than either of the Java processors. It also processes basic XIncludes.

There are a few other XSLT processors that should also be mentioned:

XT
James Clark’s XT was the first useful XSLT engine, and it is still in wide use. It is written in Java, so it runs on many platforms, and it is free. XT comes with James Clark’s nonvalidating parser XP, but you can substitute a different Java parser.

MSXML
Microsoft’s MSXML engine includes an XSLT processor. It is reported to be fast, but only runs on Windows.

Sablotron
Sablotron, written in C++, from Ginger Alliance.

4XSLT
4XSLT, written in Python, from FourThought LLC.