Re: [go-nuts] Shiny

2016-08-18 Thread Joe Blue
Do you want anyone to help on the material design "widgets" yet ? On Thu, Aug 18, 2016 at 8:26 AM Nigel Tao wrote: > 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

[go-nuts] Re: SSA back-translation / destruction

2016-08-18 Thread HWJ
My experience in TARDISgo was that Name() was stable and correct, see https://github.com/tardisgo/tardisgo/blob/89fb026cf24627db3bddabb754fed9500b5cabcd/haxe/base.go#L62 Good to know, thanks for sharing. My primary question is whether I should transform ssa.Value into another type that allows

[go-nuts] cmdline--improve Golang std.flag based on Go src v1.7

2016-08-18 Thread Ally Dale
Hi, everyone, I have create a package named cmdline to extend std.flag based on Go src v1.7 Then, we can make a command usage page more easily and with enough information. So, I wonder if the Go authors can merge this change into std.flag, to help gophers make a command line page mo

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-18 Thread andrewchamberss
thanks for posting. About adding to the stdlib: I don't think non backwards compatible changes can ever be added to the go stdlib. On Thursday, August 18, 2016 at 10:11:35 PM UTC+12, Ally Dale wrote: > > Hi, everyone, > I have create a package named cmdline to extend std.flag based on Go > s

[go-nuts] Getting root file path of USB pen drive

2016-08-18 Thread anjaanaadmi42
I am using Go to write an app that can copy some files to a USB pen drive. A web-based interface running on localhost will allow users to select the drive location where the files need to be copied. I am developing this on a Mac, with the goal of deploying the app on a Raspberry Pi 3 device runn

[go-nuts] golang.org/x/net/ipv4 windows support

2016-08-18 Thread bariman
Does anyone know what it would take to implement the windows ControlMessage functions for the golang.org/x/net/ipv4 package? I am using the ipv4 package to specify the outgoing interface index of UDP requests. The following example works correctly on linux but fails with not supported by window

[go-nuts] runtime: split stack overflow

2016-08-18 Thread martin . strenge
Hi, i'm trying to replace a Go signal handler by a C signal handler and try to call the stored Go handler inside that C handler. It works well on Linux, but on Darwin I receive a "runtime: split stack overflow" exception. Is that supposed to work on OSX? Thanks! Martin Example program: packa

Re: [go-nuts] How to initialize two dimension array

2016-08-18 Thread alexanderyau92
func Pic(dx, dy int) [][]uint8 { pic := make([][]uint8, dy) for i := 0; i < dy; i++ { pic[i] = make([]uint8, dx) for j := 0; j < dx; j++ { pic[i][j] = uint8(float64(i)*math.Log(float64(j))) } } return pic } 在 2010年5月5日星期三 UTC+8上午12:30:56,Yang Yang写道: > > Hi, All > > I'm new to Go programming la

[go-nuts] Re: cmdline--improve Golang std.flag based on Go src v1.7

