I have just taken great interest in the Ottoman Empire, nothing new I've been interested in them for almost 2 years now. The thing that fascinates me with them is their ability to stay up to speed with the Western Imperialist powers. Although their power slowly declined through the course of their history, it never fell behind the west. Despite invasion attempts by Russia and Austria it seems that they were able to soundly defeat them in many battles. In World War I they allied with the Central Powers. In the Battle of Gallipoli, my great grandfather actually fought for the Ottomans in that battle but my parents don't tell me anything, they were able to defeat the British, French, and ANZAC forces.
My question is that how did the Ottomans keep up with the rest of Europe? Did they modernize their technology and military themselves or did they take a similar approach to Japan by adopting Western ways?