public static <T> List<List<T>> getPaginate(Collection<T> c, Integer pageSize) {
if (c == null) return Collections.emptyList();
List<T> list = new ArrayList<T>(c);
if (pageSize == null || pageSize <= 0 || pageSize > list.size()) pageSize = list.size();
int numPages = (int) Math.ceil((double) list.size() / (double) pageSize);
List<List<T>> pages = new ArrayList<List<T>>(numPages);
for (int pageNum = 0; pageNum < numPages; ) {
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.yyz; | |
import java.io.UnsupportedEncodingException; | |
import java.net.HttpURLConnection; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.NameValuePair; |
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 android.content.Context; | |
import android.support.annotation.Nullable; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.util.AttributeSet; | |
import android.view.KeyEvent; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.inputmethod.InputMethodManager; | |
import android.widget.EditText; |
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 | |
# Copyright (c) 2014 Leonard Wu <[email protected]> | |
# MIT License | |
# Android SQLite DB Pull (adb-db-pull, v1.2) | |
# https://github.com/leonardw/adb-db-pull.git | |
ADB=`which adb` | |
ADB_SHELL="$ADB shell" | |
SELF=`basename $0` |
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 android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.RequiresApi; | |
import android.support.v4.content.ContextCompat; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.View; |
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 android.content.Context; | |
import android.graphics.Color; | |
import android.os.Build; | |
import android.support.annotation.Nullable; | |
import android.support.annotation.RequiresApi; | |
import android.support.annotation.StringRes; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.widget.FrameLayout; |
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 android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
/** | |
* @author yuana <[email protected]> | |
* @since 12/11/17 | |
*/ |
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
libraryGroupId=yuana.id | |
libraryArtifactId=anu | |
libraryVersion=1.0.0 |
The Z shell (zsh) is a Unix shell [...]. Zsh can be thought of as an extended Bourne shell with a large number of improvements, including some features of bash, ksh, and tcsh.
Read more about ZSH at An Introduction to the Z Shell.
Choose one of the following options.
OlderNewer