[go-nuts] Re: Can I use ... in switch? (example inside)

2016-07-27 Thread Val
Like the Playground probably told you ... no. What are you trying to achieve? There are several valid ways to use switch , depending whether each case is a condition, or a value, or a type. Cheers Val On Wednesday, July 27, 2016 at 5:02:33 AM UTC+

[go-nuts] Speeding up multiple regexp matches

2016-07-27 Thread Raj
Not specific to golang. Incidentally I am using go to develop this particular tool. I have a piece of text that I want to test against a large number of regular expressions, where a different action is taken based on which regexps successfully matched. The naive approach is to loop through each

[go-nuts] Re: Can I use ... in switch? (example inside)

2016-07-27 Thread Val
Oh, I just understood after posting, sorry : "case a..." would mean "is 1 an element of a", just like if we had written "case 0, 1, 2, 3, 4, 5". It is still afaik not an allowed syntax. To achieve something equivalent, I would have to use a helper func : https://play.golang.org/p/IUqQKjKuHb On W

[go-nuts] Re: Speeding up multiple regexp matches

2016-07-27 Thread Val
How many is a large number M of regexps? Are the regexps complex, are you trying to capture groups (parenthesized subexpressions)? Are the regexps long, and are they similar? It may be the case that the naive approach is already the most efficient for your use case. It is also possible that the

Re: [go-nuts] Who wants to use Go to process your camera's raw files?

2016-07-27 Thread Peter Herth
Hi Jonathan, I think its an excellent idea, and would be possibly interested to contribute. I am not really familiar with libraw, but there would be quite some good reasons to have a pure Go version, as long as not too much work is duplicated: - a pure Go might have cleaner code and be easier to h

[go-nuts] Re: Speeding up multiple regexp matches

2016-07-27 Thread Raj
- There are more than 10,000 regexps. - I need to do this task on ~ 800 million strings having max length 1KB each, and this number growing daily. - Currently regular expressions are simple. It's actually what MS SQL Server like operator supports. i.e. "_%[]^". See https:/

[go-nuts] Re: Speeding up multiple regexp matches

2016-07-27 Thread Raj
Is it possible to build an NFA/DFA from a list of regular expressions which can give the desired result i.e. list of regexps which matched the input string? Are there any existing libs for this? Do anybody konwof any existing algos for it, which I can use to implement it? -- You received this

[go-nuts] Re: Speeding up multiple regexp matches

2016-07-27 Thread Egon
If the regexps aren't dynamic then Ragel (http://www.colm.net/open-source/ragel/). There's https://github.com/BurntSushi/rure-go, which might work better than Go-s regexp. There might be interesting approaches depending on the regexp and input data. Also, show example data and some regexps tha

[go-nuts] Re: Multi Variable Linear Regression (with r squared and p values)

2016-07-27 Thread Jason E. Aten
https://github.com/glycerine/zettalm will do your regression and then give you t-statistics. For example: https://github.com/glycerine/zettalm/blob/master/big_test.go#L158 To convert the t-stat to a p-value, use the complement of the error-function, a.k.a Erfc https://golang.org/pkg/math/#Erfc

Re: [go-nuts] Re: Speeding up multiple regexp matches

2016-07-27 Thread Ganbold Tsagaankhuu
Maybe try Hyperscan? https://github.com/flier/gohs On Wed, Jul 27, 2016 at 7:31 PM, Egon wrote: > If the regexps aren't dynamic then Ragel ( > http://www.colm.net/open-source/ragel/). > There's https://github.com/BurntSushi/rure-go, which might work better > than Go-s regexp. > > There might be

Re: [go-nuts] Who wants to use Go to process your camera's raw files?

2016-07-27 Thread simran
+1, i'd be keen to contribute to a native go library too... -- sent from my phone On 27 Jul 2016 7:50 pm, "Peter Herth" wrote: > Hi Jonathan, > > I think its an excellent idea, and would be possibly interested to > contribute. I am not really familiar with libraw, but there would be quite > som

[go-nuts] Re: Calling go functions from command line

2016-07-27 Thread Jason E. Aten
On Thursday, July 21, 2016 at 2:14:04 PM UTC-5, christ...@google.com wrote: > > ...and we can run C functions from command line. > Not that I'm aware of. It's not clear what you are thinking of here. > Are we able to call Go functions directly from command line? > If you compile in https://g

[go-nuts] Open Source development kit Written in Go-lang

2016-07-27 Thread mayyuen318
Our team has written and used Skygear internally since last year. We did use Parse before but we were disappointed by its performance. And thus we built our own backend as a service and recently launched at an open source conference. We would love to hear more comment from you and make it a

[go-nuts] first program, game of life in go

2016-07-27 Thread Carl Ranson
HI all, So I figured Conways game of life would be a good exercise to get my feet wet with go. Specifically i wanted to make the calculation of the next board state to be concurrent. I started a separate goroutine for each cell and then used a pair of channels to synchronize updating to the

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Egon
On Wednesday, 27 July 2016 15:14:13 UTC+3, Carl Ranson wrote: > > > HI all, > > So I figured Conways game of life would be a good exercise to get my feet > wet with go. Specifically i wanted to make the calculation of the next > board state to be concurrent. > I started a separate goroutine for

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-27 Thread Andy Balholm
in github.com/andybalholm/redwood , one thing I do is to check each URL against a (potentially very large) set of regular expressions. Since these regular expressions generally contain fairly significant amounts of literal text, I analyze each regular expre

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-27 Thread Caleb Spare
On Wed, Jul 27, 2016 at 9:42 AM, Andy Balholm wrote: > in github.com/andybalholm/redwood, one thing I do is to check each URL > against a (potentially very large) set of regular expressions. Since these > regular expressions generally contain fairly significant amounts of literal > text, I analyz

