Fantacy
calmzeal's code life
posts - 66,comments - 124,trackbacks - 14

1. window.attachEvent

IE和FF处理不同,如下

另,不能直接使用带参数函数 做为attachEvent的第二个参数,可以使用function(){//这里调用你的需要加参数的js函数}来调用

 

 

if (window.attachEvent)
      window.attachEvent("onresize",function(){ ra_OnPageResize(0)});
else if (window.addEventListener)
      window.addEventListener("resize",function(){ ra_OnPageResize(0)},false);

//FF 里事件是resize

 

2. js调整FrameSet布局cols问题

其实就是直接设置FrameSet.cols (p2f1)就行

今天头晕了,对下面的p1f3.cols设置了半天无效。。

 

p1:

<frameset id=p1f1>

<frame id=p1f2>

<frame src=p2.htm id=p1f3>

</frame>

 

p2:

<frameset id=p2f1>

<frame id=p2f2>

<frame id=p2f3>

</frame>

 

附js:

function Submit_onclick()
        {        
        if (!window.parent.Fset) return;
  str= window.parent.Fset.cols; 
  if (str) str = str.substring(0,str.indexOf(",")); 
  if ((str)&&(str>150)&&(str!="0%"))
         {
         window.parent.Fset.cols="0%,*";        
         }
   else
   {
    window.parent.Fset.cols="200,*"    
   }
       }

 //今天调试跨浏览器发现,ff里不能通过对Frame的ID来直接访问

(IE FF都可以直接通过Frame的Name来访问,但是FrameSet不支持name属性)

因此上面的window.parent.Fset =》window.parent.document.getElementById("Fset");

 

posted @ 2008-08-06 17:44 calmzeal 阅读(11) | 评论 (0)编辑

现象:

SQL> select rownum,emp.* from emp;

    ROWNUM          A
---------- ----------
         1          1
         
2          2
         
3          1
         
4          1

SQL
> select rownum,emp.* from emp where rownum<3;

    ROWNUM          A
---------- ----------
         1          1
         
2          2

SQL
> select rownum,emp.* from emp where rownum=2;

未选定行

解释(google到的,不过自己后面也理解了):

How ROWNUM Works

ROWNUM is a pseudocolumn (not a real column) that is available in a query. ROWNUM will be assigned the numbers 1, 2, 3, 4, ... N, where N is the number of rows in the set ROWNUM is used with. A ROWNUM value is not assigned permanently to a row (this is a common misconception). A row in a table does not have a number; you cannot ask for row 5 from a table—there is no such thing.

!ROWNUM是在什么时候被赋予每条记录的!
Also confusing to many people is when a ROWNUM value is actually assigned. A ROWNUM value is assigned to a row after it passes the predicate phase of the query but before the query does any sorting or aggregation. Also, a ROWNUM value is incremented only after it is assigned, which is why the following query will never return a row:

 

select *
from t
where ROWNUM > 1;

 

Because ROWNUM > 1 is not true for the first row, ROWNUM does not advance to 2. Hence, no ROWNUM value ever gets to be greater than 1. Consider a query with this structure:

 

select ..., ROWNUM
from t
where <where clause>
group by <columns>
having <having clause>
order by <columns>;

 

Think of it as being processed in this order:

1. The FROM/WHERE clause goes first.
2. ROWNUM is assigned and incremented to each output row from the FROM/WHERE clause.
3. SELECT is applied.
4. GROUP BY is applied.
5. HAVING is applied.
6.
ORDER BY is applied.

That is why a query in the following form is almost certainly an error:

 

select *
from emp
where ROWNUM <= 5
order by sal desc;

 

The intention was most likely to get the five highest-paid people—a top-N query. What the query will return is five random records (the first five the query happens to hit), sorted by salary. The procedural pseudocode for this query is as follows:

 

ROWNUM = 1
for x in
( select * from emp )
loop
exit when NOT(ROWNUM <= 5)
OUTPUT record to temp
ROWNUM = ROWNUM+1
end loop
SORT TEMP

 

It gets the first five records and then sorts them. A query with WHERE ROWNUM = 5 or WHERE ROWNUM > 5 doesn't make sense. This is because a ROWNUM value is assigned to a row during the predicate evaluation and gets incremented only after a row passes the WHERE clause.

Here is the correct version of this query:

 

select *
from
( select *
from emp
order by sal desc )
where ROWNUM <= 5;

 

This version will sort EMP by salary descending and then return the first five records it encounters (the top-five records). As you'll see in the top-N discussion coming up shortly, Oracle Database doesn't really sort the entire result set—it is smarter than that—but conceptually that is what takes place.



posted @ 2008-07-18 11:00 calmzeal 阅读(25) | 评论 (1)编辑

posted @ 2008-07-10 15:42 calmzeal 阅读(6) | 评论 (0)编辑

http://hi.baidu.com/simadi/blog/item/05eebba1da17918f4710649d.html

在Asp.net AJAX 1.0 RTM版中,使用FrameSet或Iframe时,frame或iframe的frameborder属性应使用1 或 0,如:
frameborder="0"
而不能使用yes 或 no,如:
frameborder="no"

否则AJAX 1.0会出现如下脚本错误:

Sys.ArgumentOutOfRangeException: Value must be an integer.
Parameter name: x
Actual value was NaN.

posted @ 2008-07-10 08:30 calmzeal 阅读(20) | 评论 (0)编辑

==>
posted @ 2008-05-21 09:53 calmzeal 阅读(109) | 评论 (0)编辑

由于XX安全(之前92自带的apache1.3一直未能升级到2.0,被指安全隐患,望达人指点升级方法)问题,
最后Oracle要统一升级到10G了

在测试服上升级10G后,程序大部分访问正常
92的导出dmp文件能直接imp到10G

但是在access里进行ODBC调用时发现速度巨慢
同一句查询语句,用ODBC连92执行不到500ms
连10G要耗时3000-4000ms

google一通,有个老外情况更惨,原来十分钟的要几个小时。。。
他最后解决办法是 修改一个参数 但是对我无效 也记不清了 (好像是关掉行反馈? 有类似问题的可以google : Access + oracle 10 + slow + odbc)

只好自己捣鼓。。
发现把odbc驱动换成Microsoft ODBC provider for oracle
测试速度居然比 Oracle ODBC drvier 10.1.*要快  50%
看来是Oracle ODBC驱动的问题
安装新版Oralce ODBC驱动解决问题,后面安装的是10.2.*的ODBC版本
就3文件替换就行
sqora32.dll
sqoras32.dll
sqresus.dll
顺便说一句,服务器安装新的就行

posted @ 2008-04-16 11:11 calmzeal 阅读(467) | 评论 (3)编辑
这几天framework 自动更新
结果造成webservices调用报错:

System.IO.FileNotFoundException:   找不到文件或程序集名称“ygbe1ssc.dll”,或找不到它的一个依赖项。  
  文件名:   “ygbe1ssc.dll”  
        at   System.Reflection.Assembly.nLoad(AssemblyName   fileName,   String   codeBase,   Boolean   isStringized,   Evidence   assemblySecurity,   Boolean   throwOnFileNotFound,   Assembly   locationHint,   StackCrawlMark&   stackMark)  
        at   System.Reflection.Assembly.InternalLoad(AssemblyName   assemblyRef,   Boolean   stringized,   Evidence   assemblySecurity,   StackCrawlMark&   stackMark)  
        at   System.Reflection.Assembly.Load(AssemblyName   assemblyRef,   Evidence   assemblySecurity)  
        at   System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()  
        at   System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()  
        at   System.Xml.Serialization.Compiler.Compile()  
        at   System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]   xmlMappings)  
        at   System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]   mappings)  
        at   System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[]   methodInfos)  
        at   System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[]   methodInfos)  
        at   System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type   type,   LogicalMethodInfo[]   methodInfos)  
        at   System.Web.Services.Protocols.HttpServerType..ctor(Type   type)  
        at   System.Web.Services.Protocols.HttpServerProtocol.Initialize()  
        at   System.Web.Services.Protocols.ServerProtocolFactory.Create(Type   type,   HttpContext   context,   HttpRequest   request,   HttpResponse   response,   Boolean&   abortProcessing)  

