<commit_before>msg = "";

function write_file (filename, text)
    output = io.open(filename, "w");
    io.output(output);
    io.write(text);
    io.close(output);
end;

function read_file (filename)
    input = io.open(filename, "r");
    io.input(input);
    input_content = io.read();
    io.close(input);

    return input_content;
end;

while (true) do
    input_content = read_file("input.txt");

    if(input_content ~= nil) then
        msg = input_content
        gui.text(0, 50, msg);
    end;

    emu.frameadvance();
end;
<commit_msg>Add infrastructure for arbitrary code entry via sms<commit_after>prev = "";
msg = "";

function write_file (filename, text)
    output = io.open(filename, "w");
    io.output(output);
    io.write(text);
    io.close(output);
end;

function read_file (filename)
    input = io.open(filename, "r");
    io.input(input);
    input_content = io.read();
    io.close(input);

    return input_content;
end;

function handle_input ()
    local address = tonumber(read_file("address.txt"), 16);
    local value = tonumber(read_file("value.txt"), 16);
    if(address ~= "None" and address ~= nil and value ~= nil) then
        memory.writebyte(address, value);
    end;
end;

while (true) do
    input_content = read_file("input.txt");

    if(input_content ~= nil) then
        msg = input_content
        gui.text(0, 50, msg);
    end;

    if(msg ~= prev) then
        prev = msg;
    	handle_input()
    end;

    emu.frameadvance();
end;

{'fraction_non_alphanumeric': 0.14565070802427513, 'fraction_numerical': 0.006743088334457181, 'mean_word_length': 3.043596730245232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2159769', 'n_tokens_mistral': 512, 'n_tokens_neox': 498, 'n_words': 120}