[go-nuts] Re: [ANN] Go Jupyter kernel and an interactive REPL

2018-01-16 Thread Glen Newton
Wow! This is great and positions Go better in the 'data science' world! Thanks, Glen On Tuesday, January 16, 2018 at 8:53:39 AM UTC-5, Yu Watanabe wrote: > > Hi Gophers, > > I developed a new Go's Jupyter Notebook kernel and > REPL environment. > I would like to announce it

[go-nuts] Re: Effective Go recommends reading the language specification first

2018-01-16 Thread Volker Dobler
On Wednesday, 17 January 2018 06:51:34 UTC+1, Matt McClure wrote: > > It strikes me as odd that Effective Go recommends reading the language > specification first. > > "This document gives tips for writing clear, idiomatic Go code. It > augments the language specification, the Tour of Go, and How

Re: [go-nuts] Effective Go recommends reading the language specification first

2018-01-16 Thread Ian Lance Taylor
On Tue, Jan 16, 2018 at 6:40 PM, wrote: > > It strikes me as odd that Effective Go recommends reading the language > specification first. > > "This document gives tips for writing clear, idiomatic Go code. It augments > the language specification, the Tour of Go, and How to Write Go Code, all of

Re: [go-nuts] Re: where is the implementation of `getg`?

2018-01-16 Thread gansteed
thanks Ian Lance Taylor 于2018年1月17日周三 上午9:53写道: > On Tue, Jan 16, 2018 at 5:51 PM, Dave Cheney wrote: > > A long time ago getg was written in assembly in the runtime package. > These > > days it is implemented directly as pseudo instruction in the compiler. > > Search for OpGetG in $GOROOT/src/c

[go-nuts] Effective Go recommends reading the language specification first

2018-01-16 Thread matthew
It strikes me as odd that Effective Go recommends reading the language specification first. "This document gives tips for writing clear, idiomatic Go code. It augments the language specification, the Tour of Go, and How to Write Go Code, all of which you should read first." Is that really good

Re: [go-nuts] Re: where is the implementation of `getg`?

2018-01-16 Thread Ian Lance Taylor
On Tue, Jan 16, 2018 at 5:51 PM, Dave Cheney wrote: > A long time ago getg was written in assembly in the runtime package. These > days it is implemented directly as pseudo instruction in the compiler. > Search for OpGetG in $GOROOT/src/cmd/compile/internal Yes. The simplest way to see the gener

[go-nuts] Re: where is the implementation of `getg`?

2018-01-16 Thread Dave Cheney
A long time ago getg was written in assembly in the runtime package. These days it is implemented directly as pseudo instruction in the compiler. Search for OpGetG in $GOROOT/src/cmd/compile/internal On Wednesday, 17 January 2018 12:40:48 UTC+11, Jiajun Huang wrote: > > Hi, all: > > I'm rea

[go-nuts] where is the implementation of `getg`?

2018-01-16 Thread Jiajun Huang
Hi, all: I'm reading golang runtime implementation, I've got a function definition: // getg returns the pointer to the current g. // The compiler rewrites calls to this function into instructions // that fetch the g directly (from TLS or from the dedicated register). func getg() *g So

[go-nuts] Re: How to make a TSV processing Go program that beats awk and even cut in terms of runtime?

2018-01-16 Thread Dave Cheney
> Could anybody let me know what is wrong with my go program and how to make it run faster? Stop using gorun. You're timing how long it takes to compile, link, and then run your program. On Wednesday, 17 January 2018 07:18:47 UTC+11, peng...@gmail.com wrote: > > Hi, > > I made the following Go

[go-nuts] How to make a TSV processing Go program that beats awk and even cut in terms of runtime?

2018-01-16 Thread Tamás Gulácsi
Don't convert ti string if you hae byte slice (scanner.Bytes). Buffer your output, too: w:=bufio.NewWriter(os.Stdout) w.Write(...) w.WriteByte('\n') -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivi

Re: [go-nuts] Where is the help page of range in go doc?

