Skip to content

Instantly share code, notes, and snippets.

Miguel Martin miguelmartin75

Block or report user

Report or block miguelmartin75

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 nested_models.py
from keras.utils import plot_model
from keras.models import Model
from keras.layers import Input, Dense, concatenate
def create_inner_model():
input=Input((10,))
d1 = Dense(128)(input)
d2 = Dense(64)(d1)
@miguelmartin75
miguelmartin75 / tuple_type_wrapper_thing.cpp
Created Aug 25, 2014
basically converts std::tuple<T1, T2, ..., TN> to std::tuple<X<T1>, X<T2>, ..., X<TN>>, hue.
View tuple_type_wrapper_thing.cpp
#include <iostream>
#include <tuple>
template<template <typename T> class X>
struct Wrap
{
template <typename T, typename... Args>
struct Deducer
{
typedef decltype(std::tuple_cat(std::tuple<X<T>>(), typename Deducer<Args...>::tuple())) tuple;
@miguelmartin75
miguelmartin75 / insertion_sort.cpp
Last active Aug 29, 2015
sorting algorithms, heh.
View insertion_sort.cpp
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
template <typename RandomIt>
void insertion_sort(RandomIt begin, RandomIt end)
{
// loop through all the elements, from
// the the second element to the last.
@miguelmartin75
miguelmartin75 / intostr.cpp
Last active Aug 29, 2015
add vs lookup table
View intostr.cpp
#include <chrono>
#include <cstdint>
#include <iostream>
#include <random>
#include <sstream>
using namespace std;
typedef std::chrono::microseconds time_unit;
static const std::string time_unit_suffix{"us"};
View vec_vs_list_vs_link_benchmark.cpp
View biasedcoin.py
import random
HEADS = 0
TAILS = 1
n = input("How many samples do you wish to compute?: ")
p = random.random()
print "probability of getting heads is:", p
@miguelmartin75
miguelmartin75 / rojo_design.cpp
Last active Jan 2, 2016
A design for my library rojo (the rendering aspect of it).
View rojo_design.cpp
struct ogl_backend
{
typedef unsigned texture_handle_type;
void load(texture_handle_type& texture, const Image& image)
{
std::cout << "loading, " << image.id << '\n';
}
void destroy(texture_handle_type& texture)
@miguelmartin75
miguelmartin75 / SDL.cpp
Last active Dec 25, 2015
A simple application with SDL (1.2 and 2), to check whether it is working or not.
View SDL.cpp
#include <iostream>
#include <SDL/SDL.h>
int main(int argc, char * argv[])
{
// Initialize SDL with video
SDL_Init(SDL_INIT_VIDEO);
// Create a window with SDL
You can’t perform that action at this time.