Category Archives: IT

Large scale application development and MVP

Building any large scale application has its hurdles, and GWT apps are no exception. Multiple developers working simultaneously on the same code base, while maintaining legacy features and functionality, can quickly turn into messy code. To help sort things out … Continue reading

Share
Posted in IT | Leave a comment

GWT Development with Activities and Places

GWT 2.1 introduced a built-in framework for browser history management. The Activities and Places framework allows you to create bookmarkable URLs within your application, thus allowing the browser’s back button and bookmarks to work as users expect. It builds on … Continue reading

Share
Posted in IT | Leave a comment

股价提醒网站www.stock-reminder.com

使用Google App Engine平台做了个网站www.stock-reminder.com,功能就是服务器轮询当前股价,越过警戒就会向手机邮箱发送邮件,前台还有个web界面做配置。通过这个网站学到了不少新东西。 首先是学会了java语言,我会用的编程语言现在包括了C、C++、C#、Delphi、VB、php,现在又加上java,当前的主流语言都碰了。Java让用多了C风格语言的我感觉很怪异,它没什么阻塞的操作,使用addListener添加监听,程序里面有很多new出来的Listener。 其次就是GWT,我还使用了EXT-GWT,通过强语言编写网页比用HTML写网页感觉容易一些,用HTML写的话会很快迷失在一大堆HTML标签里面,还有CSS和布局,有时候元素直接差几个像素就是去不掉,我毕竟不是专业写网页的。通过GWT直接使用Layout布局(当然最后还是会编译成HTML和javascript),还用了EXT-GWT的MVC模式,感觉很不错,准备用GWT的MVP模式重构一下。 还有就是GAE提供DataStore,任务队列,用作服务器端的保存配置和轮询股价,发邮件则是我自己写的一个API调用我的空间上的一个mail程序,GAE的发邮件配额每天只有100封。 Java程序感觉对设计模式要求很高,这个网站的结构我不大满意调整了好几次,感觉还是有可以优化的地方。

Share
Posted in IT | Leave a comment

GWT工程运行出错

    创建一个使用AppEngine的GWT工程,出现如下错误: Exception in thread “main” java.lang.NoSuchMethodError: org.mortbay.thread.Timeout.<init>(Ljava/lang/Object;)V    at org.mortbay.io.nio.SelectorManager$SelectSet.<init>(SelectorManager.java:306)    at org.mortbay.io.nio.SelectorManager.doStart(SelectorManager.java:223)    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)    at org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:303)    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)    at org.mortbay.jetty.Server.doStart(Server.java:233)    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:667)    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:500)    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1055)    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:804)    at com.google.gwt.dev.DevMode.main(DevMode.java:309) 解决方法:在项目的build path里面,把GWT SDK移到App Engine SDK前面。

Share
Posted in IT | Leave a comment

函数返回值为QObject派生类对象时的注意事项

     在C语言中函数的返回值可以是结构体,而不仅仅是简单的数据类型。C语言内部实现了结构体的复制,C++中还可以返回对象,C++也实现了对象默认的拷贝函数和赋值函数。今天写一个函数,其返回值是一个QObject派生类的对象,却频频出错。好像是QObject派生的一些私有成员不能复制,因此要自己实现拷贝函数和赋值函数。 class A:public QObject { Q_OBJECT public: A(QOjbect *parent=0); A(const A &a);//拷贝函数 A & operator=(const A &a);//复制函数 int set(int) const; }      因为A前有修饰符const,所以只能使用A中用const修饰的函数,就像其中定义的set函数。

Share
Posted in IT | Leave a comment

a Course of Regular Express

Sometimes I use regular express to parse html,but I don’t know it very well.Now I have found a course of it and leave it here.The original link is http://unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm 正则表达式30分钟入门教程 版本:v2.3 (2008-4-13) 作者:deerchao 转载请注明来源 目录 跳过目录 本文目标 如何使用本教程 正则表达式到底是什么东西? 入门 … Continue reading

Share
Posted in IT | Leave a comment

Add a Class to SQLite Database

Those days I am programming to store settings in sqlite database. I am define every setting to a class, But it is not easy to write every funciton to add every new setting to database.So I use generics type to … Continue reading

Share
Posted in IT | 1 Comment

How to Reflect DataRow to Modal

If make a query from database,we need to use DataSet at first to fill the result,then write funtion like Row2XXX to convert it to a data struct.It will be a crazy job when you query many tables in database.Now I … Continue reading

Share
Posted in IT | Leave a comment

Event of IE6 closing

I am working on a .net component which is invoked by IE these days.If the component doesn’t logout before closing browser it will make some mistakes.So I have to log out when IE is closing.Now I have found a piece … Continue reading

Share
Posted in IT | Tagged , | 4 Comments