`
z610
  • 浏览: 37684 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
对于老的php版本是没有json_encode 和json_decode函数的,但是又想使用这个功能。下边就是一个用php代码写的json encode 和decode 的函数。     function fromJSON ( $json, $assoc = false ) {     /* by default we don't tolerate ' as string delimiters      if you need this, then simply change the comments on      the following lines: */       ...
  IP:  /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/   IP with sub mask /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:/(3[0-2]|2[0-9]|1[0-9]|[1-9]))?$/   IP range /(^( ...
这是用ExtJS draw API实现的Tag Cloud控件。 源代码和示例都在附件里。      
查看系统的配置   sysctl -a |grep net.core   设置系统的参数   sysctl -w net.core.rmem_max=5000000 sysctl -w net.core.wmem_max=5000000sysctl -w net.core.rmem_default=5000000sysctl -w net.core.wmem_default=5000000   更改文件: /etc/sysctl.conf
  public class TmpTest { /** * @param args */ public static void main(String[] args) { final Map<String, Object> map = new LinkedHashMap<String, Object>(); map.put("a", 1); map.put("b", "a"); map.put("c", 2); final Gson g ...
Tomcat 默认的post参数的最大大小为2M, 当超过时将会出错,可以配置maxPostSize参数来改变大小。   maxPostSize=“0” 0表示不限制大小     <Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="20000"  redirectPort="8443" maxPostSize="0"/>

Tomcat远程调试

配置Tomcat支持远程调试:   startup.bat  倒数第二行   call "%EXECUTABLE%" start %CMD_LINE_ARGS%   改为   call "%EXECUTABLE%" jpda start %CMD_LINE_ARGS%

Basic JDBC example

    博客分类:
  • java
String connectionURL = "jdbc:mysql://localhost:3306/test"; // Change the connection string according to your db, ip, username and password Connection con = null; try { // Load the Driver class. Class.forName("com.mysql.jdbc.Driver"); // If you are using ...
Geoserver默认的地图影射方式是EPSG:4326,但是对于常用的WebGIS来说,常用的影射方式是EPSG:900913,下边的代码用来设置openlayers,通知geoserver使用新的映射算法     var options = { projection: new OpenLayers.Projection("EPSG:900913"), maxResolution:156543.0339, maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508. ...
rem ----- Execute The Requested Command ---------------------------------------   set JAVA_OPTS=%JAVA_OPTS% -server -Xms256m -Xmx256m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=256m
package com.dts.test; import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.cfg.Configur ...
后台扩展一个filter,判断session过期的代码需要自己写,我这里直接就认为session过期了   public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) res; ...
前台 "exportPubSubStatistics.action?data=" + encodeURIComponent(retData)   后台 data = new String(data.getBytes("iso8859-1"), "utf-8");
转载: http://1985wanggang.blog.163.com/blog/static/7763833200971311246457/   在导出excel时,发现中文的标题乱码,试了N种编码方式,开始总是试图转为utf-8,gb2312,gbk,没想到转为iso-8859-1中文乱码的问题解决了 fileName = new String(fileName.getBytes(),"iso-8859-1");  response.setCharacterEncoding("gb2312");  response.reset();  r ...
http://blog.csdn.net/tianhai110/archive/2008/03/21/2203572.aspx   Bézier curve(贝塞尔曲线)是应用于二维图形应用程序的数学曲线。 曲线定义:起始点、终止点(也称锚点)、控制点。通过调整控制点,贝塞尔曲线的形状会发生变化。 1962年,法国数学家Pierre Bézier第一个研究了这种矢量
Global site tag (gtag.js) - Google Analytics