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
("exit" to quit) Question: What market does FitBit compete in? | |
Search Rank Squad Rank Combined Rank Answer Context | |
0 2.0 6.0 1.5 crowded market ... rather crowded ma... | |
1 7.0 1.0 1.5 oncology ...te in the oncology ... | |
2 8.0 3.0 3.0 streaming services market ...trate the streaming ... | |
3 5.0 7.0 4.0 leash ...ck a long leash. Boe... | |
4 4.0 9.0 5.0 iPhones ...io of new iPhones - ... | |
5 1.0 13.0 6.5 wearables ...hough, is wearables,... | |
6 9.0 5.0 6.5 murky ...'re in a "murky" mar... | |
7 15.0 2.0 8.0 ad market ...ce in the ad market ... |
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
>>> from whoosh.analysis import StandardAnalyzer | |
>>> | |
>>> [token.text for token in StandardAnalyzer()("This is an example analysis")] |
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
# Experimental utility function | |
message("--------------------------------------------------------------------------------\n") | |
message("Overwriting `?` function with custom utility to display in memory function help.\n") | |
message("--------------------------------------------------------------------------------\n\n") | |
help2 = function(f, ...) { | |
#' Extend `help()` to show in memory function documentation | |
#' | |
#' @details Supports python docstring-esque roxygen documentation. |
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
class A: | |
def x(self): | |
print('x: A') | |
class B(A): | |
def x(self): | |
super().x() | |
print('x: B') |
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
library(ggplot2) | |
library(gganimate) | |
library(data.table) | |
gen_heart_y = function(x, a) { | |
# source: https://i.imgur.com/avE8cxJ.gifv | |
(x^2)^(1 / 3) + 0.9 * (3.3 - x^2)^(1 / 2) * sin(a * pi * x) | |
} | |
heart_dt_list = lapply(seq(1, 15, by = 0.1), function(a) { |
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
library(R6) | |
library(ggplot2) | |
library(uuid) | |
options(stringsAsFactors = FALSE) | |
branch_base = R6Class('branch_base', | |
public = list( | |
start_x = NA_integer_, | |
start_y = NA_integer_, | |
end_x = NA_integer_, |
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/animate fractal trees at various angles for branch splits | |
library(gganimate) | |
library(ggplot2) | |
library(uuid) | |
options(stringsAsFactors = FALSE) | |
# create line segment from (0, 0) to (0, len) to be trunk of fractal tree | |
create_trunk = function(len = 1) { | |
end_point = c(0, len) |
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/Draw a Binary Fractal Tree | |
library(ggplot2) | |
library(uuid) | |
options(stringsAsFactors = FALSE) | |
# create line segment from (0, 0) to (0, len) to be trunk of fractal tree | |
create_trunk = function(len = 1) { | |
end_point = c(0, len) | |
trunk_df = data.frame(x=c(0, 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
# Create/Draw a Binary Fractal Tree | |
library(plotly) | |
# basic strucure for line shape in plotly | |
base_line = list( | |
type = "line", | |
line = list(color = "black"), | |
xref = "x", | |
yref = "y", |
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
# Barnsley fern in R | |
# reference: https://en.wikipedia.org/wiki/Barnsley_fern | |
library(plotly) | |
# FUNCTIONS FOR GENERATING BARNSLEY FERN POINTS ################################ | |
transform_1 = function(x, y) { | |
x = 0 | |
y = 0.16 * y | |
return(c(x, y)) |