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.support.v4.view.ViewCompat; | |
import android.support.v4.view.ViewPropertyAnimatorCompat; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
import com.mikepenz.itemanimators.DefaultAnimator; | |
public class ItemAnimator extends DefaultAnimator<ItemAnimator> { | |
public boolean useAnimation = true; |
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
@State(Scope.Benchmark) | |
@BenchmarkMode(Mode.Throughput) | |
@Fork(1) | |
@Warmup(iterations = 5) | |
@Measurement(iterations = 5) | |
public class KotlinRangeBenchmark { | |
@Param({"0", "123", "1000000", "1073741823", "2147483640", "2147483647"}) | |
private Integer param; | |
@Param({"1005000", "2147483647"}) |
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 TilingDrawable extends android.support.v7.graphics.drawable.DrawableWrapper { | |
private boolean callbackEnabled = true; | |
public TilingDrawable(Drawable drawable) { | |
super(drawable); | |
} | |
@Override | |
public void draw(Canvas canvas) { |
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.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
//java version "1.8.0_151" | |
//fix https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8142476 | |
public class LambdaGenHell { | |
interface IdEntity { |
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
typealias Either7<A, B, C, D, E, F, G> = Either<A, Either<B, Either<C, Either<D, Either<E, Either<F, G>>>>>> | |
typealias Either6<A, B, C, D, E, F> = Either7<A, B, C, D, E, F, Nothing> | |
typealias Either5<A, B, C, D, E> = Either7<A, B, C, D, E, Nothing, Nothing> | |
typealias Either4<A, B, C, D> = Either7<A, B, C, D, Nothing, Nothing, Nothing> | |
typealias Either3<A, B, C> = Either7<A, B, C, Nothing, Nothing, Nothing, Nothing> | |
fun <A, B, C, D, E, F, G, R> Either7<A, B, C, D, E, F, G>.fold( | |
ifa: (A) -> R, | |
ifb: (B) -> R, | |
ifc: (C) -> R, |
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 inlineEnumSet | |
import java.util.EnumSet | |
inline class InlineEnumSet<T : Enum<T>>(val set: UInt) { | |
companion object | |
} | |
//bit extraction functions |
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.Comparator; | |
import java.util.stream.Collector; | |
import java.util.stream.LongStream; | |
/** | |
* Stats of a stream of objects, including `count`, `min`, and `max`. | |
* Note that `min` and `max` are undefined if `count==0`. | |
* <p> | |
* This is intended to be used with `Stream.collect()`, for example | |
* </p> |
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.graphics.Canvas; | |
import android.graphics.ColorFilter; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
public class CenterCropDrawable extends Drawable { | |
private final Drawable drawable; |
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 2010-2017 JetBrains s.r.o. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
/* | |
* "stackblur" | |
* originally, Mario Klingemann, mario@quasimondo.com | |
* this implementation, Benjamin Yates (benjamin@rqdq.com) | |
* http://incubator.quasimondo.com/processing/stackblur.pde | |
* | |
* this blur routine seems to be quite popular. | |
* | |
* unfortunately, mario didn't comment anything. | |
* but, it's easy to see it's just a flavor of a two-pass |
OlderNewer