2016-08-18 Thread Hotei
I assume you're aware it's valid to have two initializers for the same variable.? I often use -v and -verbose to both modify flagVerbose. var flagVerbose bool func init() { boolVar(&flagVerbose,"v" boolVar(&flagVerbose "verbose" } Other than that I don't see what your package is act

Re: [go-nuts] Getting root file path of USB pen drive

2016-08-18 Thread Andy Balholm
On Mac, you can get a listing of /Volumes, and ignore whichever entry is a symlink to / (since that is the boot drive). This will give you both external drives and network shares; I’m not sure if there is an easy way to distinguish the two; one possibility is that physical drives seem to be owne

[go-nuts] Re: Differences in archive/zip between 1.6.3 / 1.7

2016-08-18 Thread Hotei
Because zip compression programs can use different levels of compression there is certainly no expectation that zipping the same file with different compression levels will give the the same output. It MIGHT - but it's not to be expected or relied upon. The only thing that's "guaranteed" is th

Re: [go-nuts] How to initialize two dimension array

2016-08-18 Thread Seb Binet
On Thu, Aug 18, 2016 at 9:32 AM, wrote: > func Pic(dx, dy int) [][]uint8 { > pic := make([][]uint8, dy) > for i := 0; i < dy; i++ { > pic[i] = make([]uint8, dx) > for j := 0; j < dx; j++ { > pic[i][j] = uint8(float64(i)*math.Log(float64(j))) > } > } > return pic > } > > [][]uint8 is not an array:

[go-nuts] import csv file

2016-08-18 Thread francis badasu
Hi guys, How do i import a csv file and save it in sql or sqlite thanks in advance -- 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...@g

Re: [go-nuts] import csv file

2016-08-18 Thread asit dhal
There is a csv package in golang  https://golang.org/pkg/encoding/csv/ There is a sql package in golang too https://golang.org/pkg/database/sql/ For sqlite https://godoc.org/github.com/gwenn/gosqlite You need to use csv parser and insert into sqlite database. Warm Regards, Asit http://bit.ly/19

[go-nuts] Re: import csv file

2016-08-18 Thread Asit Dhal
There is a csv package in golang https://golang.org/pkg/encoding/csv/ There is a sql package in golang too https://golang.org/pkg/database/sql/ For sqlite https://godoc.org/github.com/gwenn/gosqlite You need to use csv parser and insert into sqlite database. Warm Regards, Asit http://bit.ly/19

[go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread T L
package main type I1 interface { f1() fa() } type I2 interface { f1() fb() } type I interface { I1 I2 } // error: duplicate method f1 func main() { } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe fro

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread Anmol Sethi
If you did: var i I // initialize i i.f1() Embedding I1 and I2 exposes their methods/fields as members of I. So when you do i.f1(), which f1 method should be called? > On Aug 18, 2016, at 1:41 PM, T L wrote: > > > package main > > type I1 interface { > f1() >

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread 'Axel Wagner' via golang-nuts
Hm? The answer is obvious, isn't it? The one of whatever you put into i (the thing you left out when you commented "initialize i"). The only reason I can think of why this would be disallowed (except "who cares?"), would be a situation like this: type Foo struct { I1 I2 } As Foo embeds b

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread T L
On Friday, August 19, 2016 at 1:47:45 AM UTC+8, Anmol Sethi wrote: > > If you did: > > var i I > // initialize i > i.f1() > > Embedding I1 and I2 exposes their methods/fields as members of I. So when > you do i.f1(), which f1 method should be called? > just @Axel Wa

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread T L
On Friday, August 19, 2016 at 2:05:24 AM UTC+8, Axel Wagner wrote: > > Hm? The answer is obvious, isn't it? The one of whatever you put into i > (the thing you left out when you commented "initialize i"). > > The only reason I can think of why this would be disallowed (except "who > cares?"), w

Re: [go-nuts] Shiny

2016-08-18 Thread Joe Blue
Howard, Your summary is excellent. I went through all the same repo's and came to the same conclusions. Thanks for summarising the state if play. There is also some very impressive work by Skinner over at: https://github.com/dskinner/material The branch called mediansdf has impressive font impr

[go-nuts] Re: when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread 'simon place' via golang-nuts
this is an important concept in go. putting interfaces in interfaces is just shorthand/syntactic sugar, its never necessary, its purpose is having each set of method signatures only once, which should help conceptualisation, and aid progressive development. I doesn't care if its been built from

[go-nuts] Same type different values

2016-08-18 Thread sridhar . chandramouli
I need a little help understanding what's going on here: https://play.golang.org/p/8HydwIfgP3 The same type is being used to create 2 value pointers. Shouldn't the created pointers be equal ? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Define method on scope-local type

2016-08-18 Thread Joshua Liebow-Feeser
Hi All, TL;DR: While you can define types inside of functions (or scopes inside of functions), those types can't have methods on them. This limits the usability of this feature. I propose that we add the ability to define methods on scope-local types. This came up while discussing the limitati

[go-nuts] Define method on scope-local type

2016-08-18 Thread Joshua Liebow-Feeser
Hi All, TL;DR: While you can define types inside of functions (or scopes inside of functions), those types can't have methods on them. This limits the usability of this feature. I propose that we add the ability to define methods on scope-local types. This came up while discussing the limitati

[go-nuts] Re: Same type different values

2016-08-18 Thread ccross via golang-nuts
On Thursday, August 18, 2016 at 3:24:12 PM UTC-7, Sridhar wrote: > > I need a little help understanding what's going on here: > > https://play.golang.org/p/8HydwIfgP3 > > The same type is being used to create 2 value pointers. Shouldn't the > created pointers be equal ? > reflect.DeepEqual takes

Re: [go-nuts] Shiny

2016-08-18 Thread howardcshaw
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 gesture event. but in my testing trying to integrate

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread Ian Lance Taylor
On Thu, Aug 18, 2016 at 10:41 AM, T L wrote: > > package main > > type I1 interface { > f1() > fa() > } > > type I2 interface { > f1() > fb() > } > > type I interface { > I1 > I2 > } // error: duplicate method f1 > > > func main() { > } https://golang.org/issue/6977 Ian

Re: [go-nuts] runtime: split stack overflow

2016-08-18 Thread Ian Lance Taylor
On Thu, Aug 18, 2016 at 6:56 AM, wrote: > > i'm trying to replace a Go signal handler by a C signal handler and try to > call the stored Go handler inside that C handler. It works well on Linux, > but on Darwin I receive a "runtime: split stack overflow" exception. Is that > supposed to work on O

Re: [go-nuts] Shiny

2016-08-18 Thread howardcshaw
My poor brain is melting. I was just worried about vendoring shiny and the effect of that on producing something to be easily embedded in other people's programs... while writing a (successful, mind!) wrapper of sigint.ca/graphics/editor that makes it fit the Widget node.LeafEmbed model of shin

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

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

2016-08-18 Thread Randall Farmer
Yeah, sorry, was silly of me to compare to other stdlib additions without knowing their context. Something I wish I'd highlighted--there's a real win at 1K ints or strings, not just for tons of elements: benchmark old ns/op new ns/op delta BenchmarkSortString1K 157053

Re: [go-nuts] Getting root file path of USB pen drive

2016-08-18 Thread anjaanaadmi42
On Thursday, August 18, 2016 at 9:34:08 PM UTC+5:30, Andy Balholm wrote: > > > A potential cross-platform option would be to parse the output of the > mount command (with no arguments, it prints a list of mounted volumes). But > the filtering could be a challenge. > > > FWIW, I found this pack

Re: [go-nuts] Shiny

2016-08-18 Thread Sam Boyer
Yep, this is one of those nasty, known issues with vendoring right now. this exact issue was first raised on this list here: https://groups.google.com/d/msg/golang-nuts/AnMr9NL6dtc/UnyUUKcMCAAJ. We've got a crew coming together soon to address this issue, among many others: https://docs.googl

Re: [go-nuts] when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread T L
On Friday, August 19, 2016 at 7:28:26 AM UTC+8, Ian Lance Taylor wrote: > > On Thu, Aug 18, 2016 at 10:41 AM, T L > > wrote: > > > > package main > > > > type I1 interface { > > f1() > > fa() > > } > > > > type I2 interface { > > f1() > > fb() > > } > > > > type I i

[go-nuts] Weired or not?

2016-08-18 Thread T L
package main type S1 struct { } func (*S1) f() {} type S2 struct { S1 } // var _ = S1.f // S1.f undefined (type S1 has no method f) // var _ = S2.f // S2.f undefined (type S2 has no method f) var _ = (*S2).f // ok! func main() {} -- You received this message because you are subscribed to t

[go-nuts] Re: SSA back-translation / destruction

2016-08-18 Thread Elliott Stoneham
> > My primary question is whether I should transform ssa.Value into another > type that allows SSA transformation (register renaming etc.) or if > there's a chance the x/tools/go/ssa package will be extended to allow > this. > The x/tools/go/ssa package exists to do static analysis, so SSA