[go-nuts] Re: Scheduling - find the overlap size of two sequential date ranges and determine the actual dates of included in the intersection

2019-06-16 Thread John More
Updated playground code
https://play.golang.org/p/qHufIG5ppww

On Sunday, June 16, 2019 at 12:48:25 PM UTC-4, John More wrote:
>
> I have created a program to solve this problem (
> https://play.golang.org/p/BueQBahUUbk) but I am not a pro and do not know 
> if there is a better way. 
>
> Thanks for your time and a huge than You to Yudai the creator of "
> github.com/yudai/golcs" . I have also attached the code.
>
>
>

-- 
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/b36994da-2de1-420e-a15f-b62c0456f879%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Scheduling - find the overlap size of two sequential date ranges and determine the actual dates of included in the intersection

2019-06-16 Thread John More
I have created a program to solve this problem 
(https://play.golang.org/p/BueQBahUUbk) but I am not a pro and do not know 
if there is a better way. 

Thanks for your time and a huge than You to Yudai the creator of 
"github.com/yudai/golcs" . I have also attached the code.


-- 
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/90f40950-746d-48db-a7b1-992e54bd3762%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Calendar Integration Values

2018-10-24 Thread John More
Thank You.
I was afraid that would be the answer, but my research could not match 
yours. 
I will keep looking; however there does have to be a better way to provide 
API access to outside resources without involving my domain users . I 
always use a service account with DWD enabled and use my admin account to 
access calendars in my domain. 

Thanks
John

On Tuesday, October 23, 2018 at 8:24:36 PM UTC-4, mingle wrote:
>
> John,
>
> Here's what I found.  I believe this private URL includes what Google 
> refers to as a "magic cookie" for authentication.
>
> An old post (from 2008) asks if this can be retrieved via an API, with a 
> response from Google:
>
> https://markmail.org/message/fkqu62uyrmtfb3y4#query:+page:1+mid:fkqu62uyrmtfb3y4+state:results
>
> The magic cookie is not exposed through the API for security reason, it can
>> only be retrieved from going directly into the Calendar UI.
>
>
> While this is pretty old, I've found similar questions from people 
> attempting to do the same as you, and the answers over the years all seem 
> to indicate that this is only exposed via the UI.
>
>
> https://groups.google.com/forum/#!topic/google-calendar-help-dataapi/9Ds8QdaCGFI
> https://support.google.com/code/answer/64253?hl=en
>
> https://stackoverflow.com/questions/5090/retrieve-private-ical-url-for-a-private-calendar-using-the-java-google-calendar
>
> https://stackoverflow.com/questions/6719319/google-api-how-do-i-retrieve-a-calendars-private-address-or-magic-cookie
>
> If you happen to find otherwise, I'd love to know.
>
> Good luck!
> - mingle
>
> On Tue, Oct 23, 2018 at 3:15 PM Caleb Mingle > 
> wrote:
>
>> John,
>>
>> Apologies, I misunderstood your initial question.
>>
>> I wouldn’t be surprised if those values were not exposed via an API, but 
>> I’ll do some research and report back. 
>>
>> - mingle
>>
>> On Tue, Oct 23, 2018 at 13:59 John More > > wrote:
>>
>>> Mingle,
>>> The library I am using is the "google.golang.org/api/calendar/v3" which 
>>> accesses the  https://www.googleapis.com/calendar/v3 REST interface.
>>> I would like to read the secret address of a calendar that I create in a 
>>> G Suite domain user's account so I can dynamically forward it to another 
>>> company that insist they need it to watch for events on the calendar. I 
>>> know it is not appropriate to do this with the private address but this was 
>>> set up before my time and it will be changed but for now history has me 
>>> trapped.
>>> I have tried the API Explorer and I have reviewed the library code and 
>>> can not see where this value is part of any structure.
>>>
>>> Thank you for your reply.
>>>
>>> John
>>>
>>>
>>> On Monday, October 22, 2018 at 12:51:02 AM UTC-4, mingle wrote:
>>>>
>>>> John,
>>>>
>>>> Can you provide more details on which "calendar library" you 
>>>> are referring to?
>>>>
>>>> The link you've highlighted in Google calendar points to a file in 
>>>> iCalendar format. You'll probably want an iCalendar parser to handle the 
>>>> file, I've personally used this one, but it doesn't handle everything in 
>>>> the spec: https://github.com/luxifer/ical.
>>>>
>>>> Depending on the parser that you choose it may have functionality to 
>>>> fetch a file by URL, but most likely you'll need to perform an HTTP 
>>>> request 
>>>> to that URL, read the body, and pass it to a parser.
>>>>
>>>> - mingle
>>>>
>>>>
>>>> On Sun, Oct 21, 2018 at 5:13 AM John More  
>>>> wrote:
>>>>
>>>>> I can not find any documentation indicating how to retrieve the 
>>>>> Calendar Integration Values below. I can create and manipulate calendars 
>>>>> add events etc using the calendar library.
>>>>> Is it possible that these values are simply not available?
>>>>>
>>>>> Thanks any assistance is appreciated.
>>>>>
>>>>> John More
>>>>>
>>>>> [image: Screenshot from 2018-10-21 08-04-52.png]
>>>>>
>>>>> -- 
>>>>> 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 g

Re: [go-nuts] Calendar Integration Values

2018-10-23 Thread John More
Mingle,
The library I am using is the "google.golang.org/api/calendar/v3" which 
accesses the  https://www.googleapis.com/calendar/v3 REST interface.
I would like to read the secret address of a calendar that I create in a G 
Suite domain user's account so I can dynamically forward it to another 
company that insist they need it to watch for events on the calendar. I 
know it is not appropriate to do this with the private address but this was 
set up before my time and it will be changed but for now history has me 
trapped.
I have tried the API Explorer and I have reviewed the library code and can 
not see where this value is part of any structure.

Thank you for your reply.

John


On Monday, October 22, 2018 at 12:51:02 AM UTC-4, mingle wrote:
>
> John,
>
> Can you provide more details on which "calendar library" you are referring 
> to?
>
> The link you've highlighted in Google calendar points to a file in 
> iCalendar format. You'll probably want an iCalendar parser to handle the 
> file, I've personally used this one, but it doesn't handle everything in 
> the spec: https://github.com/luxifer/ical.
>
> Depending on the parser that you choose it may have functionality to fetch 
> a file by URL, but most likely you'll need to perform an HTTP request to 
> that URL, read the body, and pass it to a parser.
>
> - mingle
>
>
> On Sun, Oct 21, 2018 at 5:13 AM John More  > wrote:
>
>> I can not find any documentation indicating how to retrieve the Calendar 
>> Integration Values below. I can create and manipulate calendars add events 
>> etc using the calendar library.
>> Is it possible that these values are simply not available?
>>
>> Thanks any assistance is appreciated.
>>
>> John More
>>
>> [image: Screenshot from 2018-10-21 08-04-52.png]
>>
>> -- 
>> 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...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Caleb Mingle
>
> mingle.cm | @caleb_io <http://twitter.com/caleb_io>
>

-- 
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] Calendar Integration Values

2018-10-21 Thread John More
I can not find any documentation indicating how to retrieve the Calendar 
Integration Values below. I can create and manipulate calendars add events 
etc using the calendar library.
Is it possible that these values are simply not available?

Thanks any assistance is appreciated.

John More

[image: Screenshot from 2018-10-21 08-04-52.png]

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


Re: [go-nuts] Re: Working with import "google.golang.org/api/admin/directory/v1"

2018-08-26 Thread John More
Silviu,
Thank You.
It was my birthday yesterday and I spent all day trying to follow the
source code trail and you provided a great birthday present.
It worked as you advised and I am sure I will have many more occasions to
use this.
One side effect of my day going through the library source code was
increased go knowledge.

Thanks Again

John


On Sun, Aug 26, 2018 at 9:17 AM,  wrote:

> Hi John
>
> If you look at the source code, you will notice that the User struct they
> have makes use of a custom MarshallJSON method, which accepts
> ForceSendFields (as defined inside the User type)
>
> So what you might need to do, is add that "Suspended" into that slice and
> it will marshall it to JSON
>
> See: https://play.golang.org/p/TY-hFUlYewL
>
> Silviu
>
>
> On Saturday, 25 August 2018 23:20:09 UTC-4, John More wrote:
>>
>> I am using the "google.golang.org/api/admin/directory/v1" to access a G
>> Suite account and everything seems to work EXCEPT:
>> The import defines a User structure that includes the following element
>> among many others
>> Suspended bool <https://godoc.org/builtin#bool>
>> `json:"suspended,omitempty"`
>>
>> When set to false the json.Marshal treats this as an empty field which
>> will not allow me to reactivate a user.
>> Calling the API directly without using the library is not an option as I
>> am using a service account which means I have to use a JWT and I really
>> have no idea how to get the Bearer token.
>> Copying the user struct from the library generates a lot of compiler
>> dependency errors
>>
>> If anyone has run into this before.. workarounds or clues are appreciated
>>
>> 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.
>



-- 
John More
613-354-1234
613.328.8885

-- 
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] Working with import "google.golang.org/api/admin/directory/v1"

2018-08-25 Thread John More
I am using the "google.golang.org/api/admin/directory/v1" to access a G 
Suite account and everything seems to work EXCEPT:
The import defines a User structure that includes the following element 
among many others
Suspended bool  `json:"suspended,omitempty"` 

When set to false the json.Marshal treats this as an empty field which will 
not allow me to reactivate a user. 
Calling the API directly without using the library is not an option as I am 
using a service account which means I have to use a JWT and I really have 
no idea how to get the Bearer token.
Copying the user struct from the library generates a lot of compiler 
dependency errors

If anyone has run into this before.. workarounds or clues are appreciated

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.


Re: [go-nuts] Go Install

2018-08-06 Thread John More
You are right, using the -i option did the deed.
Thanks
John

On Tue, Aug 7, 2018 at 1:26 AM, Ian Lance Taylor  wrote:

> On Mon, Aug 6, 2018 at 7:09 PM, John More  wrote:
> > following the tutorial at https://golang.org/doc/code.html the go
> install I
> > am confused by the following statement:
> >
> >
> > Whenever the go tool installs a package or binary, it also installs
> whatever
> > dependencies it has. So when you install the hello program
> >
> > $ go install github.com/user/hello
> >
> > the stringutil package will be installed as well, automatically.
> >
> > Does this mean stringutil.a will show up in the pkg folder or do I have
> to
> > do I have to explicitly install the stringutil.go  file.
> >
> > Following the instructions does not produce the suggested output that
> > includes the stringutil.a file under the pkg directory.
> >
> > Am I missing some compiler flags or an environment variable?
>
> Sorry, this time replying to all.
>
> I don't think that statement is accurate.  I think that's a bug in
> go/doc/code.html.  It's only true if you use the -i option.
>
> Ian
>



-- 
John More
613-354-1234
613.328.8885

-- 
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] Go Install

2018-08-06 Thread John More
following the tutorial at https://golang.org/doc/code.html the go install I 
am confused by the following statement:


Whenever the go tool installs a package or binary, it also installs 
whatever dependencies it has. So when you install the hello program

$ *go install github.com/user/hello*

the stringutil package will be installed as well, automatically.

Does this mean stringutil.a will show up in the pkg folder or do I have to 
do I have to explicitly install the stringutil.go  file.

Following the instructions does not produce the suggested output that 
includes the stringutil.a file under the pkg directory. 

Am I missing some compiler flags or an environment variable?

Appreciate the help


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.