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 processing.core.*;
import javax.net.ssl.*;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
public class main {
public static int timeout = 10000;
public static void main(final String[] args) throws Exception {
maxCharsInConsoleAndPrintLog(10000);
final PGauge gauge1 = pMain(PGauge.class).type(2);
final PGauge gauge2 = pMain(PGauge.class).type(2);
final PGauge gauge3 = pMain(PGauge.class).type(2);
setWindowsY(screenHeight() / 2 - pFrame(gauge1).getHeight() - 10, centerArrangeWindows(coActivateFrames(pFrame(gauge1), pFrame(gauge2), pFrame(gauge3))));
hideConsole();
while (licensed()) {
try {
pgauge_showSystemLoad(gauge1, "Old server load", parseDoubleOrMinus1(print(loadPageWithTimeoutOrNull(timeout, "http://botcompany.de/1001951/raw/system+load"))));
pgauge_showSystemLoad(gauge2, "Very old server load", parseDouble(print(loadPageWithTimeoutOrNull(timeout, "http://tinybrain.de:8080/tb-int/diskspace.php?q=system+load"))));
pgauge_showSystemLoad(gauge3, "New server load", parseDoubleOrMinus1(print(loadPageWithTimeoutOrNull(timeout, "http://butter.botcompany.de:8080/1001951/raw/system+load"))));
} catch (Throwable __e) {
printStackTrace2(__e);
}
sleepSeconds(3);
}
}
public static volatile boolean licensed_yes = true;
public static boolean licensed() {
ping();
return licensed_yes;
}
public static void licensed_off() {
licensed_yes = false;
}
public static void sleepSeconds(double s) {
if (s > 0)
sleep(round(s * 1000));
}
public static class FrameCoActivator {
public long lastTime;
public int timeout = 100;
public FrameCoActivator(final Frame... frames) {
for (final Frame f1 : frames) {
f1.addWindowListener(new WindowAdapter() {
public void windowIconified(WindowEvent e) {
lastTime = sysNow();
}
public void windowActivated(WindowEvent e) {
if (sysNow() >= lastTime + timeout) {
lastTime = sysNow();
for (Frame f2 : frames) if (f2 != f1)
activateFrame(f2);
activateFrame(f1);
}
}
});
}
}
}
public static Frame[] coActivateFrames(Frame... frames) {
new FrameCoActivator(frames);
return frames;
}
public static void maxCharsInConsoleAndPrintLog(int chars) {
maxConsoleChars(chars);
printLogMaxChars(chars);
}
public static A pMain(final Class c) {
return first(pMainWithFrame(c));
}
public static Pair pMainWithFrame(final Class c) {
return swing(new F0>() {
public Pair get() {
try {
fixContextClassLoader();
A a = nuInstance(c);
PApplet.runSketch(new String[] { c.getName() }, a);
Frame frame = (Frame) (getOpt(a.getSurface(), "frame"));
return pair(a, frame);
} catch (Exception __e) {
throw rethrow(__e);
}
}
public String toString() {
return "fixContextClassLoader();\r\n A a = nuInstance(c);\r\n //Set frames =...";
}
});
}
public static PApplet2 pMain() {
return pMain(mc());
}
public static int screenHeight() {
return getScreenHeight();
}
public static Map _registerThread_threads = newWeakHashMap();
public static Thread _registerThread(Thread t) {
_registerThread_threads.put(t, true);
return t;
}
public static void _registerThread() {
_registerThread(Thread.currentThread());
}
public static double parseDoubleOrMinus1(String s) {
try {
return Double.parseDouble(s);
} catch (Throwable _e) {
return -1;
}
}
public static String loadPageWithTimeoutOrNull(long timeout, String url) {
return loadPageWithTimeoutOrNull(url, timeout);
}
public static String loadPageWithTimeoutOrNull(String url, long timeout) {
try {
return loadPageWithTimeout(url, timeout);
} catch (Throwable e) {
printException(e);
return null;
}
}
public static String loadPageWithTimeoutOrNull(String url, double timeoutSeconds) {
return loadPageWithTimeoutOrNull(url, toMS(timeoutSeconds));
}
public static void setWindowsY(int y, List windows) {
for (Window w : unnull(windows)) windowSetY(w, y);
}
public static void pgauge_showSystemLoad(PGauge gauge, String title, double value) {
if (value < 0)
gauge.setValue(0, "ERROR");
else
gauge.setValue(100 * value, formatDoubleFull(value, 1) + " - " + title);
}
public static double parseDouble(String s) {
return Double.parseDouble(s);
}
public static volatile StringBuffer local_log = new StringBuffer();
public static volatile StringBuffer print_log = local_log;
public static volatile int print_log_max = 1024 * 1024;
public static volatile int local_log_max = 100 * 1024;
public static boolean print_silent;
public static Object print_byThread_lock = new Object();
public static volatile ThreadLocal