Re: [go-nuts] cumulative Chi square probability density function

2018-03-13 Thread Kees Varekamp
Great, thanks both! On Tuesday, March 13, 2018 at 5:58:13 PM UTC+13, kortschak wrote: > > Gonum stat/distuv has this. > > https://godoc.org/gonum.org/v1/gonum/stat/distuv#ChiSquared > > On Mon, 2018-03-12 at 16:01 -0700, Kees Varekamp wrote: > > Hello Gophers, > > > > Does anyone happen to ha

[go-nuts] Re: Go Games

2018-03-13 Thread alex . rou . sg
To those talking about using game engines like unity etc... you can build go as c-shared and use it as a normal C/C++ plugin. The only thing to note is that you can't unload it without restarting the program and multiple c-shared go libraries wouldn't work together. As for what I'm using go for

[go-nuts] Re: Why should i use interface composistion

2018-03-13 Thread Jason E. Aten
A good guideline for newcomers is to avoid creating any interfaces at all. Start with writing structs + methods first. Interfaces impose requirements on client code. Keeping them small means clients have fewer requirements. Let the need for an interface arise naturally during evolution of your c

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Axel Wagner' via golang-nuts
The advice regarding small interfaces goes further than just a simple "don't put many methods in an interface" - it includes (and is based on) a different philosophy of using interfaces. The advice assumes that you shouldn create an interfaces for the database backend in the first place - instead,

[go-nuts] Re: Go Games

2018-03-13 Thread nicolas_boiteux via golang-nuts
Do you mean we can for example build a GO .dll wich declare an entry point usable by C/C++ game ? I can give it a try easily with ARMA game wich load those kind of extension. Le mardi 13 mars 2018 08:39:02 UTC+1, alex@gmail.com a écrit : > > To those talking about using game engines like uni

[go-nuts] Re: Go Games

2018-03-13 Thread alex . rou . sg
Yup, as long as you build the go package as a c-shared you can basically do anything a C/C++ plugin can do. This contains a simple hello world for building a c-shared you can load in any C/C++ program. http://blog.ralch.com/tutorial/golang-sharing-libraries/ On Tuesday, March 13, 2018 at 4:15:2

[go-nuts] Re: Go Games

2018-03-13 Thread Haddock
I guess for gaming applications Go is used for games played through the Internet (web browser or other frontend) to develop the server-side backend system that processes the game data received from clients. Am Montag, 5. März 2018 01:16:47 UTC+1 schrieb Chris FractalBach: > > I'm still new to Go

Re: [go-nuts] Re: database/sql, p/pg, BLOB

2018-03-13 Thread roger peppe
Hi Nigel, It all seems to work as expected for me using this code: https://play.golang.org/p/QGBT6kqxHBS I'm using Postgres 9.5.12. Can you distill your problem into some self-contained code that demonstrates the issue? cheers, rog. On 7 October 2013 at 10:46, Nigel Vickers wrote: > > T

[go-nuts] Re: Go Games

2018-03-13 Thread Harris Newman
I've written a game in go, it's at: decwars.com -Harris On Sunday, March 4, 2018 at 6:16:47 PM UTC-6, Chris FractalBach wrote: > > I'm still new to Go, and have been writing server code to support a > multiplayer game. > > After reading the Go 2017 Survey Results >

[go-nuts] Re: Why should i use interface composistion

2018-03-13 Thread prades . marq
The answer is it depends on the context. There is no way to answer that question without looking at the full codebase and what method will call a type implementing the Store interface. In general, you should only put the methods in an interface the consumer of a value will use. given a function

[go-nuts] confusing a lock demo about https://golang.org/ref/mem#tmp_8

2018-03-13 Thread 郎凯
var l sync.Mutex var a string func f() { a = "hello, world" l.Unlock() } func main() { l.Lock() go f() l.Lock() print(a) } I'm a new gopher, reading a blog about lock and having a problem, in general , we use sync.Mutex in pairs, in the above code why could it call lock two times in main. Any

Re: [go-nuts] confusing a lock demo about https://golang.org/ref/mem#tmp_8

