Skip to content

Instantly share code, notes, and snippets.

@lgersman
lgersman / README.md
Last active October 19, 2022 12:15
improved version of my d3.js selection frame example (https://gist.github.com/lgersman/5310854) supporting draggable/selectable nodes
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

new features :

  • circles are draggable
  • circles can be selected (multiple selections possible by pressing CTRL while clicking a circle)
  • the selection frame selects all circles within the frame (by pressing CTRL the selected circles will be appended to current selection)
  • multiple selected circles will be dragged simultaneous
@endolith
endolith / output.png
Last active May 21, 2024 23:58
Detecting rotation and line spacing of image of page of text using Radon transform
output.png
@cboettig
cboettig / docker-compose.yml
Last active December 31, 2023 15:23
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@wmvanvliet
wmvanvliet / signal_quality.py
Created March 9, 2016 14:21
Evaluation of bad channel detection method
import mne
import numpy as np
from scipy.stats import norm
from matplotlib import pyplot as plt
# Load required sample data
data_path = mne.datasets.sample.data_path()
subjects_dir = data_path + '/subjects'
evoked = mne.read_evokeds(data_path + '/MEG/sample/sample_audvis-ave.fif')[0]
fwd = mne.read_forward_solution(data_path + '/MEG/sample/sample_audvis-meg-eeg-oct-6-fwd.fif', surf_ori=False, force_fixed=True)
@kingjr
kingjr / lda_ridge_pcagnb.ipynb
Last active August 2, 2017 16:10
This illustrate that LDA, Ridge and PCA+GNB are equivalent for binary y
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awni
awni / ctc_decoder.py
Last active June 1, 2024 14:21
Example CTC Decoder in Python
"""
Author: Awni Hannun
This is an example CTC decoder written in Python. The code is
intended to be a simple example and is not designed to be
especially efficient.
The algorithm is a prefix beam search for a model trained
with the CTC loss function.
@zuphilip
zuphilip / engines.json
Created September 6, 2017 17:49
Example of a Zotero engines.json (for using it replace the paths by null or something else)
[
{
"name": "CrossRef Lookup",
"alias": "CrossRef",
"icon": "file:///C:/Users/zumstein/AppData/Roaming/Mozilla/Firefox/Profiles/fo682pah.default/zotero/locate/CrossRef%20Lookup.gif",
"_urlTemplate": "http://crossref.org/openurl?{z:openURL}&pid=zter:zter321",
"description": "CrossRef Search Engine",
"hidden": false,
"_urlParams": [],
"_urlNamespaces": {
# Correlation Matrix Heatmap
f, ax = plt.subplots(figsize=(10, 6))
corr = wines.corr()
hm = sns.heatmap(round(corr,2), annot=True, ax=ax, cmap="coolwarm",fmt='.2f',
linewidths=.05)
f.subplots_adjust(top=0.93)
t= f.suptitle('Wine Attributes Correlation Heatmap', fontsize=14)