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
// seam: resize images using seam carving | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"image" | |
"image/png" | |
"image/gif" | |
"image/jpeg" |
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
# Go 1.6.2 --- | |
chip@chip:~/go/test/bench/go1$ go test -bench=. | |
testing: warning: no tests to run | |
PASS | |
BenchmarkBinaryTree17 1 50504170115 ns/op | |
BenchmarkFannkuch11 1 43940678986 ns/op | |
BenchmarkFmtFprintfEmpty 2000000 639 ns/op | |
BenchmarkFmtFprintfString 500000 3664 ns/op |
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
# go 1.6.2 | |
ajstarks@localhost:~/go/test/bench/go1$ go test -bench=. | |
testing: warning: no tests to run | |
PASS | |
BenchmarkBinaryTree17-4 1 31246864000 ns/op | |
BenchmarkFannkuch11-4 1 26586101000 ns/op | |
BenchmarkFmtFprintfEmpty-4 3000000 425 ns/op | |
BenchmarkFmtFprintfString-4 1000000 1750 ns/op |
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
// structlayout-svg: generate SVG struct layouts | |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"log" | |
"os" |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
fmt.Println(<-time.After(time.Duration(60 - time.Now().Second()) * time.Second)) | |
} |
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
<deck> | |
<slide> | |
<text xp="10" yp="50" align="center" sp="2.5" color="maroon">Go Proverbs</text> | |
<text xp="25" yp="95.00" sp="1.6" align="left">Don’t communicate by sharing memory, share memory by communicating.</text> | |
<image xp="20" yp="96.00" width="300" height="300" scale="7" name="noun_skill-share_14291.png" /> | |
<text xp="25" yp="89.8" sp="1.6" align="left">Concurrency is not parallelism.</text> | |
<image xp="20" yp="90.8" width="300" height="300" scale="7" name="noun_up-arrows_220576.png" /> | |
<text xp="25" yp="84.6" sp="1.6" align="left">Channels orchestrate; mutexes serialize.</text> | |
<image xp="20" yp="85.6" width="300" height="300" scale="7" name="noun_pipes_61289.png" /> |
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
package main | |
import ( | |
"github.com/ajstarks/svgo" | |
"os" | |
) | |
var canvas = svg.New(os.Stdout) | |
// sparkline defines the components of the sparkline: |
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
pi@raspberrypi ~ $ cd go | |
pi@raspberrypi ~/go $ cd src | |
pi@raspberrypi ~/go/src $ date | |
Mon Aug 17 19:56:02 EDT 2015 | |
pi@raspberrypi ~/go/src $ date; ./all.bash; date | |
Mon Aug 17 19:56:21 EDT 2015 | |
##### Building Go bootstrap tool. | |
cmd/dist | |
##### Building Go toolchain using /home/pi/go1.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
ajstarks@ajstarks:~/go$ ls | |
api CONTRIBUTING.md doc lib misc README.md src VERSION | |
AUTHORS CONTRIBUTORS favicon.ico LICENSE PATENTS robots.txt test | |
ajstarks@ajstarks:~/go$ cd src | |
ajstarks@ajstarks:~/go/src$ time ./all.bash | |
##### Building Go bootstrap tool. | |
cmd/dist | |
##### Building Go toolchain using /home/ajstarks/go1.4. | |
bootstrap/internal/obj |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"os" | |
"github.com/ajstarks/svgo" | |
) |