Re: [go-nuts] Is there a more efficient way to slice a multidimensional matrix using proxy?

2017-08-12 Thread Dan Kortschak
The cap fields allow us to resize back to the original size (just the same as a cap in a Go slice). This is not necessary for any case where only slicing to a smaller size is needed. The allocation that we do in making a new *Dense would not be needed if the mat.Matrix returned did not modify its

Re: [go-nuts] Is there a more efficient way to slice a multidimensional matrix using proxy?

2017-08-12 Thread chatrapathi . akula
Hi kortschak, thanks for replying. Please correct me if I'm not following this right. So on Line 290 of the Dense.Slice() method, the receiver is copied into the variable 't' by dereferencing the

Re: [go-nuts] Is there a more efficient way to slice a multidimensional matrix using proxy?

2017-08-12 Thread Dan Kortschak
We implement this for first and second order tensors in gonum.org/v1/gonum/mat[1], which you are welcome to borrow from to extend to third order. Our slice operation[2] is in principle non- allocating (though we do allocate a container for generality - a non- allocating version would simply not

Re: [go-nuts] Go channels overused and hyped?

2017-08-12 Thread as
Thank you for writing this informative post. It and explains the issue well and should be shared with others with the same question. Honestly, Go has made me scared of locks. Every time I think of using one, I realize how bad the actual design of the program is and end up refactoring it. The

Re: [go-nuts] How to correctly add license information when using code from the golang project

2017-08-12 Thread Ian Lance Taylor
On Sat, Aug 12, 2017 at 4:44 AM, wrote: > > At the moment I am developing a httpmockserver that uses a slightly modified > version of > https://github.com/golang/go/blob/master/src/net/http/httptest/server.go > > My own project uses the MIT License. > > So what is the

Re: [go-nuts] Suggestions for go 2

2017-08-12 Thread Ian Lance Taylor
On Sat, Aug 12, 2017 at 1:52 PM, Robert Solomon wrote: > > Is there any one interested in compile time and date like the __time__ and > __date__ macros in c Personally I think that compile time is not normally interesting. Since build systems normally ensure that unchanged

Re: [go-nuts] Go channels overused and hyped?

2017-08-12 Thread Michael Jones
snmed, My disappointment with that blog post is that it does not address the larger issue, which some people here have clarified, but to be clear on the larger issue and the various points raised about channels: SMALL BENCHMARKS ARE HARD Benchmarking is harder than it seems, because computers

[go-nuts] Is there a more efficient way to slice a multidimensional matrix using proxy?

2017-08-12 Thread chatrapathi . akula
So I've written a small Tensor library for purposes of various computations inside a hardware product that my startup is working on. I've implemented in the library, the functionality to slice a matrix similar to matlab using a proxy. The implementation, I have works just fine and does exactly

Re: [go-nuts] atomic package pointer operations with maps and channels

2017-08-12 Thread Josh Humphries
On Fri, Aug 11, 2017 at 6:22 PM, Ian Lance Taylor wrote: > On Fri, Aug 11, 2017 at 2:51 PM, Josh Humphries > wrote: > > > > It is possible to extract a map's actual value/address if it is stored in > > the heap -- by using something like this: > >

[go-nuts] How to correctly add license information when using code from the golang project

2017-08-12 Thread alexander . gehres
Hi. At the moment I am developing a httpmockserver that uses a slightly modified version of https://github.com/golang/go/blob/master/src/net/http/httptest/server.go My own project uses the MIT License. So what is the correct way of including the modified file in my project? This is my

[go-nuts] Suggestions for go 2

2017-08-12 Thread Robert Solomon
Is there any one interested in compile time and date like the __time__ and __date__ macros in c On Aug 8, 2017 7:26 PM, wrote: golang-nuts@googlegroups.com Google Groups

Re: [go-nuts] Returning a JSON object saved as a string in a database

2017-08-12 Thread Frits van Bommel
On Friday, August 11, 2017 at 6:43:39 AM UTC+2, Dmitriy Cherchenko wrote: > > Just to make sure: When marshalling a struct, will fields of > type json.RawMessage be ignored (simply inserted into the JSON object > without further processing)? > There's some *slight* processing: - a check that

[go-nuts] Re: Teaching Go Experience

2017-08-12 Thread Thomas Solignac
That's great ! Thank you ! Le samedi 12 août 2017 14:51:14 UTC+2, Mandolyte a écrit : > > The experience reports at > https://github.com/golang/go/wiki/ExperienceReports include a reference > to an article on experience and recommendations for Go2 from CMU. Good read! > > Direct link: >

[go-nuts] Teaching Go Experience

2017-08-12 Thread Mandolyte
The experience reports at https://github.com/golang/go/wiki/ExperienceReports include a reference to an article on experience and recommendations for Go2 from CMU. Good read! Direct link: http://www.monogrammedchalk.com/go-2-for-teaching/ Thanks to Carl Kingsford for the write up. -- You

Re: [go-nuts] Go channels overused and hyped?

2017-08-12 Thread Jesper Louis Andersen
On Fri, Aug 11, 2017 at 2:22 PM Chris Hopkins wrote: > The microsecond or so of cost you see I understood was *not* due to > there being thousands of operations needed to run the channel, but the > latency added by the stall, and scheduler overhead. > One particular