Re: [go-nuts] Connection Refused while scraping the data

2020-03-06 Thread Kurtis Rader
On Fri, Mar 6, 2020 at 8:21 PM Kuldeep Avsar wrote: > I am trying to Scrape the Job Titles one by one from the Indeed.co.in website > > but it through me connection refused problem while I am visiting to the > particular jobs Title > > categories page and trying to take response back from the

[go-nuts] Re: Is the result of FindStringSubmatch correct?

2020-03-06 Thread bomin
Got it, thanks. 在 2020年3月2日星期一 UTC+8下午7:39:28,Brian Candler写道: > > Or closer to your original code, FindAllStringSubmatch > . > https://play.golang.org/p/Tiva8X425k3 > > -- You received this message because you are subscribed to the

Re: [go-nuts] interaction between runtime scheduler and Cgo calls

2020-03-06 Thread Dan Kortschak
Thanks, Ian. On Fri, 2020-03-06 at 14:01 -0800, Ian Lance Taylor wrote: > On Fri, Mar 6, 2020 at 1:40 PM Dan Kortschak > wrote: > > > > This sort of follows on from the EINTR discussion a while back, but > > was > > prompted by a claim in the gophers #general slack channel that "the > > Go > >

Re: [go-nuts] interaction between runtime scheduler and Cgo calls

2020-03-06 Thread Ian Lance Taylor
On Fri, Mar 6, 2020 at 1:40 PM Dan Kortschak wrote: > > This sort of follows on from the EINTR discussion a while back, but was > prompted by a claim in the gophers #general slack channel that "the Go > scheduler will actively try to interrupt CGO calls that take too > long"[1]. > > This doesn't

[go-nuts] interaction between runtime scheduler and Cgo calls

2020-03-06 Thread Dan Kortschak
This sort of follows on from the EINTR discussion a while back, but was prompted by a claim in the gophers #general slack channel that "the Go scheduler will actively try to interrupt CGO calls that take too long"[1]. This doesn't seem right to me, but I wanted to confirm from people who know

