Skip to content

Instantly share code, notes, and snippets.

# code for generating the graphs in https://theconfused.me/blog/numerical-integration-of-light-paths-in-a-schwarzschild-metric/
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as spi
def schw_null_geodesics(w, t, p):
r, rdot, phi = w
M, L = p
phidot = L / r**2
@lingxz
lingxz / get_sogou_wallpaper_windows.py
Created September 10, 2016 10:27
sets a random sogou wallpaper from their website as the desktop wallpaper on windows when run
import requests
from bs4 import BeautifulSoup
import os
import os.path
import datetime
import ctypes
import numpy.random as npr
dt = datetime.datetime.now()
cd = str(dt.year)+'0'+str(dt.month) + str(dt.day)