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
import java.util.List; | |
import java.util.function.Consumer; | |
public class Main { | |
public static void main(String[] args) { | |
final List<Integer> l1 = List.of(1, 2, 3, 4, 5); | |
final List<Double> l2 = List.of(1.1, 2.2, 3.3, 4.4, 5.5); | |
final List<String> l3 = List.of("a", "b", "c", "d", "e"); | |
CarthesianProduct prod = new CarthesianProduct(l1, l2, l3); |
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
tim@ryzen:~$ cd src/servo/ | |
tim@ryzen:~/src/servo$ time ./mach build --dev | |
info: syncing channel updates for 'nightly-2018-04-15-x86_64-unknown-linux-gnu' | |
info: latest update on 2018-04-15, rust version 1.27.0-nightly (bd40cbbe1 2018-04-14) | |
info: downloading component 'rustc' | |
73.1 MiB / 73.1 MiB (100 %) 31.5 MiB/s ETA: 0 s | |
info: downloading component 'rust-std' | |
57.6 MiB / 57.6 MiB (100 %) 34.7 MiB/s ETA: 0 s | |
info: downloading component 'cargo' | |
info: downloading component 'rust-docs' |
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
import sys | |
import csv | |
import json | |
if __name__=="__main__": | |
reader = csv.DictReader(sys.stdin) | |
sys.stdout.write(json.dumps([r for r in reader], sort_keys=False, indent=4, separators=(',', ': '))) | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#define N_ELEMENTS(array) (sizeof(array)/sizeof(*array)) | |
#define APPLY_FORMULA(result, array, func)\ | |
if (N_ELEMENTS(array)) {\ | |
result = array[0];\ | |
for (int8_t i = 1; i < N_ELEMENTS(array); i++)\ | |
result = func(result, array[i]);\ |