Skip to content

Instantly share code, notes, and snippets.

View valerioformato's full-sized avatar

Valerio Formato valerioformato

  • INFN
  • Rome, Italy
View GitHub Profile
ACLOCAL_PATH=/home/vformato/Workdir/test/test_spack/spack/var/spack/environments/herd/.spack-env/view/share/aclocal:/usr/share/aclocal:/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/util-macros-1.19.1-bf7hlb3uqlxzaukmvpbviayruilvog4s/share/aclocal:/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/libtool-2.4.6-igdamfiocvudb2kvhi34isuvfv43loc2/share/aclocal; export ACLOCAL_PATH
function BASH_FUNC__spack_shell_wrapper%%() { for var in LD_LIBRARY_PATH DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH;
do
eval "if [ -n \"\${${var}-}\" ]; then export SPACK_$var=\${${var}}; fi";
done;
if [ -n "${ZSH_VERSION:-}" ]; then
emulate -L sh;
fi;
_sp_flags="";
while [ ! -z ${1+x} ] && [ "${1#-}" != "${1}" ]; do
==> root: Executing phase: 'cmake'
==> [2021-06-03-08:55:32.505477] 'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/root-6.22.08-ucrevtmllcepvsdyv45fwjhedduxoelb' '-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF' '-DCMAKE_INSTALL_RPATH:STRING=/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/root-6.22.08-ucrevtmllcepvsdyv45fwjhedduxoelb/lib;/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/root-6.22.08-ucrevtmllcepvsdyv45fwjhedduxoelb/lib64;/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/libxml2-2.9.10-a7ae2vdppl3w36sze5fg2oqmnxhiiuhm/lib;/home/vformato/Workdir/test/test_spack/spack/opt/spack/linux-centos8-x86_64/gcc-8.5.0/libiconv-1.16-l3seo4mdwaykflfbbateoxfbco2omxff/lib;/home/vfor
-------- Diagnostics - 3/25/2021, 10:19:30 AM
Version: 1.2.2
Current Configuration:
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
$/setTraceNotification
cpptools/didChangeCppProperties
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/gcc'
Compiler query command line: "/usr/bin/gcc" -std=c11 -Wp,-v -E -dD -x c -m64 /dev/null
terminating child process: 338
Code browsing service initialized
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/gcc'
Compiler query command line: "/usr/bin/gcc" -std=c++17 -Wp,-v -E -dD -x c++ -m64 /dev/null
terminating child process: 348
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/gcc'
[2021-03-25 09:39:29.118] [exthost] [info] extension host started
[2021-03-25 09:39:29.414] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.cpptools {"startup":false,"extensionId":{"value":"ms-vscode.cpptools","_lower":"ms-vscode.cpptools"},"activationEvent":"onLanguage:cpp"}
[2021-03-25 09:39:29.414] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/vformato/.vscode-server/extensions/ms-vscode.cpptools-1.2.2/dist/main
[2021-03-25 09:39:29.493] [exthost] [info] ExtensionService#_doActivateExtension xaver.clang-format {"startup":false,"extensionId":{"value":"xaver.clang-format","_lower":"xaver.clang-format"},"activationEvent":"onLanguage:cpp"}
[2021-03-25 09:39:29.493] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/vformato/.vscode-server/extensions/xaver.clang-format-1.9.0/out/src/extension
[2021-03-25 09:39:29.501] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing {"startup":false,"extensionId":{"value":"vscode.configuratio
@valerioformato
valerioformato / blogpost0.md
Last active March 3, 2021 12:22
Blog post #0 #blog

Create an enum class-based array

We all agree that arrays are a simple and powerful way to encapsulate data, especially if you care about accessing a single element and be able to traverse the array via loops.

And this kind of data structure makes a lot of sense when the actual position of an element in the array carries no particular meaning, but this is often not the case.

Imagine you are writing code that deals with points in a 3D space, it could be a game engine, protein folding, a particle simulation, whatever. How would you go and define your point?
Well... you have basically two options, right? You could either use a struct/class

struct point{