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
http://tour.golang.org/#43 | |
As a simple way to play with functions and loops, implement the square root function using Newton's method. | |
In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: | |
To begin with, just repeat that calculation 10 times and see how close you get to the answer for various values (1, 2, 3, ...). | |
The approximation function for the SQRT function returns the given values for the SQRT(4)... |
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
/* | |
* The plugins used for this build. | |
*/ | |
/* | |
* Provides the compile, test, jar, etc tasks | |
*/ | |
apply plugin: 'java' | |
/* | |
* Generates the Eclipse project files. |
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
> db.SondeDataContainer.find( {"observation.pH":4.52, "observation.Battery":1.4} ).explain() | |
{ | |
"cursor" : "BasicCursor", | |
"startKey" : { | |
}, | |
"endKey" : { | |
}, | |
"nscanned" : 2419200, |
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
> db.SondeDataContainer.stats() | |
{ | |
"ns" : "netbeams.SondeDataContainer", | |
"count" : 2419200, | |
"size" : 1170892976, | |
"storageSize" : 1358632416, | |
"nindexes" : 20, | |
"ok" : 1 | |
} |
NewerOlder