This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username. | |
# Execute this script like so: 'osascript alarm_clock_spotify.scpt' (without single-quotes obviously) | |
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.html | |
# If you would like to specify a playlist, please refer to this gist: https://gist.github.com/3344118 | |
set volume 2 | |
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic" | |
tell application "Spotify" | |
set the sound volume to 0 | |
play |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In order to use this script, you must replace 'YOURUSERNAMEHERE' with your Spotify username. | |
# Execute this script like so: 'osascript start_spotify_with_playlist.scpt' (without single-quotes) | |
# Full explanation here: http://www.nikhilgopal.com/2011/08/show-and-tell-applescript-spotify-alarm.htm | |
delay 2 | |
open location "spotify:user:YOURUSERNAMEHERE:playlist:muzic" | |
tell application "Spotify" | |
play | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv, sqlite3, sys | |
file_to_read = sys.argv[1] | |
db_name = sys.argv[2] | |
table_name = sys.argv[3] | |
manifest = sys.argv[4] # lists header names and data types | |
con = sqlite3.connect("./"+db_name) | |
cur = con.cursor() | |
# Read Manifest | |
# Make create table query using manifest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The first step is to load the pre-trained vectors into python. The example below uses glove data. | |
import os | |
GLOVE_DIR = "/path/to/pretrained/embeddings/glove.6B/" | |
embeddings_index = {} | |
f = open(os.path.join(GLOVE_DIR, 'glove.6B.100d.txt'), "r") | |
for line in f: | |
values = line.split() | |
word = values[0] | |
coefs = np.asarray(values[1:], dtype='float32') | |
embeddings_index[word] = coefs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Toy Example of LSTM | |
## Relevant Links | |
* https://www.kaggle.com/amirrezaeian/time-series-data-analysis-using-lstm-tutorial | |
* https://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64 | |
* https://visualstudiomagazine.com/articles/2014/01/01/how-to-standardize-data-for-neural-networks.aspx | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Sep 23 23:16:44 2017 | |
@author: Marios Michailidis | |
This is an example that performs stacking to improve mean squared error | |
This examples uses 2 bases learners (a linear regression and a random forest) | |
and linear regression (again) as a meta learner to achieve the best score. | |
The initial train data are split in 2 halves to commence the stacking. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nikhilgopal.spark; | |
/** | |
* Created by nikhilgopal on 3/24/17. | |
*/ | |
public class SGDLinReg { | |
public static void main(String[] args) { | |
double[] coefficients = {0.4, 0.8}; | |
double[][] dataset = { | |
{1.0, 1.0}, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"created_at": "Mon Jul 17 21:05:24 +0000 2017", | |
"id": 887055659015032837, | |
"id_str": "887055659015032837", | |
"text": "RT @TEN000HOURS: The MIGOS of AAU Basketball... https:\/\/t.co\/h5lGeWHqpu", | |
"source": "\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
# Eigens | |
##### | |
# How to calculate covariance matrix | |
# Great video: https://www.youtube.com/watch?v=9B5vEVjH2Pk | |
dat <- as.matrix( | |
cbind(c(90, 90, 60, 30, 30), | |
c(80, 60, 50, 40, 20), | |
c(40, 80, 70, 70, 70)) |
NewerOlder