[go-nuts] go get failed showing unrecognised import path

2016-07-11 Thread 刘晓明Frank
I am trying to build a websocket-based signaling server in Go called in Collider . I followed the guide in github/webrtc/apprtc/collider The command go get collidermain doesn't work and shows that: package collidermain: unrecognized import path "collidermain" I tried the methods others come up wi

[go-nuts] How to make bootstrap style reflect on golang template

2016-07-11 Thread babsake
i have been having major issues making bootstrap style reflect on my html/template output and i'm wondering if there's any other way to go about this. my code below INDEX.HTML {{define "head"}}Dead Or Injured {{end}} {{define

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 4:40 PM, Erich Rickheit KSC wrote: > Ian Lance Taylor wrote: >> On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC >> wrote: >> > I found myself writing code like this: >> > >> > s := make([]byte, len) >> > for i := 0; i < len; i++ { >> > /

[go-nuts] Re: HTML templating and escaping.

2016-07-11 Thread yzha...@linkernetworks.com
Well, I cannot open the go play link now. Forbidden. So, would please review on this question and show me the code again? yzha...@linkernetworks.com -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Matt Harden
On Mon, Jul 11, 2016 at 5:41 PM Erich Rickheit KSC wrote: > Ian Lance Taylor wrote: > > On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC > wrote: > > > I found myself writing code like this: > > > > > > s := make([]byte, len) > > > for i := 0; i < len; i++ { > > >

[go-nuts] [ANN] Camerata, a server orchestration tool v1.3.0 (Rigby)

2016-07-11 Thread Diego Cena
Hi! I'm happy to announce a new release of *camerata* 1.3.0 (codename Rigby) *camerata* is a simple and easy to use server orchestration set of tools made with love and golang. Binaries: https://github.com/diegohce/camerata/releases/latest

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Erich Rickheit KSC
Ian Lance Taylor wrote: > On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC > wrote: > > I found myself writing code like this: > > > > s := make([]byte, len) > > for i := 0; i < len; i++ { > > // fill in s with stringy goodness > > } > > return st

Re: [go-nuts] Re: Can I convert bytes.Buffer object to a string, and vice-versa ?

2016-07-11 Thread Dan Kortschak
I think a key word in the question is "original". Depending on how that is intended the answer is either "no" (unless unsafe is used with a whole heap of rigmarole) or "yes" with something along the lines of the playground link here (though note that bytes.Buffer has a String() string method). On

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 1:25 PM, wrote: > Ohh that slow gcc. Sad. The GC in general is quite fast. If you have specific examples where the GC does poorly, please open issues for them with test cases. Thanks. Ian > понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance Taylor

[go-nuts] [ANN] Vermeer - physically based rendering (raytracing) with Go

2016-07-11 Thread Jamie Clarkson
Hi, I'd just like to announce a little project I've just released into alpha. It's a physically based renderer written in Go. You can install Vermeer via go get github.com/jamiec7919/vermeer There are some example data files available at: https://github.com/jamiec7919/vermeer-example/ And p

Re: [go-nuts] Improvement in text/template/parse/lex.go

2016-07-11 Thread Rob Pike
Seems reasonable (although I must add that if you have a situation where the overhead of lexing your templates is significant, you must be doing something odd). Feel free to send a CL. -rob On Mon, Jul 11, 2016 at 1:28 PM, 'Paul Borman' via golang-nuts < golang-nuts@googlegroups.com> wrote: > H

Re: [go-nuts] Improvement in text/template/parse/lex.go

2016-07-11 Thread 'Paul Borman' via golang-nuts
Here are a set of results using benchcmp. I also included a new benchmark, the code from example_test.go that executes a template 3 times with different input. The template is: Dear {{.Name}}, {{if .Attended}} It was a pleasure to see you at the wedding. {{- else}} It is a shame you couldn't mak

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Ohh that slow gcc. Sad. понедельник, 11 июля 2016 г., 23:03:07 UTC+3 пользователь Ian Lance Taylor написал: > > On Mon, Jul 11, 2016 at 9:11 AM, > > wrote: > > Thank for answer but I'm already implemented portable unmanaged memory > pool > > (https://github.com/ardente/goal/blob/master/g

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 9:11 AM, wrote: > Thank for answer but I'm already implemented portable unmanaged memory pool > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just > looking for standard direct analogue (incliding mapping of fd -1) of unix's > syscall.Mmap for windows.

Re: [go-nuts] Re: Improvement in text/template/parse/lex.go

2016-07-11 Thread 'Paul Borman' via golang-nuts
Yes, you are correct, if the template is only {{}}'s with no text then there is no benefit, but no penalty, either (i.e., no down side in performance). Once there is any reasonable amount of text (as all templates I have written are), the speed up is noticeable. -Paul On Mon, Jul 11, 2016 at

[go-nuts] Re: Improvement in text/template/parse/lex.go

2016-07-11 Thread sphilippov
1ms = 100ns. According to *Many results there is no gain. понедельник, 11 июля 2016 г., 22:27:47 UTC+3 пользователь Paul Borman написал: > > I was looking at text/template/parse/lex.go and noticed it seemed to be > very inefficient in how it searched for {{ in its input. I rewrote lexText

[go-nuts] Improvement in text/template/parse/lex.go

2016-07-11 Thread 'Paul Borman' via golang-nuts
I was looking at text/template/parse/lex.go and noticed it seemed to be very inefficient in how it searched for {{ in its input. I rewrote lexText to us strings.Index rather than calling l.next() for every single rune in the string. The results were up to a 9x speed improvement, depending on the

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Exactly. I don't know why I was misunderstood because topic title is "How to allocate memory from OS..." and in the first message I mentioned VirtualAllloc and mmap is used to obtain memory from os instead of sbrk in most unix clibs. About discussion - I think patch implementing syscall.Mmap on

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Konstantin Khomoutov
On Mon, 11 Jul 2016 09:11:14 -0700 (PDT) sphilip...@gmail.com wrote: > Thank for answer but I'm already implemented portable unmanaged > memory pool > (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm > just looking for standard direct analogue (incliding mapping of fd > -1) of uni

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Richard Todd
There are places throughout the standard packages where extra copies happen due to []byte <-> string conversion (like strings.Join(), os.*File.WriteString() etc.) I am assuming they don't use an unsafe-magic way to make aliasing strings and []bytes because they don't want people to shoot them

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Manlio Perillo
On Mon, Jul 11, 2016 at 3:28 PM, Ian Lance Taylor wrote: > On Mon, Jul 11, 2016 at 3:49 AM, Manlio Perillo > wrote: >> Il giorno domenica 10 luglio 2016 04:51:21 UTC+2, Ian Lance Taylor ha >> scritto: >>> >>> On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC >>> wrote: >>> > I found myself writ

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Thank for answer but I'm already implemented portable unmanaged memory pool (https://github.com/ardente/goal/blob/master/gut/mempool.go). I'm just looking for standard direct analogue (incliding mapping of fd -1) of unix's syscall.Mmap for windows. Looks like there is none. There is some rationa

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Konstantin Khomoutov
On Mon, 11 Jul 2016 00:07:11 -0700 (PDT) sphilip...@gmail.com wrote: > I can allocated memory from OS using syscall.Mmap(-1...) on Unix and > VirtualAlloc on Windows. But may be there is standard and compatible > way to do this? There are none, and I'm pretty sure there simply can't be any: this

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Thanks for info but I'm looking for standard way (package from runtime library or from golang.org/x). I'm already have a custom VAlloc/VFree implementation for windows and unix and now curious is there a standard way that I missed. > I unable to find standard mmap for windows in Go library, tha

[go-nuts] Re: Redis / Gin Framework Performance Issue

2016-07-11 Thread desaiabhijit
Thanks very much **Point 1 - Are you discarding Gin's log output? Writing stderr/stdout *to a terminal *can be a major bottleneck. //Gin Code - Simply gin.Default() replaced with for your 1st point - no logs r := gin.New() and simply getting 82k req / sec :-) Now will check other 3 points htt

Re: [go-nuts] Failure to go build -race with alpine and musl libc (__libc_malloc undefined)

2016-07-11 Thread Peter Waller
On 11 July 2016 at 15:30, Ian Lance Taylor wrote: > > If you just want to focus on Go, don't build the race detector. It > looks like you are running the command `go install -v -race .`. Don't > do that. This tickles me :). The whole point of course was that I want the race detector. Sadly my

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Jan Mercl
On Mon, Jul 11, 2016 at 4:37 PM wrote: > I unable to find standard mmap for windows in Go library, that was originial question. Use case is processing of large (several millions of nodes) trees. I have not used it yet: https://github.com/edsrzf/mmap-go -- -j -- You received this message bec

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
I unable to find standard mmap for windows in Go library, that was originial question. Use case is processing of large (several millions of nodes) trees. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop re

Re: [go-nuts] Failure to go build -race with alpine and musl libc (__libc_malloc undefined)

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 6:57 AM, Peter Waller wrote: > Thanks Ian. No luck though, that doesn't seem to be it. > > I have rebuilt the race detector .syso as mentioned in the README. > > I get the same error as before (below, again) while building the > runtime/race package, during `./race.bash`. (

[go-nuts] Re: Redis / Gin Framework Performance Issue

2016-07-11 Thread Matt Silverlock
Questions: - Are you discarding Gin's log output? Writing stderr/stdout *to a terminal *can be a major bottleneck. - I can't see where you've allowed more ephemeral ports? By default it's around ~28k ephemeral ports on most Linux distros; you may wish to increase this. - On a

Re: [go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread Sam Whited
On Mon, Jul 11, 2016 at 2:07 AM, wrote: > I can allocated memory from OS using syscall.Mmap(-1...) on Unix and > VirtualAlloc on Windows. But may be there is standard and compatible way to > do this? In general, the Go philosophy is that the runtime handles memory allocation and this isn't somet

Re: [go-nuts] Re: Can I convert bytes.Buffer object to a string, and vice-versa ?

2016-07-11 Thread Sam Whited
On Mon, Jul 11, 2016 at 7:16 AM, C Banning wrote: > https://play.golang.org/p/BmKQTewR9w No need to do string(b.Bytes()); buffer satisfies the fmt.Stringer interface: https://godoc.org/bytes#Buffer.String —Sam -- Sam Whited pub 4096R/54083AE104EA7AD3 https://blog.samwhited.com -- You recei

Re: [go-nuts] Failure to go build -race with alpine and musl libc (__libc_malloc undefined)

2016-07-11 Thread Peter Waller
Thanks Ian. No luck though, that doesn't seem to be it. I have rebuilt the race detector .syso as mentioned in the README . I get the same error as before (below, again) while building the runtime

Re: [go-nuts] Send us your gophers!

2016-07-11 Thread 'Andrew Gerrand' via golang-nuts
https://twitter.com/enneff/status/752497537186091009 On 21 June 2016 at 03:30, Jan Mercl <0xj...@gmail.com> wrote: > On Sat, May 21, 2016 at 8:28 AM 'Andrew Gerrand' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > > > Renee French and I are doing a little secret project and would love

Re: [go-nuts] Failure to go build -race with alpine and musl libc (__libc_malloc undefined)

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 6:04 AM, Peter Waller wrote: > > I'm guessing the answer to this one is "use glibc", but I can't find any > existing commentary on this in within the go ecosystem and thought it was > worth a quick shot in case there is a fix. I'm aware that tsan and glibc are > fairly well

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Ian Lance Taylor
On Mon, Jul 11, 2016 at 3:49 AM, Manlio Perillo wrote: > Il giorno domenica 10 luglio 2016 04:51:21 UTC+2, Ian Lance Taylor ha > scritto: >> >> On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC >> wrote: >> > I found myself writing code like this: >> > >> > s := make([]byte, len) >> >

[go-nuts] Failure to go build -race with alpine and musl libc (__libc_malloc undefined)

2016-07-11 Thread Peter Waller
Hi All, I'm guessing the answer to this one is "use glibc", but I can't find any existing commentary on this in within the go ecosystem and thought it was worth a quick shot in case there is a fix. I'm aware that tsan and glibc are fairly well intermingled, so probably requires a lot of work possi

[go-nuts] GopherCon Denver 2016 will be livestreamed on Twitch

2016-07-11 Thread Florin Pățan
See it here: https://www.twitch.tv/gophercon -- 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 htt

[go-nuts] Re: Can I convert bytes.Buffer object to a string, and vice-versa ?

2016-07-11 Thread C Banning
https://play.golang.org/p/BmKQTewR9w On Monday, July 11, 2016 at 6:06:12 AM UTC-6, Mayank Jha wrote: > > Can I convert bytes.Buffer object to a string, and vice-versa , getting > the original bytes.Buffer object back from the string ? > -- You received this message because you are subscribed to

[go-nuts] Can I convert bytes.Buffer object to a string, and vice-versa ?

2016-07-11 Thread Mayank Jha
Can I convert bytes.Buffer object to a string, and vice-versa , getting the original bytes.Buffer object back from the string ? -- 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, sen

[go-nuts] Re: Make a multi part request from a stringified body payload

2016-07-11 Thread Mayank Jha
But, I don't want to store it separately. b, _ := ioutil.ReadAll(r.Body) r.Body = ioutil.NopCloser(bytes.NewBuffer(b)) if len(b) > 0 { if err := json.Compact(body, b); err != nil { body = bytes.NewBuffer(b) } } The abov

Re: [go-nuts] confused about string allocation

2016-07-11 Thread Manlio Perillo
Il giorno domenica 10 luglio 2016 04:51:21 UTC+2, Ian Lance Taylor ha scritto: > > On Sat, Jul 9, 2016 at 4:38 PM, Erich Rickheit KSC > wrote: > > I found myself writing code like this: > > > > s := make([]byte, len) > > for i := 0; i < len; i++ { > > // fill

Re: [go-nuts] Extracting table data out of PDFs

2016-07-11 Thread Sankar P
2016-07-11 15:34 GMT+05:30 Sankar P : >> I don't know if it does what you want, but have you looked at >> https://godoc.org/rsc.io/pdf ? > > It seems to be unmaintained. I tried loading a complex PDF with plenty > of tables and it hung infinitely on Content() call in the first page. > I lost intere

Re: [go-nuts] Extracting table data out of PDFs

2016-07-11 Thread Sankar P
Using pdftohtml and then using regexes or parser on top, seem to be the easiest solution as of now. I came across tabula-java which also seems interesting. Thank you everyone for the recommendations. I've still not got multiple tables in a single page or tables over-flowing across pages working cor

Re: [go-nuts] Extracting table data out of PDFs

2016-07-11 Thread Sankar P
> I don't know if it does what you want, but have you looked at > https://godoc.org/rsc.io/pdf ? It seems to be unmaintained. I tried loading a complex PDF with plenty of tables and it hung infinitely on Content() call in the first page. I lost interest after that. Thanks. -- Sankar P http://ps

Re: [go-nuts] which approach to appending a slice to another slice by creating a new slice look best to you?

2016-07-11 Thread Jan Mercl
On Mon, Jul 11, 2016 at 6:05 AM Anmol Sethi wrote: > https://gist.github.com/nhooyr/7b773ea98f0d08e698d4fe706b4f5b2a Definitely the builtin append wins for me as it does not have worst O(n^2) performance, which should be avoided whener possible. -- -j -- You received this message because you

[go-nuts] Re: which approach to appending a slice to another slice by creating a new slice look best to you?

2016-07-11 Thread Val
I like 1. It's straight to the point, has no hidden costs, and doesn't inherit the subtlety of built-in "append". On Monday, July 11, 2016 at 6:06:03 AM UTC+2, Anmol Sethi wrote: > > https://gist.github.com/nhooyr/7b773ea98f0d08e698d4fe706b4f5b2a > -- You received this message because you are

[go-nuts] Re: Redis / Gin Framework Performance Issue

2016-07-11 Thread desaiabhijit
Hi Matt Thanks for the reply Test is done on different server on the same network Application using "gopkg.in/redis.v3" as plugin so TCP Pool size = 10 Below is the simple program storing "Hello World" small data compare to what I use to store in my actual application where Redis not even

[go-nuts] How to allocate memory from OS in compatible way.

2016-07-11 Thread sphilippov
Hi dear gophers! I can allocated memory from OS using syscall.Mmap(-1...) on Unix and VirtualAlloc on Windows. But may be there is standard and compatible way to do this? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this