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
import java.security.SecureRandom; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; | |
import java.math.BigInteger; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
/* | |
* PBKDF2 salted password hashing. | |
* Author: havoc AT defuse.ca |
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
/** | |
* @brief 圆环饼图统计view | |
* Created by zhen.liu on 1/5/16. | |
*/ | |
public class PieRingView extends View { | |
private float convertAngel; | |
private float radiusCircle; | |
// 用于绘制圆弧的矩形 | |
private RectF mCircleRectF; | |
private Paint paint; |
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 class GalleryAccountAdapter extends RecyclerView.Adapter<GalleryAccountAdapter.ViewHolder> { | |
private static final String tag = GalleryAccountAdapter.class.getSimpleName(); | |
private LayoutInflater mInflater; | |
private RelativeLayout relativeLayout; | |
private OnItemClickListener mOnItemClickListener; | |
// 列表项布局id | |
private int item_ResID; | |
private List<HistoryAccount> historyAccountData; |
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 class FloatingWindow extends FrameLayout { | |
private static final String TAG = "FloatCallView"; | |
private Context mContext; | |
private int mediaType; | |
public static int viewHeight; | |
public static int viewWidth; |
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
/** | |
* 视频录制自定义View | |
* | |
* @author zhen.liu | |
* @version 1.0 | |
* @date 2016/6/30 | |
*/ | |
public class VideoRecorderView extends LinearLayout implements MediaRecorder.OnErrorListener { | |
private static String TAG = "VideoRecordView"; |
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 double mySqrt(int x, double precision) { | |
if (x == 1 || x == 0) { | |
return x; | |
} | |
float left = 0, right = x; | |
while (left <= right) { | |
float mid = left + (right - left) / 2; | |
if (Math.abs(mid * mid - x) <= precision) { | |
return mid; | |
} else if (mid > x / mid) { |
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 class AVLTree { | |
public static class Node { | |
int data; | |
Node leftChild; | |
Node rightChild; | |
int height; | |
public Node(int data) { | |
this.data = data; |
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
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
public class HuffmanTree { | |
public static class Node<E> { | |
E data; | |
int weight; |
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 class Graph { | |
// 节点数目 | |
int size; | |
// 保存顶点信息 | |
String[] nodes; | |
// 保存边的信息 | |
int[][] edges; | |
/** | |
* A B C D E F G |
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 graph; | |
public class Dijkstra { | |
// 节点数目 | |
int size; | |
// 定点信息 | |
String[] nodes; | |
// 保存边的信息 | |
int[][] edges; |
OlderNewer