function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function getcrop(img) local w, h, g = img.width, img.height, img.getInt local x1, y1, x2, y2 = 0, 0, w, h -- left side local colors = {} while x1 < x2 do for y=y1, y2-1 do colors[g(x1, y)] = 1 end if tablelength(colors) > 1 then break end x1=x1+1 end -- top side colors = {} while y1 < y2 do for x=x1, x2-1 do colors[g(x, y1)] = 1 end if tablelength(colors) > 1 then break end y1=y1+1 end -- right side colors = {} while x2 > x1 do for y=y1, y2-1 do colors[g(x2-1, y)] = 1 end if tablelength(colors) > 1 then break end x2=x2-1 end -- bottom side colors = {} while y2 > y1 do for x=x1, x2-1 do colors[g(x, y2-1)] = 1 end if tablelength(colors) > 1 then break end y2=y2-1 end if x2 <= x1 or y2 <= y1 then -- weird result? return full image x1, y1, x2, y2 = 0, 0, w, h end return x1, y1, x2, y2 end
Began life as a copy of #324
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 |
---|---|---|---|
208 | #1000604 (pitcher) | 2015-08-18 00:51:07 | |
190 | #1000610 (pitcher) | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { function tablelength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function getcrop(img) local w, h, g = img.width, img.height, img.getInt local x1, y1, x2, y2 = 0, 0, w, h -- left side local colors = {} while x1 < x2 do for y=y1, y2-1 do colors[g(x1, y)] = 1 end if tablelength(colors) > 1 then break end x1=x1+1 end -- top side colors = {} while y1 < y2 do for x=x1, x2-1 do colors[g(x, y1)] = 1 end if tablelength(colors) > 1 then break end y1=y1+1 end -- right side colors = {} while x2 > x1 do for y=y1, y2-1 do colors[g(x2-1, y)] = 1 end if tablelength(colors) > 1 then break end x2=x2-1 end -- bottom side colors = {} while y2 > y1 do for x=x1, x2-1 do colors[g(x, y2-1)] = 1 end if tablelength(colors) > 1 then break end y2=y2-1 end if x2 <= x1 or y2 <= y1 then -- weird result? return full image x1, y1, x2, y2 = 0, 0, w, h end return x1, y1, x2, y2 end }} | 2015-08-18 00:50:25 |
Image | Result | Result calculated |
---|---|---|
#1000003 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#201 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#183 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#182 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#178 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#145 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#141 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#115 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#113 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#112 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#100 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#98 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#93 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#92 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#91 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#90 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#87 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#85 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#84 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#49 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#48 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:18 [raw result] [visualize] |
#1000053 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:13 [raw result] [visualize] |
#309 | java.io.IOException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operat... | 2016-07-31 19:44:13 [raw result] [visualize] |