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
@SpringBootApplication | |
public class PuzzleApplication { | |
@Bean | |
public CommandLineRunner startup(List<String> data) { | |
return args -> System.out.println("Result is: " + data.get(0)); | |
} | |
public static void main(String[] args) { | |
SpringApplication.run(PuzzleApplication.class, args); |
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
let add a b = a + b | |
let () = add 12 13 |> Int.to_string |> print_endline |
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.core.zip | |
data class Employee( | |
val name: String, | |
val age: Int, | |
val married: Boolean, | |
val salary: Double | |
) { | |
companion object { |
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
data class Employee( | |
val name: String, | |
val age: Int, | |
val married: Boolean, | |
val salary: Double | |
) { | |
companion object { | |
fun buildAll( | |
names: List<String>, |
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
def only_accepts_ints(the_func): | |
def wrapper(*args): | |
for position, argument in enumerate(args): | |
if type(argument) is not int: | |
raise RuntimeError(f"Invalid argument at position {position}!") | |
return the_func(*args) | |
return wrapper | |
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 Person: | |
def __init__(self, name, age): | |
self.__name = name | |
self.__age = age | |
def __str__(self): | |
return f"{self.__name} of age {self.__age}" | |
p1 = Person("Jane", 30) |
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 Person: | |
def __init__(me, name, age): | |
me.name = name | |
me.age = age | |
def __str__(me): | |
return f"{me.name} of age {me.age}" |
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 Person: | |
def __init__(self, name, age): | |
self.name = name | |
self.age = age | |
def __str__(self): | |
return f"{self.name} of age {self.age}" |
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
def sample(): | |
print("sample") | |
return 123 | |
var1 = sample() | |
var2 = sample | |
var3 = {sample(): sample} | |
var2() |
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
myvar1 = bool | |
myvar2: bool | |
print(myvar1) | |
print(myvar2) |
NewerOlder