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
with example as ( | |
select 399 as num, width_bucket(399, 400, 990, 59) as buk | |
union all | |
select 400 as num, width_bucket(400, 400, 990, 59) as buk | |
union all | |
select 401 as num, width_bucket(401, 400, 990, 59) as buk | |
union all | |
select 409 as num, width_bucket(409, 400, 990, 59) as buk | |
union all | |
select 410 as num, width_bucket(410, 400, 990, 59) as buk |
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 -*- | |
""" TODO: Update package docstring | |
""" | |
import logging | |
import argparse | |
def str2bool(val): | |
""" string to boolean conversion for argparse |
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
Install-Module -Name PowerShellCookbook | |
$app = Get-InstalledSoftware | Where-Object { $_.Publisher -like '*Anaconda*' } | |
$app.UninstallString |
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
export TEXLIB=/usr/share/texlive/texmf-dist/ | |
export packagename=tabu | |
wget http://mirrors.ctan.org/macros/latex/contrib/$packagename.zip | |
unzip $packagename.zip | |
cd $packagename | |
latex *.ins | |
sudo mkdir $TEXLIB/tex/latex/$packagename | |
sudo cp *.sty $TEXLIB/tex/latex/$packagename | |
cd .. |
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
# To get setup quickly just run the below line: | |
# (note that it changes with revisions to the file... will try to keep it up to date) | |
# source('https://gist.githubusercontent.com/logworthy/695f037e79ca4a2c49f2bdbe3502a0c5/raw/459be6d79c7e2762cae9b5c981a18dfde24da4ba/RSetup.R') | |
# set up R with desired pacakges and load them by default | |
# install packages | |
packages_required <- c( | |
'data.table', | |
'RODBC', |
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
/***** | |
EXAMPLE OF A LINEAR PROGRAMMING PROBLEM | |
*****/ | |
/* classes of things */ | |
set CATEGORIES; | |
/* function discretised over these points */ | |
set POINTS; |
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
# Simulation of how simple logistic regression can fail to model | |
# binomial response when the underlying function is more complicated | |
install.packages(c('data.table', 'plyr', 'ggplot2', 'drc')) | |
library(data.table) | |
library(plyr) | |
library(ggplot2) | |
library(drc) | |
# Generalised logistic function | |
logistic_function <- function(x) { |
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
create table parking_events ( | |
id integer, | |
areaname text, | |
streetname text, | |
betweenstreet1 text, | |
betweenstreet2 text, | |
sideofstreet text, | |
streetmarker text, | |
arrivaltime timestamp, |