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 a dataset of 16,592,802 rows (0.683GB): | |
Unit: seconds | |
expr min lq mean median uq max neval | |
fread("file") 14.51960 14.68574 18.82770 18.23437 22.39358 24.57221 10 | |
fread("file:///file") 15.98431 16.19990 19.78759 17.80094 20.29927 36.96590 10 | |
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(readr) | |
library(dplyr) | |
library(lubridate) | |
library(ggplot2) | |
library(tidyr) | |
data <- read_csv("~/traffic_2018-Jun-20_2018-Oct-18.csv") | |
data <- data %>% | |
mutate(Week = lubridate::isoweek(date), |
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
public interface IEatable { | |
bool Eat(); | |
} | |
public class Wateringhole : IEatable { | |
public bool Eat() { | |
// Always eat 1, so don't need to return anything. | |
// Whatever | |
return true; |
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
public bool TryGetValue(TKey key, out TValue value) { // key is hier input, value is waar de output in komt. | |
int i = FindEntry(key); // Probeer de key te vinden. | |
if (i >= 0) { // Als die er is, succes! | |
value = entries[i].value; // Assign de waarde naar value, de output. | |
return true; // En return true om aan te geven dat het gelukt is. | |
} // Zo niet: | |
value = default(TValue); // De compiler vindt dat we per se hier iets in moeten vullen. We hebben de waarde niet gevonden, dus maar default. | |
return false; // Return false om aan te geven dat het niet gelukt is. | |
} |
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
// Eagerly performs nullchecks. | |
public static IEnumerable<TResult> ZipNew<TFirst, TSecond, TResult>( | |
this IEnumerable<TFirst> first, | |
IEnumerable<TSecond> second, | |
Func<TFirst, TSecond, TResult> resultSelector) { | |
if(first == null) throw new ArgumentNullException(nameof(first)); | |
if(second == null) throw new ArgumentNullException(nameof(second)); | |
if(resultSelector == null) throw new ArgumentNullException(nameof(resultSelector)); | |
return ZipNewInternal(first, second, resultSelector); | |
} |
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
VALUES = {"2": 2, "1": 1, "0": 0, "-": -1, "=": -2} | |
LETTERS = {2: "2", 1: "1", 0: "0", -1: "-", -2: "="} | |
def add_snafu(left: str, right: str) -> str: | |
carry = 0 | |
left_list, right_list = list(left), list(right) | |
sum = [] |
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
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... | |
. ____ _ __ _ _ | |
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ | |
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ | |
\\/ ___)| |_)| | | | | || (_| | ) ) ) ) | |
' |____| .__|_| |_|_| |_\__, | / / / / | |
=========|_|==============|___/=/_/_/_/ | |
:: Spring Boot :: (v2.7.11) |
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
def get_visible_indexes(sequence: list[int]) -> list[int]: | |
running_max = -1 | |
for index, value in enumerate(sequence): | |
if value > running_max: | |
running_max = value | |
yield index | |
def parse_inputs(text: str) -> list[list[int]]: | |
return [[int(value) for value in line] for line in text.splitlines()] |