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

!752

/*
Date (automatically recorded)
Task: Find URL area in browser
Program: #1234
Data gathered: Screenshot (image)
Result: Rect(...)
Verdict: good
Comments: ...
*/

concept Perf {
  new Ref task;
  new S programID;
  new RefL data;
  new Ref verdict;
}

concept ProgramField {
  S field, valueStructure;
}

p {
  conceptsAndBot();
  
  final S progID = "#1006217";
  final O program = hotwire(progID);
  final L<S> fields = splitAtSpace("img clips bestClip");
  
  callMain(program);
  
  awt {
    final new Var<JComponent> form;
    JButton btnGood = jbutton("Good", r {
      recordProgramRun("good", progID, program, fields);
      disposeFrame(form!) });
    JButton btnBad = jbutton("Bad", r {
      recordProgramRun("bad", progID, program, fields);
      disposeFrame(form!) });
    form.set(showFormTitled("Your Verdict",
      "", jline(btnGood, btnBad)));
  }
}

static Perf recordProgramRun(S verdict, S programID, O program, L<S> fields) {
  Perf perf = cnew(Perf, verdict := cstr(verdict),
    +programID, task := cstr(getSnippetTitle(programID)));
  for (S field : fields) pcall {
    perf.data.add(cnew(ProgramField, +field,
      valueStructure := structure(getOpt(program, field))));
  }
  ret perf;
}

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: 482 / 559
Referenced in: [show references]