2018-01-16 Thread Ian Lance Taylor
On Tue, Jan 16, 2018 at 9:05 AM, wrote: > > I don't fine the help page of `range`. Does anybody if there is a way to > find it with `go doc`? > > $ go doc range > doc: /Users/xxx/linux/test/golang/lang/import/strings/Split/main.go:1:1: > illegal character U+0023 '#' > exit status 1 `go doc` is u

[go-nuts] How to make a TSV processing Go program that beats awk and even cut in terms of runtime?

2018-01-16 Thread pengyu . ut
Hi, I made the following Go program (main.go). But it is still slower than awk or cut. I know that `cut` uses string manipulation tricks to make it run very efficiently. https://github.com/coreutils/coreutils/blob/master/src/cut.c But I am not sure how to do the same thing in golang. Could any

[go-nuts] Where is the help page of range in go doc?

2018-01-16 Thread pengyu . ut
I don't fine the help page of `range`. Does anybody if there is a way to find it with `go doc`? $ go doc range doc: /Users/xxx/linux/test/golang/lang/import/strings/Split/main.go:1:1: illegal character U+0023 '#' exit status 1 -- You received this message because you are subscribed to the Goo

Re: [go-nuts] Go as your first language

2018-01-16 Thread matthewjuran
Here's an experience report on teaching new programmers with Go: http://www.monogrammedchalk.com/go-2-for-teaching/ On Tuesday, January 16, 2018 at 8:42:34 AM UTC-6, matthe...@gmail.com wrote: > > From my experience: > > Expecting somebody at 0 to become a software engineer via coursework or a >

Re: [go-nuts] therecipe/qt error from uitools

2018-01-16 Thread Justin Israel
On Tue, Jan 16, 2018, 12:41 PM rob wrote: > Hi. I'm interested in learning about therecipe/qt. > > I followed the instructions for the docker image. After running > qtsetup, I got an error that uitools failed to install. > > I don't know where to start, or if it even matters? > > Thx > What ab

[go-nuts] Re: Writing correct response writer wrappers

2018-01-16 Thread matthewjuran
The type switch may not work since these http types are interfaces that may all be satisfied by the ResponseWriter. Instead of a type switch you would need to do a type assertion for each possible http interface. Matt On Tuesday, January 16, 2018 at 9:01:28 AM UTC-6, matthe...@gmail.com wrote:

[go-nuts] Re: Writing correct response writer wrappers

