Re: [go-nuts] Reaching infinity

2016-11-16 Thread Nikita Loskutov
@Pietro Gagliardi (andlabs) Oh, thank you, I fixed it. @Michael Jones I think nothing will changed in case of fmt.Println(math.Inf(0)) or defer, because it never triggered. @kortschak I'll think about it :) Any ideas how to improve "infinity depth"? четверг, 17 ноября 2016 г., 2:22:02 UTC+4

Re: [go-nuts] implement 'error operator' in go similar to rust?

2016-11-16 Thread Ian Lance Taylor
On Wed, Nov 16, 2016 at 9:36 PM, Nick Evgeniev wrote: > > I've just read about 'error operator - ?' introduced in rust > https://www.infoq.com/news/2016/11/rust-113-released and ... do you think we > could see something like this in go as well? > > It could eliminate lot's of

[go-nuts] implement 'error operator' in go similar to rust?

2016-11-16 Thread Nick Evgeniev
hi, I've just read about 'error operator - ?' introduced in rust https://www.infoq.com/news/2016/11/rust-113-released and ... do you think we could see something like this in go as well? It could eliminate lot's of 'idiomatic if spaghetti' in go programs... hopefully it's less complex than

Re: [go-nuts] Enforcing decimal output when using json.Encode

2016-11-16 Thread Caleb Spare
> So my question is: Prior to go 1.8's release, how can we force float64 > values to be output in decimal? This is a problem for me specifically > because our mobile user's report their lat/lon with six places of precision. > Trying to dump that output to JSON causes a bunch of unusable

[go-nuts] Enforcing decimal output when using json.Encode

2016-11-16 Thread Eric Greer
It appears that until go 1.8 releases, float64 values with six places of precision will always be output in scientific notation when sent through json.Marshal(). This recently fixed issue explains this: https://github.com/golang/go/issues/6384#issuecomment-261140529 In short, encoding

Re: [go-nuts] Memcached replacement in GO!

2016-11-16 Thread Hirotaka Yamamoto (ymmt2005)
> Basically the memcache*d* extension for PHP was buggy yeah, and that's the reason I wrote our own memcached client for PHP5 & 7. We believe it's very stable as we do not experience even a single failure in our cloud service for years. Please try out! https://github.com/cybozu/php-yrmcds/

Re: [go-nuts] Re: rows.Scan null values in database/sql error

2016-11-16 Thread Leopoldo Caballero
I did this: https://github.com/pitakill/go_api/blob/devel/person/person.go#L51 The important part is that the struct Person, use a pointer string in the fields that maybe/maybe not be null from the Database On Wednesday, November 16, 2016 at 1:00:39 PM UTC-6, m...@ualberta.ca wrote: > > Has

[go-nuts] Merging Data Structures in Go

2016-11-16 Thread mspaulding06
Hello, I'm trying to write some code that will merge together two arbitrary data structures. I have something that seems to work okay, but wondering if anyone has encountered this before and maybe has a more elegant solution. https://play.golang.org/p/bkBCjhtfBa Thanks, Matt -- You

Re: [go-nuts] Memcached replacement in GO!

2016-11-16 Thread Slawomir Pryczek
Here is nice page describing the issue: http://developers.nk.pl/tag/gc/ >The reality in nk.pl was that evictions of valid items happened hundreds >of times per second even though there were 50% of expired items, >because there is no inherent correlation between TTL and the pattern of usage.

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Dan Kortschak
Rename it buzz_lightyear.go On Wed, 2016-11-16 at 13:58 -0800, Nikita Loskutov wrote: > Is anybody know how to increase "infinities count"? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Michael Jones
Oh, and you could defer something at the start of main…that will wait forever to execute since the for loop never returns. From: Pietro Gagliardi Date: Wednesday, November 16, 2016 at 2:21 PM To: Michael Jones Cc: Nikita Loskutov

[go-nuts] [ANN] go-chartjs wrapper for chartjs plotting library

2016-11-16 Thread Brent Pedersen
Hi All, I've been working on: https://github.com/brentp/go-chartjs It's early days, but should have enough functionality to be useful. http://www.chartjs.org/ is an MIT licensed javascript lib to make plots on . It makes the plot only from the given JSON. So, go-chartjs just defines some

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Pietro Gagliardi
Run() waits for the process to exit, so in reality only the third thing there is ever run. Use Start() instead. select{} blocks forever. > On Nov 16, 2016, at 5:15 PM, Michael Jones wrote: > > After your for loop, you could add: > > fmt.Println(math.Inf(0)) > >

Re: [go-nuts] Reaching infinity

2016-11-16 Thread Michael Jones
After your for loop, you could add: fmt.Println(math.Inf(0)) From: on behalf of Nikita Loskutov Date: Wednesday, November 16, 2016 at 1:58 PM To: golang-nuts Subject: [go-nuts] Reaching infinity Hello!

[go-nuts] Reaching infinity

2016-11-16 Thread Nikita Loskutov
Hello! I've wrote this small code snippet in *STRICTLY ACADEMIC PURPOSE*, see comments. https://gist.github.com/cnaize/c106969508bdd898cc3b5026c110ed65 As I think in this 2 lines of the code where are "3 infinities": 1 - infinity for loop 2 - goroutines infinity 3 - program itself infinity Is

Re: [go-nuts] Memcached replacement in GO!

2016-11-16 Thread Jesper Louis Andersen
On Wed, Nov 16, 2016 at 3:10 PM Slawomir Pryczek wrote: > > - Much better Garbage Collection mechanism, that isn't skipping items with > short TTLs like LRU, so memory is not occupied with garbage data even if > item TTLs differ a lot. > > Could you expand on what this

[go-nuts] Re: Memcached replacement in GO!

2016-11-16 Thread Slawomir Pryczek
It's meant for different purpose i think (eg. CAS, inc/dec, php client, fast item reclaim)... Main purpose for this project is to allow easy operations on items when there's a lot of paralell access to the same keys, so there's eg. a very easy way of atomically modifying a value using just

[go-nuts] Re: .net core vs go

2016-11-16 Thread Sotirios Mantziaris
I am currently moving one of my applications to .net core. Currently i use Redis for caching, PostgreSQL and Nginx. All run in Linux except my Rest Service which runs in Windows. After the move to asp.net core i will host the application in Linux, probably docker. Could you point me to the one

[go-nuts] Re: .net core vs go

2016-11-16 Thread Dave Cheney
I think this discussion has served its purpose with respect to what this Go discussion forum can provide. Please conclude this debate. Thanks Dave -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: .net core vs go

2016-11-16 Thread Golden Ratio
I think you are being naive. You don't pay in terms of running the code per-se, but to get other parts of their toolchain that generally go together with the whole baggage, e.g. MSSQL, OS, support, updates, etc. That's the whole point. This would take the conversation in another direction and

[go-nuts] Re: .net core vs go

2016-11-16 Thread Sotirios Mantziaris
- I did not mention windows at all... so what's with that??? - And about the profit? they allow you to run your code on Linux and MS does not get a dime? The point is that you can develop .net core and don't pay anything to MS. - Yes VS Code is based on Github's electron framework,

Re: [go-nuts] Re: Memcached replacement in GO!

2016-11-16 Thread Henrik Johansson
Groupcache is really cool but for mutable data it requires some hoops to be useable. ons 16 nov. 2016 kl 20:50 skrev Tamás Gulácsi : > > > 2016. november 16., szerda 15:10:30 UTC+1 időpontban Slawomir Pryczek a > következőt írta: > > Hi Guys, I wrote memcached like

[go-nuts] Re: .net core vs go

2016-11-16 Thread Sotirios Mantziaris
I do not agree with the above. Let me explain: - First of all asp.net core and it's new web server kestrel should be used behind nginx or similar. Hiding it behind IIS is slow because of IIS and not because of kestrel. Check out the new https://www.techempower.com/benchmarks...

[go-nuts] Re: httputil.ReverseProxy adding 100+ ms of latency on localhost - any ideas?

2016-11-16 Thread Slawomir Pryczek
If you're on a beefy machine with recent linux, maybe MTU of loopback interface is set to 65k, setting it to default 1500 would help i think... ifconfig lo mtu 1500 up https://www.cyberciti.biz/faq/centos-rhel-redhat-fedora-debian-linux-mtu-size/ W dniu środa, 16 listopada 2016 06:01:50

[go-nuts] [ANN] - BoltHold - An embeddable NOSQL store for Go Types built on BoltDB

2016-11-16 Thread Tim Shannon
I've used BoltDB in a quite a few projects, and have found it to be fast and very reliable. But I've found that I was writing the same serialization and filtering code for each project, so I thought I'd try and build a more generic, reusable solution for

[go-nuts] template Inheritance

2016-11-16 Thread Manlio Perillo
I'm trying to use the new block action in the template package but I'm not sure to understand how it should be use. What I would like to do is something like template inheritance support in Jinja templating: http://jinja.pocoo.org/docs/dev/templates/#template-inheritance Thanks Manlio --

[go-nuts] Re: How can I make io.Reader stop reading?

2016-11-16 Thread Alexander Menzhinsky
Do you mean io.CopyContext? I wasn't able to find it. On Wednesday, 16 November 2016 18:22:25 UTC+3, Daniel Theophanes wrote: > > You can also use it.CopyContext and cancel the ctx. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] How can I make io.Reader stop reading?

2016-11-16 Thread Alexander Menzhinsky
func forward(src net.Conn, network, address string, timeout time.Duration) { defer src.Close() dst, err := net.DialTimeout(network, address, timeout) if err != nil { log.Printf("dial err: %s", err) return } defer dst.Close() cpErr := make(chan error) go cp(cpErr, src, dst) go

[go-nuts] How can I make io.Reader stop reading?

2016-11-16 Thread Daniel Theophanes
You can also use it.CopyContext and cancel the ctx. -- 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] Re: .net core vs go

2016-11-16 Thread 0xcf95
I have been managing Windows based environments for well over a decade and .Net is one of the most slowest stacks I have ever seen. That being said, I just finished configuring ASP.net Core Module on IIS (it's just been released) for a client and it's still dog slow (particularly the app

Re: [go-nuts] How can I make io.Reader stop reading?

2016-11-16 Thread Peter Waller
If connTwo is closed, Read will return io.EOF, and io.Copy will return. (With no error, because copy runs until io.EOF is reached). If that's not happening for you, can you give an example to reproduce? On 16 November 2016 at 14:49, Alexander Menzhinsky wrote: > When

[go-nuts] Memcached replacement in GO!

2016-11-16 Thread Slawomir Pryczek
Hi Guys, I wrote memcached like PHP-client and GO-server, with additional features, it is in production for a long time in my company (>6 months)... now it's open so if you're looking for some modern caching mechanism for PHP I invite everyone to use it... best of all, it works on windows and

[go-nuts] [JOB] #golang Senior back-end developer (Typeform, Barcelona)

2016-11-16 Thread Karolina Osiak
Thought this one could be interesting for the Go community! :) In case it would be something for you, drop me a line - karol...@careerslab.co *[Personal note] We at CareersLab love Typeform, keep using it for a few years now (you can see it at **careerslab.co/for-candidates*

[go-nuts] type map[string]..... is not an expression

2016-11-16 Thread sandip5159
package core type MyContext struct { CurClazz string CurLine int } -- package main import ( "fmt" "pkg/core" ) var us = map[string]core.MyContext

[go-nuts] Re: url.String() method fails to percent encode Path when certain characters are removed

2016-11-16 Thread Conner Hewitt
Thanks for the replies! What I'm still stumped on is if I remove the fragment character, shouldn't that parse the all of the characters after 'http://host/' as part of the path? It would make sense if the encoding failed when the fragment character was included in the string, rather than

[go-nuts] Re: url.String() method fails to percent encode Path when certain characters are removed

2016-11-16 Thread Robert Johnstone
Hello, The pound character (0x23) is the fragment identifier. I would have thought the fragment needs to be encoded as well, but from memory I'm not sure. Good luck, On Wednesday, 16 November 2016 08:18:54 UTC-5, Conner Hewitt wrote: > > Hi, > > I'm unsure if this is a bug or if this is

[go-nuts] Re: url.String() method fails to percent encode Path when certain characters are removed

2016-11-16 Thread Volker Dobler
# seperates the fragement so you are parsing two URLs with different structure: One with a fragment and one without. Fragement reasembly in String() works different than for path or query. V. Am Mittwoch, 16. November 2016 14:18:54 UTC+1 schrieb Conner Hewitt: > > Hi, > > I'm unsure if this is a

[go-nuts] url.String() method fails to percent encode Path when certain characters are removed

2016-11-16 Thread Conner Hewitt
Hi, I'm unsure if this is a bug or if this is working as expected, but wanted to see if anyone knows what's going on exactly with this. Calling url.Parse() on a string containing all byte ASCII characters (0-255 decimal), except the % (0x25) character, works as expected and calling the

[go-nuts] Re: working with the stacktrace: will this method work smoothly ?

2016-11-16 Thread mhhcbon
yeah I can only recall how targeted and precise my question was before i give an overall explanation that you d allow yourself to bless, or not. Some may take it as a word of god, others feel likes they are living under dictatorship... guess where i stand ;) Sorry i read that, *again*.