Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-14 Thread Henrik Johansson
How in the name of anything does using Maven make life easier? Hyperbole aside I am curious. How does it help? tis 15 maj 2018 kl 07:55 skrev Igor Maznitsa : > as usual - to make life easier > > > On Tuesday, May 15, 2018 at 8:36:40 AM UTC+3, kortschak wrote: >> >> Why! >> >> -- > You received th

Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-14 Thread Igor Maznitsa
as usual - to make life easier On Tuesday, May 15, 2018 at 8:36:40 AM UTC+3, kortschak wrote: > > Why! > > -- 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 golan

Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-14 Thread Igor Maznitsa
as usual - to make lie easier On Tuesday, May 15, 2018 at 8:36:40 AM UTC+3, kortschak wrote: > > Why! > > -- 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 golan

Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-14 Thread Dan Kortschak
Why! On Sun, 2018-05-13 at 22:01 -0700, Igor Maznitsa wrote: > the 2.2.0 version of the maven golang plugin  > has been published in the > maven  > central -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Tamás Gulácsi
2018. május 14., hétfő 23:03:46 UTC+2 időpontban Luke IC a következőt írta: > > Thanks a lot, I went back and gave jsonpb a go and finally got it > unmarshalling as desired. > > To do so though I had to unmarshal and marshal the response with the > regular json library first, in order to get aro

[go-nuts] Re: dynamic programming or something else

2018-05-14 Thread Alex Dvoretskiy
Just noticed. Even restructuring the code the way kjk did improved runing time, without caching. Amazing. -- 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-

[go-nuts] Re: dynamic programming or something else

2018-05-14 Thread Alex Dvoretskiy
Thanks! Cashing improved things dramatically. -- 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, visit ht

[go-nuts] Re: dynamic programming or something else

2018-05-14 Thread Krzysztof Kowalczyk
You can memoize i.e. cache results of kbonacci(). See https://play.golang.org/p/Q2RjWZ2VTh3 for a working but not production ready implementation (for example, cache is specific to k etc.). When running locally for (5,35): Running for n=35 res: 2809074173, time: 12.189908825s res: 2809074173, ti

[go-nuts] Re: dynamic programming or something else

2018-05-14 Thread Alex Dvoretskiy
Thanks! -- 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, visit https://groups.google.com/d/optout.

Re: [go-nuts] Go license and fitness for purpose

2018-05-14 Thread Krzysztof Kowalczyk
On Monday, May 14, 2018 at 7:25:03 AM UTC-7, matthe...@gmail.com wrote: > > But you aren't going to get much in the way of guarantees when you >> receive and use something for free. > > > My work is not free, I want to contribute time back. > >> >> It's unclear if you understand the implications.

[go-nuts] Re: dynamic programming or something else

2018-05-14 Thread benjibutterfly
You should be able to generalize the solution from the common implementation of DP Fibonacci. One caveat would be that expressing the integers as strings will make it harder to do arithmetic on them. On Monday, May 14, 2018 at 8:22:00 PM UTC-4, Alex Dvoretskiy wrote: > > Hello Golang Nuts > > I

[go-nuts] Validation checks in Go

