header text

a blog of things that I (eventually) make work

Friday, 29 January 2016

Code development - Now with icons!

After surprisingly little work, I've arrived at a version of the smart mirror Processing sketch that includes a limited amount of error checking and also displays icons to represent the weather.

The icons were sourced from an awesome pack called Climacons by Adam Whitcroft (thanks!).

Integrating them into the sketch was surprisingly simple; The Yahoo weather API includes a numeric parameter that indicates the current weather. This saves needing to do string comparisons to determine which icon to use. Instead, I was able to construct a CSV file which has columns for this numeric value, the corresponding weather, and the filename of the icon that most closely matches the weather state. Then it was a simple matter of pulling out the numeric value from the API, looking the value up in a table, and displaying the relevant graphic.

All of this serves to reinforce why Processing is such a great language for fast development of ideas, and makes me realise exactly why a program in Processing is referred to as a "sketch".

1 comment:

  1. Treatment-seekers disproportionately reported negative results from these adjustments, and described how and why they fostered their elevated gambling, 카지노사이트 impulsive gambling, persistence and loss-chasing. They reported restricted uptake and effectiveness of present hurt minimisation instruments. But he said he worries in regards to the personal wreckage to other lives as this Sunday’s Super Bowl nears, a yr after Michigan legalized online gambling and sports betting. An estimated 23 million Americans wagered $4.three billion on final year’s Super Bowl, together with a record 7.three million who guess online.