tianyalinfeng
tianyalinfeng · 共 355 篇文章
map转byte
public static byte[] getSerializedBytes(Map<String, Double> list) { if (null == list || list.size() < 0) return null; try { ByteArrayOutputStream bo = new ByteArrayOutputStream(); ObjectOutputStream os = new ObjectOutputStream(bo); os.writeObject(list); return bo.toByteArray(); } catch (IOException…
2012-06-14 09:35 · Java · 评论(0)
jquery获取位置和高度宽度
var left = $(this).offset().left; var top = $(this).offset().top; var height = $(this).height(); var width = $(this).width(); 设置 $(this).css({"left" : left, "top" : top });
2012-06-13 13:29 · Jquery · 评论(0)
java设置代理
Properties prop = System.getProperties(); prop.setProperty("http.proxyHost", "127.0.0.1"); prop.setProperty("http.proxyPort", "8087"); 参考: http://www.chahushequ.com/read.bbscs?action=topic&id=402882463a44194b013a4e94fb4d0360&bid=92&fcpage=1&fcaction=index&tagId=0
2012-06-11 16:01 · Java · 评论(0)
根据经纬度计算两点距离
经纬度换算成米 纬度分为60分,每一分再分为60秒以及秒的小数。 纬度线投射在图上看似水平的平行线,但实际上是不同半径的圆。有相同特定纬度的所有位置都在同一个纬线上。 赤道的纬度为0°,将行星平分为南半球和北半球。 纬度是指某点与地球球心的连线和地球赤道面所成的线面角,其数值在0至90度之间。位于赤道以北的点的纬度叫北纬,记为N,位于赤道以南的点的纬度称南纬,记为S。 纬度数值在0至30度之间的地区称为低纬地区,纬度数值在30至60度之间的地区称为中纬地区,纬度数值在60至90度之间的地区称为高纬地区。 赤道、南回归线、北回归线、南极圈和北极圈是特殊的纬线。 纬度1秒的长度 地球的子午线总长…
2012-06-08 10:46 · Java · 评论(0)
One sentence per day
2012-09-13 There are two kinds of regret that are most torturing: You can't have the one you love and the one you love fails to reach happiness. 人的一生,有两种遗憾最折磨人:一是得不到你心爱的人;二是心爱的人得不到幸福。 2012-09-12 It's crazy in the thing. I had to go half way around the world to find out that the perfect guy for me l…
2012-06-07 15:01 · English · 评论(0)
jquery文本框change事件无效
$("input[name='from']").change(function(){ alert("=="); }); change事件不起作用,可用如下方法(但是下面的方法仅对IE适用) $("input[name='from']").bind("propertychange", function() { alert("=="); });
2012-06-07 10:59 · Jquery · 评论(0)
复制Set集合
Set<String> set = new HashSet<String>(); Set<String> setCopy = new HashSet<String>(); setCopy.addAll(set);
2012-06-06 11:02 · Java · 评论(0)
ArrayList的remove()方法失败
Map<String,Integer> map = new HashMap<String,Integer>(); List list = new ArrayList(); list.remove(map.get(key)); //remove失败,原因map.get(key)是一个object,还没有转为int类型,而这个object在list中是不存在的 正确方法 int index = map.get(key); list.remove(index);
2012-06-05 11:45 · Java · 评论(0)
jflex-1.4.3
1. a lexical specification file for JFlex consists of three parts divided by a single line starting with %% UserCode Beside package and import statements there is usually not much to do here. %% Options and declarations %% Lexical rules
2012-05-23 13:38 · Java · 评论(0)
批处理文件里的路径含有空格
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_10" 把整个路径加上双引号即可,否则会出错
2012-05-23 10:30 · Windows · 评论(0)
lucene-3.6
Analyzer analyzer = new SimpleAnalyzer(Version.LUCENE_36); TokenStream ts = analyzer.tokenStream(null, new StringReader(str)); CharTermAttribute termAtt = stream.getAttribute(CharTermAttribute.class); TypeAttribute typeAtt= ts.getAttribute(TypeAttribute.class); OffsetAttribute offsetAtt= ts.getAttr…
Myeclipse9.0安装插件
下载插件,将解压后的所有文件放到C:\Program Files\MyEclipse\MyEclipse 9\dropins下 重启Myeclipse9.0即可
2012-05-18 11:45 · Java · 评论(0)
静态建模:用例和用例图(Use Case Diagram)
角色(actor)是与系统交互的人或事。角色是一个群体概念,代表的是一类能使用某个功能的 人或事,角色不是指某个个体。 发现角色: 使用系统主要功能的人是谁(即主要角色)? 需要借助与系统完成日常工作的人是谁? 谁来维护、管理系统(次要角色),保证系统正常工作? 系统控制的硬件设备有哪些? 系统需要与哪些其他系统交互?其他系统包括计算机系统,也包括该系统将要使用的计算 机中的其他应用软件。其他系统也分二类,一类是启动该系统,另一类是该系统要使用的 系统。 对系统产生的结果感兴趣的人或事是哪些? 用例代表的是一个完整的功能。在UML 中的用例是动作步骤的集合。 用例的特征: 用例总由角色初始化…
2012-05-18 11:22 · Uml · 评论(0)