Great, I found this page
"https://www.vividcortex.com/blog/2015/01/19/gos-connection-pool-retries-and-timeouts/
and it's really useful!!!
Hope to help someone else.
Il giorno venerdì 17 giugno 2016 23:26:08 UTC+2, Danilo Cicerone ha scritto:
>
> Thanks ain, that's another brick in the wall.
>
Here is a golang version of Daniel Bernstein's "eratspeed", which is a straight
translation of his C code to golang without any changes other than as necessary
to make it work: https://play.golang.org/p/Sd6qlMQcHF.
It won't run on the golang playground because it takes too long unless one
chan
I would also like to hear from somebody about a real world use-case. I
don't pretend to be proficient in this realm of functional programming, but
I would be very surprised if this is valuable in a language like Go that
can and does hold state. That said, this is very cool and I would love to
b
This could be caused by setting GOROOT to a value that does not match the
`go` binary in your path. If you have another version of Go installed,
please remove it, unset GOROOT, and follow the installation instructions on
the Go website.
On Saturday, 18 June 2016 12:02:03 UTC+10, Hiroaki Nakamu
go test -work should do it.
On Saturday, 18 June 2016 12:02:03 UTC+10, Hiroaki Nakamura wrote:
>
> Hi,
>
> Here are commands I used to set up gopkg.in/vmihailenco/msgpack.v2
>
> go get -u gopkg.in/vmihailenco/msgpack.v2
> cd $GOPATH/src/gopkg.in/vmihailenco/msgpack.v2
> go get -u github.com/ug
Hi,
Here are commands I used to set up gopkg.in/vmihailenco/msgpack.v2
go get -u gopkg.in/vmihailenco/msgpack.v2
cd $GOPATH/src/gopkg.in/vmihailenco/msgpack.v2
go get -u github.com/ugorji/go-msgpack
go get -u github.com/ugorji/go/codec
go get -u gopkg.in/check.v1
And I tried to run tests and go
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
OK, so designers will want to quickly test their app at specific screen
sizes. I think we just need to determine the best option because there
doesn't seem to be a gomobile best practice.
It sounds like we have the following options:
1. Run a script to resize the window (
http://www.labnol.org/sof
https://play.golang.org/p/8R6QmYw_28
On Fri, Jun 17, 2016 at 3:08 PM Evan Digby wrote:
> To further this, if you do need your internal model to be a concrete
> struct rather than interface this approach still fits:
>
> https://play.golang.org/p/_wrgN1FltA
>
>
> On Friday, 17 June 2016 15:02:43 U
On Friday, June 17, 2016 at 4:48:06 PM UTC+2, gordo...@gmail.com wrote:
> > I don't see the point to the exercise as far as optimizing golang is
> > concerned.
> It is a general rule that using more registers results in faster code.
Yes, except when they're wasted as in using the extra register
To further this, if you do need your internal model to be a concrete struct
rather than interface this approach still fits:
https://play.golang.org/p/_wrgN1FltA
On Friday, 17 June 2016 15:02:43 UTC-7, Evan Digby wrote:
>
> One approach to deal with this would be to abstract your internal model a
Thanks -- I should have clarified that we've ruled that option out (it
was our first approach), since we want to stick to the built in types
that won't require explicit exchange with the primitive types.
jonathan
On Fri, Jun 17, 2016 at 02:56:49PM -0700, Edward Muller wrote:
> AFAIK (and someone
One approach to deal with this would be to abstract your internal model as
an interface from the model you receive and mutate them to match. This also
gives you the power to truncate/round/mutate a float however best suites
your needs rather than hoping the library truncates/rounds/mutates in a
If the library made no provision for the caller to give a unique token
which would help to identify it in the callback then that library does
not expect to have more than one caller-and-callback in play at any
one time, or, even worse, expects you to arrange some thread-local
storage in the caller
AFAIK (and someone will probably provide something better) you need to do
something like this:
https://play.golang.org/p/riq-m6cgZu
> On Jun 17, 2016, at 2:37 PM, jg...@bitgirder.com wrote:
>
> We have an upstream provider of JSON data which sends integer data
> types as floating point literal
We have an upstream provider of JSON data which sends integer data
types as floating point literals with a "0" decimal part. By default
json.Decoder doesn't allow this and fails:
https://play.golang.org/p/MEJlg1n3vs
Unfortunately this provider is almost certain not to change this, and
so we j
Thanks ain, that's another brick in the wall.
--
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, visit ht
'go install' worked; thanks a ton! I'll also take a look at the other stuff
you mentioned because I'm curious about the details.
On Fri, Jun 17, 2016 at 5:15 PM, adonovan via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> On Friday, 17 June 2016 15:21:55 UTC-4, Joshua Liebow-Feeser wrote:
>
On Friday, 17 June 2016 15:21:55 UTC-4, Joshua Liebow-Feeser wrote:
>
> Hi All,
>
> I'm trying to use the go/* packages to parse and type check Go source
> code. I've downloaded github.com/coreos/etcd to test this on, and I'm
> currently trying it out in the etcdserver subdirectory. When I run 'g
On Fri, Jun 17, 2016 at 12:18 PM, Andrey Salnikov
wrote:
>
> But actually I don't understand how to receive context inside callback from
> C-code. May be I'm wrong here but as I understand you mean that I have to
> identify instance of *A using callback parameters received from C-side. But
> what
On Fri, Jun 17, 2016 at 6:34 AM, wrote:
>
> Thanks, is there a way to know what to expect in later versions (
> 1.8,1.9,1.10 and so forth ... ) ?
We do not have a general roadmap, no. We expect the new SSA based
compiler to replace the old compiler on all targets. We expect to
continue to impr
On Fri, Jun 17, 2016 at 2:23 PM, Dmitry Orlov wrote:
> If I understand it correctly, go scheduler instruments code with additional
> yield points not related to I/O. That can help fairness too.
It will sometimes pre-empt on function calls, but this can get a bit
hairy since you can't always be su
Thanks Ian,
On Thu, Jun 16, 2016 at 12:13 PM, Ian Lance Taylor wrote:
> On Thu, Jun 16, 2016 at 11:27 AM, Dmitry Orlov
> wrote:
> >
> > I am curious how does goroutine scheduler picks what goroutine to run,
> among
> > several runnable. Does it optimize for fairness in any way?
>
> The current
Hi All,
I'm trying to use the go/* packages to parse and type check Go source code.
I've downloaded github.com/coreos/etcd to test this on, and I'm currently
trying it out in the etcdserver subdirectory. When I run 'go build'
everything works fine, but when I try to type check, none of the impo
Hi Andrey! thanks for answer!
But actually I don't understand how to receive context inside callback from
C-code. May be I'm wrong here but as I understand you mean that I have to
identify instance of *A using callback parameters received from C-side. But
what about if I'll receive only sum of
Note that Go's reflect package is powerful enough to implement
currying directly, though you do have to convert back to the expected
type in order to call the function.
https://play.golang.org/p/2ukRfHGnlT
Ian
--
You received this message because you are subscribed to the Google Groups
"golang
On Fri, 17 Jun 2016 00:50:20 -0700 (PDT)
User123 wrote:
[...]
> When i return http response from a function should i use
> *func makeCalls() (string, error, *http.Response, error) *
> or
> *func makeCalls() (string, error, http.Response, error) *
>
> For the struct i created above what should b
> but I still want to test my app at explicit screen sizes
testing on actual hardware is still going to be the best, but I'd imagine
there's something out there for OSX that'd let you specify the exact window
size (of any window open).
> Also, Android best practices does recommend as an option cr
Thanks. I'm wondering how I can test my UI efficiently with gomobile. So,
I will create a responsive design as you recommend, but I still want to
test my app at explicit screen sizes to mimic the actual user experience,
rather than approximate it.
The use case is someone who wants to support iPho
On Friday, 17 June 2016 18:50:59 UTC+3, Olivier Gagnon wrote:
>
> https://play.golang.org/p/yE7UVXcXm3
>
> The key point here is that all the RHS of the `Cross` function must be
> evaluated before the LHS is assigned. But I need to have a guarantee that
> we won't assign before having evaluated t
https://play.golang.org/p/yE7UVXcXm3
The key point here is that all the RHS of the `Cross` function must be
evaluated before the LHS is assigned. But I need to have a guarantee that
we won't assign before having evaluated the LHS.
--
You received this message because you are subscribed to the
I doubt that the cgo_callback method has the type the C library
desires. from https://golang.org/ref/spec#Method_declarations:
The type of a method is the type of a function with the
receiver as first argument.
I.e., the type of cgo_callback is func(a *A, ...).
The solution is to have
On Friday, June 17, 2016 at 4:48:06 PM UTC+2, gordo...@gmail.com wrote:
>
> I don't see the point to the exercise as far as optimizing golang is
> concerned.
It is a general rule that using more registers results in faster code.
> Your experiment just shows that Your compiler (GCC?)
My post
On Friday, June 17, 2016 at 5:32:25 PM UTC+3, Danilo Cicerone wrote:
>
> Hi to all,
> I'm new here and using golang too. I've read some articles and post on
> Connection Pooling" but I'm still confused. What I'm looking for is a rule
> of thumb that make me easy to decide when use connection po
I don't see the point to the exercise as far as optimizing golang is concerned.
Your experiment just shows that Your compiler (GCC?) missed an optimization as
far as reducing backend latency goes.
You may also find that swapping the order of some of the instructions such as
the second and the
I don't see the point to the exercise as far as optimizing golang is concerned.
Your experiment just shows that Your compiler (GCC?) missed an optimization as
far as reducing backend latency goes.
You may also find that swapping the order of some of the instructions such as
the second and the
Currying is translating the evaluation of a function with multiple arguments
into evaluating a sequence of functions with one argument. Not sure how this
doesn't qualify, even if a closure was used to accomplish this.
As for the value, at the very least there is the same value as using closures
Hello,
Could you guys please help me.
I can't find how to export method function which belongs to some go-struct
to C-code (cgo part) as callback. I know how to export simple function
which not belongs to any type and use it as callback for C-function, but is
it possibly to export method of c
Hi to all,
I'm new here and using golang too. I've read some articles and post on
Connection Pooling" but I'm still confused. What I'm looking for is a rule
of thumb that make me easy to decide when use connection pool. My scenario
isn't so complicated:
- a web application that makes CRUD ope
Hi All
I am using Go version 1.6.2 and Gomobile (sha +6b7a416 from the tip) and to
build an Android library. Our code is mostly networking
"encoding/json"
"fmt"
"log"
"math/rand"
"net"
"sort"
"time"
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
Yes, To16 gives you a 16 byte version of an IP address, which can be IPv4
or IPv6. Normally it is sufficient to just call To4 to determine if it is
an IPv4 address or not and assume if it is not it must be an IPv6 address:
func IsIPv4(ip net.IP) bool { return ip.To4() != nil }
func IsIPv6(ip net.
On Friday, June 17, 2016 at 3:52:27 PM UTC+2, gordo...@gmail.com wrote:
>
> I don't see the point of the exercise other than it proves that not
> putting the result of an operation back into the same register reduces the
> latency slightly for your processor (whatever it is?); I suspect that if
I don't see the point of the exercise other than it proves that not putting the
result of an operation back into the same register reduces the latency slightly
for your processor (whatever it is?); I suspect that if you used any other
register such as the unused AX register rather then the R11 r
On Friday, June 17, 2016 at 2:30:12 AM UTC+2, gordo...@gmail.com wrote:
>
> > Modern x86 CPUs don't work like that.
>
> > In general, optimally scheduled assembly code which uses more registers
> has higher performance than optimally scheduled assembly code which uses
> smaller number of registe
Thanks, is there a way to know what to expect in later versions (
1.8,1.9,1.10 and so forth ... ) ?
Le vendredi 17 juin 2016 01:15:18 UTC+2, Chris Broadfoot a écrit :
>
> Hello gophers,
>
> We have just released go1.7beta2, a beta version of Go 1.7.
> It is cut from the master branch at the revi
Hi Tamás,
thanks, I will have a look. I guess and hope that this is what I need.
@Simon: thanks for the response with so many details.
I have been working for years for projects with load balancers, HA,
disaster recovery sites, and so on so your detailed answer can be really
helpful to understan
By the way, Go 1.7 support subtests :
https://tip.golang.org/pkg/testing/#hdr-Subtests_and_Sub_benchmarks
Which is one of the nicest additions to Go 1.7
Le jeudi 16 juin 2016 16:04:11 UTC+2, Rayland a écrit :
>
> Let's say I have some piece of code like this:
>
> type Foo struct {
> }
>
> func
What is the point of doing that in a language that doesn't support auto
currying ? There is none. You are not currying anything by the way, you
just wrote 3 closures.
Le vendredi 17 juin 2016 00:00:43 UTC+2, Zauberkraut a écrit :
>
> Hello,
>
> Go enables the evaluation of functions using curry
On Thursday, June 16, 2016 at 3:20:10 PM UTC+2, Sean Russell wrote:
>
> I'm sorry -- the "share" button doesn't seem to be working, or doesn't
> work in Firefox or Chrome. And I have a window hung on "waiting for remote
> server," so I might have broken your playground.
>
TL:DR type conver
This is not a question about Go, but basic web infrastructure. However,
it's one of those "best practice" questions which "everybody knows the
answer to" and so you may be hard put to find out more without knowing
where to start.
First of all, I should point out that when you tweak your PHP pa
> Looks like something is wrong with immediate loading for the 1 << ...
> operation. Could you open a bug with repro instructions? I can look at it
> when 1.8 opens.
I have opened a golang issue #16092 as follows:
https://github.com/golang/go/issues/16092
I may have over-complicated it, but
On Friday, 17 June 2016 02:59:49 UTC+3, kortschak wrote:
>
> I'm running a terabyte-scale (minor compiler changes are necessary to get
> this to run) genome resequencing simulation at the moment and an
> interesting question has arisen.
>
The simulation involved hashing over ~all positions of a g
Have found the cause of the issue
The message that I was trying to marshall had *0x10a3c2d0 (when
fmt.Println) *which was http response.
>From https://github.com/revel/revel/issues/1037 i found that
*Since Go 1.6 http.Request struct contains `Cancel <-chan struct{}` which*
*results in `json:
53 matches
Mail list logo