This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys # we use sys to get the input to the service | |
# from sys.stdin | |
from urllib.parse import quote # to convert high-ASCII and other | |
# into URL-compatible quoting | |
import webbrowser # To open the web browser | |
# establish the base instance URL | |
jama_search_base_url = "https://almaobservatory.jamacloud.com/perspective.req#/" | |
project_id="project_id code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import datetime as dt | |
def riddle_for_date(date, solutions=False): | |
""" | |
Determines the number for the Saturday Mac Riddle associated with | |
a given date, considering whether it is the date for the riddle | |
or the solutions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{hyperref} | |
\usepackage{makeidx} | |
\usepackage{glossaries} | |
\makeindex | |
\makeglossaries | |
% Define your acronym |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script assumes that [mdbtools][1] are installed, for instance with | |
# `brew install mdbtools` | |
# [1]: https://github.com/mdbtools/mdbtools | |
# It also assumes that [pandas][2] and [pandas_access][3] are installed, | |
# [2]: https://pandas.pydata.org/ | |
# [3]: https://pypi.org/project/pandas_access/ | |
# which you can do with | |
# `pip install pandas pandas_access` | |
# or | |
# `pip install pandas_access` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph pictionary_play { | |
node [fontname = "Handlee"]; | |
edge [fontname = "Handlee"]; | |
splines=false; | |
randir=LR; | |
draw [ | |
label = "Draw a picture"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from atlassian import Confluence | |
def obtain_confluence_pat(path='~/.ConfluencePAT'): | |
confluence_PAT_filename = os.path.expanduser(path) | |
confluence_PAT = None | |
if os.path.exists(confluence_PAT_filename): | |
with open(confluence_PAT_filename, "r") as pat_file: | |
confluence_PAT = pat_file.readline() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Quick inverse square root using bit patterns | |
//Might be slower nowadays than using specific functions | |
// The following is the abridged version of the Quake function | |
// See more at https://en.wikipedia.org/wiki/Fast_inverse_square_root | |
//float Q_rsqrt( float number ) | |
//{ | |
// long i; | |
// float x2, y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ads | |
import pandas as pd | |
ads.config.token='putYourOwnAdsConfigTokenHere' | |
bibgroups = [ | |
"ALMA", | |
"CfA", | |
"CFHT", | |
"Chandra", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
right_of(X, Y) :- X =:= Y+1. | |
left_of(X, Y) :- right_of(Y, X). | |
next_to(X, Y) :- right_of(X, Y). | |
next_to(X, Y) :- left_of(X, Y). | |
solution(Street) :- | |
/* There are 5 houses in the street, all of different colours; | |
and their owners all have different nationalities, smoke different brands, | |
have different pets, and have different drinks */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
right_of(X, Y) :- X is Y+1. | |
left_of(X, Y) :- right_of(Y, X). | |
next_to(X, Y) :- right_of(X, Y). | |
next_to(X, Y) :- left_of(X, Y). | |
solution(Street, FishOwner) :- | |
Street = [ | |
house(1, Nationality1, Color1, Pet1, Drinks1, Smokes1), | |
house(2, Nationality2, Color2, Pet2, Drinks2, Smokes2), |
NewerOlder