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 main(args: Array<String>) { | |
val reza = Student("reza", 22) | |
val ghasem = Student("ghasem", 22) | |
println(ghasem.hashCode()) | |
} | |
/*class Student(val name: String, private val age: Int) { | |
fun printPlan() = "Plan" |
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 main() { | |
println("asdf".isDigits) | |
println("asdf1234".isDigits) | |
println("123456".isDigits) | |
val content: String? = null | |
println(content.orEmpty()) | |
String.print("hello") | |
} |
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
# Inserts a blank line between shell prompts | |
add_newline = false | |
# Disable the package module, hiding it from the prompt completely | |
[package] | |
disabled = true | |
# Exec time | |
command_timeout=5000 |
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 Jumps.BREAK | |
import Jumps.CONTINUE | |
enum class Jumps { BREAK, CONTINUE } | |
inline fun repeat(action: (index: Int) -> Any) { | |
var counter = 0 | |
loop@ while (true) { | |
val result = action(counter) | |
if (result == BREAK) break@loop |
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 kotlin.math.pow | |
fun main() { | |
println("^" * 5) // "^^^^^" | |
println(5 `^` 3) // 125.0 | |
println(199 `%%` 24) // (24 * 199) / 100 = 47.76 | |
println(5 / 2) // 2 | |
println(5 `÷` 2) // 2.5 | |
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
[*] | |
charset = utf-8 | |
end_of_line = crlf | |
indent_size = 4 | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
max_line_length = 100 | |
ij_kotlin_imports_layout = *, android.*, androidx.*, com.*, java.*, javax.*, kotlin.*, kotlinx.*, $* | |
# Tab indentation (no size specified) |
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
@Preview( | |
name = "NEXUS_5 -> 4.95\"", | |
group = "devices", | |
device = Devices.NEXUS_5, | |
showBackground = true | |
) | |
@Preview( | |
name = "PIXEL -> 5.0\"", | |
group = "devices", |
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 arrow.fx.coroutines.continuations.resource | |
import arrow.fx.coroutines.release | |
class UserProcessor { | |
fun start(): Unit = println("Creating UserProcessor") | |
fun shutdown(): Unit = println("Shutting down UserProcessor") | |
fun process(ds: DataSource): List<String> = | |
ds.users().map { "Processed $it" } | |
} |
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
set number | |
set relativenumber | |
set tabstop=4 | |
set shiftwidth=4 | |
set autoindent | |
set mouse=a |
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
:set number | |
:set relativenumber | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set autoindent | |
:set smarttab | |
:set softtabstop=4 | |
:set mouse=a | |
call plug#begin() |
OlderNewer