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

34
LINES

< > BotCompany Repo | #1002963 // Unimind

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

Libraryless. Click here for Pure Java version (1789L/12K/39K).

1  
!752
2  
3  
static class Entry {
4  
  S text;
5  
  long time;
6  
  S who;
7  
}
8  
9  
static PersistentLog<Entry> unimind;
10  
11  
p {
12  
  unimind = new PersistentLog("unimind");
13  
}
14  
15  
static S html(S uri, Map<S, S> params) {
16  
  S line = params.get("line");
17  
  if (nempty(line)) {
18  
    new Entry e;
19  
    e.time = now();
20  
    e.text = line;
21  
    unimind.add(e);
22  
    ret hrefresh(pageLink());
23  
  }
24  
  
25  
  new L<Map> lines;
26  
  for (Entry e : unimind)
27  
    lines.add(litmap("Line", e.text));
28  
  S formContents = tag("input", "", "type", "text", "name", "line",
29  
    "autofocus", "1");
30  
  formContents += " " 
31  
    + tag("input", "", "type", "submit", "value", "Say");
32  
  ret htmlTable(lines)
33  
    + tag("form", p(formContents), "method", "POST");
34  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002963
Snippet name: Unimind
Eternal ID of this version: #1002963/1
Text MD5: 639b6878b0320ba93439e84f299d1b3f
Transpilation MD5: 5ae989c9bfd270a7b8b3e5fce24d8df2
Author: stefan
Category: nl bots
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-04-13 21:19:15
Source code size: 724 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 613 / 769
Referenced in: [show references]