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

54
LINES

< > BotCompany Repo | #1006224 // Performance Collector [dev.]

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

Libraryless. Click here for Pure Java version (7883L/56K/180K).

1  
!752
2  
3  
/*
4  
Date (automatically recorded)
5  
Task: Find URL area in browser
6  
Program: #1234
7  
Data gathered: Screenshot (image)
8  
Result: Rect(...)
9  
Verdict: good
10  
Comments: ...
11  
*/
12  
13  
concept Perf {
14  
  new Ref task;
15  
  new S programID;
16  
  new RefL data;
17  
  new Ref verdict;
18  
}
19  
20  
concept ProgramField {
21  
  S field, valueStructure;
22  
}
23  
24  
p {
25  
  conceptsAndBot();
26  
  
27  
  final S progID = "#1006217";
28  
  final O program = hotwire(progID);
29  
  final L<S> fields = splitAtSpace("img clips bestClip");
30  
  
31  
  callMain(program);
32  
  
33  
  awt {
34  
    final new Var<JComponent> form;
35  
    JButton btnGood = jbutton("Good", r {
36  
      recordProgramRun("good", progID, program, fields);
37  
      disposeFrame(form!) });
38  
    JButton btnBad = jbutton("Bad", r {
39  
      recordProgramRun("bad", progID, program, fields);
40  
      disposeFrame(form!) });
41  
    form.set(showFormTitled("Your Verdict",
42  
      "", jline(btnGood, btnBad)));
43  
  }
44  
}
45  
46  
static Perf recordProgramRun(S verdict, S programID, O program, L<S> fields) {
47  
  Perf perf = cnew(Perf, verdict := cstr(verdict),
48  
    +programID, task := cstr(getSnippetTitle(programID)));
49  
  for (S field : fields) pcall {
50  
    perf.data.add(cnew(ProgramField, +field,
51  
      valueStructure := structure(getOpt(program, field))));
52  
  }
53  
  ret perf;
54  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006224
Snippet name: Performance Collector [dev.]
Eternal ID of this version: #1006224/1
Text MD5: 9e01ec8517b4d4d866c01302e4815313
Transpilation MD5: 65ff31810fce615b7ab8f6e4c89b343b
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-23 18:30:33
Source code size: 1275 bytes / 54 lines
Pitched / IR pitched: No / No
Views / Downloads: 484 / 563
Referenced in: [show references]