Re: [go-nuts] Re: http "alt" attribute value for img tag?

2018-04-21 Thread Nigel Tao
package main import ( "fmt" "log" "strings" "golang.org/x/net/html" ) func main() { const src = ` message ` doc, err := html.Parse(strings.NewReader(src)) if err != nil { log.Fatal(err) } var f func(*html.Node) f = func(n *html.Node) { if n.Type == html.ElementNode && n.Data == "img" { for

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

2018-04-23 Thread Nigel Tao
Nice! On Mon, Apr 23, 2018 at 3:41 AM, Steven Wiley wrote: > I refactored and enhanced the raster package from the golang translation > of freetype, > It'd be a bunch of work, but you might consider basing off of golang.org/x/image/vector instead: 1. Its

Re: [go-nuts] Reference to type satisfying a specified interface

2018-08-30 Thread Nigel Tao
On Fri, Aug 31, 2018 at 4:18 AM Burak Serdar wrote: > If b is an interface to a *Blob, what's stored in the slice is {Type: > *Blob, Value: pointer to the object}. A copy of this interface value > is also in the map. So you have two copies of the interface value, > both pointing to the same Blob o

Re: [go-nuts] Reference to type satisfying a specified interface

2018-08-30 Thread Nigel Tao
On Fri, Aug 31, 2018 at 9:50 AM Eric Raymond wrote: > That was helpful. I feel like I have a more solid grasp now, though I'm a > bit worried about what details might have changed. IIRC, as of some years ago (Go 1.3 or 1.4??), the value inside an interface is now always a pointer, because some

Re: [go-nuts] Reference to type satisfying a specified interface

2018-08-30 Thread Nigel Tao
On Fri, Aug 31, 2018 at 11:41 AM Eric Raymond wrote: > On Thursday, August 30, 2018 at 8:31:44 PM UTC-4, Ian Lance Taylor wrote: >> Which docs did you look at? Just wondering what could be updated. > > This: https://research.swtch.com/interfaces I'm only guessing, but I think Ian's "which docs

Re: [go-nuts] Space-optimization question

2018-09-05 Thread Nigel Tao
On Thu, Sep 6, 2018 at 12:22 AM Eric Raymond wrote: > Matters in my case because the deserialization of a repository history can > contain hundreds of thousands of constants like "M", "D", "R", and "C" > representing fast-export stream file operation types. I could intern them > explicitly but

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 9:29 AM 'Axel Wagner' via golang-nuts wrote: > On Fri, Sep 7, 2018 at 12:37 AM Ian Lance Taylor wrote: >> Interesting point. But is there any way to solve it short of >> explicitly listing types? Is there any generics system in any >> language that avoids this problem? >

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 9:34 AM Eric Raymond wrote: > The attached program lists For future reference, it would probably be easier for the mailing list to discuss example code via a link to the Go playground, especially for runnable code. In this case: https://play.golang.org/p/IripNZNYIgo > In

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 1:53 PM Eric Raymond wrote: > ...provided, that is, that it's possible to get from the member name to a > function pointer that can be called like a closure. Does the reflection > system support such a call-indirect method? Yep. No embedding or other inheritance-like fea

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread Nigel Tao
Building on Todd's example, you can add a little more type safety (having the map value type be a "func etc" instead of "reflect.Value) by Curry'ing the receiver: https://play.golang.org/p/n3sDpxfd2td I've also split up the single run function into two: one binds strings to functions, the second t

Re: [go-nuts] Failed iterator proposals?

2018-10-25 Thread Nigel Tao
On Fri, Oct 26, 2018 at 6:04 AM robert engels wrote: > Barring that, I don’t see how > > for(i:=c.Iterator();i.HasNext();) { > v := i.Next() > } > > is that much more difficult to use Yes, an iterator with a Next method (possibly with another name) is the idiomatic way to present database-y

Re: [go-nuts] [ANN] fixed point math library

2018-11-29 Thread Nigel Tao
On Thu, Nov 29, 2018 at 9:20 PM Jan Mercl <0xj...@gmail.com> wrote: > - To me type name 'fixed.Fixed' sounds like Javaism. Well, there's already context.Context, hash.Hash, image.Image and time.Time in the standard library. Perhaps, in a parallel universe, we could have settled on the testing.T na

[go-nuts] Wuffs: a new, memory-safe programming language

2019-01-08 Thread Nigel Tao
Spun out of the "C++ 11 to Golang convertor" thread... On Mon, Jan 7, 2019 at 12:27 AM Eric S. Raymond wrote: > Perry and I have two different target languages in mind. Perry's > target language is basically a repaired C - type-safe, almost > upward-compatible. He and I have the same strategic

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-10 Thread Nigel Tao
On Fri, Jan 11, 2019 at 4:22 AM robert engels wrote: > Again, what is wrong with the bounds checking/memory protection > library/technique for C I referred you to? Even a decrease in performance > will probably still be on par or better than the equivalent Go program. Quoting from https://www.d

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-11 Thread Nigel Tao
On Fri, Jan 11, 2019 at 5:46 PM Nigel Tao wrote: > On Fri, Jan 11, 2019 at 4:22 AM robert engels wrote: > > Again, what is wrong with the bounds checking/memory protection > > library/technique for C I referred you to? Even a decrease in performance > > will probably stil

Re: [go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-12 Thread Nigel Tao
On Mon, Feb 4, 2019 at 5:34 AM Miki Tebeka wrote: > A bit of profiling shows that the modulo operator takes most of the time: C's modulo operator is faster, but can crash if you look at it funny. $ cat x.c #include int main(int argc, char** argv) { int x = -2147483648; int y = -1; printf

Re: [go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-12 Thread Nigel Tao
On Wed, Feb 13, 2019 at 11:23 AM Nigel Tao wrote: > Yes, both the Go code and the C code will panic if y is zero. Still, > "-2147483648 % -1" has a sensible mathematical definition (zero), and > C fails to calculate it. I forgot to mention that, even with a mod-by-zero, Go l

Re: [go-nuts] Re: golang.org/x/text/language does not match sr-Latn (Serbian in a Latin script) with hr (Croatian) as it documents that it should

2019-03-01 Thread Nigel Tao
CC'ing mpvl@, the blog post author. On Sat, Mar 2, 2019 at 1:16 AM wrote: > > I did a bit more digging and found this: > > https://go-review.googlesource.com/c/text/+/55331/ > > Which states: > > "language: remove manual hr -> sr mapping was removed in CLDR for > geo-political reasons" > > Whic

Re: [go-nuts] Why does this program carry test flags once compiled?

2017-07-22 Thread Nigel Tao
On Sat, Jul 22, 2017 at 7:08 PM, Howard Guo wrote: > https://github.com/HouzuoGuo/laitos It's tangential to your question, but out of curiousity, I skimmed the source code. In things like func TestUDPServer in https://github.com/HouzuoGuo/laitos/blob/master/frontend/plain/udp.go, you say: var st

Re: [go-nuts] Is x/exp/shiny dead?

2017-07-31 Thread Nigel Tao
On Tue, Aug 1, 2017 at 6:25 AM, fazal wrote: > It was one of the things I was looking forward to, but I see almost no > activity there, which makes me sad. It's certainly not very active right now. I work part time, for uninteresting reasons, and shiny is unfortunately not my primary project. I'

Re: [go-nuts] License for x/image/testdata and x/image/font/testdata files

2017-08-19 Thread Nigel Tao
testdata/fixed subdirectory, there is a README that contains license notes. For x/image/testdata, I think "git log" is the best source of per-file license notes. For example: $ git log testdata/tux.png commit 94ba43c4786221df328229f694fa73a71558583b Author: Nigel Tao Date: Tue Jun 17 21

Re: [go-nuts] new project: pixels to svg

2017-09-01 Thread Nigel Tao
On Sat, Sep 2, 2017 at 12:50 AM, wrote: > Feel free to give me feedback on how I can improve the code or the project > setup, etc. I had a quick look. Some thoughts on style, in no particular order: 0. Run gofmt. Your code mixes tabs and spaces, amongst other issues. Gofmt will fix that. 1. Ru

Re: [go-nuts] shiny driver.Main not returning

2017-09-07 Thread Nigel Tao
For the record, the OP filed https://github.com/golang/go/issues/21796 -- 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. F

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-07 Thread Nigel Tao
On Thu, Sep 7, 2017 at 4:00 PM, Tim Uckun wrote: > I don't see anything wrong with the try catch paradigm, Try-catch makes for shorter code when you're just passing the buck, but it can be quite complicated when you actually need to handle the buck. My showcase example for this is the exception-

[go-nuts] Re: Why is Shiny's text rendering quantizes to the pixel grid?

2017-09-21 Thread Nigel Tao
On Sat, Sep 16, 2017 at 2:26 AM, David Crawshaw wrote: > On Fri, Sep 15, 2017 at 7:35 AM, Elias Naur wrote: >> Is there a fundamental reason to quantize the baseline? The >> golang.org/x/image/font package offers (fixed point) subpixel accuracy, so >> why not use it? Is there a performance advant

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-27 Thread Nigel Tao
On Tue, Sep 26, 2017 at 1:55 AM, Guy Allard wrote: > Adding support for multiple IFDs to the go package being discussed seems not > too difficult (reading the existing code). > > Suggest trying to contact the package authors. Hi, I'm one of the authors of the golang.org/x/image/tiff package. Lac

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-27 Thread Nigel Tao
On Thu, Sep 28, 2017 at 10:28 AM, Michael Jones wrote: > Not quite related, but if changes are going to happen, I want to add (or see > someone add) colorspace tags to the PNG code and the TIFF code. It's not exactly what you're asking for, but there are already issues https://github.com/golang/g

Re: [go-nuts] Go Fonts: Double double copyright notice in gomono.TTF and friends

2017-10-04 Thread Nigel Tao
On Sun, Oct 1, 2017 at 8:50 AM, as wrote: > The official go fonts contain two identical copyright notices inside the TTF > data slice. One in UTF-8 and one in UTF16 format. These make their way into > the final go binary. Bug or intentional TTF standard? Intentional, unfortunately. It's may not b

Re: [go-nuts] [ANN] Frame - Plan9 libframe in Go

2017-10-11 Thread Nigel Tao
On Wed, Oct 11, 2017 at 2:30 PM, as wrote: > https://github.com/as/frame Nice! -- 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...@googlegro

Re: [go-nuts] Re: Learning Go: suggestions for code review?

2017-12-13 Thread Nigel Tao
On Thu, Dec 14, 2017 at 1:44 AM, Ben Hoyt wrote: > I used the "dot" import for tokenizer so I can just use "if p.tok == COMMA" > instead of "if p.tok == tokenizer.COMMA" everywhere. As per https://golang.org/doc/effective_go.html#mixed-caps ALL_CAPS names are unusual Go style. In https://github.c

Re: [go-nuts] The side effect of calling html.Token()

2018-01-11 Thread Nigel Tao
On Wed, Jan 3, 2018 at 1:03 PM, Tong Sun wrote: > Shouldn't Token() be better returning the current on > instead of the next? You're right. I sent out https://go-review.googlesource.com/c/net/+/87515 -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

Re: [go-nuts] The side effect of calling html.Token()

2018-01-13 Thread Nigel Tao
On Fri, Jan 12, 2018 at 2:24 PM, Tong Sun wrote: > but I really suggest that you give it a test. It is already tested directly by func TestTokenizer in token_test.go The Tokenizer.Text method implementation does not call Tokenizer.Next, and only the Next method moves on to the next token. It is

Re: [go-nuts] The side effect of calling html.Token()

2018-01-15 Thread Nigel Tao
On Sun, Jan 14, 2018 at 4:33 PM, Tong Sun wrote: > Not being able to do that, I have to save all the Token() info to different > variables, then pass all those variables to my function separately, instead > of passing merely a single tokenizer. Instead of using different variables, I'd just pass

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2018-01-17 Thread Nigel Tao
On Thu, Jan 18, 2018 at 1:53 AM, wrote: > I'm wondering if you know any c/cpp implementation of your renderer I don't know of a C/C++ implementation, sorry. If you find (or write) one, let me know! -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] Re: S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Mon, Aug 26, 2019 at 9:49 PM Jason E. Aten wrote: > It sounds like it does, but just to be clear: does S2 also replace/upgrade > the snappy *streaming* format (the outer format that is different from snappy > itself; e.g. https://github.com/glycerine/go-unsnap-stream )? Tangential, but the h

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
Nice work, Klaus! On Mon, Aug 26, 2019 at 8:29 PM Klaus Post wrote: > Concurrent stream compression - several GB/sec. > Faster decompression A number of modern compression formats and implementations allow for concurrent *compression*. Coincidentally, I've been working on a format that allows

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Tue, Aug 27, 2019 at 7:25 PM Klaus Post wrote: > Can the concurrent decompression run on a pure stream, or does it need to > read the index first? It cannot run a pure stream. As the https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md Overview section says, an explicit non-goal i

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Mon, Aug 26, 2019 at 8:29 PM Klaus Post wrote: > This package is aimed at replacing Snappy as a high speed compression > package. If you are mainly looking for better compression zstandard gives > better compression, but typically at speeds slightly below "better" mode in > this package. Do

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-28 Thread Nigel Tao
On Wed, Aug 28, 2019 at 7:11 PM Klaus Post wrote: > TLDR; LZ4 is typically between the default and "better" mode of s2. Nice! Just a suggestion: rename "better" to either "betterSize / smaller" (i.e. better compression ratio, worse throughput) or "betterSpeed / faster", otherwise it's not immedi

Re: [go-nuts] Re: ANNOUNCE: renderview

2016-08-27 Thread Nigel Tao
On Sun, Aug 28, 2016 at 2:57 AM, Michael Jones wrote: > I tried to build but was deterred by build woes. Yeah, all of the "renderview" imports need to be "github.com/TheGrum/renderview" to play well with "go get". -- You received this message because you are subscribed to the Google Groups "go

Re: [go-nuts] Conditional compiling for android

2016-08-31 Thread Nigel Tao
On Wed, Aug 31, 2016 at 4:45 AM, Sapna Todwal wrote: > I already tried this and it doesn't work . That's odd. It should work. What are your filenames? What do your "// +build" lines look like exactly? > Also I need a way to enable > certain code only for pure android and not linux. Any suggesti

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

2016-08-31 Thread Nigel Tao
On Mon, Aug 29, 2016 at 12:27 PM, Jonathan Pittman wrote: > To everyone, I really want to see this live in the golang.org/x/image repo. > Do we need to create a formal proposal for it to live there? Should we do > the initial development in another repo and then move it to the x/image repo > late

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

2016-09-01 Thread Nigel Tao
On Thu, Sep 1, 2016 at 12:46 PM, Jonathan Pittman wrote: > Does the license need to be the same as the standard Go License if it starts > in another repo and then moves over? IANAL, but that seems best. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Go string to uintptr

2016-09-07 Thread Nigel Tao
On Thu, Sep 8, 2016 at 1:03 AM, Tamás Gulácsi wrote: > for i:=0;i<1<<20;i++{ if a[i]==0 {b=string(a[:i])}} The first part of that could be "for i := range a". You probably want a "break" statement in there too. :-) -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] Go string to uintptr

2016-09-07 Thread Nigel Tao
On Thu, Sep 8, 2016 at 1:03 AM, Tamás Gulácsi wrote: > a:=([1<<20]byte(unsafe.Pointer(retPtr))) Also, the type needs to be pointer-to-array, not array. a:=(*[1<<20]byte)(unsafe.Pointer(retPtr)) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. T

Re: [go-nuts] JPEG to RGB issues

2016-09-07 Thread Nigel Tao
JPEG is not a pixel-exact format, even in YCbCr color space. Different Discrete Cosine Transformation implementations may produce slightly different YCbCr and hence RGB values, and still be considered valid JPEG implementations. For example, libjpeg is just one software implementation, in one prog

Re: [go-nuts] Wordbreak and word extraction in Go?

2016-09-20 Thread Nigel Tao
On Wed, Sep 21, 2016 at 7:34 AM, 'Ingo Oeser' via golang-nuts wrote: > I am pretty sure I am overlooking something in the repository > https://godoc.org/golang.org/x/text but I cannot find something to split text > into words according to the next Unicode word splitting algorithm. > > Has anyone

Re: [go-nuts] truncate float32 to lesser precision (22 bit mantissa)

2016-09-21 Thread Nigel Tao
On Sun, Sep 18, 2016 at 1:57 PM, wrote: > It looked like I would have to use pkg unsafe BTW, you don't have to use package unsafe. Use package math's Float32bits and Float32frombits functions. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Crypto/rsa : OAEP documentation can lead to misunderstanding regarding max message length, is it a bug?

2016-09-21 Thread Nigel Tao
On Wed, Sep 21, 2016 at 1:41 AM, AnomalRoil wrote: > So here am I: should I open an issue for a trivial sign mistake in a > sentence in the documentation? Opening an issue would have been fine. In this case, though, I just sent the trivial change out for review: https://go-review.googlesource.com

Re: [go-nuts] Request for advice: Developing for Android

2016-09-21 Thread Nigel Tao
On Thu, Sep 22, 2016 at 12:33 AM, Peter Kleiweg wrote: > How about Go Mobile? Is that useful as a starting point, or should I try to > get to know the system first using Android Studio? What are the capabilities > of Go Mobile? Can it do all the stuff a native app can do, system calls, > events, g

Re: [go-nuts] WebP encoder

2016-09-22 Thread Nigel Tao
On Fri, Sep 23, 2016 at 4:18 AM, Aarti Parikh wrote: > Is webp encoding in pure go something that may happen in a future release? I'd like to see that, but I have higher priority things to work on. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group

Re: [go-nuts] gomobile - detect OS information

2016-10-06 Thread Nigel Tao
On Tue, Oct 4, 2016 at 10:03 PM, Scot Newberry wrote: > I'm evaluating gomobile and building a simple application just display a > text both with OS name (Android, or iOS), OS release... You can at least discriminate Android vs iOS via the runtime.GOOS constant (https://golang.org/pkg/runtime/#pk

[go-nuts] iconvg: a compact, binary format for simple vector graphics

2016-10-23 Thread Nigel Tao
I was looking for a compact, binary format for simple vector graphics. I didn't find one that did all I wanted. SVG is the de facto standard for vector graphics, in the open source world. Unfortunately, https://www.w3.org/TR/SVG/single-page.html prints as 400 pages, not including the XML, CSS or X

Re: [go-nuts] iconvg: a compact, binary format for simple vector graphics

2016-10-25 Thread Nigel Tao
On Tue, Oct 25, 2016 at 2:13 AM, Pietro Gagliardi wrote: > I wonder if there's a way to simulate elliptical gradients with only circular > gradients and affine transformations, so package ui can also render these > files directly using the system native vector graphics APIs. I'd expect that you

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-25 Thread Nigel Tao
On Tue, Oct 25, 2016 at 4:31 PM, Daniel Theophanes wrote: > My understanding is that the original rust font render code could replace > something like FreeType. Do you envision using iconvg and vector as a > replacement for the go freetype package, where font glyphs would be loaded > in as iconvg

Re: [go-nuts] Freetype performance

2016-10-25 Thread Nigel Tao
On Tue, Oct 25, 2016 at 9:40 PM, David M. wrote: > Is the Go freetype library optimized? Should I expect a similar performance > from the original C version? Why freetype don't use an internal cache to > store most frequent characters? Go freetype has had some performance work, but not a lot. I

Re: [go-nuts] iconvg: a compact, binary format for simple vector graphics

2016-10-25 Thread Nigel Tao
On Tue, Oct 25, 2016 at 9:30 PM, roger peppe wrote: > Would there be some advantage in making the Rasterizer > types in shiny/iconvg and image/vector somewhat more > uniform in the types they use? For example, vector.Rasterizer > seems to use f32.Vec2 pairs everywhere, but iconvg.Rasterizer > uses

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-25 Thread Nigel Tao
On Wed, Oct 26, 2016 at 12:45 AM, Sean Russell wrote: > How did you calculate the SVG sizes? When I download the the icons from the > material design github, the collection of the *_48px.svg icons weighs in at > 3.8MB. You may be double counting the design/ and production/ versions of the same i

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-26 Thread Nigel Tao
On Wed, Oct 26, 2016 at 7:20 PM, roger peppe wrote: > This cannot be understated. A well known tool generates SVGs that the > Go XML parser cannot parse because it uses XML directives to create XML > entities that contain XML elements when they're expanded. This meant > we couldn't process them a

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2016-10-27 Thread Nigel Tao
On Wed, Oct 26, 2016 at 4:38 PM, Nigel Tao wrote: > SVGZ is indeed smaller, and more expensive to decode, but I don't have > numbers at hand. Oh, I do have a size number. It's only one data point, but look for "gzip" at https://godoc.org/golang.org/x/exp/shiny/ico

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-27 Thread Nigel Tao
On Fri, Oct 28, 2016 at 6:54 AM, 'simon place' via golang-nuts wrote: > however, from looking at it, couldn’t find documentation, that code is > specific to speeding up graphics overlays? maybe? (accumulate) Yes, speeding up an accumulation step, described at https://medium.com/@raphlinus/inside-

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-27 Thread Nigel Tao
On Thu, Oct 27, 2016 at 9:24 AM, 'simon place' via golang-nuts wrote: > the approach i took was to try to minimise the M/C, so; Sorry for the ignorant question, but what does M/C stand for? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

Re: [go-nuts] Freetype performance

2016-10-28 Thread Nigel Tao
On Sat, Oct 29, 2016 at 2:11 AM, David M. wrote: > Here is the profiling: Ah, in package freetype, face.Glyph results (glyph images) are cached but face.GlyphAdvance and face.Kern results are not. Thanks for the bug report, I filed https://github.com/golang/freetype/issues/42 -- You received t

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-11-02 Thread Nigel Tao
On Tue, Nov 1, 2016 at 8:58 PM, Ondrej wrote: > It seems that a universal binary, as Go requires it, would be slow on > dispatch, because there would be too much checking for individual intrinsics > support. Do I understand it correctly, that to overcome this, people either > compile natively (whi

Re: [go-nuts] iconvg: a compact, binary format for simple vector graphics

2016-11-05 Thread Nigel Tao
On Tue, Oct 25, 2016 at 9:30 PM, roger peppe wrote: > Would there be some advantage in making the Rasterizer > types in shiny/iconvg and image/vector somewhat more > uniform in the types they use? For example, vector.Rasterizer > seems to use f32.Vec2 pairs everywhere, but iconvg.Rasterizer > uses

Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Nigel Tao
On Wed, Nov 9, 2016 at 4:14 AM, wrote: > I'm trying to write out a png with an alpha component as a jpeg. As I > understand it, I should be able to use the draw package to do this. > > // src is an image.RGBA > newImg := image.NewRGBA(src.Bounds()) > > draw.Draw(newImg, newImg.Bou

Re: [go-nuts] Re: Suggestion: port golang.org/x/mobile/exp/audio/al to Windows

2016-11-20 Thread Nigel Tao
On Mon, Nov 21, 2016 at 10:24 AM, wrote: > How to submit a change request? If you're asking about how to submit code that you have written yourself, the contribution guidelines are at https://golang.org/doc/contribute.html If you are asking how to file a feature request, the issue tracker for t

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-11-28 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > Sorry if this is the wrong place. This place is as good as any other. Thanks for the bug report. I'll pass it on to Bigelow & Holmes. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Processing Images with baked data

2016-11-30 Thread Nigel Tao
On Wed, Nov 30, 2016 at 4:46 AM, wrote: > I know there is an image package that exist in Golang that implements encode > and decode functionality, but how can I get other data from an image?. For > example I am trying to get iTXt chunks from PNG images, is there any way I > can do this? Not in t

Re: [go-nuts] Re: database/sql and custom column types

2016-12-03 Thread Nigel Tao
On Sat, Dec 3, 2016 at 4:26 AM, wrote: > A quick aside regarding the code that you posted. Postgres (bizarrely, IMHO) > stores longitude first, then latitude, so: Well, the usual order is "latitude, longitude", but on the standard visualization (North is 'up' on typical maps), latitude (North-So

Re: [go-nuts] Trouble with fonts

2016-12-07 Thread Nigel Tao
On Wed, Dec 7, 2016 at 5:49 PM, Lucio wrote: > The first issue is one of documentation. It says in > that: > > DrawBytes draws s at the dot and advances the dot's location. > > But it leaves the question of what exactly those bytes are supposed to > repr

Re: [go-nuts] Trouble with fonts

2016-12-07 Thread Nigel Tao
On Thu, Dec 8, 2016 at 3:32 PM, Lucio wrote: >> A text editor widget might expose its text content as a []byte, >> instead of a []rune, since in the latter representation, the >> underlying array takes 4x the memory for ASCII text, a common case. >> > I would choose to err on the side of intuition

Re: [go-nuts] gob ignores default values, bug or feature?

2016-12-14 Thread Nigel Tao
On Sat, Dec 10, 2016 at 11:14 PM, Matthew Zimmerman wrote: > Yes, it makes them smaller I agree, however shouldn't the lack of a value on > decoding be considered like a zero value was encoded? I think that is the > question here. It's pretty much academic at this point, since we can't break bac

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Nigel Tao
On Sun, Dec 18, 2016 at 1:51 PM, Henry wrote: > I have reusable test utilities in a project. They are used by various > packages in the project for testing purposes, and at the same time I don't > want to expose these utilities as public APIs. Since it is impossible to > import another test packag

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-12-21 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > The ascenders for blocks, lines, etc are all wrong and it's very > distracting. I'm enjoying go mono in the terminal so far but it's tedious to > go through every file and delete the problematic character ranges. Can these > be removed from the font until

[go-nuts] Re: curious problem implementing RGB565 image

2016-06-13 Thread Nigel Tao
On Mon, Jun 13, 2016 at 9:10 PM, Dan Kortschak wrote: > Though doing the direct round trip of an image through an RGB565 gets > back the pixels in a state that you would expect, shown here in the > playground snippet: > > https://play.golang.org/p/UCwE4YJk21 Here's your color model function: fun

Re: [go-nuts] Bitmasks on signed types

2016-06-15 Thread Nigel Tao
On Wed, Jun 15, 2016 at 6:08 AM, Dave MacFarlane wrote: > Would a patch that adds a Mult receiver function to Int52_12 and > Int26_6 be welcome in x/image/math/fixed? Yeah, I'd take that. For Int26_6, I'd convert to int64, multiply, then shift and convert back to Int26_6, as Matt Harden said. -

Re: [go-nuts] GoMobile window size always 800x800

2016-06-15 Thread Nigel Tao
On Tue, Jun 14, 2016 at 4:53 AM, Andy Brewer wrote: > I agree that good mobile UI should be responsive. I'm thinking this feature > would be useful for testing your app on those wide range of mobile screen > sizes. Right now, it's difficult to test apps made with gomobile because the > viewport ne

Re: [go-nuts] GoMobile window size always 800x800

2016-06-15 Thread Nigel Tao
On Fri, Jun 10, 2016 at 12:45 PM, Nigel Tao wrote: > I'd consider a patch that changed the hard-coded value to a more > phone-like aspect ratio instead of 1:1. Maybe 4:3 or 5:3 or 3:2 or > 16:9 but as you can see there are multiple bike-shedding options and > no single one is o

Re: [go-nuts] Re: [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-15 Thread Nigel Tao
On Thu, Jun 16, 2016 at 11:22 AM, wrote: > it no longer does the array bounds check twice It's not safe, but you might want to try disabling bounds checking by "go tool compile -B" or "go build -gcflags=-B". -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Simplest way to extend the functionality of other's package

2016-06-17 Thread Nigel Tao
On Thu, Jun 16, 2016 at 2:11 PM, Tong Sun wrote: > How to define my own function > > > func FindUrl() { return > goquery.Find(".thing").Find(".comments.may-blank").Attr("href"); } > > so that the above code can be simplified as: > > post_url, _ := doc.FindUrl() In your own package, you can only

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-22 Thread Nigel Tao
+mpvl although my instinct is that this is all working as intended, and types are not goroutine-safe unless they explicitly say so. On Tue, Jun 21, 2016 at 2:33 PM, Ian Lance Taylor wrote: > On Mon, Jun 20, 2016 at 9:15 PM, wrote: >> I am guessing the same efficiency should be possible. Except

Re: [go-nuts] Matrix Library && colour uint32's vs uint8's

2016-07-06 Thread Nigel Tao
On Mon, Jul 4, 2016 at 2:50 PM, simran wrote: > Interestingly though, when i do a colour swap (without any type casting > happening now) - the colour problem is still there. https://github.com/simran91/monkeysee/blob/master/mimage/mimage.go says: r, g, b, a := colour.RGBA() column[y] = color.RG

Re: [go-nuts] http.Handler method name

2016-07-12 Thread Nigel Tao
On Wed, Jul 13, 2016 at 6:14 AM, Anmol Sethi wrote: > If you were to redesign it now, would you name the method Handle? Also speaking personally, yes. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop recei

Re: [go-nuts] Re: any way to save an image to 8-bit indexed png format?

2016-07-13 Thread Nigel Tao
On Thu, Jul 14, 2016 at 2:07 AM, wrote: > [haven't actually checked if the PNG package will work with this - but this > would be the way to go if supported] The PNG package should work with this: https://play.golang.org/p/Sxl-nLnecy -- You received this message because you are subscribed to th

Re: [go-nuts] Streaming deflate - can't reliably read chunks as they arrive instead of the entire stream

2016-07-13 Thread Nigel Tao
On Thu, Jul 14, 2016 at 12:35 AM, A Keeton wrote: > I'm trying to decompress messages arriving over websockets that are using > permessage-deflate. You say that you're using "per message" deflate... > Each new websockets message is written into buf and then I call Read on ...but then it sounds

Re: [go-nuts] Streaming deflate - can't reliably read chunks as they arrive instead of the entire stream

2016-07-14 Thread Nigel Tao
On Fri, Jul 15, 2016 at 9:14 AM, Adam Keeton wrote: > A small self-contained example with this code would be tricky with all of > the websocket handling stuff in the way. You could possibly capture the bytes of each compressed message, and then construct a new websocket-free program that starts w

Re: [go-nuts] Streaming deflate - can't reliably read chunks as they arrive instead of the entire stream

2016-07-15 Thread Nigel Tao
On Sat, Jul 16, 2016 at 6:03 AM, Adam Keeton wrote: > Is there a different implementation of deflate that you think I should try? I don't know of any. Sorry. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] I get a "Invalid cast. " error when debuging

2016-07-15 Thread Nigel Tao
On Sat, Jul 16, 2016 at 2:33 AM, Konstantin Khomoutov wrote: > Support for Go in gdb is beleived to be suboptimal (and AFAIK the > situation in unlikely to change). Consider trying devle -- which is a > native debugger for Go. Just a small typo: devle should be delve, which is at https://github.

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

Re: [go-nuts] Fast ConcurrentCounter without memory sharing

2016-08-14 Thread Nigel Tao
On Aug 15, 2016 05:21, "Ian Lance Taylor" wrote: > If these approaches seem awkward, I suppose you could get > syscall(syscall.GETCPU, ...) when you want to increment a counter. That still seems racy: n := syscall(syscall.GETCPU, ...) // The goroutine could be re-scheduled here to another CPU, b

Re: [go-nuts] Proposal: radix sort in /x/exp

2016-08-17 Thread Nigel Tao
On Tue, Aug 16, 2016 at 1:05 PM, Randall Farmer wrote: > I think, in general, a great thing about Go is most stdlib packages scale > well--net/http's still a good pick when you get real traffic, say. Adding > stdlib sorts that are faster for large collections seems in that spirit. > They'd be no m

Re: [go-nuts] Shiny

2016-08-17 Thread Nigel Tao
On Wed, Aug 17, 2016 at 11:11 PM, Seb Binet wrote: > that said, I think it is quite clear that shiny is not yet ready for prime > time, for all the use cases of a complete GUI toolkit. > I hope it will come to that, but it isn't the case yet. Yes, it's not yet ready for prime time. We're working

Re: [go-nuts] Re: Shiny

2016-08-17 Thread Nigel Tao
On Wed, Aug 17, 2016 at 2:56 AM, wrote: > It is also slightly unclear what version of the language it is built for. I > think they have been advancing with Go, and have not made efforts towards > backwards compatibility, and I had to make several hand-edits after > updating, to get it to compile

Re: [go-nuts] Shiny

2016-08-18 Thread Nigel Tao
On Thu, Aug 18, 2016 at 6:12 PM, Joe Blue wrote: > Do you want anyone to help on the material design "widgets" yet ? It's great that there's community interest in Shiny, but as I said, it's not ready yet. I'll let y'all know when enough has been built and settled that more contributors will be he

Re: [go-nuts] Shiny

2016-08-18 Thread Nigel Tao
On Fri, Aug 19, 2016 at 9:24 AM, wrote: > Thanks Joe. I've got some samples already for testing what I'm working on... > but right now, I'm hitting a wall. The Shiny docs say that OnInputEvent on > widgets gets called on keyboard events: > > > // OnInputEvent handles a key, mouse, touch or gestur

[go-nuts] Go Fonts: request for feedback

2017-02-02 Thread Nigel Tao
Bigelow & Holmes, the designers of the Go Fonts, are preparing an update to those fonts. The changes so far are: • adjusted box/chart/shade/split-integral to align vertically • adjusted shade characters to align vertically & horizontally (more or less aesthetically) • merged the contours of ring o

Re: [go-nuts] Go Fonts: request for feedback

2017-02-04 Thread Nigel Tao
On Sat, Feb 4, 2017 at 12:12 PM, roger peppe wrote: > More unicode coverage would also be nice. Selfishly I'd like characters for > all those in plan 9's lib/keyboard file > (https://github.com/0intro/plan9/blob/master/lib/keyboard) so I can read the > characters that I can easily type. :-) I can

Re: [go-nuts] Go Fonts: request for feedback

2017-02-04 Thread Nigel Tao
On Sun, Feb 5, 2017 at 12:40 AM, Konstantin Khomoutov wrote: > Compare this to how a set of ubiquitous fonts from Microsoft is > rendered with the same settings: ms-alias-none-no-hinting.png -- they > look just great. Yeah, I believe that Microsoft put a *lot* of work into those fonts, a couple o

Re: [go-nuts] Problems drawing on frames of an animated gif

2017-02-04 Thread Nigel Tao
On Mon, Jan 23, 2017 at 6:03 AM, kalekold via golang-nuts wrote: > Hmm.. the source gif I'm using must be compressed. Doesn't Go handle > compressed gifs in the same way? When you say 'I may get unexpected results' > is that because the current gif package doesn't support compression? A GIF image

  1   2   >