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

31
LINES

< > BotCompany Repo | #1015983 // Central Restart Bot Log [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (14664L/102K).

1  
!7
2  
3  
sclass CentralRestartBotLog extends DynCalculatedList {
4  
  L<S> data;
5  
  
6  
  transient bool updateRequested;
7  
  
8  
  // We are locked already.
9  
  L<S> calc() {
10  
    if (!updateRequested && data != null) ret data;
11  
    updateRequested = false;
12  
    new MultiSet<S> ms;
13  
    for (S s : tlft(centralRestartLogSince_raw(unixTime_startOfToday()*1000))) {
14  
      SS map = parseEqualParameters(s);
15  
      ms.add(map.get('programID));
16  
    }
17  
    ret setFieldAndReturn(data := mapMultiSet(ms, func(S programID, int count) -> S {
18  
      programID + ": " + count + " [" + snippetTitle_cached(programID) + "]"
19  
    }));
20  
  }
21  
  
22  
  void start {
23  
    super.start();
24  
    ownTimer(doEvery(60.0, r uv_refresh));
25  
  }
26  
  
27  
  // uv = user-visible
28  
  void uv_refresh() {
29  
    updateRequested = true;
30  
  }
31  
}

Author comment

Began life as a copy of #1015978

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015983
Snippet name: Central Restart Bot Log [Dyn Module]
Eternal ID of this version: #1015983/8
Text MD5: 9b739a48690fbe637447818c9018a301
Transpilation MD5: 77bc90f7e5649c7e7c0b0dbe3872847c
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-12 18:26:01
Source code size: 795 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 368 / 62910
Version history: 7 change(s)
Referenced in: [show references]