Warning: session_start(): open(/var/lib/php/sessions/sess_bhc46i664ergrdaif9ckfk3v4q, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
srecord Line (
S type, // 'user, 'suggested, 'bot, 'metaComment
S text
) {}
concept Interaction {
new L lines;
bool current;
}
sS lineToString(Line line) {
ret line.type + ": " + line.text;
}
module TrainInteraction {
transient S imageID = #1101205;
transient JTextArea taInteraction;
transient S log;
transient JTextField tfInput, tfToSay;
transient JLabel lblOutput;
transient Interaction current;
start {
db();
current = uniq_sync(Interaction, current := true);
log = lines(map lineToString(current.lines));
}
visualize {
onEnter(tfInput = jTextField(), r {
Line l = Line('user, gtt(tfInput));
current.lines.add(l);
current.change();
setField(log := log + lineToString(l));
});
tfToSay = jTextField();
taInteraction = dm_fieldTextArea('log);
ret withBottomMargin(20,
centerAndSouthWithMargins(
westAndCenterWithMargin(jimage(imageID), taInteraction),
northAndCenterWithMargin(
fontSize(20, lblOutput = jCenteredBoldLabel(" ")),
makeForm3(
"Your input:", focusOnShow(fontSize(16, tfInput)),
"Make me say:", fontSize(16, tfToSay))
)));
}
}