Skip to content

Instantly share code, notes, and snippets.

Summary

Starting in March 2024, my Outlook calendar ICS export failed to include a time zone definition. This caused the times to show up wrong when I import the ICS into Google Calendar. I managed to correct this by changing the time zone definition, which can be done automatically using scripts.

Problem statement

I import my Outlook calendar in Google Calendar. The way this works is that Outlook generates an ICS file, which can be accessed via a URL, and which is updated each time I add or change appointments in Outlook calendar. This ICS URL can be imported automatically in Google Calendar so that my Outlook appointments appear in Google Calendar. However, recently, the Outlook appointments started appearing at the correct date but wrong time in Google Calendar. An appointment for 15 March 2024 10 AM would actually show up in Google Calendar as 15 March 2024 7 AM (!). This made it pretty unusable.

Diagnosis

@florisvanvugt
florisvanvugt / generalized_normalized_Laguerre.py
Last active April 29, 2023 18:46
Generalized Normalized Laguerre Polynomials in Python (SciPy)
# Trying from here https://www.researchgate.net/journal/Multimedia-Tools-and-Applications-1573-7721/publication/345040403_A_fast_and_accurate_computation_of_2D_and_3D_generalized_Laguerre_moments_for_images_analysis/links/5f9cf2ce458515b7cfac9142/A-fast-and-accurate-computation-of-2D-and-3D-generalized-Laguerre-moments-for-images-analysis.pdf?origin=publicationDetail&_sg%5B0%5D=9VkiGQ9q0Og1tlOvVuIh6e4pKfM3X1dYLsb2oI3bdeI9LxeElUb0SPaebXqBlu7IiYKDAECpxcEHYarICYyRXA.yCd1i-NvkgjWbKWRFnVHHXYiIXNzqYbLdRrEv10u6VHfSfsU2eoTSL4Hl9pxLrS7_hoVBLIrkStQjuXxxK4guQ&_sg%5B1%5D=WQy30fJkrM2uQOdD5kWfQM10xjGfBPn73CMKwiAMGKLMtZpaRVDqLDY31RX7KHYpGQfk7ZK3Yf6KiZ0uF8fI5t7GBpIAl7QC-DDgtB_z0815.yCd1i-NvkgjWbKWRFnVHHXYiIXNzqYbLdRrEv10u6VHfSfsU2eoTSL4Hl9pxLrS7_hoVBLIrkStQjuXxxK4guQ&_iepl=&_rtd=eyJjb250ZW50SW50ZW50IjoibWFpbkl0ZW0ifQ%3D%3D
import math
import scipy.special
import numpy as np
from scipy.special import genlaguerre
def genlaguerrenorm(n,a):
# Generalized normalized Laguerre polynomial
# Essentially, these are the gener
## Source: https://fep.umontreal.ca/a-propos/enseigner-a-la-fep/pedagogie/evaluation-des-apprentissages/
num2let <- data.frame(
seuil=c(0,.345,.495,.535,.565,.595,.645,.695,.725,.765,.795,.845,.895),
lettre=c('F','E','D','D+','C-','C','C+','B-','B','B+','A-','A','A+'))
findlet <- function(val) {
## Convert numeric grade into letter grade
if (is.na(val)) { return ("NA") }
selseuil <- max(subset(num2let,seuil<=val)$seuil)
return(num2let[ num2let$seuil==selseuil,'lettre'][[1]])
@florisvanvugt
florisvanvugt / .emacs
Last active May 30, 2018 16:34
Exporting Emacs Orgmode calendar to Google Calendar
;;; Taken pretty much verbatim from https://orgmode.org/worg/org-tutorials/org-google-sync.html
;;; Thanks to those developers!
;; https://stackoverflow.com/questions/23463962/emacs-export-calendar-bad-timezone-format-in-ics
(setq org-icalendar-timezone "America/New_York")
;;; define categories that should be excluded
(setq org-export-exclude-category (list "google" "private"))
@florisvanvugt
florisvanvugt / rnw2rmd.py
Last active April 16, 2018 20:50
Convert Rnw (Sweave) to R Markdown (Rmd)
#
# A very cheap-and-cheerful way to convert Rnw (Latex-R-Sweave) into Rmd (R Markdown).
#
# Probably doesn't work with any generality but may be nice to try anyway.
# NOTE: You'll have to do a whole bunch of manual tweaking of the file afterwards,
# because the Rmd will still contain lots of LATEX code.
from tkinter import filedialog
from tkinter import *
@florisvanvugt
florisvanvugt / multiband_slice_times.py
Last active August 19, 2017 23:28
Compute slice timings for multiband accelerated sequences
def multiband_slice_times_oddshots(TR,slices,multiband,incrementslice):
"""
Computes the slice timings of a multiband sequence.
I think this is mostly right but I am not an expert, so please use with caution.
And let me know if you spot errors. Thanks.
This is based on the description here:
https://wiki.humanconnectome.org/download/attachments/40534057/CMRR_MB_Slice_Order.pdf?version=3&modificationDate=1386977824455&api=v2
Arguments
@florisvanvugt
florisvanvugt / keybase.md
Created August 3, 2017 22:00
keybase.md

Keybase proof

I hereby claim:

  • I am florisvanvugt on github.
  • I am florisvanvugt (https://keybase.io/florisvanvugt) on keybase.
  • I have a public key ASDN5zT6Th8tBbFZRnpQuwB_vFIrNYng4U-B3i0Mee81ugo

To claim this, I am signing this object: