Warning: session_start(): open(/var/lib/php/sessions/sess_961qpaagg86akoenq4trv8idnk, 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
sclass LockMatrix > DynModule {
transient int n;
transient BitSet data;
transient JComponent canvas;
JComponent visualize() {
ret awtDoEvery(canvas = JComponent() {
public void paint(Graphics2D g) {
int w = getWidth(), h = getHeight();
int rows = ifloor(sqrt(n));
if (rows == 0) fillRect(g, 0, 0, w, h, Color.white);
int cols = (n+rows-1)/rows;
for y to rows: {
for x to cols: {
fillRect(g, x1, y1, x2-x1, y2-y1, Color.white);
}
}
}
}, 1000, r updateMe);
}
void update {
new BitSet bs;
L l = dm_listModules();
for i over l:
if (getLockOwner((Lock) get(l, 'lock)) != null)
bs.set(i);
setFields(n := l(l), data := bs);
repaint(canvas);
}
}