There was actually a time when you had Niccolo Machiavelli, Leonardo da Vinci, and Caesar Borgia all in the same place at the same time, literally in the same court. That bit of historical awesomeness is a really cool story, and would make for heck of a good movie.
You have Niccolo Machiavelli who was an emissary sent by the Florentine's to see what the heck Caesar Borgia was up to, you have Caesar Borgia himself who was just as ruthless as Machiavelli (but actually more so), and Leonardo, who had been hired by Borgia to improve defensive positions in Romagna and was virtually given carte blanche to do what he pleased in manners of innovation in war machinery and what not.
Apparently, Machiavelli and Borgia got along rather well, but each knew about the others malign intentions. Leonardo himself was more aloof to the whole situation in general, which is interesting because that it gives us a very in depth look at Leonardo himself. The current understanding of the man Leonardo was that he would on many occasions grow bored with one subject and move on to another, which explains many things. It explains why his notes are so varied and sporadic. It also explains why he came to be in the service of Borgia due to the fact that Leonardo had simply grown tired of art and wanted to pursue scientific innovation. Some scholars believe he may have suffered from ADHD or moderate depression, which honestly does explain a lot, such as the secretive nature of his notes and his removed demeanor, and his erratic sleeping pattern (he slept an hour for every three hours he was awake, thereby adding more hours to his day).
And in an interesting addition to the OP, the resume that is posted to the Duke of Milan (which Leonardo did get the job, so nobody worry about that) came before Leonardo's work for the king of France, and then to the employ of Caesar Borgia. And during these later years, the work in his notebooks correspond to his disinterest with art in particular. Indeed, the resume mentions multiple accounts of engineering and military technology and only a passing mention of art.
It's amazing because on a superficial level, we tend to look at the man Leonardo da Vinci as a dyed in the wool faultless genius, a larger than life person. But in reality, I would think he would have been evaluated with psychosis by today's standards.