google 到微软的解决办法:
http://support.microsoft.com/?id=823196

说是TEMP文件夹权限问题
提供了一个实用的跟踪办法,详见上面的连接:
 <system.diagnostics>
         <switches>
            <add name="XmlSerialization.Compilation" value="4"/>
         </switches>
    </system.diagnostics>


但是对我们的服务器无效,最后发现是CSC.EXE被破坏的原因
%system%\Microsoft.NET\Framework\v2.0.50727\csc.exe 文件修改日期为今天,大小为0
复制正常文件替换解决问题

不知道有没有类似自动升级造成的情况
或者是我们服务器被病毒破坏了?
posted @ 2008-04-16 10:55 calmzeal 阅读(248) | 评论 (0)编辑
我们的应用系统有部分数据传输是对本地Access表进行导出XML后上传服务器
昨天有用户发生上传错误时,发现一个奇怪的现象:
Access数据表看起来正常,但是在读入到ADO RecordSet并存为XML时,数据列平白多了如标题所示的4个
用Access程序打开mdb文件,可看到每个表的图标都有个类似同步的图标,其他都和正常数据表一致(字段定义、数据等等)
孤陋寡闻的我没见过这个,又发现复制一张里面的表,粘贴完后能看到新增的4个字段:s_ColLineage、s_Generation、s_GUID、s_Lineage
而且还删除不了这几个字段。。

