Skip to content

Instantly share code, notes, and snippets.

View jlblancoc's full-sized avatar

Jose Luis Blanco-Claraco jlblancoc

View GitHub Profile
@jlblancoc
jlblancoc / check_K.m
Created June 7, 2018 10:36
Ayuda a depuración de cálculo matricial de estructuras en C++
% Comprobación en MATLAB de que una matriz 'K.txt' es correcta:
% Dentro de MATLAB, irse al directorio donde esté el fichero K.txt:
K=load('K.txt');
% "K" debe ser simétrica, por lo que K menos su transpuesta debe ser todo ceros.
errores = K - K';
% Inspeccionar la matriz "errores" en el visor de variables, y en caso de haber
% elementos distintos de cero (ignorad los errores numéricos, valores muy pequeños)
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active April 29, 2024 23:21
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@jlblancoc
jlblancoc / gist:44be9d4d466f0a973b1f3808a8e56782
Last active February 16, 2023 15:45
GCC sanitizer with CMake

For memory leaks

Build in CMake with these params:

CMAKE_CXX_FLAGS:STRING= -fsanitize=address  -fsanitize=leak -g
CMAKE_C_FLAGS:STRING=-fsanitize=address  -fsanitize=leak -g
CMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak
CMAKE_MODULE_LINKER_FLAGS:STRING=-fsanitize=address  -fsanitize=leak

Which can be done with:

@jlblancoc
jlblancoc / delete_build_temps.bat
Created November 28, 2013 21:54
Batch (.BAT) script (Windows) to delete all temporary files after compiling a project with Microsoft Visual Studio (Visual C++) or GCC. It finds and removes (recursively in the given directory trees), all files that match any of: *.obj, *.o, *.pch, *.pdb, *.ilk, *.idb, *.gch
REM =======================================================================
REM Batch (.BAT) script (Windows) to delete all temporary files after
REM compiling a project with Microsoft Visual Studio (Visual C++) or GCC.
REM
REM Warning: It also deletes the debug databases, needed to "step into"
REM from a debugger. These files may be really *large*, but if you think
REM you will need them, remove the file for "*.pdb" below.
REM
REM Usage:
REM - Open a terminal (Windows-key + R , type "cmd", press ENTER)