租凭项目记录
来源:互联网 发布:js防水涂料是刚性的吗 编辑:程序博客网 时间:2024/04/28 08:56
1、百度地图两点距离
/** * 计算两点之间距离 * * @param start * @param end * @return 米 */ public double getDistance(double lat_a, double lng_a, double lat_b, double lng_b) { double pk = 180 / 3.14169; double a1 = lat_a / pk; double a2 = lng_a / pk; double b1 = lat_b / pk; double b2 = lng_b / pk; double t1 = Math.cos(a1) * Math.cos(a2) * Math.cos(b1) * Math.cos(b2); double t2 = Math.cos(a1) * Math.sin(a2) * Math.cos(b1) * Math.sin(b2); double t3 = Math.sin(a1) * Math.sin(b1); double tt = Math.acos(t1 + t2 + t3); return 6366000 * tt; }
2、list排序
package com.test1.listpaixu;import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.util.List;public class maintest { @SuppressWarnings("unchecked") public static void main(String[] args) { Student zlj = new Student("丁晓宇", 21); Student dxy = new Student("赵四", 22); Student cjc = new Student("张三", 11); Student lgc = new Student("刘武", 19); List<Student> studentList = new ArrayList<Student>(); studentList.add(zlj); studentList.add(dxy); studentList.add(cjc); studentList.add(lgc); Collections.sort(studentList, new SortByAge()); for (Student student : studentList) { System.out.println(student.getName() + " / " + student.getAge()); } System.out.println(" = "); Collections.sort(studentList, new SortByName()); for (Student student : studentList) { System.out.println(student.getName() + " / " + student.getAge()); } }}class SortByAge implements Comparator { public int compare(Object o1, Object o2) { Student s1 = (Student) o1; Student s2 = (Student) o2; if (s1.getAge() > s2.getAge()) return 1; else if (s1.getAge() < s2.getAge()) { return -1; } return 0; }}class SortByName implements Comparator { public int compare(Object o1, Object o2) { Student s1 = (Student) o1; Student s2 = (Student) o2; return s1.getName().compareTo(s2.getName()); }}
0 0
- 租凭项目记录
- 项目记录
- 项目记录!
- 项目记录
- 项目记录
- 项目记录
- 项目记录
- 项目记录
- 记录项目
- 项目记录
- 项目错误记录
- 项目中的问题记录
- 项目管理培训记录
- 项目工作经验记录
- 中级项目过程记录
- 项目记录--架构
- android项目记录
- 论坛项目记录
- UITableView的分割线的应用
- 解决 e.g. x.new A() where x is an instance of xxx.class
- MySQL自带数据库test编码问题
- 一年半的工作总结
- android WIFI
- 租凭项目记录
- 我的MVC框架————GothaMVC(4)GothamDispatcher的实现和Model层的封装
- MySQL/phpmyadmin问题解决手记:#2002 – 服务器没有响应 (或者本地 MySQL 服务器的套接字没有正确配置)
- class
- HDU 1237 简单计算器(后缀式+栈)
- PHP编程效率的20个要点
- POJ1456(贪心)
- opengl绘制几何体的函数
- 原创翻译:James Whittaker系列——Google是如何测试的(2)