Skip to content

Instantly share code, notes, and snippets.

View brendanjmeade's full-sized avatar

Brendan Meade brendanjmeade

View GitHub Profile
@dwf
dwf / gist:1222883
Created September 16, 2011 19:19
Using matplotlib + multiprocessing for asynchronous, interactive monitoring plots.
"""Demo of how to pop up plots asynchronously using separate processes."""
from multiprocessing import Process
import time
import sys
import matplotlib.pyplot as plt
import numpy as np
def demo():
i = 0
processes = []
@CnrLwlss
CnrLwlss / circleObjective.py
Created January 19, 2013 13:51
Functions for packing N circles into a rectangle of width W and height H, together with a function for plotting solution and some example code fitting 13 circles into a square. http://cnr.lwlss.net/CircleObjectivesPython/ #python #opimisation #circle #packing #svg #function #closure
import random, numpy
def genGuess(N,W,H):
'''Generate sensible initial guess vector (random circle coordinates and radii)'''
z=numpy.zeros(3*N)
for i in xrange(0,N):
z[i*3]=random.random()*W
z[i*3+1]=random.random()*H
z[i*3+2]=0.001*min(W,H)+random.random()*(0.009*min(W,H))
return(z)
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jkleint
jkleint / timeseries_cnn.py
Created July 29, 2016 04:05
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@xiaolai
xiaolai / jupyter-as-a-desktop-app.md
Last active May 3, 2025 12:56
Run Jupterlab as an desktop app

How to run Jupyterlab as a desktop app on Mac OSX

In Sep, 2021, Jupyterlab Desktop App (electron) was released by Mehmet Bektas (github repo).

brew install --cask jupyterlab

jupyterlab-app-first-opened

@haampie
haampie / unet.jl
Created January 30, 2020 15:43
unet.jl
function concat_and_crop(mx::AbstractArray{T,4}, x::AbstractArray{T,4}) where T
w, h = size(x)
mw, mh = size(mx)
rx = (1:mw) .+ ((w - mw) ÷ 2)
ry = (1:mh) .+ ((h - mh) ÷ 2)
return cat(x[rx, ry, :, :], mx, dims = 3)
end
create_model_2d_classes() = Chain(
BatchNorm(1),
@martinchapman
martinchapman / mosaic.sh
Last active May 18, 2023 15:25
Visualise a latex document git history
# Visualise a latex document git history
# loop through commits, create a PDF from your main file for each
# translate the pages of that PDF to a single image
# create GIF/mp4 from the folder of images created
# run within your local repository
# prerequisites: ImageMagick and FFmpeg
# create output folder
@Emilycm-97
Emilycm-97 / topo_map_generator.ipynb
Created November 24, 2025 20:40
topo_map_generator.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.