Weather Forecast
November 5, 2010
The internet provides a rich source of data for those who are interested: stock prices, baseball statistics, the littoral area in acres of lakes in Minnesota, and much more. In the United States, the National Oceanic and Atmospheric Administration publishes daily weather forecasts at http://weather.noaa.gov/pub/data/forecasts/.
Your task is to write a program that retrieves the current weather forecast for a requested city. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.
My Haskell solution (see http://bonsaicode.wordpress.com/2010/11/05/programming-praxis-weather-forecast/ for a version with comments):
function weather() { curl http://weather.noaa.gov/pub/data/forecasts/city/$1/$2.txt; }
weather $1 $2
This definitely made me think. At first I was tempted to just open the webpage itself.
This is basically a less pretty knock-off of Remco’s Haskell.
A ruby version
Actually, `file-exists?` and `delete-file` are standard if you include R6RS, and it is my understanding that they will be included in the R7RS too.
Anyway, I’m lazy so I used an existing http library for R6RS
A couple of lines for powershell
tag
My C implementation
Click here
Sorry for previous comment! it is on wrong post!
That is for “subset sums “!