2018-05-14 Thread tristan . muntsinger
Is it reasonable to use a function like "Assert" below to do validation checking in Go? If not, why not? func Assert(t bool, msg string) { if !t { debug.SetTraceback("all") debug.PrintStack() log.Fatal("Assertion failed: " + msg) } } func Divide(a float64, b float64) float64 { Assert(b != 0, "d

[go-nuts] dynamic programming or something else

2018-05-14 Thread Alex Dvoretskiy
Hello Golang Nuts I'm trying to solve a problem. Algorithm is correct, but too slow. Perhaps you can give me some ideas on how to improve running time? https://play.golang.org/p/XsXwT8EHtwC Thanks Alex -- You received this message because you are subscribed to the Google Groups "golang-nuts

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Luke IC
Here's a gist: https://gist.github.com/lukeic/7350d07cac28b2809e9930802251844f This is the JSON I see output from (errors removed for brevity): body, _ := ioutil.ReadAll(res.Body) fmt.Println(string(body)) On Tuesday, 15 May 2018 07:24:31 UTC+10, alex@gmail.com wrote: > > I do not see esca

Re: [go-nuts] Digest for golang-nuts@googlegroups.com - 25 updates in 9 topics

2018-05-14 Thread Pete Wilson
I do think that making progress towards software which shows no signs of errors despite millions of users each with hundreds of hours of usage would be a Good Thing. I also believe that folk who create stuff like go and give it away for free are not going to be willing to be put into a position

[go-nuts] [ANN] Pion-TURN, a TURN server designed with ease of use and extensibility in mind

2018-05-14 Thread sean
Hi list! I wrote a TURN server and would love to get feedback/share https://github.com/pions/turn If you aren't interested in the code, but just want a TURN server there are already built releases that work on Windows/Darwin/Linux/FreeBSD and should just take 5 mins to get running! These are

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread alex . rou . sg
I do not see escaped quotes on your stackoverflow post, can you post the raw json exactly as received? On Tuesday, 15 May 2018 05:16:59 UTC+8, Luke IC wrote: > > Thanks again for the help. Unfortunately it's a third-party API, so I > won't be able to fix it myself. The full error message is as f

Re: [go-nuts] Busted auth providers

2018-05-14 Thread jwinters
It's little embarrassing how long I spent looking at internal/token.go and totally missed this part . On Wednesday, May 9, 2018 at 5:25:01 PM UTC-4, Joshu

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Luke IC
Thanks again for the help. Unfortunately it's a third-party API, so I won't be able to fix it myself. The full error message is as follows: bad value in StructValue for key "image": unrecognized type for Value "\"https:\\/\\/ei.isnooth.com\\/multimedia\\/0\\/2\\/8\\/image_787698_square.jpeg\""

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread alex . rou . sg
In the long term I would investigate what's wrong with the json and if possible fix it at the source. Also use this as a reference on what gets mapped to what https://developers.google.com/protocol-buffers/docs/proto3#json On Tuesday, 15 May 2018 05:03:46 UTC+8, Luke IC wrote: > > Thanks a lot,

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Luke IC
Thanks a lot, I went back and gave jsonpb a go and finally got it unmarshalling as desired. To do so though I had to unmarshal and marshal the response with the regular json library first, in order to get around some escaped values in the response (I was receiving a 'bad value in Struct' error:

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Tamás Gulácsi
Please create a test case (snooth_test.go) which illustrates your problem: has the input as const string, tries to Unmarshal into your chosen struct, probably fails with error. All without making HTTP requests! 2018. május 14., hétfő 14:29:57 UTC+2 időpontban Luke IC a következőt írta: > > I've

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread alex . rou . sg
You need to use the go protobuf json decoder https://github.com/golang/protobuf/tree/master/jsonpb On Monday, 14 May 2018 11:24:06 UTC+8, Luke IC wrote: > > Hi all, > > I'm creating a microservice in Go, using protocol buffers and gRPC. It > interacts with a third-party API (Snooth) and I'm tryi

Re: [go-nuts] Go license and fitness for purpose

2018-05-14 Thread matthewjuran
> > Legalese that OP tried to ridicule (imo) says otherwise. They can be sued > but they can not lose, even if they intentionally would put a `rm -rf /` > in > the code. I mentioned email addresses being stolen, but I’m more concerned about things like somebody thinking they can use GCC and

Re: [go-nuts] Re: RFC - Review request for a project done in Golang

2018-05-14 Thread Sankar P
2018-05-14 20:39 GMT+05:30 : > They might have been looking for something like this: > > github.com/psankar/network-monitor > package monitor code files > cmd/ > minion/ > package main code files > server/ > package main code files > The reviewer me

[go-nuts] Re: RFC - Review request for a project done in Golang

2018-05-14 Thread matthewjuran
They might have been looking for something like this: github.com/psankar/network-monitor package monitor code files cmd/ minion/ package main code files server/ package main code files In a code review I would mention the use of packages as not bein

Re: [go-nuts] Go license and fitness for purpose

2018-05-14 Thread matthewjuran
> > I suspect you are worrying too much given both the long history of > open source software and the large number of > groups/organizations/companies that rely on it. I was reading about the ILOVEYOU Windows virus and recall hearing about it at the time. In that case the way Windows worked

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Luke IC
I've tried that, but I need to decode the JSON into a struct generated from a .proto. Updating the code to use json.Unmarshal results in the wines array from the response not decoding correctly, here is what I see when printing the struct that I have unmarshalled into: meta: wines:<> wines:<> w

[go-nuts] Re: RFC - Review request for a project done in Golang

2018-05-14 Thread Chris Hopkins
There's an old Dilbert about this: Don't know how to solve a problem? No problem! Don't hire a consultant; hold an interview and choose the best answer you receive from all the candidates. I'll get my coat. Chris On Monday, 14 May 2018 12:35:23 UTC+1, Sankar wrote: > > Hi > > I was recently as

Re: [go-nuts] Re: RFC - Review request for a project done in Golang

2018-05-14 Thread Sankar P
2018-05-14 17:28 GMT+05:30 Tamás Gulácsi : > Minion/minion? For what? > So that the minion package structs can be shared between Minion/Minion.go server and the APIServer.go server. > > Also APIServer.go has some goroutine starting loops that are very similar > - should be a function. > I'd pre

[go-nuts] Golang elasticsearch olivere http compression

2018-05-14 Thread torsten . schubert
Hi, I need some help to use the olivere elasticsearch client to make a compressed http connection to our elasticsearch. I have tried it with: hc := &http.Client{ Transport: &http.Transport{ DisableCompression: false, }, } and set: elastic.NewClient(elastic.SetHttpClient(hc)) but it do not use

[go-nuts] Re: RFC - Review request for a project done in Golang

2018-05-14 Thread Tamás Gulácsi
Minion/minion? For what? Also APIServer.go has some goroutine starting loops that are very similar - should be a function. I'd prefer splitting the HTTP handlers to parser + executor + responder (a'la go-kit), clarifying the business logic. Just my 2¢. 2018. május 14., hétfő 13:35:23 UTC+2 id

[go-nuts] RFC - Review request for a project done in Golang

2018-05-14 Thread Sankar
Hi I was recently asked in an interview to write a golang program for a problem that involves working with a million nodes. I did write a program that solved the problem statement. However, I was told that the solution was "poorly structured", but I did not get any detailed review comments tho

Re: [go-nuts] time.Time round/truncate not removing nanosceonds component

2018-05-14 Thread Jens Hausherr
Ah, so I misunderstood the documentation. Thanks for the answer. I suspect the behaviour of play.golang.org is due to the fake time as part of the sandboxing //Jens Am Montag, 14. Mai 2018 11:12:07 UTC+2 schrieb Jakob Borg: > > Truncate(0) is not supposed to remove the nanoseconds part; it re

Re: [go-nuts] time.Time round/truncate not removing nanosceonds component

2018-05-14 Thread Jakob Borg
Truncate(0) is not supposed to remove the nanoseconds part; it removes the monotonic time part. It just happens that the nanoseconds are zero on the "clock" on play: https://play.golang.org/p/Kdq_SDTi664 To remove the subsecond part use .Truncate(time.Second) (or the corresponding Round of cou

Re: [go-nuts] Go license and fitness for purpose

2018-05-14 Thread Wojciech S. Czarnecki
On Sun, 13 May 2018 22:28:02 -0500 Pete Wilson wrote: > All this is true. > But I expect that one of these fine days, someone sueable is going to ship > software with a serious bug, and are going to get sued and lose > get sued and lose Legalese that OP tried to ridicule (imo) says otherwise.

[go-nuts] Re: Actually I'm learning golang but I need involve me a project. do you guys know about a project to help it?

2018-05-14 Thread Gerardo Oscar JT
Hi Eduardo, I started a free blogging system at https://github.com/fulldump/blogo with some videos documenting the process (in spanish) https://www.youtube.com/watch?v=tPMVwd1js0I&list=PLMPsqnO6mKSDaL1nX3gzUP43HXJtIl4xJ. It starts from scratch. It is deployed to https://blogo.tech/ with CI/CD

[go-nuts] Re: Why does unmarshalling this API response return an unexpected EOF?

2018-05-14 Thread Tamás Gulácsi
It DOES parse with then encoding/json package: https://play.golang.org/p/IQzMm2tDI7w The protoc-generated code's Unmarshal parses a *Protocol Buffers* encoded byte stream, NOT JSON! 2018. május 14., hétfő 5:24:06 UTC+2 időpontban Luke IC a következőt írta: > > Hi all, > > I'm creating a mic

Re: [go-nuts] Actually I'm learning golang but I need involve me a project. do you guys know about a project to help it?

2018-05-14 Thread Sebastien Binet
Hi Eduardo, Welcome! To get meaningful answers, you should tell us what are your interests: machine learning, grpc, data science, crypto, GUIs, ... Another approach would be 'the GitHub roulette': go to GitHub, select 'go language' and read some code of some repo and start sending PRs (after hav