Re: [go-nuts] Re: Golang 1.9 failing with excelize (simple case works under 1.8.3)

2017-08-28 Thread Sam Whited
On Mon, Aug 28, 2017, at 22:59, silviucap...@gmail.com wrote: > Interesting... For this portion of code: > > https://github.com/360EntSecGroup-Skylar/excelize/blob/master/rows.go#L76-L85 > > The xml decoder returns row and col token types for 1.8.3 but rushes > into > an EOF for 1.9 In Go 1.8

[go-nuts] Any historical discussion around support "go generate -parallel n"?

2017-08-28 Thread Guanhua Jiang
I'm just wondering if there has been discussions about having "go generate" tool support a "-parallel n" flag such that it would run go generate on each file concurrently throughout a package(s). The motivation is this: a typical build process that involves file generation may need to support th

[go-nuts] Re: math/big

2017-08-28 Thread Alex Dvoretskiy
Thanks, Michael! On Monday, August 28, 2017 at 3:33:52 PM UTC-7, Alex Dvoretskiy wrote: > > Does anyone uses package "math/big"? And what purpose? > > It looks like hard package to work with. At least at the beggining. > Even simple line of code takes some efforts to convert to big.Float: > > y :

[go-nuts] can list.List.Push* or Get return nil?

2017-08-28 Thread snmed
Hi As far as the docs are right: For Back: Back returns the last element of list l or nil. For PushBack: PushBack inserts a new element e with value v at the back of list l and returns e. So if you push nil, you get nil otherwise you get always your pushed element. Cheers -- You received

[go-nuts] Re: Golang 1.9 failing with excelize (simple case works under 1.8.3)

2017-08-28 Thread silviucapota
Interesting... For this portion of code: https://github.com/360EntSecGroup-Skylar/excelize/blob/master/rows.go#L76-L85 The xml decoder returns row and col token types for 1.8.3 but rushes into an EOF for 1.9 If the document gets re-saved with LibreOffice for example, it works, so it may be in

Re: [go-nuts] Problems with regexp

2017-08-28 Thread Hugh S. Myers
(.*) is greedy… try ([^\[]+) this should consume all till it runs into the open bracket, your next group… On Mon, Aug 28, 2017 at 7:17 PM, Paulo Coutinho wrote: > Hi, > > Well, I'm having a problem with regular expressions, so all online regexp > testers work, including those that run on go. > >

[go-nuts] Problems with regexp

2017-08-28 Thread Paulo Coutinho
Hi, Well, I'm having a problem with regular expressions, so all online regexp testers work, including those that run on go. But locally and on the playground does not work and I do not understand what is wrong. Can anyone help me with this? Follow the code link: Https://play.golang.org/p/yVpU

Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-28 Thread yhj772709
Thanks very much. But, what I mean of setting timeout is giving up this sending, and try to send another email 在 2017年8月29日星期二 UTC+8上午9:59:24,Antonio Sun写道: > > > > On Sun, Aug 27, 2017 at 10:31 PM, > wrote: > >> >> Without setting timeout on sending, it spent 5 minutes to send an email. >> Ba

Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-28 Thread Antonio Sun
On Sun, Aug 27, 2017 at 10:31 PM, wrote: > > Without setting timeout on sending, it spent 5 minutes to send an email. > Badly, it will hang up, then cause bug on production. > That means the mail server is busy. Setting shorter timeout will stress mail server even more and make things worse for

Re: [go-nuts] math/big

2017-08-28 Thread Michael Jones
oops! that's actually a**1024 ...was rushing and typed the Printf legend too quickly. On Mon, Aug 28, 2017 at 5:14 PM, Michael Jones wrote: > I use it frequently / constantly / 24/7 :-) > > it's purpose is to enable integer, rational, and real arithmetic at chosen > precisions greater than the h

Re: [go-nuts] math/big

2017-08-28 Thread Michael Jones
I use it frequently / constantly / 24/7 :-) it's purpose is to enable integer, rational, and real arithmetic at chosen precisions greater than the hardware's native CPU arithmetic. One property of such thousand or million digit numbers is that they cannot be moved around the way '5' and '3' are i

