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).

!7

!include #1001372  // direct nohupJavax

static int maxTabsToShow = 11;

static MultiMap<S, WebNode> index = caseInsensitiveMultiMap();
static AutoComboBox cbInput;
static JButton btnTeach;

p {
  autoRestart();
  magellan();
  showCAL_defaultSize(700, 450);
  thread { downloadTypicalWebs(); updateIndex(); }
  centerBiggerConsole();
  cbInput = replaceConsoleInputWithAutoComboBox();
  bot();
  consoleInput("Fruit Cake");
  addAskButton();
  showControls(jcenteredline(btnTeach = jbutton("", r {
    letUserMakeDiagramWithNode(consoleInput())
  })));
  
  onUpdateAndNow(consoleInputField(), r {
    S s = consoleInput();
    setText(btnTeach, "I want to teach" + (empty(s) ? "" : " about " + s));
  });

  calcOnConceptChangesInOtherProgram(circlesEditorDBID(), 1000, f updateIndex, true);
  focusInputLater();
  sleepIfMain();
}

svoid updateIndex {
  print("Updating index.");
  index = dwlw_fullNodeIndex_ci();
  updateAutoComboBoxItems(cbInput, keys(index));
  consoleStatus(n(countDistinct(values(index), 'web), "web"));
}

answer {
  s = trim(s);
  L<WebNode> nodes = index.get(lower(s));
  L<Web> webs = nodesToWebs_max(nodes, maxTabsToShow);
  if (nempty(webs)) {
    setFrameTitle(s, showTabbedWebs(map(func(Web web) {
      web_dropVisUnlessLoaded(cloneWeb(web)) }, webs)));
    ret "Found " + n(nodes, "node");
  }
  try answer "No information found - please enter some!";
}

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: 504 / 17648
Version history: 69 change(s)
Referenced in: [show references]