1 | get("#265") -- json.encode, json.decode |
2 | |
3 | function acceptable(e) |
4 | local r = e.r_result |
5 | if r == 'nil' or r == 'I hate it!' |
6 | --[[or r == 'I like it!']] then return false end |
7 | if string.find(r, "^org.luaj.vm2.LuaError") then return false end |
8 | return true |
9 | end |
10 | |
11 | lst = json.decode(input) |
12 | newlst = {} |
13 | for _, e in ipairs(lst) do |
14 | if acceptable(e) then |
15 | table.insert(newlst, e) |
16 | end |
17 | end |
18 | |
19 | return json.encode(newlst) |
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 | |
---|---|---|---|---|
653 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { get("#265") -- json.encode, json.decode function acceptable(e) local r = e.r_result if r == 'nil' or r == 'I hate it!' --[[or r == 'I like it!']] then return false end if string.find(r, "^org.luaj.vm2.LuaError") then return false end return true end lst = json.decode(input) newlst = {} for _, e in ipairs(lst) do if acceptable(e) then table.insert(newlst, e) end end return json.encode(newlst) }} | 2015-08-19 04:40:07 | delete |
651 | #1000604 (pitcher) | 2015-08-18 00:07:22 |
Recognizer | Recognition Result | Visualize | Recalc |
---|---|---|---|
#308 | 435 | [visualize] |
Snippet ID: | #300 |
Snippet name: | Ranker that excludes really boring results (nil etc) |
Eternal ID of this version: | #300/1 |
Text MD5: | 7ad37b43f78ac9200077286a9a4075db |
Author: | stefan |
Category: | image recognition rankers |
Type: | Lua code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2014-12-08 21:04:24 |
Source code size: | 435 bytes / 19 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 1169 / 228 |
Referenced in: | [show references] |