!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; } }