<commit_before>package radicalzephyr;

import java.util.ArrayList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.List;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.scene.web.WebEngine;
import javafx.stage.Stage;

public class WebFX extends Application {
    private String domain;
    private String port;
    private int width;
    private int height;

    private int getIntArgOrDefault(Map<String, String> args, String argName, int defaultValue) {
        try {
            return Integer.parseInt(args.getOrDefault(argName, ""));
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }

    @Override
    public void init() throws Exception {
        Map<String, String> args = getParameters().getNamed();

        this.domain = args.getOrDefault("domain", "localhost");
        this.port   = args.getOrDefault("port", "3000");

        this.width  = getIntArgOrDefault(args, "width", 1024);
        this.height = getIntArgOrDefault(args, "height", 768);
    }

    @Override
    public void start(Stage primaryStage) {
        WebView browser = new WebView();
        WebEngine engine = browser.getEngine();

        String domain = "localhost";
        String port = "9393";

        engine.load("http://" + domain + ":" + port);

        int width = 1024;
        int height = 768;
        Scene s = new Scene(browser, width, height);

        primaryStage.setScene(s);
        primaryStage.show();
    }

    private static String[] constructArgVector(Map<String, Object> options) {
        List<String> args = new ArrayList<String>();

        for (Entry<String, Object> option: options.entrySet()) {
            String argName  = option.getKey();
            String argValue = option.getValue().toString();
            args.add(String.format("--%s=%s", argName, argValue));
        }

        return args.toArray(new String[0]);
    }

    public static void start(Map<String, Object> options) {
        String[] args = constructArgVector(options);
        launch(args);
    }

    public static void main(String[] args) {
        launch(args);
    }

}
<commit_msg>Use values passed in configuration instead of dummy local variables<commit_after>package radicalzephyr;

import java.util.ArrayList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.List;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import javafx.scene.web.WebEngine;
import javafx.stage.Stage;

public class WebFX extends Application {
    private String domain;
    private String port;
    private int width;
    private int height;

    private int getIntArgOrDefault(Map<String, String> args, String argName, int defaultValue) {
        try {
            return Integer.parseInt(args.getOrDefault(argName, ""));
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }

    @Override
    public void init() throws Exception {
        Map<String, String> args = getParameters().getNamed();

        this.domain = args.getOrDefault("domain", "localhost");
        this.port   = args.getOrDefault("port", "3000");

        this.width  = getIntArgOrDefault(args, "width", 1024);
        this.height = getIntArgOrDefault(args, "height", 768);
    }

    @Override
    public void start(Stage primaryStage) {
        WebView browser = new WebView();
        WebEngine engine = browser.getEngine();

        engine.load("http://" + this.domain + ":" + this.port);

        Scene s = new Scene(browser, this.width, this.height);

        primaryStage.setScene(s);
        primaryStage.show();
    }

    private static String[] constructArgVector(Map<String, Object> options) {
        List<String> args = new ArrayList<String>();

        for (Entry<String, Object> option: options.entrySet()) {
            String argName  = option.getKey();
            String argValue = option.getValue().toString();
            args.add(String.format("--%s=%s", argName, argValue));
        }

        return args.toArray(new String[0]);
    }

    public static void start(Map<String, Object> options) {
        String[] args = constructArgVector(options);
        launch(args);
    }

    public static void main(String[] args) {
        launch(args);
    }

}

{'fraction_non_alphanumeric': 0.11926605504587157, 'fraction_numerical': 0.008027522935779817, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 17, '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': '96033', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1202, 'n_words': 309}