Skip to content

Instantly share code, notes, and snippets.

View JossWhittle's full-sized avatar
😸

Joss Whittle JossWhittle

😸
View GitHub Profile
import numpy as np
# Some array of booleans of width w and height h
#occupied_map = np.array([[0,0,0,0],
# [1,1,1,0],
# [0,0,0,1],
# [0,1,0,1],
# [0,1,0,0],
# [0,1,1,0],
# [0,0,0,0]], dtype=np.int32).astype(np.bool)
% In preamble.
\usepackage[font=small,skip=0pt,format=hang]{caption}
% Allows you to set the width of table columns.
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% In document
\begin{table}[H]
{\resizebox{\columnwidth}{!}{ % Use \textwidth for single column format.
F = meshes[0]["Faces"].copy().sort(1)
num_faces = F.shape[0]
edges = {}
for i in range(num_faces):
edges.setdefault(tuple(F[i,:2]), []).append(i)
edges.setdefault(tuple(F[i,1:3]), []).append(i)
edges.setdefault(tuple(F[i,[0,2]]), []).append(i)
neighbours = np.zeros((num_faces, 3), dtype=np.uint32)
# http://machinelearningmastery.com/using-learning-rate-schedules-deep-learning-models-python-keras/
from keras.callbacks import LearningRateScheduler
generator.compile(loss=laplacian_charbonnier_loss, optimizer=RMSprop(lr=0))
def step_decay(epoch):
initial_lrate = 0.0002
drop = 0.5
epochs_drop = 50.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JossWhittle
JossWhittle / Bake.java
Last active January 11, 2017 20:30 — forked from anonymous/Bake.java
import java.util.Scanner;
public class Bake {
// Constants for bag sizes
static final double[] FLR_SIZES = { 750, 500, 250 };
static final double[] SUG_SIZES = { 600, 400, 200 };
static final double[] BUT_SIZES = { 500, 250, 125 };
static final double[] EGG_SIZES = { 12, 10, 6 };
graph contour_tree {
layout="dot"
rankdir=UD
ranksep="0.02"
graph [fontname="helvetica"];
node [fontname="helvetica"];
edge [fontname="helvetica"];
s_3539 [label="108" fontcolor="#0CADBC" shape=none]
s_3459 [label="163" fontcolor="#92BF72" shape=none]
s_3460 [label="163" fontcolor="#92BF72" shape=none]
#pragma once
#include <vector>
#include <string>
#include "../RenderingEssentials/maths/Vec.hpp"
#include "../RenderingEssentials/maths/Common.hpp"
#include "../RenderingEssentials/geom/Geom.hpp"
#include "../RenderingEssentials/utils/Loader.hpp"
#include "../RenderingEssentials/utils/Exporter.hpp"
static inline unsigned char* LoadBMP_24(const std::string &path) {
int w, h;
unsigned char *img = nullptr;
std::ifstream inFile(path, std::ios::in | std::ios::binary);
if (inFile.is_open()) {
/// Header
unsigned char hdr[0x36];
inFile.read((char*) hdr, 0x12);
#include <cmath>
#include <cstring>
#include <cstdio>
float sensors[9];
struct float2 {
float x, y;
};