... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
// | |
// ImageHelper.h | |
// Tabris | |
// | |
// Created by Jordi Böhme López on 22.08.12. | |
// Copyright (c) 2012 EclipseSource. All rights reserved. | |
// All rights reserved. This program and the accompanying materials | |
// are made available under the terms of the Eclipse Public License v1.0 | |
// which accompanies this distribution, and is available at | |
// http://www.eclipse.org/legal/epl-v10.html |
package main | |
// sort a map's keys in descending order of its values. | |
import "sort" | |
type sortedMap struct { | |
m map[string]int | |
s []string | |
} |
package main | |
import ( | |
"fmt" | |
"log" | |
"math/rand" | |
"time" | |
) | |
type Snapshot struct { |
import "bytes" | |
func StreamToByte(stream io.Reader) []byte { | |
buf := new(bytes.Buffer) | |
buf.ReadFrom(stream) | |
return buf.Bytes() | |
} | |
func StreamToString(stream io.Reader) string { | |
buf := new(bytes.Buffer) |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
// | |
// WatchSessionManager.swift | |
// WatchConnectivityDemo | |
// | |
// Created by Natasha Murashev on 9/3/15. | |
// Copyright © 2015 NatashaTheRobot. All rights reserved. | |
// | |
import WatchConnectivity |
package main | |
import ( | |
"bytes" | |
"compress/gzip" | |
"fmt" | |
"io" | |
"log" | |
) |
package main | |
import ( | |
"fmt" | |
"strings" | |
"gopkg.in/ldap.v2" | |
) | |
const ( | |
ldapServer = "ad.example.com:389" |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |