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
-module(calc). | |
-export([start/0, start/1, launch/1]). | |
-export([ | |
reader_loop/2, | |
aggregator_loop/2, | |
writer_loop/0 | |
]). | |
start() -> launch(filename(data_tiny)). | |
start(Size) -> launch(filename(Size)). |
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 {createReadStream} from 'node:fs'; | |
import * as readline from 'node:readline/promises'; | |
const start_time = process.hrtime(); | |
const data = new Map(); | |
const filename = process.argv[2] || '../../../data/weather-data-1M.csv'; | |
console.log('filename: %s\n----', filename); | |
const fileStream = createReadStream(filename); |
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
use strict; | |
use warnings; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
my $start_time = [ gettimeofday ]; | |
my $filename = '../../data/weather-data-100K.csv'; | |
$filename = $ARGV[0] if (@ARGV); | |
print "filename: $filename\n----\n"; | |
my %data; |
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 <iostream> | |
#include <string_view> | |
#include <array> | |
#include <unordered_map> | |
#include "memory-mapped-file.hxx" | |
#include "measurement.hxx" | |
#include "aggregation.hxx" | |
#include "util.hxx" | |
#include "spy-pmr.hxx" |
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
#pragma once | |
#include <ostream> | |
#include <algorithm> | |
#include <limits> | |
#include <format> | |
namespace ribomation::brc { | |
struct Aggregation { | |
unsigned count = 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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <unordered_map> | |
#include <map> | |
#include <algorithm> | |
#include <format> | |
#include <limits> | |
#include "util.hxx" |
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 <iostream> | |
#include <fstream> | |
#include <string> | |
#include <random> | |
#include <utility> | |
#include <vector> | |
#include <format> | |
#include <cmath> | |
#include "util.hxx" |
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
package ribomation; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.Locale; | |
import java.util.stream.Collector; | |
import java.util.stream.Collectors; | |
public class CalculateAverage { |
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 groovy.transform.* | |
@ToString | |
@EqualsAndHashCode | |
class Crime implements Comparable<Crime> { | |
String title, place, description | |
Date date | |
public int compareTo(Crime that) { this.date <=> that.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
import groovy.transform.EqualsAndHashCode | |
import groovy.transform.ToString | |
import org.w3c.dom.* | |
import javax.xml.parsers.DocumentBuilderFactory | |
import java.text.ParseException | |
class CrimesList_shorter { | |
public static final String URL = "http://brottsplatskartan.se/api.php?action=getEvents&period=" |
NewerOlder