番茄鸡蛋面

一台电脑,一碗番茄鸡蛋面,伴我前行!
随笔 - 40, 文章 - 0, 评论 - 44, 引用 - 1
数据加载中……

2005年10月12日

VS .NET add web reference

wsdl 新手问题:

用vs.net 2003添加web reference,我在被引用wsdl里面定义的namespace在vs声成的wsdl里面都会被替换成tns.
怎么保证vs生成的wsdl能用我原来的namespace?

谢谢!

posted @ 2005-10-12 16:19 番茄鸡蛋面 阅读(487) | 评论 (1)编辑

2005年3月31日

Dynamic Link Library DLL

The following article helps me a lot to understand DLL.

http://www.mindcracker.com/mindcracker/c_cafe/dll/dll_tut1l.asp

I have distributed this tutorial in three parts. First part will explain basics of MFC Dlls.
Second and third part will guide you towards developing your Regular and Extension DLLs.
What is a DLL?

DLL stands for Dynamic Link Library.
A dll is a binary file which contains some functions. It allows another process to call its functions.
More than one processes can call a dll simultaneously.

MFC support two types of dlls. Extension dlls and regular dlls. Each has its advantages and disadvantages.

Advantages of DLLs:

Dlls provide modularity to your application. You can break your big program into small modules, write some common functions in a separate module and compile it as a dll. Let all other modules call this dll.
For example, A database application has three modules Input, Output, Processing.
All three modules need to access a database. You can make a dll with database functions and let all three module call the dll to access the database.
If you need to add more functions, you can add those functions to the dll.
You don't have to change the entire application.
Since multiple processes can share a dll in memory so dll saves memory, disk space and execution time because of swapping. 

Extension DLLs

Extension DLLs implements reusable classes from MFC classes. They can export entire class. Client applications can create objects of that class and call its functions.

An MFC extension DLL has the following features and requirements:

The must implement DllMain and initialization can be done here.
Extension DLLs should be compiled with _AFXEXT defined. You need to add AFX_EXT_CLASS in dll's class.
MFC applications with _AFXDLL defined can only use Extension dlls. 
Extension DLLs should not instantiate a class derived from CWinApp, but should rely on the client application (or DLL) to provide this object.
See part III of this tutorial for how to develop and use extension dlls and more details.

Regular DLLs

If you need a DLL that can be used by Win32 or MFC applications then you need to create Regular dlls. Regular dlls can only export a C function. They can't export a class or its members as Extension dlls do.

You can link MFC library in two ways to the regular dlls. Either dynamically linked or statically liked. In static linking, your dll will include MFC library copy inside your code. Static linking make your dll size bigger. In dynamic linking, you dll doesn't copy MFC code but then you have to ship MFC with your dll.

See part II of this tutorial for how to develop and use regular dlls.

Dynamic Linking Vs. Static Linking

Dynamic linking allows an exe or dll to use required information at run time to call a DLL function. In static linking, the linker gets all the referenced functions from the static link library and places it with your code into your executable. Using DLLs instead of static link libraries makes the size of the executable file smaller. Dynamic linking is faster than static linking.

What kind of DLL you want?

This table show what kind of dll is your requirement.

DLL Requirements  Clients  DLL Selection 
DLL does not use MFC  --  non-MFC Win32 DLL 
DLL will use MFC Clients may or may not be MFC applications   MFC Regular DLL with dynamically link to MFC.
DLL will use MFC  All clients are MFC ( dynamically linked) and you want to export MFC derived classes. Extension DLL

Building a DLL that dynamically links to MFC is faster than building a DLL that statically links to MFC because it is not necessary to link MFC itself. But then you must distribute the shared DLLs MFCx0.DLL and MSVCRT.DLL with your dll and that's a big pain.

How Clients find a DLL?

You can use LoadLibrary to load a dll from a specific path. If you link implicitly, Windows searches in these paths:

Current directory of exe.
Processes current directory.
Windows System Dir
Windows Dir
Directories listed in the Path 
The best way is to copy your dll into systems directory but I don't like this approach because then your systems dir is a mess. Copying in exe 's dir is not a bad idea.

Steps to Use an Extension DLL

There are following steps required to perform by a client to use an extension dll.

1. Copy your extension class's header file to your project directory.

2. Link your project to the lib file of your dll.

3. Include header file of your class in your project's stdafx.h or cpp file.

4. Create Object of the class and call its member functions.

See how to create an extension dll in third part of this tutorial for more details.

Steps to Use a Regular DLL

1. Link to the Library. Copy your lib file to your test project directory. Or if you don't want to copy the lib file then enter your lib file with the path in Object/library modules text box.

