Skip to content

Instantly share code, notes, and snippets.

View mloskot's full-sized avatar
🏠
Working from home

Mateusz Łoskot mloskot

🏠
Working from home
View GitHub Profile
@mloskot
mloskot / lectures_watching_tracklog.md
Last active November 3, 2020 09:17
Watched Lectures Log (programming, mathematics, algorithms, databases, etc.)
@mloskot
mloskot / boost-geometry-index-statistics.hpp
Last active September 26, 2019 13:42
Custom statistics collector for Rtree in boost::geometry::index, not yet in Boost trunk, so copy to: {BOOSTDIR}/boost/geometry/index/detail/rtree/visitors/statistics.hppUPDATE: Added to Boost trunk: https://svn.boost.org/trac/boost/changeset/84649
// Boost.Geometry Index
//
// R-tree visitor collecting basic statistics
//
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2013 Mateusz Loskot, London, UK.
//
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@mloskot
mloskot / soci-pre-3.2.2-github-changelog.md
Last active December 17, 2015 22:19
pre-SOCI 3.2.2 release changelog

List of candidate commits to include in SOCI 3.2.2:

  • List of issues assigned to milestone 3.2.2
  • List of commits already in develop branch is below:
$ git log master...develop  --pretty=format:"1. [%h](http://github.com/soci/soci/commit/%H) - %s"
  1. 4f37c3f - Fix typo
@mloskot
mloskot / vim-shortcuts.md
Last active December 16, 2015 15:28
List of useful Vim shortcuts
@mloskot
mloskot / msvc_fileno_std_streams_test.c
Last active December 16, 2015 10:29
Different fileno() return value reported for standard streams in non-console Windows application (i.e. MFC GUI application)
BOOL MyOnInitDialog()
{
int fdi, fdo, fde;
fdi = fileno(stdin);
fdo = fileno(stdout);
fde = fileno(stderr);
#if _MSC_VER < 1700
assert(fdi == -2);
assert(fdo == -2);
assert(fde == -2);
  • view - Restore previous list of ORACLE_OCI_NAMES
  • view - Add ORACLE_HOME to ORACLE_LIB_DIR
  • view - Remove linking against Oracle OCIEI lib.
  • view - Add PPC64 to tested platforms.
  • view - Test functions with ':=' and causes a crash case
  • view - Fixes a crash and allows creating complex function
  • view - Use standard "||" instead of "or" keyword in Firebird backend code.
  • view - Fix
@mloskot
mloskot / vector_resize_benchmark.cpp
Last active December 14, 2015 22:48
Is your std::vector<byte>::resize implementation optimal?
// Is your C++11 std::vector<byte>::resize implementation optimal?
//
// Visual C++ 11:
// reserve() -> fill_n -> detail: _Fill_n -> memset:
//
// inline unsigned char *_Fill_n(unsigned char *_Dest, size_t _Count, unsigned char _Val)
// { // copy unsigned char _Val _Count times through [_Dest, ...)
// _CSTD memset(_Dest, _Val, _Count);
// return (_Dest + _Count);
// }
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io_new/bmp_all.hpp>
using namespace std;
using namespace boost;
using namespace gil;
int main()
{
typedef rgb8_image_t image_t;
@mloskot
mloskot / cheat-tmux.markdown
Created December 14, 2012 13:11
tmux key bindings cheat shee

$ cheat tmux

Managing tmux sessions

$ tmux      # start tmux server
$ tmux at   # attach running sessions to a terminal
$ tmux ls # list running tmux sessions