This file contains hidden or 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 static String humanReadableByteCount(long bytes, boolean si) { | |
int unit = si ? 1000 : 1024; | |
if (bytes < unit) return bytes + " B"; | |
int exp = (int) (Math.log(bytes) / Math.log(unit)); | |
String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp-1) + (si ? "" : "i"); | |
return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); | |
} |
This file contains hidden or 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 codetail.project.watchme.common.drawables; | |
import android.annotation.TargetApi; | |
import android.content.res.Resources; | |
import android.content.res.TypedArray; | |
import android.content.res.XmlResourceParser; | |
import android.graphics.BitmapFactory; | |
import android.graphics.drawable.ColorDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.os.Build; |
This file contains hidden or 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 spoon.test; | |
import spoon.reflect.declaration.*; | |
import java.util.ArrayList; | |
import java.util.IntSummaryStatistics; | |
import java.util.TreeSet; | |
import java.util.function.Consumer; | |
import java.util.function.ToIntFunction; |
This file contains hidden or 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
#ifndef __JniWrapper_h__ | |
#define __JniWrapper_h__ | |
#include <jni.h> | |
#include <string> | |
#include <exception> | |
//#include <boost/noncopyable.hpp> | |
namespace Android |
This file contains hidden or 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
# coding: utf8 | |
import re, json, bs4, requests, argparse, os, optparse | |
from urlparse import parse_qs, urlsplit, urlparse | |
ALL = -100 | |
KEY_EPISODE_NUMBER = "episode" | |
KEY_EPISODE_SEASON = "season" | |
KEY_EPISODE_FILE = "file" |
This file contains hidden or 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
@Beta | |
private class HeaderDecor extends RecyclerView.ItemDecoration { | |
private RecyclerView.AdapterDataObserver adapterDataObserver; | |
private RecyclerView.ViewHolder headerViewHolder; | |
private int headerViewType; | |
private final Rect tmpBounds = new Rect(); | |
@Override public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { | |
if (headerViewHolder == null) { | |
headerViewHolder = obtainViewHolder(parent); |
This file contains hidden or 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 io.codetail.trade.activities.preview; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v4.graphics.drawable.DrawableCompat; | |
import android.support.v4.widget.TextViewCompat; | |
import android.util.AttributeSet; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.widget.ImageView; |
This file contains hidden or 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
object Detective : SimpleActivityLifecycleCallbacks() { | |
private infix fun <T> List<T>.notContains(element: T): Boolean { | |
return !contains(element) | |
} | |
/** Timeout when app looses focus */ | |
private val backgroundEnterTimeout: Int = 120 | |
private val appFocusListeners = ArrayList<ApplicationFocusListener>() | |
private var registered = false |
This file contains hidden or 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
ּ_בּ | |
בּ_בּ | |
טּ_טּ | |
כּ‗כּ | |
לּ_לּ | |
מּ_מּ | |
סּ_סּ | |
תּ_תּ | |
٩(×̯×)۶ | |
٩(̾●̮̮̃̾•̃̾)۶ |
This file contains hidden or 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 uz.lamuz.player.ui.widget.cover; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.Color; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.graphics.drawable.ColorDrawable; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.TransitionDrawable; |