text:
Talk:Name server

Name service protocol
OK, so what's a name service protocol? Do we need a name service protocol article? --Syaifulnizam_Shamsudin

 * Possibly referring to a Naming and Directory Service? -- Ff1959 22:48, 19 January 2007 (UTC)

 * Every implementation of a name service has or follows a specific name service protocol. There is no "Name Service Protocol".  There are only protocols for name services.  Examples of name service protocols are DNS, WINS, NetBIOS.  Stephen Charles Thompson (talk) 18:43, 15 February 2012 (UTC)

IP address
Someone changed the IP address used in the first example to 208.280.152.2 which is not valid. Anyone know why? Anyone want to change it to something meaningful? BrianAshe (talk) 02:15, 17 January 2010 (UTC)
 * Fixed. I rewrote the lede, the explicit mentioning of an IP address, that is subject to change anyhow, is not needed. Kbrose (talk) 18:33, 17 January 2010 (UTC)

Not about DNS
information that is specific to DNS belongs in the article for DNS, Domain Name System]. I am moving most DNS specific information to the proper article for that topic, except where DNS is used as an example. Stephen Charles Thompson (talk) 18:39, 15 February 2012 (UTC)

 * I have to agree with this comment.  The article is a bit confused at the moment—on the one hand it tries to speak generically, and on the other, there's a lot of DNS-specific detail.   Which is it?   I just corrected some DNS-specific detail, but I think the argument that that detail ought not to be in the article is valid.   There also seems to be a lot of link farming in this article, and the See Also section is inordinately long.

 * Personally, I think an article about DNS servers would be useful, and I wonder if an article about Name Servers is useful, because different name services use very different technologies.  WINS, for example, is partly a broadcast protocol, but can operate with a server on managed networks.   But there ought to be some decision as to which thing this article is about, because right now I think a reader would come away with a rather confused idea of what a name server is.  Abhayakara (talk) 14:51, 10 July 2012 (UTC)

Recursive vs Iterative queries
Only recursive queries are mentioned, although there's not enough detail to distinguish between iterative vs recursive I guess. This section needs to be expanded. This provided a good explanation, I thought; https://technet.microsoft.com/en-us/library/cc961401.aspx — Preceding unsigned comment added by 2601:646:9300:52A0:65EE:E6C3:A49D:DB8A (talk) 17:49, 8 July 2017 (UTC)

 * I agree this should be overhauled. The section Name_server doesn't do a great job in explaining the differences between iterative and recursive queries. This is actually more relevant from a clients perspective. But this section mostly talks about servers. Also when a server is walking the DNS tree like, it generally *iteratively* queries other name servers, so this seems wrong: "it may recursively query name servers higher up in the hierarchy.". This may be helpful: https://tools.ietf.org/html/rfc8499#section-6 Mebuege (talk) 15:39, 26 August 2020 (UTC)

title: Talk:Name server


text:
History of the Bahamas

The earliest arrival of people in the islands now known as The Bahamas was in the first millennium AD. The first inhabitants of the islands were the Lucayans, an Arawakan language-speaking Taino people, who arrived between about 500 and 800 AD from other islands of the Caribbean.

Recorded history began on 12 October 1492, when Christopher Columbus landed on the island of Guanahani, which he renamed San Salvador Island, on his first voyage to the New World. The earliest permanent European settlement was in 1648 on Eleuthera. During the 18th century slave trade, many purchased African slaves were brought to the Bahamas to work unpaid. Their descendants now constitute 85% of the Bahamian population. The Bahamas gained independence from the United Kingdom on July 10, 1973.

Early history
Sometime between 500 and 800 AD, Taínos began crossing in dugout canoes from Hispaniola and/or Cuba to the Bahamas. Suggested routes for the earliest migrations have been from Hispaniola to the Caicos Islands, from Hispaniola or eastern Cuba to Great Inagua Island, and from central Cuba to Long Island (in the central Bahamas). William Keegan argues that the most likely route was from Hispaniola or Cuba to Great Inagua. Granberry and Vescelius argue for two migrations, from Hispaniola to the Turks and Caicos Islands, and from Cuba to Great Inagua.

From the initial colonisation(s), the Lucayan expanded throughout the Bahamas in some 800 years (c. 700 – c. 1500), growing to a population of about 40,000. Population density at the time of first European contact was highest in the south-central area of the Bahamas, declining towards the north, reflecting the migration pattern and progressively shorter time of occupation of the northern islands. Known Lucayan settlement sites are confined to the nineteen largest islands in the archipelago, or to smaller cays located less than one km. from those islands. Population density in the southernmost Bahamas remained lower, probably due to the drier climate there (less than 800 mm of rain a year on Great Inagua Island and the Turks and Caicos Islands and only slightly higher on Acklins and Crooked Islands and Mayaguana).

