hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
algorithm in Java

 
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle View previous topic
View next topic
algorithm in Java
Author Message
irgangla



Joined: 11 Sep 2009
Posts: 3

Post algorithm in Java Reply with quote
Hi,
has someone of you solved the puzzle with a Java programm? I have problems with downloading the levels higher than 500 at once and it seems if I resume the download with the range header I get unsolveable levels. Had someone the same problem and was able to solve it?

Greetings,
irgangla
Fri Aug 24, 2012 12:03 pm View user's profile Send private message
m!nus



Joined: 28 Jul 2007
Posts: 202
Location: Germany

Post Reply with quote
To anyone who comes across this problem: The webserver doesn't deliver the whole response, thus you get an incomplete board. I had this problem with my Python implementation too. You have to accept gzipped content, then it works just fine

Code:
request = Request(url)
request.add_header('Accept-encoding', 'gzip')
res = self.opener.open(request)
ret = res.read()
if res.getheader("Content-Encoding") == "gzip":
   ret = gzip.decompress(ret)

Thu Jun 27, 2013 6:13 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Runaway Robot Puzzle All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.