Skip to content

Instantly share code, notes, and snippets.

View kirkdotcam's full-sized avatar
🔍
Coding the science!

Camden Kirkland kirkdotcam

🔍
Coding the science!
View GitHub Profile
# coding
sudo snap install code --classic;
sudo snap install nvim --classic;
sudo snap install insomnia;
sudo snap install node --classic;
sudo snap install node-red;
sudo snap install dbeaver;
sudo snap install htop;
@kirkdotcam
kirkdotcam / alpacachannels.md
Created November 6, 2019 06:19
streaming channels for the alpaca api (definitely need for python SDK)
  • trade_updates: order updates
  • account_updates: account updates
  • T.: stock trades
  • Q.: stock quotes
  • A.: stock aggSec, the stock's aggregated per-second pricing
  • AM.: stock aggMin, the stock's aggregated per-minute pricing
#calc win/loss
if contestant_choice == prize_door:
trial.append(1)
else:
trial.append(0)
results_list.append(trial)
#calc win/loss
if contestant_choice == prize_door:
trial.append(1)
else:
trial.append(0)
results_list.append(trial)
#contestant_choice switches to the 'other' door
doors.remove(contestant_choice)
contestant_choice = doors[0]
#output results_list
trial.append(contestant_choice)
#announcer removes a door randomly, can't be contestant_choice or prize_door
to_remove = contestant_choice
while(to_remove == contestant_choice or to_remove == prize_door):
to_remove = random.choice(doors)
doors.remove(to_remove)
for guess in range(iterations):
#setup the guess
doors = ['a','b','c']
contestant_choice = random.choice(doors)
prize_door = random.choice(doors)
trial = [contestant_choice]
import random
import json
results_list = []
iterations = 5000
search_failure = []
for drug in top200_names:
res = requests.get(f"https://cactus.nci.nih.gov/chemical/structure/{drug}/stdinchi")
if res.status_code == 404:
search_failure.append(drug)
else:
inchi_to_mol_file(res.text, drug)
for key in inchi_dict:
inchi_to_mol_file(inchi_dict[key],key)