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.*;
// function returns source of forwarded-to page which is kind of not helpful
// (among other things, it says "not logged in")
import java.text.SimpleDateFormat;
import java.nio.charset.Charset;
import java.text.NumberFormat;
class main {
static String addTagToSnippet(String snippetID, String tag) {
return loadPageWithParams(tb_mainServer() + "/tb/add-tag.php",
mapPlus(standardCredentialsMap(), "id" , psI(snippetID), "tag", tag, "doit" , 1));
}
static String loadPageWithParams(String url, Object... params) {
return loadPage(appendQueryToURL(url, params));
}
static String loadPageWithParams(String url, Map params) {
return loadPage(appendQueryToURL(url, params));
}
static String tb_mainServer_default = "http://code.botcompany.de:8081";
static Object tb_mainServer_override; // func -> S
static String tb_mainServer() {
if (tb_mainServer_override != null) return (String) callF(tb_mainServer_override);
return trim(loadTextFile(tb_mainServer_file(),
tb_mainServer_default));
}
static File tb_mainServer_file() {
return getProgramFile("#1001638", "mainserver.txt");
}
static boolean tb_mainServer_isDefault() {
return eq(tb_mainServer(), tb_mainServer_default);
}
static Map mapPlus(Map m, Object... data) {
m = cloneMap(m);
litmap_impl(m, data);
return m;
}
static Map standardCredentialsMap() {
String user = standardCredentialsUser();
String pass = standardCredentialsPass();
if (nempty(user) && nempty(pass))
return litmap("_user" , user, "_pass" , pass);
return litmap();
}
static long psI(String snippetID) {
return parseSnippetID(snippetID);
}
static int loadPage_defaultTimeout = 60000;
static ThreadLocal loadPage_charset = new ThreadLocal();
static boolean loadPage_allowGzip = true, loadPage_debug;
static boolean loadPage_anonymous = false; // don't send computer ID
static int loadPage_verboseness = 100000;
static int loadPage_retries = 1; //60; // seconds
static ThreadLocal loadPage_silent = new ThreadLocal();
static volatile int loadPage_forcedTimeout; // ms
static ThreadLocal loadPage_forcedTimeout_byThread = new ThreadLocal(); // ms
static ThreadLocal