Receiver vs. return value:
| Returns block result | Returns receiver | |
|---|---|---|
Receiver available as it |
let |
also |
Receiver available as this |
run |
apply |
How to read the table:
| #!/usr/local/bin/zsh | |
| if [[ -z $1 ]]; then | |
| echo "usage: ./decompile.sh path_to_apk" | |
| exit 0 | |
| elif ! [[ -f $1 ]]; then | |
| echo "$1: No such file or directory" | |
| exit 1 | |
| fi |
| interface HasContext { | |
| fun getContext(): Context | |
| val Int.dp | |
| get() = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, this.toFloat(), getContext().resources.displayMetrics).toInt() | |
| } |
| package com.example | |
| import android.arch.lifecycle.ViewModel | |
| import android.arch.lifecycle.ViewModelProvider | |
| import javax.inject.Inject | |
| import javax.inject.Provider | |
| /** | |
| * Lets us use [Inject] annotations on [ViewModel] classes. |
| val <T> LiveData<T>.blockingValue: T? | |
| get() { | |
| var value: T? = null | |
| val latch = CountDownLatch(1) | |
| observeForever { | |
| value = it | |
| latch.countDown() | |
| } | |
| if (latch.await(2, TimeUnit.SECONDS)) return value | |
| else throw Exception("LiveData value was not set within 2 seconds") |
| package com.github.arekolek.diffutil | |
| import android.arch.lifecycle.* | |
| import android.os.Bundle | |
| import android.support.v7.app.AppCompatActivity | |
| import android.support.v7.util.DiffUtil | |
| import android.support.v7.widget.RecyclerView | |
| import android.util.Log | |
| import android.view.LayoutInflater | |
| import android.view.View |
Receiver vs. return value:
| Returns block result | Returns receiver | |
|---|---|---|
Receiver available as it |
let |
also |
Receiver available as this |
run |
apply |
How to read the table:
| {"el":{"gu":"Gujarati","ga":"Ιρλανδικά","gn":"Γουαρανί (Υοπαρά)","gl":"Galician","la":"Latin","tt":"Tatar","tr":"Τουρκικά","lv":"Latvian","tl":"Ταγκάλογκ","th":"Ταϊλανδέζικα","te":"Τελούγκου","ta":"Ταμίλ","yi":"Γίντις","dk":"Ντοθράκι","de":"Γερμανικά","db":"Dutch (Belgium)","da":"Δανέζικα","uz":"Uzbek","el":"Ελληνικά","eo":"Εσπεράντο","en":"Αγγλικά","zc":"Chinese (Cantonese)","eu":"Basque","et":"Estonian","ep":"English (Pirate)","es":"Ισπανικά","zs":"Κινέζικα","ru":"Ρωσικά","ro":"Ρουμανικά","be":"Belarusian","bg":"Bulgarian","ms":"Malay","bn":"Μπενγκάλι","ja":"Ιαπωνικά","or":"Oriya","xl":"Lolcat","ca":"Καταλανικά","xe":"Emoji","xz":"Zombie","cy":"Ουαλικά","cs":"Τσέχικα","pt":"Πορτογαλικά","lt":"Lithuanian","pa":"Παντζαπικά (Γκουρμούκι)","pl":"Πολωνικά","hy":"Armenian","hr":"Croatian","hv":"Υψηλά Βαλυριανά","ht":"Κρεόλ Αϊτής","hu":"Ουγγρικά","hi":"Ινδικά","he":"Εβραϊκά","mb":"Malay (Brunei)","mm":"Malay (Malaysia)","ml":"Malayalam","mn":"Mongolian","mk":"Macedonian","ur":"Urdu","kk":"Kazakh","uk":"Ουκρανικά"," |
| [alias] | |
| st = status | |
| aliases = config --get-regexp ^alias\\. | |
| precommit = diff --cached --minimal -w | |
| amend = commit --amend | |
| discard = checkout -- | |
| unstage = reset HEAD -- | |
| stashes = stash list | |
| save = commit -m | |
| graph = log --graph --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order |
| // ==UserScript== | |
| // @name No mousewheel-zoom | |
| // @namespace http://github.com/arekolek | |
| // @version 0.1 | |
| // @author Arek Olek | |
| // @match http://*/* | |
| // @match https://*/* | |
| // @grant none | |
| // ==/UserScript== |
| library(plyr) | |
| file = paste(commandArgs(TRUE)[1], '.txt', sep='') | |
| d = read.table(file, col.names=c('n', 'vertices', 'edges', 'edge', 'out_degree', 'adjacent_vertices', 'add_edge', 'remove_edge', 'source', 'target')) | |
| d = ddply(d, ~n, colwise(mean)) | |
| d[,c(3:6,8)] = d[,c(3:6,8)]/1000 |