Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

81
LINES

< > BotCompany Repo | #1000506 // LCombineTwoFunctions2 (learner)

JavaX fragment (include)

java.lang.RuntimeException: java.io.IOException: Snippet #1000506 not found or not public
	at main.rethrow(m1008705.java:173)
	at main.loadSnippet(m1008705.java:342)
	at main.html2(m1008705.java:83)
	at main.html(m1008705.java:67)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at main.invokeMethod(m1008705.java:1601)
	at main.callOpt_withVarargs(m1008705.java:4387)
	at main.callOpt(m1008705.java:3326)
	at main.callHtmlMethod2(m1008705.java:11404)
	at main$MyHTTPD$1.get(m1008705.java:7337)
	at main$MyHTTPD$1.get(m1008705.java:1)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at main.invokeMethod(m1008705.java:1601)
	at main.safeCallF(m1008705.java:642)
	at main.callF(m1008705.java:611)
	at main$MyHTTPD.serve(m1008705.java:7373)
	at main$NanoHTTPD.serve_2(m1008705.java:9572)
	at main$NanoHTTPD.serve(m1008705.java:9553)
	at main$NanoHTTPD$HTTPSession.execute(m1008705.java:8453)
	at main$NanoHTTPD$ClientHandler.run(m1008705.java:7829)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.io.IOException: Snippet #1000506 not found or not public
	at main.loadSnippet_noResourceLoader(m1008705.java:395)
	at main.loadSnippet(m1008705.java:365)
	at main.loadSnippet(m1008705.java:341)
	... 21 more

Author comment

Began life as a copy of #1000500

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
913 #1000604 (pitcher) 2015-08-20 15:28:24
912 #1000610 Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
// extensive version (better results) with full search

static class LCombineTwoFunctions2 extends LearnerImpl {
static boolean debug;
static long instances;
Stepper stepper;
new List<O[]> examples;

*() {
++instances;
if (debug)
debug("Instances: " + instances);
}
public void finalize() {--instances; }

public void processInOut(O in, O out) {
examples.add(new O[] {in, out});

if (stepper == null)
stepper = new Stepper(allFunctions());

while (!stepper.ended()) {
long time = System.currentTimeMillis();
boolean b = check(stepper.current());
time = System.currentTimeMillis()-time;
if (debug) debug("check time: " + time);
if (b)
ret; // ok, keep
else
stepper.step();
}

fail();
}

boolean check(F[] fg) {
if (debug) {
debug("Examples: " + examples.size() + ", stepper size: " + stepper.functions.size());
debug("Checking " + structure(fg));
}
for (O[] e : examples) {
O o = tryProcess(fg[0], e[0]);
if (o != null) {
O x = tryProcess(fg[1], o);
if (e[1].equals(x))
continue; // example ok
}
ret false;
}
ret true; // all examples ok
}

public O processIn(O in) {
F[] fg = stepper.current();
ret fg[1].process(fg[0].process(in));
}

static O tryProcess(F f, O in) null on exception {
ret f.process(in);
}

static class Stepper {
List<Function> functions;
int i1, i2;

*(List<Function> *functions) {}

boolean ended() {
ret i1 >= functions.size();
}

Function[] current() {
ret new Function[] {functions.get(i1), functions.get(i2)};
}

void step() {
if (i2 < functions.size()-1) ++i2;
else { ++i1; i2 = 0; }
}
}
}
}}
2015-08-20 01:43:10  delete 

add comment

Snippet ID: #1000506
Snippet name: LCombineTwoFunctions2 (learner)
Eternal ID of this version: #1000506/1
Text MD5: b5c33c61bcf156a6da83e68f13f209bc
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-10-17 01:25:10
Source code size: 1937 bytes / 81 lines
Pitched / IR pitched: No / No
Views / Downloads: 1562 / 2159
Referenced in: [show references]