Skip to content

Instantly share code, notes, and snippets.

@tadeu
tadeu / get_total_heap_bytes.cpp
Created July 13, 2020 20:40
Getting number of bytes allocated in heap in Linux
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <malloc.h>
size_t get_attribute_value(const char *str, const char *substr)
{
const char *pos = strstr(str, substr);
@tadeu
tadeu / eigen_maze.hpp
Last active January 31, 2020 21:13
Eigen Maze
#include <tuple>
namespace Eigen {
template<typename _Scalar>
class Array;
template<typename _Scalar>
class Matrix;
@-moz-document regexp("https?:\\/\\/bitbucket(?!\\.org).*?")
{
:root
{
--text-1: #ddd;
--text-2: #bbb;
--text-3: #555;
--text-blue: #59d;
--text-orange: #b50;
--bg-body: #222;
@tadeu
tadeu / keybase.md
Created August 6, 2019 21:38
keybase.md

Keybase proof

I hereby claim:

  • I am tadeu on github.
  • I am etadeu (https://keybase.io/etadeu) on keybase.
  • I have a public key ASBFD_Qcd57fVvDaLgUs0mnz5t90YlOlURAfcDEw6d46cQo

To claim this, I am signing this object:

active environment : None
user config file : C:\Users\tadeu\.condarc
populated config files : W:\Miniconda3\.condarc
conda version : 4.7.2
conda-build version : 3.18.2
python version : 3.7.3.final.0
virtual packages : __cuda=9.2
base environment : W:\Miniconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/win-64
@tadeu
tadeu / conda_debug_1.70.txt
Last active June 11, 2019 21:23
Conda slowdown due to boost package
# Command:
# conda env update --debug --file environment-boost-1.70.yml --prune >conda_debug_1.70.txt 2>&1
DEBUG conda.gateways.logging:set_verbosity(231): verbosity set to 2
DEBUG conda.core.solve:solve_final_state(212): solving prefix W:\Miniconda3\envs\test_boost_170
specs_to_remove: frozenset()
specs_to_add: frozenset({MatchSpec("sqlalchemy-utils==0.33.6"), MatchSpec("flask-allows==0.4"), MatchSpec("conda-wrappers"), MatchSpec("freetype=2.9.1"), MatchSpec("setuptools==40.5.0"), MatchSpec("sqlalchemy-utc==0.10.0"), MatchSpec("pytest-timeout==1.3.3"), MatchSpec("seaborn==0.9.0"), MatchSpec("hypothesis==3.57.0"), MatchSpec("ipykernel==4.8.2"), MatchSpec("pyqt==5.6.0"), MatchSpec("mkl==2019.3"), MatchSpec("exec-wrappers==1.0.3"), MatchSpec("sphinx==1.7.4"), MatchSpec("itsdangerous==0.24"), MatchSpec("ninja=1.9.0"), MatchSpec("mkl-devel==2019.3"), MatchSpec("execnet==1.5.0"), MatchSpec("pytest-mock==1.10.0"), MatchSpec("icc_rt==2019.0.0"), MatchSpec("six==1.11.0"), MatchSpec("py==1.7.0"), MatchSpec("noteb
@tadeu
tadeu / effective_modern_cmake.md
Created June 29, 2018 20:00 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@tadeu
tadeu / download-python-sources.bat
Last active February 22, 2018 07:34
download-python-sources.bat
@echo off
mkdir D:\Workspaces
subst W: D:\Workspaces
cdd W:\
mkdir dist__12.0-win32-builddist
cdd W:\dist__12.0-win32-builddist
:: aa dist.build python --no-build --no-package
solve for (C_co2_o, C_h2s_o, C_h, C_hco3, C_co3, C_h2s_w), m_co2 = V_g * P_co2 + V_o * C_co2_o + V_w * (C_co2_w + C_hco3 + C_co3), m_h2s = V_g * P_h2s + V_o * C_h2s_o + V_w * (C_h2s_w + C_hs), alk_tot = C_hco3 + 2 * C_co3 + C_hs + C_oh - C_h, K1 = C_h * C_hco3 / C_co2_w, K2 = C_h * C_co3 / C_hco3, K_h2s = C_hs * C_h / C_h2s_w