Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread Louki Sumirniy
https://stackoverflow.com/questions/6531543/efficient-implementation-of-binary-heaps Pretty much what I'm working on here is this, except with left to right sort instead of vertical. I think this guy's work will help me iron out the performance issues. Another thing, that is more on topic more

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread roger peppe
On 25 April 2018 at 08:05, Louki Sumirniy wrote: > https://stackoverflow.com/questions/6531543/efficient-implementation-of-binary-heaps > > Pretty much what I'm working on here is this, except with left to right sort > instead of vertical. I think this guy's work

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread Louki Sumirniy
I think that it's not necessarily non-idiomatic to use closures instead of interfaces in Go, it's more that Go has had interfaces longer than it's had closures, and so more code has been written this way. In Angular 2+ you have the option of embedding HTML, CSS and TS code inside one file, or

[go-nuts] Tcp connection reset

2018-04-25 Thread Binu Ps
below code i am trying to reset the tcp connection which coming from 192.168.1.3 address, now its not working its not resetting the connection , anythink wrong in my source code ? please help package main import ( "fmt" "time" "github.com/google/gopacket"

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread Bakul Shah
Roger is right. A heap can be a good structure for a priority queue but not for search. That is because it is partially ordered and siblings are not in any sorted order. In any case heaps are typically implemented with a vector. Go already has a pkg for it. go doc heap. Seems like you’re doing

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread Louki Sumirniy
As you look deeper into the link discussing the B-heap you can see that actually I am pretty much exactly following the same general structure in my algorithm. The structure will align neatly with page boundaries and that means less page faults and reduced pressure on the virtual memory mapping

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread roger peppe
On 25 April 2018 at 10:08, Louki Sumirniy wrote: > I think that it's not necessarily non-idiomatic to use closures instead of > interfaces in Go, it's more that Go has had interfaces longer than it's had > closures, and so more code has been written this way.

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread roger peppe
On 25 April 2018 at 10:24, Louki Sumirniy wrote: > As you look deeper into the link discussing the B-heap you can see that > actually I am pretty much exactly following the same general structure in my > algorithm. The structure will align neatly with page

Re: [go-nuts] go's memory model for unbuffered channels

2018-04-25 Thread threebearsdan
So it always guarantees to print "hello world" for the unbuffered channel, doesn't it? package main *var c = make(chan int)* var a string func f() { a = "hello, world" *c <- 0* } func main() { go f() *<-c* print(a) } it will guarantee to print "hello, world". package

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread matthewjuran
> > I worked for a little while on the C++ server application for the Steem > network node, and I was intending to remove a whole swathe of code relating > to protocol changes at various hard forks. The number of times I ran across > poorly ordered if/then (not even using switch!) that would

Re: [go-nuts] go's memory model for unbuffered channels

2018-04-25 Thread Ian Lance Taylor
On Wed, Apr 25, 2018 at 2:27 AM, wrote: > > So it always guarantees to print "hello world" for the unbuffered channel, > doesn't it? > > package main > var c = make(chan int) > var a string > > func f() { > a = "hello, world" > c <- 0 > } > > func main() { >

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread Louki Sumirniy
Always the elements are inserted according to greater than and less than. equal can't happen. The first value inserted will be the root to begin with, but if the tree gets heavy on one side, you rotate the root to rebalance. from any given node, you know that you will find the element you are

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-25 Thread Andy Balholm
So it sounds like the AGPL is a good license to choose if you want to keep your code from being used by big companies… ;-) > On Apr 25, 2018, at 8:48 AM, 'David Chase' via golang-nuts > wrote: > > > > On Tuesday, April 24, 2018 at 10:45:35 AM UTC-4,

[go-nuts] Isn't it a good idea to allow "local import" internal packages, even if the internal pacakges are located under GOPATH/src?

2018-04-25 Thread T L
However, now this is forbidden. -- 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

Re: [go-nuts] Type func binding and interfaces

2018-04-25 Thread matthewjuran
> > Any code that keeps data aligned to memory page and disk page sizes is > automatically significantly faster, because misalignment automatically > doubles the amount of memory that has to be accessed to satisfy a request. > This is why Binary Heaps are way slower than B-heaps. My opinion

Re: [go-nuts] Go list returning directory starting with underscore on Ubuntu

2018-04-25 Thread rungta via golang-nuts
Not accurate. $ cat ~/code/scratch/repro-underscore-issue.sh echo "GOPATH: $GOPATH" mkdir -p $GOPATH/src/github.com/testcase/testdata echo "package testdata" > $GOPATH/src/github.com/testcase/testdata/testdata.go echo "" >> $GOPATH/src/github.com/testcase/testdata/testdata.go cd

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-25 Thread 'David Chase' via golang-nuts
On Tuesday, April 24, 2018 at 10:45:35 AM UTC-4, matthe...@gmail.com wrote: > > I’m curious if some companies juggle the GPL. I guess if the app is used > internally only then there’s no problem with accidentally requiring a > proprietary program to be released as source code to the world. I’d

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-25 Thread matthewjuran
> > So it sounds like the AGPL is a good license to choose if you want to keep > your code from being used by big companies… ;-) If your project is secret software with a public network interface then don’t apply the AGPL to it. That’s not the only kind of software used at big companies.

Re: [go-nuts] using ginkgo

2018-04-25 Thread Keith Brown
thank for the response John. My intention is to run integration test where I specify my test in english (acceptance test driven tests). I dont mind generating the binary but I would like to use the binary to test components such as. 1) if the web server is alive. 2) if a certain url gives me a