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 | |
if [ ! -r "/usr/local/git" ]; then | |
echo "Git doesn't appear to be installed via this installer. Aborting" | |
exit 1 | |
fi | |
echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git" | |
printf "Type 'yes' if you sure you wish to continue: " | |
read response | |
if [ "$response" == "yes" ]; then | |
sudo rm -rf /usr/local/git/ |
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
%option 8bit noyywrap yylineno stack | |
%{ | |
#include <algorithm> | |
#include <iostream> | |
#include <cctype> | |
bool all_caps(const std::string &s) { | |
return std::none_of(s.begin(), s.end(), ::islower); | |
} |
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 <boost/graph/adjacency_list.hpp> | |
#include <boost/graph/iteration_macros.hpp> | |
#include <boost/range/irange.hpp> | |
#include <minisat/core/Dimacs.h> | |
#include <minisat/core/Solver.h> | |
#include <zlib.h> |
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
moneys = [50, 20, 10, 5, 2, 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01] | |
def ex5(quantity): | |
quantities = {m: 0 for m in moneys} | |
for m in moneys: | |
while quantity >= m: | |
quantity -= m | |
quantities[m] += 1 | |
return quantities |