Re: [go-nuts] Picnic Senior Go Dev

2022-11-08 Thread Yamil Bracho
Hi, Giorgi and nice to meet you.
I am interested in this position so enclosed my resume for your reference.
Just let me know if you need any additional information.

Best Regards,
Yamil


El mar, 8 nov 2022 a las 10:54, Giorgi Dalakishvili
() escribió:

> Hello Go Devs, I am Giorgi Tech recruiter at Picnic, Palo Alto / Ca based
> fast-growing app with 2 million users already.
> I want you to offer Golang Dev job, you can work remotely.
> If you have three years of experience in the Go language I want to offer
> you a really good working environment, a competitive and good salary with
> equity and bonuses.
>
> See attached job description below.
>
> best regards.
>
> --
> 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 this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/bffca344-04fd-49dd-b7cf-76ed47ba212bn%40googlegroups.com
> 
> .
>

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEZYzU14i21M847fE5wSuuno-CGpwHm0pNMNtUuTUqV6yuLmdw%40mail.gmail.com.


[go-nuts] Re: Ajuda sobre logica

2019-12-18 Thread Yamil Bracho


Este é o seu código com alguns arranjos (realmente mínimos):

package main

import (
"fmt"
)

func main() {
var x int = 2
var y int = 32

fmt.Print("Informe o numero:")
var primo bool

for i := x; i < y+1; i++ {
primo = true

for j := 2; j < i; j++ {

if i%j == 0 {
primo = false
break
}
}

if primo {
fmt.Println(i)
}
}
}



El miércoles, 18 de diciembre de 2019, 13:39:17 (UTC-5), 
arruda...@gmail.com escribió:
>
> Olá, tudo bem?
>
>
> Estou iniciando meus estudos em Golang e honestamente, adorei a linguagem. 
> Gostaria de saber qual meu erro, diante desse algoritmo que fiz em Go. 
> Estou verificando numeros primos  de 3 á 31. E a sua saida deve sair, e 
> estou com problema de sintaxe dele, da um help ai gente 
>  
> 3 5
> 5 7
> 11 13
> 17 19
> 29 31
>
> segue anexo a pasta do repositório do código.
>
> https://pastebin.com/mwewbd7e
>

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d5a7123b-9e7e-4238-9b9e-aea6ee86ae95%40googlegroups.com.


Re: [go-nuts] Pointer to the loop variable

2019-09-10 Thread Yamil Bracho
Then turn vo into a Vertex variable, not a pointer

var vp Vertex = Vertex{}
...
if v.X == 3 {
   vp = v
  }

….

This time vp will be a copy of v,

Maybe you have to give some known values and exceptional case for your 
domain, I mean, vp  Vertex = { -1, -1} or any values your are 
positive does not exists because maybe {0,0} is good data.

HTH
PS: You can break nested loops from an inside loop using break [label]


