Skip to content

Instantly share code, notes, and snippets.

View jraczak's full-sized avatar

Justin Raczak jraczak

View GitHub Profile
<header>
<h1>
ArgumentError
in DeviseTokenAuth::RegistrationsController#create
</h1>
</header>
<div id="container">
<h2>wrong number of arguments (given 0, expected 1)</h2>
HTTP/1.1 500 Internal Server Error
Content-Length: 82855
Content-Type: text/html; charset=UTF-8
X-Request-Id: ffe0fea9-0a91-455c-9078-eab259e8d8be
X-Runtime: 0.324780
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
package com.udacity.gradle.builditbigger;
import android.support.test.espresso.ViewInteraction;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Test;
int[] findTheNumbers(int[] a) {
int[] theNumbers = new int[2];
Arrays.sort(a);
int matchedNumbers = 0;
while (matchedNumbers < 2) {
for (int i=0; i < a.length; i++) {
if (a[i] != a[i+1]) {
theNumbers[matchedNumbers] = a[i];
@jraczak
jraczak / .java
Created February 23, 2017 00:48
problem 2
String stringReformatting(String s, int k) {
String[] stringParts = s.split("-");
String newString = "";
String reformattedString = "";
int startLocation = 0;
for (String stringPart : stringParts) {
newString = newString + stringPart;
}
int firstSegmentSize = newString.length() % k;
package com.groupon.test.rc.tests;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.ViewInteraction;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.util.Log;
import com.groupon.ABTest;
import com.groupon.R;
import com.groupon.home.main.activities.Carousel;
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (mToggle.onOptionsItemSelected(item)) {
return true;
}
public String loadExerciseJSONFromAsset() {
String json;
try {
InputStream inputStream = getResources().openRawResource(R.raw.exercises);
int size = inputStream.available();
byte[] buffer = new byte[size];
inputStream.read(buffer);
inputStream.close();
json = new String(buffer, "UTF-8");
} catch (IOException exception) {
<!-- METHOD 1 -->
{
"workout1": [
{
"sets": [
{
"exercise": "Barbell Chest Press",
"reps": 10,
"weight": 135
},
"exercises": [
{
"name": "Barbell Chest Press",
"primaryMuscle": "chest",
"secondaryMuscle": "triceps"
},
{
"name": "Incline Barbell Chest Press",
"primaryMuscle": "chest",
"secondaryMuscle": "triceps"