2018-01-16 Thread matthewjuran
Can you provide some example code showing the problem? I don’t understand why you are wrapping the ResponseWriter. If you need to pass along metadata then wrapping makes sense, but why not just pass the original interface and do the type switch in each handler? type RetryResponseWriter struct {

Re: [go-nuts] Go as your first language

2018-01-16 Thread matthewjuran
>From my experience: Expecting somebody at 0 to become a software engineer via coursework or a book doesn’t seem reasonable to me. There’s at least a couple years of mentorship and experience required just for the baseline. JS or Go can get you far without knowing about stack traces, processor

Re: [go-nuts] Re: Update your code if you use golang.org/x/crypto/acme/autocert

2018-01-16 Thread alex
You can keep using your own "redirector": m.HTTPHandler(http.HandlerFunc(myRedirector)) The one provided by autocert package is just a handy default, especially for those who didn't need to serve on port 80 before. On 16 January 2018 at 15:12, oldCoderException wrote: > I haven't had a chance

Re: [go-nuts] Go as your first language

2018-01-16 Thread Ayan George
On 01/16/2018 02:10 AM, James Pettyjohn wrote: > > Are there tracks of knowledge to take someone from 0 to understanding > baseline knowledge? > > And from there through taking them to a professional grade standard? > I think "Introducing Go" is a great book for someone relatively new to prog

[go-nuts] Re: Go as your first language

2018-01-16 Thread Kevin Powick
I've had good feedback from colleagues on the following course. https://appliedgo.com/p/mastergo There are also the usual reference at golang.org such as "Effective Go", the on-line introduction, and the language spec itself. -- Kevin Powick On Tuesday, 16 January 2018 02:10:48 UTC-5, James P

[go-nuts] Re: Update your code if you use golang.org/x/crypto/acme/autocert

2018-01-16 Thread oldCoderException
I haven't had a chance to delve into this much yet, but for those of us who already have a "redirector" setup on port 80 to redirect ALL non-SSL traffic over to port 443 won't this introduce a problem? Or I suppose we could implement said redirection in the fallback handler, ditching the one w

[go-nuts] [ANN] Go Jupyter kernel and an interactive REPL

2018-01-16 Thread Yu Watanabe
Hi Gophers, I developed a new Go's Jupyter Notebook kernel and REPL environment. I would like to announce it to golang users and hear feedback about it. https://github.com/yunabe/lgo - Go (golang) Jupyter Notebook kernel and an interactive REPL

[go-nuts] Writing correct response writer wrappers

2018-01-16 Thread Marco Jantke
Hi everyone, I am currently working on a retry middleware for an http proxy. It is wrapping the original response writer and only in case the forwarded request should not be retried, it passes calls to `Write()`, `WriteHeader()` etc directly through to the original response writer. Now I am s

Re: [go-nuts] why can't change map when in for range statements?

2018-01-16 Thread Marvin Renich
* sheepbao [180115 21:24]: > I wrote this code, and why `map=nil` don't stop the loop? > > func mapTest() { > for k, v := range m { > println(k, v) > m = nil > } > } > > output: > > 1 1 > > 2 2 > > I don't understand when I set `m = nil`, the loop is not stop. m doesn

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Tad Vizbaras
I used "walk" for prototyping but found it too complex. I do not mean this as criticism. "walk" uses many closures to init controls and get GUI working. This is fine if you are into this style of programming. I find reading "walk" internal code challenging. "walk" was an inspiration. It is possi

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Egon
On Tuesday, 16 January 2018 14:27:44 UTC+2, Tad Vizbaras wrote: > > OCR project started 2 years ago. Then there was no usable exp/shiny. > That makes sense. Although walk, libui, qml are all older than 2 years. > I still think that GUI frameworks for Go are in baby stages even today. > Total

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Tad Vizbaras
OCR project started 2 years ago. Then there was no usable exp/shiny. I still think that GUI frameworks for Go are in baby stages even today. Why would I resort to some C libraries when "syscall" works with Windows API well? On Tuesday, January 16, 2018 at 3:45:22 AM UTC-5, Egon wrote: > > As

Re: [go-nuts] Measuring low latency operations

2018-01-16 Thread asaaveri
- I will look into median and for some visual display of the data - Good advice on looking into median and using the benchmarking tool. - I run on virtualized servers but don't know at this point if it is affecting my data. On Monday, January 15, 2018 at 10:04:11 AM UTC-5, Jespe

Re: [go-nuts] how about golang channel memory usage?

2018-01-16 Thread Jan Mercl
On Tue, Jan 16, 2018 at 7:52 AM Lynn H wrote: > but how about res memory usage? how RES memory used in golang? Most process allocations typically do not care about the virtual memory being immediately mapped to physical RAM. The operating systems takes care about that usually only after a virtua

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Egon
As for getting andlabs/ui compiling the easiest I've found is to use msys2... i.e. installation from scratch: 1. http://www.msys2.org/ 2. open msys shell 3. pacman -Syu 3.1 close from X 4. pacman -Su 5. pacman -S mingw-w64-x86_64-go 6. pacman -S --needed base-devel mingw-w64-i686-toolchain min

[go-nuts] Re: Experience Report building OCR in Go

2018-01-16 Thread Egon
Not sure why you had to build a GUI separately, there are already a few libs, although some of them are still barebones... https://github.com/lxn/walk https://github.com/andlabs/ui Of course there are also bindings for gtk and qt. On Monday, 15 January 2018 22:32:33 UTC+2, Tad Vizbaras wrote: >

Re: [go-nuts] Experience Report building OCR in Go

2018-01-16 Thread Sebastien Binet
On Tue, Jan 16, 2018 at 7:09 AM, Kevin Malachowski wrote: > Not sure about the GUI points: exp/shiny has worked really well for me and > has existed for at least a year. I do admit that 4 years ago I tried my > hand at a GUI framework for Go though... > beside being a bit barebone (shiny isn't a