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
fun invoicePath( | |
config: ProcessConfiguration, | |
invoiceMap: InvoiceConfig = invoiceConfiguration, | |
shippingMap: ShippingConfig = shippingConfiguration, | |
freightMap: FreightConfig = freightCostConfiguration | |
) = invoiceMap[config.invoiceChoice]!! | |
.compose(shippingMap[config.shippingChoice]!!) | |
.compose(freightMap[config.freightChoice]!!) | |
fun availabilityPath( |
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.annotation.TargetApi | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.net.* | |
import android.os.Build | |
import androidx.annotation.RequiresApi | |
import androidx.lifecycle.LiveData |
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 ordersForProcessing = listOf<Order>( | |
Order(10,1100.0,20.0,20,Type.FOOD), | |
Order(12,100.0,5.0,8,Type.RAW_MATERIAL) | |
) | |
val getDiscountRules = listOf( | |
Pair(::isQuantityQualified, ::calculateQuantityDiscount), | |
Pair(::isPriceQualified, ::calculatePriceDiscount), | |
Pair(::isWeightQualified, ::calculateWeightDiscount), | |
Pair(::isTypeFood, ::calculateFoodDiscount), |
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
fun hourglassSum(arr: Array<Array<Int>>): Int { | |
val values = arrayListOf<Int>() | |
for (i in 0 until (arr.size - 2)) { | |
for (j in 0 until (arr[i].size - 2)) { | |
val current = arr[i] | |
val currentP1 = arr[i + 1] | |
val currentP2 = arr[i + 2] | |
val sum = current[j] + current[j + 1] + current[j + 2] + currentP1[j + 1] + currentP2[j] + currentP2[j + 1] + currentP2[j + 2] |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".HomeFragment"> | |
<androidx.appcompat.widget.Toolbar | |
android:id="@+id/toolbar" |
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
class MainActivity : AppCompatActivity() { | |
val fadeAnimator by lazy { | |
ObjectAnimator.ofFloat(targetImage,"alpha",1.0f,0.0f) | |
.apply {duration=1500} | |
.apply { repeatCount=1 } | |
.apply { repeatMode=ObjectAnimator.REVERSE } | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { |