Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# To decode: | |
# qp -d string | |
# To encode: | |
# qp string | |
alias qpd='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::decode($_);'\''' | |
alias qpe='perl -MMIME::QuotedPrint -pe '\''$_=MIME::QuotedPrint::encode($_);'\''' | |
function qp { | |
if [[ "$1" = "-d" ]] | |
then |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#include <iostream> | |
#include <memory> | |
#include <vector> | |
#include <utility> | |
/* Same definition of Object, Book, and Door as before */ | |
class object_concept_t { | |
public: | |
virtual ~object_concept_t() = default; |
defaults write -app Skim SKAutoReloadFileUpdate -boolean true |
# List targets defined in this file | |
TARGETS_SELF := cmake | |
# Exclude targets defined in this file | |
TARGETS_OTHER := $(filter-out $(TARGETS_SELF), $(MAKECMDGOALS)) | |
# Call all targets using `Makefile` in build directory in one `make` command. It | |
# can depend on targets defined in this file, e.g., depending on a target to | |
# create the Makefile. | |
# | |
# If no targets are specified, use the dummy `all` target |
#include <iostream> | |
#include <utility> | |
#include <typeinfo> | |
#include <type_traits> | |
#include <string> | |
template <size_t arg1, size_t ... others> | |
struct static_max; | |
template <size_t arg> |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns on recent CPU
L2 cache reference ........................... 7 ns 14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory
This is a sequel to "Postfix: relay to authenticated SMTP".
I would like to send mail from two different Gmail accounts using Postfix. Here is the relevant section in the Postfix documentation: Configuring Sender-Dependent SASL authentication.
As a concrete example, here's how to set up two Gmail accounts (only relevant sections of the config files are listed below):
/etc/postfix/main.cf:
# sender-dependent sasl authentication
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
#!/usr/bin/python3 | |
# By Steve Hanov, 2011. Released to the public domain. | |
# Please see http://stevehanov.ca/blog/index.php?id=115 for the accompanying article. | |
# | |
# Based on Daciuk, Jan, et al. "Incremental construction of minimal acyclic finite-state automata." | |
# Computational linguistics 26.1 (2000): 3-16. | |
# | |
# Updated 2014 to use DAWG as a mapping; see | |
# Kowaltowski, T.; CL. Lucchesi (1993), "Applications of finite automata representing large vocabularies", | |
# Software-Practice and Experience 1993 |
swatch <- function(x) { | |
# x: a vector of colours (hex, numeric, or string) | |
par(mai=c(0.2, max(strwidth(x, "inch") + 0.4, na.rm = TRUE), 0.2, 0.4)) | |
barplot(rep(1, length(x)), col=rev(x), space = 0.1, axes=FALSE, | |
names.arg=rev(x), cex.names=0.8, horiz=T, las=1) | |
} | |
# Example: | |
# swatch(colours()[1:10]) | |
# swatch(iwanthue(5)) |