Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread Liam
"considered making a T-shirt saying "answers rhetorical questions" Thank you for the LOL :-) On Saturday, November 30, 2019 at 5:57:32 PM UTC-8, Michael Jones wrote: > > Sigh. I overlooked the riddle and took it as a straight question. Typical > for me all my life. (once considered making a T-sh

Re: [go-nuts] golang and -buildmode=pie

2019-11-30 Thread Ian Lance Taylor
On Fri, Nov 29, 2019 at 5:09 PM wrote: > > while looking into how alpine linux builds golang I've found that is patches > it to make -buildmode=pie the default. I've tried to find why. I've managed > to find this thread > > > https://groups.google.com/forum/#!searchin/golang-nuts/pie|so

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Liam
I wrote a less-sophisticated version of your test, then realized I'd misspent my time; all I needed was to change the atomic.Add*() to a mutex-protected counter, and see whether my app still failed; it did. But since you took the trouble, I read your code, and would like to understand your coll

[go-nuts] Re: Where is the middle of Brazil?

2019-11-30 Thread Rodolfo Azevedo
Bixo vai dormir, isso né hora pra loucura não... hehehehehe Em sábado, 30 de novembro de 2019 21:30:33 UTC-4, JuciÊ Andrade escreveu: > > When I was a kid I asked my teacher why my country capital had been moved > from Rio de Janeiro to Brasilia. She said the reason was Brasilia is right > in t

Re: [go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread Bakul Shah
func PR(f string, a ...interface{}) { if d { return } fmt.Fprintf(os.Stderr, f, a...) } Add appropriate imports. > On Nov 30, 2019, at 12:08 PM, minfo...@arcor.de wrote: > > C allows comma-separated argument lists via variadic macros. Whereas AFAIK > golang allows only variadi

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread Michael Jones
Sigh. I overlooked the riddle and took it as a straight question. Typical for me all my life. (once considered making a T-shirt saying "answers rhetorical questions"). Mild chagrin here... (P.S. sorry for bad typing. Keyboard's B and SHIFT keys are roken broken.) On Sat, Nov 30, 2019 at 5:48 PM an

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread andrey mirtchovski
i think JuciÊ wants us to crack the md5. i'm fresh off a CTF competition so i don't have any more resources to throw at warming the universe and increasing entropy, unfortunately... On Sat, Nov 30, 2019 at 6:43 PM Michael Jones wrote: > > > My answer is this place. > 14°35'03.5"S 53°03'51.3"W > -

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread Michael Jones
My answer is this place . 14°35'03.5"S 53°03'51.3"W -14.584305, -53.064239 Not an official national answer, just my own. (That sai

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Michael Jones
As a follow-up, some more timing: *47088064 atomic increments/sec (my original email above for heavy synchronization conflict incrementing)* 142049067 atomic increments/sec when each goroutine has its own atomic update target. (Not testing global synchronization/mutex, just the overhead of conges

[go-nuts] Where is the middle of Brazil?

2019-11-30 Thread JuciÊ Andrade
When I was a kid I asked my teacher why my country capital had been moved from Rio de Janeiro to Brasilia. She said the reason was Brasilia is right in the middle of our territory, that way our president could take care of our entire country more effectively. I accepted that answer. Many years

Re: [go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread Michael Jones
You might refer to... https://blog.learngoprogramming.com/golang-variadic-funcs-how-to-patterns-369408f19085 ...to better appreciate Robert's advice. As he suggested, a variadic Go function accepting a slice of the special, magic "empty interface" type ("interface{}") can indeed do anything. The

Re: [go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread minforth
Thanks, but then you would have to define the interface beforehand for any argument type. And there are a lot: format strings, strings, characters, integers of different size, floating-pont numbers, file-ids Meanwhile I found this discussion: https://github.com/golang/go/issues/18605 which hints

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Michael Jones
Liam, I just wrote a little stress test program for you. Maybe it will make you less stressed. ;-) https://play.golang.org/p/5_7Geyczd1V 4 CPU 2016 MacBook Pro: *celeste:atom mtj$ go run main.go* *32 concurrent workers* *128 batches of 1048576 atomic increments, 134217728 total increments* *2.85

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Robert Engels
If this was broken I think a lot of things would break. > On Nov 30, 2019, at 1:56 PM, Liam wrote: > >  > The stress test for my app fails frequently with what looks like a collision > in atomic.AddUint64() results, so I wondered whether I had misunderstood > atomic-add. > > So far I can't

Re: [go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread Robert Engels
Make the type interface{} and you can pass anything and use reflect > On Nov 30, 2019, at 2:08 PM, minfo...@arcor.de wrote: > >  > C allows comma-separated argument lists via variadic macros. Whereas AFAIK > golang allows only variadic arguments of the same type. > (Please excuse if I am wrong,

[go-nuts] C variadic macro equivalent in Golang?

2019-11-30 Thread minforth
C allows comma-separated argument lists via variadic macros. Whereas AFAIK golang allows only variadic arguments of the same type. (Please excuse if I am wrong, I am considering myself a golang newbie) C demo program that prints: -- -- 1 and 1 1 and 1 // ## C variadic macro test #include

Re: [go-nuts] atomic.Add*() doesn't produce unique values

2019-11-30 Thread Liam
The stress test for my app fails frequently with what looks like a collision in atomic.AddUint64() results, so I wondered whether I had misunderstood atomic-add. So far I can't reproduce it with a small program, so I've probably misunderstood my app :-) On Friday, November 29, 2019 at 6:41:39