(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// clang::VarDecl * varDecl; | |
// clang::ASTContext & ctx; | |
const clang::Expr * initializerExpr = varDecl->getInit(); | |
llvm::APSInt result; | |
if (initializerExpr->EvaluateAsInt(result, ctx)) { | |
std::cout << "Value as string: " << result.toString(10) << std::endl; | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
/* all this verbosity is required for this to work reliably and predictably | |
* on both GCC and MSVC | |
*/ | |
/* because gcc cpp doesn't recursively expand macros, so a single CALLIT | |
* macro can't be used in all the FE_n macros below | |
*/ | |
#define FE_CALLITn01(a,b) a b | |
#define FE_CALLITn02(a,b) a b |
// Sean Parent. Inheritance Is The Base Class of Evil. Going Native 2013 | |
// Video: https://www.youtube.com/watch?v=bIhUE5uUFOA | |
// Code : https://github.com/sean-parent/sean-parent.github.io/wiki/Papers-and-Presentations | |
/* | |
Copyright 2013 Adobe Systems Incorporated | |
Distributed under the MIT License (see license at | |
http://stlab.adobe.com/licenses.html) | |
This file is intended as example code and is not production quality. |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders | |
# The produced PDF files are stored in the invocation folder | |
# | |
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf | |
# Thanks to MFT, takabanana, ComFreek | |
# | |
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system. | |
# You can allow them by calling PowerShell as an Administrator and typing | |
# ``` | |
# Set-ExecutionPolicy Unrestricted |
// Intel(R) Core(TM) i7-2600 CPU @ 3.40 GHz 3.40 GHz | |
// 16 GB RAM, Windows 7, 64 bit | |
// | |
// cl 19 | |
// /GS /GL /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /Zc:inline /fp:precise /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /WX- /Zc:forScope /Gd /Oi /MD /EHsc /nologo /Ot | |
// | |
// 1000 random vectors with 1 000 000 elements each. | |
// 11 tests: with 0%, 10%, 20%, ..., 90%, 100% duplicates in vectors. | |
// Ratio: 0 |