git clone <repo>
dh_make -p <pkgName>_<version> -c gpl3 -s --createorig
<put gbp.conf to debian/gbp.conf>
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
// infix_iterator.h | |
// | |
// Lifted from Jerry Coffin's 's prefix_ostream_iterator | |
#if !defined(INFIX_ITERATOR_H_) | |
#define INFIX_ITERATOR_H_ | |
#include <ostream> | |
#include <iterator> | |
template <class T, | |
class charT=char, | |
class traits=std::char_traits<charT> > |
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 <gtest/gtest.h> | |
#include <system_error> | |
#define ASSERT_SYSTEM_ERROR(statement, error_code) \ | |
ASSERT_THROW({\ | |
try { \ | |
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ | |
} \ | |
catch(const std::system_error &exception) {\ | |
ASSERT_EQ(error_code, exception.code());\ | |
throw;\ |
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 STRING_SPLIT_JOIN_HPP | |
#define STRING_SPLIT_JOIN_HPP | |
#include <vector> | |
#include <string> | |
/************************** | |
* split/wsplit/basic_split<T>: | |
* Splits input string (argument #1) by separator (argument #2) and returns vector of strings |
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
from datetime import timedelta | |
def ceil_dt(dt, res): | |
# how many secs have passed this day | |
nsecs = dt.hour*3600 + dt.minute*60 + dt.second + dt.microsecond*1e-6 | |
delta = res.seconds - nsecs % res.seconds | |
if delta == res.seconds: | |
delta = 0 | |
return dt + datetime.timedelta(seconds=delta) | |
def floor_dt(dt, res): |
Sven Axelsson 24 Nov 2001
How to create an output stream that writes to the debug terminal.
There are many different schools of how to debug a program (yeah, I know - write it correctly from the start), but whatever tools you prefer it is often very convenient just to use the printf
approach. Well, since you are a modern C++ kind of person, you don't really want printf
, you want to use an output stream, like cerr
.
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
import sqlalchemy as sa | |
from sqlalchemy.orm import declarative_base, relationship | |
Base = declarative_base() | |
class A(Base): | |
__tablename__ = 'A' | |
id = sa.Column(sa.Integer, primary_key=True) |