随笔分类 - questions
this is some questions in my life
摘要:int cur = 1000; Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int next = scanner.nextInt(); if (next > 0 && next + cur < 2000) { ...
阅读全文
摘要:eg:System.out.println(10.00 - 9.93)我们很期望它的结果是:0.07 但是它的值却是:0.07000000000000028 这是为什么呢?浮点间的运算有可能是不正确的。这是有计算机的存储规则所决定的。这种情况可以有两种解决方案: 使用BigDecimal .本身提供了常用的加减乘除的运算。专门为弥补计算浮点的。 使用整形。先将参与运算的值扩...
阅读全文
摘要:package com.hqb360.uic.biz.point.impl;import com.hqb360.common.lang.DateUtil;import java.util.Date;/** 生成随机时间* Created with IntelliJ IDEA.* User:* Date: 14-3-25* Time: 上午10:59*/public clas...
阅读全文
摘要:在做包剪锤游戏时,下注的时候提交一个json 请求。不断的刷新后,点击下注,提示页面过期。 经分析研究有如下疑问: 1.页面已经产生了新的token, 点击下注按钮 ,匹配session中的token,发现找不到了token的值,提示页面已经过期,请刷新。 2.右键刷新之后,为何也没有产生新的token 值。 3.测试发现在地址栏直接回车或者CRAT + F5 强制刷新,可以产生新的t...
阅读全文