[go-nuts] can list.List.Push* or Get return nil?

2017-08-28 Thread BeaT Adrian
Hello, I just started to learn golang and I have a small dillema. My programming is too defensive OR how can I replicate this scenario (for my test coverage sake) list = list.New() element := list.PushBack(item) if element == nil { //don't know how this can happen, just being defensive return

[go-nuts] math/big

2017-08-28 Thread Alex Dvoretskiy
Does anyone uses package "math/big"? And what purpose? It looks like hard package to work with. At least at the beggining. Even simple line of code takes some efforts to convert to big.Float: y := float64(py) / float64(heightP) * (ymax - ymin) + ymin -- You received this message because you ar

Re: [go-nuts] Re: Go 1.9 introduced error on UDP Multicast JoinGroup

2017-08-28 Thread Harley Laue
Might be a good excuse to try deposit (https://github.com/golang/dep) I think $ dep ensure -update Might be roughly what you would have wanted in this case. On Mon, Aug 28, 2017, 12:13 Paul Stead wrote: > Excellent catch James! I looked, and it seems my x/net/ipv4 files were > all from 2015.

[go-nuts] ann: migration of github.com/gonum/plot to gonum.org/v1/plot

2017-08-28 Thread Sebastien Binet
hi there, as mentioned here: https://github.com/gonum/plot/issues/372 with relevant PRs here: https://github.com/gonum/plot/pull/374 https://github.com/gonum/plot/pull/376 we (the Gonum community) plan to migrate the import of gonum/plot from: "github.com/gonum/plot/..." to: "gonum.org/v1/

[go-nuts] Re: Generics and readability

2017-08-28 Thread 'David Chase' via golang-nuts
One distinction that might be helpful is the difference between people using a generic data structure and people writing a generic data structure. It's much more important that the code that makes use of generics be readable than it is that the body of the generic be readable; after all, the ex

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Ain
On Monday, August 28, 2017 at 10:13:28 PM UTC+3, Uli Kunitz wrote: > > I can't replicate your issue. I have create following example, which works > perfectly for me on Linux, AMD64 and go 1.9: > > https://gist.github.com/ulikunitz/d5335e0667fb57b2d12c8ffa5404b031 > > You should create something c

Re: [go-nuts] Re: Go 1.9 introduced error on UDP Multicast JoinGroup

2017-08-28 Thread Paul Stead
Excellent catch James! I looked, and it seems my x/net/ipv4 files were all from 2015. I forced an update of those using go get -u, and things seem good now. I'll need a way to ensure things get updated more completely going forward I guess. thank you. Paul On Mon, Aug 28, 2017 at 11:37 AM, Jam

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Uli Kunitz
I can't replicate your issue. I have create following example, which works perfectly for me on Linux, AMD64 and go 1.9: https://gist.github.com/ulikunitz/d5335e0667fb57b2d12c8ffa5404b031 You should create something comparable so that others can test your code. -- You received this message bec

[go-nuts] Re: Golang 1.9 failing with excelize (simple case works under 1.8.3)

2017-08-28 Thread G Shields
here is the xlsx data file FYI this fails on both mac and ubuntu with 1.9 On Friday, August 25, 2017 at 3:10:40 PM UTC-7, G Shields wrote: > > Under 1.8.3 the program run: > package main > > import ( > "fmt" > "os" > "strconv" > > "github.com/Luxurioust/excelize" > ) > > func chec

[go-nuts] Re: Go 1.9 introduced error on UDP Multicast JoinGroup

2017-08-28 Thread James Bardin
On Sunday, August 27, 2017 at 7:36:22 PM UTC-4, oldCoderException wrote: > > No. I just downloaded and used 1.9 on its release last week. I've > reverted to 1.8.3 for now and, as mentioned, it's working fine for me. > > >>> Are you certain you also have the latest version of golang.org/x/net/i

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
Yep, that totally makes sense! I think I would go this path if Vertex was declared in a third-party package that I can't alter. On Monday, August 28, 2017 at 4:17:41 PM UTC+2, Egon wrote: > > Oh, forgot one obvious solution, store/check all the combinations of the > triangle in the map :D > > h

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
Good point. We actually do have quite a lot of code that does copy everything from one step of computation to next one, for clarity and separation of concerns. We're not afraid to do it one more time if needed, i.e. translating all fundamental Vertices to some "VerticesWithID", and then back.

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
Thank you Sébastien, I may use some of it (Orientation, etc) in the project. Having a Point.ID is the straightforwardest way to go anyway. On Monday, August 28, 2017 at 4:03:44 PM UTC+2, Sebastien Binet wrote: > > Valentin, > > On Mon, Aug 28, 2017 at 3:58 PM, Val > > wrote: > >> @Jakob sorry

[go-nuts] Custom ServeMux and pprof

2017-08-28 Thread Dave Cheney
Copy lines 72-76 into your project. https://golang.org/src/net/http/pprof/pprof.go#L72 -- 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...@go

Re: [go-nuts] Re: Generics and readability

2017-08-28 Thread Henrik Johansson
I don't know I have met many a newbie from university who didn't know their way around the Java world but would happily work with Haskell because their advanced courses used it. On Mon, 28 Aug 2017, 12:30 Wojciech S. Czarnecki wrote: > On Sun, 27 Aug 2017 17:28:07 + > Jesper Louis Andersen

Re: [go-nuts] Using pprof on publicly accessible servers

2017-08-28 Thread Konstantin Khomoutov
On Mon, Aug 28, 2017 at 08:25:05AM -0700, st ov wrote: > It's recommended to add pprof to servers > > import _ "net/http/pprof" > > Is this true even for publicly exposed servers? How do you limit access? Either through your custom ServeMux or by reverse-proxying to your Go server via something

Re: [go-nuts] Custom ServeMux and pprof

2017-08-28 Thread Konstantin Khomoutov
On Mon, Aug 28, 2017 at 08:31:11AM -0700, st ov wrote: > How do you add pprof to a custom ServeMux? > > https://golang.org/pkg/net/http/#ServeMux > > Its my understanding that the following import only adds handlers to the > default mux. > > import _ "net/http/pprof" https://blog.cloudflare.c

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Ain
On Monday, August 28, 2017 at 7:37:42 PM UTC+3, Tamás Gulácsi wrote: > > QueryRow closes the underlyin Stmt - see the docs. Where in the doc this is mentioned? https://godoc.org/database/sql#Stmt.QueryRow <> https://godoc.org/database/sql#Tx.QueryRow <> I also had a quick look at the code an

[go-nuts] database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Tamás Gulácsi
QueryRow closes the underlyin Stmt - see the docs. -- 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 more options, vis

Re: [go-nuts] Does the Wait function of sync.WaitGroup behave as a memory barrier?

2017-08-28 Thread honzajde
I am trying to write a simple code that calls bunch of get requests in goroutines and stores result on the struct, that's all -- now I know that it is correct with just wg.Wait, ugh go would really suck compared to javascript if it was not true... so far not go but godoc manages to trick me:

[go-nuts] RedisDB (Redis server version 2.2.12) Unable to get Cluster Info

2017-08-28 Thread Tamás Gulácsi
Apples with oranges? In Python, you call "info", in Go "cluster info". -- 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. F

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Ain
On Monday, August 28, 2017 at 5:07:30 PM UTC+3, Christian Joergensen wrote: > > On Monday, August 28, 2017 at 3:52:54 PM UTC+2, Ain wrote: >> >> Does anyone use prepared select statements sucessfully? With which >> DB/driver? >> I'm sure that if my code is silly someone would have pointed it out

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Ain
On Monday, August 28, 2017 at 5:13:09 PM UTC+3, Uli Kunitz wrote: > > Where are you calling Exec on the statement? > I'm talking about SELECT statements. https://godoc.org/database/sql#Tx.Exec <> ain > > On Monday, August 28, 2017 at 3:52:54 PM UTC+2, Ain wrote: >> >> Hi >> >> Tested with

Re: [go-nuts] Add factory argument to built-in make() function?

2017-08-28 Thread 'Axel Wagner' via golang-nuts
I don't really understand what you are suggesting, I think. On Sun, Aug 27, 2017 at 8:38 PM, RogerV wrote: > Would it be feasible for the built-in make() function to be enhanced to > also accept a factory signifier as an additional argument? The idea would > be that I could go and implement my o

[go-nuts] Custom ServeMux and pprof

2017-08-28 Thread st ov
How do you add pprof to a custom ServeMux? https://golang.org/pkg/net/http/#ServeMux Its my understanding that the following import only adds handlers to the default mux. import _ "net/http/pprof" -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

[go-nuts] Using pprof on publicly accessible servers

2017-08-28 Thread st ov
It's recommended to add pprof to servers import _ "net/http/pprof" Is this true even for publicly exposed servers? How do you limit access? How useful is pprof for clusters since it only profiles a single server? -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Kulti
Hi. Normalization may not work in some degenerated cases. How about to check equality of triangles, smth like this: https://play.golang.org/p/W9Gc00HD7E On Mon, Aug 28, 2017 at 2:13 PM Val wrote: > Hello, > I have some geometry data modelling with > type Triangle [3]*Vertex > > (The exact de

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Egon
On Monday, 28 August 2017 16:58:07 UTC+3, Val wrote: > > @Jakob sorry what I wrote was confusing, I meant : vertices have strong > identity (same pointer), and triangles are just keys for the map so they > need to be very stable. A triangle pointer wouldn't solve the case. When I > encounter 3

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Egon
Oh, forgot one obvious solution, store/check all the combinations of the triangle in the map :D https://play.golang.org/p/Rqn8LLI4li https://play.golang.org/p/0TY_Bcugw8 On Monday, 28 August 2017 16:58:07 UTC+3, Val wrote: > > @Jakob sorry what I wrote was confusing, I meant : vertices have str

[go-nuts] GoBkm 0.9 released

2017-08-28 Thread Thomas Bellembois
Hi Gophers ! I have released a new version of the GoBkm bookmarks manager. https://github.com/tbellembois/gobkm/releases/tag/0.9 The main improvement is the new GUI. Regards, Thomas -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Uli Kunitz
Where are you calling Exec on the statement? On Monday, August 28, 2017 at 3:52:54 PM UTC+2, Ain wrote: > > Hi > > Tested with 1.9 and got the same behaviour - first row is returned OK, the > second returns error. > > Does anyone use prepared select statements sucessfully? With which > DB/driver

[go-nuts] Re: Add factory argument to built-in make() function?

2017-08-28 Thread Rick
Interesting idea! Throw in operator overloading to retain the current make and its signature and the new make with addition of factory arg? On Sunday, 27 August 2017 11:38:47 UTC-7, RogerV wrote: > > Would it be feasible for the built-in make() function to be enhanced to > also accept a factory

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Christian Joergensen
On Monday, August 28, 2017 at 3:52:54 PM UTC+2, Ain wrote: > > Does anyone use prepared select statements sucessfully? With which > DB/driver? > I'm sure that if my code is silly someone would have pointed it out so I'm > wondering am I the only one trying to use prepared select statements... >

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Sebastien Binet
Valentin, On Mon, Aug 28, 2017 at 3:58 PM, Val wrote: > @Jakob sorry what I wrote was confusing, I meant : vertices have strong > identity (same pointer), and triangles are just keys for the map so they > need to be very stable. A triangle pointer wouldn't solve the case. When I > encounter 3

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
@Jakob sorry what I wrote was confusing, I meant : vertices have strong identity (same pointer), and triangles are just keys for the map so they need to be very stable. A triangle pointer wouldn't solve the case. When I encounter 3 vertex pointers A, B, C, then I need a "key" to determine if

[go-nuts] Re: database/sql - prepared select statements only work on first invocation

2017-08-28 Thread Ain
Hi Tested with 1.9 and got the same behaviour - first row is returned OK, the second returns error. Does anyone use prepared select statements sucessfully? With which DB/driver? I'm sure that if my code is silly someone would have pointed it out so I'm wondering am I the only one trying to use

[go-nuts] Re: Convert grid of colors to SVG

2017-08-28 Thread ajstarks
Also note that the "richter" program is included in the package. On Monday, August 28, 2017 at 9:35:25 AM UTC-4, ajstarks wrote: > > it would be helpful to better understand what you want to do, but: > > https://speakerdeck.com/ajstarks/svgo-code-plus-picture-examples > > includes the code below (

[go-nuts] Re: Convert grid of colors to SVG

2017-08-28 Thread ajstarks
it would be helpful to better understand what you want to do, but: https://speakerdeck.com/ajstarks/svgo-code-plus-picture-examples includes the code below (with many other examples would should be illustrate the capabilities of the package) package main import ( "math/rand" "os" "time"

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread 'Axel Wagner' via golang-nuts
FTR, I don't think ordering by pointer (no matter whether using unsafe or not) is reliable and safe. The GC is free to move data around at any point, including during your sort. I don't think there are a lot of ways around that. You could basically build your own allocator and add a way for it to r

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Jakob Borg
In that case, maybe use *Triangle pointers instead of Triangle values, and let that address be the identity for map purposes? Then the Vertex order etc doesn't matter any more. //jb > On 28 Aug 2017, at 14:03, Val wrote: > > That's actually a clever idea, I had not thought of that when dismis

[go-nuts] Re: Sort 3 pointers?

2017-08-28 Thread Egon
When are two vertices considered equal? If by X, Y, Z, then what is the precision of if? How often does Vertex position change? How often are new Triangles created? Anyways: 1. if you can use unsafe: https://play.golang.org/p/6cMS6aMCz7 2. if you cannot use unsafe and can add 1 field to vertex:

Re: [go-nuts] Convert grid of colors to SVG

2017-08-28 Thread steve_bagwell
Thanks Konstantin. That's a good point. I've posted an issue on that repo. Unfortunately, there is another issue there from Sep 2016 which doesn't appear to have a reply yet. We'll see if I get a reply. On Monday, August 28, 2017 at 3:36:13 AM UTC-4, Konstantin Khomoutov wrote: > > On Fri, Aug

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
That's actually a clever idea, I had not thought of that when dismissing the vertex struct inspection. Thanks! But it turns out that X,Y,Z will change often during my program execution: vertices move, but their identity (and the triangles identity) must be strongly preserved. On Monday, August

Re: [go-nuts] Sort 3 pointers?

2017-08-28 Thread Jakob Borg
On 28 Aug 2017, at 13:13, Val wrote: > > To achieve this, I consider normalizing the triplet so that all keys of the > map verify > A < B < C > for some arbitrary definition of < . This ensures that I can detect any > Triangle already present as key in the map, regardless the order of its >

[go-nuts] Sort 3 pointers?

2017-08-28 Thread Val
Hello, I have some geometry data modelling with type Triangle [3]*Vertex (The exact definition of Vertex is unimportant here, but I'd like to avoid adding more fields inside Vertex if possible.) Then I'd like to use a triplet of vertices as the entry point of a map containing more data like c

Re: [go-nuts] Re: Generics and readability

2017-08-28 Thread Wojciech S. Czarnecki
On Sun, 27 Aug 2017 17:28:07 + Jesper Louis Andersen wrote: > The advantage of having the extra syntactic abstraction in a language is > not something you would tend to dismiss too easily I think. While it > filters away some contributors from the code base, it also, on the flip > side, makes

Re: [go-nuts] Convert grid of colors to SVG

2017-08-28 Thread Konstantin Khomoutov
On Fri, Aug 25, 2017 at 10:18:17AM -0700, steve_bagw...@sil.org wrote: > > There's svgo: https://github.com/ajstarks/svgo [...] > Thanks Andrey, > SVGO didn't seem to include that particular functionality. Maybe I just > didn't look carefully enough? So, this begs the question: why producing ye