2011 年文章归档
共 14 篇文章
检查公式括号配对
a)满足在字符串的任何位置处,其左边的左括号数不小于右括号数;b) 字符串中所有的左右括号数相等。 因此,可以采用栈的思想来匹配:遇到左括号入栈,遇到右括号出栈,直到栈为空,或字符串结束停止;字符串扫描结束时,栈也同时为空,则说明匹配。js如下: function checkBracket(algorithms){ var bracket = []; var algorithms= algorithms ||''; for(var i=0; i<algorithms.length; i++){ if(algorithms.charAt(i)=="("){ bracket.push('(');…
2011-12-27 09:27 · javascript
js实现小数转百分比
Number.prototype.toPercent = function(n){n = n || 0;return ( Math.round( this * Math.pow( 10, n + 2 ) ) / Math.pow( 10, n ) ).toFixed( n ) + '%';} var A=0.358975, B=0.25554; alert([A, A.toPercent(3), B, B.toPercent()].join('\n'));
2011-12-26 15:05 · javascript
IE6下链接ONCLICK事件处理中的请求被ABORTED
IE6下链接ONCLICK事件处理中的请求被ABORTED 一大早发现,ie6下点发起对话没法弹出窗口,ff浏览器就是可以的。开启HttpWatch检测,发现点击的被aborted。 查找资料显示aborted的原因如下。 The (Aborted) value is more complex in its origin. It occurs when IE has started to process the request for a URL (e.g. to download an image), but then decides to cancel the operation. He…
2011-08-25 17:16 · javascript · javascript httpwatch aborted
oracle笔记
//删除表空间 DROP TABLESPACE gzgl_temp INCLUDING CONTENTS AND DATAFILES; //删除用户 DROP USER gzgl cascade create temporary tablespace GZGLPTDB_TEMP tempfile 'G:\oracle\oradata\gzgl_temp.dbf' size 50m autoextend on next 50m maxsize 20480m extent management local; //创建数据表空间 create tablespace GZGLPTDB_DATA lo…
2011-08-17 16:59 · 数据库
网页中打开notepad,word
<script language="JavaScript"> function open_exe(shellp,str) { a=new ActiveXObject("wscript.shell"); a.run(shellp+" "+str); } function cq() { b=new ActiveXObject("wscript.shell"); b.run("rundll32.exe") } </script> <button onclick="open_exe('notepad.exe','')">打开notepad</button> <button onclick="open…
2011-08-15 09:05 · javascript
struts2 json plugin includeProperties 包含MAP属性
<action name="dl" class="com.dqgb.action.document.DocumentAction" method="getDocumentList"> <result type="json"> <param name="includeProperties">^documentss\[\d+\]\.attachGroup\.attachs.*</param> </result> </action> 其中attachs为Set集合
2011-05-12 17:29 · ssh2
iframe自适应高度的多种方法方法小结
iframe自适应高度的多种方法方法小结发布 类型:转载 对于自适应高度的代码有很多,可效率什么的考虑进来好代码就不多见了,不过思路倒是差不多的 不带边框的iframe因为能和网页无缝的结合从而不刷新页面的情况下更新页面的部分数据成为可能,可是 iframe的大小却不像层那样可以“伸缩自如”,所以带来了使用上的麻烦,给iframe设置高度的时候多了也不好,少了更是不行,现在,让我来告诉大 家一种iframe动态调整高度的方法,主要是以下JS函数: 第一种方法:代码简单,兼容性还可以,大家可以先测试下。 复制代码 代码如下: function SetWinHeight(obj) { var w…
2011-04-21 11:58 · 收藏
jquery 缓存问题
转载: http://halk.iteye.com/blog/592306 现象: 页面使用jQuery的Ajax方式更改内容,提交保存至数据库后使用jQuery.getJSON方式重新读取数据,页面没有更新,重新登录系统后页面才显示更改后的数据。 原因: IE会缓存jQuery的get请求,导致不能查询到新的数据 解决方法 : 1、在请求URL后添加随机数,例如: Js代码 var url ="/operaterMultiAction.do?randomNum="+Math.random(); var url ="/operaterMultiAction.do?randomNum="+Ma…
2011-03-21 10:11 · javascript
js导出HTML到EXCEL(ONLY IE)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>js导出HTML到EXCEL(ONLY IE)</title> <script langu…
2011-02-25 14:22 · javascript
JavaScript 图片变换效果(ie only)
http://www.cnblogs.com/cloudgamer/archive/2008/05/23/1205642.html
2011-02-14 17:07 · javascript
System Properties
Properties props=System.getProperties(); // 系统属性 System.out.println("Java 的运行环境版本: "+props.getProperty("java.version")); System.out.println("Java 的运行环境供应商: "+props.getProperty("java.vendor")); System.out.println("Java 供应商的 URL : "+props.getProperty("java.vendor.url")); System.out.println("Java 的安装路…
2011-02-12 16:07 · java
Eclipse出现Failed to create the Java Virtual Machine和The Eclipse executable launch
百度了一下,按照网上说法,将配置文件修改如下 -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash o…
2011-02-10 08:47 · 收藏
JS获取GET参数
对于 URL,我们需要了解更多,因为我们的开发中可能会需要提取URL的部分信息来做不同的事情,事实上这也是与后端交互的一种独特的方式,当然这肯定是安全的,当请求被返回,关于 url 的信息就被记录在了 Window 对象的 Location对象中,取值的结果并不随着用户手动修改地址栏中的字符而发生任何改变,这一点是很重要的。了解了这些内容,那么我们从下面这张图开始吧: 图片中间那一行较长的字符串是一个完整的 URL,它包含了一个 URL 中可能包含的任何部分:协议、域名、端口号(当然,大多数情况下,我们在浏览网页的时候并没有看到端口号,因为他被隐藏了,默认就是80端口,你加上也不会有错)、路…
2011-01-26 16:49 · javascript
尚学堂struts2 ognl讲解
<?xml version="1.0" encoding="GB18030" ?> <%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030"%> <%@ taglib uri="/struts-tags" prefix="s" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> …
2011-01-09 17:28 · ssh2