Re: [go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-05 Thread Florian Florensen
f there is already > one there... > > PS. did you have to write extra code (not published here) to use `go test > -bench=.`? > > thx > > > > On Sun, Sep 3, 2017 at 6:03 PM, Florian Florensen > wrote: > >> Hi, two approaches would be: >> >

[go-nuts] Re: Splitting CamelCaseWords in Go

2017-09-04 Thread Florian Florensen
Hi, two approaches would be: func camelAppend(str string) string { w := []rune(str) for i := len(w) - 1; i > 1; i-- { if unicode.IsUpper(w[i]) { w = append(w[:i], append([]rune{' '}, w[i:]...)...) } } return string(w) } func camelRegexp(str string) string { re := regexp.Mu

[go-nuts] Extending image.Image with Set

2017-09-04 Thread Florian Florensen
Hello, I'd like to rotate, scale, ... images by moving pixels using affine transformations. For example, the get a points x, y position after a translating it by m, n pixels, you can just add m resp n to x and y: x' = x + m y' = y + n So the task is basically just to iterate over the images p