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.company.Home; | |
public class Geo { | |
public final int storona1; | |
public final int storona2; | |
public final int storona3; | |
public final int storona4; | |
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 enum Animal { | |
CAT, | |
DOG, | |
COW, | |
} |
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 Triangl { | |
private int one; | |
private int two; | |
private int three; | |
public Triangl(int one, int two, int three) { | |
this.one = one; | |
this.two = two; | |
this.three = three; |
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 static void main(String[] args) { | |
HashMap<String, Long> myHashMap = new HashMap<>(); | |
myHashMap.put("terramare", 380432275389L); | |
myHashMap.put("Mont blanc", 380680558887L); | |
for(Map.Entry<String, Long> entry: myHashMap.entrySet()) | |
System.out.println(entry.getKey() + " - " + entry.getValue()); | |
} |
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 Square<T extends Number> { | |
private T value; | |
public Square(T value) { | |
this.value = value; | |
} | |
public T getValue() { | |
return value; |
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
[ | |
{ | |
"Title": "They Shall Not Grow Old", | |
"Year": 2018, | |
"Rated": "R", | |
"Released": "01 Feb 2019", | |
"Runtime": "99 min", | |
"Genre": "Documentary, History, War", | |
"Director": "Peter Jackson", | |
"Writer": "Peter Jackson", |
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
val zip = BiFunction<Boolean, Boolean, Boolean> { t1, t2 -> t1 == t2 } | |
val bool1 = | |
Flowable.fromArray(true, false, true, false, false) | |
val bool2 = | |
Flowable.fromArray(false, true, true, false, true).zipWith(bool1, zip).subscribeOn( | |
Schedulers.io()).onErrorReturn { t: Throwable -> | |
eLog(t) | |
false | |
} |
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
private val ITEM_VIEW_TYPE_HEADER = 0 | |
private val ITEM_VIEW_TYPE_ITEM = 1 | |
class TopRatedMovieAdapter(private val clickListener: MovieListener) : | |
ListAdapter<DataItem, RecyclerView.ViewHolder>(MovieNightDiffCallback()) { | |
private val adapterScope = CoroutineScope(Dispatchers.Default) | |
fun addHeaderAndSubmitList(list: List<SmallMovieList>?) { |
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
bool1.withLatestFrom(bool2, BiFunction<Boolean, Boolean, Boolean> { t1, t2 -> t1 && t2 }) | |
.doAfterNext { voidFun() }.onErrorReturnItem(false) | |
.switchMap { item -> return@switchMap if (item) { | |
Flowable.create({ sub -> | |
num.filter { number -> number % 2 == 0 }.take(1) | |
.subscribeOn(Schedulers.computation()) | |
.map { (1.0 / it).toString() }.subscribe( | |
{ | |
sub.onNext(it) | |
}, { error -> |
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
// Universal put function for bundel | |
fun <T> Bundle.put(key: String, value: T) { | |
when (value) { | |
is Boolean -> putBoolean(key, value) | |
is String -> putString(key, value) | |
is Int -> putInt(key, value) | |
is Short -> putShort(key, value) | |
is Long -> putLong(key, value) | |
is Byte -> putByte(key, value) | |
is ByteArray -> putByteArray(key, value) |
OlderNewer