2. Import functions. Import functions using __declspec. Write this code in the beginning of your cpp file.

extern "C" __declspec(dllimport) long AddTwoNumbers( long val1, long val2);
extern "C" __declspec(dllimport) long MultiplyTwoNumbers( long val1, long val2); 

3. Call Functions. Add these public members to your dialog's header class.

int lSum = AddTwoNumbers( 12, 65 ); 
int lMultiplyRes = MultiplyTwoNumbers(12, 65) ;  

See how to create a regular dll in second part of this tutorial for more details.

posted @ 2005-03-31 17:54 番茄鸡蛋面 阅读(737) | 评论 (0)编辑

2005年3月29日

COM Vs .NET (Qt ActiveQt)


这些天在学习Qt的ActiveQt功能,由于对于COM和ActiveX知识的缺乏,虽然读了Qt ActiveQt相关的文档很多遍,
很多的东西的理解都不是很彻底。于是决定补充一下COM的相关知识。
在网上查了相关的书籍,看到潘爱民老师翻译的 Essential COM,评论非常不错,而且我也看过原作者的Essental .NET,感觉确实不错,决定要买。 忽然又看到潘老师的自己的著作 COM原理与应用,就先订购这本书,等看完了在班本质论。

看完书的前三章,真是有种醍醐灌顶的感觉,很多模糊的概念和词汇逐渐变的清晰起来,
COM的概念,in-process Vs. out-of-process server,COM component, COM Object,
COM interface, EXE,  DLL(Dynamic Link Library), QueryInterface, IUnknown, GUID.

今天在查资料,看到了以前down的chm电子文档,From CPP to COM,又豁然开朗了一把,Google查了一下,原来是MSDN上得一篇文章。这本书又把我对COM的认识提升了一层,而且是从C++方面。很多模糊的概念和词汇又清晰了一些,比如
 -declspec (dllexport) dumpbin, 尤其是dll。
虽然我知道在windows平台上对类库的引用有两种 static library(LIB) 和 shared library(DLL),Qt也可以以这两种模式编译,但是这两种是怎么来的却不是很清楚。看了COM的书后我错误的认为.NET以前的dll都是COM组件。

dumpbin工具可以查看dll的信息。

Dumpbin
The Microsoft COFF Binary File Dumper (DUMPBIN.EXE) displays information about 32-bit Common Object File Format (COFF) binary files. You can use DUMPBIN to examine COFF object files, standard libraries of COFF objects, executable files, and dynamic-link libraries (DLLs).


Qt CPP COM Interoperation (ActiveQt)
Qt的ActiveQt Frmaework包括两个部分,一部分是AxServer,可以把Qt应用程序转换为ActiveX Server,另外一部分是AxContainer,用来调用COM组件。这样 C++写的Qt应用程序通过ActiveQt技术就可以和COM交互上了。

.NET COM Interoperation ( Wrapper mechanism ,RCW and CCW)
由于公司同时使用.NET, Qt技术,在Qt里面找到了和COM交互的ActiveQt,.NET怎么和COM交互了,查询了网上的几篇文章,对他们之间的交互有了一个大概的了解。由于COM和.NET都是微软自己的核心技术,对于这两个技术之间的interoperation,微软还是提供了解决方案,想想也是,否则是自砸招牌。
.NET和COM之间的互调实际上原理是一样的,加了一个中间层wrapper class,分别是Runtime Callable Wrapper和COM Callable Wrapper.

Regasm
The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.

Tlbexp
Tlbimp

.NET COM comparison ( .NET is a better COM)
Assembly

(To be continued)

posted @ 2005-03-29 18:10 番茄鸡蛋面 阅读(629) | 评论 (0)编辑

2004年11月2日

复习进程和线程 process vs thread

http://www.vczx.com/tutorial/mfc/mfc8.php

进程是一个可执行的程序,由私有虚拟地址空间、代码、数据和其他操作系统资源(如进程创建的文件、管道、同步对象等)组成。一个应用程序可以有一个或多个进程,一个进程可以有一个或多个线程,其中一个是主线程。

线程是操作系统分时调度分配CPU时间的基本实体。一个线程可以执行程序的任意部分的代码,即使这部分代码被另一个线程并发地执行;一个进程的所有线程共享它的虚拟地址空间、全局变量和操作系统资源。

之所以有线程这个概念,是因为以线程而不是进程为调度对象效率更高:

  • 由于创建新进程必须加载代码,而线程要执行的代码已经被映射到进程的地址空间,所以创建、执行线程的速度比进程更快。

  • 一个进程的所有线程共享进程的地址空间和全局变量,所以简化了线程之间的通讯。

