Thursday, January 17, 2008

Generate Ajax J2EE Web applications with jpa2web

What is jpa2web?

Readily available tools like Hibernate (see Resources) have dramatically reduced the impedance created between Java objects and their database storage; specially, the ease with which Java classes can now be annotated to specify the way objects should be persisted. Developers are freed from the onerous task of writing up database integration codes. Hibernate solves the persistence issue; however, Web pages need to be created to handle these elements. A typical scenario for a medium-sized Web application can proceed something like this: The developer starts by coding the Plain Old Java Objects (POJOs) that represent a particular domain model, and then proceeds to create the different transactions and the Web user interface. A subset of the elements of the model will frequently involve non-transactional data. Customers, clients, countries, locations, employees, and companies are typical elements of a business model that are maintained by a few operators.

Why not generate the Web presentation layer to create, add, list, delete, and search these elements from the annotated beans? And why not make this presentation a friendly Ajax experience? These are the main goals of the jpa2web tool, which has the following process flow:

* Input: POJO-annotated beans (and optional templates).
* Output: An Ajax Web application to handle and persist the elements of the model.
* Technologies used: FreeMarker + ZK + Hibernate (see Resources for links to more information on these technologies).

Wednesday, January 16, 2008

失之毫厘,差之千里

失之毫厘,差之千里啊
因为自己一不小心,在头文件里的一个函数声明时落了一个分号,造成:
error C2085: 'NCCancelLogin' : not in formal parameter list和一大堆的乱七八糟的错误信息。
而且错误信息距离事发之地太远。花了偶三个多小时来查找错误,汗.......
贴在这里,免得以后忘记了。"

Monday, January 14, 2008

你还在一页打六张吗?PPT打印技巧

ppt文档有几种打印格式?一种还是两种?

至少是4种-不要和我争,否则我和你讲排列组合最深奥的内容。

ppt不像word文档打印那么简单。它一页没有多少内容。
如果把一个幻灯片打印在一页A4纸上,那么一份普通的ppt文档打印出来,
少则100页,多则几百页,浪费纸不说,自己写道阅读也不方便。

所以,一般都是把几个幻灯片打印在一页上。

这里有个基本概念:幻灯片模式和讲义模式。
在打印预览页里,“打印内容”那里可以选择你要打印的是幻灯片还是讲义。
按照幻灯片打印,则一页只能打印一个幻灯片。
按照讲义,则一页可以选择的打印1,2,3,4,6,9个幻灯片。
即使是一个幻灯片和一个讲义,打印出来也不一样:幻灯片要比讲义大一些。

那么是不是说我们应该选择一页打印9个幻灯片了?
这是我以前常用的打印方式。这样能节省不少纸张。
只是打印出来的效果不是很理想。
有时一页字数太多,单个字就显得太小,看得很吃力。
各个幻灯片之间的间距很大,你不用想都知道,还有更好的方式。

现在教你这种更好的打印方式。
--------
我是付出沉重的代价才学到的,而你只需看懂就可以了。
--------

打开菜单:

文件->打印->属性->布局

等等,你说没有找到“布局”?
你用的是什么型号的打印机啊?...
你该考虑换一个打印机试试.....

继续说
在“每张页数”中选择9个或者16个。
是否打印边框,那就随你的爱好了。
“方向”一般用横向,因为ppt一般是横向的

确定后,再看看“打印”对话框。
确定“打印内容”不是“讲义”,前面说过,幻灯片模式比讲义模式大。
如果错误的选择成打印“讲义”,那就亏大了。
如果你更是愚蠢到“每页幻灯片数”选择成9的话,
那只好恭喜你,又多了一堆草稿纸了。

正确的方法是:
打印内容选择成“幻灯片”,每页幻灯片数是1(当然,你不能选择的)

还有,“打印范围”指的是ppt的幻灯片数,而不是纸张数。
如果你只想打印第一张,前9个,则填写“1-9”
先打印一页,预览一下效果是很必要的。
浪费一张,比浪费几十张好吧。