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 / 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:
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];

Keybase proof

I hereby claim:

  • I am amallia on github.
  • I am amallia (https://keybase.io/amallia) on keybase.
  • I have a public key ASCUoVfiba2AQD3YhdQG1kjQY6tVAGColeaIPb0tIV_f2go

To claim this, I am signing this object:

//
// Created by elia on 31/07/16.
//
#define BOOST_TEST_MODULE maxscoretier_queries
#include "succinct/test_common.hpp"
#include <boost/test/floating_point_comparison.hpp>
static DS2I_FLATTEN_FUNC auto
best_compressor(global_parameters const& params, uint64_t universe, uint64_t n){
uint64_t ef_cost = compact_elias_fano::bitsize(params, universe, n);
uint64_t rb_cost = compact_ranked_bitvector::bitsize(params, universe, n);
uint64_t aos_cost = all_ones_sequence::bitsize(params, universe, n);
std::vector<std::pair<index_type, uint64_t>> type_cost = {
{elias_fano, ef_cost},
{ranked_bitvector, rb_cost},
{all_ones, aos_cost}
};
language: cpp
sudo: required
dist: trusty
matrix:
include:
- os: linux
addons:
apt:
sources:
WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,
check /proc/sys/kernel/kptr_restrict.
Samples in kernel functions may not be resolved if a suitable vmlinux
file is not found in the buildid cache or in the vmlinux path.
Samples in kernel modules won't be resolved at all.
If some relocation was applied (e.g. kexec) symbols may be misresolved
even with a suitable vmlinux or kallsyms file.
@amallia
amallia / search.cpp
Last active December 19, 2017 22:23
// search.cpp
// g++ -march=native -std=c++14 search.cpp -o search
#include <random>
#include <iostream>
#include <cstdlib>
#include <smmintrin.h>
#include <vector>
#include <algorithm>
#include <chrono>
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"
@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>