关于多线程,并发的一本电子书
http://www.unet.univie.ac.at/aix/aixprggd/genprogc/toc.htm

posted @ 2004-11-02 10:57 番茄鸡蛋面 阅读(681) | 评论 (0)编辑

2004年10月20日

Window Firewall cause "MS SQL Server New SQL Server Registeration" and "New ODBC DSN " failure

Three computers have MS SQL Server 2000 installed.
One is Windows 2000 Server ,the other two are Windows XP Professional.
The Windows XP Professional can register the MS SQL Server instance on Windows 2000 Server  via Enterprise Manager
But the Windows 2000 Server can't add Windows XP's SQL Server instance ,and Windows XP can't register each other.
The ODBC DSN is the same case.

Finally I got it through google seach.

It's the Windows Firewall, add the port 1433 to exception. The problem is solved.

posted @ 2004-10-20 14:04 番茄鸡蛋面 阅读(391) | 评论 (0)编辑

2004年9月9日

牛人与非牛人的对话


----"如果你的应用程序不能正确地运行,不要去责怪操作系统。"
2001年,当SUN提出SUN.ONE构架的那一天,XX大学毕业的牛在“牛狼之家”聊天战
碰到了一个公司的Coder

-------------------------------------------------------------------
牛: 你懂XXX协议、YYY框架、ZZZ思想吗
coder:稍微知道一点点
牛: 那你看过XX牛的《XXXX》第X版第X卷,YY牛的《YYYY》第Y版第Y卷,ZZ牛的《ZZZZ》第Z版第Z卷吗
coder:你说的这些书都是《经典书籍》,不过我大都没认真看过
牛: 这么说,你对XXX协议、YYY框架、ZZZ思想的底层细节应该不是很了解哦
coder:可以这么说
牛: 你具体做什么项目
coder:做X2X网站
牛: 你说你不懂XXX协议、YYY框架、ZZZ思想的底层细节,那么你们做X2X网站时,碰到XXX问题你怎么解决的
coder:很简单,我们会给XX、YY大学的牛发Email,叫他们给我们解XXX组件。很方便的。
牛: 如果没人肯帮你们解XXX组件呢
coder:不会的,每次都有N多牛排长对呢。再说了,到Internet上Search一下,买XXX组件的公司成堆
牛: 好了,好了,我再问你,你都用什么语言开发呢
coder:用ASP+VB
牛: 你只不知道MS已经不再支持VB+ASP了,改为C#+MS.NET
coder:在聊天室里听牛说过
牛: 那你为什么还要用VB
coder:C#,JAVA我不懂 ,所以我用VB
牛: 唉,又来了,基础的XXX协议、YYY框架、ZZZ思想的底层细节你说你不太懂,前沿的C#, MS.NET;JAVA,SUN.ONE你又不懂,你难道没想过要好好学学吗
coder:我有想过啊
牛: 那你为什么不学呢
coder:我没有时间
牛: 你的时间都到哪儿去了
coder:用VB+ASP编代码赚钱啊
牛: 赚钱干吗
coder:供我儿子出国读大学
牛: 读研究生
coder:不是,是读本科
牛: 读本科就出去读,没必要吧
coder:在XXX协议、YYY框架、ZZZ思想的底层细节方面,国内经常生产牛的最牛的XX
大学刚刚入门,在****方面连门都没入。我知道我儿子是块搞技术的料,所以我想要
让我儿子系统掌握XXX协议、YYY框架、ZZZ思想的细节,精通前沿的...

(听到Coder批评牛毕业的XX大学,牛有点生气了,开始不客气起来)
牛: 你知不知道,你没有XXX协议、YYY框架、ZZZ思想的底层细节,是写不出完美
的代码出来的。还有,像你这样,虽然现在可以赚一点小钱,但四年后肯定要被淘汰的......
coder:在我淘汰之前,我就不想干了
牛: 那你去干嘛
coder:我想开一家软件公司,招很多牛,包括精通XXX协议、YYY框架、ZZZ思想的底
层细节的牛,精通MS.net SUN.ONE的牛......
牛: 好笑!

----------------------------------------------------------------------

4年后,软件业VB已经彻底绝迹,XXX协议、YYY框架、ZZZ思想的底层细节已经被大量
修改,MS.net和SUN.ONE也快倒掉的时候.......
牛: (XXX公司CTO办公室里,看着www.xxx.com上的新闻)
啊! MS.net和SUN.ONE真要倒掉了吗?看来偶要继续充电了.......
coder:(XXX公司CEO办公室里,看着www.xxx.com上的新闻)
哦,MS.net和SUN.ONE果真快倒掉了。看来我要招聘新的CTO和Coder了...

谁也不知道,XXX公司的CTO和CEO就是当年在“牛狼之家”聊天战聊天的牛和
Coder。很多人自以为什么都知道---的确有很多牛从协议细节到当前潮流到开发环境....
样样都精通,但那是少数---可是却偏偏不知道自己正真需要的是什么,自己最
需要的又是什么,自己为什么要去知道这么多东西。

有的人知道的的确不多,但是他知道他最需要的是什么。他知道他时间不多,只
能去争取他最需要的东西。

以后的社会分工会越来越细,没必要也没有可能什么都懂,开飞机的显然不必知
道流体力学---虽然流体力学毫无疑问是飞机飞上天的基础;装配飞机的显然不必知
道采购来的发动机具体是如何把航空油变成动力输出的----虽然这是飞机可以开动的基础。

一样,用COM+或者EJB组件构造企业系统,你根本没有必要知道这个COM+或者EJB
组件是如何处理底层TCP/IP连接的。组件生产者关心的是实现细节--稳定性,效率,
安全......至于你,就去关心企业业务流程好了,即使不明白什么是TCP/IP,什么是
IPv6也没有关系。

posted @ 2004-09-09 14:08 番茄鸡蛋面 阅读(1060) | 评论 (2)编辑

2004年9月8日

Web Accessibility toolbar -- a must-have toolbar for web developer

Web Accessibility toolbar
http://www.nils.org.au/ais/web/resources/toolbar/



a must-have toolbar for web developer.

posted @ 2004-09-08 14:06 番茄鸡蛋面 阅读(509) | 评论 (0)编辑

好好学习天天向上

最近状态一直不好,看来要反省反省了。

开发方面,就是些无关痛痒的小项目,而且开发的所谓的模式还在别人的手中掌握,虽然我也提过一些意见,可是没什么成效。我们用的是asp.net,开发工具也是最新的,可是开发模式和过程还是停留在以前asp,php刚兴起的年代的开发模式。让人感觉买了个宝马车,然后把轮子换成自行车的,还洋洋得意。真不明白这些老外。
技术总在不断的变化,成熟,再变化。最近一年来,技术的更新比刚毕业那会更快,各种新名词新技术不断出现,我并不是盲目追求新技术,很多东西如果理解了,而且感觉不错,就完全可以拿来用。3-layer,   O/R Mapping .很多新名字并不是新东西,只是理解的一个新层次。

作为一个程序员,最快乐的事情莫过于学了新东西,而且实践到自己的项目中。
看到cnblogs.com上很多关于asp.net各种各样的讨论的文章和心得,我只能用心品位了。
也看了几本不错的书,感觉自己对框架,模式的理解还是上了一个层次。实践确没有。
现在的水平就是想有帮一把。
真想回到以前外包的那家公司,去实践。去偷学那个无名的老师。
在CSDN看到有人说,大概是做外包的程序员,学不到什么东西,外包做的越好,越是学不到。
我以前工作的那家公司不是非常规矩的那种,而且我自认为好学,知道怎么学习,所以从外包方那里学到了很多。

一年多的SOHO工作使我彻底厌恶了在家上班。

希望国庆的vacation能好好休整一下。



posted @ 2004-09-08 10:13 番茄鸡蛋面 阅读(472) | 评论 (0)编辑

2004年7月4日

Oracle table problem

最近遇到一个奇怪的Oracle问题:
Oracle 数据库里面有一个表,在查询表的varchar2类型的column时总是查找不到正常的结果,查询其他类型的column可以返回正常结果。简化的例子如下
ID 列的类型为  number
NAME 列的类型为varchar2(10)
里面的数据如下:(1 ,'94'), (2,'94'), (3,'testname')

select * from TestTable where id=1  能返回正常结果
select * from TestTable where name='94' 返回 no rows select
select * from TestTable where name='testname' 能返回正常结果
奇怪的是select * from TestTable where name=94 能返回正常结果

而且和这个表varchar2列相关联的view也不能返回正常结果。
这个数据库的其他表查询正常。

实在无奈drop了这个table, 又重新create了,能正常工作,可是客户那里不允许我这样做。
而且我也想知道原因。

哪位朋友能给指点指点,谢谢!

posted @ 2004-07-04 12:44 番茄鸡蛋面 阅读(782) | 评论 (3)编辑

2004年6月23日

Oracle - MSSQL Convert Tips (2)

In the  Oracle - MSSQL Convert Tips (1) I already mentioned several tips that used very often.
Today's project contains too much views , stored procedures and trigger  and the lines of these code are big.
So I try to find some tools to ease the conversion by Google with “database/sql migration/convertion PL/SQL T-SQL convert” all kind of key words

I found several toos,they all commerical software,I tried them on by one.
found that SwissSQL's  Oracle To SQL Server (PL/SQL to T-SQL) migration tool is better.
In its help html document , we  can also learn some common  convertion rules.

Also found a page of SQL Function Reference: Oracle vs. SQL Server which list many functions including Math, Datatime,String used by Oracle and SQL Server.

little tip today:
select top 10 salary from employee order by salary
select salary from ( select salary from employee order by salary ) where rownum < 11








posted @ 2004-06-23 17:49 番茄鸡蛋面 阅读(697) | 评论 (0)编辑

2004年6月22日

.NET 数据访问体系结构指南

.NET 数据访问体系结构指南 in MSDN China

some tips from this article:

无论您使用哪种 .NET 数据提供程序,您都必须始终遵循下列原则:

尽可能晚地打开数据库连接。

以尽可能短的时间使用连接。

尽可能早地关闭连接。

要保证在方法返回之前关闭连接,请考虑使用下面的两个代码示例中阐明的方法之一。第一个方法使用 finally 块。第二个方法使用 C# using 语句,它确保调用对象的 Dispose 方法。


如果您使用 SqlDataAdapter 来生成 DataSetDataTable,请注意下列事项:

不需要显式打开或关闭数据库连接。SqlDataAdapterFill 方法可打开数据库连接,然后在其返回之前关闭该连接。如果连接已经打开,Fill 将使该连接保持打开。

如果您需要将该连接用于其他目的,请考虑在调用 Fill 方法之前打开它。这样,您可以避免不必要的打开/关闭操作,从而提高性能。

尽管您可以反复使用同一 SqlCommand 对象来多次执行同一命令,请不要重用同一 SqlCommand 对象来执行不同的命令。


如果您使用 SqlDataReader,请注意以下事项:

当数据读取器处于活动状态时,到数据库的基础连接将保持打开状态,并且无法用于任何其他目的。尽可能早地调用 SqlDataReader 上的 Close

每个连接只能有一个数据读取器。

您可以在使用完数据读取器后显式关闭连接,或者通过将 CommandBehavior.CloseConnection 枚举值传递给 ExecuteReader 方法,将连接的生存期与 SqlDataReader 对象联系起来。这表示在关闭 SqlDataReader 后,应该关闭连接。

在使用读取器访问数据时,如果知道列的基础数据类型,应使用类型化的访问器方法(如 GetInt32GetString),这是因为它们可减少读取列数据时需要执行的类型转换的数量。

要避免将不需要的数据从服务器提取到客户端,如果您希望关闭读取器并丢弃其余任何结果,应在调用读取器上的 Close 之前,调用命令对象的 Cancel 方法。Cancel 确保在服务器上丢弃结果,而不会将结果无谓地提取到客户端上。否则,调用数据读取器上的 Close 会导致读取器无谓地提取其余结果以清空数据流。

如果您希望获得输出或者从存储过程返回的返回值,并且您使用的是 SqlCommand 对象的 ExecuteReader 方法,则必须在输出和返回值可用之前调用读取器上的 Close 方法。



posted @ 2004-06-22 16:46 番茄鸡蛋面 阅读(592) | 评论 (0)编辑

NET Framework Data Providers

MSDN article NET Framework Data Providers  helps us to understand several .NET Framework Data Providers  and how to choose a proper Data Provider between

.NET Framework Data Provider for SQL Server
.NET Framework Data Provider for OLD DB
.NET Framework Data Provider for ODBC
.NET Framework Data Provider for Oracle

posted @ 2004-06-22 16:27 番茄鸡蛋面 阅读(473) | 评论 (0)编辑

Links or Postbacks

posted @ 2004-06-22 13:52 番茄鸡蛋面 阅读(406) | 评论 (0)编辑

2004年6月21日

ASP.NET features we use, ASP.NET experience I have

我现在参与的是一个multilingual ,multi-culture 基于web的项目。
要满足英语,德语,法语等不同语种和文化客户的需要。
数据库要同时满足Oracle和 MSSQL.
虽然说我们用了ASP.NET,但是我觉得并不是正宗的ASP.NET
我们只用到了其中的几个feature,很多的可以说是ASP.NET精髓的东西都没有用。
我们的Leader以前做ASP,PHP的经验比较丰富,所以对ASP.NET的一些新功能不是很感兴趣.
所以一些coding的要求也很有意思.