El martes, 10 de septiembre de 2019, 14:29:50 (UTC-5), Tong Sun escribió:
>
>
>
> On Tuesday, September 10, 2019 at 3:18:47 PM UTC-4, burak serdar wrote:
>>
>> On Tue, Sep 10, 2019 at 1:13 PM Tong Sun  wrote: 
>> > 
>> > I'm experiencing a weird problem with my program and finally nail it 
>> down to what exactly went wrong, so that I can write a minimum program to 
>> duplicate it. See the following program: 
>> > 
>> > package main 
>> > 
>> > 
>> > import ( 
>> >  "fmt" 
>> > ) 
>> > 
>> > 
>> > type Vertex struct { 
>> >  X int 
>> >  Y int 
>> > } 
>> > 
>> > 
>> > func main() { 
>> >  vs := []Vertex{ 
>> >  Vertex{1, 2}, // has type Vertex 
>> >  Vertex{X: 3}, // Y:0 is implicit 
>> >  Vertex{}, // X:0 and Y:0 
>> >  } 
>> > 
>> > 
>> >  fmt.Printf("Vertex Slice %+v\n", vs) 
>> >  var vp *Vertex = nil 
>> >  for _, v := range vs { 
>> >  if v.X == 3 { 
>> >  vp =  
>> >  } 
>> >  } 
>> >  fmt.Printf("Found: %+v\n", vp) 
>> > } 
>> > 
>> > 
>> > https://play.golang.org/p/R645C5plojx 
>> > 
>> > I was expecting that the found Vertex is "v.X == 3", however the result 
>> is not. 
>>
>> Because you're keeping a pointer to the loop variable. v continues 
>> changing after you store the address of it, so you get the latest 
>> value of v. Instead, save a copy of v, or break the loop as soon as 
>> what you're looking for is found: 
>>
>
>  I can't break the loop immediately as my not-minimized real program use a 
> double loop to find the *closest *item. That's the reason I using the 
> pointer to track my finding...
>
> if v.x==3 { 
>>t:=v 
>>vp= 
>> } 
>>
>
>  OK. will do that. thx
>
> > 
>> > - what exactly is causing the problem? 
>> > - how to fix it so that I got what I was looking for? 
>> > 
>> > Again, the snip is at 
>> > https://play.golang.org/p/R645C5plojx 
>> > 
>> > 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 golan...@googlegroups.com. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/143205c1-2c86-4404-94d2-4182a6285e21%40googlegroups.com.
>>  
>>
>>
>

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/839a129d-2dcf-4bac-846f-a0fc3e891ed4%40googlegroups.com.


[go-nuts] Re: Pointer to the loop variable

2019-09-10 Thread Yamil Bracho
vp is taking the address of v, so when the loop ends, v is the last element 
in the slide and therefore *vp is {0,0}
Add a break to the condition when you assign vp, say

if v.X == 3 {
 vp = 
 break
}

HTH,
Yamil

El martes, 10 de septiembre de 2019, 14:13:40 (UTC-5), Tong Sun escribió:
>
> I'm experiencing a weird problem with my program and finally nail it down 
> to what exactly went wrong, so that I can write a minimum program to 
> duplicate it. See the following program:
>
> package main
>
>
> import (
>  "fmt"
> )
>
>
> type Vertex struct {
>  X int
>  Y int
> }
>
>
> func main() {
>  vs := []Vertex{
>  Vertex{1, 2}, // has type Vertex
>  Vertex{X: 3}, // Y:0 is implicit
>  Vertex{}, // X:0 and Y:0
>  }
>
>
>  fmt.Printf("Vertex Slice %+v\n", vs)
>  var vp *Vertex = nil
>  for _, v := range vs {
>  if v.X == 3 {
>  vp = 
>  }
>  }
>  fmt.Printf("Found: %+v\n", vp)
> }
>
>
> https://play.golang.org/p/R645C5plojx
>
> I was expecting that the found Vertex is "v.X == 3", however the result is 
> not. 
>
> - what exactly is causing the problem?
> - how to fix it so that I got what I was looking for? 
>
> Again, the snip is at
> https://play.golang.org/p/R645C5plojx
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/14f9f238-c366-4cde-8228-ecc13added04%40googlegroups.com.


Re: [go-nuts] Problems with Text Template

2019-06-17 Thread Yamil Bracho
Yes, Kurtis you are absolutely right!!!

I just typed in "template.ParseFiles" and my editor made the changes for me 
in the imports and it imported "html/template" and i di not check this...

Thanks!!!


El viernes, 14 de junio de 2019, 22:20:11 (UTC-5), Kurtis Rader escribió:
>
> It is very unlikely you are using text/template. At least I can't 
> reproduce the problem using text/template but can with html/template: 
> https://play.golang.org/p/elqHI1EtfFa. Or you are using text/template but 
> somewhere before executing that template your data is being converted to a 
> HTML friendly form.
>
> On Fri, Jun 14, 2019 at 6:28 PM Yamil Bracho  > wrote:
>
>> Yes, I am using text/template...
>>
>> El viernes, 14 de junio de 2019, 19:07:24 (UTC-4), Burak Serdar escribió:
>>>
>>>
>>> Are you using html/template by any chance? 
>>>
>>> If so, try text/template instead.
>>>
>>
> -- 
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
>

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/37ca7844-49d1-4ea9-91e7-4e1fe0ecc98c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Problems with Text Template

