<?xml version="1.0" encoding="utf-8"?>
<example.com.exampledrawview.CustomLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<example.com.exampledrawview.CustomTextView
import java.util.BitSet | |
const val MIN = 6 | |
const val SEC = 11 | |
fun countSec(m: Int, s: Int): Int { | |
return (60 * m) + s | |
} |
//Place this script inside your application module build.gradle | |
//It will create a new task(s) based on your application variants within (run) group | |
//sample: ./gradlew installRunDebug | |
//sample: ./gradlew installRunStagDebug | |
project.afterEvaluate { | |
android.applicationVariants.all { variant -> | |
task "installRun${variant.name.capitalize()}"(type: Exec, dependsOn: "install${variant.name.capitalize()}", group: "run") { | |
commandLine = ["adb", "shell", "monkey", "-p", variant.applicationId + " 1"] | |
doLast { |
Requires OkHttp >= 2.1.0 if you need to work with multipart request bodies. Lower versions don’t report the content length for the body, but the sum of the sizes of the parts is a pretty good approximation.
// TODO: Build a request body
RequestBody body = null;
/* | |
Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/ | |
USAGE: | |
ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() { | |
@Override | |
public void onItemClicked(RecyclerView recyclerView, int position, View v) { | |
// do it | |
} | |
}); |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This chapter is about defensive coding practices, both against users of your software and against yourself. Pragmatic Programmers, after all, understand that everyone makes mistakes, even themselves.
This confused the shit out of me. I wasn't entirely sure what the difference was between a contract and a unit test.
Contracts are introduced in the context of employment contracts. That is, before any work is done, the responsibilities of both parties are defined, as well as the consequences of failing. Contracts in programming are similar. As I mentioned before, I wasn't able to make a strong distinction between contracts and unit tests (given some condition, when some event, then this should happen, though I may be confusing this with [BDD][bdd]). It's all a bit jumbled in my head.