Jump to content
HWBOT Community Forums

Devroush

Members
  • Posts

    174
  • Joined

  • Last visited

Posts posted by Devroush

  1. The estimating speed part was pretty slow, 10 min is "normal". I made some changes to the code a few days ago so that it just reads the speed from a OS file, it's pretty much instant now. The benchmark itself gives you regular progress updates, but slows down near the end. But yeah it took me +2 hr with the cpu OCed to 1 GHz :). Crazy if you see that the same work can be done in 30 seconds on a modern pc.

     

    What OS/Java version do you have? I have Raspbian hard float ABI installed.

    Java version:

    dennis@raspberrypi ~ $ java -version

    java version "1.7.0_07"

    OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1)

    OpenJDK Zero VM (build 22.0-b10, mixed mode)

     

    http://hwbot.org/submission/2350613_devroush_hwbotprime_arm1176_s_2h_39min_19sec_5ms

  2. A few suggestions..

     

    (b) Simple PHP code like '$benchmarks = simplexml_load_file('http://hwbot.org/api/benchmarks'>http://hwbot.org/api/benchmarks');' fails, because it's returning JSON :) Though when I put the address into an address bar, it's returning XML. Is there some form of redirect going on?

     

    The code above gives the following error, indicating JSON:

     

    Warning: simplexml_load_file(): {"errors":null,"results":[{"name":"3DMark2001 SE","id":"1","type":"GPU","country in C:\Program Files (x86)\EasyPHP-12.1\www\HWBot API - main benchmarks\index.php on line 7

     

    I tried with an ?option=XML, still nothing. :)

     

    Going to use

    $benchmarks = json_decode(file_get_contents('http://hwbot.org/api/benchmarks'));
    

    instead, which parses the JSON into an object/array hybrid :thumb:

     

    Ah I know what's causing this. We check the accept header of the request to determine if we should return xml or json. Apparently if the request has Accept: */*, it will return json.

    curl -H "Accept: application/xml" http://hwbot.org/api/benchmarks -> xml

    curl -H "Accept: application/json" http://hwbot.org/api/benchmarks -> json

    curl -H "Accept: */*" http://hwbot.org/api/benchmarks> json

    Don't know if php has a way of setting accept headers but if you can, set Accept: application/xml :P.

     

    I'll look for a solution though.

×
×
  • Create New...