2019-06-14 Thread Yamil Bracho
Hi,
Yes, I am using text/template...

El viernes, 14 de junio de 2019, 19:07:24 (UTC-4), Burak Serdar escribió:
>
> On Fri, Jun 14, 2019 at 4:09 PM Yamil Bracho  > wrote: 
> > 
> > I am building a kind of code generator based in golang templates and I 
> have problems with some characters. 
> > 
> > For example if I have got this line in my template 
> > public class {{.Name}}Validator : AbstractValidator<{{.Name}}Input> 
>
> Are you using html/template by any chance? 
>
> If so, try text/template instead. 
>
> > 
> > 
> > is converted to this in my output file 
> > public class GetLoginMarketColorSettingByLoginIDValidator : 
> AbstractValidator GetLoginMarketColorSettingByLoginIDInput > 
> > 
> > 
> > Another line when I have got problems : 
> > RuleFor(x => 
> x.{{.Name}}).Cascade(CascadeMode.StopOnFirstFailure){{.ValidationString}}; 
> > 
> > 
> > And ValidationString is build in my code and should be 
> (.NotEmpty().Length(1,15).WithMessage("Not a Valid LoginID");) 
> > 
> > 
> > But the generated code for this line is 
> > RuleFor(x => 
> x.LoginID).Cascade(CascadeMode.StopOnFirstFailure).NotEmpty().Length(1,15).WithMessage(Not
>  
> a Valid LoginID); 
> > 
> > 
> > It seems that the template system apply url encoding or it gets confused 
> when a special character is near substitution tag ({{}}) 
> > 
> > 
> > Any hint to solve this problem ? 
> > 
> > 
> > TIA, 
> > Yamil 
> > 
> > -- 
> > 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 golan...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/834c04d1-0d21-4ccd-a1d5-d975f8246d0e%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/42844dd4-5c5e-4a72-b0ec-61f5ab49e691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Problems with Text Template

2019-06-14 Thread Yamil Bracho
I am building a kind of code generator based in golang templates and I have 
problems with some characters. 

For example if I have got this line in my template
public class {{.Name}}Validator : AbstractValidator<{{.Name}}Input>


is converted to this in my output file
public class GetLoginMarketColorSettingByLoginIDValidator : 
AbstractValidator GetLoginMarketColorSettingByLoginIDInput >


Another line when I have got problems :
RuleFor(x => 
x.{{.Name}}).Cascade(CascadeMode.StopOnFirstFailure){{.ValidationString}};


And ValidationString is build in my code and should be 
(.NotEmpty().Length(1,15).WithMessage("Not 
a Valid LoginID");)


But the generated code for this line is
RuleFor(x => 
x.LoginID).Cascade(CascadeMode.StopOnFirstFailure).NotEmpty().Length(1,15).WithMessage(Not
 
a Valid LoginID);


It seems that the template system apply url encoding or it gets confused 
when a special character is near substitution tag ({{}})


Any hint to solve this problem ?


TIA,
Yamil

-- 
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 this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/834c04d1-0d21-4ccd-a1d5-d975f8246d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: Arrays

2019-01-14 Thread Yamil Bracho
It could be :
a := [3][4]string{"1 1", "1 2", "1 3", "1 4", "2 1", "2 2", "2 3", "2 4", 
"3 1", "3 2", "3 3", "3 4" } 

or

var a = [3][4]string

for (row = 0; row < 3; row++) {
   for (col = 0; col < 4; col++) {
   a[row][col] = fmt.Sprintf("%d %d", (row+1), (col+1)
   }
}   

El lunes, 14 de enero de 2019, 0:47:50 (UTC-5), John escribió:
>
> Dear Gophers,
> 
>   I am a beginner gopher has created a project of Connect Five. The 
> game's board is shown in a dot array like this
>
> ...
> ...
> ...
>  And to input, you have to put in the exact coordinates of the place 
> you want to place, like this 1 3. You would have to carefully count the 
> dots and then input, which is a pain for the eyes. So I wonder if it is 
> possible to make a array like this and how:
>  
>
> 11 12 13 14
> 21 22 23 24
> 31 32 33 34
>
>   
> 
>Thank you,
>
>   
> 
>  John
>

-- 
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.


[go-nuts] Re: last pointer standing

2018-09-06 Thread Yamil Bracho
You are not creating a new pointer, so just do

c1.Lookup = {xt1.CodeId, xt1.Description, xt1.Active}

El jueves, 6 de septiembre de 2018, 14:59:44 (UTC-5), davidg...@gmail.com 
escribió:
>
> Am looking for insight into why the dataArray_LookupCode output array is 
> partially correct.
> The newUUID() function correctly assigns to each element of the 
> dataArray_LookupCode array, but the *LookupCode field values are all the 
> values of the last element of the LookupCodes data source array. 
> Why?
>
> package main
>
> import (
> "crypto/rand"
> "strconv"
> "fmt"
> "io"
> //"encoding/json"
> //"time"
> )
>
> func newUUID() (string, error) {
> uuid := make([]byte, 16)
> n, err := io.ReadFull(rand.Reader, uuid)
> if n != len(uuid) || err != nil {
> return "", err
> }
> // variant bits; see section 4.1.1
> uuid[8] = uuid[8]&^0xc0 | 0x80
> // version 4 (pseudo-random); see section 4.1.3
> uuid[6] = uuid[6]&^0xf0 | 0x40
> return fmt.Sprintf("%x-%x-%x-%x-%x", uuid[0:4], uuid[4:6], uuid[6:8], 
> uuid[8:10], uuid[10:]), nil
> }
>
> type LookupCode struct
> {
>   CodeIdstring`json:"codeid"`
>   Descriptionstring`json:"description"`
>   Activebool`json:"active"`
> }
>
> type UUID_LookupCode struct
> {
> UUID string `json:"uuid"`
> lookup*LookupCode `json:"lookup"`
> // *LookupCode  [does not work]
> }
>
> var LookupCodes []LookupCode
> var dataArray_LookupCode []UUID_LookupCode
>
> func init() { 
> LookupCodes = []LookupCode {
> LookupCode {
> Active: true,
> CodeId: "USA_00",
> Description: "All US States",
> },
> LookupCode {
> Active: true,
> CodeId: "USA_01",
> Description: "All US Western compact States",
> },
> }
>
> dataArray_LookupCode := make([]UUID_LookupCode, 0)
> for _, xt1 := range LookupCodes {
> c1 := _LookupCode{}
> c1.lookup = 
> //c1.LookupCode.CodeId = xt1.CodeId
> typeKey, err := newUUID()
> if err == nil {
> c1.UUID = typeKey
> }
> fmt.Println(c1.lookup.CodeId )  // correct output: USA_00 USA_01
> dataArray_LookupCode = append(dataArray_LookupCode, *c1) 
> }
> fmt.Printf(strconv.Itoa(len(dataArray_LookupCode)))  // correct output: 2
> fmt.Println(dataArray_LookupCode[0].lookup.CodeId,dataArray_LookupCode[1].lookup.CodeId)
>   
> // incorrect output: USA_01 USA_01
>
> }// init
>
> func main() {
> }
>
>

-- 
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.


[go-nuts] Re: last pointer standing

2018-09-06 Thread Yamil Bracho


El jueves, 6 de septiembre de 2018, 14:59:44 (UTC-5), davidg...@gmail.com 
escribió:
>
> Am looking for insight into why the dataArray_LookupCode output array is 
> partially correct.
> The newUUID() function correctly assigns to each element of the 
> dataArray_LookupCode array, but the *LookupCode field values are all the 
> values of the last element of the LookupCodes data source array. 
> Why?
>
> package main
>
> import (
> "crypto/rand"
> "strconv"
> "fmt"
> "io"
> //"encoding/json"
> //"time"
> )
>
> func newUUID() (string, error) {
> uuid := make([]byte, 16)
> n, err := io.ReadFull(rand.Reader, uuid)
> if n != len(uuid) || err != nil {
> return "", err
> }
> // variant bits; see section 4.1.1
> uuid[8] = uuid[8]&^0xc0 | 0x80
> // version 4 (pseudo-random); see section 4.1.3
> uuid[6] = uuid[6]&^0xf0 | 0x40
> return fmt.Sprintf("%x-%x-%x-%x-%x", uuid[0:4], uuid[4:6], uuid[6:8], 
> uuid[8:10], uuid[10:]), nil
> }
>
> type LookupCode struct
> {
>   CodeIdstring`json:"codeid"`
>   Descriptionstring`json:"description"`
>   Activebool`json:"active"`
> }
>
> type UUID_LookupCode struct
> {
> UUID string `json:"uuid"`
> lookup*LookupCode `json:"lookup"`
> // *LookupCode  [does not work]
> }
>
> var LookupCodes []LookupCode
> var dataArray_LookupCode []UUID_LookupCode
>
> func init() { 
> LookupCodes = []LookupCode {
> LookupCode {
> Active: true,
> CodeId: "USA_00",
> Description: "All US States",
> },
> LookupCode {
> Active: true,
> CodeId: "USA_01",
> Description: "All US Western compact States",
> },
> }
>
> dataArray_LookupCode := make([]UUID_LookupCode, 0)
> for _, xt1 := range LookupCodes {
> c1 := _LookupCode{}
> c1.lookup = 
> //c1.LookupCode.CodeId = xt1.CodeId
> typeKey, err := newUUID()
> if err == nil {
> c1.UUID = typeKey
> }
> fmt.Println(c1.lookup.CodeId )  // correct output: USA_00 USA_01
> dataArray_LookupCode = append(dataArray_LookupCode, *c1) 
> }
> fmt.Printf(strconv.Itoa(len(dataArray_LookupCode)))  // correct output: 2
> fmt.Println(dataArray_LookupCode[0].lookup.CodeId,dataArray_LookupCode[1].lookup.CodeId)
>   
> // incorrect output: USA_01 USA_01
>
> }// init
>
> func main() {
> }
>
>

-- 
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.


[go-nuts] Re: Help

2018-09-05 Thread Yamil Bracho
Just use a Mongo database driver, for example 

https://github.com/mongodb/mongo-go-driver

HTH,
Yamil

El miércoles, 5 de septiembre de 2018, 10:07:08 (UTC-5), Kathiresh Kumar 
escribió:
>
> How can I connect golang with mongoDB 
>

-- 
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.


[go-nuts] Re: help seek: creating and using go package

2018-09-04 Thread Yamil Bracho
And what exactly is the problem ?
Well, If you have to access n and d in the Nunm struct you have to specify 
them in uppercase.

HTH,
Yamil

El martes, 4 de septiembre de 2018, 10:32:40 (UTC-5), Sayan Shankhari 
escribió:
>
> Hello Masters,
> Probably I am making some nonsense post here and disturbing you but as a 
> beginner, I want to know how in Go I can implement the following. If I can 
> not, please suggest me suitable solution:
> 1. Create a package "myNum"
> 2. containing data type like:
> type Num struct {
> n, d int // numerator, denominator
> }
> 3. and a function to print like
> func printMyNum(x Num) {
> fmt.Println("the fractional number is: %d/%d", x.n, x.d)
> }
> 4. access and use it from "main" both the datatype as well as function
> I think for masters, to solve this is a matter of minute. So please help 
> me.
> Thank You.
>

-- 
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.