[go-nuts] Re: An issue with the select statement.

2018-05-04 Thread as
cenario which I haven't found a way to implement with the Go > channels and select statement while it's no problem to do it with the > select()/poll() functions. The scenario is as follows. > > Let me use a Go-like pseudo-code to demonstrate the idea. There is a > sourc

[go-nuts] Re: Why is there no standard `uuid` package?

2018-02-09 Thread as
Probably because UUIDv4 is the most common type and is trivial to approximate. For other requirements, there are non-RFC conformant implementations that achieve the desired properties https://github.com/segmentio/ksuid On Wednesday, February 7, 2018 at 5:43:08 PM UTC-8, 高橋誠二 wrote: > > Recentl

[go-nuts] Re: “Design Patterns: Elements of Reusable Object-Oriented Software” in Go

2018-02-02 Thread as
filepath.Walk). On Friday, February 2, 2018 at 9:03:54 AM UTC-8, matthe...@gmail.com wrote: > > I’m looking at patterns summarized on Wikipedia from “Design Patterns: > Elements of Reusable Object-Oriented Software” and writing out a few as the > equivalent in Go. > > Visitor:

[go-nuts] Re: [urgent] need aguments to justify use of Go for a scientific application

2017-12-08 Thread as
a language associated with academia (it's more practical and less theoretical) - There is a chance you will be paying someone to rewrite or port the Python version into a Go version later* *I speak from experience as someone who does this for C#, Python, C++ --> Go. Your mileage will vary

Re: [go-nuts] Re: Elphaba Chess

2017-12-02 Thread as
Transitive property abused for emphasis. On Saturday, December 2, 2017 at 7:06:15 PM UTC-8, hsmyers wrote: > > err…wouldn't that be "C an Bell product…" Bell Labs and all. > > On Sat, Dec 2, 2017 at 7:12 PM, as > wrote: > >> Calling Go a Google product m

[go-nuts] Re: Elphaba Chess

2017-12-02 Thread as
Calling Go a Google product makes as much sense as calling C a Nokia product. On Friday, November 24, 2017 at 7:23:06 PM UTC-8, Hugh Aguilar wrote: > > I invented a chess variation called: Elphaba Chess > This is just like International Chess except that the queen can't

Re: [go-nuts] Re: network programming about go

2017-12-01 Thread as
;> return >> } >> fmt.Println("reply from server:", rAddr.String(), string(buf[0:n])) >> n, err = conn.Read(buf[0:]) >> if err != nil { >> return >> } >> conn.Close() >> os.Exit(0) >> } >> } >> func checkError(err error)

golang-nuts@googlegroups.com

2017-11-19 Thread as
Shouldn't vet complain about this? I see this type of thing mostly in closed-source code https://play.golang.org/p/zl3gYi7QlE -- 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

[go-nuts] Re: Is there a way or lib to read a binary into a sturct{len int32;data [len]int32}

2017-11-08 Thread as
I made a code generator for this, but I consider it an unmaintained experiment at best. http://github.com/as/wire9 It can read a comment in the form //wire9 bstr n[4] data[n] and generate the type along with a binary codec for it type On Sunday, October 29, 2017 at 11:40:36 PM UTC-7, hui

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

2017-10-14 Thread as
I tested it with another font, and it definitely doesn't handle it. I'll have to fix that. https://github.com/as/frame/issues/26 On Tuesday, October 10, 2017 at 8:30:22 PM UTC-7, as wrote: > > For those of you who miss the Plan9 editable text boxes, here's a Go > p

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

2017-10-12 Thread as
ly, the worst answer is maybe it does and I just forgot about it. On Wednesday, October 11, 2017 at 7:17:01 PM UTC-7, Nigel Tao wrote: > > On Wed, Oct 11, 2017 at 2:30 PM, as wrote: > > https://github.com/as/frame > > Nice! > Thanks! On Wednesday, October 11, 2017 at 11:5

Re: [go-nuts] Strange behavior when dealing with certain emojis

2017-10-11 Thread as
>which puts a keycap symbol around the previous character Something about this sentence disturbs me. On Wednesday, October 11, 2017 at 3:36:16 AM UTC-7, Ian Davis wrote: > > > On Wed, 11 Oct 2017, at 11:16 AM, Gianguido Sorà wrote: > > Uhm, so the Replacer sees it as two sepa

[go-nuts] Re: go on Windows 10 from the bash shell (and the cmd shell)

2017-10-11 Thread as
A Go project is organized as a file system. The directory your go source files reside in indicate the name of the executable created with go build. On Tuesday, October 10, 2017 at 10:04:28 PM UTC-7, Pat Farrell wrote: > > I've installed the go 1.9 binary distribution on my window

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

