Skip to content

Instantly share code, notes, and snippets.

@RafaRuiz
RafaRuiz / SimpleListActivity.kt
Last active May 25, 2018 20:49
Feature developed
class SimpleListActivity : BaseActivity() {
@BindView(R.id.back)
lateinit var back: AppCompatImageView
@BindView(R.id.listViewMore)
lateinit var listView: ListView
@BindView(R.id.moreToolbar)
lateinit var toolbar: RelativeLayout
@RafaRuiz
RafaRuiz / SimpleListActivity.kt
Last active May 25, 2018 20:38
Simple List Activity
class SimpleListActivity :
BaseActivity(), SimpleListActivityViewPresenter {
@BindView(R.id.back_IV)
lateinit var backMore: AppCompatImageView
@BindView(R.id.recyclerViewMore)
lateinit var recyclerView: RecyclerView
@BindView(R.id.moreBannerImage)
interface SimpleListActivityViewPresenter {
fun loadBanner()
fun configureRecyclerView()
fun refreshView()
fun setOnClickListeners()
fun getActivity(): FragmentActivity
}
name: "AlexNet"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "fc8"
bottom: "label"
top: "loss"
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "fc8"
bottom: "label"
top: "loss"
}
@RafaRuiz
RafaRuiz / RectangleModelTestWeakAccesses.kt
Created January 12, 2018 18:53
RectangleModel Tests Weak Accesses
@RunWith(Parameterized::class)
class RectangleModelTestWeakAccesses {
@JvmField
@Parameterized.Parameter(0)
var o1: Point? = null
@JvmField
@Parameterized.Parameter(1)
var o2: Point? = null
@JvmField
@RafaRuiz
RafaRuiz / RectangleModelTestConstructorBased.kt
Created January 12, 2018 18:49
RectangleModel Tests Constructor Based
@RunWith(Parameterized::class)
class RectangleModelTestConstructorBased constructor(
private val o1: Point,
private val o2: Point,
private val expected: Boolean) {
companion object {
@JvmStatic
@Parameterized.Parameters
fun data(): MutableList<Array<out Any?>>? {
@RafaRuiz
RafaRuiz / RectangleModel.kt
Created January 12, 2018 18:46
Rectangle Model for Unit tests
/**
* o1----------------------o
* | |
* | |
* | |
* o-----------------------o2
*
* @param topLeftPoint would be o1
* @param bottomleftPoint would be o2
*/
class SimpleListActivity : BaseActivity() {
@BindView(R.id.back_IV)
lateinit var backMore: AppCompatImageView
@BindView(R.id.recyclerViewMore)
lateinit var recyclerView: RecyclerView
@BindView(R.id.moreBannerImage)
lateinit var bannerImage: ImageView