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
interface AFunctionExecutor { | |
fun execute(tag: String = "None", name: String = "Taro", age: Int=32) | |
} | |
class DefaultFunctionExecutor : AFunctionExecutor { | |
override fun execute(tag: String , name: String, age: Int) = println("[$tag] $name($age)") | |
} | |
class SoccerFunctionExecutor : AFunctionExecutor { | |
override fun execute(tag: String, name: String, age: Int) { |
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
package mobi.pooh3.thefun.fp.bitree | |
import kotlin.test.assertFalse | |
import kotlin.test.assertTrue | |
/* | |
The Fun of Programming 1-1 [IFPH Section 6.3] | |
Q, 6つのjoinのうち2つは、そのどちらか一方だけを使うと、すべての木が線形になってしまう。どの二つか? | |
A, 1 & 5 |
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
package input.your.pkg | |
import android.graphics.Bitmap | |
import android.view.View | |
import com.google.firebase.ml.vision.FirebaseVision | |
import com.google.firebase.ml.vision.common.FirebaseVisionImage | |
import kotlinx.android.synthetic.main.activity_main.* | |
public fun MainActivity.detectTextOnCloud(bitmap: Bitmap) { |
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
package com.example.forloop | |
sealed class Result<T, E> { | |
data class Success<T, E>(val t: T) : Result<T, E>() | |
data class Failure<T, E>(val e: E) : Result<T, E>() | |
} | |
sealed class MultiResult<T, E> { | |
data class Success<T, E>(val t: T, val ers: List<E>?) : MultiResult<T, E>() | |
data class Failures<T, E>(val msg: String, val ers: List<E>) : MultiResult<T, E>() |
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
@file:Suppress("DataClassPrivateConstructor") | |
// ADT and Smart Constructor | |
package com.example.algebra | |
import java.math.BigDecimal | |
import java.util.* | |
// domain modeling part |
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
package com.example | |
import org.apache.commons.math3.stat.inference.ChiSquareTest | |
import java.util.Random | |
/** | |
* カイ二乗検定のデモ | |
* https://github.com/komiya-atsushi/dbflute-fes-2014-demo/blob/master/src/main/java/biz/k11i/demo/stat/ChiSquareTestDemo.java | |
* Kotlin ver | |
*/ |
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
package com.example.calc | |
/* | |
Copyright 2018 Pooh3Mobi@GitHub | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
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
package com.example.oop; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
// abstract class を継承するやり方のデモコード | |
public class Demo { | |
// このコードはデモ用のコードです。書き方についてはチーム単位や会社単位でコーディング規約があると思いますので、 | |
// 製品コードに書くときはそちらを優先してください。 | |
void demo() { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<android.support.v7.widget.CardView | |
android:id="@+id/cardView" | |
xmlns:android="http://schemas.android.com/apk/res/android" |
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
class MainActivityFragment : androidx.fragment.app.Fragment() { | |
val viewModel = MainViewModel() | |
override fun onCreateView( | |
inflater: LayoutInflater, container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
val binding = FragmentMainBinding.inflate(inflater) | |
binding.setLifecycleOwner(this) | |
binding.vm = viewModel |