Programing Problem: Decimalize Latitude Longitude

Last year, i ran a elisp exercise but i got busy and never gave answer. Let's do this again. Here's the problem

Write a function “latitude-longitude-decimalize”.

It should take a string like this: "37°26′36.42″N 06°15′14.28″W". The return value should be a pair of numbers, like this: [37.44345 -6.25396].

Feel free to use perl, python, ruby, etc. I'll be posting a solution in emacs lisp in 2 days.

If you got stuck, you might peak at Kurt Schwehr's solution in python, at Source

Kurt's site is down at the moment. Here's a temp site for his python code: Source


• Jon Snader (jcs)'s solution in elisp + CL package, @ Source

• Kurt's solution, Python, @ Source

• Mickey Petersen's solution, using emacs calc + elisp, @ Source

Jean-Sébastien Ney, Ruby. Port of Kurt's python code to ruby, @ Source

Jorge A. Alfaro Murillo solution in elisp, @ Source

• Ian Kelly. Python 3. @ Source

will write a blog collecting the solutions and summery, and my clunky elisp solution this weekend.

Popular posts from this blog

Browser User Agent Strings 2012

11 Years of Writing About Emacs

does md5 creates more randomness?