
HELP! What programming language should I use???
Hai, I am doing a project on claculating the shortest distance between two cities. The problem is I do not have any idea on which programming language should I use. Is it possible for me to use Dreamweaver to create interface and ASP to calculate the distance? Or I need to use JAVA or C++ to do the find the shortest distance function? What is ASP actually? Is it a programming language like JAVA, Visual Basic? <BR> Plz help me...I am really lost...HELP!HELP!HELP............. :( Thanks!

RE: HELP! What programming language should I use??
Shortest distance?<BR><BR>Well, in its simplest function all you want is some basic trig, which virtually ANY language will let you do.<BR><BR>If the shortest distance you're after is more complex (such as routefinding across many possible roads), then you'll need to investigate minimising functions which'll include such techniques as simulated annealing. These are P=NP (?) problems though (if I remember my mathematics) which are a very specialised mathematical arena.<BR><BR>Basically, I would forget the language for a moment  you need to spec out what you're doing and define the mathematics (functions) that you require. The language really is secondfiddle to the techniques needed and will basically depend on what skills you have.<BR><BR>Craig.

As the crow flies
If you're doing it in the UK and want to do it as the crow flies (point to point and not worrying about the windy roads) you can do it quite easily with the postcodes :)<BR><BR>We do it by calculating the X and Y coords of the postcode and then its just a matter of Pythagaros hehe

RE: As the crow flies
Even with the postcode, though, you still need to convert the postal code to a grid reference (the centre of the postal code) surely?!<BR><BR>I looked at this for a project a while back and found that without that lookup it was impossible to do.<BR><BR>Craig.

Its not too hard actually
We do it for one of our sites www.mydestination.co.uk (still in dev), we calculate the coordinates in SQL and that allows us to the calculate the distance, would you like the code?<BR><BR>Tim

RE: Its not too hard actually
Yeah, I would be interested. I was always under the impression that without purchasing a list from the post office it was impossible to do that conversion!<BR><BR>Craig.

RE: Its not too hard actually
Yeah I've just been going through the code to get it for you one of us wrote it about 2years ago and its referencing a huge table of all the short postcodes, email me (tim at thesitedoctor.co.uk) and I'll send it over if you like?<BR><BR>Not sure how long it'll be valid for because I've heard they're changing a lot of them soon...<BR><BR>Now I'm worried this Stored Proc is taking so long, will have to investigate that later.<BR><BR>Tim

We had a long discussion on this...
...in the advanced forum a while back. It was about US zip codes, but the principle is identical.<BR><BR>If you are using a forumula to compute the distance between your target code and every other code in the table, then you may be screwing up. The "trick" is to limit the records where you need to do this calculation by creating a "limit rectangle" and only working on codes inside that rectangle.<BR><BR>It can improve perf by a significant factor.<BR><BR>Glad to see you are just using Pythagorean Theorem for distance instead of bothering with the correct Spherical Trigonometry formula. Given the inherent inaccuracy of post code locations (e.g., you might live 4 km from the location given for your code, right?), it's silly to do more than that for any distances under a few hundred km.<BR><BR>

RE: We had a long discussion on this...
Sorry i don't understand what u all discuss about.Can u all be more specific?

See thread just above this one...
http://www.aspmessageboard.com/forum/asp.asp?M=764048&T=764048&F=20&P=1<BR><BR>But if you don't understand the concepts and the math, then you shouldn't be attempting this project. Sorry, but that's the truth.<BR><BR>
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

