This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pushd () { | |
command pushd "$@" > /dev/null | |
} | |
popd () { | |
command popd "$@" > /dev/null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> //std::min, std::max | |
#include <cctype> //tolower | |
#include <array> //std::array | |
//Computes levenshtein-distance between two strings recursivly using dynamic programming | |
template<size_t MAX_STR_LEN> | |
constexpr static size_t levenshtein(const char* a, const char* b, const size_t len_a, const size_t len_b, std::array<std::array<size_t, MAX_STR_LEN>, MAX_STR_LEN>&& memo = {{0}}) { | |
return memo[len_a][len_b] != 0 ? memo[len_a][len_b] : | |
len_a == 0 ? memo[len_a][len_b] = len_b : | |
len_b == 0 ? memo[len_a][len_b] = len_a : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef NODE_HPP | |
#include <vector> | |
#include <stack> | |
#include <functional> | |
#include <list> | |
#include <iterator> | |
#include <type_traits> | |
/** A class representing an arbitrary tree **/ | |
template<typename T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef QUEUE_HPP | |
#define QUEUE_HPP | |
#include <cstdio> | |
#include "semaphore.hpp" | |
/** A thread-safe queue which supports one read-thread and one write-thread | |
manipulating the queue concurrently. In other words, the thread-safe queue can | |
be used in the consumer-producer problem with one consumer and one producer. **/ | |
template<typename T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clc; | |
clear; | |
% CONSTANTS | |
N_ITERS = 1000000; | |
IM_DIM = 1024; | |
N_VERTICES = [3, 4, 5, 7, 20, 50]; | |
TOT_VERTS = length(N_VERTICES); | |
N_FRAMES_PER_FRACTAL = 30*3; | |
TOT_FRAMES = N_FRAMES_PER_FRACTAL * TOT_VERTS; |