Ad hoc is a Latin phrase meaning literally "for this". In English, it generally signifies a solution designed for a specific problem or task, non-generalizable, and not intended to be able to be adapted to other purposes (compare with a priori).
Common examples are ad hoc committees, and commissions created at the national or international level for a specific task. In other fields, the term could refer, for example, to a military unit created under special circumstances, a tailor-made suit, a handcrafted network protocol (e.g. ad hoc network), a temporary banding together of geographically-linked franchise locations (of a given national brand) to issue advertising coupons, or a purpose-specific equation.
Ad hoc can also be an adjective describing the temporary, provisional, or improvised methods to deal with a particular problem, the tendency of which has given rise to the noun Adhocism. It also could mean shifting contexts to create new meanings or inadequate planning. 
Style guides disagree on whether Latin phrases like ad hoc should be italicized. The trend is to not use italics. For example, The Chicago Manual of Style recommends that familiar Latin phrases that are listed in the Merriam-Webster dictionary, including "ad hoc", not be italicized.
In science and philosophy, ad hoc means the addition of extraneous hypotheses to a theory to save it from being falsified. Ad hoc hypotheses compensate for anomalies not anticipated by the theory in its unmodified form.
In the military
In the military, ad hoc units are created during unpredictable situations, when the cooperation between different units is suddenly needed for fast action, or from remnants of previous units which have been overrun or otherwise decimated.
The term “ad hoc networking” typically refers to a system of network elements that combine to form a network requiring little or no planning.
- Ad hoc testing
- Ad infinitum
- Ad libitum
- House rule
- Russell's teapot
- Inductive reasoning
- Confirmation bias
- Cherry picking
- American Heritage Dictionary of Idioms, 2nd Edition
- Yateendra Joshi, "Latin phrases in scientific writing: italics or not", editage Insights, January 14, 2014 full text
- "When to italicize foreign words and phrases". Grammarpartyblog.com. 2012-02-23. Retrieved 2016-01-06.
- "Italics". The Economist. Retrieved 2016-01-06.
- Howard, R. (2002), Smart Mobs: the Next Social Revolution, Perseus
- The dictionary definition of ad hoc at Wiktionary