Applications of the joint spectral radius to some problems of functional analysis, probability and combinatorics