Warning: session_start(): open(/var/lib/php/sessions/sess_g4joedtf8mdu63cg81o38frtob, 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
interface ToSourceCodec {}
srecord noeq GridCodec1(BufferedImage stage0_image) is ToSourceCodec {
settable int rows = 20;
static GridCodec1 demo() { ret GridCodec1(defaultScreenshot()); }
// interim data & searches
Matrix stage1_matrix;
long dataBytes, dataChars;
Matrix> stage2_grid;
JE_CompressEachElementIndividually strat;
JECompressionSearch search;
JECompressionSearch forward() {
assertNotNull(stage0_image);
var m = stage1_matrix = imageToMatrix(stage0_image);
dataBytes = m.nCells()*4+2;
dataChars = dataBytes*2 + l("lInt(\"\")");
print("Matrix ~ " + takeFirst_str(60, m));
print("Trivial comp ~ " + (m.nCells()*8));
stage2_grid = matrixToMNGrid_rows(m, rows);
// list of lists
LL stage3_cells = matrixOfMatricesToListOfLists(stage2_grid);
search = jeCompressionSearch(stage3_cells, dataChars);
strat = new JE_CompressEachElementIndividually()
.elementCompressionStrategy(-> new JE_RepElement)
.onCompressionFail(ints -> javaObjectToIJavaExpr(ints);
search.addStrategy(strat);
runProbabilisticForNSeconds(5.0, search);
print(+winner());
}
S stats() { ret strat?.stats(); }
void backward {
todo();
}
JECompressionSearch.Submission winner() {
ret search.bestSubmission();
}
IJavaExpr winnerCode() {
ret winner()?.decompressor();
}
}