Re: [go-nuts] Having difficulty converting []byte to float

2018-05-17 Thread Jesse McNelis
On Fri, May 18, 2018 at 12:26 PM, wrote: > Hello all. I am creating a custom exporter for FreeNAS > https://github.com/Maelos/freenas_exporter and am stuck on the conversion of > the string of bytes provided by the commands output to a float. Here is my > code, what

[go-nuts] Re: Cgo: using syscall.Select

2018-05-17 Thread Сергей Камардин
You could also take a look at https://godoc.org/github.com/mailru/easygo/netpoll четверг, 17 мая 2018 г., 3:08:29 UTC+3 пользователь Juliusz Chroboczek написал: > > I'm interfacing with a C library that expects to do its own I/O, but > wants to be called after a file descriptor is ready for

[go-nuts] Having difficulty converting []byte to float

2018-05-17 Thread Tamás Gulácsi
The input is string, so use strconv.ParseFloat, or ParseInt (will there be non-integer number of cpus?) Just trim the LF with strings.TrimSpace. For production use, leave out the grep and bash, read the output lines directly with bufio.Scanner. -- You received this message because you are

[go-nuts] Having difficulty converting []byte to float

2018-05-17 Thread john . macrae . fox
Hello all. I am creating a custom exporter for FreeNAS https://github.com/Maelos/freenas_exporter and am stuck on the conversion of the string of bytes provided by the commands output to a float. Here is my code, what I have tried, and my results: What I have tried and results (commented so

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

2018-05-17 Thread Dave Cheney
Thank you to all those who contributed to this thread. While many Go programs are written under open source licences, and many Go programmers contribute to open source in a professional or personal capability, it is now time to bring the discussion to a close as this thread has moved outside

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

2018-05-17 Thread matthewjuran
Thanks for responding Michael. "decorative item not to be used off-road, in uneven terrain, or relied upon > as protection in case of vehicle roll." The sticker I’ve been looking at says something like “modifying or attaching anything to this ROPS will compromise the structure and may cause

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

2018-05-17 Thread Michael Jones
perhaps some context will make this clearer. no reference is being made to any actual persons or events. 1. It is the observed habit of people (plaintiff's) bring suit in court when something goes wrong. Ex: airplane crash, dark spot on potato chip, food is too hot, etc. 2. Plaintiff's attorneys

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

2018-05-17 Thread matthewjuran
I was thinking something like writing an undocumented “Happy New Year!” to standard out at the start of the year. An obvious but undocumented ‘rm -rf /‘ attempt was mentioned above. My first program was a practical joke. On the calculator command line I said “press enter” then put the program

[go-nuts] Re: Encoding

2018-05-17 Thread Manlio Perillo
Il giorno giovedì 17 maggio 2018 04:57:48 UTC+2, Raulino Neto ha scritto: > > Hello Guys, I have to convert a Json to a UTF_16LE and byte array for sign > a rsa key, someone have idea that how I can do it? Thanks regards. > For encoding UTF-8 to UTF-16LE see:

Re: [go-nuts] Cgo: using syscall.Select

2018-05-17 Thread Ian Lance Taylor
On Thu, May 17, 2018 at 9:56 AM, Juliusz Chroboczek wrote: >> If you do this in Go, you should use golang.org/x/sys/unix package >> rather than the syscall package. > > What's the advantage? (In this particular case, not in general.) The advantage in this particular case is likely

[go-nuts] Re: How to calculate x^y? (the power of)

2018-05-17 Thread Louki Sumirniy
math/big's big.Int has a power function: https://golang.org/pkg/math/big/#Int.Exp I wrote a power function for big.Float you can find here: https://github.com/l0k1verloren/float256/blob/master/float256.go#L82 It doesn't check for overflows because I don't think big.Float overflows from 64 bit

Re: [go-nuts] Cgo: using syscall.Select

2018-05-17 Thread Juliusz Chroboczek
> If you do this in Go, you should use golang.org/x/sys/unix package > rather than the syscall package. What's the advantage? (In this particular case, not in general.) > But since you have to call C anyhow, I would suggest just doing it in C. Yeah, I guess it's simpler. > There isn't any way