Re: [go-nuts] sync.Pool misuse binary-trees

2019-03-07 Thread Sokolov Yura
> Unclear… revise… “it requires a lock & unlock for every get and put of an > item" Not quite exactly. One item per scheduler (could be count as native thread) is stored in fast thread local storage. Yes, there are still locks, but for separate lock per thread, and this is quite cheap, since

Re: [go-nuts] Re: why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread fgergo
Similar reason. You might want to read about slices and arrays in go: https://golang.org/doc/effective_go.html#slices This might be helpful as well: https://gobyexample.com/slices On 3/8/19, Halbert.Collier Liu wrote: > Yes, i see, > thank you so much! > > Could you please explain, why

[go-nuts] Re: why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread Halbert.Collier Liu
Yes, i see, thank you so much! Could you please explain, why primes[6:6] okay, but primes[7:7] not? *:-)* 在 2019年3月7日星期四 UTC+8下午11:55:40,Robert Johnstone写道: > > Hello, > > When you use the colon, you taking a subset of the data. Further, the > notation is a closed/open. So a slice

Re: [go-nuts] why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread Halbert.Collier Liu
Yes, i see, thank you so much! Could you please explain, why primes[6:6] okay, but primes[7:7] not? 在 2019年3月7日星期四 UTC+8下午11:55:29,Burak Serdar写道: > > On Thu, Mar 7, 2019 at 8:31 AM > > wrote: > > > > Hi. > > > > The code like below: > > > > package main > > > > import "fmt" > > > >

Re: [go-nuts] Re: Should IP.DefaultMask() exist in today's Internet?

2019-03-07 Thread Ian Lance Taylor
On Thu, Mar 7, 2019 at 2:42 PM John Dreystadt wrote: > > I have not seen any response to my last posting yet, and I think it is still > an open question. I also realized an additional point that I should have > pointed out before which is that this is an IPv4 only thing. Which means that > I

[go-nuts] UDS and ptp

2019-03-07 Thread liamjcarey
Hi all - I'm trying to connect to ptp4l socket (/var/run/ptp4l) to collect stats for PTP delay and RMS. current code/snippet allows me to connect : conn,err := net.Dial("unixgram","/var/run/ptp") but i cannot write properly to the connection (conn). I seem to get an unexpected

[go-nuts] Re: Should IP.DefaultMask() exist in today's Internet?

2019-03-07 Thread John Dreystadt
I have not seen any response to my last posting yet, and I think it is still an open question. I also realized an additional point that I should have pointed out before which is that this is an IPv4 only thing. Which means that I really don't understand when you would use this function. Would

[go-nuts] Re: OpenAL and microphone on macos using the mobile pkg

2019-03-07 Thread whitehexagon via golang-nuts
Thanks! That got me some steps further down the rabbit hole :) gomobile: the Android requires the golang.org/x/mobile/exp/audio/al, but the OpenAL libraries was not found. Please run gomobile init with the -openal flag pointing to an OpenAL source directory. So first I tried 'brew reinstall

[go-nuts] Re: OpenAL and microphone on macos using the mobile pkg

2019-03-07 Thread mail
On Thursday, March 7, 2019 at 7:13:56 PM UTC+1, whiteh...@googlemail.com wrote: > > go1.12 macos 10.12.4 > > I haven't been able to find a Go example of this being used so far. > However I found a C example that I'm porting over to Go that access the > microphone. > > All I'm doing so far

Re: [go-nuts] Performance comparison of Go, C++, and Java for biological sequencing tool

2019-03-07 Thread Michael Jones
I'm sorry Isaac, I meant multi-language benchmarking generally, nothing about the specific case you mention so i was slightly tangential to your original post. On Thu, Mar 7, 2019 at 9:41 AM 'Isaac Gouy' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Wednesday, March 6, 2019 at

[go-nuts] OpenAL and microphone on macos using the mobile pkg

2019-03-07 Thread whitehexagon via golang-nuts
go1.12 macos 10.12.4 I haven't been able to find a Go example of this being used so far. However I found a C example that I'm porting over to Go that access the microphone. All I'm doing so far is 'al.OpenDevice()' running 'gomobile build' generates this error:

Re: [go-nuts] sync.Pool misuse binary-trees

2019-03-07 Thread 'Isaac Gouy' via golang-nuts
Is there a more concise way to write var check = 1 + self.left.itemCheck() + self.right.itemCheck() pool.Put(self.left) self.left = nil pool.Put(self.right) self.right = nil return check -- You received this message because you are subscribed to the

Re: [go-nuts] Performance comparison of Go, C++, and Java for biological sequencing tool

2019-03-07 Thread 'Isaac Gouy' via golang-nuts
On Wednesday, March 6, 2019 at 7:22:41 PM UTC-8, Michael Jones wrote: > > There is another problem about these microbenchmarks as well--they often > are ports of an originating C-version. > Which microbenchmarks? You quoted a reply to a question about "Performance comparison of Go, C++, and

[go-nuts] Re: why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread Robert Johnstone
Hello, When you use the colon, you taking a subset of the data. Further, the notation is a closed/open. So a slice primes[6:6] is all of the element in the array with index >= 6 and index < 6, which is an empty set. Note that the type of the expression primes[6:6] is []int. When you don't

Re: [go-nuts] why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread Burak Serdar
On Thu, Mar 7, 2019 at 8:31 AM wrote: > > Hi. > > The code like below: > > package main > > import "fmt" > > func main() { > primes := [6]int{2, 3, 5, 7, 11, 13} > fmt.Println(primes[6:6]) . // OK. return: [] > //fmt.Println(primes[6]) . // fail. out of bounds... > } > > Why? Those two

[go-nuts] why slice[len:len] okay, but slice[len] fail?

2019-03-07 Thread halbert . collier
Hi. The code like below: package main import "fmt" func main() { primes := [6]int{2, 3, 5, 7, 11, 13} fmt.Println(primes[6:6]) . // *OK*. return: [] //fmt.Println(primes[6]) . // fail. out of bounds... } Why? Is the golang grammatical feature? or anything else.. Any help, please! --

[go-nuts] Adding timing offset data for pprof profiles

2019-03-07 Thread neven . miculinic
This is related to pprof https://github.com/google/pprof/issues/457 issue I've opened. The usecase is like this: I have running go service, which periodically has pathological behavior. Think every 30ihs seconds some heavy CPU/memory intensive operation happens. Or under certain conditions.

[go-nuts] Re: GoLand 2019.1 EAP started today

2019-03-07 Thread Florin Pățan
I created the following issue on our tracker: https://youtrack.jetbrains.com/issue/GO-7043 It would be helpful to know what font are you using and what color theme do you use as well. You can also attach the IDE logs from Help | Compress Logs and Show in Finder and then attach the zip to the

[go-nuts] Gorilla Websocket - Proxy with URL, Username and Password

2019-03-07 Thread Subramanian Sridharan
Hello Gophers, I've been using Gorilla Websocket for a persistent connection and it has been working as expected. Now there is a need to achieve the same functionality over a Proxy. After researching a bit, I came across http.ProxyFromEnvironment But I need to connect to the Proxy using an

[go-nuts] Re: Go get fails for long paths #30623

2019-03-07 Thread Jan Mercl
On Wed, Mar 6, 2019 at 6:55 PM Ian Lance Taylor wrote: > Done. Thanks. Thank you. > I'm not quite grasping how that would work. I don't think it's going to make sense to forward e-mail from golang-nuts to the issue tracker. I've used a terrible formulation. By forwarding I meant automatically