On Fri, Aug 04, 2017 at 08:11:45AM -0700, prankpla...@gmail.com wrote:
[...]
> func fact_worker(fact_resp_chan chan string, x int) {
> defer wg.Done()
> response := factorial(x)
> fact_resp_chan <- fmt.Sprintf("Factorial of %d is : %d", x, response)
> }
[...]
Please also consider naming your ide
I'm not entirely sure, but my intuition says that using `time.After` like
that with pending sends from another goroutine will cause that goroutine to
leak. A better solution may be to use the `WithTimeout` functionality of
the `context` package and then periodically check the `Done()` channel to
On Monday, August 7, 2017 at 12:41:18 AM UTC+2, kortschak wrote:
>
> The reflect package is not mentioned in the spec (except once to
> discuss struct tags), adding a built-in would require its definition
> there, and complicate the language. Making it easier to use would also
> have the disad
Thanks your reply, I also used this way, but it still not work. code as the
following.
gonameunits := []string{"gpu0", "gpu1", "gpu2", "gpu3"}
nameunits := make([]*C.char, len(gonameunits))
for i, _ := range gonameunits {
nameunits[i] = C.CString(gonameunits[i])
defer C.free(u
>From the Laws of Reflection[1]:
> It's a powerful tool that should be used with care and avoided unless
> strictly necessary.
The reflect package is not mentioned in the spec (except once to
discuss struct tags), adding a built-in would require its definition
there, and complicate the language.
Yes but its the way it's done that i think could be made more
straightforward, why not merge ValueOf and TypeOf in a build in
intermediate reflect type as in for example int(4) but then reflect(4)
On Sunday, August 6, 2017 at 5:57:40 PM UTC+2, Rich wrote:
>
> I don't understand... doesn't Reflec
I don't understand... doesn't Reflect already do this?
https://play.golang.org/p/CIm7aISztv
On Saturday, August 5, 2017 at 12:58:52 PM UTC-4, Gert wrote:
>
> package main
>
> import (
> "fmt"
> "reflect"
> )
>
> func main() {
> x := 4
> v1 := reflect.ValueOf(x)
> fmt.Println("type:", v1.Type())
>
yes this is what I want..
Need to access web service multiple times to get the entire data unless
return status is not "completed" But same time I need timeout
Thanks for the help
Thanks
Abhi
On Sunday, August 6, 2017 at 7:48:05 PM UTC+5:30, snmed wrote:
>
> I still no get the idea behind yo
I still no get the idea behind your requirement, in your example you
calling the web service 6 times in sequential manner and then write it to
the channel.
But again you can only write once to a channel with a capacity of one, as
long as you not read from the same channel and you still read it i
Wasn't aware this is possible, will do - thanks.
On Sunday, August 6, 2017 at 4:53:13 PM UTC+3, Paul Tötterman wrote:
>
> Thanks. But if I'll use constraint I'll need to rewrite all the import
>> paths in my code (and maybe in the vendor directory as well)
>>
>
> Maybe I've misunderstood somethin
hi Bjoern
>>> Why would you expect this? "result 1" is the fist value that was sent
to the channel. Channels are sort of FIFO.
Yeah I know.. but what is the workaround to get latest c1 value which is
retrieve just before timeout
Do I need to use "for ( loop )" around Select till timeout to inv
>
> Thanks. But if I'll use constraint I'll need to rewrite all the import
> paths in my code (and maybe in the vendor directory as well)
>
Maybe I've misunderstood something, but I was expecting you wouldn't have
to:
[[constraint]]
name = "github.com/original/library"
source = "github.com/you
Thanks. But if I'll use constraint I'll need to rewrite all the import
paths in my code (and maybe in the vendor directory as well)
On Sunday, August 6, 2017 at 4:31:25 PM UTC+3, Paul Tötterman wrote:
>
> Hi,
>
> I plan to use "dep" and also to place "vendor" in the git repository.
>> However I
Hi,
I plan to use "dep" and also to place "vendor" in the git repository.
> However I have one dependency in vendor which is locally patched. The
> problem for me is that "dep ensure" overwrites my patch every time. Is
> there a way to tell "dep" to ignore this specific package? (There are
> o
Am Sonntag, 6. August 2017 09:53:36 UTC+2 schrieb Abhijit Desai:
>
> Can you please help with below code to get output at specific cutoff time
> and exit
>
> Thanks in advance
>
> Abhi
>
>
>
> package main
>
> import "time"
> import "fmt"
>
> func main() {
>
> c1 := make(chan string)
>
Fixed. Cheers.
On Sunday, August 6, 2017 at 12:23:57 PM UTC+10, Michael Jones wrote:
>
> Great. Hope it helps. I had a typo in power 0 (which is never called.
> Change the return to 1.0.
>
> On Sat, Aug 5, 2017 at 6:50 PM > wrote:
>
>> Thanks, Michael.
>>
>> I've created a tiny project with those
Great news. Thanks for sharing
On Sunday, August 6, 2017 at 1:37:11 AM UTC+10, Mandolyte wrote:
>
> This past week I wrote an "audit" program for management to see how a long
> running data migration effort was going (it will take several months to
> complete). I was little discouraged when I fo
Requirement is to collect the data with in cuttoff time say 3 sec by
invoking web service multiple times and return only latest invoked data
c1 <- "result 1" // In real scenario this taking almost 1 seconds as in
real scenario it's taking Part chunk of data from Web Service
Something like... Ex
Got it. In the same document:
"Halfway the functional design of the X1, I guess early 1957, Bram and
Carel confronted me with the idea of the interrupt, and I remember that I
panicked, being used to machines with reproducible behaviour. How was I
going to identify a bug if I had introduced one?
Hi
What are you trying to solve? Your channel has a capacity of 1, the first write
to c1 is successful but the second write to c1 is blocked until it has been
read in the select statement. And therefore you print the first value written
to c1.
I recommend you to read this https://golang.org/d
Thank you, Peter.
Maybe someone else can corroborate my impression that Dijkstra did not
immediately accept the idea of interrupts and felt it would make
programming too difficult?
Lucio.
On Saturday, 5 August 2017 19:44:26 UTC+2, peterGo wrote:
>
> Lucio,
>
> "It took Dijkstra quite some effo
Hi,
I plan to use "dep" and also to place "vendor" in the git repository.
However I have one dependency in vendor which is locally patched. The
problem for me is that "dep ensure" overwrites my patch every time. Is
there a way to tell "dep" to ignore this specific package? (There are
overrides
Can you please help with below code to get output at specific cutoff time
and exit
Thanks in advance
Abhi
package main
import "time"
import "fmt"
func main() {
c1 := make(chan string)
go func() { //Sending data after certain time
c1 <- "result 1"
time.Sleep
23 matches
Mail list logo