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
# Too lazy to make a pull request and too impatient to wait, | |
# Just tuck 1.2 into the devel version | |
## First, | |
## $brew unlink go | |
## $vim /usr/local/Library/Formula/go.rb | |
## around line 20 under the `devel' block edit the following | |
devel do | |
#url 'https://go.googlecode.com/files/go1.2rc5.src.tar.gz' | |
#version '1.2rc5' |
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 gobike | |
/* | |
Example JSON: | |
{ | |
"HTTPStatus":200, | |
"TimeLocal":"2013-11-29T18:43:59.674946633-07:00", | |
"TimeUTC":"2013-11-30T01:43:59.674946695Z", | |
"URL":{ | |
"Scheme":"", |
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 gobike | |
import ( | |
"errors" | |
"fmt" | |
"github.com/benbjohnson/megajson/scanner" | |
"io" | |
) | |
type MStatusJSONDecoder 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
/* | |
Trying to use megajson with http.Get(url) but getting Decoding errors. | |
Have tried with various json responses using various structs. | |
Decoder errors at various indices (depending on json and structs I'm using): | |
==========Some Decoding Errors=============== | |
2013/11/29 18:27:23 decoding error: Unexpected comma at 112: ,; expected colon // common for NewMStatusJSONDecoder(resp.Body) | |
2013/11/29 18:29:14 decoding error: Unexpected null at 153: ; expected '{' or string | |
2013/11/29 18:39:01 decoding error: Unexpected number at 9: 1.1; expected '{' |
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" | |
"strings" | |
"unicode" | |
) | |
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
;; record Record | |
(defrecord User [fname lname address]) | |
;; ActiveRecord generally (Object.Model), instead namespace.Record | |
(defrecord Address [street city state zip]) | |
(defrecord Foo [a b c]) | |
(class Foo) ;java.lang.Class | |
;; Create an instance of the User and Address records | |
(def stu (User. "FirstName" "LastName" | |
(Address. "300 N Street" |
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
/* | |
* Assuming a schema similar to the Cassandra wiki quick start (http://wiki.apache.org/cassandra/GettingStarted): | |
* CREATE TABLE mykeyspace.users ( | |
* user_id int PRIMARY KEY, | |
* fname text, | |
* lname text, | |
* user_id int | |
* ) | |
* | |
* RETURNs THIS: |
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" | |
type HelloList struct { | |
people []string | |
} | |
func NewHelloList(names []string) *HelloList { | |
return &HelloList{people: names} |
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 ( | |
"bufio" | |
"fmt" | |
"os" | |
"time" | |
) | |
const numWorkers = 3 |
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" | |
"net/http" | |
"time" | |
"io/ioutil" | |
"github.com/pkulak/simpletransport/simpletransport" | |
) | |
var lotso_urls = []string{ |