Skip to content

Instantly share code, notes, and snippets.

Kevin Mader kmader

  • Magic Leap
  • Zurich, Switzerland
Block or report user

Report or block kmader

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SingleCoreSolution.cpp
#include"SingleCoreSolution.h"
namespace SingleCoreSolution {
std::string Solution::TrickOrTreat(const std::vector<int>& pieces,
const int homes, const int max) {
//calculate prefix sum;
std::vector<int> prefixSum(homes + 1, 0);
for (int i = 0; i < homes; ++i) {
prefixSum[i + 1] = prefixSum[i] + pieces[i];
}
View more_working.R
library(quantmod)
library(rvest)
table_id <- 3
url <- "https://en.wikipedia.org/wiki/S%26P_100"
sp100 <- url %>%
read_html() %>%
html_nodes("table") %>%
.[[table_id]] %>%
html_table()
@kmader
kmader / a-greenland-ice-melting-graph.ipynb
Last active Aug 5, 2019
Greenland Surface Melt Extent, the NSIDC has a very interesting melt-chart but unfortunately doesn't quite show all the steps taken to make it. So here we attempt to reproduce the chart from the raw data by pulling it all from their API. ## Acknowledgements - Greenland Ice Sheet Today is produced at the National Snow and Ice Data Center by Ted S…
View a-greenland-ice-melting-graph.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / environment.yml
Last active Mar 22, 2019
Out of order bug
View environment.yml
name: plotly_express
dependencies:
- python=3.5
- numpy
- matplotlib
- pandas
- scikit-learn
- pip:
- plotly==3.7.1
- plotly_express
View Comparing_Heart_Rate.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / CornerstoneDemo.ipynb
Created Aug 30, 2018
Cornerstone Demo Notebook
View CornerstoneDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kmader
kmader / volume_labelmap.py
Created Aug 17, 2018
convert volumes to labelmaps in Slicer3D
View volume_labelmap.py
from glob import glob
import os
cur_glob = '/Volumes/NO NAME/*seg.nii'
files_to_process = glob(cur_glob)
print('Processing', len(files_to_process), 'files')
def process_file(in_path):
slicer.mrmlScene.Clear(0)
[success, loadedVolumeNode] = slicer.util.loadVolume(in_path, returnNode=True)
outputLabelMap = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')
vol_logic = slicer.modules.volumes.logic()
@kmader
kmader / jupyanno.html
Created Aug 2, 2018
FunAnnotation.html
View jupyanno.html
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Thebe Lab examples</title>
<link rel="stylesheet" type="text/css" href="index.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js">
</script>
<!-- Configure and load Thebe !-->
@kmader
kmader / ImageEnhancementPlayground.ipynb
Created Mar 7, 2018
Using IPywidgets and Matplotlib Together
View ImageEnhancementPlayground.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.