序列化:

1ObjectOutputStream oos = new ObjectOutputStream(new java.util.zip.GZIPOutputStream(
2                        new FileOutputStream(outputFile)));
3            oos.writeObject(obj);
4            oos.close();

反序列化:

1ObjectInputStream ois = new ObjectInputStream(new java.util.zip.GZIPInputStream(
2                        new FileInputStream(userFile)));
3            Object obj = ois.readObject();
4            ois.close();
posted @ 2005-06-23 18:39 罗明 阅读(769) | 评论 (0)编辑 收藏
 

一直都在做综合设计,由于项目采用了Eclipse RCP,而且我以前也没有接触过Eclipse Plugin和RCP,只是学过一点SWT和看过几个RCP的例子,所以现在做起来比较“郁闷”,一边是快乐地学习未来最热门的新技术(希望是哦),一边是为时不时蹦出的错误而不知所措,而苦恼。

最可恶的是还要按部就班的写文档,本来在纸上已经画好了用户界面,但为了付诸文档还必须在Visio里画一遍。还有一些东西不知道怎么填,本来想删掉一些的,明明知道老师不会去翻那些文档,但还是没敢那样做。

Contributing to Eclipse看到了第6章,但是一直没有时间写心得,可能是心里还感觉写Blog是一种浪费时间的东东吧,这样子可不好,我得多练练。

刚刚画完时序图,e的不行了,趁这个时间写篇Blog,放松一下,理理头绪,待会还得继续写数据库的设计流程呢。

突然有个体会:好吧,让暴风雨来得更猛烈些吧!

Go on, be a tiger!

 

posted @ 2005-06-22 15:49 罗明 阅读(133) | 评论 (0)编辑 收藏
 
ttttt在我的回复中说的:

我发现,好像是firefox好使,ie不好使,
大家都用firefox上吧!~~~~~

Go on,be a tiger.

posted @ 2005-06-21 10:12 罗明 阅读(141) | 评论 (0)编辑 收藏
 
都做什么去了,Robaggio也不来了,pat
posted @ 2005-06-21 10:07 罗明 阅读(114) | 评论 (0)编辑 收藏
 

真希望快一点得到结果,对自己对家人也得有个交代啊。

不知道过去那边是做什么,我希望别做外包,多做一点项目。而且希望是Java的,呵呵

既锻炼实战能力,又有很多Money,何乐而不为呢。

不过现在想还有点早,呵呵

posted @ 2005-06-19 18:21 罗明 阅读(141) | 评论 (0)编辑 收藏
 

粗略看了一下回复页面的源码和相关的JS文件(通过查看源文件看的,我现在还没搞到asp源码呢),感觉有两个地方比较可疑,一个是validatePage变量(具体名字忘了,大概就是这个意思),还有一个validateFeedback,都在一个JS文件中。根据代码逻辑,只要它们两个当中有一个为false,我们写的回复就不能贴上去。

是不是变量的值弄错了或者页面和回复不符合标准

btw:出事那天我写了一篇《这样可以使用户不能关闭IE吗? 》,发布之后我上了一下QQ,等我再看Blog的时候,ttttt已经在那篇文章上留言了,

# re: 这样可以使用户不能关闭IE吗? Remove Comment 1478
js吧,有个什么onClose事件好像
                                                                                                                                       6/12/2005 8:49 PM | ttttt


当我写好了我的回复准备提交时,submit按钮就不好使了,没有反应。
所以accident应该就是这个时间段发生的,但不知道ttttt是谁?可以问一下那天是怎么操作的,呵呵。

不能回复确是一件不爽的事啊。

posted @ 2005-06-19 18:12 罗明 阅读(169) | 评论 (1)编辑 收藏
 