狂google一通+问朋友后+自己动手搞半天后,总结相关信息如下:
1. 这个数据文件是因为开启了Access的同步复制功能造成的。那4张表是系统表。
2. 查看系统表可在 工具 --》 选项里 打开 显示 系统对象
3. 更多关于同步的信息查看Office目录下 RPLBRF35.CHM帮助
4. 要想从同步复制表恢复成一般本地表是个相当痛苦的事情。。

先记下这些,什么时候再看看有什么办法在ADO里面忽略这些系统字段没
posted @ 2008-04-08 11:54 calmzeal 阅读(34) | 评论 (0)编辑

baidu到一篇关于 SQL Server差异同步的文章:
http://dev.csdn.net/author/cassaba/cc3fb4ffb7f646c1bf5c789d67dcb43b.html

引用
同步数据,我们比较关心的是如何尽可能地减少每次的同步数据量,以提高同步效率,降低对网络带宽的消耗。对于大批量的数据同步,这一点尤其需要考虑。如果解决这个问题呢,我认为关键点在于获取差异数据,也就是说,我们只同步变化了的数据,没有变化的,就不用同步。
       就此,我总结了5种方法,各种方法各有优劣,下面一一道来。
      
1.SQLServer本身的复制服务
本身支持多种数据同步方式,功能很强大,但是使用上会比较复杂,而且如果在同步过程中,需要对差异数据做二次处理,似乎无路可走。
 
2.Trigger
可以实时获取差异数据, Trigger使用较为容易,不需要改变原表的结构,可以只监视部分的栏位变更,以获取你需要的变化数据,并对数据做二次处理。Trigger需要你对源表的维护状况比较了解,否则可能产生一些意想不到的影响。
 
3.日期栏位(时间戳)
简单而言,在设计表的时候,添加两个日期栏位,CreatedOn, ChangedOn, 分别记录数据产生时间和变更时间。同步程序可以根据两个栏位来获取差异的数据。
 
这种方法可以保证随时获取某个时间段内新增(变化)的数据,同时对于追踪问题也大有裨益。但是缺陷也不少,其一是这两个栏位完全由开发人员控制,切实保证这两个栏位每次都得到正确的维护比较困难,其二是不容易确定你下一次取差异数据的基准时间。
 
4.timestamp栏位
timestamp可以理解为行的版本号,每次插入或更新包含 timestamp 列的行时,timestamp 列中的值均会更新。利用这一特性,建立一个包含源表ID和timestamp值的基准表,就可以找到哪些数据发生变化了,每次同步成功后,再更新该基准表。
 
5.监控并记录基于某数据对象的所有DML语句
这种方法,我没有具体尝试过,但是一个很不错的思路,如果网络状况糟糕,而且对数据实时性要求不高,可以采用。具体做法是每天定时获取你需要同步表的所有update, delete语句,然后定点打包发送到另外一台服务器执行。
 
6.使用BINARY_CHECKSUM
这个是我认为最简单的方法。BINARY_CHECKSUM是SQLServer内置的一个聚合函数,它可以针对一行,或者某些列计算出一个值,如果它计算的那些列中的任何一个值发生变化,那么那个计算值就会发生变化。这样我只要建立一个包含源表ID和最初计算值的基准表,就可以找到哪些数据发生变化了,每次同步成功后,再更新该基准表。与方法4不同的是,BINARY_CHECKSUM可以只监视部分变化的栏位,这一点又类似于Trigger了。
使用BINARY_CHECKSUM有些限制,因为它在计算中会忽略具有不可比数据类型的列(不可比数据类型是 text、ntext、image、cursor 以及基本类型为前4个数据类型之一的 sql_variant),所以要监控这些列变化,这种方法就无能为力了。
 
俗话说得好,到什么山上唱什么歌,上面列举的方法只是在遇到此类问题的时候,能够给我们更多的选择,究竟如何取舍,还是具体问题具体分析了!

在Oracle9中 没有提供 类似ChechSum的函数
(好像10G以上版本开始有了;Oracle92中包OWA_OPT_LOCK.CHECKSUM方法提供类似功能,不过只能对单列进行计算,详见:http://www.dbforums.com/archive/index.php/t-1289203.html

我采取的办法是 类似上面的方法3,在Update和Insert时维护更新时间
源服务器提供WS服务,目标服务器程序调用。
2边采取同样排序查询更新时间(按需更新表主键)
将更新时间拼凑起来进行CRC32校验码计算,比较差异时再比较更新时间
posted @ 2008-03-31 08:54 calmzeal 阅读(73) | 评论 (2)编辑