<commit_before>package com.continuum.main;

import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

import java.applet.Applet;
import java.awt.*;

/**
 * The heart and soul of Continuum.
 */
public class ContinuumApple extends Applet {

    private final Continuum _continuum;
    private final Canvas _canvas;

    public ContinuumApple() {
        _continuum = Continuum.getInstance();
        _continuum.setSandboxed(true);

        setLayout(new BorderLayout());

        _canvas = new Canvas() {
            @Override
            public void addNotify() {
                super.addNotify();
                startGame();
            }

            @Override
            public void removeNotify() {
                super.removeNotify();
                _continuum.stopGame();
            }
        };

        _canvas.setSize(getWidth(), getHeight());

        add(_canvas);

        _canvas.setFocusable(true);
        _canvas.requestFocus();
        _canvas.setIgnoreRepaint(true);
    }

    private void startGame() {
        Thread t = new Thread() {
            @Override
            public void run() {
                try {
                    Display.setParent(_canvas);
                    Display.setDisplayMode(new DisplayMode(1024, 576));
                    Display.setTitle("Continuum - Applet");
                    Display.create();

                    _continuum.initControllers();
                    _continuum.initGame();
                    _continuum.startGame();
                } catch (Exception e) {
                    System.err.println(e);
                }
            }
        };

        t.start();
    }

    @Override
    public void init() {
        startGame();
    }

    @Override
    public void start() {
        _continuum.unpauseGame();
    }

    @Override
    public void stop() {
        _continuum.pauseGame();
    }

    @Override
    public void destroy() {
        _continuum.stopGame();
    }
}
<commit_msg>Adjusts applet code<commit_after>package com.continuum.main;

import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;

import java.applet.Applet;
import java.awt.*;

/**
 * The heart and soul of Continuum.
 */
public class ContinuumApple extends Applet {

    private Continuum _continuum;
    private Canvas _canvas;
	private Thread _gameThread;

	@Override
	public void init() {
		setLayout(new BorderLayout());

		_canvas = new Canvas() {
			@Override
			public void addNotify() {
				super.addNotify();
				startGame();
			}

			@Override
			public void removeNotify() {
				super.removeNotify();
				_continuum.stopGame();

				try {
					_gameThread.join();
				} catch (InterruptedException e) {}
			}
		};

		_canvas.setSize(getWidth(), getHeight());

		add(_canvas);

		_canvas.setFocusable(true);
		_canvas.requestFocus();
		_canvas.setIgnoreRepaint(true);
	}

    private void startGame() {
        _gameThread = new Thread() {
            @Override
            public void run() {
                try {
                    Display.setParent(_canvas);;
                    Display.create();

                    _continuum.initControllers();
                    _continuum.initGame();
                    _continuum.startGame();
                } catch (Exception e) {
                    System.err.println(e);
                }
            }
        };

		_gameThread.start();
    }

    @Override
    public void start() {

    }

    @Override
    public void stop() {

	}

    @Override
    public void destroy() {
        remove(_canvas);
		super.destroy();
    }
}

{'fraction_non_alphanumeric': 0.10766219239373602, 'fraction_numerical': 0.0019574944071588368, 'mean_word_length': 1.709848484848485, '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': '2490589', 'n_tokens_mistral': 1080, 'n_tokens_neox': 971, 'n_words': 203}