2018-03-13 Thread Burak Serdar
The second lock waits until f() runs and unlocks the mutex. On Tue, Mar 13, 2018 at 3:37 AM, 郎凯 wrote: > var l sync.Mutex > var a string > > func f() { > a = "hello, world" > l.Unlock() > } > > func main() { > l.Lock() > go f() > l.Lock() > print(a) > } > > I'm a new gopher, reading a blog about

[go-nuts] Re: ANN: gemacs, a lightweight emacs, written in pure Go

2018-03-13 Thread Zellyn
Nice! What is the relationship between gemacs and godit? The readme seems mostly a copy, so I was expecting godit to be abandoned. But it's showing recent activity… On Monday, March 12, 2018 at 5:10:20 PM UTC-4, Jason E. Aten wrote: > > *https://github.com/glycerine/gemacs

[go-nuts] Is there any tutorial or documentation on getting flame graphs with go 1.10?

2018-03-13 Thread Sathish VJ
Trying to figure out profiling and flame graphs on the latest go. And information seems to be lacking. Any pointers to articles that work? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Is there any tutorial or documentation on getting flame graphs with go 1.10?

2018-03-13 Thread Jan Mercl
On Tue, Mar 13, 2018 at 3:35 PM Sathish VJ wrote: > Trying to figure out profiling and flame graphs on the latest go. And information seems to be lacking. Any pointers to articles that work? https://github.com/uber/go-torch -- -j -- You received this message because you are subscribed to t

[go-nuts] Re: confusing a lock demo about https://golang.org/ref/mem#tmp_8

2018-03-13 Thread jake6502
I would like to point out that the example code you refer to is meant to illustrate a specific behavior of locks. It is *not* necessarily intended to be an example of good style. As a "new gopher" I would avoid this idiom. If you did use this, some significant commenting would be needed. Also,

[go-nuts] Re: Are you doing unit, module, and systems tests? If not, why not?

2018-03-13 Thread matthewjuran
I have less than ten years of experience doing this, but: The rule is that if you don’t verify it then it’s going to break in deployment, 100% of the time. In my experience you can get away without testing small changes with software if you’re very careful about verifying the change with manual

[go-nuts] Re: Why should i use interface composistion

2018-03-13 Thread matthewjuran
Interfaces are not for grouping variable behavior, interfaces are for allowing generic code to apply to varying data structures. Consider a struct of function fields for grouping variable behavior without a backing data structure. If your interface type is not an input in the same package then

[go-nuts] import and example to send file or image to printer and detect port and printer name ?

2018-03-13 Thread Juan Gomez
Hi group, I am trying to resolve how to send file image to printer not console, any body know the import file and example ? -- 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

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
hi, firstnat all thanks for your reply. Indeed, the interface arose from the necessity of testing. Have you expierience with a memory sql driver? Could you recommend one? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
hi, first of all thanks for your reply. Indeed, the interface arose from the necessity of testing. Have you expierience with a memory sql driver? Could you recommend one? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
@all thx for your comments I think i understand now how to deal with the advise of small interfaces. -- 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+

[go-nuts] Re: Why should i use interface composistion

2018-03-13 Thread Henry
I would recommend doing the simplest things to make it work, and resort to more complex stuffs when you actually have the need for them. In the beginning, there were no *best practices* and people just took the easiest way to get their jobs done. Over the years, programming practices evolve. Th

[go-nuts] Re: Go Games

2018-03-13 Thread leonsal
It may be of interest: https://github.com/g3n/engine https://github.com/g3n/g3nd https://github.com/danaugrs/gokoban -- 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

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread matthewjuran
Writing to be testable is good but ideally tests shouldn’t drive the app code. I’ll admit that I’ve written inconsistent database method patterns to enable testing but then never wrote tests. In that case there’s a global DB type (type DB struct { *sql.DB }) with a global var of the type initia

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
Unfortunately I have no tests yet. My plan is to use testify an mockery to generate tests for the Storage interface. I am aware of the fact that this only tests the app code . For testing the database methods we'll start integration tests against a real database., kind regards Reinhard Am D

