Skip to content

Instantly share code, notes, and snippets.

View llSourcell's full-sized avatar

Siraj Raval llSourcell

View GitHub Profile
Verifying that +siraj is my openname (Bitcoin username). https://onename.com/siraj
@llSourcell
llSourcell / plaid.md
Last active September 27, 2015 05:39

#Question 1

#####Overview The following is the index.js file for question 1. The instructions said to create a node.js script to generate a textfile of access_tokens for Jenny, and a bash script to read the access_tokens from the text file, outputting the item ID's associated with New Age Banking. Interestingly, the instructions provided a javascript function to deserialize the access tokens so I'm not sure if bash script was a typo and it meant to say node script? Regardless, I thought it would be equally efficient to do it all in one script, so below is a node.js script that does the following steps

  1. Pulls the clients and items from the sraval-interview.plaid.com server
- (void)login {
PFUser *user = [PFUser user];
//this is hardcoded but you can get also get it from an input textfield
user.username = @"my name";
user.password = @"my pass";
user.email = @"email@example.com";
// other fields can be set just like with PFObject
user[@"phone"] = @"415-392-0202";
- (void)myMethod {
PFUser *user = [PFUser user];
user.username = @"my name";
user.password = @"my pass";
user.email = @"email@example.com";
// other fields can be set just like with PFObject
user[@"phone"] = @"415-392-0202";
[user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
11-05 10:01:06.445 10523-10523/? D/dalvikvm: Late-enabling CheckJNI
11-05 10:01:06.545 10523-10523/com.twilio.example E/Trace: error opening trace file: No such file or directory (2)
11-05 10:01:06.545 10523-10523/com.twilio.example D/ActivityThread: setTargetHeapUtilization:0.25
11-05 10:01:06.545 10523-10523/com.twilio.example D/ActivityThread: setTargetHeapIdealFree:8388608
11-05 10:01:06.545 10523-10523/com.twilio.example D/ActivityThread: setTargetHeapConcurrentStart:2097152
11-05 10:01:06.765 10523-10523/com.twilio.example D/libEGL: loaded /system/lib/egl/libEGL_adreno200.so
11-05 10:01:06.775 10523-10523/com.twilio.example D/libEGL: loaded /system/lib/egl/libGLESv1_CM_adreno200.so
11-05 10:01:06.775 10523-10523/com.twilio.example D/libEGL: loaded /system/lib/egl/libGLESv2_adreno200.so
11-05 10:01:06.795 10523-10523/com.twilio.example I/Adreno200-EGLSUB: <ConfigWindowMatch:2087>: Format RGBA_8888.
11-05 10:01:06.815 10523-10523/com.twilio.example D/OpenGLRenderer: Enabling debug mode 0
#Android Chat App in 5 Min
##Intro
Hey guys, I’m Siraj and I’m a developer educator at Twilio. Today we’re going to be going through an Android chat app in 5 minutes. Let’s get started.
##App Walkthrough
Let’s see how the app works.
;; Remove the top n anomalies from a dataset
;; Given an anomaly resource, get the list of its top_anomaly row numbers
(define (anomalous-rows a)
(map (lambda (x) (x "row_number")) (a ["model" "top_anomalies"])))
;; Given a list of row numbers, generate a flatline expression
;; that discards those rows.
(define (row-filter rows)
(let (eqs (map (lambda (n) (flatline "(= (row-number) {n})")) rows))
;; Remove the top n anomalies from a dataset
;; Given an anomaly resource, get the list of its top_anomaly row numbers
(define (anomalous-rows a)
(map (lambda (x) (x "row_number")) (a ["model" "top_anomalies"])))
;; Given a list of row numbers, generate a flatline expression
;; that discards those rows.
(define (row-filter rows)
(let (eqs (map (lambda (n) (flatline "(= (row-number) {n})")) rows))
from flat_game import carmunk
import numpy as np
import random
import csv
from nn import neural_net, LossHistory
import os.path
import timeit
def train_net(model, params):