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
public class ReflectionUtil { | |
public static Object getField(Object object, String strName) throws NoSuchFieldException, IllegalAccessException { | |
if(object == null || object.getClass() == null) return null; | |
Field field = object.getClass().getField(strName); | |
return field.get(object); | |
} | |
public static Object getDeclaredField(Object obj, String name) | |
throws SecurityException, NoSuchFieldException, |
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
fun main(args: Array<String>) { | |
// x + y | |
val sum2Ints : (Int, Int) -> Int = { x, y -> x + y } | |
val curriedSum2Ints = sum2Ints.curried() | |
val applied1IntSum2Ints = curriedSum2Ints(5) | |
println(applied1IntSum2Ints(8)) // 13 | |
// x + y + z | |
val sum3Ints : (Int, Int, Int) -> Int = { x, y, z -> x + y + z } |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:;;;;;;;;;;;; | |
;;; | |
;;; general | |
;;; | |
;;; setup language env | |
(set-language-environment "UTF-8") | |
;;; setup your user-emacs-directory | |
(let* ((user-init-dir (file-name-as-directory (or (getenv "EMACS_USER_DIRECTORY") |
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 TpcsFgmt : Fragment() { | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
val sLoadingVisible = RxView.visibility(loadingTextView, View.INVISIBLE) | |
val sRVVisible = RxView.visibility(list, View.INVISIBLE) | |
val sIsLoading = BehaviorSubject.createDefault(false) | |
sIsLoading.observeOn(AndroidSchedulers.mainThread()).subscribe { loading -> | |
sLoadingVisible.accept(loading) | |
sRVVisible.accept(!loading) |
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.rxmediaviewer | |
import android.graphics.drawable.Drawable | |
import android.os.Bundle | |
import android.support.v7.app.AppCompatActivity | |
import android.util.Log | |
import com.bumptech.glide.Glide | |
import com.bumptech.glide.load.DataSource | |
import com.bumptech.glide.load.engine.GlideException | |
import com.bumptech.glide.request.RequestListener |
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
def _mavg_signal(data): | |
.... | |
# bollinger band %B day 20 | |
c = data["close_price_adj"].fillna(method='ffill') | |
m20 = c.rolling(window=20, center=False).mean() | |
s20 = c.rolling(window=20, center=False).std() | |
ub = m20 + s20 * 2 | |
lb = m20 - s20 * 2 | |
pb = (c - lb) / (ub - lb) | |
.... |
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
sealed class Row { | |
data class Header( | |
val columns: List<String> | |
) : Row() | |
data class Item( | |
val id: Long, | |
val name: String, | |
val price: Long? | |
) : Row() |
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
// Row.kt | |
sealed class Row { | |
data class Header( | |
val columns: List<String> | |
) : Row() | |
data class Item( | |
val id: Long, | |
val name: String, | |
val price: Long? |
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
import android.media.ToneGenerator | |
import android.os.Bundle | |
import android.support.v4.app.Fragment | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import com.jakewharton.rxbinding2.widget.text | |
import com.jakewharton.rxbinding2.widget.userChanges | |
import io.reactivex.Observable |
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..util | |
/* | |
Copyright (c) <2018> <PooheMobi@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 |
OlderNewer