1) Improve your math skill.
2) Improve your English skill.
3) Improve your computer science skill.
4) Improve your communication skill.
5) Remove BS from your vocabulary, learn from everyone, as long as they have one thing stronger than you.
6) Try define every vague term you're using precisely.
7) Do not stop at surface, think deeper, dig deeper.
8) Do not stop at surface, think higher, look at bigger picture.
9) Be the best at your current job, learn something new, and then try to get a better job.
10) Help people less experienced than you.
11) Believe you can be expert too, reward yourself for your progress, even if it's small.
12) Do something grand with your life, realize your childhood dream.
13) Enjoy life.
14) Pass it to your kids.

posted @ 2005-06-17 23:04 罗明 阅读(161) | 评论 (0)编辑 收藏
 

为了打好做Plugin的基础,今天特地借了本《Contributing to Eclipse》,其实应该是买一本的,这本书这么经典。听说这本书是从Eclipse的内部构架来讲的,对于快速入门Plugin的开发可能不是特别合适,但没有发现书店有别的关于SWT或Plugin的书,555

好了,开始切入正题,Go Go Go

《Contributing to Eclipse》分为四个循环,第一个循环是第零个循环(hahaha)。

第零个循环介绍了Eclipse的基础架构,然后通过编写一个最简单的HelloWorld Plugin带我们走进Contributing的大门。

先说说这里列出的比较重要的概念:
Eclipse分为三层:Platform、JDT、PDE。其中PDE是对JDT的扩展,提供了插件开发支持。

Platform又分为两层:Core(Workspace、Runtime)、UI(Workbench、JFace、SWT)。
下面分别介绍一下:
Runtime --- 定义了插件的基础设施。启动时发现所有可用插件并管理插件的加载。
Workspace --- 管理一个或多个顶级项目。
SWT(Standard Widget Toolkit)--- 提供图形显示功能,定义了一组标准窗体组件。
JFace --- 建立在SWT上的一组比较小的UI框架,提供对常用UI任务的支持。
Workbench --- Eclipse的UI聚合体,核心要素是编辑器、视图(View)和视角(Perspective)。
其中视角(Perspective)定义了各工作台部件的可视化排列方式。

All Right. That's how you get it.
Go on, be a tiger.

posted @ 2005-06-17 22:53 罗明 阅读(1873) | 评论 (4)编辑 收藏
 
SWT里的Right to Left Style,将Menu设为SWT.RIGHT_TO_LEFT就可以了,以前没看到过这种效果,不知道别的语言可不可以这样。
倒窗口.JPG
posted @ 2005-06-17 08:20 罗明 阅读(627) | 评论 (2)编辑 收藏
 

刚才看了Examples里的Web Browser实例,感觉特别像一个Rss Reader里的简易浏览器。

上software.hit.edu.cn看Flash没有问题,打开一个Word文档也OK,应该是内嵌了IE吧。

看了代码也只发现一个setLocation(URL),没有跟本地系统联系的代码,难道SWT里的Browser本身就内嵌了IE。

以前也听说过SWT是不用虚拟机的(是吗?),都是调用本地的dll,只是现在亲眼目睹了。

这不有点像AWT吗?!

posted @ 2005-06-17 04:30 罗明 阅读(385) | 评论 (0)编辑 收藏
 

这就是定制的Controls?有什么特别的地方吗?我好像也没看出来

CCombo就是一个ComboBox,不过可以设为Flat,这样比较酷。

CLabel有一个Shadow相关的属性,可以设置IN或OUT(就是突出或凹进,这是Label啊!搞得这么花哨)。

CTabFolder在视觉上有些改进,也是Flat Style,看着看着就忍不住想碰一下。当Size缩小时,CTabItem可以隐藏起来,在右上方显示一个下拉双箭头,还显示了隐藏的Item数目,应该就是Eclipse里的那种风格了。
CTabFolder.JPG

StyledText,顾名思义。比较特别的:可以将句子Strikeout,就是在选择的句子上划一条“删除线”。

TableTree跟上节Controls里讲的Tree差不多。有一个SWT.FULL_SELECTION Style不知道有什么用

例子看完了,休息...休息一下。

posted @ 2005-06-17 04:01 罗明 阅读(419) | 评论 (0)编辑 收藏
 
