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

27
LINES

< > BotCompany Repo | #1001088 // Print chat stats and last 10 lines

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

Libraryless. Click here for Pure Java version (2191L/17K/50K).

1  
!747
2  
3  
m {
4  
5  
  static !include #1000774 // CircularFifoBuffer
6  
  
7  
  p {
8  
    long lines = 0, chars = 0;
9  
    CircularFifoBuffer<S> buf = new CircularFifoBuffer<S>(10);
10  
    
11  
    print("Sucking chat...");
12  
    while (true) {
13  
      S s = suckFromChat();
14  
      if (s == "") break;
15  
      ++lines;
16  
      chars += s.length();
17  
      buf.add(s);
18  
    }
19  
    
20  
    print("Chat lines: " + lines + " (total characters w/overhead: " + chars + ")");
21  
    print("Last " + buf.size() + " line(s):");
22  
    print();
23  
    for (S s : buf)
24  
      print("  " + s);
25  
    print();
26  
  }
27  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001088
Snippet name: Print chat stats and last 10 lines
Eternal ID of this version: #1001088/1
Text MD5: e910911e1522924a926a43bdcf3d6dc8
Transpilation MD5: bbc2291a55dfca85fa5cca766559673d
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-20 18:20:34
Source code size: 574 bytes / 27 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 613 / 641
Referenced in: [show references]