Skip to content

Instantly share code, notes, and snippets.

View drscott173's full-sized avatar

Scott Penberthy drscott173

  • Google
  • New York
View GitHub Profile
@drscott173
drscott173 / q.sql
Created September 28, 2018 18:47
Bad query
SELECT c.id as id,
concat('https://github.com/', concat(f.repo-name, concat('/blob/master', f.path))) as url,
c.content as content,
f.size as size
FROM [bigquery-public-data:github_repos.contents] as c,
(select * from [bigquery-public-data:github_repos.files]
where right(path,3) = '.py' limit 5) as f
INNER JOIN c on f.id=c.id and f.id
@drscott173
drscott173 / words.txt
Created September 24, 2018 06:17
1000 Top English Words
a
ability
able
about
above
accept
according
account
across
act
import java.util.Scanner;
public class ContainerCalculator {
public static void main(String[] args) {
double r, h, d, volume, area;
Scanner s = new Scanner(System.in);
System.out.println("Welcome to Taylor's Container Calculator!");
System.out.println("=========================================");
import java.util.Scanner;
public class ContainerCalculator {
public static void main(String[] args) {
double r, h, d, volume, area;
Scanner s = new Scanner(System.in);
System.out.println("Welcome to Taylor's Container Calculator!");
System.out.println("=========================================");
import java.util.Scanner;
import java.math.*;
public class ContainerCalculator
{
public static void main(String[] args)
{
double r, h, d, volume;
Scanner scnr;
@drscott173
drscott173 / sliding_window.py
Last active January 11, 2017 11:53
One version of a simple "sliding window" for detecting candidate lane line pixels
# sample histogram of the bottom 40% pixels from a black & white image bw_image
histogram = np.sum(bw_img[np.int(bw_img.shape[0]*0.6):,:], axis=0)
def lane_centers(h):
# h is a histogram of lane pixels
# find the left and right max, which we return
# as lane centers
midpoint = np.int(h.shape[0]/2)
mark_left = np.argmax(h[0:midpoint])
import random
def ask(prompt, low, high):
# keep asking until we get a number inside [low, high]
x = low-1
while x < low or x > high:
x = input(prompt+" ("+str(low)+"-"+str(high)+"): ")
return x
def ask_yes_no(prompt):
@drscott173
drscott173 / test.nb
Created March 18, 2016 18:33
Sample Gist
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
function save_contact($first, $last, $email, $phone, $zip) {
$UN = "<username of your constant contact account, not the developer account>";
$PW = "<password to the username in $UN>";
$Key = "<your developer API key, not the secret key>";
$entry = '<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text"> </title>
<updated>' . date('c') . '</updated>
<author></author>
<id>data:,none</id>