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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <module type="GO_MODULE" version="4"> | |
| <component name="NewModuleRootManager" inherit-compiler-output="true"> | |
| <exclude-output /> | |
| <content url="file://$MODULE_DIR$" /> | |
| <orderEntry type="jdk" jdkName="Go 1.6.2" jdkType="Go SDK" /> | |
| <orderEntry type="sourceFolder" forTests="false" /> | |
| <orderEntry type="library" name="GOPATH <Application-Level Protocols>" level="project" /> | |
| </component> | |
| </module> |
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 ( | |
| "net" | |
| "time" | |
| ) | |
| func main_DaytimeServer() { | |
| service := ":1200" | |
| tcpAddr, err := net.ResolveTCPAddr("tcp4", service) |
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/asn1" | |
| "fmt" | |
| "os" | |
| ) | |
| func main_ASN_1() { | |
| mdata, err := asn1.Marshal(13) |
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 ( | |
| "flag" | |
| "github.com/alecthomas/template" | |
| "net/http" | |
| "log" | |
| ) | |
| var addr = flag.String("addr", ":1718", "http service addresses") |
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() { | |
| ch := make(chan int, 2) | |
| ch <- 1 | |
| ch <- 2 | |
| fmt.Println(<-ch) | |
| fmt.Println(<- ch) |
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
| (restart 1) | |
| (load "stream.scm") | |
| (define (stream-map proc . argstreams) | |
| (if (stream-null? (car argstreams)) | |
| the-empty-stream | |
| (let ((s1 (apply proc (map stream-car argstreams)))) | |
| (display s1) | |
| (cons-stream | |
| s1 |
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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (put x) x) | |
| (define (get x) x) | |
| (define (get-coercion x) x) | |
| (define (put-coercion x) x) | |
| (define (square x) (* x x)) |
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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (put x) x) | |
| (define (get x) x) | |
| (define (get-coercion x) x) | |
| (define (put-coercion x) x) | |
| (define (square x) (* x x)) |
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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (put x) x) | |
| (define (get x) x) | |
| (define (get-coercion x) x) | |
| (define (put-coercion x) x) | |
| (define (square x) (* x x)) |
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
| ;#lang planet neil/sicp | |
| #lang racket | |
| (require (planet soegaard/sicp:2:1/sicp)) | |
| (define wave einstein) | |
| (define (put x) x) | |
| (define (get x) x) | |
| (define (square x) (* x x)) | |
| ;; type-tag, contents, attach-tag | |
| (define (attach-tag tag contents) |