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

52
LINES

< > BotCompany Repo | #1010516 // Encyclopedia 1

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (16197L/120K).

1  
!7
2  
3  
!include #1001372  // direct nohupJavax
4  
5  
static int maxTabsToShow = 11;
6  
7  
static MultiMap<S, WebNode> index = caseInsensitiveMultiMap();
8  
static AutoComboBox cbInput;
9  
static JButton btnTeach;
10  
11  
p {
12  
  autoRestart();
13  
  magellan();
14  
  showCAL_defaultSize(700, 450);
15  
  thread { downloadTypicalWebs(); updateIndex(); }
16  
  centerBiggerConsole();
17  
  cbInput = replaceConsoleInputWithAutoComboBox();
18  
  bot();
19  
  consoleInput("Fruit Cake");
20  
  addAskButton();
21  
  showControls(jcenteredline(btnTeach = jbutton("", r {
22  
    letUserMakeDiagramWithNode(consoleInput())
23  
  })));
24  
  
25  
  onUpdateAndNow(consoleInputField(), r {
26  
    S s = consoleInput();
27  
    setText(btnTeach, "I want to teach" + (empty(s) ? "" : " about " + s));
28  
  });
29  
30  
  calcOnConceptChangesInOtherProgram(circlesEditorDBID(), 1000, f updateIndex, true);
31  
  focusInputLater();
32  
  sleepIfMain();
33  
}
34  
35  
svoid updateIndex {
36  
  print("Updating index.");
37  
  index = dwlw_fullNodeIndex_ci();
38  
  updateAutoComboBoxItems(cbInput, keys(index));
39  
  consoleStatus(n(countDistinct(values(index), 'web), "web"));
40  
}
41  
42  
answer {
43  
  s = trim(s);
44  
  L<WebNode> nodes = index.get(lower(s));
45  
  L<Web> webs = nodesToWebs_max(nodes, maxTabsToShow);
46  
  if (nempty(webs)) {
47  
    setFrameTitle(s, showTabbedWebs(map(func(Web web) {
48  
      web_dropVisUnlessLoaded(cloneWeb(web)) }, webs)));
49  
    ret "Found " + n(nodes, "node");
50  
  }
51  
  try answer "No information found - please enter some!";
52  
}

Author comment

Began life as a copy of #1010511

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010516
Snippet name: Encyclopedia 1
Eternal ID of this version: #1010516/70
Text MD5: 1947583e34deaabb6f6554be9d5c31b8
Transpilation MD5: ce1bddcb308738b30906ea8035e6d05f
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-16 23:36:58
Source code size: 1444 bytes / 52 lines
Pitched / IR pitched: No / No
Views / Downloads: 653 / 17980
Version history: 69 change(s)
Referenced in: [show references]