public static void loadFromFile(File f) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
        String inlin = ""; int line = 0;
        while((inlin = in.readLine()) != null) {
            String lin = comment.matcher(inlin).replaceAll("");
            String spl[] = lin.split(" ");
            if(spl.length != 2) 
                throw new IOException("Invalid line format on line "+line);
            String var = spl[0];
            String sval = spl[1];
            Number val;
            try {
                val = new Integer(sval);
            } catch (NumberFormatException nfe) {
                try {
                    val = new Double(sval);
                } catch (NumberFormatException nfe2) {
                    throw new IOException("Invalid number on line "+line);
                }
            }
            try {
                Constants.class.getDeclaredField(var).set(null, val);
            } catch (NoSuchFieldException nsfe) {
                //throw new IOException("Not a recognized constant: " +var);
                System.err.println("Not a recognized constant: "+var);
            } catch (ReflectiveOperationException re) {
                throw new IOException("Couldn't set value of field: "+var);
            }
        }
    }