我们来看一下Swt Controls,所有的控件应该都在这里了。
首先是Button,里面的TOGGLE(按下不弹起)、FLAT(平平的,跟DotNet里的Flat Style差不多)和ARROW(一个方向箭头,可以指定方向)挺好玩的,组合一下会有多重效果(用 | 来组合,如SWT.ARROW | SWT.FLAT | SWT.PUSH)。

再看看Canvas(画布),SWT.NO_REDRAW_RESIZE属性设置resize时画布不重画,想起了小田老师的实验1,呵呵。Caret显示一个光标,不知道是干什么用的。还有一个Fill Damaged Area With Color,看源代码也没弄懂,不就是画几个五颜六色的Rectangle吗,要单独列出来吗?

第三是ComboBox,Style是SWT.DROP_DOWN时是下拉列表,SWT.SIMPLE是将所有选项都平铺在板子上的ComboBox。

CoolBar也是工具栏咯,只不过比一般的ToolBar漂亮(SWT里还有ToolBar)不知道Item Styles中的SWT.DROP_DOWN有什么用,好像只对Toggle Item起作用。工具栏里可以放Text了。(后补 -> 发现DROP_DOWN的功能了:Item被隐藏时显示一个扩展箭头。刚才说的Toggle Item其实是Radio)

Dialog有四个Model Style:SWT.MODELESS、SWT.PRIMARY_MODAL、SWT.APPLICATION_MODAL、SWT.SYSTEM_MODAL(不知道PRIMARY_MODAL是做什么用的)

ToolBar里可以加入ComboBox

Tree可以有Multiple Columns和Header。甚至还能显示行列,简直就是Tree和Table的结晶。

例子看完了,休息...休息一下。
posted @ 2005-06-17 03:20 罗明 阅读(730) | 评论 (0)编辑 收藏
 

假如不考研的话,我就要在这一段时间多弄弄技术了,决定学学Eclipse的plugin和RCP,于是首先得学SWT。

上次看了几篇中文的paper,知道了SWT的基本应用,现在该动动手了(尽管我向来都提倡君子动口不动手的,呵呵),当然是首先看看swt都能干什么啦,最好的下手之处就是swt examples。

运行环境就是Eclipse啦,我的Eclipse本来不打算换的,我已经装了RC1(那天下RC2也是一位朋友要用,我的电脑上从3.0.1到3.1RC2都有,pat),但听说RC2超级快,所以也解压缩试一下。说了这么多废话,真有点对不起观众,555

现在看看怎么运行SWT Examples,我们启动Eclipse,从Help的Welcome里选择Samples,单击SWT下面的红圆圈,链接到download examples(我在Update里设了代理,速度马马虎虎),自动安装完examples后,单击OutLine里的run examples,不要害怕,这时会弹出一个Eclipse的启动画面,不要认为哪里做错了,对,这就是Examples的Laucher。在Laucher打开的workbench里选择Window->Show View->Other,选择Swt Examples里的例子。现在可以慢慢看了。

posted @ 2005-06-17 01:39 罗明 阅读(455) | 评论 (0)编辑 收藏
 
rt~
posted @ 2005-06-16 23:27 罗明 阅读(160) | 评论 (0)编辑 收藏
 

An even faster way to get up and running with WebLogic Platform 8.1

BEA, VMware and Red Hat have partnered to provide a single, easy to install package that gives you everything you need to be quickly up and running with BEA WebLogic Platform 8.1 on Red Hat Enterprise Linux.

The VMware image provided here can be installed on your VMware Workstation, which may be running on a Linux or Microsoft Windows box. After installing the image, you will have a fully operational WebLogic Platform 8.1 system running on a virtual Red Hat Enteprise Linux. No fuss, no additional installation necessary.

source: http://dev2dev.bea.com/wlplatform/vmware/

posted @ 2005-06-16 03:56 罗明 阅读(302) | 评论 (0)编辑 收藏
 

我们在IE里编辑blog时,如果按下关闭按钮,会弹出一个确认对话框,点“取消”之后IE不会关闭。