1. 我们用VS.NET 开发项目,code-behind,这点还不错,没让用EditPlus.
2. 我们不用ASP.NET的Event,delegate机制. 
    Leader认为Http协议本身就Requst,Response,引入event是把简单的事情复杂化了.
    所以我们只在Page_Load()里面写代码.
3. 我们不用ViewState. EnableViewState=“false“
4. 我们尽量不用ASP.NET Server Control,当然不用DataGrid,尽量用html 元素和Html Controls.
    如果是GUI相关元素,或者这个元素需要在Post以后恢复或者赋值,就把这个元素的属性设为 runat=server
5. 所有Form元素的值用Requst.Form[]取得.
 
我以前php,asp,jsp都有一定的经验,所以下面的代码结构我还是很快熟悉并习惯了.
我们用的最多的runat=server.和html control的动态输出.
我们的代码结构如下:
Page_Load()
{
     //fetch configuration
     //fetch the GUI element for the current culture
     doInit();
    //check  and get the URL parameter values;
    checkParameterElements();
   if the page is post back then
        //check and get the posted Form values;
        checkFormElements();
   if need to write to database then
        writeToDatabase();
   if no error happen then
        //The non-GUI related data are retrieved from the database and render here.
        renderDataUI();
   if no error happen then
        //GUI element render here
        renderGUI();
}

常用的表格输出代码:
System.Web.UI.HtmlControls.HtmlTableRow tr;
System.Web.UI.HtmlControls.HtmlTableCell td;
foreach(DataRow dataRow in sortedTable.Rows)
{
 tr = new HtmlTableRow();
 td = new HtmlTableCell();
 td.innerHtml="some stuff";
 tr.cells.add(td);
 table.rows.add(tr);
}

对于多语言界面和多数据库支持.我们用了同样的方法.
不同语言的text和不同数据库的sqlstring都放在数据库里面.
只是text表里面多了一个语言id字段,区分不同语言的text
sqlstring表里多了一个数据库id字段,区分不同的数据库 sqlstring
没有用到存储过程什么的.
我也看了PetShop 3里面的Present Layer ,Business Logic Layer, Data Access Layer划分.

经过一段的程序设计的体验,我慢慢习惯了我们目前的这种设计
也算是一种Framwork or Architecture 吧.

不知道各位朋友在类似项目或者ASP.NET项目中的设计体验如何?
欢迎交流!
 

posted @ 2004-06-21 17:31 番茄鸡蛋面 阅读(1918) | 评论 (14)编辑

2004年6月20日

Word Note 001

at the merce of
vital
trial
glitch
scratch
make the best of
make the most of 
acronym  n.首字母简略词
antonym  n.反义词
synonym  n.同义词
abbreviation : n.缩写词 Jan is the abbrevation of January
fraud:   n欺骗欺诈
petition: n.请愿书
faculty: n.才能, 本领, 能力, 全体教员, (大学的)系, 科, (授予的)权力
facility  n.容易, 简易, 灵巧, 熟练, 便利, 敏捷, 设备, 工具
stuff
staff
simulation
aggregate  聚集, 集合, 合计
RSS: Really Simply Syndication RDF Site Summary
thesaurus
glossary




posted @ 2004-06-20 08:58 番茄鸡蛋面 阅读(473) | 评论 (0)编辑

2004年6月19日

Skype 0.98.0.28 release!

Skype 0.98.0.28 release!
Major new features:

Preparations for SkypeOut
Emoticons in Messages
Avator browser
Full list:
http://www.skype.com/help_releasenotes.html

posted @ 2004-06-19 20:14 番茄鸡蛋面 阅读(417) | 评论 (0)编辑

I can't agree more

I can't agree more!
翻译成中文为
我非常同意,
同意得不能再同意了。

想查这个费了几个周折,
先是用几个Machine Translator,都翻译的不好。
然后金山词霸也不行。
Google英文搜索不行,中文就找到了洪恩在线。



posted @ 2004-06-19 14:20 番茄鸡蛋面 阅读(1056) | 评论 (1)编辑

2004年6月18日

Skype Skype Skpe

a very cool tool .



posted @ 2004-06-18 23:58 番茄鸡蛋面 阅读(3246) | 评论 (1)编辑

Getting Your Résumé Read

By Joel Spolsky

::URL::
http://www.joelonsoftware.com/articles/ResumeRead.html

 I found the above artile when I surf the skype.com job opennings page.
 they recommend this page to check for tips befoe  sending resume.

 The tips are really helpful, worth reading.

 

posted @ 2004-06-18 23:49 番茄鸡蛋面 阅读(402) | 评论 (0)编辑

在行进中开火 Fire and Motion By Joel Spolsky

By Joel Spolsky

::URL::
http://www.joelonsoftware.com/articles/fog0000000339.html

 ::URL::http://chinese.joelonsoftware.com/Articles/FireAndMotion.html


 在行进中开火。
 说的不错,万变不离其宗,很多时候我们不能被太多的新技术迷惑甚至压倒。
 踏踏实实的学点实实在在的东西才是硬道理。

 

posted @ 2004-06-18 23:47 番茄鸡蛋面 阅读(397) | 评论 (0)编辑

Nothing is simple as it seems

 By Joel Spolsky 

::URL::
http://www.joelonsoftware.com/articles/NothingIsSimple.html

 ::URL::http://chinese.joelonsoftware.com/Articles/NothingSimpleSeems.html

 yes,事情往往没有想象的那么简单,事情比想象的复杂的多,或者说繁琐的多。
 所以一定要三思而后行,先设计,再写程序。

 前几天,老板让写一个收集应聘者信息和上传简历的程序,想起来非常的简单,可是真正实施起来,需要考虑的事情就很多,
 数据库的设计化了一天,其中还有visio的使用,auto increasement column define ,
 now() time auto insert column define.
 就单单用户输入的验证就化了很长时间,而且还是考虑不周。

 一定不能想当然,要三思而后行,当然了,把简单的事情复杂化也不好的。

 

posted @ 2004-06-18 23:45 番茄鸡蛋面 阅读(409) | 评论 (1)编辑

10个必备.NET 工具

Ten Must-Have Tools Every Developer Should Download Now
 
This article discusses:
  • NUnit to write unit tests
  • NDoc to create code documentation
  • NAnt to build your solutions
  • CodeSmith to generate code
  • FxCop to police your code
  • Snippet Compiler to compile small bits of code
  • Two different switcher tools, the ASP.NET Version Switcher and the Visual Studio .NET Project Converter
  • Regulator to build regular expressions
  • .NET Reflector to examine assemblies

 

posted @ 2004-06-18 22:47 番茄鸡蛋面 阅读(641) | 评论 (0)编辑

Oracle - MSSQL Convert Tips (1)

These days I participate a project  to convert sql statements between Oracle and MSSQL and learn a lot.

1.Auto increament column Issue
sql server : when create table define this column property  identity(0,1)
oracle       : must use a sequence and a trigger as the following:

CREATE SEQUENCE SEQUENCE_NAME
  START WITH 0
  NOMAXVALUE
  MINVALUE 0
  NOCYCLE
  NOCACHE
  NOORDER;

CREATE OR REPLACE TRIGGER TRIGGER_NAME
BEFORE INSERT
ON TABLENAME
FOR EACH ROW
BEGIN
  SELECT SEQUENCE_NAME.NEXTVAL
  INTO :NEW.id
  FROM DUAL;
END;


2. Trigger Auto set System Date
when insert an entry, set a certain column to sysdate. 
This makes only one clock ,and reduce one column operation in programming .
both use trigger like the following:

sql server case:
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[TRIGGER_NAME]') AND OBJECTPROPERTY(id, N'IsTrigger') = 1)
DROP TRIGGER [TRIGGER_NAME]
GO
CREATE TRIGGER [TRIGGER_NAME] ON [TABLE_NAME]
FOR INSERT
AS
    DECLARE @id int;
    SELECT @id = inserted.id FROM inserted;
    UPDATE TABLE_NAME SET COLUMN_NAME = getdate() WHERE id = @id;
GO

Oracle case :
CREATE OR REPLACE TRIGGER TRIGGER_NAME
BEFORE INSERT
ON TABLE_NAME
FOR EACH ROW
BEGIN
  SELECT sysdate
  INTO :NEW.COLUMN_NAME
  FROM DUAL;
END;


3. Sytax difference and similiar
modify column ,alter column
Integrated constraint like Primary Key, Foreign Key, Check, Unique ,Index
    
4. Oracle connect by, SQL Server should use User Defined Function to do so.
 
5 .Misc
sqlserver: IsNull(a,b)
oracle: nvl(a,b)

posted @ 2004-06-18 17:43 番茄鸡蛋面 阅读(1713) | 评论 (3)编辑

Some Articles Help You To Understand ASP.NET ViewState

A list of good articles to help understand ASP.NET ViewState

ViewState: All You Wanted to Know

