09 2009 档案
摘要:在网上找了个方法,解决了我的问题。在script中使用defer属性。意在页面加载完毕后再执行脚本,这样可以避免找不到对象的问题。defer不会考虑外部文件是否全部下载完,只会判当前页面是否全部加载完成。并且,有defer标签的代码块里不能写document.write方法 例如:<SCRIPT LANGUAGE="JavaScript" src="<%=path%>/pub/js/myDateControler/WdatePicker.js"defer="defer"></Script>
阅读全文
摘要:在linux系统中用 java命令执行.class程序是出现“段错误”,这个问题是因为jdk版本不一致的,比如系统环境变量jdk版本是1.4,但我把这个类放在jdk1.6的bin下编译,那执行.class文件时就出现段错误,这是可以把环境变量重新设置为你想要的jdk版本,把类放到相应版本的jdk下去编译就ok了。
阅读全文
摘要:在linux下装了svn后,用svn co http://subversion.tigris.org/ /temp 时出现could not resolve hostname 错误,需要在/etc/hosts 增加 192.168.1.195 debian.localdomain debian 这种域名与ip地址的映射,这样svn就可以正常co了。
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3322最小区间覆盖,排序加上贪心。#include <iostream> #include <algorithm> #include <cstdio>using namespace std;struct SetNode{ int a; int b;}mySet[5010];int n;int minPoint;int maxPoint;bool cmp(SetNode a, SetNode b){ if(a.a != b.a) return
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3321回溯,dfs实现,注意要用long long, 9个100相乘最大数需要long long表示。#include <iostream>#include <cstdio>using namespace std;long long a[20];int n;int k;long long ans;const long long inf = 1000000000000000LL;long long myabs(long long nn){ return
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1875#include <vector>#include <iostream>#include<algorithm>#include <string>#include <cstring>using namespace std;int main(){ vector<string> phonelist; int testcast; cin >> testcast; while(testcast--
阅读全文
摘要://设计一个支持大数运算的计算器,其中乘法使用分治法求解。该计算器支持加减乘除还有开方根运算。#include <iostream>#include <list>#include <string>#include <cstdio>#include <cctype>#include <cmath>using namespace std;list<char> Add(list<char> s, list<char> t);list<char> Sub(list<char&g
阅读全文
摘要:对于每一行 ,都要从某一位置分成两段 ,由于不能切出0长度的一段,所 以有n - 1个选择 ,一共m行 ,就是(n - 1)m种方案 。由于问题的规模很 小 ,暴力枚举所有情况取最优解就可以了。直接用dfs即可。#include <iostream>#include <cstdlib>#include <string>#include <cctype>using namespace std;const int MAXSIZE = 8;long nutrition[MAXSIZE][MAXSIZE];int m, n;long mindiff =
阅读全文
摘要:#include <iostream>#include <string>#include <stack>#include <fstream>using namespace std;char *pSrc = NULL;char *pDest = NULL;stack<char> s1;char res[1000];int cnt = 0;void work(){ if(*pDest == '/0'){ for(int i = 0; i < cnt; i++){ cout << res[i] <&l
阅读全文
摘要:java io写文件时写到文件的中文都成乱码,在windows是没问题的,主要是linux下默认字符集是utf-8,而windows默认编码是gbk,所以java 往文件里面写入中文时是根据系统默认字符集来写的。可以有两种方法,1.在java io往文件写时强制用系统编码写,StringfileEncode=System.getProperty("file.encoding");FileoutFile=newFile(path+separator+fileName);if(!outFile.exists()){outFile.createNewFile();}else{ou
阅读全文