[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
I want to emphases that go generate is so far an awesome solution, but not a definitive answer. Yes, it could made easier, about that, its already great that all the tools we need are written in go itself, this is really really really helpful. On Monday, June 5, 2017 at 5:59:46 AM UTC+2, utyug

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
as anyway the thread has completely derived, its the right place to put about that. I recently read about stanford choosing to use JS over Java for some its courses. https://www.theregister.co.uk/2017/04/24/stanford_tests_javascript_in_place_of_java/ I can t understand. If a beginner ask me which

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
just to add, https://www.youtube.com/watch?v=gHCtEjzZ-rY I could not agree more on the end, i could argue about some arguments ;) btw, is there a channel that gathers all talks about go ? https://www.youtube.com/channel/UCO3LEtymiLrgvpb59cNsb8A https://www.youtube.com/channel/UCSRhwaM00ay0fasnsw

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
On Sunday, June 4, 2017 at 6:25:17 PM UTC+2, Egon wrote: > > I think you are missing the point of my comment. > > I'm all for generics, but I also can survive without them without much of > a problem. (I'm even maintaining > https://docs.google.com/document/d/1vrAy9gMpMoS3uaVphB32uVXX4pi-HnNjkM

[go-nuts] In-memory secondary index

2017-06-05 Thread James Pettyjohn
I'm loading a set of structs in memory and will be frequently using them throughout the lifetime of the application and doing frequent 'queries' against the set to get those where certain fields have certain values. Are there are any native go libraries which do this kind of sort of "secondary

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
still because its a lot of fun, testing reader / writer, https://play.golang.org/p/6TBnlY3h6L On Saturday, June 3, 2017 at 6:24:31 PM UTC+2, mhh...@gmail.com wrote: > > for the fun, with early return, > > https://play.golang.org/p/I9AORKOYQm > > On Saturday, June 3, 2017 at 12:34:15 PM UTC+2, mh

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread Egon
On Monday, 5 June 2017 12:30:33 UTC+3, mhh...@gmail.com wrote: > > just to add, > > https://www.youtube.com/watch?v=gHCtEjzZ-rY > > I could not agree more on the end, > i could argue about some arguments ;) > > btw, is there a channel that gathers all talks about go ? > https://gophervids.appspot.

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread mhhcbon
generics, quick sorter, i agree to say its fallacies you can provide one func to quicksort string or Vegetables{}. in my understanding you are doing a quickSorter of Values you can compare. quicksort([]Valuer) type Valuer interface { Value() int } So what s a Valuer when you intent to quickso

Re: [go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread utyughjgut
This is golang-nuts, a place where you let shit(ideas) fly. Trust me guy, I've been light on you. I suggest you cool your jets. This isn't my first rodeo. That is your only warning. This won't end with a report to the CoC committee or some flame war on the forum. I cut much deeper. On Monday,

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread utyughjgut
I've seen you make silly visual aids. Make a '3 minute' video to show your solution. On Monday, June 5, 2017 at 12:52:47 AM UTC-4, Egon wrote: > > > > On Monday, 5 June 2017 06:59:46 UTC+3, utyug...@mail.com wrote: >> >> >> >> On Sunday, June 4, 2017 at 12:25:17 PM UTC-4, Egon wrote: >>> >>> I th

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread utyughjgut
I gave you a simple problem, don't over think it. A Set data structure with a simple api that can work out-of-the-box - just as slices and maps with the builtins. I kept the requirements minimal. I'd like to see your solution. On Monday, June 5, 2017 at 12:52:47 AM UTC-4, Egon wrote: > > > > On

Re: [go-nuts] Minio cloud storage?

2017-06-05 Thread Jim Robinson
Great, thanks for letting me know.I'm just starting to experiment with the software, so I have't had a chance to simulate real world conditions yet. Are you running it under sustained or intermittent load? If sustained, have you had any issues with memory, such as GC pauses or memory leak

[go-nuts] Re: idea: generic methods on slices with some generic type support []string.Map(string) []string => [].Map() []

2017-06-05 Thread Egon
On Monday, 5 June 2017 16:26:25 UTC+3, utyug...@mail.com wrote: > > I gave you a simple problem, don't over think it. A Set data structure > with a simple api that can work out-of-the-box - just as slices and maps > with the builtins. I kept the requirements minimal. I'd like to see your > solut

[go-nuts] Re: Copy map with empty interfaces

2017-06-05 Thread Chun Zhang
Unfortunately it does not give any info. :( Thanks, Chun On Saturday, June 3, 2017 at 1:16:18 PM UTC-4, Egon wrote: > > Does race detector say something useful? > > On Friday, 2 June 2017 21:18:31 UTC+3, Chun Zhang wrote: >> >> I am trying to store some complicated data structure with a map, and

[go-nuts] Re: Copy map with empty interfaces

2017-06-05 Thread Chun Zhang
Hi, Tamas, Thanks for the reply! The key is a string for my current use. After the data v is retrieved, it is compared with a new data coming from the wire. And then based on the comparison, the new data, which is a newly created piece of memory contains same type of data, will be sent to a C

[go-nuts] Re: Copy map with empty interfaces

2017-06-05 Thread Tamás Gulácsi
Can you simplify it with map[string]interface{}? Otherwise, the error indicates impedance mismatch between C++ and Go. This is hard to debug - put printf everywhere, print the allocated/freed/sent/received pointers (%p), and _reduce_ the program line-by-line, till the error vanishes. -- You re

[go-nuts] Re: Golang, SQL and ORM avoidance techniques

2017-06-05 Thread Ren Thraysk
Wrote something similar recently. One difference is that I moved the rows.Scan call into the passed in function. type Scannable interface { Scan(...interface{}) error } func scanIntoUser(u *store.User) func(s Scannable) error { return func(s Scannable) error { return s.Scan(&u.Id, &u.Name

[go-nuts] go get in parallel

2017-06-05 Thread david
Hi All, I've got a few jenkins jobs that end up doing quite a lot of go-getting as part of a clean build process. I find the slowest bit of the whole process is go get sequentially resolving/downloading everything. Would making this parallel be doable? Would it be desirable? Am I doing somethin

[go-nuts] Crash after sending thousands of http requests (go version go1.8.3 windows/amd64)

2017-06-05 Thread Cheyi Lin
Hi, I’m writing a http poller that send concurrent HTTP requests to retrieve the monitoring data, put the results into a queue then consume them by several workers that send HTTP requests to our log aggregators. At the beginning everything works well, about 9 hours later the program crashes and l

Re: [go-nuts] go get in parallel

2017-06-05 Thread Ian Lance Taylor
On Mon, Jun 5, 2017 at 8:14 AM, wrote: > > I've got a few jenkins jobs that end up doing quite a lot of go-getting as > part of a clean build process. I find the slowest bit of the whole process > is go get sequentially resolving/downloading everything. Would making this > parallel be doable? Wou

[go-nuts] Re: go get in parallel

2017-06-05 Thread mhhcbon
hi, in immediate terms, assuming you have something like go get a go get b go get c Can this https://github.com/mh-cbon/cct#usage be of help ? I did not tested, but it should be, cct -add -timeout 20 go get a cct -a 1 go get b ... cct -wait 1 I m sorry it looks likes i have not implemented e

[go-nuts] {CGO,VM}-free SQLite (ATM Linux/Intel only, pre-alpha)

2017-06-05 Thread Jan Mercl
https://github.com/cznic/sqlite -- -j -- 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:/

[go-nuts] filago: Monitor a Linux process' opening and closing of files, including Unix pipes and sockets

2017-06-05 Thread Simon Ritchie
Does this have some advantage over truss (or under Linux, strace)? -- 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 m

[go-nuts] Re: Copy map with empty interfaces

2017-06-05 Thread Egon
On Monday, 5 June 2017 18:11:00 UTC+3, Chun Zhang wrote: > > Unfortunately it does not give any info. :( > Can you upload the code somewhere? Other ideas: 1. set environment variable GODEBUG to cgocheck=2 2. try valgrind - maybe it picks something up (not sure how well it works) 3. try sanitizer

[go-nuts] Re: Confusing type rules

2017-06-05 Thread conrad via golang-nuts
Thanks both! On Saturday, June 3, 2017 at 5:22:20 PM UTC-7, Xio Fen wrote: > > To answer the first point - the keyword is "*assignable*" here - an slice > []int{1,23} is not assignable to a slice []I where I is a type of int. See > https://golang.org/ref/spec#Assignability > > ( also golang tre

[go-nuts] Re: In-memory secondary index

2017-06-05 Thread Dragos Harabor
Something like this? https://github.com/hashicorp/go-memdb Though it may have more features than you need. Or features that you don't yet know you want :-) On Monday, June 5, 2017 at 3:28:33 AM UTC-7, James Pettyjohn wrote: > > I'm loading a set of structs in memory and will be frequently using

[go-nuts] Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-05 Thread DV
This seems pretty trivial, tbh. You just parse the URL query string and construct a JSON doc out of it? Go's philosophy in general is that it's better to just write the code yourself sometimes, even multiple times, than to pull in a dependency. Especially for something like this. Do you reme

[go-nuts] how to interpret debug/pprof/heap

2017-06-05 Thread Steven Roth
Hi, folks, I'm trying to track down a memory leak in a web server application, and I'm having a hard time making sense of the output of the heap dumps emitted by the net/http/pprof handlers. One of the dumps starts with: heap profile: 5: 192080 [47408: 90679856] @ heap/1048576 1: 155648 [1: 1556

[go-nuts] Re: Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-05 Thread Ray Yang
Thanks for letting me know that "left-pad" thing. I didn't know it before you mentioned it here. Parsing a URL string and constructing a BSON object are easy if the criteria is like this: A.B="foo" AND C.D=true However, if the query is like this, I'm not sure if it still can be done correctly

[go-nuts] Scheduler time profiling

2017-06-05 Thread akashina
Hi golang-nuts. I am trying to profile the runtime environment scheduler proc.go and have few questions. 1) I was wondering if the pprof profiler is good for profiling the runtime environment or would my numbers be skewed due to the overhead of pprof? 2) regarding the GODEBUG. Till what granul

[go-nuts] Re: filago: Monitor a Linux process' opening and closing of files, including Unix pipes and sockets

2017-06-05 Thread Glen Newton
Sorry about that: link to github: https://github.com/gnewton/filago Thanks, Glen On Friday, June 2, 2017 at 11:56:34 PM UTC-4, Glen Newton wrote: > > Monitor open files (via /proc/pid) of a process. Lists time when it first > sees the file open (which may be later than when the file actually ope

Re: [go-nuts] Scheduler time profiling

2017-06-05 Thread Ian Lance Taylor
On Mon, Jun 5, 2017 at 4:24 PM, wrote: > > Hi golang-nuts. I am trying to profile the runtime environment scheduler > proc.go and have few questions. > > 1) I was wondering if the pprof profiler is good for profiling the runtime > environment or would my numbers be skewed due to the overhead of p

[go-nuts] Re: filago: Monitor a Linux process' opening and closing of files, including Unix pipes and sockets

2017-06-05 Thread Glen Newton
The functionality filago provides can be implemented with truss or strace. filago offers a simpler (to many) way of getting to this information, and can provide it in json as well. Thanks, Glen On Monday, June 5, 2017 at 3:25:20 PM UTC-4, Simon Ritchie wrote: > > Does this have some advantage

[go-nuts] Re: Crash after sending thousands of http requests (go version go1.8.3 windows/amd64)

2017-06-05 Thread brainman
> Exception 0xc005 0x0 0x 0x7ffbea7bc8eb > PC=0x7ffbea7bc8ebx > > syscall.Syscall6(0x7ffbea7b8a80, 0x4, 0x4, 0x1138ad0, 0xc04223d3d0, > 0xc04223d3e0, 0x0, 0x0, 0xc0422f1a00, 0x30002, ...) > C:/Go/src/runtime/syscall_windows.go:174 +0x6b > syscall.CertVerifyCertificateC

[go-nuts] Re: Is there any golang package available for building mongodb query from plain logic expression string or URL?

2017-06-05 Thread Nathan Kerr
I haven't tried it, but https://github.com/jhsx/qm might be useful. -- 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