Skip to content

Instantly share code, notes, and snippets.

Randy Zwitch randyzwitch

Block or report user

Report or block randyzwitch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@randyzwitch
randyzwitch / customers_nopii.sh
Last active Sep 25, 2019
Limited Select Statement SQL Server to OmnISci
View customers_nopii.sh
#run in OmniSci before import to define table
create table customers_nopii(
customerid TEXT ENCODING DICT,
service_address TEXT ENCODING DICT,
address_geom POLYGON
)
#export custom query to OmniSci
java -cp /opt/omnisci/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/path/mssql-jdbc-7.4.1.jre8.jar \
com.mapd.utility.SQLImporter \
@randyzwitch
randyzwitch / sqlserver-to-omnisci.sh
Last active Sep 24, 2019
Example SQL Server to OmniSci SQLImporter code
View sqlserver-to-omnisci.sh
java -cp /opt/omnisci/bin/mapd-1.0-SNAPSHOT-jar-with-dependencies.jar:/path/mssql-jdbc-7.4.1.jre8.jar \
com.mapd.utility.SQLImporter \
-d com.microsoft.sqlserver.jdbc.SQLServerDriver \
-u admin -p HyperInteractive -db omnisci --port 6274 -t customers \
-su sqlserver_user -sp sqlserver_password \
-c "jdbc:sqlserver://localhost:1433;DatabaseName=prod" \
-ss "select * from dbo.customers"
@randyzwitch
randyzwitch / java-version.sh
Created Sep 24, 2019
Checking Java version
View java-version.sh
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
@randyzwitch
randyzwitch / servers-colorbrewer-sequential.json
Created Aug 23, 2019
OmniSci Immerse servers.json with ColorBrewer sequential scales
View servers-colorbrewer-sequential.json
[
{
"customStyles": {
"colors": {
"solid": [
"#ea5545",
"#f46a9b",
"#ef9b20",
"#ede15b",
"#bdcf32",
@randyzwitch
randyzwitch / geo_types.jl
Created Jul 26, 2019
OmniSci.jl Geo query
View geo_types.jl
julia> geodf = sql_execute(conn, "select * from omnisci_states")
52×4 DataFrame. Omitted printing of 1 columns
│ Row │ id │ abbr │ name │
│ │ String⍰ │ String⍰ │ String⍰ │
├─────┼─────────┼─────────┼──────────────────────┤
101 │ AL │ Alabama │
202 │ AK │ Alaska │
304 │ AZ │ Arizona │
405 │ AR │ Arkansas │
511 │ DC │ District of Columbia │
@randyzwitch
randyzwitch / omnisci_getting_started.jl
Last active Jul 26, 2019
Example OmniSci.jl query
View omnisci_getting_started.jl
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using OmniSci, DataFrames
@randyzwitch
randyzwitch / omniscidb-centos7-gpu.sh
Created Jun 19, 2019
Compiling OmniSciDB for CentOS 7 with GPU support
View omniscidb-centos7-gpu.sh
# run image interactively
docker run -it --runtime=nvidia --rm nvidia/cuda:10.0-devel-centos7 bash
# update image
yum update -y && yum install git sudo -y
# clone project and download/install dependencies
git clone https://github.com/omnisci/omniscidb.git
bash /omniscidb/scripts/mapd-deps-prebuilt.sh
@randyzwitch
randyzwitch / peloton_script.py
Last active Jun 20, 2019
Peloton bulk download script
View peloton_script.py
import requests
import pandas as pd
user = "user"
password = "password"
# authenticate to get user_id and session_id
authcall = requests.post("https://api.pelotoncycle.com/auth/login",
json = {"username_or_email": user, "password": password})
@randyzwitch
randyzwitch / servers-purple
Last active Jun 5, 2019
Purple ColorBrewer Scale for OmniSci
View servers-purple
"quantitative": [
[...], // Default quantitative scales removed for brevity
[
"#fcfbfd",
"#efedf5",
"#dadaeb",
"#bcbddc",
"#9e9ac8",
"#807dba",
"#6a51a3",
View servers-custom.json
"custom": [
"#ea5545",
"#bdcf32",
"#b33dc6",
"#ef9b20",
"#87bc45",
"#f46a9b",
"#ace5c7",
"#ede15b",
"#836dc5",
You can’t perform that action at this time.