2017-10-10 Thread as
For those of you who miss the Plan9 editable text boxes, here's a Go package that approximates them: https://github.com/as/frame It's not a c2go conversion, but the functionality is almost identical at the API level. A few extra things added - Raw ASCII bytes - Elastic tabstops

[go-nuts] Re: Why is there a slow-down to split one method of a struct pointer into two methods?

2017-10-08 Thread as
Take the loop and put it inside the function call. Don't make function calls in the body of a hot loop, take advantage of the loop optimizations in the runtime and your cpu cache. On Sunday, October 8, 2017 at 3:57:04 AM UTC-7, Zack Scholl wrote: > > Why is it that when I a method on an struct p

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

2017-10-05 Thread as
Thanks for clarifying that On Wednesday, October 4, 2017 at 11:13:25 PM UTC-7, Nigel Tao wrote: > > 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

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

2017-09-30 Thread as
y the data, but there other several ways to see it, like look for /Copyright/ in the resulting binary or TTF data. package main import ( "golang.org/x/image/font/gofont/gomono" "github.com/as/edit" "github.com/as/text" ) func main(){

[go-nuts] Re: Doing "C-like" things in Go

2017-09-18 Thread as
There's always a way to write confusing code in any language. var a,b int = 10,20 for a&b != 0 { do_something() } On Monday, September 11, 2017 at 5:07:48 PM UTC-7, Jon Jenkins wrote: > > I am a C developer and am trying to pick up Go. > > My question is this. C doesn't "care" about truthful

Re: [go-nuts] Issue with json unMarshall

2017-09-18 Thread as
If your field names match the JSON field names, you don't have to explicitly tag them. On Monday, September 18, 2017 at 6:10:46 AM UTC-7, Anil wrote: > > Thanks alot!! > > On Monday, 18 September 2017 18:38:49 UTC+5:30, Shawn Milochik wrote: >> >> Your struct has all unexported fields. So the jso

[go-nuts] Re: Bytconv where art thou

2017-09-14 Thread as
Strings are immutable, slices arent. Doesnt this make a string the optimal read only data structure for storing and passing around a run of bytes? If there is performance data, please share. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To u

[go-nuts] Re: [ANN]: A Text Editor based on Acme in Go

2017-09-08 Thread as
d port <https://github.com/as/frame> of plan 9's libframe, which is currently missing utf-8 support, but provides an editable text widget with a bitmap cache - Font drawing: An official Go package exists for that too. The frame port has a font cache of questionable utility

[go-nuts] Re: Tools for 80 column split for golang

2017-09-06 Thread as
auth.IsReferrer( http.HandlerFunc( lh.AddReferrerHandler)) On Wednesday, September 6, 2017 at 9:10:43 PM UTC-7, Sankar wrote: > > Hi > > Are there any tools available for golang to split lon

[go-nuts] [ANN]: A Text Editor based on Acme in Go

2017-09-06 Thread as
ditor firsthand (and I really need my nul bytes to remain uneaten). https://github.com/as/a I've tested it on Windows and Linux, and am happy enough with it to use it for editing Go along with some other languages, hopefully it will be of use to someone else as well. -- You received th

[go-nuts] Re: Why isn't golang input and output is buffered?

2017-08-31 Thread as
Once something is buffered, it can not be unbuffered. That is, the latency of the I/O operations permanently increase with respect to the properties of the buffering done underneath. Go does not buffer things by default because not everyone wants to buffer things by default. This is also why Na

Re: [go-nuts] Go channels overused and hyped?

2017-08-12 Thread as
ms, because computers since the IBM > 360/85 (1969), the DEC PDP-11/70 (1975), and a others before have memory > caches. They can also have multiple CPUs, multiple levels of memory cache, > and since 1964's CDC 6000, multiple threads active in a single CPU (the > basis of the f

Re: [go-nuts] "find" for Slices like "append"

2017-08-09 Thread as
For loops are not your enemy. Cyclomatic complexity in cute_loop_functions is. The for loop tells you something is happening. Your contains loop is always running for the entire length of the slice. -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

Re: [go-nuts] [ANN] Edit - Acme command language

2017-08-08 Thread as . utf8
Thanks for suggesting the Reader(q0, q1 int64) io.RuneReader. I accidentally replied off list. I wasn't aware of up to four horsemen being involved. The man pages didn't prepare me for this. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Go channels overused and hyped?

2017-08-08 Thread as . utf8
lopers. Because I just used go for a couple of months > for my private web projects and rarely get in touch with channels. > > By the way, that article is not a rant and the author likes go very much > as far as I can conclude from the article. > > Cheers snmed > -- You receiv

[go-nuts] [ANN] Edit - Acme command language

2017-08-08 Thread as . utf8
I'm sure this has been done already, but I thought I'd share my implementation of this here for anyone interested in using structural regular expressions in Go. It doesn't cover 100% of what Edit does in Acme, but its close enough that I can use the example program <https://

Re: [go-nuts] Re: [Blog] Context should go away for Go 2

2017-08-07 Thread as . utf8
channels as conduits. If I could wish for an idiom taken from operating systems, TLS/GLS wouldn't be my first choice. I see namespaces serving a similar role on Plan9. The ability to share a namespace with the child or parent process. Namespaces include the environment and allow the calle

[go-nuts] [Blog] Context should go away for Go 2

2017-08-07 Thread as . utf8
I also dont want to see context everywhere. At the same time, I don't want it to be obfuscated in a confusing way. ctx is an unfortunate initialism and context.Context package stuttering doesn't help. I suppose you could stuff a pointer on the stack pointing to a potential context and then p

[go-nuts] Re: Generics are overrated.

2017-08-04 Thread as . utf8
I'm hesitant to accept generics due to the fear of *overloaded operators *being the next big deal*. *C# even has *properties (user-defined methods dispatched upon an assignment operation)*. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

[go-nuts] Re: gitcreepy – get GitHub users' previous email addresses from all their historical commits!

2017-08-04 Thread as . utf8
This information is actually stored in the git commits themselves. There is a zlib'd field that contains the author's name and email address for each commit in the repo. A complete transcript for every commit can be reconstructed from a git repo in this manner. On Saturday, July 15, 2017 at 5:5

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

2017-08-04 Thread as . utf8
. I've not used the widgets much, and ended up porting/reimplementing <http://github.com/as/frame> Plan 9's libframe due to my inability to understand how to get editable text on the screen. This was over a year ago, so things may have changed. I agree with the general consensus,

[go-nuts] Re: Disadvantage of Go

2017-01-16 Thread as . utf8
, hui zhang wrote: > > Disadvantage of Go > 1 No Generic For Now > That make user coding repeat code many times, even for basic type such as > int float bool > It is not easy , even to make a generic min function. > using interface will always check type casting. > and for

[go-nuts] Re: shiny: get mouse position relative to window

2017-01-16 Thread as . utf8
tps://godoc.org/github.com/as/ms/win On Saturday, January 14, 2017 at 8:47:17 AM UTC-8, kty...@gmail.com wrote: > > How do I get the position for a mouse.Event in shiny using > golang.org/x/mobile/event.mouse? > > The position returned is the global position on the screen, which changes

[go-nuts] Deleting the /r/golang subreddit

2016-11-26 Thread as . utf8
I don't use the site, nor understand how any immediate conflicts of interest can manifest based on the CEO's actions that justify removing the subreddit or locking it down. Why not add a community to the official golang.org site and let the subreddit die of natural causes? It would be a favorab

Re: [go-nuts] Small complete examples which show the power of Go?

2016-08-13 Thread as . utf8
It's shorter, but it's harder for me to grasp what it does as easily as the first example. On Wednesday, August 10, 2016 at 2:09:58 AM UTC-7, Anmol Sethi wrote: > > You can shorten that by 6 lines > > package main > > import "net/http" > > func ma

[go-nuts] Re: OS X Installer: Why modify $PATH instead of adding symbolic links to /usr/local/bin?

2016-07-20 Thread as . utf8
This is just a guess based on the origins of the language, but the design decision probably stems from a dim view of symbolic links. They are seen as ugly hacks that carry persistent state on the filesystem instead of a higher control plane such as a per-process namespace. The path variable

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread as . utf8
> > https://blog.golang.org/slices specifically mentions that arrays and > slices are not similar. The spec does as well. Currently, slices do NOT > compare. I am simply arguing that they could very logically. > > The "==" operator is only overloaded in the case of

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread as . utf8
iptor of an aggregate. 3. A struct can resemble a slice 4. If a slice can be compared as a struct holding a descriptor, then maps can have slices as keys 5. Because it benefits this use case, it is a good feature to add to the language Enumerating the drawbacks of this feature is more useful

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread as . utf8
y was borne. And also > because you didn't really answer the question as I asked (by quoting the > spec) which I found funny. > > Alas, I guess we couldn't see eye to eye. > > But chill a little bit. I have given all the hardcoded proofs and people > have just given m

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-03 Thread as . utf8
e work... > Otherwise, the behaviour of maps, slices and funcs cannot be fully > explained. > > On Sunday, July 3, 2016 at 7:25:31 AM UTC+2, as@gmail.com wrote: >> >> Go does not have reference types. As far as I know, the word was >> purposefully removed f

Re: [go-nuts] Re: Relaxing rules on slice comparison: would it make sense?

2016-07-02 Thread as . utf8
Go does not have reference types. As far as I know, the word was purposefully removed from the spec to remove the ambiguity surrounding the word. https://groups.google.com/forum/m/#!topic/golang-dev/926npffb6lA -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: How to decrypt data with AES in golang

2016-07-02 Thread as . utf8
An IV is not a key, it just changes the state of the block chain and must the same size as the block. The key can be a different size than the block, the IV can not in this case. Your program complains because you are reusing the key as an IV, and this key-IV happens to be a different size than

Re: [go-nuts] redirect already running processes stdout

2016-07-01 Thread as . utf8
Most systems don't support this functionality without a kernel patch or debugger trick. You can manipulate the file descriptor before the process is born, everything afterwards is luck or system specific. In Go, you have a lot more power: os.Stdout, os. Stderr = os.Stderr, os.Stdout fmt.Prin

Re: [go-nuts] How to be safe in Go?

2016-06-24 Thread as . utf8
I wasn't referring to concurrency within package scope, but data crossing package boundaries (the earlier post says libraries' are responsible to ensure data passed *to* them is safe). The map type reveals an implementation detail by documenting that it isn't safe for parallel use. On Friday,

