Minimal resolutions and the homology of matching and chessboard complexes Counting the dimension of splines of mixed smoothness. A general recipe, and its application to planar meshes of arbitrary topologies 