Skip to content

Instantly share code, notes, and snippets.

View amallia's full-sized avatar
🏠
In Pisa

Antonio Mallia amallia

🏠
In Pisa
View GitHub Profile
@amallia
amallia / machine_learned_index.py
Created March 2, 2019 07:42 — forked from tokestermw/machine_learned_index.py
Using deep learning to approximate a B-Tree index from this paper: https://arxiv.org/abs/1712.01208 (The Case for Learned Index Structures)
import click
import torch
import torch.autograd
import torch.nn.functional as F
from torch.autograd import Variable
import os
import random
import math
@amallia
amallia / custom_iterator.cpp
Created September 29, 2018 00:30 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
## All plt.rcParams lines are defined globally for all the following plots.
# Use latex to produce it and use the ACM default sans-serif package
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.preamble'] = r'\usepackage{libertine}\usepackage{fixltx2e}'
plt.rcParams['font.family'] = "sans-serif"
package partition_problem;
public class DynamicProgrammingPartitionProblemSolver implements ThePartitionProblemSolver {
public int[] solve(int[] books, int k) {
assert k > 0 && books.length >= k;
// prefix sums: sum[k] = books[i..k]
final int[] sum = new int[books.length];
@amallia
amallia / gist:cb44dfefa30a4717c21894a23ce759ee
Created July 24, 2017 10:41 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: