How do I repeat events in an ICS file every x seconds? - calendar

I'm trying to set up calendar events in macOS Sierra's Calendar that repeat every 2,551,440 seconds (which happens to be the synodic period of the Moon). This system uses the ICS specification.
Ultimately, I want a calendar that provides the Moon rise and set times for my location, and it also needs to list the Lunar phase (e.g. Full Moon, New Moon, etc.). I have found plenty of examples on the Internet where people have manually created the events, but that's incredibly tedious (one event per day for years!), and they're based on different time zones (and so are of no use to me).
I have seen from the ICS specifications that the file format itself supports events that recur every x seconds. I exported an event as an ICS file (from Calendar), and then edited the ICS file in a text editor, but I must've got the code wrong, as it didn't re-import into macOS Calendar with the correct repeat interval. Instead, it imported a single event with no repetition. It's also possible that I got the code right, but Calendar discarded it upon import...
Can someone please explain how to go about doing this?
I found the RRULE Generator, but that only supports hourly intervals, not seconds, and so is not precise enough for my needs.
I considered running a bash script to generate the event (which would run as a cron job every 2,551,440 seconds), but that would only give a month's notice. I'd prefer to have it set up indefinitely.
Another option may be to write a script in Python to create individual ICS event files; this would also be tedious...
I understand that this can't be done in Calendar directly; the solution will most likely be manually editing each ICS file to set up the recurrence correctly, and then importing them into Calendar... I just don't know how...
...or is there a calendar application somewhere out there that lets you set up events that recur every x seconds? If so, I could create the event in that, export it and then import it into Calendar...
Thanks in advance for any thoughts.

So, I figured this one out.
Apple Calendar, Google Calendar, and pretty much all calendar applications don't support events that repeat every x seconds. The ICS format itself does, just not the programs.
The Moon is in an inclined orbit, so this is an inappropriate solution for what I wanted anyway.
The US Navy has an API that publishes rise/set and phase data for the Moon. I saved the responses from this page (a JSON file), and did some Python code to extract the required data, and then made a Python script to create the separate .ICS files for each event (one event per Moonrise) (i.e. not one event that repeats every x seconds). I then imported those ICS files into macOS Calendar.
Hope this helps someone else who needs to deal with a similar situation in future...

Related

Synchronizing events of my system into most widely used calendars

I have implemented a (sports field) booking system. I would like to add one feature: when a customer makes a booking I would like to offer him the possibility to get/sync his newly created entry in his own calendar.
One solution what I already found is to create an iCalendar feed for the customer with his bookings. So he can take this feed (basically an URL pointing to a user-specific .ics file) and integrate it into his calendar applications (as most will support the addition of external calendars).
One bottleneck with this solution is that a good amount of customers use Gmail and its calendar. And it may take some time until Gmail refreshes external calendars. So it may take up to few hours until the newly created entry appears in the customers calendar.
Of course there's no such problem when customer is using calendar apps which offer more frequent or on-demand synchronization.
So my question here: what other solutions can you recommend? An export in a file for the newly created event? Or any other technology to sync our bookings with the most widely used calendars? What would be the most usable solution for customers?
If you want to be able to auto update / synchronise the booking by having the user subscribe, then the ics feed is the standard cross application way to do it.
If it is just one booking and is never going to be updated, then you could encourage them to import the ics file to their calendar which usually then appears within seconds.
You can also email them the ics file. It is then not subscribeable as it is NOT a url. How it is handled depends on their email and system setup, but most would offer import into their calendar. (Mine opens in notepad++) ;)

AppleScript to move iCal events from one calendar to another

Trying to script the moving of events containing a keyword from one calendar to another but hitting a wall. Any pointers? I'm currently doing something like this:
tell application "Calendar"
move ((events of calendar "Cal1") whose summary contains "Test") to calendar "Cal2"
end tell
However, this is iCal is returning this error:
"There was an error saving calendar data.
Calendar encountered a critical error while saving to the database, and recent changes may be lost. More information may be available in the console."
What am I doing wrong?
Thanks :)
J
This is a difficult task for AppleScript in the current version of Calendar. It can be done by repeating through the list of target Events, making new Events based on the properties of the target Events, and then deleting the original Events. Or you can just get my app from the App Store.

Export multiple database records to iCal or gCal

I'm building a simple scheduling application for a client. It allows teachers to create a calendar of assignments for their students. I'd like to offer the ability for a student to add ALL assignments to their calendar at one time. Say there were 20 assignments over a 4 week period. This functionality would allow the student to download a single file, or follow a certain feed, to add all 20 assignments to their calendar at one time.
In my head this would be a single iCal file, but I'm not sure if iCal works that way. Alternately, each course /course/basket-weaving-101_51/ would have an RSS feed /course/basket-weaving-101_51/cal/ that could be followed.
Does anyone have experience with this, or could offer guidance?
Yes, one feed program that accepts parameters via the url could be used to offer a subscribeable calendar feed at whatever level of detail you wish. I say subscribeable as that, at a student level ... /student_id_or_name?feed=ics would offer the students the most convenient solution. They could subscribe once and then all the courses assignments that they are signed up for all courses over time could automatically appear as their calendar app refreshes the feed.
A single assignment could also offer a feed of the one 'event'. But that should probably be imported into their main calendar, rather than subscribing!
Note subscribing is different to importing - your help instructions need to make that clear as it is up to the user what they do with the feed.
Import(or add to calendar) is a once-off and will not update with new events/assignments.
Subscribing as a separate calendar I find much preferable as most calendar apps will let one check and uncheck the calendars as you need them. I have mykids timetables subscribed (and public holidays etc) but that's a very busy view, so often I just untick them
for a cleaner view.
You need to get familiar with the treatment of ical by the different calendar clients (outlook, webmail) before you can decide how best to target them. In general, they have two modes for treating ical: "accept an invitation" and "subscribe to an internet calendar".
The big advantage of "Accept an invitation" is that your events go into the user's calendar, and generate reminders and so on as if the user had created the event. The disadvantage is that you need to send your invitations one "event" at a time by email, and, particularly in Outlook, they may need to be viewed as mail before they appear in the calendar. If you're sending out 20 or more assignments, this may feel like spam to the recipient.
"Subscribe to an internet calendar" is a little misleading in that an ical feed is not a feed. You put the "whole calendar" on a website, and the client poles the website. Outlook and webmail clients are generally happy to display these calendars, but "importing" the events into the user's own calendar is a bit clunky. Gmail and webmail display the info on the same grid by default. Outlook displays a new grid for each calendar.
Modifications are a bit more complex for the subscription scenario. You will likely want to regenerate the whole calendar for affected students, whereas in the invitation scenario you just send one mail with the changed event.
Even so, if you have a database with courses, students and enrolments, you could do a nice little app that generates an ical per student, names it with their student number, and whacks it in a calendars folder. The student subscribes once to http://myuniversity.com/calendars/12345.ical, and each semester all their assignments are automatically in their web calendar.
Be careful with the subscription link. If tens of thousands of students subscribe to (pole) a dynamically generated calendar, you are going to have a lot of needless processing, and quite likely a performance headache. You want to be generating static files, then let your webserver negotiate with the client whether they need to be resent.

Want to create a Lead Time chart based on the selection of two releases rally

Want to create a Lead Time chart based on the selection of two releases rally
like below
Something like this, with the options to select two releases start release and end release. So this chart should be prepared for those releases time period, rather than for whole year.
Any suggestions, examples for this. Which calculator should I use. Any help will be appreciated, thanks in advance
Cycle/Lead Time cannot be customized beyond what's available in the Settings because it is actually a report served by a legacy analytics service. Generally, this applies to all the reports available on Reports>Reports page even when they can be installed via AppCatalog. Anything that can be accessed via StandardReports component available in older AppSDK1 falls into this category. AppSDK2 also has a thin wrapper over it via Rally.ui.report.StandardReport but the same limitation applies since underneath it is using the same built-in reports that predate LookbackAPI.
If you decide to write an app from scratch that displays cycle time use AppSDK2's SnapshotStore that gets historic data from LookbackAPI.

How to find all files that were changed at last session, or at a given date

I'm trying to implement ClearCase at our small site.
We are using CCRC (remote client) only, since we are located away from the CC server.
Now I'm able to check out, change files and then check in a bunch of different files.
However, say at the end of the day, or next day, I want to know which files I modified (or evey a month from now), I'd like to know which files I modified last time I worked on that project.
How could I do that?
Any help will be much appreciated
You need to use a (preferably) dynamic view with a time-based selection rule in its config spec.
In your case, ie CCRC, a simple web view will work. Simply limit at first the loading rules, while you experimenting with those special selection rules.
You can see an example of such a rule at how to find out all the activities happend in a branch in the last month?

Resources