!752 sS suckerID = "#1004654", algoID = "#1004663"; sclass Desc { S progID, params; } p { load("algoID"); if (args.length != 0) algoID = args[0]; if (args.length > 1) suckerID = args[1]; if (isAWT()) { final JTextField tf = new JTextField(algoID); showForm("Algorithm to feed (ID):", tf, r { algoID = trim(tf.getText()); save("algoID"); thread { wakeSucker(suckerID, algoID); } }); } else wakeSucker(suckerID, algoID); } static void wakeSucker(S suckerID, S algoID) { ping(); algoID = fsI(algoID); print("Waking..."); O sucker = run(suckerID); print("Loading..."); final O algo = hotwire(algoID); print("Feeding..."); Class intrface = getClass(sucker, "main$Algorithm"); assertNotNull("main$Algorithm", intrface); O proxy = java.lang.reflect.Proxy.newProxyInstance(intrface.getClassLoader(), new Class[] { intrface }, new InvocationHandler { public O invoke(O proxy, Method method, O[] args) { assertEquals(method.getName(), "recognizeWord"); ret call(algo, method.getName(), quickExport(args[0], algo), quickExport(args[1], algo)); } }); bool rep = hasMethodNamed(algo, "prepareNext"); int count = 1; while (licensed() && (rep ? isTrue(call(algo, "prepareNext")) : (count-- > 0))) { S desc = algoID; S params = cast callOpt(algo, "getParams"); if (nempty(params)) desc += " " + params; O result = callOpt(sucker, "suck", desc, proxy); print("Suck Result: " + struct(result)); } cleanUp(algo); cleanUp(sucker); }