这是不是能实现rt功能?是什么促使对话框的弹出,是JS还是内嵌的word或其他?

以前有人问过怎么避免用户误关闭IE,当时觉得不可能实现(那不成病毒网页了吗?),现在发现好像还是可以的,山外有山啊!!!

得出一个道理: 多接触一点东西,趁现在年轻

posted @ 2005-06-13 04:45 罗明 阅读(346) | 评论 (0)编辑 收藏
 
我还纳闷baggio的图片是怎么弄上去的呢,一直都忘记问了。
posted @ 2005-06-12 20:48 罗明 阅读(145) | 评论 (0)编辑 收藏
 

今天看一个Rails on Ruby的视频时,那位高手在一个文件夹上单击右键(具体是rails文件夹,),在弹出的菜单上单击Open Command Window Here(诸位的菜单上有吗?),随即打开的cmd进入了选中的文件夹,这可是一个创新啊,再不用copy + paste了。所以我决定做一个,用百度搜了一篇添加windows右键菜单的文章,照着做了一下,后来又参考了Far(一个类似rar的压缩工具,目前在我的右键菜单上寄居,当时装着玩的)的command知道了“选择目录”的参数:%1 。于是一个类似Open Command Window Here的功能实现了

具体步骤:regedit -> HKEY_CLASSES_ROOT -> Folder -> shell -> 新建/项:Open in cmd -> 在Open in cmd上新建/项:Command -> 设置Command的默认值为:C:\WINDOWS\system32\cmd.exe %1

呵呵,大功告成

posted @ 2005-06-10 17:12 罗明 阅读(1654) | 评论 (6)编辑 收藏
 

Yesterday, Steve Jobs proudly announced the 3rd major transition in Apple's history. After the move from the 68000 family to the PowerPC and after the move from MacOS 9 to beloved MacOS X, Apple will move from PowerPC to Intel x86 family. And Steve Jobs confirmed the rumors: Apple compiled and built all its applications and releases of MacOS X for x86. "Just in case" said Jobs.

Why does it has to do with Java anyway? Well moving from one CPU architecture to another will demand a lot of work from the Mac community. Sure it won't be as hard as moving from MacOS 9 to MacOS X, but still, it's huge. As usual, Apple takes care of easing the pain: Xcode 2.1 can generate PowerPC and x86 binaries. Best, you can generate them in one single universal (or "fat") executable. MacOS X will also be shipped with Rosetta (Steve Jobs maybe want to be seen as the Champollion of IT), a runtime library to run PowerPC binaries on x86.

Despite these (wonderful) tools, nothing will be as easy as porting your Java apps from MacOS X PPC to MacOS X x86. You'll just have nothing to do. Jobs even emphasized this point when, speaking about the amount of work required to port existing applications to x86, he explained that neither Dashboard Widgets nor Java apps will need the slighest change. Unfortunately he deceived us. Some Dashboard Widgets will need a bit of work, at least a new build.

That's why we are the winners in this transition. We can rejoice to get a user friendly, stable and elegant OS on our well known x86 hardware and still enjoy our favorite development platform without bothering a minute about it.

If you needed a proof of the advantage of hardware decoupled bytecode, you got it right in front of you my friends. We live interesting times and I'm glad I'm not talking about server side or mobile stuff.

P.S: This is one more reason to check out the Quaqua Look and Feel and to contribute. As WinLAF, this look and feel aims to fix the glitches and minor bugs in comparison to the native look and feel.

Source: http://weblogs.java.net/blog/gfx/archive/2005/06/apple_moves_to.html

posted @ 2005-06-08 12:25 罗明 阅读(222) | 评论 (0)编辑 收藏
 
垂直:jScrollPane.getVerticalScrollBar().setValue(jScrollPane.getVerticalScrollBar().getMaximum());

水平方向类似!
posted @ 2005-06-07 21:00 罗明 阅读(423) | 评论 (0)编辑 收藏
仅列出标题
共14页: First 上一页 6 7 8 9 10 11 12 13 14 下一页