This file contains 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" | |
"sort" | |
"time" | |
) | |
// a struct to hold the result from each request including an index |
This file contains 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
func waitForServer(URL string, timeout time.Duration) error { | |
ch := make(chan bool) | |
go func() { | |
for { | |
_, err := http.Get(URL) | |
if err == nil { | |
ch <- true | |
} | |
time.Sleep(10 * time.Millisecond) | |
} |
This file contains 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
import logging | |
import cStringIO | |
import csv | |
DEBUG = False | |
def data2csv(data): | |
si = cStringIO.StringIO() | |
cw = csv.writer(si, delimiter='\t',lineterminator="\n") | |
for row in data: |