[go-nuts] Re: [ANN] Configuration library

2016-07-27 Thread Gerardo Oscar JT
Oh my gosh! There are dozens of 'goconfig' projects at github and hundreds of 'configo' projects. This is crazy. I have been looking at some of them and probably fulldump/goconfig has the best logo :) And also it is the most generic and simpler one with default values > json values > cli values

[go-nuts] Go language - ending?

2016-07-27 Thread Alexey Solovey
Hello. Will support of WebAssembly (compilation to JS) in Go language, in ending version? Hardness: SIMD, Atomics, Threads... Also, I have question: GO supports SIMD? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this g

Re: [go-nuts] Go language - ending?

2016-07-27 Thread Chris Broadfoot
You might want to check out the gopherjs project: https://github.com/gopherjs/gopherjs There are no plans for the Go project to have an official target for WebAssembly. On Wed, Jul 27, 2016 at 8:02 AM, Alexey Solovey wrote: > Hello. Will support of WebAssembly (compilation to JS) in Go language

Re: [go-nuts] Go language - ending?

2016-07-27 Thread Konstantin Khomoutov
On Wed, 27 Jul 2016 08:02:51 -0700 (PDT) Alexey Solovey wrote: > Hello. Will support of WebAssembly (compilation to JS) in Go > language, in ending version? If by "ending version" you mean 1.7 which is now at RC3, then AFAIK the answer is no -- see for youself: https://tip.golang.org/doc/go1.7

Re: [go-nuts] gomobile graphics without opengl

2016-07-27 Thread Nigel Tao
On Sun, Jul 24, 2016 at 5:21 PM, wrote: > All the examples for gomobile use opengl for graphics. > Is it possible to manipulate go-images directly, like shiny can do? Not yet. Longer term, I'd like to see a shiny driver for mobile devices, but that's not an immediate priority for me. -- You re

[go-nuts] http.ListenAndServeTLS accepts .pem files

2016-07-27 Thread viridian . reg
I have few questions 1. Is there a java keystore equivalent in golang? 2. http.ListenAndServeTLS expects .pem files as input and .pem is in plain text and easily readable and I don't want that. Is it possible to have files in .der or any other encrypted format passed to http.ListenAndServeTLS if

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Carl Ranson
Thanks Egon, Ok, I take your point that one needs to strike a balance with the work done in each goroutine to achieve optimum performance. i understand that each goroutine doing a subblock of the board using bitmaps would be faster, but as a learning exercise i'm keeping it simple. In fact I

Re: [go-nuts] Re: first program, game of life in go

2016-07-27 Thread Charles Haynes
"Naive" implementations of life are fun as a learning exercise, but if you actually want to compute life you need to know about "Hashlife." It'd be fun to see Hashlife implemented in Go. -- Charles https://en.wikipedia.org/wiki/Hashlife Representation The field is typically treated as a theoret

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Egon
On Thursday, 28 July 2016 03:40:39 UTC+3, Carl Ranson wrote: > > Thanks Egon, > > Ok, I take your point that one needs to strike a balance with the work > done in each goroutine to achieve optimum performance. > i understand that each goroutine doing a subblock of the board using > bitmaps wo

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Jordan Krage
| one of the reasons I used pointers here was to avoid each goroutine from fighting over access to the boards array. they only care about the adjacent cells after all. What's to fight over? Concurrent reads are no problem, and the writes are independent of one another. Rather than storing the p

Re: [go-nuts] Who wants to use Go to process your camera's raw files?

2016-07-27 Thread Jonathan Pittman
Sam, I do not think that I can use LibRAW (or LibTIFF) on appengine. And I aim to write and run some apps on appengine that will let me do some things with my RAW images (not just the thumbnail or the jpeg previews). Extracting the data (and metadata) is the easy part. I have written things in G

Re: [go-nuts] http.ListenAndServeTLS accepts .pem files

2016-07-27 Thread Kiki Sugiaman
On 28/07/16 09:13, viridian@gmail.com wrote: I have few questions 1. Is there a java keystore equivalent in golang? There is no built-in secrecy management for your tls private key in the standard library. Private key is stored in: https://golang.org/pkg/crypto/rsa/#PrivateKey Trusted c

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-27 Thread Raj
Thank you for excellent suggestions. I will explore and try them. I am wondering is it possible to single NFA/DFA from set of regular expressions (similar to aho-corasick which does for fixed strings) which can determine matched regexps with single pass on the input. Especially if regular expr

[go-nuts] http response issue with leaking handles

2016-07-27 Thread krmayankk
http://devs.cloudimmunity.com/gotchas-and-common-mistakes-in-go-golang/index.html#close_http_resp_body Recommends the below. I wanted to confirm with golang people if this is indeed the correct approach. Can the response be not nil in cases where there is an error ? resp, err := http.Get("https