Skip to content

Instantly share code, notes, and snippets.

static String func(int n){
int k = n /2 + 10;
int f = 1 - ( n % 2);
int s = n %2;
int result = (k * f) / 10 + (k * s) % 10;
return String.valueOf(result);
}
@ymkawb
ymkawb / Loggable.kt
Created November 22, 2017 08:56
Kotlin loggable trait
interface Loggable {
val logTag: String
fun debug(message: String) = Log.d(logTag, message)
fun debug(message: String, vararg args: String) = Log.d(logTag, message, args)
fun debug(function: () -> String) = logIfEnabled(Log.DEBUG, function) {
Log.d(logTag, it)
@ymkawb
ymkawb / java.java
Created December 7, 2017 18:56
Java.java
class Foo {
private int mBarHeigh;
void foo(){
int d = 0;
System.out.println(mBarHeight);
}
}