European exploration
In 1492, Christopher Columbus sailed from Spain on his first voyage with three ships, the Niña, the Pinta, and the flagship, Santa Maria, seeking a direct route to Asia. On 12 October, Columbus reached an island in the Bahamas and claimed it for Spain, an event long regarded by Europeans as the "discovery" of America. This island was called Guanahani by the Lucayan, and San Salvador by the Spanish. The identity of the first American landfall by Columbus remains controversial, but many authors accept Samuel E. Morison's identification of Columbus' San Salvador as what was later called Watling (or Watling's) Island. Its name has been officially changed to San Salvador. Columbus visited several other islands in the Bahamas before sailing to present-day Cuba and afterwards to Hispaniola.

The Bahamas held little interest to the Spanish except as a source of slave labor. Nearly the entire population of Lucayan (almost 40,000 people total) were transported to other islands as laborers over the next 30 years. When the Spanish decided to remove the remaining Lucayans to Hispaniola in 1520, they could find only eleven. The islands remained abandoned and depopulated for 130 years afterwards. With no gold to be found, and the population removed, the Spanish effectively abandoned the Bahamas. They retained titular claims to them until the Peace of Paris in 1783, when they ceded them to Britain in exchange for East Florida.

When Europeans first landed on the islands, they reported the Bahamas were lushly forested. Cleared to develop the land for sugarcane plantations, the forests have not regrown and have not been replanted.

For many years, historians believed that The Bahamas was not colonised until the 17th century. However, recent studies show that there may have been attempts of colonisation by groups from Spain, France, Britain, and the Netherlands. In 1565 a group of French Huguenots settled on Abaco and were never heard of again.

Early English settlement
In 1648, a group from Bermuda called "The Company of Adventurers for the Plantation of the Islands of Eleutheria", which was led by William Sayle, sailed to the Bahamas to found a colony. These early settlers were Puritans and republicans. Bermuda was becoming overcrowded, and the Bahamas offered both religious and political freedom and economic opportunity. The larger of the company's two ships, the William, wrecked on the reef at the north end of what is now called Eleuthera Island, with the loss of all provisions.

Despite the arrival of additional settlers, including Europeans, slaves and former African slaves from Bermuda and the receipt of relief supplies from Virginia and New England, the Eleuthera colony struggled for many years, hampered by poor soil, fighting between settlers, and conflict with the Spanish. In the mid-1650s, many of the settlers returned to Bermuda. The remaining settlers founded communities on Harbour Island and Saint George's Cay (Spanish Wells) at the north end of Eleuthera. In 1670 about 20 families lived in the Eleuthera communities. In 1666 other colonists from Bermuda settled on New Providence, which soon became the centre of population and commerce in the Bahamas, with almost 500 people living on the island by 1670. Unlike the Eleutherians, who were primarily farmers, the first settlers on New Providence made their living from the sea, salvaging (mainly Spanish) wrecks, making salt, and taking fish, turtles, conchs and ambergris. Farmers from Bermuda soon followed the seamen to New Providence, where they found good, plentiful land. Neither the Eleutherian colony nor the settlement on New Providence had any legal standing under English law. In 1670, the Proprietors of Carolina were issued a patent for the Bahamas, but the governors sent by the Proprietors had difficulty imposing their authority on the independent-minded residents of New Providence.

The early settlers continued to live much as they had in Bermuda, fishing, hunting turtles, whales, and seals, finding ambergris, making salt on the drier islands, cutting the abundant hardwoods of the islands for lumber, dyewood and medicinal bark; and wrecking, or salvaging wrecks. The Bahamas were close to the sailing routes between Europe and the Caribbean, so shipwrecks in the islands were common, and wrecking was the most lucrative occupation available to the Bahamians.

Republic of Pirates
The Bahamians soon came into conflict with the Spanish over the salvaging of wrecks. The Bahamian wreckers drove the Spanish away from their wrecked ships, and attacked Spanish salvagers, seizing goods the Spanish had already recovered from the wrecks. When the Spanish raided the Bahamas, the Bahamians in turn commissioned privateers against Spain, even though England and Spain were at peace. In 1684, the Spanish burned the settlements on New Providence and Eleuthera, after which they were largely abandoned. New Providence was settled a second time in 1686 by colonists from Jamaica. In the 1690s, English privateers (England was then at war with France) made a base in the Bahamas. In 1696 Henry Every (or Avery), using the assumed name Henry Bridgeman, brought his ship Fancy, loaded with pirates' loot, into Nassau harbor. Avery bribed the governor, Nicholas Trott (uncle of the Nicholas Trott who presided at the trial of Stede Bonnet), with gold and silver, and by leaving him the Fancy, still loaded with 50 tons of elephant tusks and 100 barrels of gunpowder. Following peace with France in 1697, many of the privateers became pirates. From this time the pirates increasingly made Nassau, the Bahamian capital founded in 1694, their base. The governors appointed by the Proprietors usually made a show of suppressing the pirates, but most were accused of dealing with them. By 1701 England was at war with France and Spain. In 1703, and again in 1706, combined French-Spanish fleets attacked and sacked Nassau, after which some settlers left, and the Proprietors gave up on trying to govern the islands.

With no functioning government in the Bahamas, English privateers operated from Nassau as their base, in what has been called a "privateers' republic", which lasted for eleven years. The raiders attacked French and Spanish ships, while French and Spanish forces burned Nassau several times. The War of the Spanish Succession ended in 1714, but some privateers were slow to get the news, or reluctant to accept it, and slipped into piracy. One estimate puts at least 1,000 pirates in the Bahamas in 1713, outnumbering the 200 families of more permanent settlers.

The "privateers' republic" in Nassau became a "pirates' republic". At least 20 pirate captains used Nassau or other places in the Bahamas as a home port during this period, including Henry Jennings, Edward Teach (Blackbeard), Benjamin Hornigold and Stede Bonnet. Many settler families moved from New Providence to Eleuthera or Abaco to escape harassment from the pirates. On the other hand, residents of Harbor Island were happy to serve as middlemen for the pirates, as merchants from New England and Virginia came there to exchange needed supplies for pirate plunder. Piracy provoked frequent and brutal but ineffective retaliatory attacks by the French and Spanish.

Reasserting British control
Starting in 1713, Woodes Rogers had conceived the idea of leading an expedition to Madagascar to suppress the pirates there and establish it as a British colony. Rogers' friends Richard Steele and Joseph Addison eventually convinced him to tackle the pirates' nest in the Bahamas, instead. Rogers and others formed a company to fund the venture. They persuaded the Proprietors of Carolina to surrender the government of the Bahamas to the king, while retaining title to the land. In 1717 King George appointed Rogers governor of the Bahamas and issued a proclamation granting a pardon to any pirate who surrendered to a British governor within one year. Word of the appointment of a new governor and of the offer of pardons reached Nassau ahead of Rogers and his forces. Some of the pirates were willing to accept a pardon and retire from piracy. Henry Jennings and Christopher Winter, sailed off to find British authorities to confirm their acceptance of the amnesty.

Others were not ready to give up. Many of those were Jacobites, supporters of the House of Stuart, who identified as enemies of the Hanoverian King George. Still others simply identified as rebels, or thought they were better off as pirates than trying to earn an honest living. When a Royal Navy ship brought official word to Nassau of the pardon offer, many pirates planned to accept. Soon, however, the recalcitrant parties gained the upper hand, eventually forcing the Navy ship to leave.

Blackbeard, Stede Bonnet, Nicholas Brown and Edmond Condent left the Bahamas for other territories. Charles Vane, with "Calico Jack" Rackham and Edward England in his crew, came to prominence at this time. Vane worked to organise resistance to the anticipated arrival of Royal authority, even appealing to James Francis Edward Stuart, the Stuart pretender, for aid in holding the Bahamas and capturing Bermuda for the Stuarts. As aid from the Stuarts failed to materialise and the date for Rogers' arrival approached, Vane and his crew prepared to leave Nassau.

Woodes Rogers arrived in Nassau in late July 1718, with his own 460-ton warship, three ships belonging to his company, and an escort of three ships of the Royal Navy. Vane's ship was trapped in Nassau harbor. His crew set that ship on fire, sending it towards Rogers' ships, and escaped in the ensuing confusion in a smaller ship they had seized from another pirate. The remaining population welcomed Rogers; they comprised about 200 settlers and 500 to 700 pirates who wanted to receive pardons, most prominently Benjamin Hornigold. After the pirates' surrender, the Proprietors leased their land in the Bahamas to Rogers' company for 21 years.

Rogers controlled Nassau, but Charles Vane was loose and threatening to drive the governor and his forces out. Learning that the King of Spain wanted to expel English from the islands, Rogers worked to improve the defenses of Nassau. He lost nearly 100 men of the new forces due to an unidentified disease, and the Navy ships left for other assignments. Rogers sent four of his ships to Havana to assure the Spanish governor that he was suppressing piracy and to trade for supplies. The crews of ex-pirates and men who had come with Rogers all turned to piracy. The ex-pirate Benjamin Hornigold later caught ten men at Green Turtle Cay as part of Rogers' suppression effort. Eight were found guilty and hanged in front of the fort.

Vane attacked several small settlements in the Bahamas but, after he refused to attack a stronger French frigate, he was deposed for cowardice and replaced as captain by "Calico Jack" Rackham. Vane never returned to the Bahamas; he was eventually caught, convicted and executed in Jamaica. After nearly being captured by Jamaican privateers, and hearing that the king had extended the deadline for pardons for piracy, Rackham and his crew returned to Nassau to surrender to Woodes Rogers. In August of 1720, Rackham stole the sloop William out of Nassau harbor. Alongside him was a small crew that included female pirates Anne Bonny and Mary Read. In October, Rackham, Bonny and Read were captured and taken to Jamaica. They were convicted of piracy, and Rackham was executed. Bonny and Read were sent to prison, after claiming to be pregnant and therefore excluded from execution. Read died in prison, while Bonny's fate is unknown.

When Britain and Spain went to war again in 1719, many of the ex-pirates were commissioned by the British government as privateers. A Spanish invasion fleet set out for the Bahamas, but was diverted to Pensacola, Florida when it was seized by the French. Rogers continued to improve the defenses of Nassau, spending his personal fortune and going heavily into debt to do so. In 1720, the Spaniards finally attacked Nassau. Rogers returned to Britain in 1722 to plead for repayment of the money he had borrowed to build up Nassau, only to find he had been replaced as governor. He was sent to debtors' prison, although his creditors later absolved his debts, gaining him release.

After the publication in 1724 of A General History of the Robberies and Murders of the Most Notorious Pirates, which praised Rogers' efforts to suppress piracy in the Bahamas, his fortunes began to improve. The king awarded him a pension, retroactive to 1721. In 1728 Rogers was appointed Governor of the Bahamas for a second term. He dissolved the colony's assembly when it would not approve taxes to repair Nassau's defenses. He died in Nassau in 1732.

Latter 18th century
In 1741, Governor John Tinker and Peter Henry Bruce constructed Fort Montague. Additionally, the Governor also reported a privateering boom in the Thirteen Colonies in North America. He also reported that over 2300 sumptuous houses were built. In 1768 Governor William Shirley filled in mosquito-breeding swamps and extended Nassau. During the American War of Independence the Bahamas was attacked by American and allied forces on several occasions. In 1776, American forces launched an amphibious assault against Nassau, resulting in its two-week occupation. In 1782, Spanish forces under General Galvez captured the Bahamas in 1782. A British-American Loyalist expedition led by Colonel Andrew Deveaux, recaptured the islands in 1783.

After the American Revolution, the British issued land grants to American Loyalists who had gone into exile from the newly established United  States. The sparse population of the Bahamas tripled within a few years. The Loyalists developed cotton as a commodity crop, but it dwindled from insect damage and soil exhaustion. In addition to slaves they brought with them, the planters' descendants imported more African slaves for labour.

Most of the current inhabitants in the islands are descended from the slaves brought to work on the Loyalist plantations. In addition, thousands of captive Africans, who were liberated from foreign slave ships by the British navy after the abolition of the British slave trade in 1807, were resettled as free persons in the Bahamas.

19th century
In the early 1820s, following the Adams–Onís Treaty ceding Florida from Spain to the United States, hundreds of African slaves and Black Seminoles escaped from Florida, most settling on Andros Island in the Bahamas. Three hundred escaped in a mass flight in 1823. While the flow was reduced by federal construction of a lighthouse at Cape Florida in 1825, slaves continued to find freedom in the Bahamas. In August 1834, the traditional plantation life ended with the British emancipation of slaves throughout most of its colonies. Freedmen chose to work on their own small plots of land when possible.

In the 1830s and 1840s, tensions rose between Britain and the United States after American merchant ships, part of the coastwise slave trade, put into Nassau or were wrecked on its reefs. These included the Hermosa (1840) and the Creole (1841), the latter brought in after a slave revolt on board. Britain had notified nations that slaves brought into Bahama and Bermuda waters would be forfeited and freed the slaves, refusing US efforts to recover them. In 1853 Britain and the US signed a claims treaty and submitted to arbitration for claims dating to 1814; they paid each other in 1855.

With emancipation, Caribbean societies inherited a rigid racial stratification that was reinforced by the unequal distribution of wealth and power. The three-tier race structure, of whites, mixed-race, and primarily blacks, who comprised the large majority, existed well into the 1940s and in some societies beyond. Like African Americans, many also have European and Native American ancestry. Caribbean societies continue to struggle with racial issues.

The Bahamas during the American Civil War prospered as a base for Confederate blockade-running, bringing in cotton to be shipped to the mills of England and running out arms and munitions. None of these provided any lasting prosperity to the islands, nor did attempts to grow different kinds of crops for export.

Colonial 20th century
In 1911, there was a short-lived movement to make the Bahamas part of Canada. Although the movement enjoyed the support of many in Nassau and from the head of Sun Life, a Canadian insurance company, the movement failed. The failure of the movement was, in part, due to the British government's opposition to uniting a predominantly black colony with a predominantly white country.

In World War I organisations such as the Imperial Order of the Daughters of Empire and the Bahamas Red Cross Guild began collecting money, food and clothing for soldiers and civilians in Europe. "The Gallant Thirty" Bahamians set out to join the British West Indies Regiment as early as 1915 and as many as 1,800 served in the armed forces of Canada, Britain and the United States.

World War II
Oakes Field, the Bahamas first airport, was opened in Nassau in January 1940. It was named after Harry Oakes, a millionaire who made a large contribution. Prior to that, aviation in the Bahamas was largely carried out by seaplanes.

The Duke of Windsor was installed as governor of the Bahamas, arriving at that post in August 1940 with his new Duchess. They were appalled at the condition of Government House, but they "tried to make the best of a bad situation." He did not enjoy the position, and referred to the islands as "a third-class British colony". He opened the small local parliament on October 29, 1940, and they visited the 'Out Islands' that November, which caused some controversy because of on whose yacht they were cruising. The British Foreign Office strenuously objected when the Duke and Duchess planned to tour aboard a yacht belonging to a Swedish magnate, Axel Wenner-Gren, whom American intelligence wrongly believed to be a close friend of Luftwaffe commander Hermann Göring. The Duke was praised, however, for his efforts to combat poverty on the islands, although he was as contemptuous of the Bahamians as he was of most non-white peoples of the Empire. He was also praised for his resolution of civil unrest over low wages in Nassau in June 1942, when there was a "full-scale riot," even though he blamed the trouble on "mischief makers – communists" and "men of Central European Jewish descent, who had secured jobs as a pretext for obtaining a deferment of draft". The Duke resigned the post on 16 March 1945.

Canadian garrison
In April 1942 the United Kingdom asked Canada to provide military support in Nassau, in part to provide protection services to H.R.H. the Duke of Windsor. The No. 33 company of the Veterans Guard of Canada was raised and arrived in June. No. 33 company were relieved in 1943 by a company of The Pictou Highlanders. The Canadian garrison left Nassau in 1946.

Post-World War II
The wartime airfield became Nassau's international airport in 1957 and helped spur the growth of mass tourism, which accelerated after Havana was closed to American tourists in 1961. Freeport, on the island of Grand Bahama, was established as a free trade zone in the 1950s. Bank secrecy combined with the lack of corporate and income taxes led to a rapid growth in the offshore financial sector during the postwar years.

Modern political development began after World War II. The first political parties were formed in the 1950s. The Progressive Liberal Party was formed in 1953, and the United Bahamian Party was formed in 1956.

Bahamians achieved self-government in 1964, with Sir Roland Symonette, of the United Bahamian Party, as the first Premier. Sir Lynden O. Pindling, leader of the Progressive Liberal Party, became the first black Premier of the colony in 1967, and in 1968 the title was changed to Prime Minister.

Independent Bahamas
The Bahamas achieved full independence as a Commonwealth realm within the Commonwealth of Nations on 10 July 1973. Sir Milo Butler was appointed the first Governor-General of the Bahamas (the official representative of Queen Elizabeth II) shortly after independence. Pindling was prime minister until 1992. He was succeeded by Hubert Ingraham, leader of the Free National Movement, who was prime minister until 2002.

The College of the Bahamas was founded in 1974 and provided the nation's higher or tertiary education. The college was chartered in 2016 as the University of the Bahamas, offering baccalaureate, masters and associate degrees, on three campuses and teaching and research centres throughout the Bahamas.

Based on the twin pillars of tourism and offshore finance, the Bahamian economy has prospered since the 1950s. However, there remain significant challenges in areas such as education, health care, housing, international narcotics trafficking and illegal immigration from Haiti.

In the 2002 Bahamian general election, the PLP returned to power under Perry Christie. Ingraham returned to power from 2007 to 2012, followed by Christie again from 2012 to 2017. With economic growth faltering, Bahamians re-elected the FNM in 2017, with Hubert Minnis becoming the fourth prime minister.

In September 2019, Hurricane Dorian struck the Abaco Islands and Grand Bahama at Category 5 intensity, devastating the northwestern Bahamas. The storm inflicted at least US$7 billion in damages and killed more than 50 people, with 1,300 people still missing.

In September 2021, Prime Minister Hubert Minnis lost in a snap election as the economy struggles to recover from its deepest crash since at least 1971. Progressive Liberal Party (PLP) won 32 of the 39 seats in the House of Assembly. Free National Movement (FNM), led by Minnis, took the remaining seats. On 17 September 2021, the leader of the Progressive Liberal Party (PLP) Phillip “Brave” Davis was sworn in as the new Prime Minister of the Bahamas.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: History of the Bahamas


text:
Sanity check

A sanity check or sanity test is a basic test to quickly evaluate whether a claim or the result of a calculation can possibly be true. It is a simple check to see if the produced material is rational (that the material's creator was thinking rationally, applying sanity). The point of a sanity test is to rule out certain classes of obviously false results, not to catch every possible error. A rule-of-thumb or back-of-the-envelope calculation may be checked to perform the test. The advantage of performing an initial sanity test is that of speedily evaluating basic function.

In arithmetic, for example, when multiplying by 9, using the divisibility rule for 9 to verify that the sum of digits of the result is divisible by 9 is a sanity test—it will not catch every multiplication error, but is a quick and simple method to discover many possible errors.

In computer science, a sanity test is a very brief run-through of the functionality of a computer program, system, calculation, or other analysis, to assure that part of the system or methodology works roughly as expected. This is often prior to a more exhaustive round of testing.

Mathematical
A sanity test can refer to various orders of magnitude and other simple rule-of-thumb devices applied to cross-check mathematical calculations. For example:
 * If one were to attempt to square 738 and calculated 54,464, a quick sanity check could show that this result cannot be true. Consider that yet   Since squaring positive integers preserves their inequality, the result cannot be true, and so the calculated result is incorrect. The correct answer,  is more than 10 times higher than 54,464.
 * In multiplication, is not 142,135 since 918 is divisible by three but 142,135 is not (digits add up to 16, not a multiple of three). Also, the product must end in the same digit as the product of end-digits:  but 142,135 does not end in "0" like "40", while the correct answer does:  An even quicker check is that the product of even and odd numbers is even, whereas 142,135 is odd.

Physical

 * Dimensional analysis may be used as a sanity check of physical equations: the two sides of any equation must be commensurable or have the same dimensions. A person who has calculated the power output of a car to be 700 kJ may have omitted a factor, since the unit joules is a measure of energy, not power (energy per unit time).
 * When determining physical properties, comparing to known or similar substances will often yield insight on whether the result is reasonable. For instance, most metals sink in water, so the density of most metals should be greater than that of water (~$2$).
 * Fermi estimates will often provide insight on the order of magnitude of an expected value.

Software development
In software development, a sanity test (a form of software testing which offers "quick, broad, and shallow testing" ) evaluates the result of a subset of application functionality to determine whether it is possible and reasonable to proceed with further testing of the entire application. Sanity tests may sometimes be used interchangeably with smoke tests insofar as both terms denote tests which determine whether it is possible and reasonable to continue testing further. On the other hand, a distinction is sometimes made that a smoke test is a non-exhaustive test that ascertains whether the most crucial functions of a programme work before proceeding with further testing whereas a sanity test refers to whether specific functionality such as a particular bug fix works as expected without testing the wider functionality of the software. In other words, a sanity test determines whether the intended result of a code change works correctly while a smoke test ensures that nothing else important was broken in the process. Sanity testing and smoke testing avoid wasting time and effort by quickly determining whether an application is too flawed to merit more rigorous QA testing, but needs more developer debugging.

Groups of sanity tests are often bundled together for automated unit testing of functions, libraries, or applications prior to merging development code into a testing or trunk version control branch, for automated building, or for continuous integration and continuous deployment.

Another common usage of sanity test is to denote checks which are performed programme code, usually on arguments to functions or returns therefrom, to see if the answers can be assumed to be correct. The more complicated the routine, the more important that its response be checked. The trivial case is checking to see whether the return value of a function indicated success or failure, and to therefore cease further processing upon failure. This return value is actually often itself the result of a sanity check. For example, if the function attempted to open, write to, and close a file, a sanity check may be used to ensure that it did not fail on any of these actions—which is a sanity check often ignored by programmers.

These kinds of sanity checks may be used during development for debugging purposes and also to aid in troubleshooting software runtime errors. For example, in a bank account management application, a sanity check will fail if a withdrawal requests more money than the total account balance rather than allowing the account to go negative (which wouldn't be sane). Another sanity test might be that deposits or purchases correspond to patterns established by historical data—for example, large purchase transactions or ATM withdrawals in foreign locations never before visited by the cardholder may be flagged for confirmation.

Sanity checks are also performed upon installation of stable, production software code into a new computing environment to ensure that all dependencies are met, such as a compatible operating system and link libraries. When a computing environment has passed all the sanity checks, it's known as a sane environment for the installation programme to proceed with reasonable expectation of success.

A "Hello, World!" program is often used as a sanity test for a development environment similarly. Rather than a complicated script running a set of unit tests, if this simple programme fails to compile or execute, it proves that the supporting environment likely has a configuration problem that will prevent any code from compiling or executing. But if "Hello world" executes, then any problems experienced with other programmes likely can be attributed to errors in that application's code rather than the environment.

The Association for Computing Machinery, and software projects such as Android, MediaWiki and Twitter, discourage use of the phrase sanity check in favour of other terms such as confidence test, coherence check, or simply test, as part of a wider attempt to avoid ableist language and increase inclusivity.

title: Sanity check


text:
History of Bahrain

Bahrain was a central location of the ancient Dilmun civilization. Bahrain's strategic location in the Persian Gulf has brought rule and influence from mostly the Persians, Sumerians, Assyrians, Babylonians, Portuguese, the Arabs, and the British.

Dilmun Civilization
Bahrain was a central site of the ancient Dilmun civilization. Dilmun appears first in Sumerian cuneiform clay tablets dated to the end of fourth millennium BC, found in the temple of goddess Inanna, in the city of Uruk. The adjective Dilmun is used to describe a type of axe and one specific official; in addition, there are lists of rations of wool issued to people connected with Dilmun. Dilmun was mentioned in two letters dated to the reign of Burna-Buriash II (c. 1370 BC) recovered from Nippur, during the Kassite dynasty of Babylon. These letters were from a provincial official, Ilī-ippašra, in Dilmun to his friend Enlil-kidinni in Mesopotamia. The names referred to are Akkadian. These letters and other documents, hint at an administrative relationship between Dilmun and Babylon at that time. Following the collapse of the Kassite dynasty, Mesopotamian documents make no mention of Dilmun with the exception of Assyrian inscriptions dated to 1250 BC which proclaimed the Assyrian king to be king of Dilmun and Meluhha. Assyrian inscriptions recorded tribute from Dilmun. There are other Assyrian inscriptions during the first millennium BC indicating Assyrian sovereignty over Dilmun. Dilmun was also later on controlled by the Kassite dynasty in Mesopotamia.

One of the early sites discovered in Bahrain indicate that Sennacherib, king of Assyria (707–681 BC), attacked northeast Persian Gulf and captured Bahrain. The most recent reference to Dilmun came during the Neo-Babylonian dynasty. Neo-Babylonian administrative records, dated 567 BC, stated that Dilmun was controlled by the king of Babylon. The name of Dilmun fell from use after the collapse of Neo-Babylon in 538 BC.

There is both literary and archaeological evidence of extensive trade between Ancient Mesopotamia and the Indus Valley civilization (probably correctly identified with the land called Meluhha in Akkadian). Impressions of clay seals from the Indus Valley city of Harappa were evidently used to seal bundles of merchandise, as clay seal impressions with cord or sack marks on the reverse side testify. A number of these Indus Valley seals have turned up at Ur and other Mesopotamian sites.

The "Persian Gulf" types of circular, stamped (rather than rolled) seals known from Dilmun, that appear at Lothal in Gujarat, India, and Failaka, as well as in Mesopotamia, are convincing corroboration of the long-distance sea trade. What the commerce consisted of is less known: timber and precious woods, ivory, lapis lazuli, gold, and luxury goods such as carnelian and glazed stone beads, pearls from the Persian Gulf, shell and bone inlays, were among the goods sent to Mesopotamia in exchange for silver, tin, woolen textiles, olive oil and grains. Copper ingots from Oman and bitumen which occurred naturally in Mesopotamia may have been exchanged for cotton textiles and domestic fowl, major products of the Indus region that are not native to Mesopotamia. Instances of all of these trade goods have been found. The importance of this trade is shown by the fact that the weights and measures used at Dilmun were in fact identical to those used by the Indus, and were not those used in Southern Mesopotamia.

 * "the ships of Dilmun, from the foreign land, brought him wood as a tribute".

Mesopotamian trade documents, lists of goods, and official inscriptions mentioning Meluhha supplement Harappan seals and archaeological finds. Literary references to Meluhhan trade date from the Akkadian, the Third Dynasty of Ur, and Isin-Larsa Periods (c. 2350–1800 BC), but the trade probably started in the Early Dynastic Period (c. 2600 BC). Some Meluhhan vessels may have sailed directly to Mesopotamian ports, but by the Isin-Larsa Period, Dilmun monopolized the trade. The Bahrain National Museum assesses that its "Golden Age" lasted ca. 2200–1600 BC. Discoveries of ruins under the Persian Gulf maybe of Dilmun. ]

In the Mesopotamian epic poem Epic of Gilgamesh, Gilgamesh had to pass through Mount Mashu to reach Dilmun, Mount Mashu is usually identified with the whole of the parallel Lebanon and Anti-Lebanon ranges, with the narrow gap between these mountains constituting the tunnel.

Dilmun, sometimes described as "the place where the sun rises" and "the Land of the Living", is the scene of some versions of the Eridu Genesis, and the place where the deified Sumerian hero of the flood, Utnapishtim (Ziusudra), was taken by the gods to live forever. Thorkild Jacobsen's translation of the Eridu Genesis calls it "Mount Dilmun" which he locates as a "faraway, half-mythical place".

Dilmun is also described in the epic story of Enki and Ninhursag as the site at which the Creation occurred. The promise of Enki to Ninhursag, the Earth Mother: For Dilmun, the land of my lady's heart, I will create long waterways, rivers and canals, whereby water will flow to quench the thirst of all beings and bring abundance to all that lives. Ninlil, the Sumerian goddess of air and south wind had her home in Dilmun. It is also featured in the Epic of Gilgamesh.

However, in the early epic Enmerkar and the Lord of Aratta, the main events, which center on Enmerkar's construction of the ziggurats in Uruk and Eridu, are described as taking place in a world "before Dilmun had yet been settled".

Persian Empire
From the 6th century BC to the 3rd century BC Bahrain was a pivotal part of the Persian Empire of the Achaemenids, an Iranian dynasty. From the 3rd century BC to the arrival of Islam in the 7th century AD, Bahrain was controlled by two other Iranian dynasties, the Parthians and the Sassanids. By about 130 BC, the Parthian dynasty brought the Persian Gulf under their control and extended their influence as far as Oman; since they needed to control the Persian Gulf trade route, the Parthians established garrisons along the southern coast of the Persian Gulf.

In the 3rd century AD, the Sassanids succeeded the Parthians and held the area until the arrival of Islam four centuries later. Ardashir, the first ruler of the Iranian Sassanid dynasty marched to Oman and Bahrain and defeated Sanatruq (or Satiran ), probably the Parthian governor of Bahrain. He appointed his son Shapur I as governor of Bahrain. Shapur constructed a new city there and named it Batan Ardashir after his father. At this time, Bahrain incorporated the southern Sassanid province covering the Persian Gulf's southern shore plus the archipelago of Bahrain. The southern province of the Sassanids was subdivided into three districts; Haggar (now al-Hafuf province, Saudi Arabia), Batan Ardashir (now al-Qatif province, Saudi Arabia), and Mishmahig (now Bahrain Island).

Tylos
Bahrain was referred to by the ancient Greeks as Tylos, the centre of pearl trading, when the Greek admiral, Nearchus, first visited there. Nearchus was serving under Alexander the Great, who overthrew the ruling tribe of Al Hamar.

Nearchus is believed to have been the first of Alexander's commanders to visit Bahrain, and he found a verdant land that was part of a wide trading network. He recorded: "That in the island of Tylos, situated in the Persian Gulf, are large plantations of cotton tree, from which are manufactured clothes called sindones, with very different degrees of value, some being costly, others less expensive. The use of these is not confined to India, but extends to Arabia." The Greek historian, Theophrastus, states that many of the islands were covered in these cotton trees and that Tylos was famous for exporting walking canes engraved with emblems that were customarily carried in Babylon.

It is not known whether Bahrain was part of the Seleucid Empire, although the archaeological site at Qalat Al Bahrain has been proposed as a Seleucid base in the Persian Gulf. Alexander had planned to settle the eastern shores of the Persian Gulf with Greek colonists, and although it is not clear that this happened on the scale he envisaged, Tylos was very much part of the Hellenised world: the language of the upper classes was Greek (although Aramaic was in everyday use). Local coinage shows a seated Zeus, who may have been worshiped there as a syncretised form of the Arabian sun-god Shams. Tylos was also the site of Greek athletics contests.

Strabo, the Greek historian, geographer and philosopher mentioned that the Phoenicians came from Eastern Arabia where they have similar gods, cemeteries and temples. This theory was accepted by the 19th-century German classicist Arnold Heeren who said that: "In the Greek geographers, for instance, we read of two islands, named Tyrus or Tylos, and Arad, Bahrain, which boasted that they were the mother country of the Phoenicians, and exhibited relics of Phoenician temples". The people of Tyre, Lebanon in particular have long maintained Persian Gulf origins, and the similarity in the words "Tylos" and "Tyre" has been commented upon. Later classicist theories were proposed prior to modern archaeological excavations which revealed no disruption of Phoenician societies between 3200 B.C. and 1200 B.C.

Herodotus's account (written c. 440 BC) refers to the Phoenicians originating from Eastern Arabia. (History, I:1). "According to the Persians best informed in history, the Phoenicians began the quarrel. These people, who had formerly dwelt on the shores of the Erythraean Sea (the eastern part of the Arabia peninsula), having migrated to the Mediterranean and settled in the parts which they now inhabit, began at once, they say, to adventure on long voyages, freighting their vessels with the wares of Egypt and Assyria..."

The name Tylos is thought to be a Hellenisation of the Semitic, Tilmun (from Dilmun). The term Tylos was commonly used for the islands until Ptolemy's Geographia when the inhabitants are referred to as 'Thilouanoi'. Some place names in Bahrain go back to the Tylos era, for instance, the residential suburb of Arad in Muharraq, is believed to originate from "Arados", the ancient Greek name for Muharraq island.

With the waning of Seleucid Greek power, Tylos was incorporated into Characene or Mesenian, the state founded in what today is Southern Iraq by Hyspaosines in 127BC. A building inscriptions found in Bahrain indicate that Hyspoasines occupied the islands, (and it also mentions his wife, Thalassia).

Islam
From the time when Islam emerged in the 7th century until the early 16th century, the name Bahrain referred to the wider historical region of Bahrain stretching from Basrah to the Strait of Hormuz along the Persian Gulf coast. This was Iqlīm al-Baḥrayn, i.e. the Province of Bahrain, and the Arab inhabitants of the province were descendants of the Arab tribe Bani Abd al-Qais. Bahrain embraced Islam in 629 (the seventh year of hijra); the Prophet Mohammed ruled Bahrain through one of his representatives, Al-Ala'a Al-Hadhrami. During the time of Umar I the famous companion of the Prophet, Abu Hurayrah, was the governor of Bahrain. Umar I also appointed Uthman bin Abi Al Aas as governor of the area. Al Khamis Mosque, founded in 692, was one of the earliest mosques built in Bahrain, in the era of Umayyad caliph Umar II. Prior to Islam, Bahrain was a centre of Nestorian Christianity.

The expansion of Islam did not affect Bahrain's reliance on trade, and its prosperity continued to be dependent on markets in Mesopotamia. After Baghdad emerged as the seat of the caliph in 750 and the main centre of Islamic civilization, Bahrain greatly benefited from the city's increased demand for foreign goods especially from China and South Asia. Bahrain became a hub for intellectuals for hundreds of years stretching from the early days of Islam in the 6th century to the 18th century. Philosophers of Bahrain were highly esteemed, such as the 13th century mystic, Sheikh Maitham Al Bahrani (died in 1299).

The Qarmatian Republic
Around the year 900, Abu Sa'id al-Hasan al-Jannabi led the Qarmatian revolution, a rebellion by a messianic Ismaili sect originating in Kufa in present-day Iraq. Al-Jannabi took over the city of Hajr, Bahrain's capital at that time, and al-Hasa, which he made the capital of his republic. Once in control of the state he sought to create a utopian society.

The Qarmatians' goal was to build a society based on reason and equality. The state was governed by a council of six with a chief who was a first among equals. All property within the community was distributed evenly among all initiates. The Qarmatians were organized as an esoteric society but not as a secret one; their activities were public and openly propagated, but new members had to undergo an initiation ceremony involving seven stages. The Qarmatian world view was one where every phenomenon repeated itself in cycles, where every incident was replayed over and over again.

Even before taking over Bahrain, the Qarmatians had instigated what some scholars have termed a 'century of terrorism' in Kufa. From Bahrain they launched raids along the pilgrim routes crossing Arabia: in 906 they ambushed the pilgrim caravan returning from Mecca and massacred 20,000 pilgrims. Under Abu Tahir al-Jannabi they came close to capturing Baghdad in 923, and sacked Mecca in 930. In the assault on Islam's holiest sites, the Qarmatians desecrated the Well of Zamzam with corpses of Hajj pilgrims, and took the Black Stone from Mecca to al-Hasa. According to historian al-Juwayni, the stone was returned 22 years later in 951 under mysterious circumstances. Wrapped in a sack, it was thrown into the Great Mosque of Kufa in Iraq, accompanied by a note saying "By command we took it, and by command we have brought it back." The theft and removal of the Black Stone caused it to break into seven pieces.

The sack of Mecca followed millenarian excitement among the Qarmatians (and in Persia) over the conjunction of Saturn and Jupiter in 928. Bahrain became the seat of the Qarmatian Mahdi-Caliph from Isfahan who abolished Sharīa law. The new Mahdi also changed the qibla of prayer from Mecca to that of fire, a specifically Zoroastrian practice. Some scholars take the view that "they may not have been Isamailis at all at the outset, and their conduct and customs gave plausibility to the belief that they were not merely heretics but bitter enemies of Islam."

For much of the 10th century the Qarmatians were the most powerful force in the Persian Gulf and Middle East, controlling the coast of Oman, and collecting tribute from the Abbasid caliph in Baghdad and from the rival Ismaili Fatimid caliph in Cairo, whom they did not recognize. The land they ruled over was extremely wealthy with a huge slave-based economy according to academic Yitzhak Nakash:

"The Qarmatian state had vast fruit and grain estates both on the islands and in Hasa and Qatif. Nasiri Khusru, who visited Hasa in 1051, recounted that these estates were cultivated by some thirty thousand Ethiopian slaves. He mentions that the people of Hasa were exempt from taxes. Those impoverished or in debt could obtain a loan until they put their affairs in order. No interest was taken on loans, and token lead money was used for all local transactions. The Qarmatian state had a powerful and long-lasting legacy. This is evidenced by a coin known as Tawila, minted around 920 by one of the Qarmatian rulers, and which was still in circulation in Hasa early in the 20th century"

The Qarmatians were defeated in battle in 976 by the Abbasids, which encouraged them to look inward to build their utilitarian society. Around 1058, a revolt on the island of Bahrain led by two Shi'a members of the Abd al-Qays tribe, Abul-Bahlul al-'Awwam and Abu'l-Walid Muslim, precipitated the waning of Qarmatian power and eventually the ascendancy to power of the Uyunids, an Arab dynasty belonging to the Abdul Qays tribe.

Uyunid dynasty
In 1076–1077, Sheikh Abdullah bin Ali Al Uyuni seized the country from the Qarmatians in Bahrain and Al-Hasa with the military assistance of Great Seljuq Empire and founded the Uyunid dynasty and established the Uyunid Emirate. The Uyunid dynasty, ruled Bahrain for 163 years, from the 11th to the 13th centuries. Their sect is disputed; some sources mention they were Shia, others Sunni. They were the remnants of Bani Abdul Qays tribe. The state of Al-Hasa was the first capital of the Uyunid Emirate. Then Al-Fadhl, son of Abdullah, transfers his capital to Qatif, then to Awal (today's state of Bahrain). In his reign, the state extended to Kuwait. Then in 513 H. the Capital went back to Qatif. Then in 531 H. Mohammed son of Al Fadhl 1 is assassinated there for the state was divided into two, one in Al-Hasa and the other in Al-Qatif.

Under Muhammad b. Ahmad b. Abu'l-Hussin b. Abu Sinan, the Uyunid's territory stretched from Najd to the Syrian desert. Due to the influence of the Uyunid kingdom, Caliph al-Nasir li-Din Allah gave Muhammad b. Ahmad authority to protect the pilgrimage route to Mecca. Muhammad was later murdered by a family member, instigated by his cousin, Gharir b. Shukr b. Ali. In the years 587 – 605 H. Mohammed bin Abi Al-hussain unites Qatif and Al-Hasa. The country was ruled by the Uyunid dynasty for 163 years. In 1253 C. Conflicts inside the Uyunid family gave the chance to the Bedouin Usfurids of Banu Uqayl to establish their state and destroy the Uyunid State. Thereby gaining control over eastern Arabia, including the islands of Bahrain. The famous poet Ali bin al Mugrab Al Uyuni is a descendant of the Uyunids.

Usfurid, and Jabrid dynasties
In 1253, the Bahrani dynasty of the Usfurids of Banu Uqayl – named after its founder, Usfur ibn Rashid – gained control over eastern Arabia, including the islands of Bahrain. The late Middle Ages were a time of chronic instability with local disputes allowing various Persian-based Arab Kingdoms based in Qais, Qishm and Hormuz to involve themselves in Bahrain's affairs. In 1330, the islands became tributary to the rulers of Hormuz.

According to historian Juan Cole it was under Sunni rule that Twelver Shiaism became established in Bahrain, as Shia Bahrainis gradually moved away from the radical, egalitarian Ismaili Qarmatian sect to the more quietist Twelver or Imami branch, a process which the Sunni rulers encouraged. But even in the 14th century, the North African traveller Ibn Battuta visiting Qatif around 1331, found it inhabited by Arabs whom he described as "extremist Shi'is" (rafidiyya ghulat), which Cole presumes is how a 14th-century Sunni would describe Ismailis. Ibn Battuta also noted the great wealth of the area thanks to the pearling industry.

Until the late Middle Ages, "Bahrain" referred to the larger historical region of Bahrain. Ibn Battuta's 14th-century account contains an early use of the term "Bahrain" to refer solely to the Awal islands. However, the exact date at which the term "Bahrain" began to refer solely to the Awal archipelago is unknown.

In the mid-15th century, another branch of the Banu Uqayl, led by Zamil ibn Jabir, wrested control of Bahrain, founding the dynasty of the Bedouin Jabrids. Based in al-Ahsa, the Jabrids ruled most of eastern Arabia and followed the Sunni Maliki rite, which they actively promoted within their domain.

Portuguese rule
The Arab navigator, Ahmad Bin Majid, visited Bahrain in 1489 prior to the Portuguese' arrival in the region and gave an account of the country: "In Awal (Bahrain) there are 360 villages and fresh water can be found in a number of places. A most wonderful al-Qasasir, where a man can dive into the salt sea with a skin and can fill it with fresh water while he is submerged in the salt water. Around Bahrain are pearl fisheries and a number of islands all of which have pearl fisheries and connected with this trade are 1,000 ships" (Majid, Arab Navigation in the Indian Ocean before the Coming of the Portuguese. Trans. G.R. Tibbetts. The Royal Asisatic Society of Great Britain and Ireland, 1981. page 222).

Portuguese expansion into the Indian Ocean in the early 16th century followed Vasco da Gama's voyages of exploration in which the Portuguese battled the Ottomans up the coast of the Persian Gulf. The Portuguese, drawn in by the lucrative trade routes of the Gulf, sought control of the strategic Ormus region before setting its sights on Bahrain. Portuguese ships first entered the Gulf in 1485, the first reputed Portuguese traveller to visit Bahrain was Duarte Barbosa. After the Kingdom of Hormuz fell in 1507, Hormuz' political control of Bahrain was lost after the island fell to the princes of Al-Hasa. A combined Portuguese-Hormuz force led by António Correia conquered Bahrain in 1521 only to briefly lose it to the princes of Al-Hasa the same year. In response, the Portuguese sent another expedition to Bahrain and the Arabian coast and subdued the Al-Hasa attempts to regain power.

The Portuguese later consolidated their position of the island by reconstructing the Qal'at al Bahrain fortress, which was to serve as the base for the Portuguese garrison. It is believed that the Portuguese ruled the islands via indirect rule, with some force, against the inhabitants for eighty years, despite incurring several revolts and protests (one of which resulted in temporary independence in 1534). Such a revolt was the rebellion of 1529 saw the deployment of a 400-man Portuguese force sent to subdue the island.

Except for a brief period in 1559 when the governor of the Ottoman province of Al-Hasa tried to occupy the islands but were repelled, the Portuguese remained in control until they were driven out of the island in 1602, when a popular uprising led by Rukn ed-Din took control of the Bahrain Fort. The uprising was sparked by the governor's order of the execution of the island's richest traders. Portuguese attempts to retake Bahrain were thwarted due to aid from the prince of Shiraz. The uprising coincided with regional disputes between the Portuguese and rival European powers. The power vacuum that resulted was almost immediately filled by the Persian ruler, Shah Abbas I, who deployed a Persian garrison to the Bahrain Fort and subsumed it within the Safavid Empire.

Persian Safavid hegemony and Omani invasion
Under Persian Safavid rule (1602–1717), Bahrain fell under the administrative jurisdiction of the Beglarbegi of Kuhgilu centered at Behbahan in southern Iran. In fact, the Safavids ruled Bahrain from a distance, seeking to control the islands not by force, but through ideology and the manipulation of local rivalries. Safavid rule was a period of intellectual flowering among the Shia theological elite, with Bahrain's seminaries producing such theorists as Sheikh Yusuf Al Bahrani. The Safavid's used the clergy to buttress their rule, hoping that by firmly implanting Imami Shiaism they could secure the islands of Bahrain, with their centrality to trade routes and pearl wealth.

However, the Safavids' strategy was in many ways too successful: the power and influence of the religious class meant that they had a great deal of autonomy, and it was the subsequent tension between Safavid state and the clergy that drove Bahrain's theological vitality. Part of this flourishing was borne of the Bahraini clerics' adherence to conservative Akhbari Shiaism, while the Safavids encouraged the more state-centric, Usulism. Attempts by the Persians to reign in the Bahraini ulema were often counterproductive, and ended up strengthening the clerics against their local land-owning Bahraini rivals who challenged the clerics' control over the lucrative pearl trade. Cleric-landowner conflict was usually contained within very limited parameters given that the senior ulema were usually the sons of the land-owning class.

Omani invasion and subsequent instability
An Afghan invasion of Iran at the beginning of the 18th century resulted in the near collapse of the Safavid state. In the resultant power vacuum, Oman invaded Bahrain in 1717, ending over a hundred years of Persian hegemony. The Omani invasion began a period of political instability and a quick succession of outside rulers took power with consequent destruction. According to a contemporary account by theologian, Sheikh Yusuf Al Bahrani, in an unsuccessful attempt by the Persians and their Bedouin allies to take back Bahrain from the Kharijite Omanis, much of the country was burnt to the ground. Bahrain was eventually sold back to the Persians by the Omanis, but the weakness of the Safavid empire saw Huwala tribes seize control.

In 1730, the new Shah of Persia, Nader Shah, sought to re-assert Persian sovereignty in Bahrain. He ordered Latif Khan, the admiral of the Persian navy in the Persian Gulf, to prepare an invasion fleet in Bushehr. The Persians invaded in March or early April 1736 when the ruler of Bahrain, Shaikh Jubayr, was away on hajj. The invasion brought the island back under central rule and to challenge Oman in the Persian Gulf. He sought help from the British and Dutch, and he eventually recaptured Bahrain in 1736. In 1753, Bahrain was occupied by the Arabs of Abu Shahr of the Bushire-based Al Madhkur family, who ruled Bahrain in the name of Persia and paid allegiance to Karim Khan Zand. During the Qajar era, Persian control over Bahrain waned

The years of almost constant warfare and instability in the period led to a demographic collapse – German geographer Carsten Niebuhr found in 1763 that Bahrain's 360 towns and villages had, through warfare and economic distress, been reduced to only 60. The influence of Iran was further undermined at the end of the 18th century when the ideological power struggle between the Akhbari-Usuli strands culminated in victory for the Usulis in Bahrain.

The Bahrain invasions
In 1782, war broke out between the army of Sheikh Nasr Al-Madhkur, the ruler of Bahrain and Bushehr and the Zubarah-based Bani Utbah clan, though hostilities arose since 1777 after the Persians saw the Zubarah base as a threat. The prosperity of Zubarah, which is in modern Qatar, had brought it to the attention of the two main powers at the time, Persia and Oman, which were presumably sympathetic to Sheikh Nasr's ambitions. At the same time, Bahrain offered great potential wealth because of the extensive pearls found in its waters.

Nasr enlisted the aid of the rulers of Bandar Rig, Bandar Ganaveh and Dashtestan and amassed an army of 2,000 soldiers to be commanded by his nephew, Mohammed. The Persians launched an assault of Zubarah's fort but were forced to break the siege after suffering stiff resistance from the Al Khalifa defenders and facing imminent naval reinforcements from Bani Utbah men in Kuwait. In retaliation to the assault, the Bani Utbah clan launched an invasion of Bahrain Island in 1783. Historians disagree on who attacked first; some historians believe that the incoming naval reinforcements from Kuwait intercepted a message from Nasr Al-Madhkur to his representative in Bahrain stating that the Persians had lost the battle. Upon learning this, the fleet switched course and invaded Bahrain, capturing the Bahrain fort and surrounding the Persian garrison. With a large coalition of tribesmen from the Bani Utbah and interior Arabia, the invasion of Bahrain was completed on 28 July 1783 Other historians believe that the Kuwaitis invaded Bahrain because they were closer to it than to Zubarah and as such, would deliver a tactical defeat to the Persians and would later handover possession to the Bani Utbah clan. The most probable version, as put forward by Historian J. G. Lorimer, was that the invasion was led by Ahmed Al Fateh in 1783 and that he defeated Nasr Al-Madhkur in battle on the outskirts of Manama and plundered the town. Historians dispute the date of the invasion, some stating it occurred in 1782 while others say it was 1783. Ahmed al-Fateh ruled Bahrain and Zubarah, visiting the former in the summer and the latter in the winter, until his death in 1796.

In 1797, fourteen years later after gaining the power of the Bani Utbah, the Al Khalifa family moved to Bahrain and settled in Jaww, later moving to Riffa. They were originally from Kuwait having left in 1766. Al-Sabah family traditions relates that the ancestors of their family and those of the Al-Khalifa family came to Kuwait after their expulsion from the Iraqi Umm Qasr town upon Khor Zubair by the Turks, an earlier base from which they preyed on the caravans of Basra and pirated ships in the Shatt al-Arab waterway. The first ruler of the Al Khalifa was Shaikh Ahmed Al-Fateh.

Persian attempts to reconquer the island in 1783 and in 1785 failed; the 1783 expedition was a joint Persian-Qawasim invasion force that never left Bushehr. The 1785 invasion fleet, composed of forces from Bushehr, Rig and Shiraz was called off after the death of the ruler of Shiraz, Ali Murad Khan. Due to internal difficulties, the Persians could not attempt another invasion. In 1799, Bahrain came under threat from the expansionist policies of Sayyid Sultan, the Sultan of Oman, when he invaded the island under the pretext that Bahrain did not pay taxes owed. The Bani Utbah solicited the aid of Bushire to expel the Omanis on the condition that Bahrain would become a tributary state of Persia. In 1800, Sayyid Sultan invaded Bahrain again in retaliation and deployed a garrison at Arad Fort, in Muharraq island and had appointed his twelve-year-old son Salim, as Governor of the island. The Bani Utbah laid siege to Arad Fort later that year, ejecting Salim from power. In 1802, Sayyid Sultan once again sailed with a fleet to Bahrain however, the Al Khalifa enlisted the aid of Wahhabis from the mainland which forced the Omanis to abort their invasion.

Treaties with Britain
In 1820, the Al Khalifa tribe regained power in Bahrain and entered a treaty relationship with Great Britain, by then the dominant military power in the Persian Gulf. This treaty recognised the Al Khalifa as the rulers ("Al-Hakim" in Arabic) of Bahrain. It was the first of several treaties including the 1861 Perpetual Truce of Peace and Friendship, which was further revised in 1892 and 1951.

This treaty was similar to those entered into by the British Government with the other Persian Gulf principalities. It specified that the ruler could not dispose of any of his territory except to the United Kingdom and could not enter into relationships with any foreign government without British consent. In return the British promised to protect Bahrain from all aggression by sea and to lend support in case of land attack. More importantly, the British promised to support the rule of the Al Khalifa in Bahrain, securing its unstable position as rulers of the country. According to School of Oriental and African Studies academic, Nelida Fuccaro, this treaty relationship with Britain was one aspect of an evolving polity:

"From this perspective state building under the Al Khalifa shayks should not be considered exclusively as the result of Britain's informal empire in the Persian Gulf. In fact, it was a long process of strategic negotiation with different sections of the local population in order to establish a pre-eminence of their particularly artistic Sunni/Bedouin tradition of family rule."

After the Egyptian ruler, Mohammad Ali Pasha took the Arabian Peninsula from the Wahhabis on behalf of the Ottoman Empire in 1830, the Egyptian army demanded yearly tributes from Sheikh Abdul Al Khalifa. He had earlier sought Persian and British protection from the Egyptians. The Sheikh agreed to the terms of the Egyptians.

In April 1843 Muhammad bin Khalifa Al Khalifa defeated Abdullah bin Ahmad Al Khalifa becoming the ruler. Among his first steps taken as ruler was to appoint his brother, Ali bin Khalifa, as chief of Al Bidda, Qatar that year, thereby delegating all mainland affairs and solidifying Qatar's status as a Bahraini suzerainty.

During his reign Muhammad paid an annual tribute to Faisal bin Turki, successor of Abdullah bin Thunayan as the Emir of Najd. After eliminating his rival Abdullah bin Thunayan, Faisal bin Turki consolidated his power by subduing opposition tribes in Najd and taking control of key economic centres such as Al-Ahsa and Saihat. However, Faisal's ambitions extended beyond these territories. In 1847, he attempted to intervene in Bahrain, exploiting internal conflicts within the ruling family. Although unsuccessful in capturing Bahrain, he settled for a peace agreement that included a tribute payment. Faisal's inability to seize Bahrain was, in part, due to the firm stance of the British government against Saudi expansion in the Persian Gulf. The British, who had substantial interests in the region, closely monitored Faisal's movements. Their support for Muhammad bin Khalifa and their strategic positions in the Gulf influenced the broader regional dynamics.

However, in 1850, Muhammad began not to pay the tribute, and next year he attempted to get support from the Ottomans, but his attempt was not fruitful. In May 1851, Faisal launched his third attempt to capture Bahrain, ordering his forces to proceed towards Al Bidda, Qatar, which was intended to be used as a staging area for an invasion of Bahrain, preparing for a confrontation with Muhammad bin Khalifa. In response, Ali bin Khalifa, the Bahraini representative in Qatar, called on all men of fighting age to defend Al Bidda, as well as sending for help from Saeed bin Tahnun Al Nahyan of Abu Dhabi. This culminated in the Battle of Mesaimeer, taking place from 2–4 June, 1851. Although the resistance was initially successful in repelling the invasion, Ali bin Khalifa's forces later retreated to their ships. Shortly after the fighting had taken place, Mohammed bin Thani, an influential tribal leader in Al Bidda, pursued a separate peace agreement with Faisal and agreed to his governance, a move seen as a betrayal by the Bahrainis. Upon receiving news of this, Muhammad bin Khalifa ordered a naval blockade of Al Bidda in June 1851. He also sent Hamad bin Mohammed Al Khalifa to inform British political resident Samuel Hennell of his concerns of a joint Wahhabi-Qatari invasion of Bahrain and requested protection, stating that he was willing to be a British subject in exchange for such protection. The British originally rejected this proposition.

Upon further analysis of the situation, Justin Sheil, a high-ranking British diplomat in Persia, concluded that Faisal bin Turki's control of the Qatari Peninsula would be detrimental to British interests as it would provide the Ottoman Empire with an opportunity to incorporate Bahrain under its aegis in the event of a joint Qatari-Wahhabi invasion of the island. Thus, on 1 July, Hennel directed multiple British warships to be sent to protect Manama Harbor in Bahrain. He then separately wrote letters to Faisal bin Turki and Mohammed bin Thani, warning them against launching a naval invasion of the Bahraini coast. The conflict pacified when, facing pressure from multiple sides and fearing further erosion of Bahraini influence, Muhammad bin Khalifa agreed to a peace settlement. This agreement, brokered by Saeed bin Tahnun of Abu Dhabi on July 25, 1851, required Bahrain to pay an annual sum of 4,000 German krones to Faisal bin Turki as zakat. In return, Faisal agreed to restore the fort of Al Bidda to Bahraini control and to cease interference in Qatar.

In 1860, the Government of Al Khalifa once again sought the protection of a larger power when the British tried to overpower Bahrain. Sheikh Mohammad bin Khalifa Al Khalifa wrote letters to both the Persian Prince-Governor of Fars and to the Ottoman Wali of Baghdad, to place Bahrain in the protection of each respective state. Both sides sent wakils (a person who is an authorised representative), who offered the Sheikh their conditions, of which the Ottoman terms were more beneficial and was accepted in March 1860. In another letter to the Iranian Foreign Minister, Sheikh Mohammad demanded that the Government of Iran provide direct guidance and protection from British pressure.

Later on, under pressure from Colonel Sir Lewis Pelly, Sheikh Mohammad requested military assistance from Iran, but the Government of Iran at that time provided no aid to protect Bahrain from British aggression. As a result, the Government of British India eventually overpowered Bahrain. Colonel Pelly signed an agreement with Sheikh Mohammad in May 1861 and later with his brother Sheikh Ali that placed Bahrain under British rule and protection.

In 1868, following the Qatari–Bahraini War, British representatives signed another agreement with the Al Khalifa rulers, making Bahrain part of the British protectorate territories in the Persian Gulf. It specified that the ruler could not dispose of any of his territory except to the United Kingdom and could not enter into relationships with any foreign government without British consent. In return the British promised to protect Bahrain from all aggression by sea and to lend support in case of land attack. More importantly the British promised to support the rule of the Al Khalifa in Bahrain, securing its unstable position as rulers of the country. Other agreements in 1880 and 1892 sealed the protectorate status of Bahrain to the British.

Economic prosperity
Peace and trade brought a new prosperity. Bahrain was no longer dependent upon pearling, and by the mid-19th century, it became the pre-eminent trading centre in the Persian Gulf, overtaking rivals Basra, Kuwait, and finally in the 1870s, Muscat. At the same time, Bahrain's socio-economic development began to diverge from the rest of the Persian Gulf: it transformed itself from a tribal trading centre into a modern state. This process was spurred by the attraction of large numbers of Persian, Huwala, and Indian merchant families who set up businesses on the island, making it the nexus of a vast web of trade routes across the Persian Gulf, Persia and the Indian sub-continent. A contemporary account of Manama in 1862 found:

"Mixed with the indigenous population [of Manamah] are numerous strangers and settlers, some of whom have been established here for many generations back, attracted from other lands by the profits of either commerce or the pearl fishery, and still retaining more or less the physiognomy and garb of their native countries. Thus the gay-coloured dress of the southern Persian, the saffron-stained vest of Oman, the white robe of Nejed, and the striped gown of Bagdad, are often to be seen mingling with the light garments of Bahreyn, its blue and red turban, its white silk-fringed cloth worn Banian fashion round the waist, and its frock-like overall; while a small but unmistakable colony of Indians, merchants by profession, and mainly from Guzerat, Cutch, and their vicinity, keep up here all their peculiarities of costume and manner, and live among the motley crowd, 'among them, but not of them'."

Palgrave's description of Manama's coffee houses in the mid-19th century portrays them as cosmopolitan venues in contrast to what he describes as the 'closely knit and bigoted universe of central Arabia'. Palgrave describes a people with an open – even urbane – outlook: "Of religious controversy I have never heard one word. In short, instead of Zelators and fanatics, camel-drivers and Bedouins, we have at Bahrain [Manama] something like 'men of the world, who know the world like men' a great relief to the mind; certainly it was so to mine."

The great trading families that emerged during this period have been compared to the Borgias and Medicis and their great wealth – long before the oil wealth for which the region would later be renowned – gave them extensive power, and among the most prominent were the Persian Al Safar family, who held the position of Native Agents of Britain in the 19th century. The Al Safar enjoyed an 'exceptionally close' relationship with the Al Khalifa clan from 1869, although the al-Khalifa never intermarried with them – it has been speculated that this could be related to political reasons (to limit the Safars' influence with the ruling family) and possibly for religious reasons (because the Safars were Shia).

As a result of Bahrain's trade with India, the cultural influence of the subcontinent grew dramatically, with styles of dress, cuisine, and education showing a marked Indian influence. According to Exeter University's James Onley "In these and countless other ways, eastern Arabia's ports and people were as much a part of the Indian Ocean world as they were a part of the Arab world."

Early 20th century reforms
Unrest amongst the people of Bahrain began when Britain officially established complete dominance over the territory in 1892. The first revolt and widespread uprising took place in March 1895 against Sheikh Issa bin Ali, then ruler of Bahrain. Sheikh Issa was the first of the Al Khalifa to rule without Iranian relations. Sir Arnold Wilson, Britain's representative in the Persian Gulf and author of The Persian Gulf, arrived in Bahrain from Mascat at this time. The uprising developed further with some protesters killed by British forces.

Bahrain underwent a period of major social reform between 1926 and 1957, under the de facto rule of Charles Belgrave, the British advisor to Shaikh Hamad ibn Isa Al-Khalifa (1872-1942). The country's first modern school was established in 1919, with the opening of the Al-Hiddaya Boys School, while the Persian Gulf's first girls school opened in 1928. The American Mission Hospital, established by the Dutch Reform Church, began work in 1903. Other reforms include the abolition of slavery, while the pearl diving industry developed at a rapid pace.

These reforms were often vigorously opposed by powerful groups within Bahrain including sections within the ruling family and merchants. In order to counter conservatives, the British removed the Ruler, Isa ibn Ali Al Khalifa in 1923 and replaced him with his son. Some Sunni families left Bahrain to mainland Arabia, whilst clerical opponents of social reforms were exiled to Saudi Arabia and Iran. The heads of some merchant and notable families were likewise exiled. Britain's interest in Bahrain's development was motivated by concerns over the ambitions of the Saudi-Wahabi and the Iranians.

Discovery of oil
The discovery of oil in 1932 by Bahrain Petroleum Company brought rapid modernisation to Bahrain. Relations with the United Kingdom became closer, as evidenced by the British Royal Navy moving its entire Middle Eastern command from Bushehr in Iran to Bahrain in 1935. British influence continued to grow as the country developed, culminating with the appointment of Charles Belgrave as advisor. He went on to establish a modern education system in Bahrain.

Bahrain participated in the Second World War as part of the British Empire, specifically the British Indian Empire as a Gulf Residency on the Allied side, joining on 10 September 1939. On 19 October 1940, four Italian SM.82s bombers bombed Bahrain alongside Dhahran oilfields in Saudi Arabia, targeting Allied-operated oil refineries. Although minimal damage was caused in both locations, the attack forced the Allies to upgrade Bahrain's defences which further stretched Allied military resources. After World War II, increasing anti-British sentiment spread throughout the Arab World and led to riots in Bahrain. The riots focused on the Jewish community, which included distinguished writers, singers, accountants, engineers and middle managers working for the oil company, textile merchants with business all over the peninsula, and free professionals.

The leftist movement
The National Union Committee (NUC), a leftist nationalist movement associated with the labour unions, was formed in 1954 calling for the end of British interference and political reforms. Work sites were plagued with frequent strikes and occasional riots (including several fatalities) during this period. Following riots in support of Egypt defending itself against the tripartite invasion during 1956 Suez Crisis, the British decided to put an end to the NUC challenge to their presence in Bahrain. The NUC and its offshoots were declared illegal. Its leaders were arrested, tried and imprisoned. Some fled the country while others were forcibly deported.

Strikes and riots continued during the 1960s, now under the leadership of underground cells of the NUC, namely the communist National Liberation Front and the Popular Front for the Liberation of Bahrain, the Bahraini section of the Arab Nationalist Movement.

In March 1965, an uprising broke out, called the March Intifada, against the British presence in Bahrain. The spark of the riots was the laying off of hundreds of Bahraini workers at the Bahrain Petroleum Company. Several people died in the sometimes violent clashes between protesters and police.

Independent Bahrain
After World War II, Bahrain became the centre for British administration of the lower Persian Gulf.

In 1968, when the British Government announced its decision to end the treaty relationships with the Persian Gulf sheikdoms, Bahrain joined with Qatar and the seven Trucial States (which now form the United Arab Emirates) under British protection in an effort to form a union of Arab emirates. By mid-1971, however, the nine sheikhdoms still had not agreed on the terms of union. Accordingly, Bahrain sought independence as a separate entity.

In 1969, both the British and Iranian governments agreed to approach the United Nations Secretariat to resolve the dispute of Bahrain's sovereignty. In early 1970, the Iranian government asked the UN secretary-general to assess the will of the Bahraini people with regards to their sovereignty. The survey (sometimes referred to as a "referendum" ) took the form of a United Nations poll on whether islanders preferred independence or Iranian control. The report of the Personal Representative of the Secretary-General on the consultation stated that "the overwhelming majority of the people of Bahrain wish to gain recognition of their identity in a full independent and sovereign State free to decide for itself its relations with other States."

As a result, the United Nations Security Council unanimously passed Resolution 278 on 11 May 1970, while in the same month Iran renounced its claim to the island. The country subsequently became independent from the United Kingdom, declaring independence on 15 August 1971, and becoming formally independent as the State of Bahrain on 16 December 1971.

At independence, the permanent Royal Navy presence in Bahrain ended and the United States Navy moved onto the 10 acres (40,000 m2) previously occupied by British operations. The installation later grew into Naval Support Activity Bahrain, headquarters for the United States Fifth Fleet.

The emirate emerged just as the price of oil skyrocketed after the 1973 Yom Kippur War; while Bahrain's own reserves were being depleted the high oil price meant there was massive capitalisation in the Kingdom's neighbours. The Kingdom was able to exploit the situation thanks to another war in the Levant in 1975: the Lebanese Civil War. Beirut had long been the financial centre of the Arab world, but the outbreak of hostilities in the country had an immediate impact on the banking industry. Bahrain offered a new location at the centre of the booming Persian Gulf with a large educated indigenous workforce and sound fiscal regulations. Realizing the opportunity to become a financial centre resulted in growth in other industries in the country.

This bolstered the development of the middle class and gave Bahrain a very different class structure from its tribal dominated neighbours. Although there had long been a large Indian presence in Bahrain, it was at this time that mass migration to the Kingdom began to take off with subsequent consequences for the Kingdom's demographics. Large numbers of immigrants from Third World countries such as the Philippines, Pakistan, Egypt, and Iran were attracted by better salaries than at home.

The constitutional experiment
Based on its new 1973 constitution, Bahraini men elected its first National Assembly in 1973 (although Article 43 of the 1973 Constitution states that the Assembly is to be elected by "universal suffrage", the conditional clause "in accordance with the provisions of the electoral law" allowed the regime to prevent women from participating). Although the Assembly and then-Emir Isa ibn Salman al-Khalifa quarrelled over a number of issues (foreign policy; the U.S. naval presence, and the budget), the biggest clash came over the State Security Law (SSL). The Assembly refused to ratify the government-sponsored law, which allowed, among other things, the arrest and detention of people for up to three years, (renewable) without a trial.

The legislative stalemate over this act created a public crisis, and on 25 August 1975, the emir dissolved the Assembly. The emir then ratified the State Security Law by decree, and suspended those articles in the constitution dealing with the legislative powers of the Assembly. In that same year, the emir established the State Security Court, whose judgments were not subject to appeal.

Iranian Revolution and social and political change
The tide of political Islam that swept the Middle East in the 1970s, culminating in the Iranian Revolution in 1979 was to have profound implications for Bahrain's social and political development.

There were a number of factors that had caused Bahrain to be more liberal than its neighbours, but these were challenged by the rise of Islamic religious fundamentalism. Bahrain's pluralist traditions were to a large extent a result of the complex confessional and demographic makeup of the country, which required Shi'a Moslems Arabs, Sunni Moslem Arabs, ethnic Iranians (Huwala), and (Ajams), and a plethora of minority faiths, to live and work together. This tolerance had been buttressed by the prominence of Arab nationalism and Marxism as the main modes of dissent, both of which were socially progressive and downplayed religious affiliations. The country's traditional dependence on trade further encouraged openness. It was the political earthquake represented by the Shah's fall that changed the dynamics of Bahrain's politics.

In 1981, the Islamic Front for the Liberation of Bahrain (an alleged Iranian front organisation), attempted a coup d'état. Their goal was the assassination of Bahrain's leadership and installing an Islamist theocracy with a cleric as supreme leader. The attempted coup and the outbreak of the Iran–Iraq War led to the formation of the Gulf Cooperation Council, which Bahrain joined with Kuwait, Oman, Qatar, Saudi Arabia, and the United Arab Emirates. The sense of regional uncertainty was further heightened when Saddam Hussein's Iraq invaded Kuwait, triggering the 1991 Persian Gulf War.

1990s
The 1990s saw growing criticism of the lack of democratic reforms. The unrest resulted in approximately forty deaths and ended after Hamad ibn Isa Al Khalifa became the Emir in 1999. The emir appointed a 30-member Consultative Council for a four-year term in December 1992. Demonstrations followed the arrest of Shia cleric, Sheikh Ali Salman, on 5 December 1994 after he called for the restoration of the National Assembly and criticised the ruling family. A group of youths clashed with police after throwing stones at female runners during an international marathon for running bare-legged. In January 1995, Sheikh Ali Salman was deported and sought asylum in Britain. A cabinet reshuffle in June 1995, brought five Shia ministers into the government. Shia cleric, Sheikh Abdul Amir al-Jamri, arrested in April 1995, was released five months later. After bomb explosions in Manama's business quarter, Al-Jamri was arrested again on 18 January 1996. A Sunni lawyer and poet, Ahmad al-Shamlan, was also detained on 8 February, but released in April. In June 1996, the government claimed it had uncovered another Iranian-backed coup plot by a group called "Hezbollah-Bahrain". Bahrain recalled its ambassador to Iran and downgraded its representation to chargé d'affaires level. In September 1996 the Consultative Council was increased from 30 to 40 members.

The political impasse continued over the next few years during which time the regime dealt with its opponents using severe repression. Bomb attacks and police brutality marked this period in which over forty people were killed in violence between the two sides. Although the violence was never entirely stopped by the security measures, it was contained and continued as low-level intermittent disturbances.

In December 1998 Bahrain provided military facilities for "Operation Desert Fox", the US and UK bombing campaign against Iraq.

The emir, Sheikh Isa, died in March 1999, and was succeeded by his eldest son, Hamad bin Isa Al Khalifa. Sheikh al-Jamri was sentenced to 10 years' imprisonment in July 1999, but then pardoned by the new Emir. For the first time, non-Muslims (a Christian and a Jewish businessman) and four women were appointed to the Consultative Council in September 2000.

2000s
In 2001 Bahrainis strongly backed proposals put by the emir – now the king – to turn the country into a constitutional monarchy with an elected parliament and an independent judiciary. A referendum on 14–15 February 2001 massively supported the National Action Charter. The emir gave women the right to vote, and released all political prisoners. As part of the adoption of the National Action Charter on 14 February 2002, Bahrain changed its formal name from the State (dawla) of Bahrain to the Kingdom of Bahrain.

Local elections were held in May 2002. For the first time women could vote and stand as candidates, but failed to win a seat. Parliamentary elections – the first such in nearly 30 years – were held in October 2002 for a 40-member parliament, the Council of Deputies, which included a dozen Shia MPs. Authorities said the turnout was more than 50% despite a call by critics for a boycott.

In May 2003 thousands of victims of alleged torture petitioned the king to cancel a law which prevents them from suing suspected torturers. Nada Haffadh was made health minister in April 2004 – the first woman to head a government ministry. The following month, protests in Manama against fighting in the Iraqi holy cities of Najaf and Karbala saw the king sack his interior minister after police tried to prevent the protest. In March–June 2005, thousands of protest marchers demanded a fully elected parliament. In the general election of November 2006, the Shia opposition won 40% of the seats. A Shia Muslim, Jawad Al-Arrayedh, was named as a deputy prime minister.

A Jewish woman, Houda Nonoo, was appointed Bahrain's ambassador to the US in 2008 May. She is believed to be the Arab world's first Jewish ambassador.

Authorities arrested several people who allegedly planned to detonate homemade bombs during Bahrain's national celebrations in December 2008. In April 2009, the King pardoned more than 170 prisoners charged with endangering national security, including 35 Shias being tried on charges of trying to overthrow the state. However, in September 2010, in the run up to the elections, 20 Shia opposition leaders were arrested and accused of plotting to overthrow monarchy by promoting violent protests and sabotage. In the October parliamentary elections, the main Shia opposition group, Al Wefaq, could make only slender gains.

The country participated in military action against the Taliban in October 2001 by deploying a frigate in the Arabian Sea for rescue and humanitarian operations. As a result, in November of that year, US president George W. Bush's administration designated Bahrain as a "major non-NATO ally". Bahrain opposed the invasion of Iraq and had offered Saddam Hussein asylum in the days prior to the invasion. Relations improved with neighbouring Qatar after the border dispute over the Hawar Islands was resolved by the International Court of Justice in The Hague in 2001. Bahrain negotiated a free trade agreement with the United States in 2004, although Saudi Arabia criticized the move, saying it hindered regional economic integration.

Qatar and Bahrain have made plans to build the Qatar-Bahrain Friendship Bridge to link the countries across the Persian Gulf, which would be the longest fixed-link bridge in the world if completed.

Bahraini uprising (2011–present)

The protests in Bahrain started on 14 February, and were initially aimed at achieving greater political freedom and respect for human rights; they were not intended to directly threaten the monarchy. Lingering frustration among the Shiite majority with being ruled by the Sunni government was a major root cause, but the protests in Tunisia and Egypt are cited as the inspiration for the demonstrations. The protests were largely peaceful until a pre-dawn raid by police on 17 February to clear protestors from Pearl Roundabout in Manama, in which police killed four protesters. Following the raid, some protesters began to expand their aims to a call for the end of the monarchy. On 18 February army forces opened fire on protesters when they tried to reenter the roundabout, fatally wounding one. The following day protesters reoccupied Pearl Roundabout after the government ordered troops and police to withdraw. Subsequent days saw large demonstrations; on 21 February a pro-government Gathering of National Unity drew tens of thousands, whilst on 22 February the number of protestors at the Pearl Roundabout peaked at over 150,000 after more than 100,000 protesters marched there. On 14 March, Saudi-led GCC forces were requested by the government and entered the country, which the opposition called an "occupation".

King Hamad bin Isa Al Khalifa declared a three-month state of emergency on 15 March and asked the military to reassert its control as clashes spread across the country. On 16 March, armed soldiers and riot police cleared the protesters' camp in the Pearl Roundabout, in which 3 policemen and 3 protesters were reportedly killed. Later, on 18 March, the government tore down Pearl Roundabout monument. After the lifting of emergency law on 1 June, several large rallies were staged by the opposition parties. Smaller-scale protests and clashes outside of the capital have continued to occur almost daily. On 9 March 2012 over 100,000 protested in what the opposition called "the biggest march in our history".

The police response has been described as a "brutal" crackdown on "peaceful and unarmed" protestors, including doctors and bloggers. The police carried out midnight house raids in Shia neighbourhoods, beatings at checkpoints, and denial of medical care in a "campaign of intimidation". More than 2,929 people have been arrested, and at least five people died from torture while in police custody. On 23 November 2011 the Bahrain Independent Commission of Inquiry released its report on its investigation of the events, finding that the government had systematically tortured prisoners and committed other human rights violations. It also rejected the government's claims that the protests were instigated by Iran. Although the report found that systematic torture had stopped, the Bahraini government has refused entry to several international human rights groups and news organizations, and delayed a visit by a UN inspector. More than 120 people had died since the start of the uprising.

title: History of Bahrain


text:
1411

Year 1411 (MCDXI) was a common year starting on Thursday (link will display the full calendar) of the Julian calendar.

January–December

 * February 1 – The First Peace of Thorn is signed at Thorn in the Monastic State of the Teutonic Knights, ending the Polish–Lithuanian–Teutonic War.
 * February 17 – Ottoman Interregnum: Süleyman Çelebi is killed after being forced to flee his capital, Edirne, by his brother Musa Çelebi. Rule of the Ottoman domains in Europe (Rumelia) passes to Musa.
 * July 6 – Ming Dynasty Admiral Zheng He returns to Nanjing after his second voyage, and presents the Sinhalese king, captured during the Ming–Kotte War, to the Yongle Emperor.
 * July 24 – Battle of Harlaw in Scotland: Domhnall of Islay, Lord of the Isles, and an army commanded by Alexander Stewart, Earl of Mar battle to a bloody draw.
 * September 3 – The Treaty of Selymbria is concluded between the Ottoman Empire and the Republic of Venice.
 * September 21 – King Henry IV of England calls his ninth parliament.
 * November 30 – Henry IV dismisses Prince Henry and his supporters from the government.

Date unknown

 * Under the Yongle Emperor of Ming China, work begins to reinstate the ancient Grand Canal of China, which fell into disuse and dilapidation during the previous Yuan dynasty. Between 1411 and 1415, a total of 165,000 laborers dredge the canal bed in Shandong, build new channels, embankments, and canal locks. Four large reservoirs in Shandong are also dug, in order to regulate water levels, instead of resorting to pumping water from local tables. A large dam is also constructed, to divert water from the Wen River southwest into the Grand Canal.
 * Constantinople is briefly besieged by the Ottoman pretender Musa Çelebi, due to Byzantine support for Süleyman Çelebi during the Ottoman Interregnum.
 * (possibly early 1412) The Battle of İnceğiz between the rival brothers Mehmed Çelebi and Musa Çelebi, during the Ottoman Interregnum.

Births

 * September 21 – Richard of York, 3rd Duke of York, claimant to the English throne (d. 1460)
 * date unknown – Juan de Mena, Spanish poet (d. 1456)
 * Margareta of Celje, Polish Duchess (d. 1480)

Deaths

 * January 18 – Jobst of Moravia, ruler of Moravia, King of the Romans
 * February 6 – Esau de' Buondelmonti, ruler of Epirus
 * June 3 –Leopold IV, Duke of Austria (b. 1371)
 * September – Anne de Mortimer, Countess of Cambridge (b. 1390)
 * November 4 – Khalil Sultan, ruler of Transoxiana (b. 1384)
 * probable – Hasdai Crescas, Jewish philosopher

title: 1411


text:
1412

Year 1412 (MCDXII) was a leap year starting on Friday (link will display the full calendar) on the Julian calendar.

January–December

 * January 16 – The Medici Family are made official bankers of the Papacy.
 * January 25 – Ernest, Duke of Austria, marries Cymburgis of Masovia.
 * February 28 – The University of St Andrews in Scotland is granted a charter of privilege by the local bishop.
 * July 24 – Behnam Hadloyo becomes Syriac Orthodox Patriarch of Mardin.
 * October 5 – Emperor Go-Komatsu abdicates, and Emperor Shoko accedes to the throne of Japan.
 * October 28 – Eric of Pomerania becomes sole ruler of the Kalmar Union (Sweden, Denmark and Norway), upon the death of Queen Margaret.
 * December – Battle of Chalagan: The Kara Koyunlu Turkomans defeat the Georgians under Constantine I of Georgia, and their ally Ibrahim I of Shirvan.

Date unknown

 * The first mention is made of Wallachian knights competing in a jousting tournament, in Buda.
 * John II of Castile declares the Valladolid laws, that restrict the social rights of Jews. Among many other restrictions, the laws force Jews to wear distinctive clothes, and deny them administrative positions.
 * Years after its publication in the 14th century, the Ming Dynasty Chinese artillery officer Jiao Yu adds the preface to his classic book on gunpowder warfare, the Huolongjing.
 * The Black Death sweeps England for a final time, in a 60-year period.

Births

 * January 6 – Joan of Arc, French soldier and saint (tradition holds that she was born on the Feast of the Epiphany, but there is no documentary evidence) (d. 1431)
 * January 26 – William IV, Lord of Egmont, IJsselstein, Schoonderwoerd and Haastrecht and Stadtholder of Guelders (d. 1483)
 * April 22 – Reinhard III, Count of Hanau (1451–1452) (d. 1452)
 * June 5 – Ludovico III Gonzaga, Marquis of Mantua (d. 1478)
 * August 22 – Frederick II, Elector of Saxony and Margrave of Meissen (1428–1464) and Landgrave of Thuringia (1440–1445) (d. 1464)
 * November 17 – Zanobi Strozzi, Italian painter (d. 1468)
 * December 8 – Astorre II Manfredi, Italian noble (d. 1468)

Deaths

 * March – Albrekt of Mecklenburg, king of Sweden 1364–1389 (b. 1336)
 * April 2 – Ruy Gonzáles de Clavijo, Castilian traveller and writer
 * May 16 – Gian Maria Visconti, Duke of Milan
 * August 6 – Margherita of Durazzo, Queen consort of Charles III of Naples (b. 1347)
 * September 14 – Ingegerd Knutsdotter, Swedish abbess (b. 1356)
 * October 28 – Margaret I of Denmark, queen regnant of Denmark of Norway since 1387 and of Sweden since 1389 (b. 1353)
 * date unknown – Ignatius Abraham bar Garib, Syriac Orthodox Patriarch of Mardin
 * date unknown – Jalal ad-Din khan, khan of the Golden Horde

title: 1412