Skip to content

Instantly share code, notes, and snippets.

join <( tr A-Z a-z < $1 | tr -s '[:space:][:punct:]' '\n' | sort | uniq -c | awk '{print $2, $1}' ) <( tr A-Z a-z < $2 | tr -s '[:space:][:punct:]' '\n' | sort | uniq -c | awk '{print $2, $1}' ) | awk -v n=${3:-1} '{if ($2 >= n && $3 >= n) print $1}'
#!/usr/bin/env python2
from pysmt.shortcuts import Solver
from six.moves import cStringIO
from pysmt.smtlib.parser import SmtLibParser
from pysmt.smtlib.script import evaluate_command
from IPython import embed
import sys
import time
#!/bin/bash
#if [[ $# != 2 ]]
if [[ $# != 1 ]]
then
echo "Usage: $0 [directory]"
#echo "Usage: $0 [directory] [solver]"
exit 0
fi
myFst :: (a, b) -> a
myFst x = fst x
myOdd :: Int -> Bool
myOdd x = odd x
-- (a) Ord is a typeclass. It means that the type supports the functions of the Ord typeclass (e.g. compare, <, > etc.).
-- The type of qs mean that "a" belongs to typeclass "Ord". The function qs take a list of type "a" and return a list of type "a"
-- (b) The type of ++ is (++) :: [a] -> [a] -> [a]. It concatenates 2 lists.
-- (c) ys are the elements that are less or equal than x(the pivot of quicksort). zs are the elements that are greater than x.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
set nocompatible " be iMproved, required
set encoding=utf-8
set fileencodings=utf8,big5,gbk,latin1
filetype off " required
let g:ycm_key_list_select_completion = ['<TAB>']
inoremap <Down> <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
inoremap <Esc>[B <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
inoremap <Esc>OB <C-R>=pumvisible() ? "\<lt>C-y>\<lt>Down>" : "\<lt>Down>"<CR>
let g:ycm_key_list_select_previous_completion = ['<S-Tab>']
# Mouse mode
set-option -g mouse on
# Shift + arrow to switch pane
#bind-key C-h select-pane -L
#bind-key C-l select-pane -R
#bind-key C-k select-pane -U
#bind-key C-j select-pane -D
# Use Ctrl-arrow keys without prefix key to switch panes