iUxaTwANChoKEDAgQAlAAQUOMAA9AAAAAFaYvG1WmLxtADKLBZkAAAJmAAACNKu8
wBMAFzJhMzhhNGE5MzE2YzQ5ZTVhODMzNTE3YzQ1ZDMxMDcwIDg2MTM5ODVldAMA
E2I4Zjc1N2FlNjQzOWU4NzliYjJhIHwgUm9tYW4gSGl0bWFuCj0gHgAAAAcKL1Rk
NldGb0FBQVRtMXJSR0FnQWhBUndBQAAAAHRRejFqTTRBRnlBUlZkQUNrSUJFU2l3
VU5uMHF1VVVBRElIZ3kyCjVsU1RROFM3R1ZHcU1TeTBxNUlqbjR1cmFJS05zcjRW
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
# assuming python and pip are already installed | |
# installing the instantclient is usually where problems happen | |
# download the following files from oracle | |
# | |
# oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm | |
# oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm | |
# oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm | |
# install the rpms |
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 matplotlib | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
import time | |
def get_times(maximum_time): | |
device_times = { | |
"/gpu:0":[], | |
"/cpu:0":[] |
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
#!/bin/bash | |
# Script to instruct the Mac how to route packets to the | |
# software defined network where containers created via boot2docker | |
# reside. This lets you casually directly to ports (ssh, http, etc. etc.) | |
# on those containers. | |
function ERROR(){ echo "ERROR: $*" ; } | |
function FAIL(){ echo "FAILING: $*" ; exit 1; } | |
IP_OF_DOCKER_HOST="172.16.42.43" | |
SDN_NET_FOR_CONTAINERS=$(docker-osx ssh -c 'ip route show' 2> /dev/null | awk '/docker0/{print $1}' ) |
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
/* Copyright 2012 LinkedIn Corp. | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
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
/** | |
* A question I normally ask in Scala interviews, this is not a tail-recursive implementation | |
*/ | |
object Permutations { | |
def permutations(s: String): List[String] = { | |
def merge(ins: String, c: Char): Seq[String] = | |
for (i <- 0 to ins.length) yield | |
ins.substring(0, i) + c + ins.substring(i, ins.length) |
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
require 'nokogiri' | |
require 'open-uri' | |
MARK_FILE = "mark.dat" | |
def wait_for_threads(threads) | |
print "Waiting for downloads to finish..." | |
threads.each { |t| t.join } | |
puts " ok" | |
end |
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
try: | |
from urllib.parse import quote # Py 3 | |
except ImportError: | |
from urllib2 import quote # Py 2 | |
import os | |
import sys | |
BLOG_DIR = os.environ['BLOG_DIR'] | |
# BLOG_DIR = '/Users/cscorley/git/cscorley.github.io/' |
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
#!/usr/bin/env bash | |
# global parameters | |
g_tmp_folder="ncdc_tmp"; | |
g_output_folder="ncdc_data"; | |
g_remote_host="ftp.ncdc.noaa.gov"; | |
g_remote_path="pub/data/noaa"; | |
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
def read_m3u8(m3u8) | |
File.open(m3u8, 'r') do |file| | |
keyfile = nil | |
iv = 0 | |
file.each_line do |line| | |
line.chomp! | |
if line =~ /^#EXT-X-KEY:METHOD=AES-128,URI="(.*?)"(,IV=0x(.*))?/ | |
keyfile = $1 | |
if $2 | |
iv = $3 |
OlderNewer