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"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/login_root_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/colorGrey" | |
tools:context=".ui.views.login.LoginActivity"> |
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
//This method takes as parameters the bincount; which is the number of bins you want your histogram to have | |
//and your data in the form of a double array. | |
//Based on this SO answer "https://stackoverflow.com/questions/10786465/how-to-generate-bins-for-histogram-using-apache-math-3-0-in-java" | |
private fun displayHistogram(binCount: Int, data: DoubleArray) { | |
val histogram = DoubleArray(binCount) | |
val distribution = org.apache.commons.math3.random.EmpiricalDistribution(binCount) | |
distribution.load(data) | |
//Not sure what this variable K does to be honest. | |
var k = 0 |
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.sellectorsample; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.TextView; | |
public class MainActivity extends Activity implements OnClickListener { |
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
/** | |
* Tracks the number of calories a person consumes in a given meal. | |
* Has helper method to get the day's total. | |
*/ | |
public class Meal { | |
public enum Type { | |
BREAKFAST, | |
LUNCH, | |
DINER, |
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
testCompile 'junit:junit:4.12' | |
testCompile('org.robolectric:robolectric:3.0-rc2'){ | |
exclude group: 'commons-logging', module: 'commons-logging' | |
exclude group: 'org.apache.httpcomponents', module: 'httpclient' | |
} |
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
//After creating your class extend, RobolectricTestRunner | |
//Create a cunstructor | |
//then inside your constructer, put this code inside it | |
super(testClass); | |
String buildVariant = (BuildConfig.FLAVOR.isEmpty() | |
? "" : BuildConfig.FLAVOR+ "/") + BuildConfig.BUILD_TYPE; | |
String intermediatesPath = BuildConfig.class.getResource("") | |
.toString().replace("file:", ""); | |
intermediatesPath = intermediatesPath |