`
ld362093642
  • 浏览: 65132 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论
文章列表
采用正则表达式获取地址栏参数: function GetUrlParam(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)return unescape(r[2]); return null; } // 调用方式 var nexturl = GetUrlParam(" ...

node.js学习

推荐一本在线书籍《Node入门》,正在看,写的真的很细,适合入门看。 地址:http://www.nodebeginner.org/index-zh-cn.html
项目需要学了一下Maven,在网上翻了一个教程就开始安装,装完之后新建一个工程就出错了, 整个人都懵逼了。 命令:mvn archetype:create -DgroupId=com.rv.build -DartifactId=rvbuild 错误:Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.3:create (default-cli) on project standalone-pom: Unable to parse configuration of mojo or ...
gzip 压缩数据提交 public void parsePostParams(HttpRequestBase requestBase, HttpRequest req){ byte [] bgzip = gzip(req.postParamsToJson()); ((HttpPost)requestBase).setEntity(new InputStreamEntity(new ByteArrayInputStream(bgzip), bgzip.length)); } public byte[] gzip(St ...
String title= "eeee\"ttttttttt<aaa>aaa!qqq:vvv?mmmm/rrrr\\pppp|jj*jj*";// 你要处理的String //String regex = "(?<>\":\\|*)"; //查找开始标签的< String regex = "[!?<>\":\\\\|*/]+"; Pattern pattern = Pattern.compile(regex); M ...
//给zdgzuser用户zdgzrest库的所有权限 grant all privileges on zdgzrest.* to 'zdgzuser'@'%' identified by 'root'; MySql中添加用户,新建数据库,用户授权,删除用户,修改密码(注意每行后边都跟个;表示一个命令语句结束): 1.新建用户   1.1 登录MYSQL:   @>mysql -u root -p   @>密码   1.2 创建用户:   mysql> insert into mysql.user(Host,User,Passw ...
这个是JDK6新添的错误类型。是发生在GC占用大量时间为释放很小空间的时候发生的,是一种保护机制。解决方案是,关闭该功能,使用—— -XX:-UseGCOverheadLimit 加载了太多资源到内存,本地的性能也不好,gc时间消耗的较多 这里要查看是否有使用大内存的代码或死循环。 GC overhead limt exceed检查是Hotspot VM 1.6定义的一个策略,通过统计GC时间来预测是否要OOM了,提前抛出异常,防止OOM发生。Sun 官方对此的定义是:“并行/并发回收器在GC回收时间过长时会抛出OutOfMemroyError。过长的定义是,超过98%的时间 ...
readability 学习中 朋友给的资源 https://github.com/selectingProcess/snacktory(侵删) File f = new File("htmtmp/4186.htm"); Converter c = new Converter(); ArticleTextExtractor extractors = new ArticleTextExtractor(); JResult res = extractors.extractContent(c.streamToString( ...
//去掉html标签 $string = preg_replace ( "/(\<[^\<]*\>|\r|\n|\s|\[.+?\])/is", ' ', $string ); // //去掉字符串里面的html代码 // 要求数据要规范,比如大于小于号要配套,否则会被集体误杀。 public static String stripHtml(String content) { // <p>段落替换为换行 content = content.replaceAll("<p .*?>&q ...
/** apache ant Zip - [ant-1.7.0.jar] * 创建zip包 * @author * @since * @param directory 文件目录 * @param zipFile 压缩文件完整路径及文件名 */ public static final void zip(File directory, File zipFile) { Project prj = new Project(); Zip zip = new Zip(); zip.se ...
Java读取文本文件(例如csv文件、txt文件等),遇到中文就变成乱码。读取代码如下: List<String> lines=new ArrayList<String>(); BufferedReader br = new BufferedReader(new FileReader(fileName)); String line = null; while ((line = br.readLine()) != null) { lines.add(line); } ...
import java.io.File; import javax.xml.parsers.*; import org.w3c.dom.*; public class XMLReader { public static void reader(String readPath, JDBCConnector front, JDBCConnector rest){ //readPath = "F:/knowledgeExport"; File dir = new File(readPath); File[] files = dir. ...
XML中有这样一个节点,<address /> 空节点 出错前是这么写的 String source = doc.getElementsByTagName("source ").item(i).getFirstChild().getNodeValue(); 解决的办法就是在取值之前加一个判断: String source = ""; if(doc.getElementsByTagName("source").item(i).hasChildNodes()){//判断节点是否为空 doc.ge ...
//这里调用 数据是库表查的转为List<JSONObject> XMLWriter.createXML("data_id,url,country,full_name,intro,service_field,activity,source,u_time,u_user,u_type", itentsite, "info_source_it_ent", export_url, "info_source_it_ent-" + DateUtil.getNowTime4String("yyyyMMddHHmmss&qu ...
POST发送http请求 可请求cgi程序或REST程序获取JSON格式数据串,编码要统一 public static String http(String url, Map<String, String> params) { URL u = null; HttpURLConnection con = null; // 构建请求参数 StringBuffer sb = new StringBuffer(); if (params != null) { for (Entry<String, String> e : params.en ...
Global site tag (gtag.js) - Google Analytics