`
dreamoftch
  • 浏览: 484933 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
    Eclipse version: Eclipse Java EE IDE for Web Developers.   Version: Kepler Service Release 1 Build id: 20130919-0819     lamdba学习: public class Employ { private String name; private int salary; public Employ(String name, int salary, Department department) { super(); th ...
Maven常见的问题集锦    先说结果吧,要添加其它的远程仓库,需要在maven的conf目录下的setting.xml里面添加下面配置:   在   <profiles> 节点下添加(里面的url地址就是仓库的地址,根据自己的情况替换就好了):     <profile> <id>dev</id> <repositories> <repository> <id>company</id> <name>compa ...
  自执行函数(立即执行): 不能直接这样: function(){ alert('a'); }() 因为这样会解析出错,需要加上括号: (function(){ alert('a'); })() 或者: (function(){ alert('a'); }())   DOM元素节点:元素节点,属性节点,文本节点 function _nodeFn(domEle){ if(domEle.nodeType == 1){//元素节点 alert(domEle.nodeName);//或者tagName }else i ...
   注:通常我们的action都要继承ActionSupport,这里都默认继承了该类   参考资料:   http://struts.apache.org/release/2.2.x/docs/spring-plugin.html   http://struts.apache.org/release/2.2.x/docs/spring-and-struts-2.html   要想将struts2和spring整合起来,只需要引入 struts2-spring-plugin-x-x-x.jar 即可   然后打开jar包,发现里面有一个struts-plugin.xm ...
   做一下笔记(参考Spring 事务管理高级应用难点剖析: 第 2 部分):   调用私有方法:下面的私有方法test出现异常,会受到事务控制   package com.tch.test.template.service; import java.util.Date; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import org.springframework.transaction.an ...
  用winscp 可以方便的将window的文件上传到linux机器上。   今天学习的linux命令:   ls:(列出当前目录下的文件和文件夹) ls -lt:(列出文件,并按照时间降序显示) ls -ltr:(列出文件,并按照时间升序显示)   cd : cd -(回到进入当前目录之前所在的目录,比如刚开始在/home/test目录,然后我执行了cd /var进入/var目录下,此时我执行cd -就可以回到/home/test目录了。类似浏览器页面回退的功能)   pwd:(显示当前目录)   mkdir:创建目录   touch:创建文件   r ...
问题一:调度器(admin)和执行器(executor)之间如何互相通信? admin公共spring-mvc提供了一个rest的接口给执行器调用(com.xxl.job.admin.controller.JobApiController#api)。 com.xxl.job.admin.controller.JobApiController#api方法作为执行器调用admin的统一入口,在该方法里面通过反射执行不同的操作(注册,删除注册,回调等),提供给执行器操作的api接口定义在com.xxl.job.core.biz.AdminBiz中。 其中回调主要是更新job的执行时间,执行是 ...
    参考链接 比如要查询每个人创建的前10条公司:   select a.* from organization a where (select count(1) from organization b where a.created_by = b.created_by and b.id < a.id) < 10
    参考链接:http://www.codejava.net/java-se/graphics/adding-a-watermark-over-an-image-programmatically-using-java   一: 添加文字水印:   /** * Embeds a textual watermark over a source image to produce * a watermarked one. * @param text The text to be embedded as watermark. * @param sourceImageFil ...
  https://www.journaldev.com/661/java-ftp-client-upload-example-apache-commons-net   gradle依赖:   compile 'commons-net:commons-net:3.6'     import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import or ...
    kotlin代码:   private fun validateIdCard(cardNo: String?): Boolean { cardNo ?: return false if (cardNo.length != 18 || !cardNo.substring(0, 17).matches(Regex("\\d{17}"))) { return false } // 身份证号前17位分别和下面的array中对应的值相乘之后求和 ...
fun connectDb() { Class.forName("com.mysql.jdbc.Driver") val url = "jdbc:mysql://xxx:3306/xxx?user=xxx&password=xxx" val conn = DriverManager.getConnection(url) val md = conn.metaData val rs = md.getTables(null, null, "%", null) while ...
    参考资料:https://www.elastic.co/guide/en/elasticsearch/client/java-api/2.4/index.html 注:es版本为2.4.0   1.下载安装: 下载地址:https://www.elastic.co/downloads/elasticsearch 下载之后解压,运行 bin/elasticsearch 即可   2.maven依赖:
  简而言之,如果两个document之间的mapping比较类似,则使用type(同一个index下两个type),否则使用两个index可能是更好的选择。   https://www.elastic.co/blog/index-vs-type   注意红色字体的部分:   Who has never wondered whether new data should be put into a new type of an existing index, or into a new index? This is a recurring question for new user ...

java生成群头像

  参考:http://www.2cto.com/weixin/201503/382943.html   通过java生成类似微信的群头像:   package com.tch.test.common.image; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.geom.AffineTransform; import java.awt.image.AffineTransformOp; ...
Global site tag (gtag.js) - Google Analytics