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

54
LINES

< > BotCompany Repo | #1004698 // Algo Sucker [Predict "Maude Primer"]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 5312K of libraries. Click here for Pure Java version (2367L/15K/52K).

1  
!752
2  
3  
static new HighestShortest highest;
4  
static new ShortestPercentiles percentiles;
5  
static S text;
6  
static double lastScore;
7  
8  
p {
9  
  load("highest");
10  
  load("percentiles");
11  
}
12  
13  
// returns true when updated result
14  
static synchronized bool suck(S desc, Algorithm algorithm) {
15  
  print("Best score: " + highest.score);
16  
  bool saved = false;
17  
  
18  
  double score = scoreAlgorithm(algorithm);
19  
  lastScore = score;
20  
  
21  
  if (highest.update(desc, score)) {
22  
    save("highest");
23  
    saved = true;
24  
  }
25  
  
26  
  if (percentiles.update(desc, score)) {
27  
    save("percentiles");
28  
    saved = true;
29  
  }
30  
  
31  
  ret saved;
32  
}
33  
34  
static S highestDesc() {
35  
  ret highest.a;
36  
}
37  
38  
static double highestScore() {
39  
  ret highest.score;
40  
}
41  
42  
static double scoreAlgorithm(Algorithm algorithm) {
43  
  ret scoreTextPredictAlgo(algorithm, getText());
44  
}
45  
46  
static bool testLua(S luaCode) {
47  
  ret suck("L " + luaCode, makeLuaTextPredictAlgo("L " + luaCode));
48  
}
49  
50  
static S getText() {
51  
  if (text == null)
52  
    text = textFromUtf8(lzmaInputStream("#1004694"));
53  
  ret text;
54  
}

Author comment

Began life as a copy of #1004654

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xinetxnxrdbb

No comments. add comment

Snippet ID: #1004698
Snippet name: Algo Sucker [Predict "Maude Primer"]
Eternal ID of this version: #1004698/1
Text MD5: b31ab3bf6eb23157b4aa4156a8476341
Transpilation MD5: 915cd1e344a34361f74b94e19bdcc67f
Author: stefan
Category: javax / images
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-28 16:49:50
Source code size: 1067 bytes / 54 lines
Pitched / IR pitched: No / No
Views / Downloads: 516 / 1877
Referenced in: [show references]