Skip to content

Instantly share code, notes, and snippets.

@osolmaz
osolmaz / lastDays.sh
Created November 24, 2015 21:47 — forked from juanpabloaj/lastDays.sh
git: latest changes grouped by day
#!/bin/bash
a=""
b=""
for i in $(seq 0 10)
do
b=$(git diff --shortstat "@{ $i day ago }")
if [[ "$b" != "$a" ]]; then
echo $(date --date="$i days ago" +%F) $b
fi
a=$b
\ProvidesClass{mydiss}[2013/08/21 v1.4 mydiss class (Michael Ummels)]
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
% Options
\newif\if@iso
\@isofalse
\newif\if@crop
\@cropfalse
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def is_dir(dirname):
"""Checks if a path is an actual directory"""
if not os.path.isdir(dirname):
msg = "{0} is not a directory".format(dirname)
raise argparse.ArgumentTypeError(msg)
void blendWithMask(cv::Mat &base, cv::Mat &src, cv::Mat &mask, cv::Mat &out){
char ch = base.channels();
double alpha = 0;
for( int y = 0; y < base.rows; y++ ){
uchar* pBS = base.ptr<uchar>(y);
uchar* pSR = src.ptr<uchar>(y);
uchar* pMK = mask.ptr<uchar>(y);
uchar* pOU = out.ptr<uchar>(y);
for( int x = 0; x < base.cols*ch; x++ ){
int ix = x / ch;