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
############################################################################### | |
# Class: PumaSubmitter_sbatch | |
# | |
# Purpose: Launch an MPI job with sbatch. | |
# | |
# Programmer: Devin Bayly (extending Brad Whitlock's work) | |
# Date: Thu May 17 14:22:04 PDT 2012 | |
# | |
# Modifications: | |
# Satheesh Maheswaran, Tue Jan 15 14:47:54 GMT 2013 |
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 python3 | |
# encoding: utf-8 | |
"""Use instead of `python3 -m http.server` when you need CORS""" | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
class CORSRequestHandler(SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_header('Access-Control-Allow-Origin', '*') |
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
{ | |
"data": { | |
"url": "https://gist.githubusercontent.com/DevinBayly/946ca3386bc910be49121e209f8a6d5b/raw/d38bbfc4315abac24198b90c9958fda95979ca5c/iris.json" | |
}, | |
"mark": "bar", | |
"encoding": { | |
"y": { | |
"aggregate": "mean", | |
"field": "petal_length", | |
"type": "quantitative" |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "Plot showing a 30 day rolling average with raw values in the background.", | |
"title":"Learning Vega", | |
"data": { | |
"url": "https://gist.githubusercontent.com/DevinBayly/a4bbb3b0f1293f0b4d373bc99e1917cc/raw/ca4376a0255d00885866be5b7f395743833321e9/vega_data.json" | |
}, | |
"width": 400, | |
"height": 300, |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "Plot showing a 30 day rolling average with raw values in the background.", | |
"title":"Learning Vega", | |
"data": { | |
"url": "https://gist.githubusercontent.com/DevinBayly/a4bbb3b0f1293f0b4d373bc99e1917cc/raw/ca4376a0255d00885866be5b7f395743833321e9/vega_data.json" | |
}, | |
"width": 400, | |
"height": 300, |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "Plot showing a 30 day rolling average with raw values in the background.", | |
"title":"Learning Vega", | |
"data": { | |
"url": "https://gist.githubusercontent.com/DevinBayly/a4bbb3b0f1293f0b4d373bc99e1917cc/raw/ca4376a0255d00885866be5b7f395743833321e9/vega_data.json" | |
}, | |
"facet":{"row":{"field":"category"},"col":{"field":"category"}}, | |
"spec":{ | |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "Plot showing a 30 day rolling average with raw values in the background.", | |
"width": 400, | |
"height": 300, | |
"data": { | |
"url": "https://gist.githubusercontent.com/DevinBayly/a4bbb3b0f1293f0b4d373bc99e1917cc/raw/710cd28eb5e458f270c5686823887ff19c8b998f/vega_data.json" | |
}, | |
"mark": "point", | |
"encoding": { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 time | |
import socket | |
import socketserver | |
import ssl | |
import numpy as np | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
## the reusaddr part means you don't have to wait to restart | |
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1) |
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
from numba import njit | |
import numpy as np | |
from itertools import product | |
# %% | |
dim = 800 | |
boidcount = 3000 | |
frame = np.ones((dim,dim,3)).astype("uint8")*255 | |
nbhds = np.array([list(product(np.arange(-1,1), np.arange(-1,1)))]).reshape(-1,2) | |
positions = None |
NewerOlder