ViewState and JavaBean The ASP.NET Alternative part give us a overview of how ViewStae works

Taking a Bite Out of ASP.NET ViewState is another MSDN article

Understanding ASP.NET View State by Scott Mitchell from 4GuysFromRolla.com is the lastes MSDN article about ViewState

以下是个人的一些理解:

ASP.NET的一大好处就是很多html control 都可以设定为runat=“server“,变成可以在服务器端控制的control.
这也是导致误解ViewState的一个原因。

ViewState不是用来恢复Form(此处Form专门指普通的,用来向服务器端提交数据的表单)的值(value)的.
比如Input 里面的TextBox,Submit, CheckBox, Select等等,这些control由于实施了IPostBackDataHandler接口,所以他们的value并没有保存在ViewState里面,因此也不用ViewState来恢复.

但是他们的其他属性比如background color等,如果有的话是要保存在ViewState里面的.

ViewState是用来恢复和保存那些
被设定为runat=”server”的,
没有实施了IPostBackDataHandler接口的,
control的属性.是属性,不仅仅是值.
比如Label, Calendar等等和其他微软自己引入的control.

posted @ 2004-06-18 17:22 番茄鸡蛋面 阅读(673) | 评论 (1)编辑

Good Translation And English Learning Tools

English Chinese translation
::URL::http://www.iciba.net

In Google Language Tool page, I saw it s translation tool, I try its German to English translation, the result is wonderful. 
Unfortunately it doesn't provide English Chinese translation . 
I then search  English  Chinese translation with Google and found the following one

::URL::http://dictionary.reference.com/translate/text.html

I found it's powered by SYSTRAN Software.
It's really powerful.
and Dictionary also provides the Dictionary IE Toolbar.

Google
::URL::http://www.google.com/language_tools?hl=en

Dictionary
::URL::http://dictionary.reference.com/translate/text.html

FreeTranslation
::URL::http://www.freetranslation.com/

WorldLingo
::URL::http://www.worldlingo.com/products_services/worldlingo_translator.html

Find acronym words
::URL::http://www.acronymfinder.com/


posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(1086) | 评论 (5)编辑

看车人的七月

看了电影 看车人的七月

不禁想到了下面几部

十七岁的单车
卡拉是条狗
站直了,别趴下

小人物的命运,老百姓的生活



posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(445) | 评论 (0)编辑

Skype updated, My Picture avator

cool pictures ,also cool logo

http://www.skype.com/download_avatars.html

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(482) | 评论 (0)编辑

Three/Multi Tier/Layer Architecture/Design

More details
A reminder on "Three/Multi Tier/Layer Architecture/Design" brought to you by my late night frustrations.




MY COMMENT 
What matters is that you have already adopt it in your practice,not just understand the theory, 
or think your project is too small and this is overkill. 
Just do it!

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(551) | 评论 (0)编辑

Test Driven Development && NUnit

::URL::http://nunit.org

Test Driver Development (TDD) is a popular word these day.
It's principal is "test first". Since is a method, it has rules.

In fact ,we already use this method but not so strict to obey the rules and didn't use some tools like NUnit..

For intance, I write a class for database access . once I add a function, I will make the test data and test it in the main method.  once it's finished ,the test part in main method is deleted. The disadvatage is that if you modify the function and unfortunately you delete the test  part in main function, you have to rewrite the test part.

However in TDD, test is always kept and use tools to run the test seperately.
even we write the test first.

I think it's a goold method for developer to  test and make better quality.

I will try to use this method and NUnit in future programming

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(531) | 评论 (0)编辑

Top Ten Tips for Programming ASP.NET

More details in 
http://www.ondotnet.com/pub/a/dotnet/2002/04/22/asptips.html

Top ten tips for programming ASP.NET
1. Use Visual Studio .NET, but do not use default names for anything except trivial or non-referenced objects.

2.Even if coding outside of Visual Studio .NET, use code-behind files for a performance benefit the first time a page is requested.

3. Test for postback on page load.

4.Use the StringBuilder Class

5.Use server-side controls only when necessary.

6.To navigate to a URL without posting the form, use a HyperLink control; to post the form and then navigate, use a LinkButton.

7. Comment your code.
Alzheimer's Law of Programming:
 Looking at code you wrote more than two weeks ago is like looking at code you are seeing for the first time.


8.Trace page execution using the trace methods and trace attribute in the Page directive.

9.Use the Stored Procedure

10. Use the Command Prompt.

posted @ 2004-06-18 15:10 番茄鸡蛋面 阅读(497) | 评论 (0)编辑