1 | function loadDKJSON(sID) |
2 | local env = setmetatable({}, {__index=function(o, k) return _G[k] end }) |
3 | return assert(loadSnippet(sID, env))() |
4 | end |
5 | |
6 | json = loadDKJSON('#44') |
7 | |
8 | allSnippets = json.decode(getSnippet('#76')) |
9 | |
10 | env = setmetatable({}, {__index=function(o, k) return _G[k] end }) |
11 | env.snippets = allSnippets |
12 | -- input is passed on automatically |
13 | engine = loadSnippet('#45', env) -- the search engine |
14 | |
15 | result = engine() |
16 | |
17 | print(tostring(#result)..' result(s)') |
18 | for _, s in ipairs(result) do |
19 | print('#'..tostring(s.id)..' '..s.name) |
20 | end |
21 | |
22 | return json.encode(result) |
test run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
ID | Author/Program | Comment | Date |
---|---|---|---|
212 | #1000604 (pitcher) | 2015-08-18 00:51:17 | |
197 | #1000610 (pitcher) | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { function loadDKJSON(sID) local env = setmetatable({}, {__index=function(o, k) return _G[k] end }) return assert(loadSnippet(sID, env))() end json = loadDKJSON('#44') allSnippets = json.decode(getSnippet('#76')) env = setmetatable({}, {__index=function(o, k) return _G[k] end }) env.snippets = allSnippets -- input is passed on automatically engine = loadSnippet('#45', env) -- the search engine result = engine() print(tostring(#result)..' result(s)') for _, s in ipairs(result) do print('#'..tostring(s.id)..' '..s.name) end return json.encode(result) }} | 2015-08-18 00:50:43 |
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 585 | [visualize] |
Snippet ID: | #78 |
Snippet name: | Search engine test |
Eternal ID of this version: | #78/1 |
Text MD5: | a44c4ad369d4cd539435979eeeba8556 |
Author: | stefan |
Category: | searching |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2014-01-03 19:33:20 |
Source code size: | 585 bytes / 22 lines |
Pitched / IR pitched: | Yes / Yes |
Views / Downloads: | 2546 / 527 |
Referenced in: | [show references] |