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/doc/GoCourseDay1.pdf Initialization example | |
package transcendental | |
import "math" | |
var Pi float64 | |
func init() { | |
Pi = 4 * math.Atan(1) //init() function computes Pi | |
} |
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
#python 3.1 | |
x = 'hello' | |
y = 'world' | |
print(x + " " + y) |
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" | |
func main() { | |
m := make(map[string]int) //initialize | |
//map[keyType]valueType | |
m["Alice"] = 21 //Store Values to initialized |
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
var noEscape = [256]bool{ | |
'A': true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, | |
'a': true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, | |
'0': true, true, true, true, true, true, true, true, true, true, | |
'-': true, | |
'.': true, | |
'_': true, | |
'~': true, | |
} |
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
//working example of func(*iter)Next from: http://goneat.org/pkg/launchpad.net/mgo/#Iter.Next | |
package main | |
import ( | |
"fmt" | |
"launchpad.net/mgo" | |
) | |
type Person struct { |
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://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html#PrivateContent_AuthExamples | |
//Amazon CloudFront Developer's Guide (API Version 2010-11-01) Using Amazon Cloudfront>Serving Private Content > Creating a Signed URL | |
package main | |
import ( | |
"os" | |
"strconv" | |
"fmt" | |
"io/ioutil" |
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 ("template" ;"os") | |
const templ = `Hello {{.Name}}` | |
type Person struct {Name string} | |
func main() { | |
me := &Person{Name: "greg"} | |
var t = template.Must(template.New("first").Parse(templ)) |
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
//Encoding a map to a gob. Save the gob to disk. Read the gob from disk. Decode the gob into another map. | |
package main | |
import ( | |
"fmt" | |
"gob" | |
"bytes" | |
"io/ioutil" | |
) | |
func main() { |
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
// X11 viewer for a MJPEG stream, such as the one obtained from the | |
// Android app https://market.android.com/details?id=com.pas.webcam | |
package main | |
import ( | |
"exp/gui/x11" | |
"flag" | |
"http" | |
"image" |
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
<!doctype html> | |
<head> <meta charset="utf-8"> | |
<title></title> | |
<link rel="sytlesheet" href="css/sytle.css"> | |
<script type="text/javascript" src="http://worleyworks.com.s3.amazonaws.com/jwscript.js"></script> | |
</head> | |
<body> | |
<div id="container">Loading the player...</div> | |
<script type="text/javascript"> | |
jwplayer("container").setup({ |