[go-nuts] Re: Pure go based Automated Browser simulation without any driver

2017-07-12 Thread mhhcbon
chromedp seems lovely. https://www.youtube.com/watch?v=_7pWCg94sKw On Thursday, July 13, 2017 at 2:48:54 AM UTC+2, Tong Sun wrote: > > I bumped into a pure go based tools that can be used as an automated > Browser simulation, just like Selenium but *without any driver* > selenium-webdriver/Phan

Re: [go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-12 Thread Rader
sure you can. no memory space difference. On Wednesday, July 12, 2017 at 7:44:47 PM UTC+8, Matthew Zimmerman wrote: > > Why not use struct{}? Is what is recommended for maps to notate a set > (only the keys mean something). > > https://play.golang.org/p/fxtEWejqdh > > On Tue, Jul 11, 2017, 11:34

Re: [go-nuts] How can I set a larger goroutine initial stack size manually?

2017-07-12 Thread Ian Lance Taylor
On Wed, Jul 12, 2017 at 8:16 PM, Cholerae Hu wrote: > > We found quite a lot `morestack` call in our system, which cost a lot of > time. 4 KB of initial stack seems too small for us, how can I set a larger > size of initial stack size? There is no way to do that at present. If this is really wha

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread Ian Lance Taylor
On Wed, Jul 12, 2017 at 8:56 AM, James Abley wrote: > > Labels for clarity: > > 1. goroutine 1 spawns goroutine 2 to read from Oregon, and spawns goroutine > 3 to read from Virginia. > 2. goroutine 1 calls waitForSearchCompletion and enters the select. Nothing > can proceed, so that select blocks.

[go-nuts] How can I set a larger goroutine initial stack size manually?

2017-07-12 Thread Cholerae Hu
We found quite a lot `morestack` call in our system, which cost a lot of time. 4 KB of initial stack seems too small for us, how can I set a larger size of initial stack size? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: Pure go based Automated Browser simulation without any driver

2017-07-12 Thread lewgun
https://github.com/knq/chromedp ? https://github.com/headzoo/surf ? On Thursday, 13 July 2017 08:48:54 UTC+8, Tong Sun wrote: > > I bumped into a pure go based tools that can be used as an automated > Browser simulation, just like Selenium but *without any driver* > selenium-webdriver/PhantomJS

[go-nuts] Pure go based Automated Browser simulation without any driver

2017-07-12 Thread Tong Sun
I bumped into a pure go based tools that can be used as an automated Browser simulation, just like Selenium but *without any driver* selenium-webdriver/PhantomJS or anything, just *pure go based*. However, I didn't save the URL and now I just can't find it anywhere any more. That why I have to

Re: [go-nuts] What is Go's version of python's list data type?

2017-07-12 Thread Tyler Compton
If you're looking for a datatype in Go that stores multiple values, that would be the slice. Slices are ordered collections of data that can change in size at runtime. myIntegers := []int{5, 7, 4, 3} myStrings := []string{"hi", "there"} myStrings = append(myStrings, "gophers") The difference that

Re: [go-nuts] x/exp/shiny: is there a way to get screen DPI ?

2017-07-12 Thread Daniel Skinner
If you're manually processing events, this is switch e := w.NextEvent().(type) { case size.Event: dpi := float64(e.PixelsPerPt) * unit.PointsPerInch } If you're writing your own widget, Paint and PaintBase methods receive either a PaintContext or PaintBaseContext argument respectively; call c

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread James Abley
On Wednesday, 12 July 2017 13:57:16 UTC+1, Ian Lance Taylor wrote: > > On Wed, Jul 12, 2017 at 12:28 AM, > > wrote: > > > > On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: > >> > >> On Tue, Jul 11, 2017 at 12:27 PM, wrote: > >> > > >> > This caught me out recently; th

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread Ian Lance Taylor
On Wed, Jul 12, 2017 at 12:28 AM, wrote: > > On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: >> >> On Tue, Jul 11, 2017 at 12:27 PM, wrote: >> > >> > This caught me out recently; there's definitely a gap in my >> > understanding as >> > to how select works. Maybe it's caught

[go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-12 Thread Haddock
I once played a bit with thread-safe collections I wrote using Java. With the number of threads increasing throughput did not just decline a bit, it completely plummeted that I was baffled. Class ConcurrentHashMap, which is part of Java since JDK 1.5 is divided in segments. Segments help great

Re: [go-nuts] Sorting json fields recursive

2017-07-12 Thread Jakob Borg
Unmarshalling and (re)marshalling the message will do that for you. https://play.golang.org/p/UrHedCa6sO You get error checking and reformatting for free. //jb On 11 Jul 2017, at 20:57, Tong Sun mailto:suntong...@gmail.com>> wrote: Hi, Is there any existing code/package out there that can so

Re: [go-nuts] Re: Named or unnamed struct initialisation? What is best practice?

2017-07-12 Thread Matthew Zimmerman
Why not use struct{}? Is what is recommended for maps to notate a set (only the keys mean something). https://play.golang.org/p/fxtEWejqdh On Tue, Jul 11, 2017, 11:34 PM Rader wrote: > I found the position of `[0]byte` in the struct matters. > type bar2 struct { > A int > _ [0]byte > } > > di

[go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-12 Thread ammar
It is supported via the `--rwmu` flag. On Wednesday, July 12, 2017 at 3:05:33 AM UTC-5, Rader wrote: > > I would prefer `sync.RWMutex` which allows multiple `Get` to the map. > > On Friday, June 16, 2017 at 1:26:04 PM UTC+8, am...@ammar.io wrote: >> >> https://github.com/ammario/mapgen >> >> >> Fe

[go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-12 Thread Rader
I would prefer `sync.RWMutex` which allows multiple `Get` to the map. On Friday, June 16, 2017 at 1:26:04 PM UTC+8, am...@ammar.io wrote: > > https://github.com/ammario/mapgen > > > Features: > >- Supports any key/value pair supported by Go's native maps >- Allows complex operations via Lo

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread james . abley
On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: > > On Tue, Jul 11, 2017 at 12:27 PM, > > wrote: > > > > This caught me out recently; there's definitely a gap in my > understanding as > > to how select works. Maybe it's caught other people out too? > > > > For one of my

[go-nuts] Re: why I got a panic in this code?

2017-07-12 Thread Rader
"pos" is not initialized. You think you are using the *global* var "pos", but you are wrong as it's been *overwritten* by the *named return var *"pos" (defined like this (pos []float32)). On Tuesday, July 11, 2017 at 5:24:19 PM UTC+8, Fino wrote: > > https://play.golang.org/p/2Wd9xlztBr > > > p