<commit_before>//
//  main.cpp
//  chip
//
//  Created by lex on 21/08/2017.
//  Copyright © 2017 lex. All rights reserved.
//

#include <iostream>

int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
}<commit_msg>add rom loading<commit_after>//
//  main.cpp
//  chip
//
//  Created by lex on 21/08/2017.
//  Copyright © 2017 lex. All rights reserved.
//

#include <iostream>
#include <fstream>
#include <cstdint>
#include <array>

std::array<uint8_t, 4096> rom{0};

int readRom(const std::string& file) {
    std::ifstream i(file, std::ios::binary);

    if (!i.is_open()) {
        std::cout << "couldn't open file " << file << std::endl;
        return 1;
    }

    i.read(reinterpret_cast<char*>(&rom), sizeof rom);

    i.close();

    for (const auto& b : rom) {
        std::cout << b;
    }

    std::cout << std::endl;

    return 0;
}

int main(int argc, const char * argv[]) {
    if (argc < 2) {
        std::cout << "need rom" << std::endl;
        return 1;
    }

    const std::string file = argv[1];

    int r = readRom(file);

    return r;
}
{'fraction_non_alphanumeric': 0.18157661647475642, 'fraction_numerical': 0.03188662533215235, 'mean_word_length': 2.3832335329341316, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3338168', 'n_tokens_mistral': 446, 'n_tokens_neox': 403, 'n_words': 115}