TornSoul.
Tried to use your API. Can't get it to work. What am I doing wrong.
To keep things easy and to exclude coding errors I used "Hurl.it — Make HTTP Requests"
Tried the example on your page.
setting in hurlit.
Url: http://edstarcoordinator.com/api.asmx/GetSystems
Type: POST
Parameters: ver=1&date=2014-09-18+12%3A34%3A56&cr=5
Error received from hurlit:Code:Cache-Control: private Content-Length: 3030 Content-Type: text/html; charset=utf-8 Date: Wed, 22 Oct 2014 10:22:43 GMT Server: Microsoft-IIS/7.5 X-Aspnet-Version: 4.0.30319 X-Powered-By: ASP.NET BODY view formatted <html> <head> <title>Runtime Error</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style> </head> <body bgcolor="white"> <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1> <h2> <i>Runtime Error</i> </h2></span> <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "> <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. <br><br> <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".<br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> <code><pre> <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration></pre></code> </td> </tr> </table> <br> <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.<br><br> <table width=100% bgcolor="#ffffcc"> <tr> <td> <code><pre> <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration></pre></code> </td> </tr> </table> <br> </body> </html>
const apiurl = "http://edstarcoordinator.com/api.asmx/GetDistances"
resp, err := http.PostForm(apiurl, url.Values{ "ver": {"1.1"}, "date": {"2014-09-18"} })
Great. Thanks. Updated the OP. Have a look and please tell me if its correct. Would it be possible for you to update your OP. As I have linked to that and your source code. I did NOT provide a link to your maps.
I am also getting 500 Internal Server Errors from TornSoul's API. I was attempting to use it to GetSystems so as to have the data to work on some ideas for the distance rounding discrepancy....
In other news, I'm definitely missing about 60 systems based on just the distances data I have, compared to the recently quoted system counts. I *can* work with just coordinates - I would just skip the use of the 'resolve' script, which exists solely to turn distances into coordinates - but I also like to keep the primary data around.
Might be easier for you to grab my systems.json (link in first post) - it has all the systems we have so far and all the distance data I've got. I can upload the webpage I used to look at this issue too if you're interested.
Please consider adding the route planner map to the list of tools using the coordinates, too:
Online
Forum
Source code
I need to add link to the map from Chromatix, since his work inspired my project in the first place.
I saw your very useful input here. Can't recall if you have made stuff for verification etc (not a perfect memory). Can you please tell me in what list I can best put you? There WILL be overlap and for example Chromatix will end up in both lists. Note: If you don't mind I certainly add your name in the credits list.
Thanks for the explanation.
I haven't been able to do anything yet to improve/calculate coordinates, and I am not yet sure if my plans will improve anything in the first place. Therefore I believe I do not (yet) belong to the credits. I just thought my map is a good visual representation of the work you all have done here, therefore might be considered for addition to the "List of third party tools using star systems".
Main difference between your and smackers file:
1) single vs multiple contributors. I like multiple authors credited by name instead of "combined"
2) "Not present tag". I like that one.
3) capitalisation scheme.
I've updated the systems.json data to include the time and contributor info from Smacker's TD version (existing contributor info also retained for now). The systems.html has also been updated and should produce CSV output that is very close to TD's. Also fixed some stuff in entry.html.
Code:Calculated Displayed 131.336 496795921 131.337 (rounded up instead of down)
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef struct {
char name[128];
float x;
float y;
float z;
} star;
star stars[] = {
{ "Keries", -18.90625, 27.21875, 12.59375 },
{ "WREDGUIA WH-Q B46-2", -132.6875, 26.46875, -53 }
};
int main(int argc, char *argv[]) {
float d = 0;
d = sqrtf(
powf(stars[0].x - stars[1].x, 2) +
powf(stars[0].y - stars[1].y, 2) +
powf(stars[0].z - stars[1].z, 2)
);
printf("Distance: %10.6f\n", d);
return 0;
}
14:57:54 2$ ./rounding
Distance: 131.336502
sqrt(( -18.90625 - -132.6875)^2 + (27.21875 - 26.46875)^2 + (12.59375- -53)^2)
131.33649
Didn't speak up yesterday (my bad) but I actually liked the ability to create a csv file which was sorted like it was selected.sorted on screen. Yes it was possible to generate a file different then the TD one but it added flexibility.
Any change of getting a switch for it? That would be great - for me....
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void test_systems(int first, int second);
typedef struct {
char name[128];
float x;
float y;
float z;
} star;
star stars[] = {
{ "Keries", -18.90625, 27.21875, 12.59375 },
{ "WREDGUIA WH-Q B46-2", -132.6875, 26.46875, -53 },
{ "HIP 91906", -108.09375, 57.1875, -33.59375 },
{ "Wredguia UR-Q b46-2", -97.78125, 56.875, -49.75 },
{ "Loga", -79.78125, 36.53125, -42.0625 },
{ "LFT 668", -19.03125, 25.65625, -24.21875 },
{ "Haras", -118.75, 14.40625, -21.40625 },
{ "LHS 3297", -36.46875, 22.6875, -16.53125},
{ "", 0, 0, 0 }
};
int main(int argc, char *argv[]) {
int s = 0;
while (stars[s].name[0] != '\0') {
printf("%s and %s\n", stars[s].name, stars[s+1].name);
test_systems(s, s+1);
s += 2;
}
return 0;
}
void test_systems(int first, int second) {
float f = 0;
double d = 0.0;
f = sqrtf(
powf(stars[first].x - stars[second].x, 2) +
powf(stars[first].y - stars[second].y, 2) +
powf(stars[first].z - stars[second].z, 2)
);
d = sqrt(
pow(stars[first].x - stars[second].x, 2) +
pow(stars[first].y - stars[second].y, 2) +
pow(stars[first].z - stars[second].z, 2)
);
printf("\tDistance (float): %20.10f ( %7.3f )\n\tDistance (double): %20.10f ( %7.3f )\n",
f,
f,
d,
d
);
}
15:37:35 1$ ./rounding
Keries and WREDGUIA WH-Q B46-2
Distance (float): 131.3365020752 ( 131.337 )
Distance (double): 131.3364967959 ( 131.336 )
HIP 91906 and Wredguia UR-Q b46-2
Distance (float): 19.1695003510 ( 19.170 )
Distance (double): 19.1694999038 ( 19.169 )
Loga and LFT 668
Distance (float): 64.2434997559 ( 64.243 )
Distance (double): 64.2435019209 ( 64.244 )
Haras and LHS 3297
Distance (float): 82.8404998779 ( 82.840 )
Distance (double): 82.8405023411 ( 82.841 )
I assume this is Keries <> WREDGUIA WH-Q B46-2 (this is why I needed access to the data, to have the co-ords of the latter).
Using a pure C program with purely floats, and the math.h sqrt() and pow() on a Linux system I get:
Code:d = sqrtf( powf(stars[0].x - stars[1].x, 2) + powf(stars[0].y - stars[1].y, 2) + powf(stars[0].z - stars[1].z, 2) );
I don't know if your clib has special handling for the power of two, but perhaps you should try simple multiplication, i.e. use x*x instead of pow(x, 2).
Athan. Thanks for having a go at it. I've not been really following this rounding part of the crowd source project so perhaps can you explain me something.
Did I understand correctly that with what you found all rounding issues can counted for and avoided?
If so does it mean that by changing some part in the programs used so far (if possible) we can get outcomes which are the same as what ED tells us?
If so does it mean that by changing some part in the programs used so far (if possible) we can get outcomes which are the same as what ED tells us?