随笔分类 -  Java

摘要:public class SortHeap { public static void sort(int[] data) { // 构建大顶堆 for (int i = (data.length - 2) / 2; i >= 0; i--) { adjustHeap(data, i, data.len 阅读全文
posted @ 2020-03-06 12:19 误入IT界的农民工 阅读(171) 评论(0) 推荐(0)
摘要:快捷键Ctrl + Alt + S打开设置面板,勾选Build project automatically选项: 快捷键Ctrl + Shift + A查找registry命令: 在查找到的registry命令通过鼠标双击或敲回车键,在弹出的面板中搜索关键字automake,找到并勾选compile 阅读全文
posted @ 2018-04-16 10:39 误入IT界的农民工 阅读(3446) 评论(0) 推荐(0)
摘要:起初并没有遇到什么困难,用Shiro的session管理来实现,使用的sessionDao层实现主要用的还是RedisSessionDAO。登录认证一切OK。但是当我去修改缓存时候,需要从session当中将对象的属性取出来的时候(此时为Object类型),再转成对应的类型就发生了类型转换异常(不是 阅读全文
posted @ 2018-04-12 11:05 误入IT界的农民工 阅读(1517) 评论(0) 推荐(0)
摘要:后端把Long类型的数据传给前端,前端可能会出现精度丢失的情况。例如:201511200001725439这样一个Long类型的整数,传给前端后会变成201511200001725440。 解决方法: 方法一:在后台将这个Long类型的字段转换成String类型的,风险比较大。 方法二:使用fast 阅读全文
posted @ 2018-04-11 17:20 误入IT界的农民工 阅读(1396) 评论(0) 推荐(0)
摘要:输出结果: ClassB --> static block B1 + 0ClassB -->static block2 +1ClassA --> static block B1 + 0ClassA -->static block2 +1ClassA static getvaluesA:2ClassB 阅读全文
posted @ 2018-03-24 22:56 误入IT界的农民工 阅读(2840) 评论(0) 推荐(0)
摘要:import cn.jpush.api.JPushClient;import cn.jpush.api.common.resp.APIConnectionException;import cn.jpush.api.common.resp.APIRequestException;import cn.j 阅读全文
posted @ 2018-01-27 16:37 误入IT界的农民工 阅读(186) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/baicp3/article/details/15848039 阅读全文
posted @ 2018-01-26 14:58 误入IT界的农民工 阅读(121) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { /** * 解析jsonArray */ String jsonArray = "[{\"provece\":\"qinghai\"},{\"beijing\":\"chaoyang\"}]"; getJsonArra(jsonArray); } public static void... 阅读全文
posted @ 2017-11-21 23:07 误入IT界的农民工 阅读(10865) 评论(0) 推荐(0)
摘要:public static void main(String[] args) { String json = "{\"code\":\"200\",\"msg\":\"数据获取成功\",\"data\":{\"codes\":900,\"HuKouBen\":\"zhangsan\",\"FangChanZheng1\":null}}"; /** * 将Json字符串转换为J... 阅读全文
posted @ 2017-11-21 22:46 误入IT界的农民工 阅读(223) 评论(0) 推荐(0)
摘要:判断一个数中最大回文数的长度 :例如12332112345654321中最大的回文数是12345654321,长度为11 阅读全文
posted @ 2017-11-11 18:04 误入IT界的农民工 阅读(795) 评论(0) 推荐(0)
摘要:public class NumberDegrees { private final static int N = 3; public static void main(String[] args) { int x[][]={ {0,2,0,0,0,9,0,1,0,0}, {5,0,6,0,0,0,3,0,9... 阅读全文
posted @ 2017-11-11 13:16 误入IT界的农民工 阅读(1032) 评论(0) 推荐(0)
摘要:递归遍历二叉树: 阅读全文
posted @ 2017-11-11 13:11 误入IT界的农民工 阅读(153) 评论(0) 推荐(0)
摘要:创建一棵二叉树: 阅读全文
posted @ 2017-11-11 13:09 误入IT界的农民工 阅读(158) 评论(0) 推荐(0)
摘要:public static void unzip1(String zipName, String temPath) throws IOException { ZipFile zip = new ZipFile(new File(zipName),Charset.forName("UTF-8")); String zipName1 = zip.getName().substring(zip... 阅读全文
posted @ 2017-11-11 13:05 误入IT界的农民工 阅读(277) 评论(0) 推荐(0)
摘要:package com.wang.sort; import java.util.Arrays; public class Sort { /** * 1.直接插入排序 * 思想:当前数与前面已经排好顺序的数进行比较,插入到合适的位置 * @param arra */ public void simpl 阅读全文
posted @ 2017-11-11 13:01 误入IT界的农民工 阅读(805) 评论(0) 推荐(0)
摘要:例如求1235的反序5321: /** * 字符反序 * @param data * @return */ public static int getRever(int data) { int temp = data; int result = 0; //数字反序 while (temp > 0) { resu... 阅读全文
posted @ 2017-11-11 12:53 误入IT界的农民工 阅读(222) 评论(0) 推荐(0)
摘要:public static int[] twoArray(int[] a, int[] b) { int i =0; int j = 0; int k = 0; int aLen = a.length; int bLen = b.length; int[] arra = new int[aLen + bLen]; while... 阅读全文
posted @ 2017-11-11 12:51 误入IT界的农民工 阅读(385) 评论(0) 推荐(0)
摘要:/** * 非递归斐波那契数列 * @param args */ public static int getFieibolaLie(int number) { int data = 0; int n = 1; int m = 1; if (number = 2) { data += n; ... 阅读全文
posted @ 2017-11-11 12:48 误入IT界的农民工 阅读(407) 评论(0) 推荐(0)
摘要:/** * 水仙花数 */ public static void findDaffodilNumbe() { for (int i = 100; i list = getList(i); for (int j = 0; j getList(int n) { List list = new ArrayList(); list.add(n % 10); ... 阅读全文
posted @ 2017-11-11 12:46 误入IT界的农民工 阅读(290) 评论(0) 推荐(0)