Warning
These guidelines haven't been updated since 2016. Learn more…
Table of contents
class throttle(object): | |
""" | |
Decorator that prevents a function from being called more than once every | |
time period. | |
To create a function that cannot be called more than once a minute: | |
@throttle(minutes=1) | |
def my_fun(): | |
pass |
var callcc = function(f){ | |
var c = new Continuation(); | |
return f(c); | |
}; | |
// Original code | |
// (let* ((yin ((lambda (cc) (newline) cc) | |
// (call/cc (lambda (bar) bar)))) | |
// (yang ((lambda (cc) (display "*") cc) | |
// (call/cc (lambda (foo) foo))))) |
android { | |
signingConfigs { | |
release | |
} | |
buildTypes { | |
release { | |
signingConfig signingConfigs.release | |
} |
import java.time.*; | |
import java.time.format.DateTimeFormatter; | |
import java.time.format.FormatStyle; | |
import java.time.temporal.ChronoUnit; | |
import java.time.temporal.TemporalAdjusters; | |
import java.util.*; | |
import static java.time.temporal.TemporalAdjusters.*; | |
public class Java8DateTimeExamples { |
public class GroupViewHolder extends MainViewHolder { | |
@InjectView ( R.id.groupTitle ) | |
TextView mTitle; | |
@InjectView ( R.id.groupContent ) | |
TextView mContent; | |
public GroupViewHolder ( View itemView ) { | |
super ( itemView ); |
Warning
These guidelines haven't been updated since 2016. Learn more…
Table of contents
@Override | |
public void onNext(ArrayList<Phrase> phrases) { | |
ArrayList<Integer> phraseIDs = new ArrayList<>(); | |
Observable | |
.from(phrases) | |
.collect(phraseIDs, new Action2<ArrayList<Integer>, Phrase>() { | |
@Override | |
public void call(ArrayList<Integer> integers, Phrase phrase) { | |
integers.add(phrase.getId()); | |
} |
import android.content.Context; | |
import android.os.Debug; | |
import java.io.File; | |
public class OomExceptionHandler implements Thread.UncaughtExceptionHandler { | |
private static final String FILENAME = "out-of-memory.hprof"; | |
public static void install(Context context) { | |
Thread.UncaughtExceptionHandler defaultHandler = Thread.getDefaultUncaughtExceptionHandler(); |