[go-nuts] RDF "encoding"

2016-11-27 Thread Johann Höchtl
I am relatively new to RDF. I plan to use https://github.com/knakk/rdf to serialize data I read from CSV Of course it fails to encode invalid IRIs like "example.com/A + B" where I read the information "A + B" from a CSV file. Is there a standard to perform IRIs encoding? Would URL-encoding the

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Jesper Louis Andersen
On Fri, Nov 25, 2016 at 10:51 PM Dave Cheney wrote: > > Yes, goroutine switching occurs a known points; effectively where the > goroutine is blocked from proceeding; sending and receiving on channels (if > they are full/empty respectively), trying to acquire a locked mutex, and > performing IO. T

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Dave Cheney
On Sun, Nov 27, 2016 at 10:25 PM, Jesper Louis Andersen wrote: > On Fri, Nov 25, 2016 at 10:51 PM Dave Cheney wrote: >> >> >> Yes, goroutine switching occurs a known points; effectively where the >> goroutine is blocked from proceeding; sending and receiving on channels (if >> they are full/empty

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Jesper Louis Andersen
On Sat, Nov 26, 2016 at 8:32 PM Olivier El Mekki wrote: > > This could yield interesting properties, because this means that even > using channels, maybe we could write concurrent code and still have a > chance to have predictable and reproducible execution in testing > environment. > > > I think

[go-nuts] Eliminating redundant map lookups

2016-11-27 Thread stinkingmadgod
The following code is taken from https://blog.golang.org/go-maps-in-action. type Person struct {Name stringLikes []string}var people []*Person*likes := make(map[string][]*Person)*for _, p := range people {for _, l := range p.Likes {*likes[

[go-nuts] Re: Eliminating redundant map lookups

2016-11-27 Thread stinkingmadgod
I should clarify that this actually came up in practice and I have no clue on how I can eliminate them -- 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-nut

[go-nuts] Re: stripping null in json string

2016-11-27 Thread C Banning
Not sure what you're looking for but here's a couple examples: https://play.golang.org/p/Rrg3kWkuGV On Thursday, November 24, 2016 at 2:02:20 PM UTC-7, Seanchann Zhou wrote: > > hi: >have json: > > "test": { > "test1": null, > "test2": null, > "test3": null, > "test4

[go-nuts] Re: Running commands via SSH

2016-11-27 Thread Manlio Perillo
Il giorno sabato 26 novembre 2016 19:35:28 UTC+1, kbur...@gmail.com ha scritto: > > Hi, I'd like to SSH to a remote host and run an arbitrary command. I found > this pretty difficult to do with existing Go libraries. > > The first problem I had was around escaping; commands run locally are > app

[go-nuts] Re: Eliminating redundant map lookups

2016-11-27 Thread Andrei Tudor Călin
In general, a good way to answer questions like this is to inspect an assembly listing for the code. This is what I compiled: $ cat foo.go package foo import ( "fmt" ) type Person struct { Name string Likes []string } func foo() { var people []*Person likes := make(map[string][]*Person) for _

Re: [go-nuts] Re: Eliminating redundant map lookups

2016-11-27 Thread 'Ian Cottrell' via golang-nuts
Yes you will get two map operations happen, one lookup and one assign. Wrapping the code into a (mildly modified for pretty output) runnable example: https://play.golang.org/p/oGKvfS9ssH In the basic case of a new key, there is no way to avoid doing both a lookup and assign, but in the case where

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Michael Jones
Wait… “If any of these fails to produce a correct result…” Really? I believe that we want the correct result under any valid schedule, including the most perverse, and that anything less means a failure of the design of the underlying system. Perhaps I misunderstand what you imply. From: on

Re: [go-nuts] Do Go Routines use continuations to allow yelding?

2016-11-27 Thread Jesper Louis Andersen
On Sun, Nov 27, 2016 at 5:47 PM Michael Jones wrote: > Wait… *“If any of these fails to produce a correct result…”* Really? I > believe that we want the correct result under any valid schedule, including > the most perverse, and that anything less means a failure of the design of > the underlying

[go-nuts] multiple html templates

2016-11-27 Thread keith6014
Hello, I am building a site which will have the following pages, "/" (home), "/about", and "/data" which will show some data using DataTables . "/", "/about" will be simple so I am using templates/base.html but for /data I would still like to use tempalt

Re: [go-nuts] Inevitable unexpected EOF

2016-11-27 Thread Dan Kortschak
I don't see anywhere that you are closing the gzip.Writer. Does doing that fix the problem? On Fri, 2016-11-25 at 05:12 -0800, Connor wrote: > Hi all. > > I'm trying to implement a structure which gzips multiple  > individually-inflatable messages in the same data stream. I've built > an  > examp

Re: [go-nuts] RDF "encoding"

2016-11-27 Thread Dan Kortschak
On Sun, 2016-11-27 at 01:46 -0800, Johann Höchtl wrote: > Is there a standard to perform IRIs encoding? Would URL-encoding the > read  > part be acceptable and interoperable? There is a published grammar for RDF, which defines the IRI grammar used. This can be used to write a parser. An example o

Re: [go-nuts] Inevitable unexpected EOF

2016-11-27 Thread thebrokentoaster
This is entirely proper behavior of the gzip implementation (or more specifically, compress/flate). At the edges of the LZ77 window (approximately 32KiB), you are not guaranteed that you can simply for loop over the gzip.Reader until the input buffer is zero since the implementation of the deco

[go-nuts] RDF "encoding"

2016-11-27 Thread Patrick Logan
Some CSV-specific specs are here... https://www.w3.org/blog/news/archives/5232?pk_campaign=feed&pk_kwd=csv-on-the-web-recommendations-published -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emai

Re: [go-nuts] Re: Eliminating redundant map lookups

2016-11-27 Thread 'Keith Randall' via golang-nuts
Yes, it currently requires two lookups (two hashes, two bucket searches, etc.). This general problem is issue 17133 (https://github.com/golang/go/issues/17133). Your example has the extra complication that the update operation is an append, not just a +=. On Sunday, November 27, 2016 at 7:00

Re: [go-nuts] CFG for a Go program

2016-11-27 Thread adonovan via golang-nuts
If you're building tools for source code analysis, you may find the golang.org/x/go/ssa representation easier to work with than the internals of the compiler. Build and run this command to see an example: $ go get golang.org/x/tools/cmd/ssadump $ ssadump -build=F fmt Alternatively, the cmd

Re: [go-nuts] Inevitable unexpected EOF

2016-11-27 Thread Connor Peet
That's exactly what I was look for, thanks so much! I've prefixed each message with its original size and it works perfectly. On Sunday, November 27, 2016 at 6:52:30 PM UTC-5, thebroke...@gmail.com wrote: > > This is entirely proper behavior of the gzip implementation (or more > specifically, c

[go-nuts] Re: goroutine scheduler is a trap?????!!!!!

2016-11-27 Thread 370265036
thanks for response. i am using the version is go1.7, i do not know it's detail version. yes, i have profiled my program,the cpu profile,16-core cpu and 8-core cpu both done.the percent of the same functions almost at the same,but the total cpu.this is interesting. i will follow your suggestion,

[go-nuts] Re: goroutine scheduler is a trap?????!!!!!

2016-11-27 Thread 370265036
thanks. i have checked my code and analyze the cpu prof file for many times.i do not see any problems. 在 2016年11月26日星期六 UTC+8上午2:45:13,Didier Spezia写道: > > Any non trivial program is scalable up a certain point. > In your code, you may have some contention. > It can be physical (CPU, memory, netw

Re: [go-nuts] CFG for a Go program

2016-11-27 Thread Michael Jones
Details of this would make a great Go Blog post… From: adonovan via golang-nuts Reply-To: Date: Sunday, November 27, 2016 at 6:07 PM To: golang-nuts Cc: Subject: Re: [go-nuts] CFG for a Go program If you're building tools for source code analysis, you may find the golang.org/x/go/ssa r

[go-nuts] Re: goroutine scheduler is a trap?????!!!!!

2016-11-27 Thread Dave Cheney
Are you able to share the profile with us? On Monday, 28 November 2016 13:56:08 UTC+11, 3702...@qq.com wrote: > > thanks. > i have checked my code and analyze the cpu prof file for many times.i do > not see any problems. > > 在 2016年11月26日星期六 UTC+8上午2:45:13,Didier Spezia写道: >> >> Any non trivial p

[go-nuts] Re: Hide struct fields from frontend code (JSON REST API)

2016-11-27 Thread Mirco Zeiss
That might work. Thank you! Will try and report back. -- 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. For more options,

[go-nuts] Checking whether html/css toggle switch has been set to on/off position in go

2016-11-27 Thread Chris S
Hi, I am trying to implement a toggle switch in my webpage. I've followed the site below for doing so: http://www.w3schools.com/howto/howto_css_switch.asp I currently have my html file set up with a button and this toggle switch. I also configured my webserver in go to be listening on localhos

Re: [go-nuts] GoLang assembly support shifted operands?

2016-11-27 Thread Wei . Xiao
I have filed the issue: https://github.com/golang/go/issues/18070 and submit a patch for it: https://go-review.googlesource.com/#/c/33595/ On Tuesday, November 15, 2016 at 9:50:00 AM UTC+8, william@gmail.com wrote: > > Do you have plan to restore them back for reducing code size? > > On Tuesd

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

2016-11-27 Thread vacuuz
I would just like to point out what a genuinely vile response this is. Your vague and menacing implication is that Florian is somehow a sexist because he disagrees with you is beneath you, Dave, and you should apologise. On Friday, November 25, 2016 at 6:26:40 PM UTC+13, Dave Cheney wrote: >

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

2016-11-27 Thread seanphaugh
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 they're done properly or just copied from a f

Re: [go-nuts] Field undefined error when trying to compile go file for parsing xml's

2016-11-27 Thread Konstantin Khomoutov
On Thu, 24 Nov 2016 22:20:44 -0800 (PST) Chris S wrote: > I am working on trying to parse an xml file with my go code. But I > keep on getting an error saying: > > ./main_v4.go:155: aggInfoXml.IpAddr.Hports undefined (type []Addr has > no field or method Hports) [...] > type AggInfoXml struct {

Re: [go-nuts] Field undefined error when trying to compile go file for parsing xml's

2016-11-27 Thread Chris S
Thanks for the response, working now! On Monday, November 28, 2016 at 1:47:12 AM UTC-5, Konstantin Khomoutov wrote: > > On Thu, 24 Nov 2016 22:20:44 -0800 (PST) > Chris S > wrote: > > > I am working on trying to parse an xml file with my go code. But I > > keep on getting an error saying: >