- Install the chromedriver package via:
npm install chromedriver --saveor install with a local binary via:
npm install chromedriver --chromedriver_filepath=C:\\YOUR_PROJECT_PATH\\chromedriver.zipnpm install chromedriver --saveor install with a local binary via:
npm install chromedriver --chromedriver_filepath=C:\\YOUR_PROJECT_PATH\\chromedriver.zip| # | |
| # [2017-07-10] Challenge #323 [Easy] 3SUM | |
| # https://www.reddit.com/r/dailyprogrammer/comments/6melen/20170710_challenge_323_easy_3sum/ | |
| # | |
| # Demo at http://www.r-fiddle.org/#/fiddle?id=Qzdqx96U&version=2 | |
| # | |
| # In computational complexity theory, the 3SUM problem asks if a given set of n real numbers contains three elements that sum to zero. | |
| # | |
| # by Kory Becker | |
| # http://primaryobjects.com |
| var date = new Date().toISOString(); | |
| // 2017-07-19T13:52:37.361Z | |
| console.log(date); | |
| // 2017-07-19T13:52:37Z | |
| console.log(moment.utc(date).format()); | |
| // 2017-07-19T09:52:37-04:00 | |
| console.log(moment.utc(date).local().format()); |
| var bestPurchase = function(prices) { | |
| var best = null; | |
| var current = {}; | |
| prices.forEach(function(price) { | |
| if (!current.min || price < current.min) { | |
| // New buy-point. | |
| if (current.min && current.max) { | |
| current.profit = current.max - current.min; | |
| packages <- c('flexclust', 'caTools') | |
| if (length(setdiff(packages, rownames(installed.packages()))) > 0) { | |
| install.packages(setdiff(packages, rownames(installed.packages()))) | |
| } | |
| library(flexclust) | |
| library(caTools) | |
| # Read the data set. Source: https://investor.vanguard.com/mutual-funds/list#/etf/name/month-end-returns | |
| data <- read.csv2('vanguard-etf.tsv', header=T, sep='\t', stringsAsFactors=F) |
Our family owned "Larimore's Diner" in Foxboro, Mass. in 1929 (I was 5 years old at that time). When the depression hit, we lost the Diner and moved into my grandfather's home in Miami. Grandfather, who was a millionaire investor and chief executive of an investment trust company, lost everything--including the Miami home we lived in.
-1929--1930--1931--1932
(-31%)(-25%)(-43%)(-08%) Large Cap Stocks
(-34%)(-35%)(-47%)(-06%) Mid/Small Cap Stocks
| # Generate a set of random colors. | |
| colors <- as.data.frame(t(sapply(1:1000, function(i) { | |
| parts <- sample(0:255, 3) | |
| c(red = parts[1], green = parts[2], blue = parts[3], hex = rgb(parts[1], parts[2], parts[3], maxColorValue = 255)) | |
| })), stringsAsFactors = F) | |
| colors$red <- as.numeric(colors$red) | |
| colors$green <- as.numeric(colors$green) | |
| colors$blue <- as.numeric(colors$blue) |
| # | |
| # [2017-06-12] Challenge #319 [Easy] Condensing Sentences | |
| # https://www.reddit.com/r/dailyprogrammer/comments/6grwny/20170612_challenge_319_easy_condensing_sentences/ | |
| # | |
| # Demo at http://www.r-fiddle.org/#/fiddle?id=p7yvuSZQ&version=2 | |
| # | |
| # Compression makes use of the fact that repeated structures are redundant, and it's more efficient to represent the pattern and the count or a reference to it. Siimilarly, we can condense a sentence by using the redundancy of overlapping letters from the end of one word and the start of the next. In this manner we can reduce the size of the sentence, even if we start to lose meaning. | |
| # For instance, the phrase "live verses" can be condensed to "liverses". | |
| # In this challenge you'll be asked to write a tool to condense sentences. | |
| # |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script data-require="jquery@3.1.1" data-semver="3.1.1" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
| <script data-require="tether@*" data-semver="1.4.0" src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js"></script> | |
| <link data-require="bootstrap@4.0.5" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" /> | |
| <script data-require="bootstrap@4.0.5" data-semver="4.0.5" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/js/bootstrap.min.js"></script> | |
| <script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react.min.js"></script> | |
| <script data-require="react@*" data-semver="15.5.0" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.0/react-dom.min.js"></script> |