This file contains hidden or 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
C:\Users\ian>vcpkg install --clean-after-build --triplet x64-windows --x-manifest-root C:\Users\ian\arrow\cpp | |
A suitable version of cmake was not found (required v3.19.2). Downloading portable cmake v3.19.2... | |
Downloading cmake... | |
https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2-win32-x86.zip -> C:\vcpkg\downloads\cmake-3.19.2-win32-x86.zip | |
Extracting cmake... | |
A suitable version of 7zip was not found (required v18.1.0). Downloading portable 7zip v18.1.0... | |
Downloading 7zip... | |
https://www.nuget.org/api/v2/package/7-Zip.CommandLine/18.1.0 -> C:\vcpkg\downloads\7-zip.commandline.18.1.0.nupkg | |
Extracting 7zip... | |
A suitable version of nuget was not found (required v5.5.1). Downloading portable nuget v5.5.1... |
This file contains hidden or 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
remotes::install_github("ianmcook/weatherAlerts") | |
remotes::install_github("ianmcook/weatherAlertAreas") | |
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts(c("TX", "LA")) # takes about 45 seconds | |
severity <- alerts@data$severity | |
colorMap <- c(Minor = "green", |
This file contains hidden or 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.packages(c("ggmap", "leaflet", "sp")) | |
devtools::install_github("ianmcook/weatherAlerts") | |
devtools::install_github("ianmcook/weatherAlertAreas") | |
# geocode home address | |
library(ggmap) | |
register_google("ENTER_GCP_GEOCODING_API_KEY_HERE") | |
home <- geocode("University of North Carolina at Chapel Hill") | |
# or specify coordinates of home |
This file contains hidden or 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
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("NC") # takes a few seconds | |
alerts <- alerts[alerts$event == "Tornado Warning",] | |
leaflet() %>% | |
addTiles() %>% | |
addPolygons(data = alerts, color = "black", fillColor = "magenta", weight = 1) |
This file contains hidden or 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
piece | base_diameter | height | weight | |
---|---|---|---|---|
King | 37.3086 | 95.1557 | 50.2774 | |
King | 36.9878 | 95.3598 | 51.5528 | |
King | 37.6846 | 94.8507 | 50.7298 | |
King | 37.4201 | 96.2158 | 50.9344 | |
King | 36.7413 | 95.5326 | 51.9347 | |
King | 36.8166 | 96.0273 | 51.2393 | |
King | 37.5822 | 95.8491 | 50.8103 | |
King | 37.4132 | 95.2667 | 52.2267 | |
King | 37.7643 | 94.9941 | 51.2417 |
This file contains hidden or 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
# vented box loudspeaker equations | |
Qts <- 0.40 # property of driver | |
fs <- 19 # property of driver | |
Vas <- 260 # property of driver | |
# you choose an alignment, | |
# choose a QL (assume 7 for starters), | |
# then look up the following values | |
# in the appropriate table on LDC p.58-62: |
This file contains hidden or 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
# closed box loudspeaker equations | |
Qtc <- 0.707 # you choose this; see LDC p.24 | |
Qts <- 0.40 # property of driver | |
fs <- 19 # property of driver | |
Vas <- 260 # property of driver | |
alpha <- (Qtc/Qts) ^ 2 - 1 | |
fc <- (Qtc * fs) / Qts |
This file contains hidden or 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
from pyspark.sql import SparkSession | |
from pyspark.sql.types import StructType, StructField, IntegerType, StringType, FloatType | |
from pyspark.sql.functions import col, round | |
spark = SparkSession.builder.master('local').getOrCreate() | |
games = spark.createDataFrame( | |
[ | |
(1, 'Monopoly', 'Elizabeth Magie', 1903, 8, 2, 6, 19.99), | |
(2, 'Scrabble', 'Alfred Mosher Butts', 1938, 8, 2, 4, 17.99), |
This file contains hidden or 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 2018 Cloudera, Inc. | |
# | |
# 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 hidden or 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
devtools::install_github("ianmcook/weatherAlerts") | |
devtools::install_github("ianmcook/weatherAlertAreas") | |
library(weatherAlerts) | |
library(leaflet) | |
alerts <- getAlerts("FL") # takes about 30 seconds | |
severity <- alerts@data$severity | |
colorMap <- c(Minor = "green", |