Skip to content

Languages

C++

STL implementations

  • libstdc++ GNU's C++ STL implementation.

  • libc++ Clang's C++ STL implementation.

  • hackingcpp Articles, Cheat Sheets and tutorials for modern C++ and standard library features.

  • cppreference Reference for entire C++ std library

  • C++ Core Guidelines C++ core guidelines maintained by Bjarne Stroustrup and Herb Sutter.

  • cppexamples Examples of various c++ idioms, patterns, and STL functionality.

Books

I've read a ton of books on C++, these are the books which I find to be both excellent and (more or less) up to date with modern C++.

  • The C++ Programming Language A very thorough guide/reference of modern C++, which covers most of the language. I really like this book!

  • C++ Templates - The Complete Guide Solid reference for template metaprogramming. The next step after this book is usually to look at STL implementations.

  • C++ Concurrency in Action Great book covering C++ standard library concurrency and parallel computing. If you're interested in OpenMP, MPI or other resources on parallel or distributed programming I suggest you look at my recommended resources on my computing page

Object Size and sizeof

The size of a an object of type T can be found by using the operator sizeof(T). It's a constant expression which resturns the number of bytes of T as asize_t. A byte is at least 8 bits, but may be larger (architecture-dependent) and the number of bits per byte is stored in the macro CHAR_BIT defined in the <climits> header.

Compiler is responsible of

Object Alignment, alignof and alignas

template<typaname T>
void print_class() {
    std::cout << "The size of class: " << typeid(T).name() << "is: " << sizeof(T) << " bytes\n"
}

Checking if a pointer points to memory inside a region

Comparing pointer's can be tricky. There is good blog post which show the intriciacies of pointer comparisons and memory regions by Raymon Chen: * How to check if a pointer is in a range of memory

In C++ there i s a nice solution to the problem, using function objects from the <functional> header. The std::less and std::greater function objects are guaranteed produce a strict total order for pointer types T* even if the < operator does not (see e.g. std::less cppreference and the pages for the other functional comparison operators).

Python

Numpy

From Python to Numpy

Matplotlib

Matplotlib tutorial on style sheets and rcParams

Tmux

The Tmux Cheat Sheet webpage: tmuxcheatsheet.com

Creating a new sesstion:

tmux new -s [session_name]

Attaching to a session:

tmux a -t [session_name]

Killing a session:

tmux kill-session -t [session_name]

LaTeX

A webpage I recently found which I wish I'd seen when I was new to TeX LaTeX USI

MkDocs and web

Material for MkDocs theme website

For full documentation visit mkdocs.org.

Project layout

mkdocs.yml    # The configuration file.
docs/
    index.md  # The documentation homepage.
    ...       # Other markdown pages, images and other files.