This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.yct.demo.guava; | |
import com.google.common.base.MoreObjects; | |
import com.google.common.base.Objects; | |
import static com.google.common.base.Preconditions.*; | |
import com.google.common.collect.ComparisonChain; | |
import com.google.common.collect.Ordering; | |
public class Employee implements Comparable<Employee> { | |
private String name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具 | |
* | |
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本 | |
* @author geosmart | |
*/ | |
public class CoordinateTransformUtil { | |
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0; | |
// π | |
static double pi = 3.1415926535897932384626; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 获取原生gps信息,代码放 MainActivity 里就可以 | |
*/ | |
public void getGPSInfo() { | |
LocationManager mManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) | |
!= PackageManager.PERMISSION_GRANTED | |
&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) | |
!= PackageManager.PERMISSION_GRANTED) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BeanUtils { | |
/** | |
* 只要要克隆的对象以及对象所包含的引用类型的成员对象所在的类实现了 java.io.Serializable 接口即可做到完美克隆。 | |
*/ | |
@SuppressWarnings("unchecked") | |
public static <T> T cloneTo(T src) throws RuntimeException { | |
ByteArrayOutputStream memoryBuffer = new ByteArrayOutputStream(); | |
ObjectOutputStream out = null; | |
ObjectInputStream in = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function count() { | |
local insert=0 | |
local delete=0 | |
while read line ;do | |
current=`echo $line| awk -F',' '{printf $2}' | awk '{printf $1}'` | |
if [[ -n $current ]]; then | |
insert=`expr $insert + $current` | |
fi | |
current=`echo $line | sed -n 's/.*, //p' | awk '{printf $1}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo BEFORE COMMIT | |
ex=$(git remote -v | awk '{printf "%s\n",$1}' | grep wothing | wc -l) | |
if [[ $ex == 0 ]];then | |
git remote add wothing https://github.com/XXXXX/XXXX.git | |
fi | |
git fetch wothing | |
echo -e "UR \033[32m ahead $(git rev-list --left-only develop...wothing/develop | wc -l) \033[0m commits before" | |
echo -e "UR \033[31m behind $(git rev-list --right-only develop...wothing/develop | wc -l) \033[0m commits after" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mobi.dzs.util; | |
/** | |
* 16进制值与String/Byte之间的转换 | |
* @author JerryLi | |
* @email [email protected] | |
* @data 2011-10-16 | |
* */ | |
public class CHexConver | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.test; | |
import java.io.IOException; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.net.DatagramPacket; | |
import java.net.DatagramSocket; | |
import java.net.InetAddress; | |
import java.net.SocketException; | |
import java.net.UnknownHostException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
******************************* Copyright (c)*********************************\ | |
** | |
** (c) Copyright 2015, 蒋朋, china, qd. sd | |
** All Rights Reserved | |
** | |
** By(******公司) | |
** http://www.******.com | |
** | |
**-----------------------------------版本信息------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
来源:https://github.com/wtsang02/colors/blob/master/color.xml | |
Version: 2 | |
Organized by: Willie Tsang | |
--> | |
<resources> | |
<!-- Android style --> |