Warning: session_start(): open(/var/lib/php/sessions/sess_ss5fc8j38t762vjks0kiebtbde, 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
!747
m {
p {
// List all JavaX programs
L ids = searchSnippets("type:34 type:40"); // all main programs
print(ids.size() + " JavaX programs found");
// Load their sources
// Find questions
// Group
}
// returns list of snippet IDs
static L searchSnippets(S query) ctex {
S url = "http://tinybrain.de:8080/tb/search.php?q=" + urlencode(query);
S page = loadPage(url);
Matcher m = Pattern.compile(">(#\\d+) - (.*?)
").matcher(page);
new L ids;
while (m.find())
ids.add(m.group(1));
return ids;
}
static L findQuestions(S src) {
new L questions;
L tok = javaTok(src);
for (int i = 1; i+4 < tok.size(); i += 2)
if (tok.get(i).equals("match3") && tok.get(i+2).equals("(")
&& isQuoted(tok.get(i+4)))
questions.add(tok.get(i+4));
return questions;
}
}