import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.*;
import java.math.*;
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.text.*;
import javax.imageio.metadata.*;
import javax.imageio.stream.*;
import java.text.NumberFormat;
import java.awt.datatransfer.StringSelection;
import javafx.scene.media.*;
import javafx.embed.swing.JFXPanel;
class main {
static MediaPlayer player;
public static void main(final String[] args) throws Exception { pExperiment();
{ swing(new Runnable() { public void run() { try { new JFXPanel();
} catch (Exception __e) { throw rethrow(__e); } } public String toString() { return "new JFXPanel();"; }}); } // initializes JavaFX environment
String name = fileToURI(desktopDir("Thompson Twins - Hold Me Now-H9694K85Xc8.m4a"));
Media song = new Media(name);
player = new MediaPlayer(song);
player.play();
}
static void pExperiment() {
if (!isMain()) return;
//substance();
autoRestart(5);
experimentIcon();
centerHigherConsole();
tt();
}
static Object swing(Object f) {
return swingAndWait(f);
}
static A swing(F0 f) {
return (A) swingAndWait(f);
}
static RuntimeException rethrow(Throwable t) {
if (t instanceof Error)
_handleError((Error) t);
throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t);
}
static String fileToURI(File f) { try {
return str(f.toURI());
} catch (Exception __e) { throw rethrow(__e); } }
static File desktopDir() {
return userDir("Desktop");
}
static File desktopDir(String sub) {
return newFile(desktopDir(), sub);
}
static boolean isMain() {
return isMainProgram();
}
static double autoRestart_interval = 10;
static boolean autoRestart_on, autoRestart_debug, autoRestart_simulate;
static java.util.Timer autoRestart_timer;
static void autoRestart(double interval) {
autoRestart_interval = interval;
autoRestart();
}
static void autoRestart() {
if (!isMain() || autoRestart_on) return;
autoRestart_on = true;
autoRestart_schedule();
preloadProgramTitle();
}
static void autoRestart_off() {
if (!autoRestart_on) return;
stopTimer(autoRestart_timer);
autoRestart_timer = null;
}
static void autoRestart_schedule() {
autoRestart_timer = doLater_daemon(toMS(autoRestart_interval), "autoRestart_check");
}
static void autoRestart_check() {
try {
String newMD5;
try {
newMD5 = serverAutoRestartMD5(programID());
} catch (Throwable e) {
return;
}
if (!isMD5(newMD5)) { if (autoRestart_debug) print("autoRestart: no server transpilation"); return; }
if (autoRestart_localMD5 == null)
autoRestart_localMD5 = md5(loadCachedTranspilation(programID()));
String localMD5 = autoRestart_localMD5();
if (neq(localMD5, newMD5)) {
if (autoRestart_simulate)
print("Would upgrade now. " + localMD5 + " -> " + newMD5);
else {
infoBox("Upgrading " + programTitle());
restartWithDelay(500);
sleep();
}
}
} finally {
if (autoRestart_debug) print("autoRestart: Done");
autoRestart_schedule();
}
}
static void experimentIcon() {
consoleAndDefaultFrameIcon("#1101173" /*#1101171*/);
}
static void centerHigherConsole() {
if (headless()) return;
setConsoleHeight(600);
centerConsole();
}
static void tt() {
typeWriterConsole();
}
static String tt(Object contents, Object... params) {
return tag("tt", contents, params);
}
static void swingAndWait(Runnable r) { try {
if (isAWTThread())
r.run();
else
EventQueue.invokeAndWait(addThreadInfoToRunnable(r));
} catch (Exception __e) { throw rethrow(__e); } }
static Object swingAndWait(final Object f) {
if (isAWTThread())
return callF(f);
else {
final Var result = new Var();
swingAndWait(new Runnable() { public void run() { try {
result.set(callF(f));
} catch (Exception __e) { throw rethrow(__e); } } public String toString() { return "result.set(callF(f));"; }});
return result.get();
}
}
static void _handleError(Error e) {
call(javax(), "_handleError", e);
}
static String str(Object o) {
return o == null ? "null" : o.toString();
}
static String str(char[] c) {
return new String(c);
}
static File userDir() {
return new File(userHome());
}
static File userDir(String path) {
return new File(userHome(), path);
}
static File newFile(File base, String... names) {
for (String name : names) base = new File(base, name);
return base;
}
static File newFile(String name) {
return name == null ? null : new File(name);
}
static boolean isMainProgram() {
return creator() == null;
}
static void preloadProgramTitle() {
{ Thread _t_0 = new Thread() {
public void run() { try { programTitle(); } catch (Throwable __e) { _handleException(__e); } }
};
startThread(_t_0); }
}
static void stopTimer(java.util.Timer timer) {
if (timer != null) timer.cancel();
}
static java.util.Timer doLater_daemon(long delay, final Object r) {
final java.util.Timer timer = new java.util.Timer(true);
timer.schedule(timerTask(r), delay);
return timer;
}
static java.util.Timer doLater_daemon(double delaySeconds, final Object r) {
return doLater_daemon(toMS(delaySeconds), r);
}
static long toMS(double seconds) {
return (long) (seconds*1000);
}
static int serverAutoRestartMD5_timeout = 10000;
static String serverAutoRestartMD5(String programID) {
return loadPageSilentlyWithTimeout("http://botcompany.de/1010693/raw?id=" + psI(programID), serverAutoRestartMD5_timeout);
}
static String serverAutoRestartMD5() {
return serverAutoRestartMD5(programID());
}
static String programID() {
return getProgramID();
}
static String programID(Object o) {
return getProgramID(o);
}
static boolean isMD5(String s) {
return l(s) == 32 && isLowerHexString(s);
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
//static int print_maxLineLength = 0; // 0 = unset
static boolean print_silent; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal