Skip to content

Instantly share code, notes, and snippets.

View ramonaharrison's full-sized avatar

Ramona Harrison ramonaharrison

  • The New York Times
  • New York, NY
View GitHub Profile
package com.nytimes.android.buggyapp;
public class WordAnalyzer {
public WordAnalyzer() {
}
public char firstRepeatedCharacter(String word) {
for (int i = 0; i < word.length(); i++) {
{
"id": 1,
"data": {
"type": "downloadProgress",
"url": "https://www.example.com/amazing-ar-scene",
"totalWritten": 324071,
"totalExpected": 578000
}
}
{
"id": 1011,
"success": "true",
"values": {}
}
{
"id": 1011,
"type": "loadScene",
"options": {
"sceneUrl": "https://www.example.com/amazing-ar-scene"
}
}

Morning Challenge

1) Given an string, write a method called HashMap<String, Integer> countTheLetters(String input) that returns a map containing a count for each of each of the letters in the string. For full credit, your solution should be O(n).

countTheLetters("dog"); // returns a map containing the pairs {d: 1, o: 1, g: 1}
countTheLetters("elephant"); // returns a map containing the pairs {e: 2, l: 1, p: 1, h: 1, a: 1, n: 1, t: 1}
countTheLetters("llama"); // returns a map containing the pairs {l: 2, a: 2, m: 1}

Enable Developer Mode / USB Debugging on your device

  • On the device, go to Settings. If you don't see Developer Options in the list:
  • Go to About Phone. Scroll to the bottom and tap on Build Number 7 times to enable developer mode.
  • Go back to the main Settings screen. Select Developer Options, scroll to USB Debugging and enable the switch.
  • Plug in the device to your computer using a USB data cable.
  • You may be prompted to accept the RSA Fingerprint, tap Yes.

Install ADB + add it to your path

Morning Challenge ⛄

NO LAPTOPS

Given an unsorted int[] input and an int k, return the kth largest element in input.

Spy on your Access Cats database with Stetho

  1. Add Stetho to your app/build.gradle dependencies:
dependencies {
    // ...

    // Cupboard
 compile 'nl.qbusict:cupboard:2.1.4'

Hiding API keys in local.properties

  1. Add the API key to your local.properties file:
apiKey=<value>
  1. Add to the root level of your app-level build.gradle file:

Morning Challenge ☀️

Think of three problems you've encountered working on individual and/or team based software projects. Write each one down on a separate index card.