This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // From http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/ | |
| // Start with a temperature, in Kelvin, somewhere between 1000 and 40000. (Other values may work, | |
| // but I can't make any promises about the quality of the algorithm's estimates above 40000 K.) | |
| function colorTemperatureToRGB(kelvin){ | |
| var temp = kelvin / 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plot = Plot[Cos[x],{x,0,2\[Pi]}]; | |
| mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1]; | |
| Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // sleepIn | |
| // The parameter weekday is true if it is a weekday, and the parameter vacation is true if we are on vacation. | |
| // We sleep in if it * is not a weekday or we're on vacation. Return true if we sleep in. | |
| public boolean sleepIn(boolean weekday, boolean vacation) { | |
| if (!weekday || vacation) { | |
| return true; | |
| } | |
| return false; | |
| } |