[go-nuts] Re: Are you doing unit, module, and systems tests? If not, why not?

2018-03-13 Thread Mike Crilly
Great response. Thank you. You've given me a lot to think about. On Wednesday, 14 March 2018 01:38:53 UTC+10, matthe...@gmail.com wrote: > > I have less than ten years of experience doing this, but: > > The rule is that if you don’t verify it then it’s going to break in > deployment, 100% of the

[go-nuts] Re: ANN: gemacs, a lightweight emacs, written in pure Go

2018-03-13 Thread Jason E. Aten
On Tuesday, March 13, 2018 at 9:03:15 AM UTC-5, Zellyn wrote: > > > What is the relationship between gemacs and godit? > While that was answered in the very first two lines of the readme, I've added language there to emphasize the contrast. Using tcell is the big one. A bunch of smaller updates

[go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread Christopher Sebastian
Hi Maverick, this is an interesting VTable pattern to think about. I have a question about your Dynamic() method. As far as I can see, these two expressions would always be equal: myShape.Dynamic() myShape.VTable ...So why go through the trouble of defining Dynamic() at all? Is there

[go-nuts] Question regarding the use of LSB-first polynomials in the hash/crc32

2018-03-13 Thread rasty
Hi guys, I searched the whole mailing list and haven't found any discussion so wanted to ask directly. What was the thinking behind using reversed polynomials in the crc32 instead of the normal ones (or giving an option to use either at will). At times it may produce complications (as it did in

[go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread prades . marq
> In the example, there is a "typo" in the spelling of a method name ("Bg" instead of "Bug"), and that typo caused the generate code to exhibit an infinite recursion in method lookup. No, it has nothing to do with a "typo". I removed the Bg() method and infinite recursion still occurs a

Re: [go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread Christopher Sebastian
@prades.marq , The solution that you pointed out is already obvious to everyone. Maverick was not asking "how" to solve the problem. He is pointing out an interesting corner-case bug in the Go runtime. -- You received this message because you are subscribed to the Google Groups "golang-nuts" g

Re: [go-nuts] infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread Maverick Woo
Hi Rog, Thank you very much for taking the time to write the example code on the playground. I understand how the inversion is supposed to happen and I acknowledge it is very common in Go---to the extent that I think everyone including myself would call your example idiomatic (and my VTable at

[go-nuts] Re: confusing a lock demo about https://golang.org/ref/mem#tmp_8

2018-03-13 Thread 郎凯
Thank you for your advice, this is my first time to ask a question there. 在 2018年3月13日星期二 UTC+8下午11:00:46,Jake Montgomery写道: > > I would like to point out that the example code you refer to is meant to > illustrate a specific behavior of locks. It is *not* necessarily intended > to be an example

Re: [go-nuts] confusing a lock demo about https://golang.org/ref/mem#tmp_8

2018-03-13 Thread 郎凯
Thanks a lot, I also want to know what the first lock meaning is? 在 2018年3月13日星期二 UTC+8下午9:32:35,Burak Serdar写道: > > The second lock waits until f() runs and unlocks the mutex. > > On Tue, Mar 13, 2018 at 3:37 AM, 郎凯 > > wrote: > > var l sync.Mutex > > var a string > > > > func f() { > > a

[go-nuts] Re: ANN: gemacs, a lightweight emacs, written in pure Go

2018-03-13 Thread Zellyn
Heh. I didn't realize that godit isn't terminal-capable. I thought, “Who cares which terminal library it uses?” lol. Thanks for the clarification :-) Zellyn On Tuesday, March 13, 2018 at 5:51:01 PM UTC-4, Jason E. Aten wrote: > > On Tuesday, March 13, 2018 at 9:03:15 AM UTC-5, Zellyn wrote: >> >

[go-nuts] Re: Go Games

2018-03-13 Thread Alan Lu
I voted this option. I use Go in server side, and it performs very well. On Monday, March 5, 2018 at 8:16:47 AM UTC+8, Chris FractalBach wrote: > > I'm still new to Go, and have been writing server code to support a > multiplayer game. > > After reading the Go 2017 Survey Results >