[go-nuts] Re: Concurrent queries in a single transaction

2024-04-19 Thread nilsocket
Does any solution exist for this problem? I'm facing similar problem, want to run bunch of queries inside a transaction, but want to run them concurrently, as running sequential is taking more than 1 second. On Friday, June 29, 2018 at 6:32:40 PM UTC+5:30 Space A. wrote: > Hi, > > DB in

[go-nuts] Re: Cookies in http package

2021-02-05 Thread nilsocket
isn't this issue fixed still? Thank you. On Friday, February 5, 2021 at 7:33:38 PM UTC+5:30 nilsocket wrote: > func main() { > c := { > Name: "cookie", > Value: "\"hello\"", > } >fmt.Println(c) > } > > 1. Why too much

[go-nuts] Cookies in http package

2021-02-05 Thread nilsocket
func main() { c := { Name: "cookie", Value: "\"hello\"", } fmt.Println(c) } 1. Why too much work being done while printing , shouldn't this be done only once? 2.

Re: [go-nuts] Unable to create a specific file in windows

2020-10-16 Thread nilsocket
of problem with windows OS and skip it, as this is error is from windows system calls. On Friday, October 16, 2020 at 8:39:03 AM UTC+5:30 Kurtis Rader wrote: > On Thu, Oct 15, 2020 at 8:00 PM nilsocket wrote: > >> No, dir "a" is being created. > > > Yes, I understand you are t

Re: [go-nuts] Unable to create a specific file in windows

2020-10-15 Thread nilsocket
ume that creating the > directory "a" is failing on your system. Try printing the error returned by > `os.MkdirAll`. > > On Thu, Oct 15, 2020 at 3:59 PM nilsocket wrote: > >> var fileName = `408_-IMG >> SRC=-` >> var dir1 = "a" >> >> func

Re: [go-nuts] Why is go too slow?

2020-01-28 Thread nilsocket
Thanks a lot for your answer. Thank you. On Tuesday, January 28, 2020 at 9:15:58 PM UTC+5:30, Ian Lance Taylor wrote: > > On Tue, Jan 28, 2020 at 7:33 AM nilsocket > > wrote: > >> Attached two files main.c and main.go, >> both try to compute fib(40), 20 times on `

[go-nuts] Why is go too slow?

2020-01-28 Thread nilsocket
Attached two files main.c and main.go, both try to compute fib(40), 20 times on `x` no.of threads/goroutines. fib(40) is recursive. *Prerequisites for C:* 1. libuv (https://github.com/libuv/libuv) *Compile*: - *C :* - *Unoptimized:* * gcc main.c -lpthread -luv * -

[go-nuts] why doesn't vgo use git checkout?

2018-09-27 Thread Nilsocket
I think there was something absolutely wrong with my question. I'm not a professional software developer, so excuse me if I was wrong. I was just watching russ cox go with versions keynote , Why not one do a git checkout to the version which is

[go-nuts] Re: idiomatic code to find, if executable exists in golang

2018-09-26 Thread Nilsocket
On Wednesday, September 26, 2018 at 1:16:51 PM UTC+5:30, Dave Cheney wrote: > > Are you able to modify the original question. Why do you need to know if a > binary exists? Presumably so you can execute it. If so then you can modify > the original request and make the problem more tractable.

[go-nuts] idiomatic code to find, if executable exists in golang

2018-09-26 Thread Nilsocket
package main import ( "os" "os/exec" ) func main() { cmdName := os.Args[1] //either cmd or executable without arguments if _, err := exec.LookPath(cmdName); err != nil { if (err.(*exec.Error)).Err == exec.ErrNotFound { // executable doesn't exist, do

Re: [go-nuts] Why is the output different for this program?

2018-03-29 Thread Nilsocket
> > https://research.swtch.com/godata > I did read it, but what I was asking is irrelevent to it. func showInt(x int) { res := (*[unsafe.Sizeof(x)]byte)(unsafe.Pointer()) for i := range res { fmt.Printf("%.2x ", res[i]) } fmt.Println() } // showInt(12345) // 39 30 00 00

[go-nuts] Why is the output different for this program?

2018-03-28 Thread Nilsocket
package main import ( "fmt" "unsafe" ) func main() { showString("12345") } func showString(s string) { res := *(*[unsafe.Sizeof(s)]byte)(unsafe.Pointer()) fmt.Println(s, res, []byte(s)) for i := range res { fmt.Printf("%.2x", res[i]) } fmt.Println() }

[go-nuts] Re: fetching URLs Concurrently

2017-11-13 Thread Nilsocket
package main import ( "fmt" "io" "io/ioutil" "net/http" "os" "sync" "time" ) var wg sync.WaitGroup func main() { start := time.Now() ch := make(chan string) for _, url := range os.Args[1:] { wg.Add(1) go fetch(url, ch) } for range

[go-nuts] Re: fetching URLs Concurrently

2017-11-13 Thread Nilsocket
Could you edit your question, it's unclear and format your code. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For

[go-nuts] Re: Simple exec.Command() program

2017-11-12 Thread Nilsocket
package main import ( "os" "os/exec" ) func main() { cmd := exec.Command("ls") null, _ := os.Open(os.DevNull) defer null.Close() cmd.Stdout = null cmd.Run() } What you were trying to do is, redirecting output of ls to /dev/null. `ls` is the name of the command. `>`

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-31 Thread Nilsocket .
>>>>>> io though. Timings on my machine, reading 1e6 integers chosen randomly >>>>>> from >>>>>> the range [0,1e18): >>>>>> >>>>>> Original code https://play.golang.org/p/grB-muK7hw >>>>>&

Re: [go-nuts] Why isn't golang input and output is buffered?

2017-08-30 Thread Nilsocket
> Can you provide example code for how you read the input? > Both of them were given same input size is:100, (i.e., 1 million) https://play.golang.org/p/grB-muK7hw // Time taken to read input : 9.840256889s // Time taken to sort: 731.469604ms I have implemented the same using bufio:

[go-nuts] Why isn't golang input and output is buffered?

2017-08-30 Thread nilsocket
I have seen that python input and output is buffered, but golang's input and output is not buffered. For those types of problems where i need to take large amounts of input, It's taking long time to just take input than to do processing. When we have advantages with buffered input and output,