What is a good way to find Go developers and Go jobs nowadays?
--
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.
To view
Yes, it's weird question...
It's a POST request. The request passes search query to a graph database.
Information about DNA sequences. List of Ids from database is expected. The
question is, is it common for one API call like this to be 10Mb long? Or
something completely wrong here, and API
It's length in characters.
--
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
I ran into a huge API call. 160 * 60. Can it be normal? Or something should
be changed here for sure?
Alex.
--
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
Hi, do I have to have "$GOPATH/pkg" folder in Go v1.11.5? Looks like go modules
save versions of pakages in this folder. But where packages stored if I use
$GO111MODULE=on? $GOPATH should be ignored in this case so do pkg folder. Or
I'm missing something?
--
You received this message because
ck:
> https://play.golang.org/p/lMI8rmEBJ-d
>
> On Thu, 6 Dec 2018 at 23:40, Alex Dvoretskiy > wrote:
>
>> Hi Golangnuts,
>>
>> I'm trying to run SignerCrc32() concurently, but instead it runs
>> sequentially. Can you explain why?
>>
>> https://play.golang.o
Hi Golangnuts,
I'm trying to run SignerCrc32() concurently, but instead it runs
sequentially. Can you explain why?
https://play.golang.org/p/l5A3tBSqfs1
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop
Thanks.
One question, we do "defer close(out)", but we don't close "in" channel.
Why garbage collector don't remove "out" channel? We don't write nothing to
it in function 3. So it should be empty.
On Tuesday, December 4, 2018 at 3:52:45 PM UTC-8, Alex Dvoretskiy
I'm getting "fatal error: all goroutines are asleep - deadlock! on this
code.
Why?
https://play.golang.org/p/KgJKu96PF7Q
--
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
Thanks, Burak. Great explanation!
On Tuesday, December 4, 2018 at 10:57:03 AM UTC-8, Alex Dvoretskiy wrote:
>
> Hi Golangnuts,
>
> I'm trying to implement kind of pipe function, using channels
>
> Do you think this would be a correct conception:
>
> func Pipe(fs ...task
Hi Golangnuts,
I'm trying to implement kind of pipe function, using channels
Do you think this would be a correct conception:
func Pipe(fs ...task) {
ch1 := make(chan interface{})
ch2 := make(chan interface{})
for _, f := range fs {
ch1, ch2 = ch2, ch1
go f(ch1, ch2)
}
}
Can you also
Yes! This is perfect!
On Friday, November 30, 2018 at 2:52:57 PM UTC-8, Justin Israel wrote:
>
>
>
> On Sat, Dec 1, 2018, 10:43 AM Alex Dvoretskiy > wrote:
>
>> Here is recursion. I d'ont know when its end.
>>
>
> Do you mean that you want to wait for all 3
Here is recursion. I d'ont know when its end.
On Friday, November 30, 2018 at 12:04:42 PM UTC-8, Burak Serdar wrote:
>
> On Fri, Nov 30, 2018 at 12:44 PM Alex Dvoretskiy
> > wrote:
> >
> > Hi,
> >
> > How should I modify my code if I want to run thre
Hi,
How should I modify my code if I want to run three recursive functions in
parallel?
go inOrderTr(root)
go preOrderTr(root)
go postOrderTr(root)
https://play.golang.org/p/n-QLR7V0H49
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To
gardless of the state field.
>
> On Tue, Nov 20, 2018 at 10:27 PM Alex Dvoretskiy
> wrote:
>
>> I need the other states, CA, IL... and the other districts 3, 5, 15...:
>>
>> "ocd-division/country:us/state:wi/cd:3"
>> "ocd-division/country:us/state:ca
functions to get congressional district number? I can
get the state from address.
On Tuesday, November 20, 2018 at 4:38:26 PM UTC-8, Alex Dvoretskiy wrote:
>
> Hello,
>
> I'm writing a tool for extracting congressional district. Getting http
> JSON response from google civic api.
If you using vim: https://github.com/fatih/vim-go
On Tuesday, November 20, 2018 at 12:52:11 PM UTC-8, Pat Farrell wrote:
>
> I know, this is both a FAQ and an unanswerable question. I'm an old
> programmer who has used nearly every editor known to man. I am not a fan of
> whole-universe IDEs,
If you using vim, keep using it: https://github.com/fatih/vim-go
On Tuesday, November 20, 2018 at 11:28:03 AM UTC-8, Alex Dvoretskiy wrote:
>
>
>
> file, err := os.Open(inputFile)
> if err != nil {
> log.Fatal(err)
> }
> defer file.Close()
> scanner := bufio
Hello,
I'm writing a tool for extracting congressional district. Getting http JSON
response from google civic api.
I need only one line *"name": "Wisconsin's 3rd congressional district" *How
web developers usually proceed with such task?
{
"normalizedInput": {
"line1": "9732 570th Avenue",
Yes, it's encoded in UCS-2, UTF-16.
Should I just change encoding to UTF-8?
What if I can't change encoding?
On Tuesday, November 20, 2018 at 11:36:24 AM UTC-8, Ian Lance Taylor wrote:
>
> On Tue, Nov 20, 2018 at 11:30 AM, Alex Dvoretskiy
> > wrote:
> > go version
go version go1.10 windows/386
--
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
file, err := os.Open(inputFile)
if err != nil {
log.Fatal(err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
address := ""
scanner.Scan()
scanner.Scan()
address = scanner.Text()
fmt.Println([]byte(address))
I'm reading string from file, but getting null value inserted as every
other
I'm working on algorithm to get top N values from int slice.
This one is the best I can do. Heap structure. Is it possible to make it
better?
https://play.golang.org/p/Gz00Njz-54s
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe
Is it possible to implement type assertion from interface to struct?:
https://play.golang.org/p/xK4mlF32_NR
--
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
nt it sorted by the fields you can implement the sort
> interface[1] on either or both fields.
>
> 1 - https://godoc.org/sort#Interface
> On Thu, Nov 1, 2018 at 15:57, Alex Dvoretskiy > wrote:
>
>> How can I rewrite this code to use a heap of structs instead of a heap of
How can I rewrite this code to use a heap of structs instead of a heap of
ints?
Have:
type IntHeap []int
Need:
type str struct {
num int,
val string
}
type Heap []str
https://play.golang.org/p/KHhIvKMkNMy
--
You received this message because you are subscribed to the Google Groups
Is there is a way to read a file line by line and extract JSON data from
it?
Example:
file:
`
value1: {"field1": "123, "field2": "123"}
value2: {"field1": "456", "field2": "879"}
`
I need to extract the struct in a loop:
type s struct {
field1 string
field2 string
}
--
; ```
> Struct values encode as JSON objects. Each exported struct field
> becomes a member of the object, using the field name as the object key,
> unless the field is omitted for one of the reasons given below.
> ```
>
> On Wed, 2018-10-31 at 23:07 -0700, Alex Dvoretskiy wr
11:07 PM (less than a minute ago)
How can I get this json in output?
[
{
"s": 123,
"id": "adsfasdf"
},
{
"s": 123,
"id": "sefascss"
}
]
https://play.golang.org/p/cQNIKuGXRmj
--
You received this message because you are subscribed to the
How can I get this json in output?
[
{
"s": 123,
"id": "adsfasdf"
},
{
"s": 123,
"id": "sefascss"
}
]
https://play.golang.org/p/AHcUO5IuByf
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
Looking for a Go code or algorithm, in general, to print out directory
structure.
Example: https://jekyllrb.com/docs/structure/
. ├── _config.yml ├── _data | └── members.yml ├── _drafts | ├──
begin-with-the-crazy-ideas.md | └── on-simplicity-in-technology.md ├──
_includes | ├── footer.html |
I got it!
max(test.vals...)
On Wednesday, May 23, 2018 at 4:09:01 PM UTC-7, Alex Dvoretskiy wrote:
>
> How do you write test for variadic functions?
>
> For example I have function:
>
> func max(vals ...int) int {
> m := 0
> for _, v := range vals {
> if v &
How do you write test for variadic functions?
For example I have function:
func max(vals ...int) int {
m := 0
for _, v := range vals {
if v > m {
m = v
}
return m
}
and how to write a few tests for it? I can't put vals ...int
in struct
package main
import (
"testing"
)
func TestMax(t
Just noticed. Even restructuring the code the way kjk did improved runing time,
without caching. Amazing.
--
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
Thanks! Cashing improved things dramatically.
--
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
Thanks!
--
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 https://groups.google.com/d/optout.
Hello Golang Nuts
I'm trying to solve a problem. Algorithm is correct, but too slow. Perhaps
you can give me some ideas on how to improve running time?
https://play.golang.org/p/XsXwT8EHtwC
Thanks
Alex
--
You received this message because you are subscribed to the Google Groups
Thanks a lot!!!
On Thursday, April 19, 2018 at 11:55:49 AM UTC-7, Bakul Shah wrote:
>
> Terminate Scanf format strings with \n. To see why, do "go doc fmt.Scanf".
> Always check the result of (at least) any input operation such as Scanf.
>
> On Apr 19, 2018, at 10:31 AM
separator to the
> input such as a semicolon?
>
> On Thursday, 19 April 2018 20:31:56 UTC+3, Alex Dvoretskiy wrote:
>>
>> Hello Golang-nuts,
>>
>> Following code reads data from file and creates binary tree structure:
>>
>> '
>> // go run main.go <
Hello Golang-nuts,
Following code reads data from file and creates binary tree structure:
'
// go run main.go < input
package main
import "fmt"
type TreeNode struct {
Value int
Left *TreeNode
Right *TreeNode
}
func main () {
nodes := read()
for i, node := range(nodes) {
fmt.Printf("%p\n",
Hello Golangnuts,
Why there is no difference if the last comma exists?
{'A', 'B', 'C', 'E'}
or
{'A', 'B', 'C', 'E',}
both are valid.
Sometimes it causes little troubles. For example, the second snippet
wouldn't compile, because of different formatting. But these two snippets
are identical
Hello Golang nuts,
For example, I have a multidimensional slice, which I want to modify, but
keep an original slice untouched.
Do I need to do this all the time or there is another convenient way to do
this?:
https://play.golang.org/p/YDn6ii52oOt
Thanks
Alex
--
You received this message
Hello Golangnuts,
I'm experiencing unexpected behavior. Trying to reverse integer.
This code works on 64-bit machine, but working wrong on 32-bit:
https://play.golang.org/p/p4Ptu8cx-b7
How can I generate an error in this case?
Thanks
--
You received this message because you are subscribed
Hello Golang-nuts,
When I'm doing assignments to multiple variables in one line, there is a
limitation.
You can do it in this way:
w, x = w+i, x+i+i
But can't in this one:
w, x += i, i+i
What do you think, it was done on purpose or this is something worth for
change proposal?
Hello Golang-nuts
Why it is not allowed to pass function result like this to return?:
https://play.golang.org/p/YPeaeW_4WZ6
Or it is allowed without declaring temporary variables i3, i4?
Thanks
Alex
--
You received this message because you are subscribed to the Google Groups
"golang-nuts"
Thanks, Burak!
On Tuesday, February 20, 2018 at 4:29:44 PM UTC-8, Burak Serdar wrote:
>
> On Tue, Feb 20, 2018 at 5:23 PM, Alex Dvoretskiy
> <advore...@gmail.com > wrote:
> > Hello golang-nuts,
> >
> > https://play.golang.org/p/Lib9EfWcsjG
> >
Hello golang-nuts,
https://play.golang.org/p/Lib9EfWcsjG
If you run this code it works fine. But if you remove one "Actor" key -
template stops executing: "template: movielist:10:14: executing "movielist"
at <.Actor.Name>: can't evaluate field Name in type *main.Actor"
Modified version:
Go understanding.
On Tuesday, October 31, 2017 at 1:32:47 PM UTC-7, Ian Lance Taylor wrote:
>
> On Tue, Oct 31, 2017 at 10:53 AM, Alex Dvoretskiy
> <advore...@gmail.com > wrote:
> >
> > package main
> >
> > import (
> > "fmt"
> &
Hello Golang-nuts,
*package main*
*import (*
* "fmt"*
* "time"*
*)*
*func main() {*
* t := time.Date(2009, time.December, 31, 23, 0, 0, 0, time.UTC)*
* fmt.Println(t)*
* fmt.Println(t.AddDate(0, -1, 0))*
*}*
https://play.golang.org/p/hZ7nhnkepK
The result is
2009-12-31 23:00:00 + UTC
wow, super impressed!
On Thursday, October 19, 2017 at 10:22:26 AM UTC-7, rog wrote:
>
> Or taking it a bit further: https://play.golang.org/p/g4uF2QjiJQ
>
>
> On 18 October 2017 at 23:38, Alex Dvoretskiy <advore...@gmail.com
> > wrote:
> > Looks fun!: https:
> t[x] = make(map[string]string)
> }
> t[x][y] = z
> }
>
> func (t table) get(x, y string) string {
> return t[x][y]
> }
>
> The fact that t[x] can be indexed even if it hasn't been created makes
> this much simpler.
>
> On Tue, Oct 17, 2017
Hello, Golang Nuts!
I have an interesting question about maps. What is the possible usage of
nil maps, which can be declared like "var m map[string]int"? You can't
write to nil map but have an option to create it.
Perhaps there is no use at all and this is just language specific feature?
Thanks, Michael!
On Monday, August 28, 2017 at 3:33:52 PM UTC-7, Alex Dvoretskiy wrote:
>
> Does anyone uses package "math/big"? And what purpose?
>
> It looks like hard package to work with. At least at the beggining.
> Even simple line of code takes some efforts to co
Does anyone uses package "math/big"? And what purpose?
It looks like hard package to work with. At least at the beggining.
Even simple line of code takes some efforts to convert to big.Float:
y := float64(py) / float64(heightP) * (ymax - ymin) + ymin
--
You received this message because you
54 matches
Mail list logo