Re: [go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-04 Thread Jeff Stein
= 0 { goto childerror } continue } On Monday, March 4, 2024 at 1:13:08 PM UTC-7 Jeff Stein wrote: > It appears this was in fact the issue. > > I added some code to print out the `FD_CLOEXEC` state. Files called via > *syscall.Dupe2* end up with a *FD_CLOEXEC=0* whereas anything passed via

Re: [go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-04 Thread Jeff Stein
towards a wonderful discovery about what NOT to do :) On Monday, March 4, 2024 at 12:03:16 PM UTC-7 Jeff Stein wrote: > I think I may have discovered the issue. > > I made a sys call to duplicate the file descriptor > > dupFd, err := syscall.Dup(int(file.Fd())) > if err != nil { >

Re: [go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-04 Thread Jeff Stein
quals fd2, then dup2 returns fd2 without closing it. Otherwise, the FD_CLOEXEC file descriptor flag is cleared for fd2, so that fd2 is left open if the process calls exec.* Does this sound like what may have been happening? On Monday, March 4, 2024 at 9:04:31 AM UTC-7 Jeff Stein wrote: > OP h

Re: [go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-04 Thread Jeff Stein
comes around. > > Good point, I am assuming that the OP is using the os/exec package to > start up a new copy of the process. > > A simple fork without an exec can't work in Go, or in any > multi-threaded program. > > Ian > > > > > On Mar 1, 20

[go-nuts] Limiting File Descriptors on Forked Linux cmd.exec

2024-03-01 Thread Jeff Stein
I'm struggling to understand if I'm able to do something. In my very odd use case we are writing a websever that handles connections via a forked process. I have a listener process that listens for TCP connections. So each net.Conn that comes in we pull off its file descriptor: *fd, err := co

[go-nuts] Re: Ignore stale read errors from the race detector

2022-06-10 Thread Jeff Learman
Consider skipping specific tests when the race detector is active. Alternatively (and dangerously, unless you understand the consequences), provide two implementations; one that is safe and is used when race detection is enabled, and another that is unsafe, and use build flags to control it:

Re: [go-nuts] Re: Ignore stale read errors from the race detector

2022-06-10 Thread Jeff Learman
Unlike C, Go has no `volatile` keyword. Therefore, the compiler is allowed to cache a value that is never updated in the scope that it sees, and there's no way for us to tell it not to do that. Issues like this aren't really data races, but they are caught by the race detector. On Wednesday,

Re: [go-nuts] Type inference based on constraints

2022-02-18 Thread Jeff Peck
On 2/16/2022 2:43 PM, Ian Lance Taylor wrote: On Tue, Feb 15, 2022 at 2:49 PM Blackgreen wrote: I came across this stack overflow question: https://stackoverflow.com/questions/71131665/generics-pass-map-with-derived-types The OP attempted to pass different maps into this code: func equal[M1,

[go-nuts] How can I submit an optimized crypto code file ?

2021-10-11 Thread 'Jeff Winkler' via golang-nuts
Hi All, I optimized this file, by unrolling small loops and removing unnecessary branches. What's the next step to get it in the process for eventual inclusion ? It's about 30% faster. src/crypto/elliptic/p224.go Thanks, Jeff -- You received this message because you are subscri

Re: [go-nuts] Why does Go ignore HTTP_PROXY and HTTPS_PROXY if the proxy address is localhost

2021-04-14 Thread Jeff Peck
Just a complete shot in the dark. Have you verified that the environment variables you set are indeed getting picked up inside of your application? Try checking the output of os.GetEnv("HTTP_PROXY"), os.GetEnv("HTTPS_PROXY"), and os.GetEnv("NO_PROXY"). Make sure that if NO_PROXY is set that it

Re: [go-nuts] Why does my code keep giving me "socket: too many open files"

2021-04-09 Thread Jeff Peck
On 4/9/21 11:57 AM, Tenjin wrote: Basically I am making a script to query an api for some json data, if I run it synchronously it works fine and works as intended but it needs to do this give or take 15thousand times so I thought I would use concurrency to get the job done. It works fine for a

Re: [go-nuts] calling cmd

2021-01-28 Thread Jeff Mangan
Jan 28, 2021 at 9:29 AM Jeff Mangan wrote: > >> I am trying to get the results of top (more specifically htop) but every >> time it prints nothing, whereas any other command (ls, pwd, etc...) returns >> the output fine. My objective is to get access to the process stats

[go-nuts] calling cmd

2021-01-28 Thread Jeff Mangan
I am trying to get the results of top (more specifically htop) but every time it prints nothing, whereas any other command (ls, pwd, etc...) returns the output fine. My objective is to get access to the process stats that are returned to the screen. Here is the latest example which displays noth

[go-nuts] sound level from sample of a wav file

2021-01-03 Thread Jeff Mangan
I am able to open a wav file and iterate through samples of it. I am trying to figure out the level of sound (loud vs low talking) and I believe it's a matter of getting some value from the sample and then running some math formulas. Anyone have any ideas or references on this, prefer not some hea

[go-nuts] Re: datastore.RunInTransaction

2020-12-27 Thread Jeff
:= tx.Commit(); err != ErrConcurrentTransaction { return cmt, err } On Sunday, December 27, 2020 at 3:04:32 AM UTC-5 peterGo wrote: > Jeff, > > Retry if err == ErrConcurrentTransaction. > > Peter > > On Saturday, December 26, 2020 at 10:54:36 PM UTC-5 Jeff wrote: &

[go-nuts] datastore.RunInTransaction

2020-12-26 Thread Jeff
hrough the for loop the number of times. Thus, increasing the attempts would actually decrease the chances of successfully committing the transaction as it would need to be successful for each attempt. Hopefully, my interpretation is wrong and someone can explain what is actually going on. Th

[go-nuts] mic input level

2020-12-21 Thread Jeff Mangan
I asked a similar question recently, but have decided to approach a different way. I'm looking for a way to do something similar to a standard sound record app that shows a graph line chart of the input from a mic. That's it, nothing fancy doesn't need to record and save or anything. Has anyone

[go-nuts] 3 part write up on C# vs Golang performance

2020-12-17 Thread Jeff Mangan
https://alexyakunin.medium.com/go-vs-c-part-1-goroutines-vs-async-await-ac909c651c11 Interesting article, only had time to skim but seems to lean towards C#. Thoughts? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

Re: [go-nuts] Re: get decibel level from audio stream or file

2020-12-16 Thread Jeff Mangan
reat non-Go-specific > article about generating waveform data > https://matt.aimonetti.net/posts/2019-06-generating-waveform-data-audio-representation/ > . > > I hope this helps with your search. > On Tuesday, December 15, 2020 at 2:42:50 PM UTC-5 Jeff Mangan wrote: > >> >

[go-nuts] get decibel level from audio stream or file

2020-12-15 Thread Jeff Mangan
I want to know if there is a, internal or other package to get the decibel level from an audio stream or file say every second, or few seconds, etc... I tried searching and have not found anything. Anyone know of a way to accomplish this with golang? I'd rather not use c#, java, etc... Than

[go-nuts] Re: go 1.13.1 (linux x64): time.After not working as expected

2019-10-14 Thread Jeff Kayser
On Monday, October 14, 2019 at 5:53:23 AM UTC-7, Jeff Kayser wrote: > > I'm working through the most excellent book "Concurrency in Go", doing the > example on page 162-166. My code is here: > > https://play.golang.org/p/7kokkAIdhov > > The program is not t

[go-nuts] go 1.13.1 (linux x64): time.After not working as expected

2019-10-14 Thread Jeff Kayser
r examples have worked as expected, including the one just before this, which is almost identical, except for a couple of tweaks. This is the first one that hasn't worked. What am I doing wrong? ~Jeff Kayser -- You received this message because you are subscribed to the Google Groups &qu

[go-nuts] DEDIS Lab at EPFL is hiring gophers

2019-01-24 Thread jeff . allen
Hacking Go to make blockchains suck less? Hacking Go at the intersection of students, researchers, and industry? Hacking Go to protect privacy, democracy, or medical data? Hacking Go while eating fondue? Apply and come find out what's better than just hacking Go! Jeff Allen Engineering Te

[go-nuts] Will golang.org/x/sys be getting a go.mod file?

2019-01-11 Thread jeff . allen
/x/sys to act like a real module. Thanks for any pointers to an explanation of the Go team's plans for golang.org/x packages. -jeff -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] Go offline development recommendations

2018-12-13 Thread Jeff Kowalczyk
g 1.12 changes to module vendoring? Jeff -- 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.

[go-nuts] googleable guru doc page?

2018-11-03 Thread 'Jeff Hodges' via golang-nuts
Hey, I just googled "guru golang" and "go guru" and wasn't able to find documentation on what guru can do or how it does it. Is there documentation for it that could be made search accessible somewhere? Or is guru deprecated and I hadn't heard? -- You received this message because you are subscr

Re: [go-nuts] Generics - Why contracts?

2018-09-11 Thread Jeff
On Tuesday, September 11, 2018 at 11:35:05 AM UTC-4, Ian Davis wrote: > > > Recent conversations here and around the proposal suggest that the type > system isn't strong or clear enough to convey the kinds of constraints that > we want to use. Personally I am not a fan of having nonsense, unexec

[go-nuts] Generics - Why contracts?

2018-09-11 Thread Jeff
plore contracts over other approaches. Jeff -- 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.

[go-nuts] Re: gofmt: one line if statement

2018-01-07 Thread Jeff Goldberg
Yes, but ... First the "yes" part. I find myself writing one line if statements, and then finding myself annoyed at gofmt. When I write a one line if statement, there is a presentational reason for it. But But such formatting would have to be an all or nothing thing if we wanted consistency

[go-nuts] Re: Surprise About How Method Receivers Work

2017-12-17 Thread Jeff Goldberg
On Sunday, December 17, 2017 at 2:32:24 PM UTC-6, jlfo...@berkeley.edu wrote: > > Here's something that someone new to Go might run up against. I know I did. > > Me, too! The trivial program below, derived from "The Go Programming Language" > book, shows two methods that differ only in the way

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-13 Thread Jeff Goldberg
On Wednesday, December 13, 2017 at 5:06:01 AM UTC-6, Caleb Spare wrote: > > And in fact, Tv has already done that. You want > https://github.com/tv42/zbase32. > Yep. That solves my immediate needs. (For what it is worth, I'm playing with different ways of displaying public key fingerprints in th

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-13 Thread Jeff Goldberg
On Wednesday, December 13, 2017 at 5:02:40 AM UTC-6, rog wrote: > > > Looking at > http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt, > it seems that zbase32 allows the encoder and decoder to agree on the > number of bits transmitted, so if you're encoding 5 bits or less, you >

Re: [go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Jeff Goldberg
non-standard base32 works as an encoder should. Anyway, now that I've done more testing and have had this conversation, I'm confident enough that this is a bug that I will file a bug for it. Cheers, -j On Tuesday, December 12, 2017 at 5:13:41 PM UTC-6, Jeff Goldberg wrote: > > > &

[go-nuts] base32 DecodeLen() miscalculation when no padding

2017-12-12 Thread Jeff Goldberg
In encoding/base32 there is, I believe, an off by one error in the calculation of the size of the buffer needed for DecodeLen() when padding is turned off. // DecodedLen returns the maximum length in bytes of the decoded data // corresponding to n bytes of base32-encoded data. func (enc *Enco

[go-nuts] Position at Red Hat for a Go engineer

2017-08-31 Thread Jeff Law
contact me directly and I'll answer as best as I can. Thanks, Jeff Law Red Hat, Inc. -- 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

[go-nuts] learning go, or, yes, math/big.Mod, there *is* a better way :-)

2017-07-19 Thread Jeff Templon
Hi A followup message ... I managed to increase the speed of my little prime factorization program by a bit more than a factor of two, the performance win is hardware-dependent. After I learned how to profile the code, I discovered a few things: - 70% of the time was taken in math/big.Mo

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-18 Thread Jeff Templon
One more bit of progress which shaved off more time: following this page, https://blog.golang.org/profiling-go-programs I introduced a pair of global cache big.Int variables for the function which was consuming most of the time; one for the smaller intermediate results and one for the larger.

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-18 Thread Jeff Templon
I managed to do quite a bit better (30% savings in execution time) proceeding along these lines. Finally I got to the point where runtime.makeslice, and underneath runtime.mallocgc, are responsible for 50% of the run time, with no other real hotspots. Almost all of the makeslice time is comin

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-18 Thread Jeff Templon
locgc disappeared, resulting in a bit more than 10% overall performance improvement in the entire code. Now I understand better the comments about reuse of arguments in the math/big documentation! Thanks for your suggestion. On Tuesday, July 18, 2017 at 9:09:54 AM UTC+2, Jeff Templon wrote: &

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-18 Thread Jeff Templon
Hi Remy, On Monday, July 17, 2017 at 10:39:56 PM UTC+2, Rémy Oudompheng wrote: > > 2017-07-17 15:56 GMT+02:00 Jeff Templon >: > > > it turns out that 77% of the time of the program is spent in > > runtime.mallocgc :-) I think the reason why is stuff like this: >

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Hi Jan, On Monday, July 17, 2017 at 4:20:21 PM UTC+2, Jan Mercl wrote: > > > Just for fun: Please provide a sample in that range. > Sure: medina:gofact> time ./factorize -r -M 191 factoring 3138550867693340381917894711603833208051177722232017256447 factors [ 383 7.068.569.257 39.940.132.241

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Hi Generally I'm factoring numbers that I can do in less than a day, so in the order of 60 to 100 decimal digits. JT On Monday, July 17, 2017 at 4:02:29 PM UTC+2, Jan Mercl wrote: > > On Mon, Jul 17, 2017 at 3:57 PM Jeff Templon > wrote: > > > Coming back to this, n

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-17 Thread Jeff Templon
Coming back to this, now that my Go knowledge is increasing: On Saturday, July 8, 2017 at 5:58:59 PM UTC+2, Andy Balholm wrote: > > I noticed your “naive explanation” after I sent my message. But I think it > is the real explanation. > it turns out that 77% of the time of the program is spent i

Re: [go-nuts] slow Mod function in math/big, a better way?

2017-07-08 Thread Jeff Templon
Hi, On Friday, July 7, 2017 at 6:48:01 PM UTC+2, Andy Balholm wrote: > > That’s normal for languages like Python. The code that is actually running > in Python is slow, but library functions are fast, because they are written > in C. > Sure ... that's why I wrote the 'naive explanation' that sa

[go-nuts] slow Mod function in math/big, a better way?

2017-07-07 Thread jeff . templon . nikhef
Hi Exploring Go, 1st project is to port over my favourite playground (prime number factorisation) from Python to Go. Aside: I was a big Oberon-2 fan back in the day, so I'm pretty excited about Go making possible what never was in Oberon. Back to business: I was disappointed that Go is only

[go-nuts] RE: Go package/version management, vendoring, dep, gb, etc...

2017-02-05 Thread Jeff Kayser
Hi, Dave. Thank you for your clarifications about how gb works. I appreciate your specific examples of how to get the needed code into the gb directory trees. I didn’t know about git submodules or the gb-vendor plugin; I’ll check it out. Jeff Kayser Jibe Consulting | Managing Principal

[go-nuts] RE: Go package/version management, vendoring, dep, gb, etc...

2017-02-05 Thread Jeff Kayser
etch". That is exactly what I needed to know! I just started to use gb a couple of days ago, so I'm a newbie with that too. Thank you for your help. Much appreciated. Jeff Kayser Jibe Consulting | Managing Principal Consultant 5000 Meadows Rd. Suite 300 Lake Oswego, OR 97035 O: 503-5

[go-nuts] RE: Go package/version management, vendoring, dep, gb, etc...

2017-02-05 Thread Jeff Kayser
might help some other newbies. Items 6 and 7 have info I've gleaned from Internet and Dave Cheney about package management, dependency management, package versioning, cyclic dependencies, etc. Jeff Kayser Jibe Consulting | Managing Principal Consultant 5000 Meadows Rd. Suite 300 Lake Osweg

[go-nuts] rewriting html/template files

2016-11-10 Thread 'Jeff Hodges' via golang-nuts
I originally wrote this up as a GitHub issue, but I want to make sure I'm not missing anything by emailing this list first. It would be nice if it was easier to rewrite `html/template` files but the current tools (`html/template` and `x/net/html`) seem to have a gap between them. Maybe there's a w

[go-nuts] Re: enabling HTTP/2 clients with some TLS settings using only stdlib?

2016-08-28 Thread 'Jeff Hodges' via golang-nuts
6\x00\x00@ \x00\x00\x00\x04\b\x00\x00\x00\x00\x00\x00\x0f\x00\x01\x00\x00\x1e\a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01http2_handshake_failed" exit status 1 On Sun, Aug 28, 2016 at 6:18 PM Jeff Hodges wrote: > Hey, I've not been able to figure out how to enable HTTP/2 in a

[go-nuts] enabling HTTP/2 clients with some TLS settings using only stdlib?

2016-08-28 Thread 'Jeff Hodges' via golang-nuts
Hey, I've not been able to figure out how to enable HTTP/2 in a net/http client that needs some tls.Config settings in its Transport (like it's needs a specific root added at run time) using only the stdlib. Is there a way to enable HTTP/2 on clients in the stdlib that I've missed? (Related: I th