In situ formation of hydrides and carbides in palladium catalyst: When XANES is better than EXAFS and XRD