Re: [go-nuts] Re: [ANN] GoKi Trees and GoGi GUI

2018-05-04 Thread Randall O'Reilly
Here’s a few responses to some of the overall “Smell” issues, and per Wojciech’s comments I don’t really do blogging but here are just a few of the “lessons learned / issues confronted” in this effort. Overall the ONLY thing I would change about Go based on my experience so far is some of the m

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Andrei Avram
Yes, this could be it. First I was fooled by println rounding 2.9 to 3, thinking floor is not working properly on Linux. Thanks! On Saturday, May 5, 2018 at 1:49:34 AM UTC+3, Steven Hartland wrote: > > You could be seeing a side effect on fact that windows only ticks every > 15ms. > > On Fri, 4

[go-nuts] Re: I don't know about callbacks in Golang

2018-05-04 Thread Krzysztof Kowalczyk
You can read Essential Go (https://www.programming-books.io/essential/go/) On Friday, May 4, 2018 at 5:53:13 PM UTC-7, Eduardo Moseis Fuentes wrote: > > HI everyone I´m Eduardo from Guatemala and I'm beginer. I'm interesting > in all scope golang in fact I was download a little book about it, b

[go-nuts] I don't know about callbacks in Golang

2018-05-04 Thread Eduardo Moseis Fuentes
HI everyone I´m Eduardo from Guatemala and I'm beginer. I'm interesting in all scope golang in fact I was download a little book about it, but I need learn more about callbacks because the book don´t has enough information on callbacks. May somebody tell me where can I find more information?

[go-nuts] Re: Go routines hanging

2018-05-04 Thread Michael Andersen
When you say it hangs, do you mean that every single goroutine hangs or just some of them? If it is just some of them, I don't have any ideas, but you could try running with -race to catch deadlocks. If it is all of them then you might be running into a problem that I had where the GC suspends

[go-nuts] Re: [go/types] Implements doesn't work for types from different packages when the interface signature has types from the package where the interface lies.

2018-05-04 Thread Denis Cheremisov
I meant true-false is not expected behaviour, true-true is what I would love to see. -- 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...@goog

[go-nuts] [go/types] Implements doesn't work for types from different packages when the interface signature has types from the package where the interface lies.

2018-05-04 Thread Denis Cheremisov
Hi! I am writing a special linting-like piece of code and struggle dealing with the Implements that doesn't work for my configuration. I made a simplified testing example to show the issue: - I have package speaker with interface Speaker and it

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Steven Hartland
You could be seeing a side effect on fact that windows only ticks every 15ms. On Fri, 4 May 2018 at 21:56, Andrei Avram wrote: > This code is extracted from something real. Someone on the team noticed > the unit tests (which I wrote on a Linux machine) were failing on their > Windows machine. >

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread Louki Sumirniy
I sorta only vaguely understand what you mean about being 'too big'. I only have 4 comparators, 5 walk operators and a small collection maybe around 8 helper functions. But now that I'm working with inter-convertible slice types, I don't have to do any interfaces in fact. I only have 5 types I

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread Louki Sumirniy
There won't be reallocations as I won't be resizing the pages. I think I have to think carefully about the sizes of the elements in the arrays, and when creating them pad them out if there is a remainder of space after the elements are allocated. I think I will probably work with, in fact, uint3

[go-nuts] Re: Is there any #blog which writes about how to succeed as a fresher Go programmer?

2018-05-04 Thread matthewjuran
I’m assuming you’re asking how to make a career around Go. For a career you might be best served by blogs about general software development or software engineering. Others here may be able to point you in the right direction for blogs. I’m not sure if “software” is still the best word for it.

Re: [go-nuts] Re: [ANN] GoKi Trees and GoGi GUI

2018-05-04 Thread Randall O'Reilly
Matt — thanks a ton for all the detailed comments! Just quickly I figured out the git/hub steps to split out the top-level repositories into separate “ki” and “gi” repos, so the link and package paths are now: https://github.com/goki/gi and ki and hopefully this now works for the demo — just w

Re: [go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-04 Thread Wojciech S. Czarnecki
On Fri, 4 May 2018 04:39:06 -0600 Randall O'Reilly wrote: > https://github.com/goki/goki — key demo in: > https://github.com/goki/goki/tree/master/gi/examples/widgets > > This is the first release of a new Go framework built around the Tree as a > core data structure (Ki = Tree in Japanese), Ha

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread matthewjuran
With byte slices you’ll need to pay attention to reallocation of the backing array as a possible source of performance problems (https://blog.golang.org/go-slices-usage-and-internals). I can see clearly how freakin complex code gets when you try to do generics > and polymorphism. I think it’s

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Andrei Avram
This code is extracted from something real. Someone on the team noticed the unit tests (which I wrote on a Linux machine) were failing on their Windows machine. I'll continue studying this and come back if I find something new. Thank you both for your time, I appreciate it! On Friday, May 4, 20

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread speter
To file a bug (and have it treated seriously) you would need to demonstrate that it is causing problems in a program that actually does something useful, not just a pathological code sample. My expectation would be that once you start doing some real processing, the difference between time.Now() in

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Andrei Avram
> > But I don't think it is because Windows is so much faster than Linux > Yeah... :) I was exploring all cases. and/or the way the time package implemented is different between Windows > and Linux Could this be considered a possible Go bug and would it worth opening an issue on Github?

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread speter
So on Linux it's working as expected. In the playground time is "virtual"; the start time is fixed and it doesn't progress unless you explicitly Sleep -- because you don't Sleep in your program, time.Now() returns the same time on both invocation. So the only slightly surprising part is that on Wi

Re: [go-nuts] panic: runtime: unknown pc

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 12:12 PM, andrey mirtchovski wrote: > It is unfortunately not reproducible. I got 2 crashes out of 500 > million executions. I've updated to tip and have not seen it since. It is possible that it has been fixed on tip. There have been fixes in the right areas, such as http

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Andrei Avram
Peter and Ian, you are both wright regarding the printing. Still, on Linux I have different values than on Go Playground. Regarding the speed, Peter, do you think that on Windows the two calls just run faster every time? On Friday, May 4, 2018 at 9:07:15 PM UTC+3, speter wrote: > > b is slightl

Re: [go-nuts] panic: runtime: unknown pc

2018-05-04 Thread andrey mirtchovski
It is unfortunately not reproducible. I got 2 crashes out of 500 million executions. I've updated to tip and have not seen it since. On Fri, May 4, 2018 at 12:14 PM, Ian Lance Taylor wrote: > On Thu, May 3, 2018 at 11:39 PM, andrey mirtchovski > wrote: >> >> I believe I've never encountered this

[go-nuts] Is there any #blog which writes about how to succeed as a fresher Go programmer?

2018-05-04 Thread heyimshub
Is there any blog which writes about how to succeed as a new Go coder? I mean: - How should one learn Go and make his/her career? - What should one do after learning Go? - How should one get/find job as freshman Go programmer? - and what skills should one have to land to his first Go programming

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread atomly
Perhaps try another language like Rust? atomly On Fri, May 4, 2018 at 10:44 AM, Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > Well after bashing my head against a brick wall I finally understand what > a mess it is for my specific purpose to work with Go. Nobody really > specifical

Re: [go-nuts] An issue with the select statement.

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 11:10 AM, Andriy Pylypenko wrote: > 2018-05-04 19:32 GMT+03:00 Ian Lance Taylor : >> >> On Fri, May 4, 2018 at 2:00 AM, wrote: >> > >> > And I want to modify the worker thread like this: >> > >> > for { >> > select { >> > case wi := <- work_ch: >> > self.do

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread Louki Sumirniy
Actually, after having a minor meltdown about the unpossibility of this, I realised for my specific case there is a golang compatible way to do this instead. Byte slices. Since I basically intended that really the nodes in the tree would probably be small, more often than not no more than 256

Re: [go-nuts] panic: runtime: unknown pc

2018-05-04 Thread Ian Lance Taylor
On Thu, May 3, 2018 at 11:39 PM, andrey mirtchovski wrote: > > I believe I've never encountered this nor seen anyone mention this > error before. It occurred while fuzzing a C library that we interface > with: > > PC=0x7fffbafc847c m=0 sigcode=0 > > goroutine 0 [idle]: > runtime: unknown pc 0x7fff

Re: [go-nuts] An issue with the select statement.

2018-05-04 Thread Andriy Pylypenko
2018-05-04 19:32 GMT+03:00 Ian Lance Taylor : > On Fri, May 4, 2018 at 2:00 AM, wrote: > > > > And I want to modify the worker thread like this: > > > > for { > > select { > > case wi := <- work_ch: > > self.do_the_work(wi) > > case <-self.idle_request: > > self.idle_

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread speter
b is slightly less than 3 because there is a bit of time between the two calls to time.Now(). If you substitute this: fmt.Printf("input: %20.18f\n", b) you get something like input: 2.99965553350911 HTH Peter On Fri, May 4, 2018 at 7:26 PM, Andrei Avram wrote: > Hello everyone, >

Re: [go-nuts] An issue with the select statement.

2018-05-04 Thread Andriy Pylypenko
2018-05-04 18:24 GMT+03:00 Bruno Albuquerque : > Here is an example that came up in the list that might help you: > https://play.golang.org/p/I8MS0DFgZ2 > Thank you! This is exactly the code I looked for. However I should say this approach is not very much elegant because the select statement ra

Re: [go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 10:26 AM, Andrei Avram wrote: > > Today I ran into a situation that is strange to me. I ran the following code > on two Linux machines (go run floor.go), on two Windows ones, and on Go > Playground. > > package main > > import ( > "time" > "math" > ) > > func main() { > date

Re: [go-nuts] Re: Go 1.10.2 and Go 1.9.5 are released

2018-05-04 Thread Michel Casabianca
Hi Gophers, I have updated my list of Go interfaces for these releases : http://sweetohm.net/article/go-interfaces.en.html Enjoy! -- Michel Casabianca Le mar. 1 mai 2018 à 19:27, Nathan Kerr a écrit : > I updated my release related resources: > >- Go Release Timeline

[go-nuts] Re: An issue with the select statement.

2018-05-04 Thread as
>Talking about the select() or poll() functions from the C library which evidently were an inspiration for the Go select statement Go select is more similar to alt() than select() or poll() On Friday, May 4, 2018 at 7:24:56 AM UTC-7, Andriy Pylypenko wrote: > > Hi, > > I have a scenario which I

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread Louki Sumirniy
Well after bashing my head against a brick wall I finally understand what a mess it is for my specific purpose to work with Go. Nobody really specifically said it in any discussions up to now but what my design needs is generics. If code generation could be done more transparently I could use t

Re: [go-nuts] Re: Upcoming Go protobuf release

2018-05-04 Thread 'Joe Tsai' via golang-nuts
The merge has happened on pull request #591 . JT On Thu, May 3, 2018 at 4:01 PM Tharaneedharan Vilwanathan < vdhar...@gmail.com> wrote: > Hi All, > > Can someone share some details on this code merge? Has this happened? How > can I play with it? > > T

[go-nuts] Possible issue with math.Floor on Linux

2018-05-04 Thread Andrei Avram
Hello everyone, Today I ran into a situation that is strange to me. I ran the following code on two Linux machines (go run floor.go), on two Windows ones, and on Go Playground. package main import ( "time" "math" ) func main() { datetime := time.Now().Add(time.Hour * 24 * 7 * 4 * 12 * 3) seco

Re: [go-nuts] bufio usage hurting performance

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 7:43 AM, Ankit Gupta wrote: > > I am talking in terms of parsing http request by using > > http.ReadRequest method which only accept bufio.Reader > (https://golang.org/pkg/net/http/#ReadRequest) Ah. That may have been a mistake. It dates back to the initial implementation

Re: [go-nuts] An issue with the select statement.

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 2:00 AM, wrote: > > And I want to modify the worker thread like this: > > for { > select { > case wi := <- work_ch: > self.do_the_work(wi) > case <-self.idle_request: > self.idle_response <- true > } > } > > However this last snippet of code

Re: [go-nuts] what is the binary code share mechanism of golang ?

2018-05-04 Thread Ian Lance Taylor
On Thu, May 3, 2018 at 11:37 PM, Jim Yin wrote: > > Right now, go still import 3rd party libraries by source code. > It is too foolish. > Java share libraries by jar files, c++ share libraries by dll or so files. > Even php has a phar file format. > go need a binary format file share libraries. >

[go-nuts] Re: Go routines hanging

2018-05-04 Thread Aaron Alpar
Can you distill the code you've provided into something that demonstrates the hangs with the least code possible? Immediately I see a possible problem on lines 131 and 148 or your code: I don't see specification of a timeout for the outgoing connection or sending the message on the outgoing co

Re: [go-nuts] An issue with the select statement.

2018-05-04 Thread Bruno Albuquerque
Here is an example that came up in the list that might help you: https://play.golang.org/p/I8MS0DFgZ2 That being said, It looks like you are over engineering. If I really understand what you want to accomplish, wouldn't this help? https://github.com/brunoga/workerpool You can call Stop()/Start()

Re: [go-nuts] what is the binary code share mechanism of golang ?

2018-05-04 Thread Michael Jones
Hello. Trying to understand your question. JAR files are the result of compiling source to a "ready for execution" state (using a CPU and OS-specific interpreter). DLL and SO are the result of compiling source to a specific, "ready for execution on a particular CPU and with a particular OS." Go pr

[go-nuts] Re: [ANN] GoKi Trees and GoGi GUI

2018-05-04 Thread matthewjuran
Hi Randy, here’s a code review. Thanks for the BSD license. I prefer the look of a minimized import path, I would have put the title library at the top level (github.com/goki/ki). To me the README doesn’t balance text and code examples well enough, I’d like to see more example uses and less te

Re: [go-nuts] bufio usage hurting performance

2018-05-04 Thread Ankit Gupta
I am talking in terms of parsing http request by using http.ReadRequest method which only accept bufio.Reader (https://golang.org/pkg/net/http/#ReadRequest) On Friday, May 4, 2018 at 8:04:22 PM UTC+5:30, Ian Lance Taylor wrote: > > On Fri, May 4, 2018 at 5:20 AM, Ankit Gupta > wrote: > > > >

Re: [go-nuts] bufio usage hurting performance

2018-05-04 Thread Ian Lance Taylor
On Fri, May 4, 2018 at 5:20 AM, Ankit Gupta wrote: > > I recently wrote a reverse proxy in Go - > https://github.com/gptankit/serviceq which does load balancing and queues > failed requests (to dipatch later). > When I compared perf with nginx, I noticed 15-20 ms higher response times. > So, I tim

[go-nuts] what is the binary code share mechanism of golang ?

2018-05-04 Thread Jim Yin
Right now, go still import 3rd party libraries by source code. It is too foolish. Java share libraries by jar files, c++ share libraries by dll or so files. Even php has a phar file format. go need a binary format file share libraries. Share libraries by source code is acceptable, but should not do

[go-nuts] The jsgo playground: Edit and run Go in the browser, supporting arbitrary import paths.

2018-05-04 Thread dave
https://play.jsgo.io/ The jsgo playground is an extension of the jsgo compiler. The compiler allows you to easily compile Go to JS using GopherJS, and automatically host the results in an aggressively cached CDN. The playground adds an online editor and many other features (share, deploy etc

[go-nuts] Go routines hanging

2018-05-04 Thread sam
Hi all, I'm having an issue with a messaging server I'm trying to write in Go (my first real Go project). I'm having an issue that I've not come across before in Go - the code executes as expected, then hangs after a second or so indefinitely, no errors, no logs showing it's exited. The code is

[go-nuts] An issue with the select statement.

2018-05-04 Thread bambyster
Hi, I have a scenario which I haven't found a way to implement with the Go channels and select statement while it's no problem to do it with the select()/poll() functions. The scenario is as follows. Let me use a Go-like pseudo-code to demonstrate the idea. There is a source of a work items wh

[go-nuts] beginner question about chanels

2018-05-04 Thread sam
gobyexample.com/channel-buffering explains this really nicely with a runnable example showing the difference! -- 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 gol

[go-nuts] Re: Html is not parsing while parsing a template to send email

2018-05-04 Thread djego . joss
Hello, first a small remark on wording: I think you're using the verb "parse" with the wrong definition here? You might mean something like "to replace html in template tokens" instead of "to parse..." :-). On Friday, May 4, 2018 at 10:42:57 AM UTC+2, Amandeep Kaur wrote: > > Where templateHtml

[go-nuts] it's hard to reply to group from gmail, by default

2018-05-04 Thread Jim Mitchell
  this is how it originally worked.  I have an old group setup years ago and that is the way it goes.   I spent an entire day with our new group and checked every setting to the old group and everything is the same except reply just goes to the poster.   Do the google group admins not understan

[go-nuts] Re: beginner question about chanels

2018-05-04 Thread k1attila1
Thank you Sir now i understand the difference 2018. május 4., péntek 15:21:49 UTC+2 időpontban k1at...@gmail.com a következőt írta: > > Hi > > i dont' understn what is the difference between : > > ch := make(chan bool,1) vs. ch := make(chan bool) > > this sample works well : > > packag

[go-nuts] Re: beginner question about chanels

2018-05-04 Thread Ankit Gupta
ch := make(chan bool) means you want to have an unbufferred channel. Send and Receive are block operations. In other words, send will block unless there is a receive operation, which is the case in your code. All calls to increment are blocked at ch <- true. When you change it to ch := make(cha

[go-nuts] beginner question about chanels

2018-05-04 Thread k1attila1
Hi i dont' understn what is the difference between : ch := make(chan bool,1) vs. ch := make(chan bool) this sample works well : package main import ( "fmt" "sync" ) var x = 0 func increment(wg *sync.WaitGroup, ch chan bool) { ch <- true x = x + 1 <-ch wg.Done() } func main() { var

Re: [go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Jakob Borg
Like this; https://play.golang.org/p/VVIOY7s9xQq //jb On 4 May 2018, at 13:32, Amandeep Kaur mailto:amandeepkaur4...@gmail.com>> wrote: Hi, Jakob Borg Thanks for ypur reply to the post. The solution you have provided can not be implemented on my system. I have provided a small sample of my

[go-nuts] bufio usage hurting performance

2018-05-04 Thread Ankit Gupta
I recently wrote a reverse proxy in Go - https://github.com/gptankit/serviceq which does load balancing and queues failed requests (to dipatch later). When I compared perf with nginx, I noticed 15-20 ms higher response times. So, I timed each function, and got to know that the code spends most

Re: [go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Amandeep Kaur
Hi, Jakob Borg Thanks for ypur reply to the post. The solution you have provided can not be implemented on my system. I have provided a small sample of my code structure. Please take a look type EmailTemplate struct{ BookingDetails string } type EmailReques

[go-nuts] [ANN] GoKi Trees and GoGi GUI

2018-05-04 Thread Randall O'Reilly
https://github.com/goki/goki — key demo in: https://github.com/goki/goki/tree/master/gi/examples/widgets This is the first release of a new Go framework built around the Tree as a core data structure (Ki = Tree in Japanese), which includes as its first application a fully-native Go GUI (built o

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread Louki Sumirniy
Yep, you are correct, more or less. My code is using interfaces and panicking when it's fed the wrong thing. For example, in my test I had a literal number going into a write function to put a value into a node in the tree. The insert implementation panicked saying it couldn't put an int into a

[go-nuts] Re: Windows OneDrive issue ..

2018-05-04 Thread Dave Cheney
This is issue https://github.com/golang/go/issues/22579 On Tuesday, 1 May 2018 20:38:26 UTC+2, xiof...@gmail.com wrote: > > I just discovered a problem running/compiling files that are > accessed/backed up by windows OneDrive > > (don't know when this started - worked a couple of months ago..) >

Re: [go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Jakob Borg
Hi, Your post is a bit confusing and I think you may be using the word "parse" in the opposite of it its common meaning. However, if you want to pass a HTML fragment through a HTML template and have it not be escaped, look at the template.HTML type: https://golang.org/pkg/html/template/#HTML /

[go-nuts] Html is not parsing while parsing a template to send email

2018-05-04 Thread Amandeep Kaur
Hello, I am working on a SAAS based project for which I need to send emails to different clients on different events. I am using email templates which use tokens (in format {{.TOKENNAME}}) that are made dynamic while sending emails. Now these token are parsed by using "html/template" package.

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread prades . marq
> Eliminating code duplication shrinks the base of code that must be changed Except go was designed a certain way that will make whatever you are attempting to do here burdensome. We've all been there at first trying to fit a square into a round hole, it doesn't work. Unless you start ignoring