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
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
apply plugin: 'kotlin-kapt' | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion "29.0.2" | |
defaultConfig { | |
applicationId "com.example.usample" |
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
{ | |
"Vegetarian": [ | |
{ | |
"id": 10, | |
"name": "Vegan Veggie", | |
"price": "23.95", | |
"menu_description": "Daiya vegan mozzarella, paired with fresh veggies", | |
"classifications": { | |
"vegetarian": 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
class Solution { | |
public boolean isMatch(String s, String p) { | |
if (s == null || p == null) return false; | |
// Create Table and fill default value for edge case | |
int n = s.length(), m = p.length(); | |
boolean[][] table = new boolean[n+1][m+1]; | |
table[n][m] = true; | |
for(int i= m-1; i>=0; i--){ |
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
/** | |
* Problem: given numbers with distinct int values such that: | |
* abc | |
* + abc | |
* + abc | |
* -------- | |
* ccc | |
* | |
* Find a, b & c. | |
* |
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
Toothpick.closeScope(activity); |
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
scope.installModules(Module().apply { bind(State::class.java).toInstance(State(0)) }); |
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 scope = Toothpick.openScopes(application, activity); |
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 scope = Toothpick.openScopes(application, activity); |
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 MyActivity { | |
@Inject lateinit var state: State | |
onCreate(...) { | |
super.onCreate() | |
scope = ... | |
ToothPick.inject(this, scope); | |
} | |
} |
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 SimpleActivity : AppCompatActivity() { | |
private var store = Store(0) | |
private val subscriptions = CompositeSubscription() | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_counter) | |
setTitle(R.string.simple_activity_name) |
NewerOlder