Re: [go-nuts] How to be safe in Go?

2016-06-24 Thread as . utf8
of the operations its used for. There's an illusion of safety in languages that advertise all-encompassing abstractions, in my experience the problem becomes the language or library itself, as the underpinnings acquire code bloat to cover all use-cases. If this happens, the user mus

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
Security has little to do with this. It's a "legal" problem: Unfortunately, this code has to be removed due to legal concerns. We > apologize for any inconvenience this causes you. https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.org/thread/RDAHDK4RKN477G2ZDSX4DZT5ED

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
Go should not encourage distribution builder shenanigans. The effective way to solve this problem is by submitting it as an issue to the appropriate community it affects. A high search rank will accumulate based on the popularity of this issue, and the feedback (blame) will flow to the

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
If the distribution builders can take it out, what is preventing them from adding their own documentation? On Monday, June 20, 2016 at 9:06:26 PM UTC-7, Joshua Chase wrote: > > Yep, that's exactly what I'm saying. > > > https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.

Re: [go-nuts] [ANN] Mirror of Go SSA

2016-06-16 Thread as . utf8
That's because you are mirroring the compiler's internal ssa package. Sharing it as compile/ssa would probably remove this unintuitive name clash. On Thursday, June 16, 2016 at 1:52:31 AM UTC-7, JW Bell wrote: > > I've used golang.org/x/tools/go/ssa, it doesn't have

Re: [go-nuts] [ANN] Mirror of Go SSA

2016-06-16 Thread as . utf8
Have you tried to *go get golang.org/x/tools/go/ssa *? On Wednesday, June 15, 2016 at 10:54:05 AM UTC-7, JW Bell wrote: > > >>I have to say that I don't see a big benefit to mirroring a github > repo on github itself. > There isn't another way to use the ssa package. > > On Tuesday, June 14, 201

[go-nuts] Re: Problem with `go run *.go` in windows CMD - winapi error #123

2016-06-14 Thread as . utf8
How exactly do you propose this be fixed? Windows has a crippled shell that thinks programs should process and interpret their own asterisk characters. This turns into a major inconsistency across windows CLI tools. I dont think Go should tailor itself to badly designed plumbing. -- You recei

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread as . utf8
secrecy should rely solely on the key. If you don't like passwords, you can store the key on a flash drive as a file or even write it directly to the underlying block device. On Monday, June 13, 2016 at 10:12:25 PM UTC-7, Haddock wrote: > > Thanks for all the useful answers. A

Re: [go-nuts] Re: Better sum types for go

2016-06-13 Thread as . utf8
Thanks! On Monday, June 13, 2016 at 3:27:51 AM UTC-7, Jesper Louis Andersen wrote: > > > On Mon, Jun 13, 2016 at 1:58 AM, > wrote: > >> What research or other literature can you recommend on the topic of type >> theory? > > > Benjamin C. Pierce's "Types and Programming Languages", often abbreviat

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread as . utf8
This is a key distribution problem, if you store the key in the executable you should assume everyone already has access to the key. This is a different problem than "can someone get the key out of running memory". If you store the key in the executable, then an existential compromise of this k