Skip to content

Instantly share code, notes, and snippets.

from random import randint
import math
logs = []
ts = 0
for i in range(100):
ts+=randint(0,100)
logs.append((ts, i))
def get_log(stream, ts):

Assignment 2 - HealthFinder++

HealthFinder is a mobile client app that leverages the HealthFinder API which is maintained by the Department of Health and Human Services.

Time spent: X hours spent in total

User Stories

The following required functionality is completed:

[Your app name] is a tip calculator application for iOS.

Name: Your Name

Time spent: ? hours spent in total

User Stories

The following required functionality is complete:

  • User can enter a bill amount, choose a tip percentage, and see the tip and total values.
  • If your labels aren't wrapping correctly, make sure to set the number of “Lines” to 0 using the storyboard
  • If your rows are looking a little squished, set tableView.rowHeight = 110 or whatever you have the prototype cell's height as in the storyboard (this height is adjustable!)
  • Try to Project -> Clean and then Build again if you ever a "Linker error"
  • One way to see if you're actually getting data back is to use breakpoints within your if-let statements of your dataTask and making sure that they're successfully pushing through.
  • The CodePath videos are slightly outdated, if your networking call isn't working try this:
let url = URL(string: "https://healthfinder.gov/developer/MyHFSearch.json?api_key=demo_api_key&who=child&age=16&gender=male")
let request = URLRequest(url: url!)
let session = URLSession(
    configuration: URLSessionConfiguration.default,
@skleung
skleung / HealthFinderReadme.md
Last active October 6, 2016 01:16
A sample readme for the first assignment of CS96SI

Assignment 1 - HealthFinder.gov Mobile Client

HealthFinder is a mobile client app that leverages the HealthFinder API which is maintained by the Department of Health and Human Services.

Time spent: X hours spent in total

User Stories

The following required functionality is completed:

  • Speaker line-up: we need about 6 speakers total:
    • "Keynote": someone who can give a fantastic overview of mobile health, the reason for its growth and why mobile technology in particular is exciting.
    • Research-Kit oriented talk: Familiar with ResearchKit and the importance of clinical research through mobile technology - we should definitely reach out to Euan Ashley's group at Stanford. Hopefully we could get Euan himself to speak about MyHeartsCount.
    • Apple Health oriented talk: Someone to talk about CareKit + Apple's specific competencies and what sort of insfrastructure/support Apple has built up specifically for healthcare.
    • Mobile Health Entrepreneur: Someone who's built a product that touches different parts of the healthcare ecosystem. I can ask Jason, my co-founder/CEO, though
  • Google Fit/Verily: Somedone from one of these teams (ideally a Product/Engineering sort of person) to chat about the flip side of Android and what sort of affordances are there (if they could compare
  1. String manipulation:

Write a function that converst strings (e.g. "1001") to its numeric representation Write a function that does the converse of the above.

Write a function that does the following: Convert "A" -> 0 Convert "Z" -> 25 Convert "AA" -> 26

@skleung
skleung / prototypes.md
Created November 26, 2015 05:33
Good prototyping alternatives to building an app from scratch
  1. Invision A good resource for just uploading images and linking screens to other screens to emulate tapping.
  2. Nativ I've never used this one before but would be something to look into - it seems you can start with templates that might help cut some of the dev time.
  3. Kinetise This is another resource that I've heard about though haven't used myself - seems like the provide some built in features to sync up with actual APIs (i.e. camera, etc...) that the phone has access to.
@skleung
skleung / run.sh
Created November 13, 2015 21:11
Setting up PRs for each of the submission folders
# This script automates the creation of pull requests for students
mkdir assign2-submissions
# TODO: setup the git remote here for the assign2-submissions folder
while read id; do
git checkout master
git checkout -b $id
cd ../
folderName="$id-assign2"
cp -rf "assign2/$folderName" "assign2-submissions/$folderName"
cd assign2-submissions
def senseCollision(self):
time.sleep(0.5)
lastX = None
lastY = None
smoothingFactor = 0.5
collisionThreshold = 750
while True:
x, y, z = self.joystick.read_accelerometer_data()
if lastY != None and lastX != None: