1. Combination

    Tue 24 June 2014 | tags: go
    package main
    
    import "fmt"
    
    func main() {
        var n = 6
        var k = 3
        ar := make([]int, k)
        comb(n, k, ar)
        fmt.Println(damn)
    }
    
    var count = 0
    
    func comb(n, k int, arr []int) {
        count++
        fmt.Println("--", count, "--")
        for i := n; i >= k; i-- {
            arr[k-1] = i
            if k > 1 ...
    read more
  2. Multi Upload

    Tue 24 June 2014 | tags: go
    package main
    
    import (
        "io"
        "log"
        "mime/multipart"
        "net/http"
        "os"
        "path/filepath"
        "runtime"
    
        "github.com/cheggaaa/pb"
    )
    
    func main() {
        if len(os.Args) != 2 {
            log.Println("Usage: pipeUp <filename>\n")
            os.Exit(1)
        }
    
        input, err := os.Open(os.Args[1])
        check(err)
        defer input.Close()
    
        stat, err := input.Stat()
        check ...
    read more

« Page 2 / 2