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
public class MyHTTPClient { | |
private URL mUrl; | |
public MyHTTPClient(URL url) { | |
mUrl = url; | |
} | |
public String getString() throws IOException { | |
HTTPUrlConnection urlConnection = null; | |
URL url = new URL(mUrl, "/string"); |
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
public class MyHTTPClientTest extends AndroidTestCase { | |
private MockWebServer mServer; | |
private MyHTTPClient mClient; | |
public void setUp() throws Exception { | |
mServer = new MockWebServer(); | |
mServer.play(); | |
mClient = new MyHTTPClient(mServer.getUrl("/")); | |
} | |
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 ( | |
"errors" | |
) | |
var ( | |
// ErrNotFound is returned when something isn't found | |
ErrNotFound = errors.New("not found") | |
) |
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 Queue | |
import threading | |
class WorkerThread(threading.Thread): | |
def __init__(self, q): | |
super(WorkerThread, self).__init__() | |
self q = q | |
self.exception = None | |
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 timestamp | |
import ( | |
"fmt" | |
"labix.org/v2/mgo/bson" | |
"strconv" | |
"time" | |
) | |
type Timestamp time.Time |
OlderNewer