This file contains hidden or 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
| infix fun View.onClick(function: () -> Unit) { | |
| this.setOnClickListener { function.invoke() } | |
| } | |
| object Terpaksa { | |
| private var context: Context? = null | |
| infix fun init(context: Context) { | |
| this.context = context | |
| } |
This file contains hidden or 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
| data class User(val id:Int?, val nama:String?, val alamat:String?) |
This file contains hidden or 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 users:MutableList<User> = mutableListOf(...) |
This file contains hidden or 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
| inline fun <reified T, Y> MutableList<T>.listOfField(property: KMutableProperty1<T, Y?>):MutableList<Y> { | |
| val yy = ArrayList<Y>() | |
| this.forEach { t: T -> | |
| yy.add(property.get(t) as Y) | |
| } | |
| return yy | |
| } |
This file contains hidden or 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 name = users?.listOfField(User::nama) |
This file contains hidden or 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
| open class Bantuan() { | |
| var id: Int? = null | |
| var name: String? = null | |
| var category: String? = null | |
| var info: String? = null | |
| var created: String? = null | |
| var updated: String? = null | |
| } |
This file contains hidden or 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 name = users?.listOfField(Bantuan::name) |
This file contains hidden or 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
| 21 + 12 | |
| 3 - 97 | |
| 87 / 61 | |
| 1 * 2 | |
| 99 - 76 * 32 / 15 | |
| 76 * 55 | |
| 7 ^ 45 | |
| 8 * 14 /7 *5 | |
| 9 * 3 * 1 | |
| 4 * 2 - 12 |
This file contains hidden or 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
| Setiap ada Awal, pasti ada Akhir. | |
| —------- | |
| dalam beberapa bahasa pemrograman, sebuah blok kode dibuka dengan tanda { dan di akhiri dengan tanda }, atau karakter lainnya. | |
| pada HTML, ada tag pembuka, dan ada tag penutup, misalnya dibuka dengan <b> dan di tutup dengan </b> | |
| Jihad, ingin membuat sebuah bahasa pemrograman baru dengan nama Bahasa Asahab. Bahasa pemroraman yang dia buat ini | |
| memanfaatkan logika Palindrome, untuk membedakan sebuah blok kode program, namun hanya berbentuk kebalikan dari nama fungsi itu. | |
| Misalnya deklarasi sebuah fungsi: | |
| ``` |
This file contains hidden or 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
| Angka Unik | |
| Anwar tidak terlalu menyukai matematika, dia lebih suka mempelajari sejarah ketimbang Matematika. | |
| Namun ada satu hal yang dia sukai dalam Matematika, yakni jika angka-angka yang di proses dalam soal | |
| matematika itu mengandung angka-angka berdigit tunggal yang habis dibagi 3 seperti: 3, 6, dan 9. | |
| Contohnya: 16, 62, 35, 97, dll. | |
| Jika Anwar diberika soal operasi matematika dengan angka-angka yang mengandung angka berdigit tunggal | |
| yang habis dibagi 3 tersebut, maka soal tersebut bisa dikerjakan nya dengan mudah, namun jika tidak | |
| mengandung angka yang habis dibagi tiga, maka soal tersebut akan sulit untuk dikerjakannya. |