Skip to content

Instantly share code, notes, and snippets.

View sstadelman's full-sized avatar
🚀

Stan Stadelman sstadelman

🚀
View GitHub Profile
@sstadelman
sstadelman / Exercises_5_23_2017.md
Last active May 24, 2017 16:53
Exercises_5_23_2017

Used Google Cloud Platform BigQuery WebUI to edit SQL queries for GOOGL prediction code competition.

Found some very good examples of BigQuery complex queries here. Really critical findings are:

  1. Can use lag(<prop name>, <previous row count) over (ORDER BY <prop name>), and lead to access the window of the result set.
  2. When combined with functions like AVG(<prop name>), makes it really easy to calculate moving averages
 SELECT
   DATE(S1.date) AS join_date,

I watched a 9 minute video on Long Short Term Memory (LSTM) in recurrent neural networks. The concept here is that the input to the hidden layer includes some information about the previous back-prop, which if I remember correctly includes the last calculation of the inner weights for each of the classes... something like that.

I walked through the jupyter notebook for this example. It introduces keras as an API, as well as some concepts around Dropout which I don't yet understand.

The very interesting thing about this example was the charting at the end, which plotted a set of predictions, against the true values. Also, the author proposed a code challenge, to best predict the future of GOOGL (Alphabet), using Price History and two other metrics using an LSTM.

I downloaded a dataset from Quandl for GOGVIX, curled to csv, and uploaded to BigQuery.

curl https://w
@sstadelman
sstadelman / Exercises_5_15_2017.md
Last active May 17, 2017 07:03
Exercises_5_15_2017

Ran Google Cloud Platform Big Query examples for working with time-series financial data. Used gcloud command-line tools to connect to Google Cloud project financials-test. Initialized bq (BigQuery tools), and pointed it at my project. Imported two large csv files of USD-GBP exchange rates in 2014.

# my GCP project
gcloud config set project financials-test

# my temporary data set that is imported to BigQuery
bq mk timeseries

# note the column definitions appended to the `load` command
@sstadelman
sstadelman / GeneratedProxies.swift
Last active December 8, 2016 17:14
Using the DataService streaming API
open class DefaultContainer<Provider: DataServiceProvider>: DataService<Provider> {
public override init(provider: Provider) {
super.init(provider: provider)
self.provider.metadata = DefaultContainerMetadata.document
}
// ...
open func photos(query: DataQuery = DataQuery()) throws -> Array<Photo> {
export XSC_OPTIONS=
./build-all.sh
export XSC_OPTIONS=-pi
./build-mobile.sh swift
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Microsoft.OData.SampleService.Models.TripPin">
<EnumType Name="PersonGender">
<Member Name="Male" Value="0"/>
<Member Name="Female" Value="1"/>
<Member Name="Unknown" Value="2"/>
</EnumType>
<ComplexType Name="City">
@sstadelman
sstadelman / gist:50cd4bb27915d06df6072a078a0be82d
Last active November 22, 2016 00:40
UIEdgeOffsets for iOS devices in regular horizontal mode
iPhoneSE: portrait UIEdgeInsets(top: 0.0, left: 16.0, bottom: 0.0, right: 16.0) // compact
iPhoneSE: landscape UIEdgeInsets(top: 0.0, left: 20.0, bottom: 0.0, right: 20.0) // compact
iPhone6s: portrait UIEdgeInsets(top: 0.0, left: 16.0, bottom: 0.0, right: 16.0) // compact
iPhone6s: landscape UIEdgeInsets(top: 0.0, left: 20.0, bottom: 0.0, right: 20.0) // compact
iPhone6sPlus: portrait UIEdgeInsets(top: 0.0, left: 20.0, bottom: 0.0, right: 20.0) // compact
iPhone6sPlus: landscape UIEdgeInsets(top: 0.0, left: 32.0, bottom: 0.0, right: 32.0) // regular
iPhone7: portrait UIEdgeInsets(top: 0.0, left: 16.0, bottom: 0.0, right: 16.0) // compact
iPhone7: landscape UIEdgeInsets(top: 0.0, left: 20.0, bottom: 0.0, right: 20.0) // compact
iPhone7Plus: portrait UIEdgeInsets(top: 0.0, left: 20.0, bottom: 0.0, right: 20.0) // compact
iPhone7Plus: landscape UIEdgeInsets(top: 0.0, left: 32.0, bottom: 0.0, right: 32.0) // regular
@sstadelman
sstadelman / gist:130a3e13cc39c478e8c0
Created June 29, 2015 22:13
Switch to older version of node, and to current
# Switch to older version (e.g.: v0.10.39)
sudo n 0.10.39
# install : node-v0.10.39
# mkdir : /usr/local/n/versions/node/0.10.39
# fetch : https://nodejs.org/dist/v0.10.39/node-v0.10.39-darwin-x64.tar.gz
# installed : v0.10.39
# Switch to current version
sudo n stable
# install : node-v0.12.5
@sstadelman
sstadelman / case.json
Last active August 29, 2015 14:22 — forked from d3noob/.block
{
"links" : [
{"source": "5530bcc5298d000e396ff280", "target": "5530bd47298d000e396ff281"},
{"source": "5530bd47298d000e396ff281", "target": "5530bd83298d000e396ff282"},
{"source": "5530bd47298d000e396ff281", "target": "5530bdcb298d000e396ff283"},
{"source": "5530bd83298d000e396ff282", "target": "5530be68298d000e396ff285"},
{"source": "5530bdcb298d000e396ff283", "target": "5530bd83298d000e396ff282"},
{"source": "5530bdcb298d000e396ff283", "target": "5530be28298d000e396ff284"},
{"source": "5530be28298d000e396ff284", "target": "5530bd83298d000e396ff282"},
{"source": "5530be28298d000e396ff284", "target": "5530be93298d000e396ff286"}