Re: [go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Jesper Louis Andersen
On Fri, Mar 6, 2020 at 5:21 PM Christophe Meessen < christophe.mees...@gmail.com> wrote: > > However, it never gets back to the low level it had initially. Initial > lowest Alloc is 146520. It then grows steadily up to 163040. Then suddenly > drops to 156896, and grows slowly again to 163520.

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Dan Kortschak
Is this helpful for addressing your issue? On Fri, 2020-03-06 at 04:42 -0800, Warren Stephens wrote: > Perhaps I should have referenced MIT's Scratch programming tool??? > "Go is not as good as Scratch" -- THAT would be popular around here I > am sure! -- You received this message because you

[go-nuts] Re: Changing source code in order code to be supported from older Golang versions e.g. Go 1.10

2020-03-06 Thread Jake Montgomery
On Friday, March 6, 2020 at 1:20:38 PM UTC-5, Amnon Baron Cohen wrote: > > Anyone who is able to put up with a 20 year old OS > will be able to tolerate a 2 year old Go version... > Dimitrios' question is a perfectly legitimate one. Your response does nothing to actually answer the question. It

[go-nuts] gomobile video for ios and android?

2020-03-06 Thread oneone
hello, looking at: https://godoc.org/golang.org/x/mobile I see I can draw any polygon or text or image to the screen. And with audio: https://godoc.org/golang.org/x/mobile/exp/audio/al I see I could play any sound I want so... my question is, is it possible to stream a video file and play it?

[go-nuts] Re: Changing source code in order code to be supported from older Golang versions e.g. Go 1.10

2020-03-06 Thread Amnon Baron Cohen
Anyone who is able to put up with a 20 year old OS will be able to tolerate a 2 year old Go version... On Thursday, 5 March 2020 11:08:07 UTC, Dimitrios Trechas wrote: > > Dear colleagues, > > There are even now cases that a Windows XP is needed. The latest Golang > compiler that could target XP

Re: [go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Jan Mercl
On Fri, Mar 6, 2020 at 4:55 PM Christophe Meessen < christophe.mees...@gmail.com> wrote: > It would have been convenient for detecting memory leaks to be able to compare memory Alloc before and after the checked task and a really complete GC. That's not feasible. There are _always_ other

[go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Christophe Meessen
While letting the program run for a few hours I see that after some time the memory usage vary in saw teeth. Some of the garbage is reclaimed after 800 calls to GC(). However, it never gets back to the low level it had initially. Initial lowest Alloc is 146520. It then grows steadily up to

Re: [go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Robert Engels
Because GC costs are amortized in order to limit the effect on the performance (pauses) of the program - you should almost never manually invoke a GC.That being said, there are "memory profilers" that can detect live/dead objects in order to detect memory leaks - use them during development (and

[go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Christophe Meessen
The documentation of the GC() function states: "GC runs a garbage collection and blocks the caller until the garbage collection is complete. It may also block the entire program." Based on the documentation, I assumed that a garbage collection would be really complete by calling GC. By

Re: [go-nuts] Pass C struct from Go to C method

2020-03-06 Thread Nitish Saboo
Thankyou Ian for your responses. Thanks, Nitish On Fri, 6 Mar 2020, 21:01 Ian Lance Taylor, wrote: > On Fri, Mar 6, 2020 at 7:18 AM Nitish Saboo > wrote: > > > > > 3) Why is 'fmt.Println(InitStruct)' printing the struct fields even > after freeing the memory ? [b] > > > > Because that's how

Re: [go-nuts] Pass C struct from Go to C method

2020-03-06 Thread Ian Lance Taylor
On Fri, Mar 6, 2020 at 7:18 AM Nitish Saboo wrote: > > > 3) Why is 'fmt.Println(InitStruct)' printing the struct fields even after > > freeing the memory ? [b] > > Because that's how C works. C is not a memory safe language, and it > doesn't become memory safe just because you make the calls

Re: [go-nuts] Pass C struct from Go to C method

2020-03-06 Thread Nitish Saboo
Hi Ian, > 3) Why is 'fmt.Println(InitStruct)' printing the struct fields even after freeing the memory ? [b] Because that's how C works. C is not a memory safe language, and it doesn't become memory safe just because you make the calls from Go. 1)You mean to say the dangling pointer will

[go-nuts] Re: Memory leak or GC feature ?

2020-03-06 Thread Volker Dobler
This is normal behaviour and not a leak. Nothing is leaking in your code (and it is generally hard to leak RAM). The allocations will be reclaimed. V. On Friday, 6 March 2020 14:11:37 UTC+1, Christophe Meessen wrote: > > I wanted to check my program for go routine and memory leaks. In doing so

Re: [go-nuts] Pass C struct from Go to C method

2020-03-06 Thread Ian Lance Taylor
On Fri, Mar 6, 2020 at 4:25 AM Nitish Saboo wrote: > > So what did I do : > > main.go > > > var InitStruct *C.struct_Foo; > > func InitializeEngine(pattern string, path string) { > pattern_db := C.CString(pattern) > module_path := C.CString(path) > if InitStruct != nil{ >

[go-nuts] Memory leak or GC feature ?

2020-03-06 Thread Christophe Meessen
I wanted to check my program for go routine and memory leaks. In doing so I detected what resemble a memory leak while my program was doing nothing. Here is a minimal program that reproduces the problem. The program collects and prints the total number of bytes allocated and the number of

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
Nigel, Thanks! I can use that in general to wrap pieces of code so that I can collapse them in my editor whenever I want! I was grasping for some concrete way to show this concept -- amid the distraction of doing real work. Perhaps I should have referenced MIT's Scratch programming tool???

Re: [go-nuts] Pass C struct from Go to C method

2020-03-06 Thread Nitish Saboo
Hi Ian, So what did I do : main.go var InitStruct *C.struct_Foo; func InitializeEngine(pattern string, path string) { pattern_db := C.CString(pattern) module_path := C.CString(path) if InitStruct != nil{ C.free(unsafe.Pointer(InitStruct)) } InitStruct := (*C.Foo)(C.calloc(1,

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Nigel Tao
On Thu, Mar 5, 2020 at 10:32 AM Warren Stephens wrote: > There is a bunch of "goto nonsense" added to get the Go compiler to accept > the 4 labels Well then, don't use labels, so you don't need nonsense (or the dummy parameter). Cutting them out (https://play.golang.org/p/SUalTGaAxmx) runs

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
A few decades ago the Apple Macintosh was not very good either. Warren -- 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.

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Dan Kortschak
I wrote cybernetic systems for laboratories with LabView a few decades ago. Nothing is worth keeping from that system. On Fri, 2020-03-06 at 00:59 -0800, Warren Stephens wrote: > How many good tools exist now that will turn linear code into a nice > looking readable flow chart? Few? None really?

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Warren Stephens
> > establish[ed] refactoring tools that are well understood and > tested > New modes of working need new tools to be developed. Prior paradigm tools are for the prior paradigm. How many good tools exist now that will turn linear code into a nice looking readable flow chart? Few? None