text
stringlengths
1
22.8M
Lieutenant General The Right Honourable Sir Thomas Maitland (10 March 1760 – 17 January 1824) was a British soldier and British colonial governor. He also served as a Member of Parliament for Haddington from 1790 to 1796, 1802–06 and 1812–13. He was made a Privy Councillor on 23 November 1803. He was the second surviving son of James Maitland, 7th Earl of Lauderdale, and the younger brother of James Maitland, 8th Earl of Lauderdale. Maitland never married. Early military career Maitland was commissioned into the Edinburgh Light Horse, shortly after his birth, but did not take up his commission until he joined the 78th (Highland) Regiment of Foot (Seaforth Highland Regiment) as a captain in 1778. He transferred to the 62nd Foot as a major in 1790. He was promoted lieutenant-colonel in 1794 and colonel and brigadier-general in 1798. Haitian Revolution In 1797, Maitland landed in Saint-Domingue, under orders to capture the French colony. Maitland realised that his forces were quickly dying in droves due to yellow fever, and he began to negotiate a retreat with the Haitian leader, Toussaint Louverture. Henry Dundas, 1st Viscount Melville, who was the Secretary of State for War for prime minister William Pitt the Younger, had instructed Sir Adam Williamson, the lieutenant-governor of Jamaica, to sign an agreement with representatives of the French colonists that promised to restore the ancien regime, slavery and discrimination against mixed-race colonists, a move that drew criticism from abolitionists William Wilberforce and Thomas Clarkson. Elkins and McKitrick write: It was in fact Maitland and not the War Ministry who had determined that Britain's only sensible choice, rather than try to maintain any kind of presence at Jérémie and Môle-Saint-Nicolas, was to deal directly with Louverture and negotiate a total evacuation of the island. Accordingly he and the black general concluded a secret agreement on August 31, 1798. Great Britain would desist from any further attack on St. Domingue and any interference with its internal affairs; Louverture made a similar promise with regard to Jamaica; and Maitland would see that provisions were allowed to reach the ports of St. Domingue without interference from British cruisers. In May 1799, Maitland returned to Saint-Domingue to negotiate an extension of the agreement with Louverture. On 13 June, in the presence of Edward Stevens, the representative of the United States on the island, Maitland and Louverture signed the Maitland Convention, which stipulated that the ports of Le Cap and Port-Républicain would be opened to Anglo-American shipping. Governor of Ceylon Maitland served as Governor of Ceylon (Sri Lanka) during 1805 to 1811. While at Ceylon, Maitland was attracted to a place at "Galkissa" (Mount Lavinia) and decided to construct his palace there. During this time, Maitland fell in love with a half-caste dancing-girl named Lovina, who had been born to Portuguese and Sinhalese parents. A folktale sometimes repeated states that during the construction of the palace, Maitland gave instructions for the construction of a secret tunnel to Lovina's house, which was located close to the governor's palace. One end of the tunnel was inside the well of Lovina's house and the other end was in a wine cellar inside the governor's palace. When the governor came to reside there, he would often use the tunnel to meet Lovina. The Sinhalese village that surrounded the Governor's mansion developed into a modern city named "Galkissa". Later the city was renamed "Mount Lavinia" in honour of Lovina. In 1920 the tunnel was sealed up. The bicentenary celebration of the Mount Lavinia Hotel was held in 2005. Some of Sir Thomas Maitland's relatives living in the UK attended the ceremony. Two roads in central Colombo in modern-day Sri Lanka, are named for him, Maitland Crescent and Maitland Place. Peninsular War In early 1812, The 1st Earl of Wellington began the campaign that resulted in his victory at the Battle of Salamanca on 22 July. To prevent Marshal Louis Gabriel Suchet from sending French reinforcements from the east coast of Spain, Wellington requested that Lord William Bentinck launch a diversionary operation using the British garrison of Sicily. At first Bentinck agreed to send 10,000 of his soldiers, but in March he reversed himself. After much persuasion, he allowed the operation to go forward and on 7 June he put 8,000 men aboard naval transports under the command of Maitland. The fickle Bentinck changed his mind again on 9 June, stopping the expedition. At last on 28 June Maitland sailed for Menorca. The fleet first picked up 6,000 Spanish troops at Menorca and landed on 31 July at Palamós, northeast of Barcelona. He wisely decided that Barcelona was too strong to attack, but he also refused to try to capture weakly held Tarragona. Maitland soon received news that Joseph O'Donnell's Army of Murcia had been routed at the Battle of Castalla on 21 July. Without the support of O'Donnell, Maitland decided he could not accomplish anything. He re-embarked his expeditionary force and sailed to Alicante instead, joining his troops with the garrison to form an army of 15,000 men. With the disaster at Salamanca, the French were forced to evacuate both Madrid in central Spain and Andalusia in the south. Their combined forces joined Suchet in the province of Valencia. About 80,000 French soldiers, Maitland declined to move from Alicante. Maitland asked to be relieved in September 1812 due to illness. Governor of Malta and of the Ionian Islands Maitland became Lieutenant-Governor of Portsmouth and General Officer Commanding South-West District in May 1813 and was then appointed as Governor of Malta on 23 July, when the island became a crown colony instead of a protectorate. The plague had broken out in Malta in March 1813 and the disease began to spread especially in Valletta and the Grand Harbour area. Maitland arrived on the island on 3 October 1813 and took his oath of office on 5 October. Once in post, he enforced stricter quarantine measures. The plague spread to Gozo by the following January, but the islands were free of the disease by March 1814. Overall, 4486 people were killed which amounted to 4% of the total population. It is thought that the outbreak would have been worse without Maitland's strict actions. After the eradication of the plague, Maitland made several reforms. He removed British troops from Lampedusa on 25 September 1814, ending the dispute that had started in 1800. On Malta, he was autocratic and he refused to form an advisory council made up of Maltese representatives, and so he was informally known as "King Tom". He formed the Malta Police Force in 1814, while the local Italian-speaking Università was dissolved in 1819. Various reforms were undertaken in taxation and the law courts as well. Maitland remained Governor until his death from apoplexy on 17 January 1824. He was attended on his death-bed by doctors Robert Grieves, Alexander Broadfoot and John Hennen. While he was Governor of Malta, Maitland also served as Lord High Commissioner of the Ionian Islands during 1815 to 1823, while the islands were a British protectorate. The seat of administration was at Corfu, where he was represented by Sir Frederick Hankey, his private secretary. The neoclassical Maitland Monument was built there in his honour in 1821. Citations See also Mount Lavinia Hotel Maitland Plan Law enforcement in Malta References Aves, Edward (2003) Sri Lanka. Bath, England: Footprint. . Elkins, Stanley M. and Eric McKitrick (1993) The Age of Federalism. New York: Oxford University Press. . James, C.L.R. (2001) The Black Jacobins: Toussaint L'Ouverture and the San Domingo Revolution. London: Penguin Books. . Seneviratne, Maureen (1995) The story of Mount Lavinia Hotel. Colombo, Sri Lanka: McCallum Publishers. . Further reading Dixon, Cyril Willis (1939) The Colonial Administrations of Sir Thomas Maitland Longmans, Green and Company, London, ; reprinted in 1968 by Cass, London, Hulugalle, H. A. J. (1963) "Sir Thomas Maitland (1805–1811)" British Governors of Ceylon Associated Newspapers of Ceylon, Colombo, Sri Lanka, pp. 18–25, External links The Louverture Project: Thomas Maitland – Thomas Maitland and the Haitian Revolution. |- |- |- |- 1760 births 1824 deaths Younger sons of earls Thomas British Army lieutenant generals 72nd Highlanders officers Royal Lincolnshire Regiment officers Wiltshire Regiment officers West India Regiment officers Members of the Parliament of Great Britain for Scottish constituencies British MPs 1790–1796 Members of the Parliament of the United Kingdom for Scottish constituencies UK MPs 1802–1806 UK MPs 1812–1818 Knights Grand Cross of the Order of the Bath British Army personnel of the French Revolutionary Wars British Army commanders of the Napoleonic Wars British Army personnel of the Peninsular War Members of the Privy Council of the United Kingdom Governors and Governors-General of Malta General Officers Commanding, Ceylon British people of the Greek War of Independence
The Vargas Diamond, discovered in Brazil on August 13, 1938 (July 1938 according to Ball & Kerr) by Joaquim Venancio Tiago and Manoel Miguel Domingues, was when pulled out of the ground. Twenty-nine smaller diamonds were carved from the larger rough Vargas Diamond including the emerald cut diamond named "President Vargas", after the former Brazilian President, Getúlio Vargas. The diamond has been in the possession of Harry Winston, a jeweler from New York. See also List of largest rough diamonds List of diamonds Further reading Esmaraldo Reis (1940) Three Large Brazilian Diamonds, pp.  2-3 Gemological Institute of America, USA, Vol. 3, No. 6 (Summer 1940) Shipley, Robert M. (1944) Gemological Digest: Additional Notes on the President Vargas Diamond, pp.  168-169 (PDF page 12–13) Gemological Institute of America, USA, Vol. 4, No. 11 (Fall 1944) References 1938 in Brazil Diamonds originating in Brazil Individual diamonds
Lyrical King (From the Boogie Down Bronx), from 1987, is the debut album of hip-hop emcee T La Rock. It was released after the EP He's Incredible, and none of the tracks from that record were on the original release of the album. Singles released were "Back to Burn," "Tudy Fruity Judy," "It's Time to Chill," and, in the UK, "Big Beat in London." Kurtis Mantronik produced several tracks, and Greg Nice of Nice & Smooth contributed human beat boxing. When the album was rereleased in digital form by Traffic Entertainment Group in 2006, two of the tracks from He's Incredible and two non-album tracks produced by Kurtis Mantronik were added. In addition, the Rick Rubin-produced classic "It's Yours," which was originally released on a different label, was also included because of its common ownership in the present day. Cover On the cover can be seen T La Rock wearing an Adidas Laser track top with the logo of the French Football Federation. Actually, T La Rock won this suit from a streetball game against Akhenaton, one of the emcees of the French hip hop group IAM, when the group came to New York City in 1986. Track listing Original 1987 album: Lyrical King Back to Burn Tudy Fruity Judy Having Fun Three Minutes of Beat Box Bust These Lyrics This Beat Kicks Big Beat in London It's Time to Chill Live Drummin' with the Country Boy 2006 additions: It's Yours (12-Inch Radio Mix) Breakdown (12-Inch Version) He's Incredible (12-Inch Version) Breaking Bells (12-Inch Version) Bass Machine (12-Inch Version) Additional personnel Editors: Chep Nuñez, Omar Santana, Carlos Barios Mastering engineer: Howie Weinberg Later samples Samples of "It's Yours" can be heard in the following songs and in countless others. "Paul Revere" by the Beastie Boys from the album "Licensed to Ill" "Louder Than a Bomb" by Public Enemy from the album It Takes a Nation of Millions to Hold Us Back "The World Is Yours" by Nas from the album Illmatic "Rewind" by Nas from the album Stillmatic "Fumbling Over Words That Rhyme" by Edan from the album Beauty and the Beat "Party People" and "Can You Party" by Royal House from its self-titled album "Interloper" by Slipknot from the album Slipknot References 1987 debut albums Fresh Records (US) albums East Coast hip hop albums Albums produced by Kurtis Mantronik
The Toy Symphony (full title: Cassation in G major for toys, 2 oboes, 2 horns, strings and continuo) is a musical work dating from the 1760s with parts for toy instruments, including toy trumpet, ratchet, bird calls (cuckoo, nightingale and quail), Mark tree, triangle, drum and glockenspiel. It has three movements and typically takes around seven minutes to perform. It was long reputed to be the work of Joseph Haydn, but later scholarship suggested that it was actually written by Leopold Mozart. Its authorship is still disputed, however, and other composers have been proposed as the symphony's true author, including Joseph Haydn's younger brother Michael Haydn, who purportedly contributed movements to the work. Recent research (published in 1996) on a newly found manuscript suggests the Austrian Benedictine monk (1740–1794) to be the author. If Angerer's manuscript (from 1765, entitled "Berchtolds-Gaden Musick") is the original, the Toy Symphony was originally written not in G but in C major. These findings, however, are disputed among scholars. There is reason to believe that the true composer will likely never be known, in whole or in part, given its confused origins and the paucity of related manuscript sources. Other Toy Symphonies The cassation described above was one of a number of anonymous toy symphonies composed at Berchtesgaden near Salzburg, then a manufacturing centre for toy instruments. Some of the instruments used for these can be seen in the Museum Carolino Augusteum in Salzburg. Other toy symphonies and overtures by named composers include: Felix Mendelssohn: Two Kindersymphonie (1827, 1828) Bernhard Romberg: Symphonie burlesque, 'Toy Symphony', op. 62 (first published 1852) Ignaz Lachner: Toy Symphony, op. 85 (circa 1850s) Carl Reinecke: Kinder-Symphonie, 'Toy Symphony', op.239 (1895). Emma Lomax: Toy Overture (1915) Malcolm Arnold: Toy Symphony, op. 62 (1957) Joseph Horovitz: Jubilee Toy Symphony (1977) Stephen Montague: A Toy Symphony, for six amateur performers and chamber orchestra (1999) Tod Machover: Toy Symphony (2002) Malcolm Arnold's Toy Symphony was first performed at a Savoy Hotel fund raising dinner in London on 28 November 1957, with toy instruments played by a group of eminent composers, musicians and personalities, including Thomas Armstrong, Edric Cundell, Gerard Hoffnung, Eileen Joyce, Steuart Wilson and Leslie Woodgate. Similarly, the Jubilee Toy Symphony by Joseph Horowitz was composed for the Silver Jubilee of Elizabeth II in 1977 and featured Dame Peggy Ashcroft, Richard Baker, Joseph Cooper, Humphrey Burton, James Blades, Fenella Fielding, Nigel Kennedy, Yehudi Menuhin, Steve Race and Malcolm Williamson, among others. Tod Machover's piece deploys custom musical toys as electronic controllers. References Notes Citations External links Compositions by Leopold Mozart Classical-period symphonies Children's music Compositions in G major Compositions with a spurious or doubtful attribution Toy instruments and noisemakers
X is the fourth studio album by Kristeen Young. It is themed around various reversals of, and thoughts on, the Ten Commandments. The album was produced by Tony Visconti and engineered by Mario J. McNulty at Studio B, Looking Glass Studios. It features "Baby" Jeff White on drums, David Matos on guitar and a duet with Placebo's Brian Molko on No Other God. Track listing "No Other God" (with Brian Molko)– 3:07 "Commit Adultery" – 3:11 "Kill It" – 4:02 "Lie" – 4:01 "Cold Steal" – 4:20 "Goddamn You, You Scenesters" – 3:34 "Yesterday's Future Man" – 4:03 "I Own The Best Of All Things" – 3:29 "My TV" – 4:00 "Devil Girl" – 4:55 "Credits" (read by David Matos) – 1:49 "No Other God' - 3:09 References Kristeen Young albums 2004 albums Albums produced by Tony Visconti
Sudbury/Coniston Airport is located adjacent to the community of Coniston in Greater Sudbury, Ontario, Canada. See also Greater Sudbury Airport Sudbury/Azilda Water Aerodrome Sudbury/Ramsey Lake Water Aerodrome References Registered aerodromes in Ontario Transport buildings and structures in Greater Sudbury
Enemies Closer is a 2013 American thriller film directed by Peter Hyams and starring Jean-Claude Van Damme, Tom Everett Scott, Orlando Jones and Linzey Cocker. In it, a former Navy SEAL is marked for death by the mourning brother of a comrade he left behind, only to have to team up with him when they both become targets of a deranged crime lord. It was Hyams' third directorial collaboration with Van Damme, following 1994's Timecop and 1995's Sudden Death, and the first of these to feature the actor in a villainous role. Plot A plane carrying 50 pounds of pure heroin in sealed packets crashes near the US-Canada border. Immigration and Customs Enforcement (ICE) officers prepare to search for the plane, but a group of criminals led by the unstable Xander (Van Damme) kill them and take the coordinates for the crash: a lake just off King's Island. On the island, ex-Navy SEAL Henry Taylor (Scott) works as a forest ranger. The only other permanent resident is Sanderson, an elderly hermit. While patrolling, Henry helps a woman named Kayla (Cocker), who invites him to dinner that night. That evening, a man named Clay (Jones) knocks on Henry's door, claiming to have lost his boat. Henry lets him in, but Clay pulls a gun on him. Clay's younger brother was Decker, a SEAL who was killed in action under Henry's command. Clay plans to kill Henry because he believes Henry abandoned Decker. Henry explains that he if he hadn't withdrawn the squad, all his men would have died, but Clay is unmoved. Clay bring Henry to a field and, holding him at gunpoint, gives him a pistol. Clay orders Henry to commit suicide. Henry refuses, explaining that he was suicidal for years after Decker's death, but with time he has accepted that it wasn't his fault. Clay prepares to kill Henry, but Xander and his men appear, posing as ICE agents. Henry sees through the ruse, warns Clay, and runs as Xander's men fire. Clay's return fire incapacitates the criminal team's diver. When Xander determines the diver can't dive, he kills him. Xander plans to force Henry, whom he knows from earlier research is a diver, to retrieve the sunken heroin. Clay agrees to work with Henry to escape. Because Henry's home phone was shot, they go to Sanderson's house but find no functioning phone there. The surprised Sanderson fires a warning shot when they enter, alerting the criminals. As Xander and his men surround the house, Sanderson begs Henry and Clay to escape while he holds them off. Henry refuses to leave Sanderson behind, to Clay's surprise. Sanderson nevertheless sacrifices himself to let the two escape. Henry, convinced that Xander will kill them both after getting the drugs, lays traps for Xander's men in the forest. Working together, Henry and Clay take out all of Xander's crew. Meanwhile, Kayla returns after Henry neglects to meet her again. Xander radios Henry and Clay, who have taken a walkie-talkie from one of the criminals, and tells them that he is now holding Kayla hostage. Kayla is gagged with duct tape on her mouth and held at knifepoint by Xander. She is later tied up at gunpoint whilst still being gagged with tape. Henry surrenders himself and agrees to dive for the drugs to save her. Once Xander and Henry are on the water, Clay saves Kayla, untying her and taking the tape off her mouth, only for her pull a gun on him. Kayla has been working with Xander as a honeypot. Clay turns the tables on Kayla and subdues her in a fight. Henry dives and retrieves the bag of heroin, but he also finds a Magpul ACR, a rifle that functions after being submerged. Henry brings Xander to shore at gunpoint and is confused to see Clay holding Kayla captive. Kayla cries for help; Clay warns Henry in vain of her duplicity and a battle follows. Xander takes advantage and knocks Henry's gun away. Kayla joins the fight to choke Henry but is no match for him, making a mortal mistake. In the ensuing scuffle, Xander stabs Clay in the leg and, frustrated by Kayla's ineffectiveness, snaps her neck. Xander and Henry eventually end up fighting on Xander's boat. During the fight the fuel tank springs a leak. Xander knocks Henry overboard, but Henry manages to grab a flare. On the water, he ignites the trail of gasoline, causing the boat to explode and killing Xander. Clay helps the exhausted Henry back to the shore. Cast Production Director Peter Hyams was offered the film by producer Moshe Diamant, and accepted it both as a show of friendship and as a stylistic exercise. Hyams is usually his own cinematographer, and a well known fan of night photography. With the movie's main sequence of events taking place entirely at night and close to water, two highly demanding filming conditions, he saw it as a stimulating challenge, especially given its independent budget and tight shooting schedule, which spanned a period of 27 days. Exteriors were filmed in Bulgaria, and interiors were filmed in Louisiana. Peter Hyams had helped cementing his son John's directing career by serving as his cinematographer on two Universal Soldier sequels produced by Diamant, and the younger Hyams returned the favor by editing this film for his father. Van Damme was initially going to play the main protagonist, but Hyams asked him to switch to the part of drug trafficker Xander, as he had already directed him twice in heroic roles and did not want to retread the same ground. The Belgian was not easily convinced, as he had just played the appropriately named Jean Vilain in The Expendables 2, and demanded his new role be fleshed out so as to differentiate it from the classic archetype he had portrayed in the earlier feature. With Enemies Closer set in the wilderness, the character was expanded to become a staunch ecologist and vegan, and Van Damme personnally devised the "Édith the Goose" monologue that appears midway into the film. Xander's distinctive wild hair was also the actor's idea. Tom Everett Scott, who took over Van Damme's intended part, is a longtime friend of John Hyams, with whom he attended Syracuse University. After Dark returnee Orlando Jones previously appeared in Peter Hyams' remake of Beyond a Reasonable Doubt. He also received a producer credit this time around. Release Theatrical Enemies Closer was released theatrically in select U.S. markets by Lionsgate on January, 24 2014. It also saw a theatrical release in the United Arab Emirates in October 2014, where it reached 7th place at the box office. Home video Enemies Closer premiered on DVD and Blu-ray in France via the distribution arm of national broadcaster France Télévisions on December 4, 2013. The film received its domestic home video release through Lionsgate on March 11, 2014. In the United Kingdom, the film was released by Starz Media under its Anchor Bay Entertainment imprint on July 21, 2014. Reception The film received mostly positive reviews. Rotten Tomatoes gave the movie a score of 79% based on 14 reviews, with an average rating of 5.71/10 with no consensus as of yet. Metacritic gave the film a weighted average score of 49 out of 100, based on 9 reviews, indicating mixed or average reviews. Neil Glenzinger of the New York Times found that the collision of the three main characters was "a ridiculous coincidence", but commended Hyams for "[keeping] things moving briskly, building up to an ending with a pretty good plot twist". Scott Foundas of the Chicago Tribune praised the film's multiple narrative threads, although he found it "[to lack] the shrewd, self-aware qualities of Van Damme's recent JCVD and Universal Soldier: Day of Reckoning". He also enjoyed the "crisp, sleek, professional sheen" brought by Hyams, with a special mention for his night photography. James Marsh of ScreenAnarchy thought that Enemies Closer did not entirely build upon its "intriguing" premise, due to its more urgent preoccupation with showcasing Van Damme, and a reliance on periodic bouts of exposition-heavy dialogue. He still decreed that "it ticks enough of the right boxes to entertain its intended audience". Conversely, Gabe Toro of IndieWire deemed that the subplot involving Scott and Jones did not work, and that the film only found its footing when it focused on the Van Damme character. He gave the film a C rating. Andrew Pollard of British magazine Starburst called the film "a fun, if predictable, actioner" and gave it a 6 out of 10. Matt Zoller Seitz of RogerEbert.com judged that the film "does not rise to the level of [the Hyamses]' best work" but noted "at least two setpieces that are keepers". He gave the film two and a half stars out of four. Most reviewers singled out Van Damme's flamboyant performance as Xander, with Glenzinger pointing that "he seems to be having a great time" and Pollard hailing his performance as "brilliantly loony". Toro was particularly effusive, calling Van Damme "an arresting presence in his old age" and his performance "a wonder" which, like his turn in the fourth Universal Soldier film, contained shades of Apocalypse Now'''s Colonel Kurtz. Annlee Ellingson of the Los Angeles Times'', however, was not impressed with "the eccentricities of Van Damme's character", and did not find them worthy of taking precedence over his martial arts skills. Scott's performance as a former Navy SEAL was widely viewed as unconvincing. Ellington labelled him as "terribly miscast". Pollard wrote that "it’s hard to really buy into [him] as an action-type of guy", while Toro found him to have "limited charisma" and criticized his reliance on a stunt double. Zoller Seitz was more positive, saying that he and Jones "play their roles earnestly" and "never seem overmatched." Soundtrack The film's score was composed by Tony Morales, a former collaborator of Hyams' frequent composer John Debney. It was released digitally by Lakeshore Records on 25 February 2014. References External links 2013 films 2013 action thriller films American action thriller films 2010s English-language films Films about drugs Films directed by Peter Hyams Films shot in Bulgaria IM Global films Lionsgate films 2010s American films
A tai-pan is a foreign-born senior business executive or entrepreneur operating in China or Hong Kong. A taipan is an Australian venomous snake. Taipan or Tai-Pan may also refer to: Arts, entertainment, and media Steel Taipan, a steel roller coaster at Dreamworld Tai-Pan (novel), a 1966 novel by James Clavell Tai-Pan (film), a 1986 film based on Clavell's novel "Taipan", a song from the album Circus Animals (1982) by the Australian band Cold Chisel Taipan, the new name for the Thrillseeker (roller coaster) Taipan!, a computer game for the Apple II and TRS-80 "The Taipan", a 1922 short story by W. Somerset Maugham Ships HMAS Taipan, a Second World War Royal Australian Navy auxiliary vessel MV Taipan, a container ship freed in the action of 5 April 2010 from Somali pirates Taipan 28, a sailing yacht or sloop Taipan Catamarans, high performance sailing catamarans made in Australia Other uses Albert Cheng, a radio commentator-turned-politician in Hong Kong also known as Tai-pan Cairns Taipans, an Australasian National Basketball League team MRH-90 Taipan, Australian Defence Force name for the NH90 helicopter Taipan, alternative name for the mythical Australian Aboriginal creator-being, the Rainbow Serpent Taipan Business Centre, a commercial hub of UEP Subang Jaya, Malaysia TAIPAN galaxy survey (originally "Transforming Astronomical Imaging surveys through Polychromatic Analysis of Nebulae"), a large-scale spectroscopic survey underway at the UK Schmidt Telescope zh:大班
See also Lists of fossiliferous stratigraphic units in Europe References Netherlands Geology of the Netherlands Fossiliferous stratigraphic units
Paenalcaligenes is a genus of bacteria from the family of Alcaligenaceae.'' References Further reading Burkholderiales Bacteria genera
Legislative elections were held in El Salvador on 12 March 1978. The elections were boycotted by all but one of the opposition parties, resulting in an easy victory for the ruling National Conciliation Party, which won 50 of the 54 seats. Results References Bibliography Political Handbook of the world, 1978. New York, 1979. Anderson, Thomas P. 1988. Politics in Central America: Guatemala, El Salvador, Honduras, and Nicaragua. New York: Praeger. Revised edition. Herman, Edward S. and Frank Brodhead. 1984. Demonstration elections: U.S.-staged elections in the Dominican Republic, Vietnam, and El Salvador. Boston: South End Press. Montgomery, Tommie Sue. 1995. Revolution in El Salvador: from civil strife to civil peace. Boulder: Westview. Webre, Stephen. 1979. José Napoleón Duarte and the Christian Democratic Party in Salvadoran Politics 1960-1972. Baton Rouge: Louisiana State University Press. Legislative elections in El Salvador Legislative El Salvador Election and referendum articles with incomplete results
Amador Lugo Guadarrama (April 12, 1921 – June 26, 2002) was a Mexican painter, graphic artist, writer and cultural promoter, best known for his landscape painting and the founding of several cultural institutions. He began painting when still a child, attending the Escuela al Aire Libre de Pintura in Taxco then developing his career in Mexico City. At that time, the Mexican muralism school was still dominant. Lugo related to its aesthetics but not so much to its politics, so he participated in the founding of various institutions such as the Sociedad Mexicana de Grabadores and the Salón de la Plástica Mexicana which provided opportunities for artists outside the dominant movement. He also worked as an educator, writer and cultural promoter, mostly in Mexico City and his home state of Guerrero. Life Amador Lugo Guadarrama was born in the village of Santa Rosa, located in the municipality of Taxco in Guerrero, Mexico to Carlos Lugo Hernández and María Guadarrama Viveros. The area was rural with the village about ten kilometers from the town proper. Lugo stated in an interview that there was almost nothing in the village educationally or culturally, only attending primary school there. In the early 1930s, he went to Taxco to live after his second year of primary school. There he found a much larger world with ideas and knowledge that did not exist in his village, even though at the time Taxco had only 5,000 residents. Taxco also gave him his first contact with painting at the Escuela al Aire Libre de Pintura, run by Japanese artist Tamaji Kitagawa. This school was a satellite school promoted from Mexico City into the provinces. The school's purpose was to break from the rigidity of the traditional academies, and to promote more art for the masses. In 1934, he had his first exhibition sponsored by the school which took place in Mexico City. In the late 1930s, Kitagawa returned to Mexico City and the school's focus changed along with its leadership. These changes did not agree with Lugo. A friend suggested that he also move to Mexico City, promising to help him make contacts. Lugo arrived to the city in 1942 with only thirty pesos and a contact with gallery owner Inés Amor. She eventually helped him to get work at the Escuela de Pintura al Aire Libre in Mexico City to make ends meet. In 1942, he entered the Escuela Nacional de Artes del Libro, to study engraving with Carlos Alvarado Lang . In 1943, he entered the Escuela Normal Superior to become certified as an art teacher. From 1943 to 1945, he also studied clay sculpture at the Academy of San Carlos . He had a career as a cultural promoter and writer even though he was to a certain extent quiet and reserved, speaking little socially. In 1952, he married María de los Angeles Trejo. During his life he traveled, first to Guatemala, Honduras and Peru in 1964, then to Europe (France, Italy, England, Switzerland, Germany and Spain) in 1979 and then to Cuba in 1980. In 1983, he was invited by the Japan Foundation to visit various cities in Japan. Near the end of his life, he donated a large number of his works to his home state, many of which depicted scenes from that area. Amador Lugo died in Mexico City on June 26, 2002 at the age of 81. Career Amador Lugo became one of the few students at the Escuela de Aire Libre de Pintura in Taxco to work as an artist professionally, with a career that spanned over 65 years. Although is best known as a landscape painter, was also a master engraver, as well as writer and cultural promoter. He participated in about 350 individual and collective exhibitions in both Mexico and abroad. attracting the attention of critics such as Jorge Juan Crespo de la Serna, Enrique F. Gual, Margarita Nelken, Antonio Rodríguez, Raquel Tibol and Teresa del Conde. Most of his individual exhibitions were related to the Salón de la Plástica Mexicana including his first in 1950 and others in 1952, 1966, 1972, 1982 and 1997. Other individual exhibitions of his work include a 1972 show at the Foro de Artesanias in Taxco, and a homage held at the Galería Taxco in 1983. In 1948 the Instituto Nacional de Bellas Artes (INBA) acquired twenty one of his works and in 2008, a work called Región fantástica (1978), became part of the exhibition called La invención de lo cotidiario at MUNAL . In 1983 a Veracruz landscape won first prize from the faculty of fine arts of the Universidad Veracruzana. In 2002, shortly before his death, he participated in an event to honor the founders of the Salón de la Plástica Mexicana and in the same year after his death, the Centro Cultural Taxco-Borda held an event to honor him. Lugo's published writings include presentations of artists, catalog descriptions, conference papers and articles in newspapers and magazines from 1959 to 1983, writing on topics such as art education, pre-Columbian art and colonial era art. His writing gave him visibility through the press and in art catalogs, participating in conferences and seminars to discuss the works of his colleagues. In 1957 he participated in the creation of the book La ciudad de México vista por cinco pintores by the Sociedad Mexicana de Grabadores. In 1976 he collaborated with photographs and drawings for the book Arte Integral Uno. He art education career began in 1948 at the Escuela Nacional de Artes Gráficas. He also taught at the Escuela Nacional de Educadores and worked as a supervisor of art education with INBA. In 1955, he was a member of the executive committee of the Sindicato Nacional de Trabajadores en Educación, a teachers’ union. When Lugo arrived to Mexico City in the 1940s, the Mexican muralism movement with artists such as Diego Rivera, David Alfaro Siqueiros and Leopoldo Méndez dominated the art scene, closing opportunity to many younger artists, Lugo included. Lugo identified with the aesthetics of the movement but not such much its political bent. In graphics Lugo respected the dominant artists in Mexico, especially those of the Taller de Gráfica Popular but did not join. Instead, he helped to found new organization called the Sociedad Mexicana de Grabadores in 1947. This group explored topics outside politics without excluding it. He also helped to found new organizations to promote new artists such as the Sociedad para el Impulso de las Artes Plásticas (1948), the Frente Nacional de Artes Plásticas (1952) and the Salón de la Plástica Mexicana (1949). He was very active with the last organization, serving as a judge in various events and serving on the board various times, the last term being from 1976 to 1979. His cultural promotion activities were done in his home state of Guerrero and in Mexico City. He taught classes at his home in Guerrero and participated in primary school education activities there. In 1980, he began a radio program called La hora de bellas artes sponsored by INBA. The goal was to get youth interested in music and the culture of Mexico broadcasting alternatively in Taxco and Mexico City. In 1983 he became a member of the Feria Nacional de la Plata in Guerrero to promote that state's silver smithing industry. Artistry This aesthetic sense was set in his youth, as he learned to paint as a child from Kitigawa, whose influence remained evident in Lugo's creation through his career, especially in the depictions of nature. His early work, in which dominated scenes of everyday life such as rural markets, women with rebozos and farm workers, have a childlike quality, which also appears in some of his later work. Lugo stated in an interview that “art is the feeling and the possibility to express and idea; to express something that a human being needs to give to posterity, some that that come, in reality, from deep inside.” His work does not contain bright colors, those that impact, but rather look to depict the colors of reality. But he avoided dark colors and shadows as these depict sadness. When Lugo began his career, the Mexican muralism school was still very dominant in the country. He identified with much of the aesthetics of the muralism school but not its politics. Lugo's work was mostly on canvas, although he also did graphic art and even a natural stone mural for his house in Taxco with a mining theme. He is best known for his landscape paintings, mostly focusing on scenes from the Mexico City area, the town of Taxco and rural areas in Guerrero. His landscapes show influence from Eugenio Landecio, José María Velasco and Dr. Atl along with Manuel Echauri, Angelina Beloff, Luis Nishizawa and Raúl Anguiano. He began with rural scenes around his home in Taxco. In the 1940s, he began to depict scenes in the Mexico City areas, adapting what he did for landscapes of rural Guerrero to that major urban center. During this period as well his language and techniques matured, deciding that cities have their own kind of beauty; however, he never stopped painting rural areas. References 1921 births 2002 deaths Mexican landscape painters Artists from Guerrero Writers from Guerrero 20th-century engravers 21st-century engravers 20th-century Mexican painters Mexican male painters 21st-century Mexican painters 20th-century Mexican male artists 21st-century Mexican male artists
Shi Jintong (; born May 1979) is a Chinese politician of Miao ethnicity, currently serving as deputy townhead of Shuanglong Town and party secretary of Shibadong Village. He is a representative of the 20th National Congress of the Chinese Communist Party and an alternate member of the 20th Central Committee of the Chinese Communist Party. Biography A native of the Shibadong Village of Shuanglong Town in Huayuan County, Hunan, Shi joined the Chinese Communist Party (CCP) in June 2001, and was proposed as director of his home-village in August 2005 and rose to become deputy townhead of his home-town in May 2017. Shi is a supporter of Xi Jinping, general secretary of the CCP Central Committee, who inspected the village to propose the policy of "Targeted Poverty Alleviation" for the first time. Shibadong Village became a testing ground for the new initiative in since Xi's investigation. References 1979 births Living people Miao people People from Huayuan County People's Republic of China politicians from Hunan Chinese Communist Party politicians from Hunan Alternate members of the 20th Central Committee of the Chinese Communist Party
Jim Amaral (born 3 March 1933) is an American-born Colombian artist known for his drawings and bronze sculptures. Over a career that spans more than half a century, Amaral has also been dedicated to painting, etchings, collages, furniture design, assemblages/objects, and artist’s books. The artist has been widely recognized for his draughtsmanship, the subtlety and refinement of his technique as well as his imaginative and cultured universe. As a constant experimenter, Amaral has developed a unique aesthetics and symbolism and therefore has never belonged to any style or movement in particular. However, his work has been linked, for example, to surrealism and ancient Greece (sculpture). His art is deeply rooted in the psychological realms of the human existence. Amaral has always been focused on the condition of the human being, especially the topic of death and the passing time. "I am only trying to understand the world, to live through my painting. I am trying to understand certain mysteries, such as the energies of life and death, the loneliness of a man (...) I paint what people can reflect upon, so that what stays with the spectator is not only the visual impact". For the years 2013-2014 he was chosen as the author of the graphic imagery for the VIII Cartagena International Music Festival in Cartagena, Colombia, organised by The Salvi Foundation. His large scale bronze sculptures are located outdoors in different sites in Bogotá, Colombia, such as in the garden of The National Museum and, since 1996, at the entrance to the Bolsa de Valores de Colombia BVC on Carrera Séptima (3 bronze sculptures Women with wheels, 1994). In 2013 the artist published a calendar called Aguas Turbias with a collection of 14 drawings from a series with the same title. Biography and education Amaral was born in 1933 in Pleasanton, California, USA. His father was Portuguese and his mother was American of Italian descent. Amaral grew up in a rural environment in Pleasanton and remembers that period as "living in an interior exile". As a teenager he wrote poetry, which has always been his great source of inspiration. And years later it turned out to be vice versa - because of the lyrical aspect of Amaral's sculptures, drawings, oil paintings and graphic works, these have become illustrations for poems by such poets as Edoardo Sanguineti or Armando Rojas Guardia.After two years at the University of Washington, Seattle (1952–53) where he studied, among other subjects, history of art and architecture, Amaral finally decided for a career in the arts at the Stanford University and in 1954 graduated with a title Bachelor of Arts. "When I abandoned United States I realized that art is my only option, the only place where I am not a foreigner". He continued postgraduate studies at the Cranbrook Academy of Art in Bloomfield Hills, Michigan (1954-1955), where he met Colombian visual artist and future wife Olga de Amaral (got married in Colombia in December 1957). Before moving to Bogotá in 1958, Amaral spent two years (1955–57) in the Philippine Islands with the U.S. Navy (obligatory military service). In Bogotá, Amaral started working with a furniture and interior design company. Soon his son was born and Amaral decided to become a full-time artist and began casting bronze sculptures, making collages and abstract drawings. In 1960 his daughter was born. From 1966 to 1967 the Amaral family moved temporarily to New York. In 1967, after coming back to Colombia, Amaral traveled to the US again to teach drawing at the Penland School of the Arts and Crafts in North Carolina. In the same year he also started teaching drawing at the Universidad Jorge Tadeo Lozano in Bogotá. In the years 1970-1972 the Amaral family traveled around Europe, settling down for a longer period in Paris, where in the fall of 1971, at the Albert Loeb gallery, Amaral showed his work for the first time in Europe. The exhibition brought him great critical acclaim. He traveled to Paris again for longer periods in the years 1974-1975 and 1979-1980. In 1989 Amaral taught drawing at the University of California, Los Angeles (UCLA). Currently he lives with his wife in Bogotá and works in Casa Amaral. Works Early career in the 1960s and 1970s In his first solo show in 1962 at the Vorpal Gallery in San Francisco, Amaral exhibited small ink drawings humorously depicting erotic themes. This exhibition was important in the cultural context of the values change in the US, the transition from the beatniks to the hippies, which favoured a new attitude towards sex. The 1960s were also a period of great unrest and Amaral himself suffered an episode of depression in that time. A psychoanalytic treatment resulted in a series of "psychological" drawings that the artist considers as skill exercises and a result of the atmosphere of the time. In 1964, Amaral had his first solo show in Colombia, in Galería El Callejón, where he exhibited drawings, collages and oil paintings. Toward the end of the sixties, Amaral worked increasingly with erotic themes and in 1970 participated in a group exhibition entitled El erotismo en el arte at the Galería Belarca in Bogotá. In 1972 at the same gallery, he showed drawings in a new technique that he started to develop earlier in Paris - a mix of pencil and watercolour on paper treated previously with gesso. During the 1970s Amaral exhibited in France, Italy, Sweden, Germany, and Belgium. During his Parisian period, Amaral found an intellectual affinity with the milieu of the time as well as a popular audience which brought him critical acclaim by authors like Jacques Leenhardt and José Pierre. His drawings from the 1970s often treat subjects in an erotic and sensual manner with a realistic style. "I hear people saying that my artworks are erotic. I don't think so. But then I am surprised - almost confused - when I see how annoyed people get when they see a penis". He typically depicts fragmented body parts, human sexual organs, flowers that bloom lips or ears as petals, and biomorphic beings. Invisible Flowers is one of his most remarkable creations from this period. The title alludes to Invisible Cities, written by Italo Calvino, a friend of the artist during his years in Paris. His work from this period also comes in the form of collages and assemblages with antique boxes, old photographs, antique books, and antique colonial furniture. The surrealist roots of these creations are evident. Painting in the 1980s In 1980 Amaral returned to Bogotá. In the following two decades he worked with oil and acrylic paint, rendering meditative compositions with shadowed and earthy palettes. His finesse finds expression in this medium as well. Amongst them, a series titled Mourning Fruit, characterized by various arrangements of dried and mummified fruits placed on intricate varieties of patterned surfaces with celestial bodies hanging somberly or luminously in the sky. "My paintings are dense, they have layers and layers of acrylic paint; thus, as I saturate the space, the possibility of the void expands (...) The fruit is a contradiction, because although itself it means life, at the same time it is dry, soft or stony, that is to say, lonely". In the tradition of vanitas and memento mori, with these paintings the artist reflects on death, decay and the passage of time. Sculpture in the 1990s In his early career, looking for identity as an artist, Amaral experimented with visual arts branches and techniques. In 1959 he started making his first sculptures and casting them at Gerardo Benítez Foundry, the only casting site in Bogotá at the time. But the process and the effects were very disappointing for the artist and because of those technical difficulties he soon left sculpture for collages and drawing. Again, in 1989, on a trip accompanying his wife Olga de Amaral to an exhibition site in Santa Fe, New Mexico, USA, the artist discovered Shidoni Foundry, where he was able to cast his visually recognizable three-dimensional creations. His cire-perdue bronzes from this period are characterized by mythological themes, metamorphosis, death, the human condition and the mysteries of the cosmos. "I've been asking myself insistently and for many years how it is to die. To leave one darkness in order to enter another semidarkness, the one that belongs to death. A lot of this is embodied in my sculptures and that's why this question upsets me profoundly. No one has ever seen this in my creations and it might not even be like this, but in this journey between the two darknesses I put all my effort". Often his figures are depicted with small heads, absent facial features, and gender ambiguities. The sensuality that characterized his earlier two-dimensional creations takes on new veneers in the textures and refined patinas of his bronzes, in which he also explores solidity and monumentality. Eduardo Serrano speaks of the creatures rendered in these bronzes as expectant and concerned for the future with “composed anxiety.” William Ospina in his literary and poetic essay, points the irony in Amaral's bronze sculptures from the 90s. Cuerpos pintados In 2003 a Chilean photographer Roberto Edwards invited Jim Amaral to participate in his non-profit project Taller experimental. Cuerpos pintados (painted bodies). Amaral decided to work with midgets from the community of Santiago de Chile. The artist painted the bodies of his models and characterised them as if they were angels, demons and cupids spreading love. In another, later series, he transformed them in live versions of some of his sculptures. The project had as its aim a wider recognition of a human body and appreciation for its diversity. Recent work As a mature artist Amaral has focused on the creation of watercolor and ink drawings, artist's books, and an array of single-edition bronze sculptures. His bronzes have, in recent years, made a departure from human and animal figures towards desolate geometrical landscapes, ashen carts, and timeless machines that appear simultaneously futuristic and archaic, caught in a time beyond death. Mute and undecipherable, these artefacts inhabit a dimension where movement, time and sound disobey the laws of reality as we know them. Planes shift, cubes resonate, wheels spin, and spheres revolve. With these vehicles, these worlds, at once static and fluid, Amaral questions the preconceptions often imposed upon art and the determinism of science, reminding the spectator that our lives are bound inevitably by the dark mystery of existence. Exhibitions Selected solo 2016 Chariots of Humankind. Galerie Agnes Mosplaisir, Paris, France. 2015 Tiempos del nunca, Galería La Cometa, Bogotá, Colombia. 2014 La oreja pasiva y otras fabulas, Museo de Arte Moderno de Cartagena, Colombia. 2011 Islas Imaginarias, Cámara de Comercio de Bogotá, Bogotá, Colombia. 2009 Presencia, Centro Cultural Corp Banca, Caracas, Venezuela. 2008 Meridianos, Galería La Cometa, Bogotá, Colombia. 2007 Medusas, Casa Amaral, Bogota, Colombia. 2004 Trans/figuraciones 1960-2004, Retrospective exhibition curated by Jose Roca, Biblioteca Luis Ángel Arango, Banco de la República, Bogotá, Colombia. 2002 No-men: bronzes, Peyton Wright Gallery, Santa Fe, New Mexico, USA. 2000 New Sculpture, Peyton Wright Gallery, Santa Fe, New Mexico, USA. 1998 Monólogos, Galería Uno, Caracas, Venezuela. 1993 Galeria der Brücke, Buenos Aires, Argentina. 1992 New Bronzes, Shidoni Contemporary Gallery, May to June, Tesuque, New Mexico, USA. 1991 Soliloquies, Sculptures, Shidoni Contemporary Gallery, Santa Fe, New Mexico, USA. 1988 Pinturas y Mesas, Galería Garcés Velásquez, Bogotá, Colombia. 1983 Metamorfosis (a retrospective exhibition), Museo de Arte Moderno, Bogotá, Colombia.; J.Amaral: La vida es una transformación transitoria, XVII São Paulo Biennale, São Paulo, Brazil. 1980 Floralies, Galerie Albert Loeb, Paris, France. 1979 Pitture di Jim Amaral, Galleria del naviglio, Milan, Italy. 1978 Amaral, Galerie Levy, Hamburg, Germany. 1977 Galerie Octave Negru, Paris, France. 1976 Amaral: Landscape of an absent finger, Galería Belarca, Bogotá, Colombia. 1975 Galeria Belarca, Bogota, Colombia. 1974 Amaral: Oeuvres Recentes, Galerie Albert Loeb, Paris, France. 1973 Galerie Albert Loeb, Paris, France. 1971 Amaral, Galerie Albert Loeb, Paris, France. 1969-1970 Jim Amaral: dibujos a lápiz, Galería Buchholz, Bogota, Colombia. 1968 Jim Amaral: Drawings in the Graphics Corridor, Arleigh Gallery, San Francisco, California, USA. 1966 Jim and Olga Amaral, Museo de Bellas Artes, Caracas, Venezuela; Galería Colseguros, Bogotá, Colombia. 1964 Jim Amaral: Dibujos, Collages, Oleos, Galería El Callejón, Bogotá, Colombia. 1962 Vorpal Gallery, San Francisco, California, USA. Selected group 2014 Paper Trail, Latin American Masters Gallery, Los Angeles, CA, USA. 2012-13 Inmigrantes: Artistas, arquitectos, fotografos, criticos y galeristas en el Arte Colombiano 1930-1970, travelling exhibition Fundación Gilberto Alzate, Museo de Bogota, Biblioteca Luis Angel Arango, Bogotá, Colombia. 2012 Grandes maestros, Galería El Museo, Bogotá, Colombia. 2007 Formas Divergentes: una mirada a la escultura colombiana de entre-siglos, Montealegre Galería de Arte, Bogota, Colombia. 2003 Microcosmos (sculptures), Galería Galena, Bogotá, Colombia. 2002 Art Miami, Miami, Florida with Juan Ruiz Gallery, Maracaibo, Venezuela; Homage to New York, Galeria La Cometa, Bogotá, Colombia. 2001 La Bandera: Exposición Homenaje, Galeria La Cometa, Bogota, Colombia; Art Palm Beach, Palm Beach, Florida, USA with Galeria El Museo, Bogotá, Colombia; Chicago International Art Fair, Chicago, Illinois, USA with Galeria El Museo, Bogotá, Colombia; Toronto Art Fair, Toronto, Canada with Galeria El Museo, Bogotá, Colombia. 2000 San Francisco International Art Fair, San Francisco, California, USA with Galeria El Museo, Bogotá, Colombia. 1998 The Homecoming: Jim Amaral New Sculpture and Jeff Bertoncino New Paintings, Peyton Wright Gallery, Santa Fe, New Mexico, USA. 1996 V Feria Iberoamericana de arte FIA'96, Caracas, Venezuela with Galeria El Museo, Bogotá, Colombia. 1994 Latin American Artists, Lowe Museum, Miami, USA. 1993 Colombian Sculpture I, Colombian Center, New York, NY, USA.. 1991 Masters of Painting, Permanent Mission of Colombia to the United Nations, Colombian Center, New York, NY, USA. 1990 Grandes Obras-Grandes maestros, Galeria El Museo, Bogotá, Colombia. 1989 Feria Internacional de Arte Contemporáneo ARCO ’89, Galeria El Museo, Madrid, Spain; Donation Daniel Cordier, Centre Pompidou, Paris, France; Museo de Arte Moderno de Bogotá, Bogotá, Colombia. 1987 Tres Decadas de Maestros 1960-1980, Galeria Diners, Bogotá, Colombia. 1986 Cien años de arte en Colombia, Museo de Arte Moderno, Bogotá, Colombia.; Palacio Imperial, Rio de Janeiro, Brazil.; Centro Cultural Paulista, São Paulo, Brazil.; Centro Cultural Italo-Latinoamericano, Rome, Italy. 1979 Musee d’Art Moderne, Atelier Lacouriere & Frelaut, Paris, France. 1978 Drawn and Matched, Museum of Modern Art, New York, New York, USA.; Galerie Sylvie Bourdon, Paris, France. 1976 Galerie Maia, Bruxelles, Belgium. 1975 XXII Biennale Internazionale d’arte: Aspetti dell arte fantastica oggi, Florence, Italy. 1973 32 artistas colombianos de hoy, Museo de Arte Moderno, Bogotá, Colombia. 1972 Galerie Alfonse Chave, Vence, France.; Galerie Maia, Bruxelles, Belgium.; Art Basel, Galerie Albert Loeb, Basel, Switzerland. 1968 Eve Goldschmidt Gallery, New York, NY, USA. Collections Centre Pompidou, Paris, France. Museum of Modern Art, New York, New York, USA. Museo de Bellas Artes, Caracas, Venezuela. Banco de la República, Bogotá, Colombia. Museo de Arte Moderno, Bogotá, Colombia. Museo de Arte Contemporáneo, Bogota, Colombia. Museo Nacional, Bogota, Colombia. Museo Universidad Nacional, Bogotá, Colombia. La Tertulia Museum, Cali, Colombia. Notes External links Chariots of Humankind (2016), exhibition review on artnet.com Taller experimental Cuerpos Pintados Jim Amaral in Galerie Agnes Monsplaisir. Individual exhibition "Tiempos del Nunca" on youtube.com Jim Amaral on artsy.net Jim Amaral's official FB page. Jim Amaral on pinterest.com 1933 births Colombian painters Colombian male painters Living people Modern painters Modern sculptors 20th-century Colombian sculptors American people of Italian descent American people of Portuguese descent American emigrants to Colombia Colombian people of American descent Colombian people of Italian descent Colombian people of Portuguese descent Stanford University alumni Academic staff of Jorge Tadeo Lozano University University of California, Los Angeles faculty People from Pleasanton, California Artists from Bogotá
```javascript (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.multiplexingMode = function(outer /*, others */) { // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects var others = Array.prototype.slice.call(arguments, 1); var n_others = others.length; function indexOf(string, pattern, from) { if (typeof pattern == "string") return string.indexOf(pattern, from); var m = pattern.exec(from ? string.slice(from) : string); return m ? m.index + from : -1; } return { startState: function() { return { outer: CodeMirror.startState(outer), innerActive: null, inner: null }; }, copyState: function(state) { return { outer: CodeMirror.copyState(outer, state.outer), innerActive: state.innerActive, inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner) }; }, token: function(stream, state) { if (!state.innerActive) { var cutOff = Infinity, oldContent = stream.string; for (var i = 0; i < n_others; ++i) { var other = others[i]; var found = indexOf(oldContent, other.open, stream.pos); if (found == stream.pos) { stream.match(other.open); state.innerActive = other; state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0); return other.delimStyle; } else if (found != -1 && found < cutOff) { cutOff = found; } } if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff); var outerToken = outer.token(stream, state.outer); if (cutOff != Infinity) stream.string = oldContent; return outerToken; } else { var curInner = state.innerActive, oldContent = stream.string; if (!curInner.close && stream.sol()) { state.innerActive = state.inner = null; return this.token(stream, state); } var found = curInner.close ? indexOf(oldContent, curInner.close, stream.pos) : -1; if (found == stream.pos) { stream.match(curInner.close); state.innerActive = state.inner = null; return curInner.delimStyle; } if (found > -1) stream.string = oldContent.slice(0, found); var innerToken = curInner.mode.token(stream, state.inner); if (found > -1) stream.string = oldContent; if (curInner.innerStyle) { if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle; else innerToken = curInner.innerStyle; } return innerToken; } }, indent: function(state, textAfter) { var mode = state.innerActive ? state.innerActive.mode : outer; if (!mode.indent) return CodeMirror.Pass; return mode.indent(state.innerActive ? state.inner : state.outer, textAfter); }, blankLine: function(state) { var mode = state.innerActive ? state.innerActive.mode : outer; if (mode.blankLine) { mode.blankLine(state.innerActive ? state.inner : state.outer); } if (!state.innerActive) { for (var i = 0; i < n_others; ++i) { var other = others[i]; if (other.open === "\n") { state.innerActive = other; state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0); } } } else if (state.innerActive.close === "\n") { state.innerActive = state.inner = null; } }, electricChars: outer.electricChars, innerMode: function(state) { return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer}; } }; }; }); ```
Kim Fu (born 1987) is a Canadian-born writer, living in Seattle, Washington. She was born in Vancouver, British Columbia to immigrant parents from Hong Kong, Fu studied creative writing at the University of British Columbia. Her first novel For Today I Am a Boy won the Edmund White Award for Debut Fiction and was a finalist for the PEN/Hemingway Award. It was also a New York Times Book Review Editors' Choice and long-listed for CBC's Canada Reads. Fu's debut poetry collection How Festive the Ambulance received a starred review from Publishers Weekly, and includes a 2017 National Magazine Awards Silver Medal winner and a Best Canadian Poetry 2016 selection. Fu's writing has appeared in Granta, the Atlantic, the New York Times, Hazlitt, and the Times Literary Supplement. She has received residency fellowships from the Ucross Foundation, Berton House, Wildacres, and the Wallace Stegner Grant for the Arts. Her second novel, The Lost Girls of Camp Forevermore, was published in 2018. Her short story collection Lesser Known Monsters of the 21st Century was published in 2022. Published works References External links 1987 births Canadian women novelists Canadian women poets Novelists from Vancouver Poets from Vancouver University of British Columbia alumni 21st-century Canadian novelists 21st-century Canadian poets Canadian writers of Asian descent Living people Canadian people of Hong Kong descent 21st-century Canadian women writers 21st-century Canadian essayists Canadian women essayists
The 1927 Army Cadets football team represented the United States Military Academy in the 1927 college football season. In their second season under head coach Biff Jones, the Cadets compiled a 9–1 record, shut out six of their ten opponents, and outscored all opponents by a combined total of 197 to 37. In the annual Army–Navy Game, the Cadets defeated the Midshipmen The team's only loss came to national champion Yale by a 10 to 6 score. The team was ranked No. 6 in the nation in the Dickinson System ratings released in December 1927. Four Army players were recognized on the All-America team. Halfback Red Cagle was a consensus first-team honoree and was later inducted into the College Football Hall of Fame. Tackle Bud Sprague was selected as a first-team honoree by the Associated Press (AP), the International News Service (INS), and the Central Press Association (CP). End Charles Born was selected as a second-team honoree by the United Press (UP), Hearst newspapers, New York Sun, and Billy Evans. Tackle George Perry was selected as a first-team honoree by the New York Sun. Schedule Players The following players won varsity letters for their participation on the 1927 Army football team. Charles Born - end Samuel Brentnall - end Red Cagle - back (College Football Hall of Fame) Paul Elias Herbert Gibner William Evens Hall - center Louis A. Hammack - guard Norris B. Harbold - end Charles I. Humber Richard C. Hutchinson Arthur W. Meehan - back John H. Murrell - back William L. Nave Howard E. Pearson - center George W. Perry - tackle LaVerne G. Saunders - tackle Lyle Seeman - guard Bud Sprague - tackle (College Football Hall of Fame) Birrell Walsh Harry Wilson - captain (College Football Hall of Fame) References Army Army Black Knights football seasons Army Cadets football
Featherstone Field, previously known as Murdock Stadium is a stadium on the campus of El Camino College in Torrance, California. Built in 1958 the stadium seats around 12,127 on wood-backed bleacher seats. It was home to the North American Soccer League's Los Angeles Aztecs for two years (1975–1976), the American Soccer League's Southern California Lazers for a single season in 1978, as well as several United States men's national soccer team FIFA World Cup qualification matches. Today, it hosts El Camino College's American football team. The stadium was originally named after the founding president of the college, Forrest G. Murdock. The stadium was also used as the main stadium in the 2005 remake of the 1974 film, The Longest Yard. The 2005 film starred Adam Sandler, Chris Rock, James Cromwell and Burt Reynolds, who actually played the lead role in the original film. The original stadium was demolished and a new state of the art stadium was opened in September 2016. In 2019, El Camino College announced that they would rename the field inside Murdock Stadium after longtime football coach John Featherstone, a former coach at El Camino. The stadium is also the annual host site of California Interscholastic Federation (CIF) Los Angeles City Section high school football championship games. International games References External links LA Sports - Murdock Stadium m Sports venues completed in 1958 Sports venues in Greater Los Angeles American football venues in California Athletics (track and field) venues in California College football venues North American Soccer League (1968–1984) stadiums Soccer venues in California El Camino Warriors Torrance, California Buildings and structures in Torrance, California 1958 establishments in California
```c /* =========================================================================== This file is part of Quake III Arena source code. Quake III Arena source code is free software; you can redistribute it or (at your option) any later version. Quake III Arena source code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the along with Quake III Arena source code; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ // // q_math.c -- stateless support routines that are included in each code module // Some of the vector functions are static inline in q_shared.h. q3asm // doesn't understand static functions though, so we only want them in // one file. That's what this is about. #ifdef Q3_VM #define __Q3_VM_MATH #endif #include "q_shared.h" const vec3_t vec3_origin = {0,0,0}; vec3_t axisDefault[3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } }; vec4_t colorBlack = {0, 0, 0, 1}; vec4_t colorRed = {1, 0, 0, 1}; vec4_t colorGreen = {0, 1, 0, 1}; vec4_t colorBlue = {0, 0, 1, 1}; vec4_t colorYellow = {1, 1, 0, 1}; vec4_t colorMagenta= {1, 0, 1, 1}; vec4_t colorCyan = {0, 1, 1, 1}; vec4_t colorWhite = {1, 1, 1, 1}; vec4_t colorLtGrey = {0.75, 0.75, 0.75, 1}; vec4_t colorMdGrey = {0.5, 0.5, 0.5, 1}; vec4_t colorDkGrey = {0.25, 0.25, 0.25, 1}; // actually there are 35 colors but we want to use bitmask safely const vec4_t g_color_table[ 64 ] = { {0.0f, 0.0f, 0.0f, 1.0f}, {1.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 1.0f, 0.0f, 1.0f}, {1.0f, 1.0f, 0.0f, 1.0f}, {0.2f, 0.2f, 1.0f, 1.0f}, //{0.0, 0.0, 1.0, 1.0}, {0.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 0.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, // extended color codes from CPMA/CNQ3: { 1.00000f, 0.50000f, 0.00000f, 1.00000f }, // 8 { 0.60000f, 0.60000f, 1.00000f, 1.00000f }, // 9 // CPMA's alphabet rainbow { 1.00000f, 0.00000f, 0.00000f, 1.00000f }, // a { 1.00000f, 0.26795f, 0.00000f, 1.00000f }, // b { 1.00000f, 0.50000f, 0.00000f, 1.00000f }, // c { 1.00000f, 0.73205f, 0.00000f, 1.00000f }, // d { 1.00000f, 1.00000f, 0.00000f, 1.00000f }, // e { 0.73205f, 1.00000f, 0.00000f, 1.00000f }, // f { 0.50000f, 1.00000f, 0.00000f, 1.00000f }, // g { 0.26795f, 1.00000f, 0.00000f, 1.00000f }, // h { 0.00000f, 1.00000f, 0.00000f, 1.00000f }, // i { 0.00000f, 1.00000f, 0.26795f, 1.00000f }, // j { 0.00000f, 1.00000f, 0.50000f, 1.00000f }, // k { 0.00000f, 1.00000f, 0.73205f, 1.00000f }, // l { 0.00000f, 1.00000f, 1.00000f, 1.00000f }, // m { 0.00000f, 0.73205f, 1.00000f, 1.00000f }, // n { 0.00000f, 0.50000f, 1.00000f, 1.00000f }, // o { 0.00000f, 0.26795f, 1.00000f, 1.00000f }, // p { 0.00000f, 0.00000f, 1.00000f, 1.00000f }, // q { 0.26795f, 0.00000f, 1.00000f, 1.00000f }, // r { 0.50000f, 0.00000f, 1.00000f, 1.00000f }, // s { 0.73205f, 0.00000f, 1.00000f, 1.00000f }, // t { 1.00000f, 0.00000f, 1.00000f, 1.00000f }, // u { 1.00000f, 0.00000f, 0.73205f, 1.00000f }, // v { 1.00000f, 0.00000f, 0.50000f, 1.00000f }, // w { 1.00000f, 0.00000f, 0.26795f, 1.00000f }, // x { 1.0, 1.0, 1.0, 1.0 }, // y, white, duped so all colors can be expressed with this palette { 0.5, 0.5, 0.5, 1.0 }, // z, grey }; int ColorIndexFromChar( char ccode ) { if ( ccode >= '0' && ccode <= '9' ) { return ( ccode - '0' ); } else if ( ccode >= 'a' && ccode <= 'z' ) { return ( ccode - 'a' + 10 ); } else if ( ccode >= 'A' && ccode <= 'Z' ) { return ( ccode - 'A' + 10 ); } else { return ColorIndex( COLOR_WHITE ); } } vec3_t bytedirs[NUMVERTEXNORMALS] = { {-0.525731f, 0.000000f, 0.850651f}, {-0.442863f, 0.238856f, 0.864188f}, {-0.295242f, 0.000000f, 0.955423f}, {-0.309017f, 0.500000f, 0.809017f}, {-0.162460f, 0.262866f, 0.951056f}, {0.000000f, 0.000000f, 1.000000f}, {0.000000f, 0.850651f, 0.525731f}, {-0.147621f, 0.716567f, 0.681718f}, {0.147621f, 0.716567f, 0.681718f}, {0.000000f, 0.525731f, 0.850651f}, {0.309017f, 0.500000f, 0.809017f}, {0.525731f, 0.000000f, 0.850651f}, {0.295242f, 0.000000f, 0.955423f}, {0.442863f, 0.238856f, 0.864188f}, {0.162460f, 0.262866f, 0.951056f}, {-0.681718f, 0.147621f, 0.716567f}, {-0.809017f, 0.309017f, 0.500000f},{-0.587785f, 0.425325f, 0.688191f}, {-0.850651f, 0.525731f, 0.000000f},{-0.864188f, 0.442863f, 0.238856f}, {-0.716567f, 0.681718f, 0.147621f},{-0.688191f, 0.587785f, 0.425325f}, {-0.500000f, 0.809017f, 0.309017f}, {-0.238856f, 0.864188f, 0.442863f}, {-0.425325f, 0.688191f, 0.587785f}, {-0.716567f, 0.681718f, -0.147621f}, {-0.500000f, 0.809017f, -0.309017f}, {-0.525731f, 0.850651f, 0.000000f}, {0.000000f, 0.850651f, -0.525731f}, {-0.238856f, 0.864188f, -0.442863f}, {0.000000f, 0.955423f, -0.295242f}, {-0.262866f, 0.951056f, -0.162460f}, {0.000000f, 1.000000f, 0.000000f}, {0.000000f, 0.955423f, 0.295242f}, {-0.262866f, 0.951056f, 0.162460f}, {0.238856f, 0.864188f, 0.442863f}, {0.262866f, 0.951056f, 0.162460f}, {0.500000f, 0.809017f, 0.309017f}, {0.238856f, 0.864188f, -0.442863f},{0.262866f, 0.951056f, -0.162460f}, {0.500000f, 0.809017f, -0.309017f},{0.850651f, 0.525731f, 0.000000f}, {0.716567f, 0.681718f, 0.147621f}, {0.716567f, 0.681718f, -0.147621f}, {0.525731f, 0.850651f, 0.000000f}, {0.425325f, 0.688191f, 0.587785f}, {0.864188f, 0.442863f, 0.238856f}, {0.688191f, 0.587785f, 0.425325f}, {0.809017f, 0.309017f, 0.500000f}, {0.681718f, 0.147621f, 0.716567f}, {0.587785f, 0.425325f, 0.688191f}, {0.955423f, 0.295242f, 0.000000f}, {1.000000f, 0.000000f, 0.000000f}, {0.951056f, 0.162460f, 0.262866f}, {0.850651f, -0.525731f, 0.000000f},{0.955423f, -0.295242f, 0.000000f}, {0.864188f, -0.442863f, 0.238856f}, {0.951056f, -0.162460f, 0.262866f}, {0.809017f, -0.309017f, 0.500000f}, {0.681718f, -0.147621f, 0.716567f}, {0.850651f, 0.000000f, 0.525731f}, {0.864188f, 0.442863f, -0.238856f}, {0.809017f, 0.309017f, -0.500000f}, {0.951056f, 0.162460f, -0.262866f}, {0.525731f, 0.000000f, -0.850651f}, {0.681718f, 0.147621f, -0.716567f}, {0.681718f, -0.147621f, -0.716567f},{0.850651f, 0.000000f, -0.525731f}, {0.809017f, -0.309017f, -0.500000f}, {0.864188f, -0.442863f, -0.238856f}, {0.951056f, -0.162460f, -0.262866f}, {0.147621f, 0.716567f, -0.681718f}, {0.309017f, 0.500000f, -0.809017f}, {0.425325f, 0.688191f, -0.587785f}, {0.442863f, 0.238856f, -0.864188f}, {0.587785f, 0.425325f, -0.688191f}, {0.688191f, 0.587785f, -0.425325f}, {-0.147621f, 0.716567f, -0.681718f}, {-0.309017f, 0.500000f, -0.809017f}, {0.000000f, 0.525731f, -0.850651f}, {-0.525731f, 0.000000f, -0.850651f}, {-0.442863f, 0.238856f, -0.864188f}, {-0.295242f, 0.000000f, -0.955423f}, {-0.162460f, 0.262866f, -0.951056f}, {0.000000f, 0.000000f, -1.000000f}, {0.295242f, 0.000000f, -0.955423f}, {0.162460f, 0.262866f, -0.951056f}, {-0.442863f, -0.238856f, -0.864188f}, {-0.309017f, -0.500000f, -0.809017f}, {-0.162460f, -0.262866f, -0.951056f}, {0.000000f, -0.850651f, -0.525731f}, {-0.147621f, -0.716567f, -0.681718f}, {0.147621f, -0.716567f, -0.681718f}, {0.000000f, -0.525731f, -0.850651f}, {0.309017f, -0.500000f, -0.809017f}, {0.442863f, -0.238856f, -0.864188f}, {0.162460f, -0.262866f, -0.951056f}, {0.238856f, -0.864188f, -0.442863f}, {0.500000f, -0.809017f, -0.309017f}, {0.425325f, -0.688191f, -0.587785f}, {0.716567f, -0.681718f, -0.147621f}, {0.688191f, -0.587785f, -0.425325f}, {0.587785f, -0.425325f, -0.688191f}, {0.000000f, -0.955423f, -0.295242f}, {0.000000f, -1.000000f, 0.000000f}, {0.262866f, -0.951056f, -0.162460f}, {0.000000f, -0.850651f, 0.525731f}, {0.000000f, -0.955423f, 0.295242f}, {0.238856f, -0.864188f, 0.442863f}, {0.262866f, -0.951056f, 0.162460f}, {0.500000f, -0.809017f, 0.309017f}, {0.716567f, -0.681718f, 0.147621f}, {0.525731f, -0.850651f, 0.000000f}, {-0.238856f, -0.864188f, -0.442863f}, {-0.500000f, -0.809017f, -0.309017f}, {-0.262866f, -0.951056f, -0.162460f}, {-0.850651f, -0.525731f, 0.000000f}, {-0.716567f, -0.681718f, -0.147621f}, {-0.716567f, -0.681718f, 0.147621f}, {-0.525731f, -0.850651f, 0.000000f}, {-0.500000f, -0.809017f, 0.309017f}, {-0.238856f, -0.864188f, 0.442863f}, {-0.262866f, -0.951056f, 0.162460f}, {-0.864188f, -0.442863f, 0.238856f}, {-0.809017f, -0.309017f, 0.500000f}, {-0.688191f, -0.587785f, 0.425325f}, {-0.681718f, -0.147621f, 0.716567f}, {-0.442863f, -0.238856f, 0.864188f}, {-0.587785f, -0.425325f, 0.688191f}, {-0.309017f, -0.500000f, 0.809017f}, {-0.147621f, -0.716567f, 0.681718f}, {-0.425325f, -0.688191f, 0.587785f}, {-0.162460f, -0.262866f, 0.951056f}, {0.442863f, -0.238856f, 0.864188f}, {0.162460f, -0.262866f, 0.951056f}, {0.309017f, -0.500000f, 0.809017f}, {0.147621f, -0.716567f, 0.681718f}, {0.000000f, -0.525731f, 0.850651f}, {0.425325f, -0.688191f, 0.587785f}, {0.587785f, -0.425325f, 0.688191f}, {0.688191f, -0.587785f, 0.425325f}, {-0.955423f, 0.295242f, 0.000000f}, {-0.951056f, 0.162460f, 0.262866f}, {-1.000000f, 0.000000f, 0.000000f}, {-0.850651f, 0.000000f, 0.525731f}, {-0.955423f, -0.295242f, 0.000000f}, {-0.951056f, -0.162460f, 0.262866f}, {-0.864188f, 0.442863f, -0.238856f}, {-0.951056f, 0.162460f, -0.262866f}, {-0.809017f, 0.309017f, -0.500000f}, {-0.864188f, -0.442863f, -0.238856f}, {-0.951056f, -0.162460f, -0.262866f}, {-0.809017f, -0.309017f, -0.500000f}, {-0.681718f, 0.147621f, -0.716567f}, {-0.681718f, -0.147621f, -0.716567f}, {-0.850651f, 0.000000f, -0.525731f}, {-0.688191f, 0.587785f, -0.425325f}, {-0.587785f, 0.425325f, -0.688191f}, {-0.425325f, 0.688191f, -0.587785f}, {-0.425325f, -0.688191f, -0.587785f}, {-0.587785f, -0.425325f, -0.688191f}, {-0.688191f, -0.587785f, -0.425325f} }; //============================================================== int Q_rand( int *seed ) { *seed = (69069 * *seed + 1); return *seed; } float Q_random( int *seed ) { return ( Q_rand( seed ) & 0xffff ) / (float)0x10000; } float Q_crandom( int *seed ) { return 2.0 * ( Q_random( seed ) - 0.5 ); } //======================================================= signed char ClampChar( int i ) { if ( i < -128 ) { return -128; } if ( i > 127 ) { return 127; } return i; } signed char ClampCharMove( int i ) { if ( i < -127 ) { return -127; } if ( i > 127 ) { return 127; } return i; } signed short ClampShort( int i ) { if ( i < -32768 ) { return -32768; } if ( i > 0x7fff ) { return 0x7fff; } return i; } // this isn't a real cheap function to call! int DirToByte( vec3_t dir ) { int i, best; float d, bestd; if ( !dir ) { return 0; } bestd = 0; best = 0; for (i=0 ; i<NUMVERTEXNORMALS ; i++) { d = DotProduct (dir, bytedirs[i]); if (d > bestd) { bestd = d; best = i; } } return best; } void ByteToDir( int b, vec3_t dir ) { if ( b < 0 || b >= NUMVERTEXNORMALS ) { VectorCopy( vec3_origin, dir ); return; } VectorCopy (bytedirs[b], dir); } unsigned ColorBytes3 (float r, float g, float b) { unsigned i; ( (byte *)&i )[0] = r * 255; ( (byte *)&i )[1] = g * 255; ( (byte *)&i )[2] = b * 255; return i; } unsigned ColorBytes4 (float r, float g, float b, float a) { unsigned i; ( (byte *)&i )[0] = r * 255; ( (byte *)&i )[1] = g * 255; ( (byte *)&i )[2] = b * 255; ( (byte *)&i )[3] = a * 255; return i; } float NormalizeColor( const vec3_t in, vec3_t out ) { float max; max = in[0]; if ( in[1] > max ) { max = in[1]; } if ( in[2] > max ) { max = in[2]; } if ( !max ) { VectorClear( out ); } else { out[0] = in[0] / max; out[1] = in[1] / max; out[2] = in[2] / max; } return max; } /* ===================== PlaneFromPoints Returns false if the triangle is degenerate. The normal will point out of the clock for clockwise ordered points ===================== */ qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ) { vec3_t d1, d2; VectorSubtract( b, a, d1 ); VectorSubtract( c, a, d2 ); CrossProduct( d2, d1, plane ); if ( VectorNormalize( plane ) == 0 ) { return qfalse; } plane[3] = DotProduct( a, plane ); return qtrue; } /* =============== RotatePointAroundVector This is not implemented very well... =============== */ void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ) { float m[3][3]; float im[3][3]; float zrot[3][3]; float tmpmat[3][3]; float rot[3][3]; int i; vec3_t vr, vup, vf; float rad; vf[0] = dir[0]; vf[1] = dir[1]; vf[2] = dir[2]; PerpendicularVector( vr, dir ); CrossProduct( vr, vf, vup ); m[0][0] = vr[0]; m[1][0] = vr[1]; m[2][0] = vr[2]; m[0][1] = vup[0]; m[1][1] = vup[1]; m[2][1] = vup[2]; m[0][2] = vf[0]; m[1][2] = vf[1]; m[2][2] = vf[2]; memcpy( im, m, sizeof( im ) ); im[0][1] = m[1][0]; im[0][2] = m[2][0]; im[1][0] = m[0][1]; im[1][2] = m[2][1]; im[2][0] = m[0][2]; im[2][1] = m[1][2]; memset( zrot, 0, sizeof( zrot ) ); zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F; rad = DEG2RAD( degrees ); zrot[0][0] = cos( rad ); zrot[0][1] = sin( rad ); zrot[1][0] = -sin( rad ); zrot[1][1] = cos( rad ); MatrixMultiply( m, zrot, tmpmat ); MatrixMultiply( tmpmat, im, rot ); for ( i = 0; i < 3; i++ ) { dst[i] = rot[i][0] * point[0] + rot[i][1] * point[1] + rot[i][2] * point[2]; } } /* =============== RotateAroundDirection =============== */ void RotateAroundDirection( vec3_t axis[3], float yaw ) { // create an arbitrary axis[1] PerpendicularVector( axis[1], axis[0] ); // rotate it around axis[0] by yaw if ( yaw ) { vec3_t temp; VectorCopy( axis[1], temp ); RotatePointAroundVector( axis[1], axis[0], temp, yaw ); } // cross to get axis[2] CrossProduct( axis[0], axis[1], axis[2] ); } void vectoangles( const vec3_t value1, vec3_t angles ) { float forward; float yaw, pitch; if ( value1[1] == 0 && value1[0] == 0 ) { yaw = 0; if ( value1[2] > 0 ) { pitch = 90; } else { pitch = 270; } } else { if ( value1[0] ) { yaw = ( atan2 ( value1[1], value1[0] ) * 180 / M_PI ); } else if ( value1[1] > 0 ) { yaw = 90; } else { yaw = 270; } if ( yaw < 0 ) { yaw += 360; } forward = sqrt ( value1[0]*value1[0] + value1[1]*value1[1] ); pitch = ( atan2(value1[2], forward) * 180 / M_PI ); if ( pitch < 0 ) { pitch += 360; } } angles[PITCH] = -pitch; angles[YAW] = yaw; angles[ROLL] = 0; } /* ================= AnglesToAxis ================= */ void AnglesToAxis( const vec3_t angles, vec3_t axis[3] ) { vec3_t right; // angle vectors returns "right" instead of "y axis" AngleVectors( angles, axis[0], right, axis[2] ); VectorSubtract( vec3_origin, right, axis[1] ); } void AxisClear( vec3_t axis[3] ) { axis[0][0] = 1; axis[0][1] = 0; axis[0][2] = 0; axis[1][0] = 0; axis[1][1] = 1; axis[1][2] = 0; axis[2][0] = 0; axis[2][1] = 0; axis[2][2] = 1; } void AxisCopy( vec3_t in[3], vec3_t out[3] ) { VectorCopy( in[0], out[0] ); VectorCopy( in[1], out[1] ); VectorCopy( in[2], out[2] ); } void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal ) { float d; vec3_t n; float inv_denom; inv_denom = DotProduct( normal, normal ); #ifndef Q3_VM assert( Q_fabs(inv_denom) != 0.0f ); // zero vectors get here #endif inv_denom = 1.0f / inv_denom; d = DotProduct( normal, p ) * inv_denom; n[0] = normal[0] * inv_denom; n[1] = normal[1] * inv_denom; n[2] = normal[2] * inv_denom; dst[0] = p[0] - d * n[0]; dst[1] = p[1] - d * n[1]; dst[2] = p[2] - d * n[2]; } /* ================ MakeNormalVectors Given a normalized forward vector, create two other perpendicular vectors ================ */ void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up) { float d; // this rotate and negate guarantees a vector // not colinear with the original right[1] = -forward[0]; right[2] = forward[1]; right[0] = forward[2]; d = DotProduct (right, forward); VectorMA (right, -d, forward, right); VectorNormalize (right); CrossProduct (right, forward, up); } void VectorRotate( const vec3_t in, const vec3_t matrix[3], vec3_t out ) { out[0] = DotProduct( in, matrix[0] ); out[1] = DotProduct( in, matrix[1] ); out[2] = DotProduct( in, matrix[2] ); } //============================================================================ #ifdef _MSC_SSE2 #include <intrin.h> #endif /* ** float Q_rsqrt( float number ) */ float Q_rsqrt( float number ) { #if defined(_MSC_SSE2) float ret; _mm_store_ss( &ret, _mm_rsqrt_ss( _mm_load_ss( &number ) ) ); return ret; #elif defined(_GCC_SSE2) /* writing it this way allows gcc to recognize that rsqrt can be used with -ffast-math */ return 1.0f / sqrtf( number ); #else floatint_t t; float x2, y; const float threehalfs = 1.5F; x2 = number * 0.5F; t.f = number; t.i = 0x5f3759df - ( t.i >> 1 ); // what the fuck? y = t.f; y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration // y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed return y; #endif } float Q_fabs( float f ) { floatint_t fi; fi.f = f; fi.i &= 0x7FFFFFFF; return fi.f; } //============================================================ /* =============== LerpAngle =============== */ float LerpAngle (float from, float to, float frac) { float a; if ( to - from > 180 ) { to -= 360; } if ( to - from < -180 ) { to += 360; } a = from + frac * (to - from); return a; } /* ================= AngleSubtract Always returns a value from -180 to 180 ================= */ float AngleSubtract( float a1, float a2 ) { float a; a = a1 - a2; while ( a > 180 ) { a -= 360; } while ( a < -180 ) { a += 360; } return a; } void AnglesSubtract( vec3_t v1, vec3_t v2, vec3_t v3 ) { v3[0] = AngleSubtract( v1[0], v2[0] ); v3[1] = AngleSubtract( v1[1], v2[1] ); v3[2] = AngleSubtract( v1[2], v2[2] ); } float AngleMod(float a) { a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535); return a; } /* ================= AngleNormalize360 returns angle normalized to the range [0 <= angle < 360] ================= */ float AngleNormalize360 ( float angle ) { return (360.0 / 65536) * ((int)(angle * (65536 / 360.0)) & 65535); } /* ================= AngleNormalize180 returns angle normalized to the range [-180 < angle <= 180] ================= */ float AngleNormalize180 ( float angle ) { angle = AngleNormalize360( angle ); if ( angle > 180.0 ) { angle -= 360.0; } return angle; } /* ================= AngleDelta returns the normalized delta from angle1 to angle2 ================= */ float AngleDelta ( float angle1, float angle2 ) { return AngleNormalize180( angle1 - angle2 ); } //============================================================ /* ================= SetPlaneSignbits ================= */ void SetPlaneSignbits (cplane_t *out) { int bits, j; // for fast box on planeside test bits = 0; for (j=0 ; j<3 ; j++) { if (out->normal[j] < 0) { bits |= 1<<j; } } out->signbits = bits; } /* ================== BoxOnPlaneSide Returns 1, 2, or 1 + 2 ================== */ int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *p) { float dist[2]; int sides, b, i; // fast axial cases if (p->type < 3) { if (p->dist <= emins[p->type]) return 1; if (p->dist >= emaxs[p->type]) return 2; return 3; } // general case dist[0] = dist[1] = 0; if (p->signbits < 8) // >= 8: default case is original code (dist[0]=dist[1]=0) { for (i=0 ; i<3 ; i++) { b = (p->signbits >> i) & 1; dist[ b] += p->normal[i]*emaxs[i]; dist[!b] += p->normal[i]*emins[i]; } } sides = 0; if (dist[0] >= p->dist) sides = 1; if (dist[1] < p->dist) sides |= 2; return sides; } /* ================= RadiusFromBounds ================= */ float RadiusFromBounds( const vec3_t mins, const vec3_t maxs ) { int i; vec3_t corner; float a, b; for (i=0 ; i<3 ; i++) { a = fabs( mins[i] ); b = fabs( maxs[i] ); corner[i] = a > b ? a : b; } return VectorLength (corner); } void ClearBounds( vec3_t mins, vec3_t maxs ) { mins[0] = mins[1] = mins[2] = 99999; maxs[0] = maxs[1] = maxs[2] = -99999; } void AddPointToBounds( const vec3_t v, vec3_t mins, vec3_t maxs ) { if ( v[0] < mins[0] ) { mins[0] = v[0]; } if ( v[0] > maxs[0]) { maxs[0] = v[0]; } if ( v[1] < mins[1] ) { mins[1] = v[1]; } if ( v[1] > maxs[1]) { maxs[1] = v[1]; } if ( v[2] < mins[2] ) { mins[2] = v[2]; } if ( v[2] > maxs[2]) { maxs[2] = v[2]; } } qboolean BoundsIntersect(const vec3_t mins, const vec3_t maxs, const vec3_t mins2, const vec3_t maxs2) { if ( maxs[0] < mins2[0] || maxs[1] < mins2[1] || maxs[2] < mins2[2] || mins[0] > maxs2[0] || mins[1] > maxs2[1] || mins[2] > maxs2[2]) { return qfalse; } return qtrue; } qboolean BoundsIntersectSphere(const vec3_t mins, const vec3_t maxs, const vec3_t origin, vec_t radius) { if ( origin[0] - radius > maxs[0] || origin[0] + radius < mins[0] || origin[1] - radius > maxs[1] || origin[1] + radius < mins[1] || origin[2] - radius > maxs[2] || origin[2] + radius < mins[2]) { return qfalse; } return qtrue; } qboolean BoundsIntersectPoint(const vec3_t mins, const vec3_t maxs, const vec3_t origin) { if ( origin[0] > maxs[0] || origin[0] < mins[0] || origin[1] > maxs[1] || origin[1] < mins[1] || origin[2] > maxs[2] || origin[2] < mins[2]) { return qfalse; } return qtrue; } vec_t VectorNormalize( vec3_t v ) { // NOTE: TTimo - Apple G4 altivec source uses double? float length, ilength; length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; if ( length ) { /* writing it this way allows gcc to recognize that rsqrt can be used */ ilength = 1/(float)sqrt (length); /* sqrt(length) = length * (1 / sqrt(length)) */ length *= ilength; v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; } return length; } vec_t VectorNormalize2( const vec3_t v, vec3_t out) { float length, ilength; length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; if (length) { /* writing it this way allows gcc to recognize that rsqrt can be used */ ilength = 1/(float)sqrt (length); /* sqrt(length) = length * (1 / sqrt(length)) */ length *= ilength; out[0] = v[0]*ilength; out[1] = v[1]*ilength; out[2] = v[2]*ilength; } else { VectorClear( out ); } return length; } void _VectorMA( const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc) { vecc[0] = veca[0] + scale*vecb[0]; vecc[1] = veca[1] + scale*vecb[1]; vecc[2] = veca[2] + scale*vecb[2]; } vec_t _DotProduct( const vec3_t v1, const vec3_t v2 ) { return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]; } void _VectorSubtract( const vec3_t veca, const vec3_t vecb, vec3_t out ) { out[0] = veca[0]-vecb[0]; out[1] = veca[1]-vecb[1]; out[2] = veca[2]-vecb[2]; } void _VectorAdd( const vec3_t veca, const vec3_t vecb, vec3_t out ) { out[0] = veca[0]+vecb[0]; out[1] = veca[1]+vecb[1]; out[2] = veca[2]+vecb[2]; } void _VectorCopy( const vec3_t in, vec3_t out ) { out[0] = in[0]; out[1] = in[1]; out[2] = in[2]; } void _VectorScale( const vec3_t in, vec_t scale, vec3_t out ) { out[0] = in[0]*scale; out[1] = in[1]*scale; out[2] = in[2]*scale; } void Vector4Scale( const vec4_t in, vec_t scale, vec4_t out ) { out[0] = in[0]*scale; out[1] = in[1]*scale; out[2] = in[2]*scale; out[3] = in[3]*scale; } int Q_log2( int val ) { int answer; answer = 0; while ( ( val>>=1 ) != 0 ) { answer++; } return answer; } /* ================= PlaneTypeForNormal ================= */ /* int PlaneTypeForNormal (vec3_t normal) { if ( normal[0] == 1.0 ) return PLANE_X; if ( normal[1] == 1.0 ) return PLANE_Y; if ( normal[2] == 1.0 ) return PLANE_Z; return PLANE_NON_AXIAL; } */ /* ================ MatrixMultiply ================ */ void MatrixMultiply(float in1[3][3], float in2[3][3], float out[3][3]) { out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0]; out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1]; out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2]; out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0]; out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1]; out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2]; out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0]; out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1]; out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2]; } void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) { float angle; static float sr, sp, sy, cr, cp, cy; // static to help MS compiler fp bugs angle = angles[YAW] * (M_PI*2 / 360); sy = sin(angle); cy = cos(angle); angle = angles[PITCH] * (M_PI*2 / 360); sp = sin(angle); cp = cos(angle); angle = angles[ROLL] * (M_PI*2 / 360); sr = sin(angle); cr = cos(angle); if (forward) { forward[0] = cp*cy; forward[1] = cp*sy; forward[2] = -sp; } if (right) { right[0] = (-1*sr*sp*cy+-1*cr*-sy); right[1] = (-1*sr*sp*sy+-1*cr*cy); right[2] = -1*sr*cp; } if (up) { up[0] = (cr*sp*cy+-sr*-sy); up[1] = (cr*sp*sy+-sr*cy); up[2] = cr*cp; } } /* ** assumes "src" is normalized */ void PerpendicularVector( vec3_t dst, const vec3_t src ) { int pos; int i; float minelem = 1.0F; vec3_t tempvec; /* ** find the smallest magnitude axially aligned vector */ for ( pos = 0, i = 0; i < 3; i++ ) { if ( fabs( src[i] ) < minelem ) { pos = i; minelem = fabs( src[i] ); } } tempvec[0] = tempvec[1] = tempvec[2] = 0.0F; tempvec[pos] = 1.0F; /* ** project the point onto the plane defined by src */ ProjectPointOnPlane( dst, tempvec, src ); /* ** normalize the result */ VectorNormalize( dst ); } /* ================ Q_isnan Don't pass doubles to this ================ */ int Q_isnan( float x ) { floatint_t fi; fi.f = x; fi.u &= 0x7FFFFFFF; fi.u = 0x7F800000 - fi.u; return (int)( fi.u >> 31 ); } //your_sha256_hash-------- /* ================ Q_isfinite ================ */ static int Q_isfinite( float f ) { floatint_t fi; fi.f = f; if ( fi.u == 0xFF800000 || fi.u == 0x7F800000 ) return 0; // -INF or +INF fi.u = 0x7F800000 - (fi.u & 0x7FFFFFFF); if ( (int)( fi.u >> 31 ) ) return 0; // -NAN or +NAN return 1; } /* ================ Q_atof ================ */ float Q_atof( const char *str ) { float f; f = atof( str ); // modern C11-like implementations of atof() may return INF or NAN // which breaks all FP code where such values getting passed // and effectively corrupts range checks for cvars as well if ( !Q_isfinite( f ) ) return 0.0f; return f; } /* ================ Q_log2f ================ */ float Q_log2f( float f ) { const float v = logf( f ); return v / M_LN2; } /* ================ Q_exp2f ================ */ float Q_exp2f( float f ) { return powf( 2.0f, f ); } #ifndef Q3_VM /* ===================== Q_acos the msvc acos doesn't always return a value between -PI and PI: int i; i = 1065353246; acos(*(float*) &i) == -1.#IND0 ===================== */ float Q_acos(float c) { float angle; angle = acos(c); if (angle > M_PI) { return (float)M_PI; } if (angle < -M_PI) { return (float)M_PI; } return angle; } #endif ```
Fiction Records is a British record label founded by Chris Parry in 1978, owned by Universal Music Group and based in the United Kingdom. It is best known for being the home of The Cure for over 20 years. It was originally a part of Polydor, but in January 2014, Universal restructured Fiction as a standalone label, removing it from Polydor's corporate affiliation. Fiction repertoire is now released internationally through Virgin (ex-North America). History Fiction Records was founded in the late 1970s by Polydor A&R man, and longtime The Cure manager Chris Parry, alongside music publisher Fiction Songs Ltd, and who went on to found Radio X (then XFM London) and both were subsidiaries of Polydor Records, and based in London at 97 Charlotte Street and eventually maintained a satellite office in New York City at 850 7th Ave. Fiction was also home to UK dance label Desire, re-launched in 1988 as Fiction's house subdivision, and Non Fiction Records, Fiction's specialty label for special editions. Fiction was best known for The Cure's releases and achieved its first UK No. 1 album in 1992 with The Cure's Wish; the album's lead single "Friday I'm In Love" also topped Billboard'''s Modern Rock chart. Additionally, Fiction was home to other artists who signed to the publishing company as well as the record label and released a number of acclaimed albums including Eat's Sell Me a God (Fiction/Polydor) in 1989, The God Machine's Scenes from the Second Storey (Fiction/Polydor) in 1993 and Die Warzau's Engine (Fiction/Wax Trax!) in 1995. Other artists who were part of the Fiction roster and publishing catalog during this time included Billy Mackenzie & The Associates, Candyland, The Purple Hearts, Cult Hero and The Passions. Starting in 1995, Fiction became dormant as a label, apart from the occasional Cure release, and focused exclusively on Fiction Songs, who partnered with Bertelsmann Music Group to form a joint venture publishing company and moved their New York offices to the Bertelsmann Building at 1540 Broadway in Times Square in 1994; Fiction's headquarters were unchanged. However, BMG eventually acquired Fiction Songs and its catalog in 2001. Besides being the publisher for the Cure and other Fiction artists, Fiction Songs was also home to hip hop/electronic artist Stereo MCs, producer and songwriter Cameron McVey, the Jungle Brothers, Primitive Radio Gods, and NY Loose. In 1992, the Fiction headquarters at Charlotte Street served as the first home to XFM London co founded by Parry. A benefit concert called 'Great Xpectations' was held in support of the station on 13 June 1993 at Finsbury Park in London. A live album of the concert titled Great Xpectations Live was released in July 1993 on Fiction and included performances by The Cure, Damon Albarn & Graham Coxon, Belly and Catherine Wheel. In January 2004, Joe Munns, Paul Smernicki and Beastman revived Fiction to "give Polydor a bit more of a guitar stronghold", as their roster then consisted mostly of pop acts. The first release on the "new" Fiction was the Snow Patrol single "Run", which entered the UK Singles Chart at No. 5. The subsequent Snow Patrol album, Final Straw'', went on to sell over two million copies worldwide. In January 2014, Universal Music Group restructured Fiction as a standalone label, removing it from Polydor's corporate affiliation. Artists The current Fiction stable includes Crystal Castles, Tame Impala, The Mysterines, Death From Above 1979, The Maccabees, Spector, HEALTH, Mini Mansions, Fryars, Kate Boy, Meanwhile, Palace, The Amazons, Another Sky, The Big Moon and Kaiser Chiefs. Fiction has also released records by The Naked And Famous, Kate Nash, Athlete, Elbow, White Lies, Yuksek, Stephen Fretwell, Ian Brown, Jacknife Lee, Delays, Alberta Cross, Guillemots and Yeah Yeah Yeahs. See also List of record labels References External links Fiction Records Official Website Shop Fiction Records Fiction Records Discography Desire Records Discography Non Fiction Discography Fiction Records in Music Week - May 2015 Interview with Fiction A&R Jim Chancellor, HitQuarters Oct 2005 Fiction Records in Music Week - May 2015 Interview with Fiction A&R Jim Chancellor, HitQuarters Oct 2005 British record labels Record labels established in 1978 Labels distributed by Universal Music Group The Cure
```shell #!/bin/bash ./common.sh cd ../.. mvn -Ddatabasedmn=cockroachdb clean install ```
```shell Aliasing ssh connections Clear bash history Terminal based browser Sequential execution using the `;` statement separator ```
Atomotricha ommatias is a moth in the family Oecophoridae first described by Edward Meyrick in 1883. It is endemic to New Zealand. References Moths described in 1883 Oecophoridae Moths of New Zealand Endemic fauna of New Zealand Taxa named by Edward Meyrick Endemic moths of New Zealand
David Ellis (born 23 June 1939) is an English academic and writer. He went from a local grammar school to study English at Downing College, Cambridge under F. R. Leavis and then spent three years teaching at La Trobe University in Melbourne, Australia. The rest of his academic career was at the University of Kent in Canterbury, apart from two years as a visiting professor in two separate universities in the United States and another as an Andrew Mellon Fellow at the National Humanities Center in North Carolina. In 1998 he took early retirement in order to write more and has since published over a dozen books. He remains an Emeritus Professor at the University of Kent. Married with two daughters and three grandchildren he lives in Faversham, Kent. Key publications Ellis’s first publications were a translation of Stendhal’s Memoirs of an Egotist and a book on Wordsworth's Prelude. He was then responsible for the third volume of the new Cambridge biography of D. H. Lawrence (Dying Game) which was short-listed for the James Tait Black award. A good deal of his work since his retirement has been on D.H.Lawrence and includes Death and the Author: How D. H. Lawrence died, and was remembered (2008) as well as Love and Sex in D. H. Lawrence (2015). In a review of Death and the Author, Peter Balbert of Trinity University wrote " LET ME BE PRECISE and unequivocal here. David Ellis, the distinguished critic and the author of the third and final volume of the Cambridge life of D.H.Lawrence, now has written nothing less than a masterpiece of biography, intellectual history, and medical inquiry in a study that is simultaneously wide-ranging and sharply focused. " In 2011 Ellis was awarded the Harry T. Moore award for services to Lawrence studies. Writing biography turned Ellis’s attention to its problems, some of which he addressed in Literary Lives: Biography and the search for understanding (2000). Struck with how many biographies of Shakespeare could appear when so little is known about his private life, he discussed the issues in both That Man Shakespeare (2005) and The Truth about William Shakespeare (2015) although in between he also wrote Shakespeare’s Practical Jokes: an introduction to the comic in his work (2007). Ellis is the author of two memoirs, Memoirs of a Leavisite: The decline and fall of Cambridge English (2013) and Frank Cioffi: the philosopher in shirt-sleeves (2015) and has kept up his interest in Romantic writers with Byron in Geneva: That summer of 1816 (2011) and, most recently, The Story of Stendhal and British Culture (2018). Ellis has also written introductions for Wordsworth Classics, Penguin Classics and Everyman's Library. Books Perfidious Albion: The Story of Stendhal and British Culture (2018), Edward Everett Root Publishers . Love and Sex in D. H. Lawrence (2015), Clemson University Press . Frank Cioffi: The philosopher in shirt-sleeves (2015), Bloomsbury . Memoirs of a Leavisite: The decline and fall of 'Cambridge English''' (2013), Liverpool University Press . Long-listed for the J. R. Ackerley prize for autobiography.The truth about William Shakespeare (2012), Edinburgh University Press, .Byron in Geneva: That Summer of 1816 (2011), Liverpool University Press .Death and the Author: How D. H. Lawrence died, and was remembered (2008), Oxford University Press .Shakespeare's Practical Jokes: an introduction to the comic in his work (2007), Associated University Presses .That Man Shakespeare (2005), Helm Information .Literary Lives: Biography and the Search for Understanding (2000), Edinburgh University Press .D. H. Lawrence: Dying Game'' (1998),Cambridge University Press . Short-listed for the James Tait Black Memorial Prize. References 1939 births Living people People from Swinton, Greater Manchester 20th-century British male writers 20th-century British biographers 20th-century English male writers Alumni of Downing College, Cambridge Academics of the University of Kent Academic staff of La Trobe University 21st-century British male writers
```objective-c //===-- ARMMCAsmInfo.h - ARM asm properties --------------------*- C++ -*--===// // // See path_to_url for license information. // //===your_sha256_hash------===// // // This file contains the declaration of the ARMMCAsmInfo class. // //===your_sha256_hash------===// #ifndef LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCASMINFO_H #define LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCASMINFO_H #include "llvm/MC/MCAsmInfoCOFF.h" #include "llvm/MC/MCAsmInfoDarwin.h" #include "llvm/MC/MCAsmInfoELF.h" namespace llvm { class Triple; class ARMMCAsmInfoDarwin : public MCAsmInfoDarwin { virtual void anchor(); public: explicit ARMMCAsmInfoDarwin(const Triple &TheTriple); }; class ARMELFMCAsmInfo : public MCAsmInfoELF { void anchor() override; public: explicit ARMELFMCAsmInfo(const Triple &TT); void setUseIntegratedAssembler(bool Value) override; }; class ARMCOFFMCAsmInfoMicrosoft : public MCAsmInfoMicrosoft { void anchor() override; public: explicit ARMCOFFMCAsmInfoMicrosoft(); }; class ARMCOFFMCAsmInfoGNU : public MCAsmInfoGNUCOFF { void anchor() override; public: explicit ARMCOFFMCAsmInfoGNU(); }; } // namespace llvm #endif ```
```php <?php declare(strict_types=1); return [ [ 'BCDE', 'PhpSpreadsheet', ], [ '877D', 'Mark Baker', ], [ 'C0EA', '!+&=()~', ], [ 'C07E', '', ], [ '99E8', 'leyndarml lykilor', ], [ 'CE4B', '', ], [ 'O6EXRLpLEDNJDL/AzYtnnA4O4bY=', '', 'SHA-1', ], [ 'GYvlIMljDI1Czc4jfWrGaxU5pxl9n5Og0KUzyAfYxwk=', 'PhpSpreadsheet', 'SHA-256', 'Php_salt', 1000, ], [ 'your_sha512_hash==', 'Mark Baker', 'SHA-512', 'Mark_salt', 10000, ], [ 'r9KVLLCKIYOILvE2rcby+g==', '!+&=()~', 'MD5', 'Symbols_salt', 100000, ], // Additional tests suggested by Issue #1897 ['DCDF', 'ABCDEFGHIJKLMNOPQRSTUVW'], ['ECD1', 'ABCDEFGHIJKLMNOPQRSTUVWX'], ['88D2', 'ABCDEFGHIJKLMNOPQRSTUVWXY'], 'password too long' => ['exception', str_repeat('x', 256)], ]; ```
"Fiesta" () is a Greek Pop song by Helena Paparizou. The song was exclusively released on Dromos FM 89,8 (Athens), Cosmoradio 95,1 (Thessaloniki) on June 27, and was officially released on July 4 on Vevo. It is the third single from her sixth Greek studio album Ouranio Toxo which released on December 15, 2017. The song is written by Michael Tsaousopoulos, Teo Tzimas and Dimitris Beris. The English version released on July 15 on her vevo channel. Lyrics are written by Nektarios Tyrakis. Paparizou performed "Fiesta" for the first time at the annual MAD Video Music Awards held in Tae Kwon Do Stadium in Athens on the 28th June 2016. On July 1, Paparizou performed "Fiesta" at the semi-finals of The X Factor (Greek series 4). Charts Release history Greek Version English Version References 2016 singles Helena Paparizou songs 2016 songs Number-one singles in Greece Greek-language songs
Troon () is a village in Cornwall, UK, southeast of Camborne. The village lies at around above sea level. An electoral ward named Troon and Beacon covers the area north from Troon to the outskirts of Camborne. The population at the 2011 census was 5,410. There were once important copper and tin mines near Troon, including the Grenville Mines. Wheal Grenville began to be worked in the 1820s though it was not productive until the 1850s, at which time the South and East mines were worked independently. In 1906 these mines were united with South Condurrow to form the Grenville United Mines and continued until 1920. The mineral Condurrite is a compound mineral named after the Great Condurrow Mine at Troon. The King Edward Mine is still situated on the outskirts of the village on the Carn Brea Road. It has a museum and can still be visited. An inscribed altar stone found at Chapel Ia, Troon (now set in the altar of the parish church), and dated to the tenth or eleventh centuries, attests to the existence of a settlement then. The chapel of Saint Ia was recorded in 1429 and a holy well was nearby. The site was called Fenton-ear (i.e. the well of Ia). The stone is very similar to one now in the garden at Pendarves, used as the base for a sundial. There are two Cornish crosses at Pendarves; one was found in a ditch on the estate and then set up near the house. It has a crude crucifixus figure on the front and a Latin cross on the back. The other is a cross head found in the kitchen garden at Pendarves. Troon Cricket Club Formed in 1875 as Troon Amateur Cricket Club, the club, along with Camborne, Penzance and St Just, is one of the most successful in Cornish cricket. The club is based at Treslothan Road, where it has played cricket for over a hundred years. In 1972 the club was one of the participants in the inaugural National Village Competition, beating Astwood Bank in the final at Lord's. They went on to win the competition again the following year and for a third time, which remains a record. Among the many good players to have represented the club down the years, two homegrown players have gone on to play first-class cricket, these are Anthony Penberthy and Malcolm Dunstan. Former Pakistan and ICL spinner Arshad Khan also represented the club in the late 1990s and early 2000s. Cornish wrestling Cornish wrestling tournaments, for prizes, have been held in Troon. Venues have included the King Edward Mine Playing Fields and Little Haven Farm at Newton Moor. Treslothan Troon is in the parish of Treslothan which was divided from the parish of Camborne in 1845. St John's Church was built to the designs of George Wightwick four years earlier (opened in October 1841). The 15th century font was removed from Camborne church in the 18th century. The miner poet John Harris (1820–1884) is buried in the churchyard, where also is the mausoleum of the Pendarves family. References Sources External links GENUKI account of Treslothan Troon Cricket Club King Edward Mine Villages in Cornwall
Chek Keng () is an area and village of Sai Kung North in Hong Kong. It is administratively part of Tai Po District. Location Chek Keng is located within Sai Kung East Country Park, on the northern coast of Sai Kung Peninsula and facing the Chek Keng Hau () aka East Arm Bay of Long Harbour. Administration Chek Keng is a recognized village under the New Territories Small House Policy. History Chek Keng was probably founded more than 200 years ago. It was historically a multi-surname Hakka village. It was reported in 2003 that Chek Keng had only one resident, an 84 year old woman. Features Chapel The Holy Family Chapel () in Chek Keng was built in 1874 to replace an earlier chapel that had been severely damaged by a storm in 1867. The whole village later converted to Catholicism. During the Japanese Occupation of Hong Kong, the chapel was a base of the Hong Kong-Kowloon Independent Battalion of the East River Guerrilla (). The chapel is listed as a Grade II historic building. Others Chek Keng Pier Bradbury Hall youth hostel Transportation Chek Keng is not accessible by car. It is located along the Stage 2 of the MacLehose Trail, about an hour's walk from Pak Tam Au. A kai-to service is available between Wong Shek, Wan Tsai (Nam Fung Wan) and Chek Keng. References External links Delineation of area of existing village Chek Keng (Sai Kung North) for election of resident representative (2019 to 2022) Chek Keng - A Piece of Sai Kung History Pictures of Chek Keng Picture of the Holy Family Chapel in Chek Keng Villages in Tai Po District, Hong Kong Sai Kung North
Timothy R. Pauketat is an American archaeologist, director of the Illinois State Archaeological Survey, the Illinois State Archaeologist, and professor of anthropology and medieval studies at the University of Illinois at Champaign-Urbana. He is known for his historical theories and his investigations at Cahokia, the major center of precolonial Mississippian culture in the American Bottom region of Illinois near St. Louis, Missouri. Early life and education Pauketat was exposed to archaeology at an early age, growing up amid family heirlooms and Native artifacts scattered about his family's property. Early on, he met Brad Koldehoff, who was similarly exposed to archaeology while growing up on the other side of their home town of Millstadt, Illinois. In high school, he took an art class from Al Meyer, a veteran of the Mound 72 excavations at Cahokia. Pauketat's enthusiasm for archaeology grew. A few years later, Pauketat attended Southern Illinois University at Edwardsville, graduating in 1983 with a B.S. in Anthropology and Earth Sciences. His professors included Drs. Sidney Denny, William Woods, Charlotte Frisbie, Ted Frisbie, Alan Stueber, and Ronald Yarbrough. During college he worked as an intern for the U.S. Army Corps of Engineers, St. Louis District, learning from lead archaeologist Terry Norris, another veteran of the Mound 72 excavations at Cahokia. As a college student, he worked most summers on SIU-Edwardsville archaeology projects and, briefly, with the Center for American Archaeology, a cultural resource management program based at Kampsville, Illinois. Moving to SIU-Carbondale for a Masters degree, he was a research assistant for the Black Mesa archaeological project and as assistant curator for SIU-Carbondale from 1983-1984. At Carbondale, he learned from George Gumerman, Brian Butler, Jon Muller, George Sherman, Lynne Sullivan, William Andrefsky, Jr., and Robert Rand. He corresponded with the eminent professor James B. Griffin of the University of Michigan, who encouraged him to be critical of received wisdom. Pauketat earned an M.A. in Anthropology from SIU-Carbondale in 1986 and then left for the University of Michigan to pursue his doctorate. At Michigan, Pauketat worked with Professors Henry Wright, Richard Ford, John O'Shea, and Jeff Parsons, and teamed up with then-students Preston Miracle, Andrew Darling, Alex Barker, David Anderson, and John Robb. A particularly memorable field encounter that he, Preston Miracle, and David Anderson had with the "dark forces" of American capitalism in 1987 is recorded in his 2007 book Chiefdoms and Other Archaeological Delusions.. He earned his PhD in Anthropology in 1991. Academic career Pauketat did a one-year post-doc at the University of Illinois as a visiting researcher with Charles Bareis, and in 1992 started as an assistant professor at the University of Oklahoma at Norman. During this period, he published his dissertation as his first single-authored book, The Ascent of Chiefs: Cahokia and Mississippian Politics in Native North America (1994). In 1996 he moved to the University at Buffalo, the State University of New York as an associate professor. In 1998, he accepted a position at the University of Illinois, where he became a full professor in 2005. He has published numerous professional papers, book chapters, additional books, and earned a Distinguished Service award from his department. The years between the mid 1990s and the mid 2010s were filled with field work, field schools, and laboratory study. With funding from the National Science Foundation, the National Endowment for the Humanities, National Geographic, the Wenner Gren Foundation, and the John Templeton Foundation, Pauketat led excavations at a series of endangered archaeological sites on the margins of Greater Cahokia, including the Halliday, Pfeffer, Grossmann, and Emerald Acropolis sites. Up until 2019, he regularly taught classes such as “Introductory World Archaeology” and “Archaeological Theory". He also led the annual University of Illinois archaeological field school for 17 out of the 20 years that his primary appointment was with the Department of Anthropology at the University of Illinois. In 2019, he assumed the role of the Director of the Illinois State Archaeological Survey (ISAS), a subdivision of the Prairie Research Institute at the University of Illinois. As Director, he oversees the research and compliance archaeology of upwards of 100 staff and is engaged in transforming the research and engagement activities of ISAS, the largest archaeological organization of its kind in the U.S. Pauketat is a member of the Editorial Advisory Board of the archaeology journal Antiquity. Research Cahokia Pauketat has concentrated his own research on Cahokia, an Indigenous city at the center of a large, regional Mississippian culture that extended its influence up and down the Mississippi Valley and across its tributaries. He has excavated in Cahokia's grand plaza and surrounding settlements and platform mounds. He has also worked at outlying sites such as Halliday, Pfeffer, and Emerald in the uplands of the Mississippi valley. He ranks Cahokia as the prime society in the Mississippian world. The finding of similar mundane and ritual implements such as pottery, chunkey stones, and Mississippian stone statuary in locations as far afield as sites such as Spiro Mounds in Oklahoma, and the presence of resources from distant locales such as the Gulf of Mexico at Cahokia, show the extent of Cahokia's historical and political connections to the greater Mississippian world. He has entangled this spread of Cahokian material culture with the effects of a pax Cahokiana, all of which contributed to Cahokia's far-reaching influence. Pauketat has used research from contemporaneous archaeological sites to formulate a comprehensive, large-scale picture of the Mississippian world. He is interested in investigating such questions as the emergence of civilization, especially as we might imagine that today to have involved human and other-than-human forces. He has investigated culture areas beyond the Mississippian heartland to define what he once called his "historical processual" approach. Today, that approach has been extended to draw on New Materialist theories and a variety of ontological or relational approaches to history and humanity. Whatever the theoretical underpinnings, Pauketat has always relied on hard data and artifacts to discover new or previously ignored information. Doing so led him to an early reconstruction of Cahokian urban history as beginning around A.D. 1050, when pre-Cahokian settlements were suddenly transformed into the large, planned community of Cahokia proper, marked by a sudden preponderance of houses and the rapid adoption of wall-trench housing that replaced the previously common post-wall housing. Also during this time, a distinctive pattern of farmsteads developed in the uplands east of Cahokia proper, dubbed the "Richland complex" by Pauketat. The walls of houses in Richland farming settlements were set into trenches, but some post-wall and hybrid-wall forms were discovered. Initially considered an example of cultural resistance, the hybrid and traditional forms were later realized to be the homes of immigrants to the Greater Cahokia region. The documented Richland complex farmsteads are estimated to have housed thousands of persons, representing a huge population shift. This shift did not originate from local inhabitants, however, as pottery styles attest. Pauketat and his colleagues noticed a great amount of artifact diversity among Richland sites, including some non-local pottery styles (“Varney Red Filmed”), and pottery-making methods of the local style (shell-tempered) that differed from the norm (thicker walls, etc.) These villages have fewer finely crafted items or ritual objects and a high percentage of workshop debris, likely indicating their purpose as support communities for the Cahokian elite. His notion of a transplanted farmer population is supported by the complete abandonment of these upland villages at the same time of Cahokia’s presumed collapse around two centuries later. Pauketat questions established knowledge about ancient North America. For instance, due to improvements in radiometric dating and new methodologies, such as identification of domestic remains, he and other researchers have concluded that Cahokia rose and fell over a much shorter time period, around three hundred years, than had been previously attributed. The ubiquity of Cahokian-derived goods across much of then contemporaneous Midwest and Mid-South U.S. has also been examined. While this distribution was most certainly due to an exchange network, Pauketat posits relations between Cahokians and other Mississippians as not being purely environmentally determined, following previous interpretations (by who?). Rather, he suggests that political relationships inspired much of the trading, as their natural environment satisfied their needs for survival. By trading, Cahokia may have been trying to bring outsiders within their sphere of influence, evidenced in the sudden large amount of Cahokian material culture found outside of Cahokia. At a more local scale, the sudden appearance and proliferation of Cahokian artifacts is coupled with housing reorganization of peoples and the incorporation of greater Cahokia. Cultural Resource Management Due to the nature of American archaeology, Pauketat participated in “salvage” or cultural resource management early on. This archaeology removes and documents cultural material before modern development destroys it. Today, he leads the largest rescue-archaeology or cultural resource management organization in the United States. Though often much more limited in scope and time than academic archaeology, Pauketat's book, The Ascent of Chiefs..., details how artifacts in part “salvaged” from the construction of a highway through Cahokia can be used to achieve the highest kind of intellectual knowledge production. Dividing up the artifacts by radiometrically dated and ceramic-seriated phases, he noted an increasing number of foreign goods as time progressed during the pre-Cahokian era. In that study, he interpreted this pattern to suggest the emergence of a new subcommunity or class of elites. Theoretical Foundations In an interview with Peter Shea in 2013, Pauketat characterized his work as being about objects and their relationships to people. He insisted on the importance of research into materials as the only way to understand people and their histories, if not humanity itself. While respectful of the work of historians, he yet asserts that the written record misses important aspects of the human history. He says that understanding history means exploring the materiality of the past. He describes his approach to the past as being "object heavy." More recently, in a series of lectures, he has emphasized the importance of the archaeology of the intangible. Processualism In the 1990s and early 2000s, Pauketat championed practice-based, agency-focused, and phenomenological theories in archaeology, initiated as part of the post-processual movement in the 1980s and 1990s. These theories culminated in his 2007 book, Chiefdoms and Other Archaeological Delusions. Post-processual theory was a critique of processual archaeology, sometimes associated by critics with postmodernism. Today, the distinction is disappearing, as all archaeologists use the scientific method for basic inference construction. Theories of identity, landscape phenomenology, and agency are now central to 21st-century explanations of the past. Practice Theory Pauketat advocates a more historical approach to theory and a more theoretical approach to history. Practice theory also contributes to his understanding, that is, understanding changes in people’s habits and actions, provides an explanation for changes in the archaeological record. Pauketat stated that “... practices are always novel and creative, in some ways unlike those in other times or places...” when understood within their historical context. One method to ascertain the historical influences on practices is discerning traditions, or practices with a long temporal dimension. Traditions are the forms of practice most visible in the archaeological record; they can range from an arrowhead style to the preponderance of shell-tempered pottery throughout the U.S. Mid-South and Midwest during the Mississippian era. Tracking the change of archaeologically defined traditions tracks the changes of the archaeological culture, since tradition is a measure through which change can take place. With regard to Cahokia, Pauketat used practice theory to interpret the proliferation of the chunkey stone. Pre-Cahokian American Bottom dwellers were using an early form of this round disc with two concave sides as early as 600 AD. This artifact is not found outside this region until the height of Cahokia about 400 years later. The sudden popularity and proliferation of the game pieces across the Mid-South and Southeast U.S. at this time suggests mass organization of the game played with this shaped stone. The massive plazas at Cahokia would have been an ideal setting, and large enough to accommodate all parts of Cahokian society. The organizers of the games, likely the Cahokian elite, could bring together all levels of society by using a longstanding tradition. This game tradition retained its prestige, continuing to be practiced until the 19th century among certain Native American tribes. It was ethnographically documented as a competition for the losing side’s worldly possessions. Recent work After 2008, Pauketat turned to rethink religion and agency in human history, often through the lens of archaeoastronomy. Between 2009 and 2011, he worked with Danielle Benden and Robert Boszhardt (independent) to lead "The Mississippian Initiative" (funded by the National Science Foundation). The trio investigated sites in western Wisconsin at sites including the Fisher Mounds Site Complex and Trempealeau, which they believe to have been a short-term Cahokian "shrine complex," mission, or colony. In Wisconsin, they found evidence that the effects of Cahokians colonizing the north country in the 11th century AD resulted in profound, long-term change in the precolonial Native world. Between 2012 and 2018, Pauketat worked with Susan Alt (Indiana University, Bloomington) on an even larger-scale investigation of upland "shrine complexes" due east of Cahokia. Over five intensive field seasons, Alt and Pauketat's teams undercovered evidence of periodic, large-scale religious events at a place dubbed the "Emerald Acropolis." Here, Pauketat verified his claims that Cahokian religion was centered on the long 18.6-year cycle of the Moon, drawing inspiration from colleagues at Chaco Canyon, in New Mexico, and the Hopewell sites of central Ohio. Since then, Alt and Pauketat have sought to understand the relationship between religion to politics generally, at sites in Wisconsin, Mississippi, Indiana, and Illinois. Like most pre-modern religions, those of precolonial America were practiced through rituals and events. Pauketat is seeking to understand the larger historical implications of such performed religion. He discusses this and other theories about Cahokia's connections and influence in his Cahokia: Ancient America's Great City on the Mississippi (2009). In an early review of this work, Pauketat's old mentor, William I. Woods, took issue with Pauketat's suggestion (on page 2) that Cahokia may have been in contact with Mesoamerican civilizations, and to his belief that they have important similarities in mythic images and religious beliefs. Woods notes that James B. Griffin, "the dean of Eastern North American archaeology," repeatedly stated that there was "absolutely no evidence for direct contact between Mesoamerica and Cahokia." C. Wesson says that Pauketat presents this theory but is not committed to proving a connection between Cahokia and ancient Mexico; rather it is one of several alternatives that he explores to provide an overview of the field. Pauketat's An Archaeology of the Cosmos: Rethinking Agency and Religion in Ancient America was published in 2013. The previous year he also edited the volume, The Oxford Handbook of North American Archaeology (2012). Since then, several other volumes of his have been published. Most recently, Pauketat has written an extended treatment of the big history of North America that includes the effects of both Medieval climate change and Mesoamerica on the rest of North America. His latest book is Gods of Thunder: How Climate Change, Travel, and Spirituality Reshaped Precolonial North America (2023). References Selected works (2023) Gods of Thunder: How Climate Change, Travel, and Spirituality Reshaped Precolonial America, Oxford University Press. (2013) An Archaeology of the Cosmos, Routledge Press. (2012) Oxford Handbook of North American Archaeology., ed. by Timothy Pauketat, Oxford University Press (2009) Cahokia: Ancient America's Great City on the Mississippi. Viking Adult. (2007) Chiefdoms and Other Archaeological Delusions. Alta Mira Press. (2004) Ancient Cahokia and the Mississippians. Cambridge University Press. (2001) “Practice and History in Archaeology: an Emerging Paradigm,” Anthropological Theory Vol. 1, No. 73 (1998) “Refiguring the Archaeology of Greater Cahokia,” Journal of Archaeological Research Vol. 6 No. 1 (1994) The Ascent of Chiefs: Cahokia and Mississippian Politics in Native North America, University of Alabama Press. Pauketat, Timothy R. and Alt, Susan M. (2005) “Agency in a Postmold? Physicality and the Archaeology of Culture-Making,” in Journal of Archaeological Method and Theory, Vol. 12 No. 3 External links Cahokia Mounds State Historic Site Dr. Pauketat's Faculty Web Page Year of birth missing (living people) 20th-century American archaeologists 21st-century American archaeologists University of Illinois Urbana-Champaign faculty Living people University at Buffalo faculty Cahokia
Jacquelynne (Jackie) Pement (born May 10, 1946 in Drumheller, Alberta) is a Canadian former politician, who represented the electoral district of Bulkley Valley-Stikine in the Legislative Assembly of British Columbia from 1991 to 1996. She was a member of the New Democratic Party. She served as Minister of Transportation and Highways in the Executive Council of British Columbia from 1993 to 1996. References 1946 births Living people British Columbia New Democratic Party MLAs Women government ministers of Canada Members of the Executive Council of British Columbia People from Drumheller Women MLAs in British Columbia 20th-century Canadian politicians 20th-century Canadian women politicians
Three on a Ticket is a 1947 American crime film directed by Sam Newfield and written by Fred Myton. It is based on the 1942 novel The Corpse Came Calling by Brett Halliday. The film stars Hugh Beaumont, Cheryl Walker, Paul Bryar, Ralph Dunn, Louise Currie, Gavin Gordon, Charles Quigley and Douglas Fowley. The film was released on April 4, 1947, by Producers Releasing Corporation. Plot Cast Hugh Beaumont as Michael Shayne Cheryl Walker as Phyllis Hamilton Paul Bryar as Tim Rourke Ralph Dunn as Inspector Pete Rafferty Louise Currie as Helen Brimstead Gavin Gordon as Pearson aka Barton Charles Quigley as Kurt Leroy Douglas Fowley as Mace Morgan Noel Cravat as Trigger Charles King as Drunk Brooks Benedict as Jim Lacy References External links 1947 films 1940s English-language films American crime films 1947 crime films Producers Releasing Corporation films Films directed by Sam Newfield American black-and-white films 1940s American films
Richard Pfeiffer may refer to: Richard Friedrich Johannes Pfeiffer (1858–1945), German physician and bacteriologist Richard Pfeiffer (politician) (born 1944), member of the Ohio Senate
```yaml apiVersion: release-notes/v2 # This YAML file describes the format for specifying a release notes entry for Istio. # This should be filled in for all user facing changes. # kind describes the type of change that this represents. # Valid Values are: # - bug-fix -- Used to specify that this change represents a bug fix. # - security-fix -- Used to specify that this change represents a vulnerability fix. # - feature -- Used to specify a new feature that has been added. # - test -- Used to describe additional testing added. This file is optional for # tests, but included for completeness. kind: bug-fix # area describes the area that this change affects. # Valid values are: # - traffic-management # - security # - telemetry # - installation # - istioctl # - documentation area: traffic-management # issue is a list of GitHub issues resolved in this note. # If issue is not in the current repo, specify its full URL instead. issue: - 52746 # releaseNotes is a markdown listing of any user facing changes. This will appear in the # release notes. releaseNotes: - | **Fixed** an issue where Waypoints required DNSProxy to be enabled in order to consume auto-allocated IPs ```
The Desert of Paran or Wilderness of Paran (also sometimes spelled Pharan or Faran; , Midbar Pa'ran), is a location mentioned in the Hebrew Bible. It is one of the places where the Israelites spent part of their 40 years of wandering after the Exodus, and was also a home to Ishmael, and a place of refuge for David. In Islamic tradition, it has often been equated with an area of the Hejaz. Biblical Paran The Wilderness or Desert of Paran is said to be the place where Hagar (the Egyptian servant girl of Abraham's wife Sarah/Sarai and, by Sarah's suggestion, was made his wife and had a son with him Ishmael) was sent into exile from Abraham's dwelling in Beersheba (). Hagar "departed, and strayed in the wilderness of Beer-sheba" ():Then God opened her [Hagar's] eyes and she saw a well of water. So she went and filled the skin with water and gave the boy a drink. God was with the boy as he grew up. He lived in the desert and became an archer. While he was living in the Desert of Paran, his mother got a wife for him from Egypt. () Paran is later mentioned in the Book of Numbers as a place where the Israelites temporarily settled during the Exodus: Then the Israelites set out from the Desert of Sinai and traveled from place to place until the cloud came to rest in the Desert of Paran. (; see also ) Paran again features in the opening lines of the Book of Deuteronomy: These are the words Moses spoke to all Israel in the desert beyond the Jordan--that is, in the Arabah--opposite Suph, between Paran and Tophel, Laban, Hazeroth and Dizahab. () He said: "The LORD came from Sinai and dawned over them from Seir; he shone forth from Mount Paran. He came with myriads of holy ones, from his right hand went a fiery law for them." () King David spent some time in the wilderness of Paran after Samuel died (). states that when Hadad the Edomite fled from Edom to Egypt, he passed through Midian and Paran on the way to Egypt. It is not certain precisely where the wilderness of Paran is to be located. It is often associated with Mount Sinai in Egypt, and there is some evidence that it may originally have referred to the southern portion of the Sinai Peninsula. However the Deuteronomy 1:1 text suggests it could be east of the Jordan River. The minor prophet Habakkuk references that "God is coming from Teman, the Holy One from Mount Paran" in . Both Eusebius (in his Onomasticon, a Bible dictionary) and Jerome reported that Paran was a city in Paran desert, in Arabia Deserta (beyond Arabia Nabataea), southeast of Eilat Pharan. Onomasticon, under Pharan, states: "(Now) a city beyond Arabia adjoining the desert of the Saracens [who wander in the desert] through which the children of Israel went moving (camp) from Sinai. Located (we say) beyond Arabia on the south, three days journey to the east of Aila (in the desert Pharan) where Scripture affirms Ismael dwelled, whence the Ishmaelites. It is said (we read) also that (king) Chodollagomor cut to pieces those in 'Pharan which is in the desert'." Eusebius' mention of Chodollagomor refers to a possible earlier mention of Paran in , which states that as he and the other kings allied with him were campaigning in the region of Sodom and Gomorrah, they smote "the Horites in their mount Seir, unto El-paran, which is by the wilderness". (KJV) Sebeos, the Armenian Bishop and historian, describing the Arab conquest of his time, wrote that the Arabs "assembled and came out from Paran". in 1989, Professor Haseeb Shehada, in his translation of the Samaritan Torah, suggested an identification of the wilderness of Paran with the desert of Western Arabia, which is known today as the Hijaz. Arab and Islamic traditions The Arab geographer Al-Muqaddasi mentioned in his book that the Red Sea branches into two "at the extremity of al-Hijaz at a place called Faran". The association of Paran in Genesis 21:21 with Ishmael and the Ishmaelites is affirmed by the Muslim geographer Yaqut al-Hamawi who writes "Faran, an arabized Hebrew word, one of the names of Mecca mentioned in the Torah." Islamic and Arabic traditions hold that the wilderness of Paran is, broadly speaking, the Hejaz, the northern half of Tihamah, stretching along the east side of the Red Sea starting from Jordan and Sinai, and that the specific site where Ishmael settled is that of Mecca, near the mountains of Paran. The "Desert of Paran" is also interpreted as Hijaz in an old Arabic translation of the Samaritan Pentateuch. When it was translated into English in 1851, it was found to include a footnote making this interpretation. The name 'Paran' or 'Faran' has often been used to refer specifically to the wilderness and mountains near where Mecca is situated. Al-Hamdani in his book Geography of the Arabic Peninsula says that the Paran mountains around Mecca were named after Paran son of Amalek. Sam'ni in his Book of Surnames also says that the surname Farani is derived from the Faran mountains near Mecca in Hijaz According to Wahb ibn Munabbih, there was a Tal Faran ("Hill of Faran") on the outskirts of Mecca, mentioned in his book Kitab al-Tijan, a Pre-Islamic Arabic folklore compilation. Ibn Munabbih further suggested an identification for Tal Faran as the 'mound of the Two runaways', a place where the Jurhum tribe found Hagar and Ishmael and thought of them as two runaways. Haggai Mazuz, a scholar of Islam associated with the Bar-Ilan University, asserts that Muslim polemicists' (like the Jewish convert Samawʾal al-Maghribī, 1125–1175 CE) appropriation of Deut. 33:2 has antecedence in Jewish tradition itself, as some Midrashim and Targumim, before the rise of Islam itself, posed a connection between Paran and Ishmael-Arabs. For instance, commentating on the Sifrei Debarīm, a halakhic midrash on Deuteronomy, dated from the 3rd to the 5th century CE, he says: the link between Paran and the Arabs (actually the Arabic language), who are also called Ishmaelites after Ishmael (among other names), is very early although somewhat vague. See also Middle East Wadi Feiran, whose oasis was identified by Ptolemy as "Paran" References External links Baseinstitute.org A 16th century French map showing Paran Book of Genesis Book of Numbers Book of Deuteronomy Books of Samuel Books of Kings Book of Habakkuk Hebrew Bible regions Vayeira Hejaz Hagar Deserts
Aggrey Jaden Ladu (1924, 1927, or 1928 — 1985 or 1987) was a South Sudanese politician. Biography Aggrey Jaden Ladu is from the Pojulu ethnic group, known for promoting the independence of South Sudan from Sudan. He was born in Loka village in the mid to late 1920s and Education Aggrey Jaden Ladu attended Loka Church Missionary Society CMS Elementary school in the period 1936–1944, before proceeding to Nabumali secondary school in Uganda, where he studied from 1945 to 1949.He joined University of Khartoum in 1950 and graduated in the school of Arts in 1954 and joined Sudan administration and was trained as a sub – mamur administrator in 1955. Upon the independence of Sudan in 1956, he was accused of refusing to lower the British flag and replacing it with the new Sudan independence flag. He was transferred to Malakal in 1957 but got dismissed from the Sudan civil service in 1958 after the coup d'état of General Ibrahim Abboud. He left the country in search of a job and managed to get employed by the East African Railways and Harbours Corporation in Kenya. Political career He left this lucrative job to join the Southern Sudan People`s Liberation Movement--SPLM in 1963 in the company of Fr. Saturnino Ohure, Joseph Oduho and William Deng Nhial. He was elected President of the movement Sudan African National Union (SANU) after Joseph Oduho in 1964. He led the movement delegation to the Khartoum round table conference in 1965 and then returned to continue with the struggle. In April 1967, Jaden was elected the president of the Southern Sudan Provisional Government. He moved to Nairobi, Kenya in 1969 out of fear for his safety. Gordon Muortat Mayen was his successor as the leader of the Anyanya. Following the signing of the Addis Ababa agreement in 1972, Jaden was the first to denounce it as a sell out because his objectives for the struggle were by far much higher. The agreement didn’t handle the issue of self – determination as at the Khartoum round table conference of 1965, and the agreement was not witnessed by any international observers. Aggrey Jaden decided to dishonor it and remained in exile. Many southerners tried to convince him to return home and join the Southern Regional Government. He eventually returned to Sudan in 1978 long after Addis Ababa agreement was signed. He returned an angry man and despite a lot of persuading, he refused to dirty his untarnished political career by participating in the government. In 1983, his rejection of the Addis Ababa agreement was vindicated when Gaafar Nimeiry tore the agreement forcing southerners, once again, to take to the bush for the second struggle for the liberation of the Sudan under the late Dr. John Garang. Life and Death The best recognition to the late Aggrey Jaden was when the SPLA leader, Dr. John Garang, granted safe passage for the transportation of his body to his village Loka, for burial, in 1987 when he passed on in the same year(1987). References "Tribute to Jaden 20 years after Demise" Sudan Mirror. Sep. 23 2007. “Uncharacteristic of some southern Sudanese politicians, Jaden didn’t waver in his political objective. That became the cornerstone of the struggle of the people of southern Sudan. He was so resolute and rigid that he created enemies for himself even among his own comrades sparking a power struggle in which he was unseated twice as head of the external faction of SANU and of the South Sudan Provisional Government”. “A Troubled History of Southern Sudan Struggles 1821–2011 by Serafino Wani Swaka, 2009, Juba” “Shaping a Free Southern Sudan – Memoirs of our Struggle, 1934–1985 by Severino Fuli Boki, 2002, Nairobi, Kenya”. 1920s births 1987 deaths Sudanese civil servants South Sudanese activists Exiled South Sudanese politicians
A dethatcher or lawn scarifier is a device that removes thatch from lawns. Types of dethatchers include motorized dethatchers or those that can be pulled behind a garden tractor. Thatch removal (dethatching) Scarification or de-thatching of lawns or turf is a mechanical process whereby the surface and subsurface of the lawn, green or sports pitch is rigorously abraded by penetrating metal blades, tines or prongs. The process is usually carried out by machines of a professional standard which are normally powered by gasoline engines. Smaller, less rigorous electric machines are also available for the domestic market. The process of scarifying is designed to remove thatch from lawns. Thatch is a build-up of organic matter which can include dead grass, leaves, stems, stolons, rhizomes and overcrowded grass roots and lateral weed growth. Thatch can stifle the growth and health of grass or turf. Removing the thatch helps the grass by encouraging it to thicken up and also makes it stronger and less susceptible to disease. Reducing thatch levels increases the levels of water, air and nutrients that can get through to the root zone of the grass plants. Significant thatch problems in lawns can cause diseases and can encourage moss to grow in the areas where grass has died. A by-product of scarifying or de-thatching is that moss is also removed, and depending on how deep the scarifying blades are set, root cutting can also occur, and this in turn helps grass to thicken up over time. Scarifying is normally carried out in autumn or spring. When scarifying or de-thatching, not all thatch should be removed as a small amount of thatch is beneficial to the lawn. A lawn that has excessive thatch may feel spongy when trodden upon. After removing thatch, it can be swept or raked up using a lawn sweeper. References External links Gardening tools Horticultural techniques Lawn care
A nominal income target is a monetary policy target. Such targets are adopted by central banks to manage national economic activity. Nominal aggregates are not adjusted for inflation. Nominal income aggregates that can serve as targets include nominal gross domestic product (NGDP) and nominal gross domestic income (GDI). Central banks use a variety of techniques to hit their targets, including conventional tools such as interest rate targeting or open market operations, unconventional tools such as quantitative easing or interest rates on excess reserves and expectations management to hit its target. The concept of NGDP targeting was formally proposed by Neo-Keynesian economists James Meade in 1977 and James Tobin in 1980, although Austrian economist Friedrich Hayek argued in favor of the stabilization of nominal income as a monetary policy norm as early as 1931 and as late as 1975. The concept was resuscitated and popularized in the wake of the 2008 financial crash by a group of economists (most notably Scott Sumner) who came to be known as the market monetarists. They claimed that the crisis would have been far less severe had central banks adopted some form of nominal income targeting. Mechanism The central bank establishes a target level or growth rate of nominal economic activity within a currency zone (usually a single country) for a given period without adjusting for price level changes (inflation/deflation). Policy is loosened or tightened as needed to hit the target. Since the goal is to hit the target for the coming period, some method of forecasting the default value of the target must be devised to serve as the baseline that indicates the direction and magnitude of policy change required to change the outcome to match that target. One such mechanism is conventional economic forecasting. The central bank's forecast, that of some reified econometric model or an average of a group of forecasts prepared by independent groups are examples of such forecasts. Another approach is to create a futures market for the target and adjust policy until the market predicts that the target will be met. Level targeting vs rate targeting When supply or demand shocks or policy errors push NGDP growth above or below the target, market monetarists argue that the bank should target the level rather than the rate of growth of NGDP. With level targeting if a recession pushes NGDP to 2% for one year, the bank adds the shortfall to the next year's target to return the economy to trend growth. The name for this policy is NGDP level targeting (NGDPLT). The rate targeting alternative, which targets a constant growth rate per period allows growth to drift lower or higher over time than implied by straightforward compound growth, because each period's target growth depends on the nominal income in the prior only. Effective policy Monetary policy that ensures a NGDP target is met by definition avoids recessions in nominal terms, and by maintaining aggregate demand softens recessions in real terms albeit by adding inflation to ensure NGDP is level. A US target of five percent growth is often recommended with the expectation that it would on average comprise three percent real growth (the historical average growth rate during the so-called Great Moderation) and two percent inflation (as currently targeted by the US Federal Reserve). An alternative target of three percent was proposed with the expectation of nominal growth mirroring the real growth rate, and zero average inflation. This lower target has the potential downside of being deflationary if real growth exceeds the three percent target, implying deflation. However, any nominal target could conceivably be either deflationary or inflationary if real growth sharply deviated from expectations in either direction. Labour supply Charlie Bean discussed optimal conditions for nominal income targets. Let and be labour demand and labour supply, respectively. They are expressed as follows: where and are the wage and price level respectively. is a productivity shock. And , and d is positive. In an equilibrium state, the labour demand and supply become equal to each other, which yields where is the market clearing level. Then consider the expected market clearing level of the wage: Substituting into the labour demand equation, we write it as: Since output is expressed as it turns out that it becomes: Immediately we have and that yields This equation says that a negative productivity shock of, say, 5 percent is cancelled out by the increase in the price level of 5 percent, provided that the money wage is fixed. If we consider the full information level of output , which is obtained by setting , then we have Then the deviation of output from its full information level becomes: Introducing as , we obtain the following formula: Macroeconomic stabilisation policy aims at minimising the variance of , and this formula suggests that if , that is , then the nominal income targeting eliminates the divergence of real output from its full information equilibrium. It is therefore concluded that nominal income targets are optimal under the condition of perfectly inelastic labour supply. Central bank discussion As of 2011, it was claimed that the Bank of England might be targeting nominal income and not inflation (at least in the short term), as inflation was greater than one percent above its target, and income was growing at nearly five percent. The Federal Open Market Committee of the US Federal reserve discussed the possibility of a nominal income target on September 21, 2010. The Reserve Bank of New Zealand, the pioneer of inflation targeting, responded directly to a Scott Sumner report on inflation targeting, noting its concerns with GDP figures often being restated and therefore being unsuitable as a consistent monetary policy framework. Developing countries Jeffrey Frankel's reasons for a developing country to target its NGDP were: A developing country needs to follow a credible economic policy with which it can survive. The IMF often tells a developing country to target its inflation rate, but inflation targeting makes it difficult for the country to handle an adverse supply shock or a terms-of-trade shock, because monetary expansion increases the prices of imported goods. If a country targets its inflation rate when it suffers negative supply shocks, its real GDP becomes volatile. Negative supply shocks are more common in developing countries, because their economies are more vulnerable to natural disasters, social unrest and unrelated policy errors. Terms-of-trade shocks such as oil price increases and commodity export price decreases have greater effects because they represent larger fractions of the economy. India is regularly subject to supply shocks, such as good or bad monsoons. Frankel argued countries who target NGDP have more flexibility in dealing with such shocks. Market monetarism Market monetarists are skeptical of traditional monetarism's use of monetary aggregates as policy variables and prefer to use forward-looking markets. They advocate a nominal income target as a monetary policy rule because it simultaneously addresses prices and growth. Proponents contend that national income targeting would reduce positive and negative fluctuations in economic growth. In recovery from a recession, market monetarists believe concerns over inflation are unjustified and policy should instead focus on returning the economy to a normal growth path. Conversely, in an inflationary environment, it provides a glide path to stability without overreacting. Similarly, such a targeting policy can help the economy accommodate both positive and negative supply shocks, while minimizing collateral damage. The leading proponent was Scott Sumner, with his blog "The Money Illusion." Supporters included Lars Christensen, blogging at "The Market Monetarist", Marcus Nunes at "Historinhas" David Glasner at "Uneasy Money", Josh Hendrickson at "The Everyday Economist", David Beckworth at "Macro and Other Market Musings" and Bill Woolsey at "Monetary Freedom." Support As of fall 2011, the number and influence of economists who supported this approach was growing largely the result of a blog-based campaign by several macroeconomists. Larry Kudlow, James Pethokoukis and Tyler Cowen advocate NGDP targeting. Australian economist John Quiggin supports nominal income targeting, on the basis that "A system of nominal GDP targeting would maintain or enhance the transparency associated with a system based on stated targets, while restoring the balance missing from a monetary policy based solely on the goal of price stability." Supporters of nominal income targeting often self-identify as market monetarists, although market monetarism encompasses more than nominal income targeting. Among policymakers, Vince Cable, ex United Kingdom Business Secretary, has described himself as "attracted" to nominal income targeting, but declined to elaborate further. Charles L. Evans, president of the Federal Reserve Bank of Chicago, said in July 2012 that "nominal income level targeting is an appropriate policy choice" because of what he claimed was its "safeguard against an unreasonable increase in inflation." However, "recognizing the difficult nature of that policy approach," he also suggested a "more modest proposal" of "a conditional approach, whereby the federal funds rate is not increased until the unemployment rate falls below 7 percent, at least, or until inflation rises above 3 percent over the medium term." Few academic publications analyze nominal income targeting. One study argues that similar monetary policy performs better than real income targeting during crises based on a theoretical model. In June 2015, Lawrence Summers seemed to suggest that NGDP targeting was a more powerful policy tool than a higher inflation target, although he did not endorse the progressive monetary policy. As Summers notes, setting a target which does not depend on inflation adjustments is more reasonable, and NGDP targeting guarantees that when a real growth rate is low real rates become low. David Beckworth, a long-time proponent of NGDP targeting, produces a brief each quarter to describe the stance of monetary policy in the United States. In what he calls the "NGDP gap," Beckworth measures the "percentage difference between the neutral level of NGDP and the actual level of NGDP." Beckworth uses this finding to argue "whether monetary policy is expansionary or contractionary." References Bundled references Further reading External links Monetary policy Central banks
```java /* * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.apache.shardingsphere.infra.executor.sql.process.yaml.swapper; import org.apache.shardingsphere.infra.executor.sql.process.Process; import org.apache.shardingsphere.infra.executor.sql.process.yaml.YamlProcessList; import org.apache.shardingsphere.infra.util.yaml.swapper.YamlConfigurationSwapper; import java.util.Collection; import java.util.stream.Collectors; /** * YAML process list swapper. */ public final class YamlProcessListSwapper implements YamlConfigurationSwapper<YamlProcessList, Collection<Process>> { private final YamlProcessSwapper yamlProcessSwapper = new YamlProcessSwapper(); @Override public YamlProcessList swapToYamlConfiguration(final Collection<Process> data) { YamlProcessList result = new YamlProcessList(); result.setProcesses(data.stream().map(yamlProcessSwapper::swapToYamlConfiguration).collect(Collectors.toList())); return result; } @Override public Collection<Process> swapToObject(final YamlProcessList yamlConfig) { return yamlConfig.getProcesses().stream().map(yamlProcessSwapper::swapToObject).collect(Collectors.toList()); } } ```
Avery Island (historically ) is a salt dome best known as the source of Tabasco sauce. Located in Iberia Parish, Louisiana, United States, it is approximately inland from Vermilion Bay, which in turn opens onto the Gulf of Mexico. A small human population lives on the island. The island is listed on the National Register of Historic Places. History The island was named after the Avery family, who settled there in the 1860s, but long before that, Native Americans had found that Avery Island's verdant flora covered a precious natural resource—a massive salt dome. There, Native Americans boiled the Island's briny spring water to extract salt, which they traded to other tribes as far away as central Texas, Arkansas, and Ohio. According to records maintained prior to 1999 in the Southern Historical Collection at the University of North Carolina at Chapel Hill, Petite Anse Island, renamed Avery Island in the late 19th century, was purchased by John Craig Marsh of New Jersey in 1818. Marsh operated a sugar plantation on the island's fertile soil. His daughter, Sarah Craig Marsh, married Daniel Dudley Avery in 1837, thus uniting the Marsh and Avery families. Daniel Dudley Avery hailed from Baton Rouge, and was a jurist. In 1849, Daniel became co-owner of his in-law's sugar plantation, and in 1855 he became sole owner. Before the Civil War, Edmund McIlhenny joined the Avery family, by marrying Mary Eliza Avery, daughter of Daniel Dudley Avery and Sarah Marsh Avery. In 1868, McIlhenny founded McIlhenny Company, and began manufacturing Tabasco brand pepper sauce. In 1870, he received letters patent for his sauce processing formula. That same basic process is still used today. In 1938, his son, Edward Avery McIlhenny established a nutria farm on Avery Island, Louisiana, near the factory where the company that bears his family name makes Tabasco sauce. According to company history, McIlhenny bought his stock of nutrias from a farm near New Orleans, so he was not the first to introduce the creature, a native of southern Brazil, Argentina, and Chile, to North America. What is certain, though, is that McIlhenny, for reasons unknown, released an unknown but probably large number of nutrias into the wild from the confines of Avery Island, and from there they fanned out and proliferated. Avery Island was hit hard in September 2005 by Hurricane Rita. According to The New York Times, the family spent $5 million on constructing a -high levee, pumps, and back-up generators to ensure that future hurricanes will not disrupt Tabasco sauce production. Bird sanctuary Under the Avery/McIlhenny family's management, Avery Island has remained a natural paradise, inhabited by many animal species, as well as by exotic plants from throughout the world. Edward Avery McIlhenny, or "Mr. Ned" as he was affectionately known, founded this bird colony—later called Bird City—around 1895 after plume hunters had slaughtered egrets by the thousands to provide feathers for ladies' hats. Edward gathered eight young egrets, raised them in captivity on the island, and released them in the fall to migrate across the Gulf of Mexico. The following spring the birds returned to the island with others of their species, a migration that continues today. McIlhenny's illustrated and written documentation of plant and animal life on Avery Island was donated to the Louisiana State University library. Exotic plants Edward McIlhenny introduced numerous varieties of azaleas, Japanese camellias, Egyptian papyrus sedge, and other rare plants to the Island's natural landscape. When oil was discovered on the Island in 1942, he ensured that production crews bypassed live oak trees and buried pipelines (or painted them green) to preserve the Island's beauty, wildlife, and utility as a wildlife refuge. Today Jungle Gardens and Bird City are open to the public. Geography Avery Island is surrounded on all sides by bayous (slow-moving, muddy rivers), salt marsh, and swampland; it sits about west of New Orleans. The island was a sugar plantation formerly known as Petite Anse Island. (Petite Anse means "Little Cove" in Cajun French.) Access to the island is via a toll road (technically a very low toll bridge), though a toll is no longer charged for visitors, including tourists. At its highest point, the island is above mean sea level. It covers about and is about across at its widest point. Geology Avery Island is actually a huge dome of rock salt, long and wide. It was created by the upwelling of ancient evaporite (salt) deposits that exist beneath the Mississippi River Delta region. These upwellings are known as "salt domes". Avery Island is one of five salt dome islands that rise above the flat Louisiana Gulf coast. The Five Islands from northwest to southeast are Jefferson Island, Avery Island, Weeks Island, Cote Blanche Island and Belle Isle. Government and infrastructure The United States Postal Service operates the Avery Island Post Office. Education The Iberia Parish School System operates the public schools in the area. Students attend schools in New Iberia. Students are zoned to Center Street Elementary School, Iberia Middle School, Westgate High School and New Iberia Senior High School. Avery Island Elementary School (K-6) formerly served the community. After the 2007–2008 school year, students from Avery Island Elementary were moved to Center Street Elementary School. At the time, 118 children attended Avery Island Elementary. While Avery Island Elementary operated, it fed into the same middle and high schools that Center Street feeds into. Iberia Parish is in the service area of Fletcher Technical Community College and of South Louisiana Community College. References and notes External links tabasco.com Inventory of the Avery Family of Louisiana, 1796–1951, in the Southern Historical Collection, UNC-Chapel Hill. Acadiana Unincorporated communities in Iberia Parish, Louisiana Historic American Engineering Record in Louisiana Islands of Louisiana McIlhenny family Unincorporated communities in Louisiana Geography of Iberia Parish, Louisiana Salt domes Tourist attractions in Iberia Parish, Louisiana Landforms of Iberia Parish, Louisiana National Register of Historic Places in Iberia Parish, Louisiana
Jonna Valesca Tilgner (born November 18, 1984 in Hannover, Lower Saxony) is a German sprinter and hurdler, who specialized in the 400 metres. She won two medals, silver and bronze, in the women's 400 m hurdles at the 2007 Summer Universiade in Bangkok, Thailand, and at the 2009 Summer Universiade in Belgrade, Serbia, clocking at 56.27 and 56.02 seconds, respectively. Tilgner is also a member of Bremer Leichtathletik Team, and is coached and trained by Jens Ellrott. Tilgner competed for the women's 4 × 400 m relay at the 2008 Summer Olympics in Beijing, along with her teammates Claudia Hoffmann, Florence Ekpo-Umoh, and Sorina Nwachukwu. Running the start-off leg, Tilgner recorded her individual-split time of 53.12 seconds, and the German team went on to an eighth-place finish in the final, for a total time of 3:28.45. References External links NBC 2008 Olympics profile German female sprinters German female hurdlers Living people Olympic athletes for Germany Athletes (track and field) at the 2008 Summer Olympics Sportspeople from Hanover Universiade medalists in athletics (track and field) 1984 births Universiade silver medalists for Germany Universiade bronze medalists for Germany Medalists at the 2007 Summer Universiade Medalists at the 2009 Summer Universiade
Lauri Elias Ala-Myllymäki (born 4 June 1997) is a Finnish professional footballer who plays as an attacking midfielder for Ilves. He began his senior club career playing for Ilves, before signing with Venezia in 2021. Ala-Myllymäki has played for Finland in various youth national teams and is regarded as one of the most promising Finnish players in his age group. He is known as a set-piece specialist. Club career Ilves Ala-Myllymäki debuted on senior level on 15 June 2013 at the age of 16 in the ranks of Ilves in a match against KTP. Venezia On 5 November 2020, he signed a 3.5-year contract with Italian club Venezia. On 31 January 2022, Ala-Myllymäki joined Triestina on loan until 30 June 2023. Return to Ilves On 24 January 2023, Ala-Myllymäki returned to Ilves on a two-year contract. International career He has represented Finland at international youth levels and he played in 8 out of 10 2019 UEFA European Under-21 Championship qualification matches. Career statistics Honours Ilves Finnish Cup: 2019 Individual Ilves Player of the Year: 2016 Veikkausliiga Player of the Month: June 2019 Veikkausliiga Team of the Year: 2019 References External links U.S. Triestina Calcio official profile Lauri Ala-Myllymäki – SPL competition record 1997 births Living people Finnish men's footballers Finland men's youth international footballers Finland men's under-21 international footballers Men's association football midfielders Ilves (football) players Venezia FC players US Triestina Calcio 1918 players Veikkausliiga players Serie C players Finnish expatriate men's footballers Expatriate men's footballers in Italy
The Sonot Kkaazoot is the premier long-distance cross-country ski race in Fairbanks, Alaska. The race includes two events, a 50 km (31 mile) and 20 km (12.5 mile) course. Both events begin and end on the Chena River in downtown Fairbanks. Both events are freestyle, mass start and are raced simultaneously. Origins The race was founded in 1988 by noted Fairbanks skier Bob Baker. The name of the race is based on a Koyukon word which translates roughly as 'sliding around in early spring' and was used by Native people to describe the motion of cross-country skiers. This race has been virtual since 2020. Course Both the 20 km and 50 km events begin and end on the Chena River above the Cushman Street bridge in downtown Fairbanks. The course then proceeds up the Chena River, entering Fort Wainwright army post and continuing as far as the Birch Hill Ski & Snowboard Area. At that point the 20 km race turns around and returns via the same course back to the start/finish area. The 50 km course proceeds up the Birch Hill alpine ski hill to connect with the trails system at the Birch Hill Recreation Area. From there the course follows all of the trails in the Birch Hill system (excepting the classic-only trails) in a counter-clockwise direction. After approximately 27 km the course again returns to the top of the alpine ski hill and proceeds back to the river and to the start/finish area by the same route. In 2012 the 50 km race will make use of a new trail constructed to gain access to the Birch Hill Recreation Area. Rather than climbing directly up the alpine ski hill, the Sonot Connector trail climbs through the forest to the east of the ski hill, starting from the top of the rope tow and making two long switchbacks. Adjustments to the course are sometimes made due to weather or snow conditions. When it is not possible to hold the race on river, either due to ice conditions or cold temperatures, the race may be held entirely on the trail system at the Birch Hill Recreation Area, beginning and ending in the stadium area. In these cases the race is usually shortened to compensate for the addition of steeper terrain. In years of low snowfall when it is not possible to easily connect between the river and the alpine ski area, the race may be held entirely on the river. In this the 20 km course remains unchanged, but the 50 km course proceeds slightly further up the river before turning around at 12.5 km, returning to the start, and then doing another lap of the same course along the river. Past winners External links Sonot KKaazoot website Nordic Ski Club Fairbanks Sonot Kk'o'eelzoot, Talking Alaska blog post, March 15, 2009. Birch Hill Recreation Area Birch Hill Ski & Snowboard Area SportAlaska timing services 1988 establishments in Alaska Annual events in Alaska Cross-country skiing competitions March events Recurring sporting events established in 1988 Ski marathons in the United States Sports competitions in Alaska Tourist attractions in Fairbanks North Star Borough, Alaska
Dongshan Township ( or ), may refer to: Dongshan Township, Bama Yao Autonomous County, a township in Bama Yao Autonomous County, Guangxi Zhuang Autonomous Region, China Dongshan Township, Quanzhou County, a township in Quanzhou County, Guangxi Zhuang Autonomous Region, China Dongshan Dong Ethnic Township, Suining County, an ethnic township in Suining County, Hunan, China. Dongshan Township, Puge County, a township in Puge County, Sichuan, China. Dongshan Township, Tongjiang County, a township in Tongjiang County, Sichuan, China. Dongshan Township, Shanxi, a township in Fanzhi County, Shanxi, China. Dongshan Township, Qinghai, a township in Huzhu Tu Autonomous County, Qinghai, China. Dongshan Township, Inner Mongolia, a township in Songshan District of Chifeng, Inner Mongolia, China. Dongshan Township, Wenshan, a township in Wenshan City, Wenshan Zhuang and Miao Autonomous Prefecture, Yunan, China. Dongshan Township, Xiangyun County, a township in Xiangyun County, Dali Bai Autonomous Prefecture, Yunnan, China. Dongshan, Yilan, a township in Yilan County, Taiwan.
The men's +80 kg competition in taekwondo at the 2000 Summer Olympics in Sydney took place on 30 September at the State Sports Centre. 1997 World champion Kim Kyong-hun captured South Korea's third gold in the sport, as he prevailed over the local favorite Daniel Trenton of Australia 6–2 in the men's heavyweight final despite the ridicule and commotion from a raucous, partisan home crowd. The bronze medal was awarded to France's Pascal Gentil after he knocked out his Saudi Arabian opponent Khaled Al-Dosari in the second round of the repechage final match. Competition format The main bracket consisted of a single elimination tournament, culminating in the gold medal match. The taekwondo fighters eliminated in earlier rounds by the two finalists of the main bracket advanced directly to the repechage tournament. These matches determined the bronze medal winner for the event. Schedule All times are Greece Standard Time (UTC+2) Competitors Results Legend PTG — Won by points gap SUP — Won by superiority OT — Won on over time (Golden Point) WO — Walkover Main bracket Repechage References External links Official Report M81 2000 Men's events at the 2000 Summer Olympics
Heuglin's white-eye (Zosterops poliogastrus), also known as the Ethiopian white-eye (formerly the montane white-eye), is a species of bird in the family Zosteropidae. It is found in north-eastern and eastern Africa, primarily in Ethiopia and Kenya. Its natural habitats range from subtropical or tropical moist montane forests, to subtropical or tropical high-altitude shrubland, plantations, and rural gardens. The Mbulu white-eye, the south Pare white-eye and the broad-ringed white-eye were formerly considered as subspecies of Heuglin's white-eye. They were promoted to species rank based on a molecular phylogenetic study published in 2014. To reflect this change, the English name was changed from "montane white-eye" to "Heuglin's white-eye". There are three subspecies: Z. p. kulalensis (Kulal) Williams, JG, 1948 – Mount Kulal (north Kenya) Z. p. poliogastrus (Ethiopian) Heuglin, 1861 – southeast Sudan, Eritrea, north, central, and east Ethiopia Z. p. kaffensis (Kaffa) Neumann, 1902 – west and southwest Ethiopia Identification by subspecies Heuglin's white-eye (Kulal) The Kulal Heuglin's white-eye adult male is about 11-12 centimeters long. The male sex has different characteristics than the female. The male has a bright yellow forehead, and a lime-green crown (top of a bird's head) and upper feathers. Its flight feather colors vary from brownish black to grey and edge off with a matching green tint to its crown. Its tail is like its flight feathers, brownish black to grey with green edges. The belly is a bright white that fades into the color of its surrounding feathers. Different from the male, the female may have a yellow belly and wings that are mostly grey. Heuglin's white-eye (Ethiopian) The Ethiopian Heuglin's white-eye has a vivid yellow head and crown that extends all the way to its white eyering (a circle of color around a bird's eye) and a narrow black line extending from the eye to its black beak. Underneath the beak, the rest of the head is yellow as well. On the Ethiopian Heuglin's white-eye, the flight feathers have a lime-green coloration. The tips of the feathers then shift to a brownish black. Both sexes share the same attributes. Heuglin's white-eye (Kaffa) The crown of the Kaffa Heuglin's white-eye is rich green with a yellow forehead leading to its black bill. Under the beak, yellow and green are the dominant colors of the chin. Its eyering is white and is slightly larger than the Ethiopian white-eye's. Depending on their diet, their flight feathers are brownish-black that fade into a yellow-green edge. The tail generally matches the flight feathers but tends to be a shiny, dark brown. The breast of the bird has green flanks (the sides of the bird's body) that fade into a yellow-tinged middle. Both sexes share the same attributes. Habitat and distribution During the dry season, the Heuglin's white-eye are commonly found in large flocks of up to fifty birds. However, in the wet season, flocks of this size are only seen in the early mornings or late afternoons. The habitat of the Heuglin's white-eye varies by subspecies. Heuglin's white-eye (Kulal) The Heuglin's white-eye (Kulal) habitat typically consists of forest edges and wet bush. However, during the wet season they can be found in drier bush at lower altitudes, and in the dry season they can be found in montane forests at higher altitudes. Heuglin's white-eye (Ethiopian) The Heuglin's white-eye (Ethiopian) habitat generally consists of woodland and forest edges, as well as isolated cultivations. In these areas, they commonly live in younger growths or shorter trees. They live anywhere from 1340 to 3640 meters in Ethiopia and above 1800 meters in South Sudan. Heuglin's white-eye (Kaffa) The Heuglin's white-eye (Kaffa) habitat generally consists of woodland and forest edges, as well as highlands with younger areas of secondary growth. They typically live within the 1340 to 3640 meter elevational band (a section of altitude above sea level). Migration Both the Heuglin's white-eye (Ethiopian) and (Kaffa) are nonmigrants (sedentary), while the Heuglin's white-eye (Kulal) descends from higher to lower altitudes as the wet season approaches. Diet The Heuglin's white-eye diet mainly consists of berries and small insects. However, in the months of September and November they can be found foraging on Leonotis flowers. During the dry season, this bird is mainly frugivorous, while insectivorous in the wet season. References Heuglin's white-eye Birds of East Africa Heuglin's white-eye Taxa named by Theodor von Heuglin Taxonomy articles created by Polbot
```objective-c // -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; -*- // (c) 2020 Henner Zeller <h.zeller@acm.org> // // This program is free software; you can redistribute it and/or modify // the Free Software Foundation version 2. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // along with this program. If not, see <path_to_url #ifndef VIDEO_SOURCE_H_ #define VIDEO_SOURCE_H_ #include <signal.h> #include "image-source.h" #include "terminal-canvas.h" #include "timg-time.h" struct AVCodecContext; struct AVFormatContext; struct AVFrame; struct AVPacket; struct SwsContext; namespace timg { // Video source, meant for one video to load, and if successful, Play(). class VideoSource final : public ImageSource { public: explicit VideoSource(const std::string &filename); ~VideoSource() final; static const char *VersionInfo(); // Attempt to load given filename as video, open stream and set-up scaling. // Returns true on success. bool LoadAndScale(const DisplayOptions &options, int frame_offset, int frame_count) final; // Play video up to given duration. // // The reference to the "interrupt_received" can be updated by a signal // while the method is running and shall be checked often. void SendFrames(const Duration &duration, int loops, const volatile sig_atomic_t &interrupt_received, const Renderer::WriteFramebufferFun &sink) final; // Format title according to the format-string. std::string FormatTitle(const std::string &format_string) const final; bool IsAnimationBeforeFrameLimit() const override { return true; } private: void AlphaBlendFramebuffer(); DisplayOptions options_; bool maybe_transparent_ = false; int frame_offset_ = 0; int frame_count_ = -1; int orig_width_, orig_height_; int video_stream_index_ = -1; AVFormatContext *format_context_ = nullptr; AVCodecContext *codec_context_ = nullptr; SwsContext *sws_context_ = nullptr; timg::Duration frame_duration_; // 1/fps timg::Framebuffer *terminal_fb_ = nullptr; int center_indentation_ = 0; }; } // namespace timg #endif // VIDEO_SOURCE_H_ ```
The 2022 Portland City Commission elections were held on May 17, 2022, and November 8, 2022. 2 positions are up for election. Position 2 and Position 3 are held by Dan Ryan and Jo Ann Hardesty respectively who have both running for re-election. Portland has no term-limits on officeholders. Position 2 Incumbent Dan Ryan has filed for re-election. Four other candidates have also filed to run for the seat and two additional candidates have filed but since withdrawn from the race. Candidates Dan Ryan, incumbent City Commissioner Sandeep Bali Chris Brummer Avraham Cox Steven Cox Michael Simpson, X-Ray technician and volunteer for AFL–CIO Renee Stephens Sophie Sumney-Koivisto, karaoke Host Alanna Joy "AJ" McCreary, founder and executive director of Equitable Giving Circle Withdrawn Jamila Aurora Dozier, Policy Coordinator at Portland Housing Bureau Brandon Farley Results Position 3 Incumbent Jo Ann Hardesty filed for re-election. Seven other candidates have also filed to run for the seat, including Rene Gonzalez, a local attorney. Since no candidate received a majority of votes in the May primary election, Hardesty and Gonzalez, the top two vote-getters, both advanced to the November general election. Gonzalez won in November, with 52.59% of the vote (as of November 23, 2022), emphasizing law-and-order policies and promising to crack down on homelessness. Candidates Jo Ann Hardesty, incumbent City Commissioner Peggy Sue Owens, glass company administrator Vadim Mozyrsky, administrative law judge Rene Gonzalez, attorney Dale Hardt Chad Leisey, business owner and volunteer firefighter Jeffrey A. Wilebski, teacher and school administrator Karellen Stephens Results References Portland, Oregon City Commission Portland, Oregon City Commission Portland City Council elections
Andreas Chyliński (also known as Andrzej Chyliński) (b. ca. 1590 in Poland; d. after 1635 in Padua) was a Polish composer. His life is not well known; between 1630 and 1635 he lived as a Franciscan Friar in Padua, where he was maestro di cappella at the church of Sant'Antonio. Of his music, sixteen canons survive. 1590s births 17th-century deaths Polish Baroque composers Italian male classical composers 17th-century Italian composers Italian Baroque composers 17th-century male musicians Polish composers Polish male classical composers 17th-century classical composers
```c++ /* Boost.MultiIndex test for projection capabilities. * * (See accompanying file LICENSE_1_0.txt or copy at * path_to_url * * See path_to_url for library home page. */ #include "test_projection.hpp" #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include "pre_multi_index.hpp" #include "employee.hpp" #include <boost/detail/lightweight_test.hpp> using namespace boost::multi_index; void test_projection() { employee_set es; es.insert(employee(0,"Joe",31,1123)); es.insert(employee(1,"Robert",27,5601)); es.insert(employee(2,"John",40,7889)); es.insert(employee(3,"Albert",20,9012)); es.insert(employee(4,"John",57,1002)); employee_set::iterator it,itbis; employee_set_by_name::iterator it1; employee_set_by_age::iterator it2; employee_set_as_inserted::iterator it3; employee_set_by_ssn::iterator it4; employee_set_randomly::iterator it5; BOOST_STATIC_ASSERT((boost::is_same< employee_set::iterator, nth_index_iterator<employee_set,0>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_name::iterator, nth_index_iterator<employee_set,1>::type >::value)); #if defined(BOOST_NO_MEMBER_TEMPLATES) BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_age::iterator, index_iterator<employee_set,age>::type >::value)); #else BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_age::iterator, employee_set::index_iterator<age>::type >::value)); #endif BOOST_STATIC_ASSERT((boost::is_same< employee_set_as_inserted::iterator, nth_index_iterator<employee_set,3>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_ssn::iterator, nth_index_iterator<employee_set,4>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_randomly::iterator, nth_index_iterator<employee_set,5>::type >::value)); it= es.find(employee(1,"Robert",27,5601)); it1= project<name>(es,it); it2= project<age>(es,it1); it3= project<as_inserted>(es,it2); it4= project<ssn>(es,it3); it5= project<randomly>(es,it4); #if defined(BOOST_NO_MEMBER_TEMPLATES) itbis=project<0>(es,it5); #else itbis=es.project<0>(it5); #endif BOOST_TEST( *it==*it1&&*it1==*it2&&*it2==*it3&&*it3==*it4&&*it4==*it5&&itbis==it); BOOST_TEST(project<name>(es,es.end())==get<name>(es).end()); BOOST_TEST(project<age>(es,es.end())==get<age>(es).end()); BOOST_TEST(project<as_inserted>(es,es.end())==get<as_inserted>(es).end()); BOOST_TEST(project<ssn>(es,es.end())==get<ssn>(es).end()); BOOST_TEST(project<randomly>(es,es.end())==get<randomly>(es).end()); const employee_set& ces=es; employee_set::const_iterator cit,citbis; employee_set_by_name::const_iterator cit1; employee_set_by_age::const_iterator cit2; employee_set_as_inserted::const_iterator cit3; employee_set_by_ssn::const_iterator cit4; employee_set_randomly::const_iterator cit5; BOOST_STATIC_ASSERT((boost::is_same< employee_set::const_iterator, nth_index_const_iterator<employee_set,0>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_name::const_iterator, nth_index_const_iterator<employee_set,1>::type >::value)); #if defined(BOOST_NO_MEMBER_TEMPLATES) BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_age::const_iterator, index_const_iterator<employee_set,age>::type >::value)); #else BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_age::const_iterator, employee_set::index_const_iterator<age>::type >::value)); #endif BOOST_STATIC_ASSERT((boost::is_same< employee_set_as_inserted::const_iterator, nth_index_const_iterator<employee_set,3>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_by_ssn::const_iterator, nth_index_const_iterator<employee_set,4>::type >::value)); BOOST_STATIC_ASSERT((boost::is_same< employee_set_randomly::const_iterator, nth_index_const_iterator<employee_set,5>::type >::value)); cit= ces.find(employee(4,"John",57,1002)); #if defined(BOOST_NO_MEMBER_TEMPLATES) cit1= project<by_name>(ces,cit); #else cit1= ces.project<by_name>(cit); #endif cit2= project<age>(ces,cit1); #if defined(BOOST_NO_MEMBER_TEMPLATES) cit3= project<as_inserted>(ces,cit2); #else cit3= ces.project<as_inserted>(cit2); #endif cit4= project<ssn>(ces,cit3); cit5= project<randomly>(ces,cit4); citbis=project<0>(ces,cit5); BOOST_TEST( *cit==*cit1&&*cit1==*cit2&&*cit2==*cit3&&*cit3==*cit4&&*cit4==*cit5&& citbis==cit); } ```
```java package com.example.polly; // snippet-start:[polly.java2.demo.main] // snippet-start:[polly.java2.demo.import] import javazoom.jl.decoder.JavaLayerException; import software.amazon.awssdk.core.ResponseInputStream; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.polly.PollyClient; import software.amazon.awssdk.services.polly.model.DescribeVoicesRequest; import software.amazon.awssdk.services.polly.model.Voice; import software.amazon.awssdk.services.polly.model.DescribeVoicesResponse; import software.amazon.awssdk.services.polly.model.OutputFormat; import software.amazon.awssdk.services.polly.model.PollyException; import software.amazon.awssdk.services.polly.model.SynthesizeSpeechRequest; import software.amazon.awssdk.services.polly.model.SynthesizeSpeechResponse; import java.io.IOException; import java.io.InputStream; import javazoom.jl.player.advanced.AdvancedPlayer; import javazoom.jl.player.advanced.PlaybackEvent; import javazoom.jl.player.advanced.PlaybackListener; // snippet-end:[polly.java2.demo.import] /** * Before running this Java V2 code example, set up your development * environment, including your credentials. * * For more information, see the following documentation topic: * * path_to_url */ public class PollyDemo { private static final String SAMPLE = "Congratulations. You have successfully built this working demo " + " of Amazon Polly in Java Version 2. Have fun building voice enabled apps with Amazon Polly (that's me!), and always " + " look at the AWS website for tips and tricks on using Amazon Polly and other great services from AWS"; public static void main(String args[]) { PollyClient polly = PollyClient.builder() .region(Region.US_WEST_2) .build(); talkPolly(polly); polly.close(); } public static void talkPolly(PollyClient polly) { try { DescribeVoicesRequest describeVoiceRequest = DescribeVoicesRequest.builder() .engine("standard") .build(); DescribeVoicesResponse describeVoicesResult = polly.describeVoices(describeVoiceRequest); Voice voice = describeVoicesResult.voices().stream() .filter(v -> v.name().equals("Joanna")) .findFirst() .orElseThrow(() -> new RuntimeException("Voice not found")); InputStream stream = synthesize(polly, SAMPLE, voice, OutputFormat.MP3); AdvancedPlayer player = new AdvancedPlayer(stream, javazoom.jl.player.FactoryRegistry.systemRegistry().createAudioDevice()); player.setPlayBackListener(new PlaybackListener() { public void playbackStarted(PlaybackEvent evt) { System.out.println("Playback started"); System.out.println(SAMPLE); } public void playbackFinished(PlaybackEvent evt) { System.out.println("Playback finished"); } }); // play it! player.play(); } catch (PollyException | JavaLayerException | IOException e) { System.err.println(e.getMessage()); System.exit(1); } } public static InputStream synthesize(PollyClient polly, String text, Voice voice, OutputFormat format) throws IOException { SynthesizeSpeechRequest synthReq = SynthesizeSpeechRequest.builder() .text(text) .voiceId(voice.id()) .outputFormat(format) .build(); ResponseInputStream<SynthesizeSpeechResponse> synthRes = polly.synthesizeSpeech(synthReq); return synthRes; } } // snippet-end:[polly.java2.demo.main] ```
Tuř is a municipality and village in Jičín District in the Hradec Králové Region of the Czech Republic. It has about 100 inhabitants. History In 2019, the village of Hubálov, originally part of Tuř, was joined to Jičín. The transfer of the entire cadastral territory is unique in the modern history of the country. References Villages in Jičín District
```lua local unicode = require('tools.utils.unicode') local myopt = { { '-mode', 'conservative', [[Define how aggressive should the tokenization be. `aggressive` only keeps sequences of letters/numbers, `conservative` allows a mix of alphanumeric as in: "2,000", "E65", "soft-landing", etc. `space` is doing space tokenization. `char` is doing character tokenization]], { enum = {'space', 'conservative', 'aggressive', 'char'} } } } local function declareOptsFn(cmd) cmd:setCmdLineOptions(myopt, 'Tokenizer') end local function mytokenization(opt, line) -- fancy tokenization, it has to return a table of tokens (possibly with features) if opt.mode == "char" then local tokens = {} for v, c, _ in unicode.utf8_iter(line) do if unicode.isSeparator(v) then table.insert(tokens, '') else table.insert(tokens, c) end end return tokens end end local function mydetokenization(opt, words, _) if opt.mode == "char" then return table.concat(words, ''):gsub('', ' ') end end return { tokenize = mytokenization, detokenize = mydetokenization, hookName = function() return "chartok" end, declareOpts = declareOptsFn } ```
Gantang () is a rural town in Jingzhou Miao and Dong Autonomous County, Hunan, China. As of the 2017 census it had a population of 24,000 and an area of . Miao and Dong people account for 86.7% of the total population in the town. It has the reputation of "granary" and "fruit town" in Jingzhou County. It is surrounded by Shaxi Township on the north, Taiyangping Township on the west, Wenxi Township on the east, and Quyang Town on the south. History After the founding of the Communist State in 1950, Gantang Township was established. In 1958 it was renamed "Gantang People's Commune". In 1984 it was upgraded to a town. Administrative division As of 2017, the town is divided into 17 villages: Hongguang (), Xikou (), Pingyuan (), Liaoyuan (), Tangtou (), Diling (), Tiandi (), Gaofeng (), Gupo (), Lequn (), Longfeng (), Jianguo (), Daqiao (), Zhaixing (), Shamu (), Shanmen (), Nongchang (), and one community: Gantang Community (). Geography There are two reservoirs in the town: Diling Reservoir () and Shuita'ao Reservoir (). The Qushui River () passes through the western town. Economy The town's economy is based on nearby mineral resources and agricultural resources. Mineral resources are mainly gold, coal and bauxite. Township enterprises are mainly building materials. Transportation The G65 Baotou–Maoming Expressway is a north-south highway in the town. The town is connected to the Jiaozuo–Liuzhou railway. References Towns of Huaihua Jingzhou Miao and Dong Autonomous County
· February 15 - Eastern Orthodox liturgical calendar - February 17 All fixed commemorations below are observed on March 1 (February 29 on leap years) by Eastern Orthodox Churches on the Old Calendar. For February 16th, Orthodox Churches on the Old Calendar commemorate the Saints listed on February 3. Saints Hieromartyrs Pamphilus of Caesarea, Priest, and 11 companions, at Caesarea in Palaestina (c. 307-309): Valens, Deacon, and Martyrs Paul, Seleucus, Porphyrius, Julian, Theodulus, Elias, Jeremiah, Isaiah, Samuel, and Daniel. Saint Maruthas of Martyropolis, Bishop of Sophene and Martyropolis (422), and the Martyrs of Persia (4th century), whose relics rest in Martyropolis. Saint Flavian I of Antioch, Archbishop of Antioch (404) (see also: September 27) Saint Flavian the Confessor, Archbishop of Constantinople (449) Venerable Flavian the Hermit, monastic and Wonderworker. Saint Mary the New, of Byzia in Thrace (9th century) Pre-Schism Western saints Saint Onesimus, of the Seventy Apostles (c. 68) (see also: February 15) Saint Honestus (Honestus of Nîmes), a disciple of Saturninus of Toulouse, who preached the Gospel in Spain (270) Saint Faustinus of Brescia, Bishop of Brescia and Confessor (381) Hieromartyr Tanco of Verden, Bishop of Verden (815) Post-Schism Orthodox saints New Monk-martyr Romanus of Karpenision and Kapsokalyvia, Mount Athos, at Constantinople (1694) (see also January 5) Saint Basil Gryaznov of Pavlovo-Posadsky (1869) Saint Macarius (Nevsky), Metropolitan of Moscow, Apostle to the Altai (1926) Saint Nicholas of Japan, Archbishop and Equal-to-the-Apostles (1912) (New Calendar date see also: February 3) New martyrs and confessors New Hieromartyr Peter Lagov, Priest (1931) New Hieromartyr Elias Chetverukhin, Priest, of Moscow (1934) New Hieromartyr Paul, Priest (1938) Other commemorations Translation of the relics of Virgin-martyr Juliana of Nicomedia (304) (see also December 21) Synaxis of the 'Cypriot' Icon of the Theotokos. Icon gallery Notes References Sources February 16 / March 1. Orthodox Calendar (Pravoslavie.ru). March 1 / February 16. Holy Trinity Russian Orthodox Church (A parish of the Patriarchate of Moscow). February 16. OCA - The Lives of the Saints. The Autonomous Orthodox Metropolia of Western Europe and the Americas. St. Hilarion Calendar of Saints for the year of our Lord 2004. St. Hilarion Press (Austin, TX). p. 15. The Sixteenth Day Day of the Month of February. Orthodoxy in China. February 16. Latin Saints of the Orthodox Patriarchate of Rome. The Roman Martyrology. Transl. by the Archbishop of Baltimore. Last Edition, According to the Copy Printed at Rome in 1914. Revised Edition, with the Imprimatur of His Eminence Cardinal Gibbons. Baltimore: John Murphy Company, 1916. pp. 49–50. Rev. Richard Stanton. A Menology of England and Wales, or, Brief Memorials of the Ancient British and English Saints Arranged According to the Calendar, Together with the Martyrs of the 16th and 17th Centuries. London: Burns & Oates, 1892. p. 72. Greek Sources Great Synaxaristes: 16 Φεβρουαρίου. Μεγασ Συναξαριστησ. Συναξαριστής. 16 Φεβρουαρίου. Ecclesia.gr. (H Εκκλησια Τησ Ελλαδοσ). Russian Sources 1 марта (16 февраля). Православная Энциклопедия под редакцией Патриарха Московского и всея Руси Кирилла (электронная версия). (Orthodox Encyclopedia - Pravenc.ru). February in the Eastern Orthodox calendar
Solar street lights are raised light sources which are powered by solar panels generally mounted on the lighting structure or integrated into the pole itself. The solar panels charge a rechargeable battery, which powers a fluorescent or LED lamp during the night. Features Most solar lights turn on and turn off automatically by sensing outdoor light using solar panel voltage. Solar streetlights are designed to work throughout the night. Many can stay lit for more than one night if the sun is not in the sky for an extended period of time. Older models included lamps that were not fluorescent or LED. Solar lights installed in windy regions are generally equipped with flat panels to better cope with the winds. Modern designs use wireless technology and fuzzy control theory for battery management. The street lights using this technology can operate as a network with each light having the capability of performing the turning on and off of the network. Components Solar street lights consist of four main parts: Solar panel The solar panel is one of the most important parts of a solar street light, as the solar panel can convert solar energy into electricity that the lamps can use. There are two types of solar panels commonly used in solar street lights: monocrystalline and polycrystalline. The conversion rate of mono-crystalline solar panels is much higher than their poly-crystalline counterparts. Solar panels also vary in wattage systems. Lighting fixture LEDs are usually used as the primary lighting source of modern solar street lights, as the LED will provide much higher luminosity with lower energy consumption. The energy consumption of an LED fixture is at least 50% lower than the HPS fixture counterpart which is widely used as the lighting source in traditional street lights. A lack of warm-up time in LEDs also allows for use of motion detectors for additional efficiency gains. Rechargeable battery Batteries will store the electricity generated by the solar panel during the day and provide energy to the fixture during the night. The life cycle of the battery is very important to the lifetime of the light and the capacity of the battery will affect the backup days of the lights. There are two types of batteries commonly used in solar-powered street lights- gel cell deep cycle batteries as well as lead acid batteries. Lithium-ion batteries are also popular due to their compact size. Pole Strong poles are necessary to all street lights, especially to solar street lights as there are often components mounted on the top of the pole: fixtures, panels and sometimes batteries. However, in some newer designs, the PV panels and all electronics are integrated in the pole itself. Wind resistance is also a factor. In addition, accessories do exist for these types of poles, such as a foundation cage and battery box. Type Each street light can have its own photo voltaic panel, independent of other street lights. Alternately, a number of panels can be installed as a central power source on a separate location and supply power to a number of street lights. All-in-one type solar street lights are gaining popularity due to their compact design which incorporates all of the parts necessary in a compact manner including the battery. The city of Las Vegas, Nevada was the first city in the world that tested new EnGoPlanet Solar Street lights which are coupled with kinetic tiles that produce electricity when people walk over them. Advantages Solar street lights are independent of the utility grid. Hence, the operation costs are minimized. Solar street lights require much less maintenance compared to conventional street lights. Since external wires are eliminated, risk of accidents are minimized. Electricity produced from solar panels is non-pollutive. Separate parts of a solar panel system can easily be transported. Energy costs can be saved. Disadvantages Initial investment is higher compared to conventional street lights. Risk of theft is higher as equipment costs are comparatively higher. Snow or dust, combined with moisture can accumulate on horizontal PV-panels and reduce or even stop energy production. Rechargeable batteries will need to be replaced several times over the lifetime of the fixtures adding to the total lifetime cost of the light. Countries that have less Sunlight time or mostly Cloudy in nature can not be feasible to use outdoor light of solar products. It is very delegated and if it been broken it cost a lots more that a normal light. The charge and discharge cycles of the battery are also very important considering the overall cost of the project. See also Light pollution List of solar-powered products Street light References Street light Street lighting Applications of photovoltaics
```yaml decrypt: my:name: '["value"]' paths: my:name: value: - value string: '["value"]' redacted: '["value"]' object: HRAADltdaW50ZXJmYWNlIHt9/4MCAQL/hAABEAAAFf+EEgABBnN0cmluZwwHAAV2YWx1ZQ== secure: false isObject: true my:name[0]: value: value string: value redacted: value object: EhAABnN0cmluZwwHAAV2YWx1ZQ== secure: false isObject: false ```
A civilian casualty occurs when a civilian is killed or injured by non-civilians, mostly law enforcement officers, military personnel, rebel group forces, or terrorists. Under the law of war, it refers to civilians who perish or suffer wounds as a result of wartime acts. The term is generally applied to situations in which violence is committed in pursuit of political goals. During periods of armed conflict, there are structures, actors, and processes at a number of levels that affect the likelihood of violence against civilians. The term "civilian casualties" is sometimes used in non-military situations, for example to distinguish casualties to police vs. to criminals such as bank robbers. Overview In times of armed conflict, despite numerous advancements in technology, the European Union's European Security Strategy, adopted by the European Council in Brussels in December 2003, stated that since 1990, almost 4 million people have died in wars, 90% of them civilians. However, United Nations Children's Fund (UNICEF) reports that civilian fatalities have climbed from 5 per cent at the turn of the century to more than 90 per cent in the wars of the 1990s. Generating reliable assessments of casualties of war is a notoriously complex process. Civilian casualties present particular difficulties. One problem is that the attribution of the label 'civilian' is contested in some cases. On the surface, the definition of a civilian, at least in the context of international armed conflicts, is relatively simple: a civilian is any person who is not a member of the armed forces and is not a combatant in situation of armed conflict. To make effective use of such statistics as there are about civilian casualties of war, it is necessary to be explicit about the criteria for inclusion. All too often, there is a lack of clarity about which of the following categories of civilian casualties are included in any given set of figures. Those killed as a direct effect of war; Those injured as a direct effect of war; Those dying, whether during or after a war, from indirect effects of war such as disease, malnutrition and lawlessness, and who would not have been expected to die at such rates from such causes in the absence of the war; Victims of one-sided violence, such as when states slaughter their own citizens in connection with a war; Victims of rape and other forms of sexual violence in connection with a war; Those uprooted in a war – that is, refugees and Internally Displaced Persons (IDPs); Those who, even after a war is over, die prematurely from injuries sustained in war. The inclusion of people in each of these categories may be defensible, but needs to be explicit. Each category presents its own methodological problems. In the case of people dying from indirect effects (category 3), much careful work is needed to distinguish between 'expected' and 'excess' levels of mortality. In the case of victims of sexual crimes (category 5) there could be an argument for including not only direct crimes by combatants, but also 'indirect' crimes due to general social collapse. In the case of those uprooted in war (category 6), the implication that refugees and IDPs always count as war victims is too simple. Some may be fleeing one-sided violence from a repressive state apparatus, natural calamity, or general social breakdown. Moreover, in certain episodes, such as the Indo-Pakistani War of 1971, the Kosovo War of 1999, and the Afghanistan War of 2001, military campaigns have enabled large numbers of refugees to return home. Indeed, in the 1971 and 1999 wars, refugee return was a stated reason for launching hostilities. Yet this key observation finds remarkably little reflection in the literature about the casualties of contemporary war. A focus on the numbers of those uprooted in war is especially problematic as those who are trapped in conflict zones may in fact be worse off than those uprooted, but seldom feature in statistics. Figures for war deaths and for war-related migration should be presented separately, not amalgamated. International law Following the Second World War, a series of treaties governing the laws of war were adopted starting in 1949. These Geneva Conventions would come into force, in no small part, because of a general reaction against the practices of the Second World War. Although the Fourth Geneva Convention attempted to erect some legal defenses for civilians in time of war, the bulk of the Fourth Convention devoted to explicating civilian rights in occupied territories, and no explicit attention is paid to the problems of bombardment and the hazardous effects in the combat-zone. In 1977, Protocol I was adopted as an amendment to the Geneva Conventions, prohibiting the deliberate or indiscriminate attack of civilians and civilian objects in the war-zone and the attacking force must take precautions and steps to spare the lives of civilians and civilian objects as possible. Although ratified by 173 countries, the only countries that are currently not signatories to Protocol I are the United States, Israel, Iran, Pakistan, India, and Turkey. The Rome Statute defines that "intentionally directing attacks against the civilian population" to be illegal, but only came into effect on 1 July 2002 and has not been ratified by every country. Ethics Many modern nations' views on the ethics of civilian casualties align with the Just War theory, which advocates a system of proportionality. An act of war is deemed proportional in Just War theory if the overall destruction expected from the use of force is outweighed by the projected good to be achieved. This view is a war-adapted version of utilitarianism, the moral system which advocates that the morally correct action is the one that does the most good. However, moral philosophers often contest this approach to war. Such theorists advocate absolutism, which holds there are various ethical rules that are, as the name implies, absolute. One such rule is that non-combatants cannot be attacked because they are, by definition, not partaking in combat; to attack non-combatants anyway, regardless of the expected outcome, is to deny them agency. Thus, by the absolutist view, only enemy combatants can be attacked. The philosopher Thomas Nagel advocates this absolutist rule in his essay "War and Massacre". Finally, the approach of pacifism is the belief that war of any kind is morally unjust. Pacifists sometimes extend humanitarian concern not just to enemy civilians but also to enemy combatants, especially conscripts. Refugees The laws of war have changed over the course of history, and international protocols like the Fourth Geneva Convention explicitly provide legal protections to civilians in territories occupied by a belligerent party during and after an international armed conflict. The 1951 Refugee Convention and the 1967 Protocol Relating to the Status of Refugees has also given protection to people who have a well founded fear of persecution. Some researchers have included refugees and internally displaced persons in their definition of "civilian casualty". Civilian casualty ratio The civilian casualty ratio in an armed conflict is the ratio of civilian casualties to combatant casualties or total casualties. The measurement can apply either to casualties inflicted by a particular belligerent or to casualties in the conflict as a whole. The ratio of ten civilian casualties for every combatant is a frequently-cited, but disputed figure. Collateral damage Collateral damage is defined in terms of armed conflict as unavoidable or accidental killing or injury of non-combatants or unavoidable or accidental destruction of non-combatant property caused by attacks on legitimate military targets. See also Casualty recording Casualty (person) Concentration camps List of concentration and internment camps Nazi concentration camps Wartime sexual violence References Further reading Counting Civilian Casualties: An Introduction to Recording and Estimating Non-military Deaths in Conflict. Twentieth Century Atlas - Death Tolls WAR STATS REDIRECT WAR STATS REDIRECT WAR STATS REDIRECT Twentieth Century Atlas - Death Tolls Twentieth Century Atlas - Death Tolls Twentieth Century Atlas - Death Tolls Selected Death Tolls for Wars, Massacres and Atrocities Before the 20th Century The world's worst massacres, by Greg Brecht. Fall, 1987. Whole Earth Review. Law of war International criminal law War casualties
Vaiva Vo (O'odham) name translates as "Cocklebur Pond", is a census-designated place in Pinal County, in the U.S. state of Arizona. Its population was 93 as of the 2020 census. It is located on the northwestern part of the Tohono O'odham Nation reservation. Population At the 2020 census there were 147 people, 30 households, and 24 families living in the CDP. The population density was 319 people per square mile. There were 34 housing units. The median household income was $28,523. The per capita income for the CDP was $8,275. Demographics The population was 128 at the 2010 census. As of 2019, the population has risen to 142. Primary coordinates The primary coordinate point for Vaiva Vo is located at latitude 32.7178 and longitude -111.9265 in Pinal County. Climate Vaivo Vo has a nice summertime climate and is best visited during the months of February to November. This is when the weather is most pleasant with hot temperatures and limited rainfall. The highest average temperature in Vaiva Vo is 39 °C in June and the lowest is 17 °C in December. References Census-designated places in Pinal County, Arizona Census-designated places in Arizona Tohono O'odham Nation Populated places in the Sonoran Desert
```python # mypy: allow-untyped-defs from __future__ import annotations import atexit import collections import contextlib import copy import dataclasses import datetime import dis import enum import functools import gc import importlib import inspect import itertools import linecache import logging import math import operator import os import re import sys import textwrap import threading import time import types import typing import warnings import weakref from contextlib import contextmanager from functools import lru_cache from types import MethodWrapperType from typing import ( Any, Callable, cast, ClassVar, Counter, DefaultDict, Deque, Dict, Iterable, Iterator, KeysView, List, Optional, overload, Set, Tuple, Type, TypeVar, Union, ValuesView, ) from typing_extensions import Literal, TypeGuard import torch import torch._functorch.config import torch._inductor.config as inductor_config import torch.fx.experimental.symbolic_shapes import torch.utils._pytree as pytree from torch import fx from torch._C import ( _get_function_stack_at, _len_torch_function_stack, _pop_torch_function_stack, _push_on_torch_function_stack, ) from torch._dispatch.python import enable_python_dispatcher from torch._guards import TracingContext from torch._subclasses.meta_utils import is_sparse_compressed from torch._utils_internal import log_compilation_event from torch.fx._utils import _format_graph_code, lazy_format_graph_code from torch.nn.modules.lazy import LazyModuleMixin from torch.utils._triton import has_triton, has_triton_package from torch.utils.hooks import RemovableHandle try: import numpy as np except ModuleNotFoundError: np = None # type: ignore[assignment] try: import torch._logging import torch._numpy as tnp from torch._guards import detect_fake_mode # noqa: F401n from torch._logging import LazyString from . import config # NOTE: Make sure `NP_SUPPORTED_MODULES` and `NP_TO_TNP_MODULE` are in sync. if np: NP_SUPPORTED_MODULES: Tuple[types.ModuleType, ...] = ( np, np.fft, np.linalg, np.random, ) NP_TO_TNP_MODULE = { np: tnp, np.fft: tnp.fft, np.linalg: tnp.linalg, np.random: tnp.random, } else: NP_SUPPORTED_MODULES = () NP_TO_TNP_MODULE = {} from torch._subclasses.fake_tensor import FakeTensor, is_fake, maybe_get_fake_mode except ImportError: pass T = TypeVar("T") unpatched_nn_module_getattr = torch.nn.Module.__getattr__ counters: DefaultDict[str, Counter[str]] = collections.defaultdict(collections.Counter) optimus_scuba_log: Dict[str, Any] = {} troubleshooting_url = ( "path_to_url" ) nnmodule_doc_url = "path_to_url" nnmodule_doc_url_msg = f"See {nnmodule_doc_url} for more information and limitations." log = logging.getLogger(__name__) # profiling compilation time by function compilation_time_metrics: Dict[str, List[float]] = {} # profiling compilation time by frame phase frame_phase_timing: Dict[str, Dict[str, float]] = collections.defaultdict( lambda: collections.defaultdict(float) ) timer_counter = itertools.count() def tabulate( rows: Union[List[Tuple[str, object]], List[List[object]]], headers: Union[Tuple[str, ...], List[str]], ) -> str: try: import tabulate return tabulate.tabulate(rows, headers=headers) except ImportError: return "\n".join( ", ".join(map(str, row)) for row in itertools.chain([headers], rows) ) curr_frame = 0 # Note: Called for you by dynamo - you almost never ever want to invoke this yourself. def increment_frame() -> None: global curr_frame curr_frame = curr_frame + 1 # Note: Called for you by dynamo - you almost never ever want to invoke this yourself. def reset_frame_count() -> None: global curr_frame frame_phase_timing.clear() compilation_time_metrics.clear() curr_frame = 0 op_count = 0 def increment_op_count(cnt: int) -> None: global op_count op_count += cnt # Calculate total time spent so far for each phase # For example, {'entire_frame_compile':8.574629999999999, 'backend_compile':5.26806} def calculate_time_spent() -> Dict[str, float]: total_wall_time = 0.0 total_by_key = {} for timings in frame_phase_timing.values(): total_wall_time += timings.get( "entire_frame_compile", timings.get("inductor_compile", 0) ) for key, timing in timings.items(): if key not in total_by_key: total_by_key[key] = timing else: total_by_key[key] += timing if total_by_key: total_by_key["total_wall_time"] = total_wall_time return total_by_key # Print a report of time spent so far # Ex: # TIMING: # entire_frame_compile:8.574629999999999 # backend_compile:5.26806 def print_time_report() -> None: total_by_key = calculate_time_spent() out = "TIMING:" for key, value in total_by_key.items(): out = f"{out} {key}:{round(value, 5)}" print(out) def _add_time_spent(key: str, phase_name: str, time_spent: float) -> None: frame_phase_timing[key][phase_name] += time_spent # dynamo_timed is a context manager # By wrapping a function in dynamo_timed, we can store a record in compilation_time_metrics # where the key is the functions name. # For example: # # def _foo(...): # with dynamo_timed("_foo"): # ... # # Would show up as an entry in our timing dict: # OrderedDict([('_foo', [0.083690, 0.23949, 3.1425e-05])]) # This is extremely useful for granular debugging. # # Although it is tempting to use dynamo_timed as a decorator, please do not. # In its decorator form it makes cProfile traces less useful as dynamo_timed # suddenly becomes a bottleneck for lots of function calls (as only one parent # pointer is recorded). # # For a higher-level mode, pass a phase_name into dynamo_timed # phase_names record an extra record into a separate compilation timing structure, # one keyed on frame+name rather than function. # The frame is incremented outside of this function, in def increment_frame() above. # `fwd_only` is used to identify if this phase or function is only called # during compiling fwd graphs, e.g, `entire_frame_compile` and `backend_compile`. # The other phases (`inductor_compile` and `code_gen`) are called for both fwd and bwd graphs. @contextmanager def dynamo_timed( key: str, phase_name: Optional[str] = None, fwd_only: bool = True, ): if key not in compilation_time_metrics: compilation_time_metrics[key] = [] fail_type: Optional[str] = None fail_reason: Optional[str] = None time_spent = float("-inf") try: with torch.profiler.record_function(f"{key} (dynamo_timed)"): t0 = time.time() ChromiumEventLogger.log_event_start(key, time.time_ns()) if phase_name: ChromiumEventLogger.log_event_start(phase_name, time.time_ns()) yield if phase_name: ChromiumEventLogger.log_event_end(phase_name, time.time_ns()) ChromiumEventLogger.log_event_end(key, time.time_ns()) time_spent = time.time() - t0 compilation_time_metrics[key].append(time_spent) except Exception as e: fail_type = str(type(e)) fail_reason = str(e) raise finally: # Only record backward compilation metrics if phase_name is not None! if phase_name: frame_key = str(curr_frame) # fwd only compilation stages: entire_frame_compile, backend_compile. # use frame_key as time aggregation key. if fwd_only and fail_type is None: _add_time_spent(frame_key, phase_name, time_spent) else: # fwd + bwd compilation stages: inductor_compile, code_gen. # use frame_key as time aggregation key for fwd graphs; # use compile_id as time aggregation key for bwd graphs. if torch._guards.TracingContext.try_get() is not None: aot_graph_name = str( torch._guards.TracingContext.get().aot_graph_name ) if ( "forward" in aot_graph_name or "inference" in aot_graph_name ) and fail_type is None: _add_time_spent(frame_key, phase_name, time_spent) elif "backward" in aot_graph_name: compile_id = str( torch._guards.CompileContext.current_compile_id() ) if fail_type is None: _add_time_spent(compile_id, phase_name, time_spent) # log backward compilation metrics at the end of `inductor_compile` of bwd graph, # one record for one bwd graph. if phase_name == "inductor_compile": if fail_type is None: inductor_compile_time = frame_phase_timing[ compile_id ].get("inductor_compile", None) code_gen_time = frame_phase_timing[compile_id].get( "code_gen", None ) else: inductor_compile_time = None code_gen_time = None metrics = BwdCompilationMetrics( compile_id, inductor_compile_time, code_gen_time, fail_type, fail_reason, ) record_compilation_metrics(metrics) @overload def compile_times(repr: Literal["str"], aggregate: bool = False) -> str: ... @overload def compile_times( repr: Literal["csv"], aggregate: bool = False ) -> Tuple[List[str], List[object]]: ... def compile_times(repr="str", aggregate: bool = False): """ Get metrics about torchdynamo frontend/backend compilation times. Accumulates information from functions tagged with `dynamo_timed`. repr='str' returns a printable string for user interaction, and 'csv' returns headers, rows which can be logged for output aggregate causes values from multiple compilations (e.g. split graphs) to be accumulated into one value. If false, expect more than one value per metric. """ def fmt_fn(values, item_fn=lambda x: x): if aggregate: return item_fn(sum(values)) return ", ".join(map(item_fn, values)) if repr == "str": rows = [ (k, fmt_fn(compilation_time_metrics[k], item_fn=lambda x: f"{x:.4f}")) for k in compilation_time_metrics ] out = "TorchDynamo compilation metrics:\n" out += tabulate(rows, headers=("Function", "Runtimes (s)")) return out elif repr == "csv": values = [ fmt_fn(v, item_fn=lambda x: f"{x:.6f}") for v in compilation_time_metrics.values() ] headers = list(compilation_time_metrics.keys()) return headers, values return None @atexit.register def dump_compile_times() -> None: log.info(compile_times(repr="str", aggregate=True)) tensortype_to_dtype = { torch.FloatTensor: (torch.float32, torch.float), torch.DoubleTensor: (torch.float64, torch.double), torch.HalfTensor: (torch.float16, torch.half), torch.BFloat16Tensor: (torch.bfloat16,), torch.ByteTensor: (torch.uint8,), torch.CharTensor: (torch.int8,), torch.LongTensor: (torch.int64, torch.long), torch.IntTensor: (torch.int32, torch.int), torch.ShortTensor: (torch.int16, torch.short), torch.BoolTensor: (torch.bool,), } class DuplicateWarningChecker: def __init__(self, maxsize: int = 4096) -> None: self.maxsize = maxsize self.reset() def reset(self): self.set = collections.OrderedDict() def add(self, key: Union[str, Tuple[object, object]]) -> bool: if key in self.set: self.set.move_to_end(key, last=True) if not config.verbose: return False else: self.set[key] = None while len(self.set) > self.maxsize: self.set.popitem(last=False) return True graph_break_dup_warning_checker = DuplicateWarningChecker() def setup_compile_debug(): compile_debug = os.environ.get("TORCH_COMPILE_DEBUG", "0") == "1" if compile_debug: return add_file_handler() return contextlib.ExitStack() def reset_graph_break_dup_checker() -> None: graph_break_dup_warning_checker.reset() def add_file_handler(): log_path = os.path.join(get_debug_dir(), "torchdynamo") os.makedirs(log_path, exist_ok=True) log_file_handler = logging.FileHandler(os.path.join(log_path, "debug.log")) logger = logging.getLogger("torch._dynamo") logger.addHandler(log_file_handler) exitstack = contextlib.ExitStack() exitstack.callback(lambda: logger.removeHandler(log_file_handler)) return exitstack def setup_log_file(): exitstack = contextlib.ExitStack() if config.log_file_name is not None: log_file_handler = logging.FileHandler(config.log_file_name) for logger in torch._logging._internal.get_loggers(): logger.addHandler(log_file_handler) exitstack.callback(lambda: logger.removeHandler(log_file_handler)) return exitstack return exitstack def gen_record_file_name(exc, code) -> str: return f"{get_debug_dir()}/error_recordings/\ {code.co_name}_{type(exc).__name__}_{code.co_firstlineno}.rec" def write_record_to_file(filename: str, exec_record) -> None: try: if os.path.exists(filename): log.warning( "Unable to write execution record %s; file already exists.", filename ) else: os.makedirs(os.path.dirname(filename), exist_ok=True) with open(filename, "wb") as f: exec_record.dump(f) except Exception: log.exception("Unable to write execution record %s", filename) def count_calls(g: fx.Graph) -> int: c = 0 for n in g.nodes: if "call" in n.op: c += 1 return c def identity(x): return x def hashable(x): try: hash(x) return True except TypeError: return False # cannot hash writable memoryview object except ValueError: return False def nothing(*args, **kwargs): pass class ExactWeakKeyDictionary: """Similar to weakref.WeakKeyDictionary, but use `is`/`id` rather than `==` to compare equality""" def __init__(self): self.values = {} self.refs = {} def __getitem__(self, key): return self.values[id(key)] def get(self, key, default=None): return self.values.get(id(key), default) def __contains__(self, key): return id(key) in self.values def __setitem__(self, key, value): idx = id(key) if idx not in self.refs: self.refs[idx] = weakref.ref(key, lambda ref: self._remove_id(idx)) self.values[idx] = value def _remove_id(self, idx): if idx in self.values: del self.values[idx] if idx in self.refs: del self.refs[idx] def clear(self): self.refs.clear() self.values.clear() @overload def istype(obj: object, allowed_types: Type[T]) -> TypeGuard[T]: ... @overload def istype( obj: object, allowed_types: Tuple[Type[List[T]], Type[Tuple[T, ...]]] ) -> TypeGuard[T]: ... @overload def istype(obj: object, allowed_types: Iterable[type]) -> bool: ... def istype(obj, allowed_types): """isinstance() without subclasses""" if isinstance(allowed_types, (tuple, list, set)): return type(obj) in allowed_types return type(obj) is allowed_types if sys.version_info >= (3, 12): # Some typing classes moved to C in 3.12, # which no longer have the _Final mixin. _builtin_final_typing_classes = ( typing.ParamSpecArgs, typing.ParamSpecKwargs, typing.ParamSpec, typing.TypeVar, typing.TypeVarTuple, typing.TypeAliasType, ) def is_typing(value): # _Final catches most of typing classes: # - Any # - Callable # - Union # ... # # NB: we intentionally ignore classes that inherit from Generic, since they # can be used as both TypingVariable as well as UserDefinedClassVariable. if sys.version_info >= (3, 12) and isinstance(value, _builtin_final_typing_classes): return True return isinstance(value, typing._Final) or value is typing.Generic # type: ignore[attr-defined] def is_numpy_int_type(value): if not np: return False return istype( value, ( np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64, ), ) def is_numpy_float_type(value): if not np: return False return istype( value, ( np.float16, np.float32, np.float64, ), ) def is_lru_cache_wrapped_function(value): return isinstance(value, functools._lru_cache_wrapper) and is_function( inspect.getattr_static(value, "__wrapped__") ) def is_function_or_wrapper(value): return is_function(value) or isinstance( value, (torch._ops.OpOverloadPacket, torch._ops.OpOverload) ) def is_function(value): return isinstance( value, ( types.FunctionType, types.BuiltinFunctionType, types.MethodDescriptorType, types.WrapperDescriptorType, ), ) def is_wrapper_or_member_descriptor(value): return isinstance( value, ( # set up by PyGetSetDef types.GetSetDescriptorType, # set by PyMethodDef, e.g. list.append types.MethodDescriptorType, # slots - list.__add__ types.WrapperDescriptorType, # set up by PyMemberDef types.MemberDescriptorType, # wrapper over C functions types.MethodWrapperType, ), ) def unwrap_if_wrapper(fn): return unwrap_with_attr_name_if_wrapper(fn)[0] def unwrap_with_attr_name_if_wrapper(fn): # TODO(anijain2305) - Investigate if we can get rid of this function # unpack @torch._dynamo.optimize()(fn) wrapped function if is_function(fn) and inspect.getattr_static(fn, "_torchdynamo_inline", False): fn = inspect.getattr_static(fn, "_torchdynamo_inline", fn) attr_name = "_torchdynamo_inline" else: attr_name = None return fn, attr_name def is_numpy_ndarray(value): if not np: return False return istype(value, np.ndarray) def istensor(obj): """Check of obj is a tensor""" tensor_list: Tuple[type, ...] = ( torch.Tensor, torch.nn.Parameter, *config.traceable_tensor_subclasses, ) tensor_list = tensor_list + (torch._subclasses.FakeTensor,) return istype(obj, tensor_list) def is_lazy_module(mod): return isinstance(mod, LazyModuleMixin) @functools.lru_cache(4096) def print_once(*args): print(*args) def make_cell(val=None): """Some black magic to create a cell object that usually only exists in a closure""" x = val def f(): return x assert f.__closure__ is not None and len(f.__closure__) == 1 return f.__closure__[0] def proxy_args_kwargs(args, kwargs): try: proxy_args = tuple(arg.as_proxy() for arg in args) proxy_kwargs = {key: arg.as_proxy() for key, arg in kwargs.items()} return proxy_args, proxy_kwargs except NotImplementedError as e: from .exc import unimplemented from .variables.base import typestr unimplemented( f"call_function args: {typestr(*args)} {typestr(*list(kwargs.values()))}", from_exc=e, ) @dataclasses.dataclass class CompilationMetrics: compile_id: str frame_key: str co_name: str co_filename: str co_firstlineno: int cache_size: int accumulated_cache_size: int guard_count: Optional[int] shape_env_guard_count: Optional[int] graph_op_count: Optional[int] graph_node_count: Optional[int] graph_input_count: Optional[int] start_time: float entire_frame_compile_time_s: Optional[float] backend_compile_time_s: Optional[float] inductor_compile_time_s: Optional[float] code_gen_time_s: Optional[float] fail_type: Optional[str] fail_reason: Optional[str] fail_user_frame_filename: Optional[str] fail_user_frame_lineno: Optional[int] non_compliant_ops: Set[str] compliant_custom_ops: Set[str] restart_reasons: Set[str] dynamo_time_before_restart_s: float # Sometimes, we will finish analyzing a frame but conclude we don't want # to install any guarded code. True means we actually decided to install # a compiled frame has_guarded_code: bool possibly_missed_reinplacing_opportunities: Optional[int] @dataclasses.dataclass class BwdCompilationMetrics: compile_id: str inductor_compile_time_s: Optional[float] code_gen_time_s: Optional[float] fail_type: Optional[str] fail_reason: Optional[str] DEFAULT_COMPILATION_METRICS_LIMIT = 64 _compilation_metrics: Deque[ Union[CompilationMetrics, BwdCompilationMetrics] ] = collections.deque(maxlen=DEFAULT_COMPILATION_METRICS_LIMIT) def record_compilation_metrics( compilation_metrics: Union[CompilationMetrics, BwdCompilationMetrics] ): global _compilation_metrics _compilation_metrics.append(compilation_metrics) if isinstance(compilation_metrics, CompilationMetrics): name = "compilation_metrics" else: name = "bwd_compilation_metrics" torch._logging.trace_structured( name, lambda: { k: list(v) if isinstance(v, set) else v for k, v in dataclasses.asdict(compilation_metrics).items() }, ) if config.log_compilation_metrics: log_compilation_event(compilation_metrics) def set_compilation_metrics_limit(new_size: int) -> None: global _compilation_metrics while len(_compilation_metrics) > new_size: _compilation_metrics.popleft() new_deque = collections.deque(_compilation_metrics, maxlen=new_size) _compilation_metrics = new_deque def clear_compilation_metrics() -> None: global _compilation_metrics _compilation_metrics.clear() def get_compilation_metrics() -> List[Union[CompilationMetrics, BwdCompilationMetrics]]: return list(_compilation_metrics) class ChromiumEventLogger: """Logs chromium events to structured logs. tlparse will concatenate these into a perfetto UI link. See path_to_url#heading=h.yr4qxyxotyw for a specification of the Chromium Event JSON format. """ @staticmethod def log_event_start( event_name: str, time_ns: int, metadata: Optional[Dict[str, Any]] = None, ) -> None: """ Logs the start of a single event. :param str event_name Name of event to appear in trace :param time_ns Timestamp in nanoseconds :param metadata: Any extra metadata associated with this event """ ChromiumEventLogger._log_timed_event( event_name, time_ns, "B", metadata, ) @staticmethod def log_event_end( event_name: str, time_ns: int, metadata: Optional[Dict[str, Any]] = None, ) -> None: """ Logs the end of a single event. This function should only be called after log_event_start with the same event_name. :param event_name: Name of event to appear in trace :param time_ns: Timestamp in nanoseconds :param metadata: Any extra metadata associated with this event """ ChromiumEventLogger._log_timed_event( event_name, time_ns, "E", metadata, ) @staticmethod def _log_timed_event( event_name: str, time_ns: int, phase: str, metadata: Optional[Dict[str, Any]] = None, ) -> None: """ Logs a timed event in chromium format. See log_event_start, log_event_end, etc. """ event = { "name": event_name, "ts": time_ns / 1000, # Chromium events are in ms "args": metadata, "ph": phase, "pid": 0, # pid should be specified on all logs, we don't personally care about the actual process id } torch._logging.trace_structured( "chromium_event", payload_fn=lambda: event, suppress_context=False, expect_trace_id=False, # Not every chromium event will have a trace_id ) @staticmethod def log_instant_event( event_name: str, time_ns: int, metadata: Optional[Dict[str, Any]] = None, ) -> None: """ Log an instant event with no associated duration. :param str event_name: Name of event to appear in trace :param int time_ns Timestamp in nanoseconds :param Optional[Dict[str, Any]] metadata: Any extra metadata associated with this event :param str cname optional color for the arrow in the trace """ event = { "name": event_name, "ts": time_ns / 1000, "args": metadata, "ph": "i", "pid": 0, # pid should be specified on all logs, we don't personally care about the actual process id "s": "p", # We use "process" level instant events so they all appear on the same row in the trace. } torch._logging.trace_structured( "chromium_event", payload_fn=lambda: event, suppress_context=False, expect_trace_id=True, ) @dataclasses.dataclass class CleanupHook: """Remove a global variable when hook is called""" scope: Dict[str, Any] name: str def __call__(self, *args): # Make sure we're not shutting down if CleanupManager is not None: CleanupManager.count -= 1 del self.scope[self.name] @staticmethod def create(scope, name, val): assert name not in scope CleanupManager.count += 1 scope[name] = val return CleanupHook(scope, name) class CleanupManager(ExactWeakKeyDictionary): count = 0 instance: ClassVar[CleanupManager] def _remove_id(self, idx): for hook in self.values[idx]: hook() super()._remove_id(idx) CleanupManager.instance = CleanupManager() def clone_tensor(x): """Clone the tensor and its gradient""" y = x.clone().requires_grad_(x.requires_grad) if x.is_leaf and x.grad is not None: y.grad = x.grad.clone() return y def clone_input(x, *, dtype=None): """copy while preserving strides""" # TODO: this is questionable if is_fake(x): # this func fails on fake tensors in __torch_dispatch__ return x def torch_clone(x): y = torch.clone(x) if x.is_leaf: y.requires_grad_(x.requires_grad) if x.is_leaf and x.grad is not None: y.grad = clone_input(x.grad, dtype=dtype) if hasattr(x, "_dynamo_dynamic_indices"): y._dynamo_dynamic_indices = x._dynamo_dynamic_indices.copy() # type: ignore[attr-defined] return y with torch.no_grad(): if x.device.type == "xla": # Access data_ptr() for a xla tensor will cause crash return torch_clone(x) # Handle sparse storage (no stride). if x.layout is torch.sparse_coo: return torch.sparse_coo_tensor( torch_clone(x._indices()), torch_clone(x._values()), x.shape, is_coalesced=x.is_coalesced(), ) elif is_sparse_compressed(x): if x.layout in {torch.sparse_csr, torch.sparse_bsr}: compressed_indices = x.crow_indices() plain_indices = x.col_indices() else: compressed_indices = x.ccol_indices() plain_indices = x.row_indices() return torch.sparse_compressed_tensor( torch_clone(compressed_indices), torch_clone(plain_indices), torch_clone(x.values()), x.shape, layout=x.layout, ) needed_size = sum( (shape - 1) * stride for shape, stride in zip(x.size(), x.stride()) ) if x.is_quantized: result = torch.empty_quantized((needed_size + 32,), x) else: result = torch.empty( needed_size + 32, dtype=dtype or x.dtype, device=x.device ) cache_line_offset = ( (x.data_ptr() - result.data_ptr()) % 32 ) // x.element_size() result.as_strided_(x.size(), x.stride(), cache_line_offset) try: result.copy_(x.clone()) if x.is_leaf: result.requires_grad_(x.requires_grad) if x.is_leaf and x.grad is not None: result.grad = clone_input(x.grad, dtype=dtype) except RuntimeError: # RuntimeError: unsupported operation: more than one element of the written-to # tensor refers to a single memory location. Please clone() the tensor before # performing the operation. return torch_clone(x) if hasattr(x, "_dynamo_dynamic_indices"): result._dynamo_dynamic_indices = x._dynamo_dynamic_indices.copy() # type: ignore[attr-defined] return result def clone_inputs(example_inputs): res: Union[Dict[Any, Any], List[Any]] if type(example_inputs) is dict: res = dict(example_inputs) for key, value in res.items(): if isinstance(value, tuple): res[key] = clone_inputs(value) else: assert isinstance(value, torch.Tensor), type(value) res[key] = clone_input(value) return res res = list(example_inputs) for i in range(len(res)): if isinstance(res[i], torch.Tensor): res[i] = clone_input(res[i]) return res def skip_frame_if_in_functorch_mode(val: torch.Tensor): try: val.data_ptr() # will throw for functorch tensors except RuntimeError as e: from .exc import SkipFrame # This will be GradTrackingTensor/BatchedTensor/etc functorch_subclass_name = re.sub(r"\(.*", "", repr(val)) raise SkipFrame( f"torch.compile cannot be run in context: {functorch_subclass_name}" ) from e @contextmanager def preserve_rng_state(): disable_functorch = torch._C._DisableFuncTorch disable_current_modes = torch.utils._python_dispatch._disable_current_modes with disable_current_modes(), disable_functorch(): rng_state = torch.clone(torch.random.get_rng_state()) skip_frame_if_in_functorch_mode(rng_state) if torch.cuda.is_available(): cuda_rng_state = torch.clone(torch.cuda.get_rng_state()) try: yield finally: with torch.utils._python_dispatch._disable_current_modes(): torch.random.set_rng_state(rng_state) if torch.cuda.is_available(): torch.cuda.set_rng_state(cuda_rng_state) # type: ignore[possibly-undefined] def is_jit_model(model0): return isinstance( model0, ( torch.jit._trace.TopLevelTracedModule, torch.jit._script.RecursiveScriptModule, torch.jit.ScriptFunction, torch.jit.ScriptModule, ), ) def torchscript(model, example_inputs, verbose=False): if is_jit_model(model): # already done? return model try: return torch.jit.trace(model, example_inputs) except Exception: try: return torch.jit.script(model) except Exception: if verbose: log.exception("jit error") else: log.error("Both torch.jit.trace and torch.jit.script failed") return None def getfile(obj): try: return inspect.getfile(obj) except (TypeError, OSError): return None def is_namedtuple(obj): """Test if an object is a namedtuple or a torch.return_types.* quasi-namedtuple""" return is_namedtuple_cls(type(obj)) def is_namedtuple_cls(cls): """Test if an object is a namedtuple or a (torch.return_types|torch.autograd.forward_ad).* quasi-namedtuple""" try: if issubclass(cls, tuple): bases = getattr(cls, "__bases__", []) or [None] module = getattr(cls, "__module__", None) return module in ("torch.return_types", "torch.autograd.forward_ad") or ( bases[0] is tuple and hasattr(cls, "_make") and hasattr(cls, "_fields") ) except TypeError: pass return False @functools.lru_cache(1) def namedtuple_fields(cls): """Get the fields of a namedtuple or a torch.return_types.* quasi-namedtuple""" if cls is slice: return ["start", "stop", "step"] assert issubclass(cls, tuple) if hasattr(cls, "_fields"): # normal namedtuples return cls._fields @dataclasses.dataclass class Marker: index: int # frustrating ones e.g. torch.return_types.max assert cls.__module__ == "torch.return_types" obj = cls(map(Marker, range(cls.n_fields))) fields: List[Optional[str]] = [None] * cls.n_fields for name in dir(obj): if name[0] != "_" and isinstance(getattr(obj, name), Marker): fields[getattr(obj, name).index] = name return fields def checkpoint_params(gm): with torch.no_grad(): rng_state = torch.clone(torch.random.get_rng_state()) if torch.cuda.is_available(): cuda_rng_state = torch.clone(torch.cuda.get_rng_state()) saved_state = [] for param in itertools.chain(gm.parameters(), gm.buffers()): saved_state.append((param, param._version, torch.clone(param))) def restore(): with torch.no_grad(): torch.random.set_rng_state(rng_state) if torch.cuda.is_available(): torch.cuda.set_rng_state(cuda_rng_state) for param, version, original_value in saved_state: if param._version != version: param.copy_(original_value) return restore def timed(model, example_inputs, times=1): if torch.cuda.is_available(): synchronize = torch.cuda.synchronize else: synchronize = nothing synchronize() gc.collect() torch.manual_seed(1337) t0 = time.perf_counter() for _ in range(times): result = model(*example_inputs) synchronize() t1 = time.perf_counter() return result, t1 - t0 # type: ignore[possibly-undefined] def check_is_cuda(gm, example_inputs): return all(x.is_cuda for x in itertools.chain(example_inputs, gm.parameters(True))) @lru_cache(32) def rot_n_helper(n): assert n > 1 vars = [f"v{i}" for i in range(n)] rotated = reversed(vars[-1:] + vars[:-1]) fn = eval(f"lambda {','.join(vars)}: ({','.join(rotated)})") fn.__name__ = f"rot_{n}_helper" return fn common_constant_types: Set[type] = { int, float, complex, bool, str, bytes, type(None), Ellipsis.__class__, types.CodeType, torch.device, torch.dtype, torch.memory_format, torch.layout, } if has_triton_package(): import triton common_constant_types.add(triton.language.dtype) """ Difference between is_safe_constant and common_constant_types. * common_constant_types: Constants would be wrapped by VariableBuilder.wrap_literal as ConstantVariable. * is_safe_constant: Constants can be loaded by LOAD_CONST bytecode. """ def is_safe_constant(v): if istype(v, (tuple, frozenset)): return all(map(is_safe_constant, v)) return isinstance(v, (enum.Enum, type, torch.Size)) or istype( v, common_constant_types | {slice}, ) def specialize_symnode(arg): from .variables import ConstantVariable, SymNodeVariable # Guard and specialize if isinstance(arg, SymNodeVariable): return ConstantVariable.create(arg.evaluate_expr()) return arg def guard_if_dyn(arg): from .variables import ConstantVariable arg = specialize_symnode(arg) if isinstance(arg, ConstantVariable): return arg.as_python_constant() return arg def check_constant_args(args, kwargs): return all(x.is_python_constant() for x in itertools.chain(args, kwargs.values())) def check_unspec_python_args(args, kwargs): from .variables.constant import ConstantVariable from .variables.tensor import UnspecializedPythonVariable unspec_count = 0 for x in itertools.chain(args, kwargs.values()): if isinstance(x, UnspecializedPythonVariable): unspec_count += 1 elif not isinstance(x, ConstantVariable): return False return unspec_count > 0 def check_unspec_or_constant_args(args, kwargs): # A fused version of: # return check_constant_args(args, kwargs) or check_unspec_python_args(args, kwargs) from .variables.tensor import UnspecializedPythonVariable for x in itertools.chain(args, kwargs.values()): if not (x.is_python_constant() or isinstance(x, UnspecializedPythonVariable)): return False return True def check_numpy_ndarray_args(args, kwargs): from .variables.tensor import NumpyNdarrayVariable return any( isinstance(x, NumpyNdarrayVariable) for x in itertools.chain(args, kwargs.values()) ) dict_keys: Type[KeysView[Any]] = type({}.keys()) dict_values: Type[ValuesView[Any]] = type({}.values()) odict_values: Type[ValuesView[Any]] = type(collections.OrderedDict().values()) tuple_iterator: Type[Iterator[Any]] = type(iter(())) tuple_iterator_len = tuple_iterator.__length_hint__ # type: ignore[attr-defined] object_new = object.__new__ def nn_module_new(cls): obj = object_new(cls) torch.nn.Module.__init__(obj) return obj def product(it): return functools.reduce(operator.mul, it, 1) def tuple_iterator_getitem(it, index): _, (obj,), start = it.__reduce__() return obj[start + index] iter_next = next def to_subclass(t, cls): return t.as_subclass(cls) def dict_keys_getitem(d, n): return next(itertools.islice(iter(d), n, n + 1)) def enum_repr(value, local): # enum class can override __str__ method. Use __class__ and name attribute # to extract the class name and key name. name = value.__class__.__name__ val = value.name scope = "L" if local else "G" local_name = f'{scope}["{name}"].{val}' return local_name def set_example_value(node, example_value): # NB: example_value is a bit of a misnomer, because this is always a fake # tensor of some sort. Furthermore, these example values serve as the # runtime state of Dynamo tracing, which means if metadata mutation # occurs, the example_value gets directly updated (so you can't rely on # this to accurately reflect what the state of the value was at the time # the program was traced). node.meta["example_value"] = example_value shape_env = TracingContext.get().fake_mode.shape_env if symbol_to_path := torch.fx.experimental.symbolic_shapes.compute_unbacked_bindings( shape_env, example_value ): node.meta["unbacked_bindings"] = symbol_to_path def _get_fake_tensor(vt): fake_tensor = vt.as_proxy().node.meta.get("example_value") if not is_fake(fake_tensor): from .exc import unimplemented unimplemented("Cannot check Tensor object identity without its fake value") return fake_tensor def iter_contains(items, search, tx, check_tensor_identity=False): from .variables import ( BuiltinVariable, ConstantVariable, TensorVariable, VariableTracker, ) if search.is_python_constant(): found_const = any( x.is_python_constant() and x.as_python_constant() == search.as_python_constant() for x in items ) return ConstantVariable.create(found_const) must_check_tensor_id = False if check_tensor_identity and isinstance(search, TensorVariable): must_check_tensor_id = True # Match of Tensor means match of FakeTensor search = _get_fake_tensor(search) found: Optional[VariableTracker] = None for x in items: if must_check_tensor_id: if isinstance(x, TensorVariable): if search is _get_fake_tensor(x): # Object equivalence return ConstantVariable.create(True) else: check = BuiltinVariable(operator.eq).call_function(tx, [x, search], {}) if found is None: found = check else: found = BuiltinVariable(operator.or_).call_function( tx, [check, found], {} ) if found is None: found = ConstantVariable.create(False) return found def key_is_id(k): """Returns whether it indexes dictionaries using its id""" return isinstance(k, (torch.Tensor, torch.nn.Module, MethodWrapperType)) def key_to_id(value): return [id(k) if key_is_id(k) else k for k in value.keys()] def const_repr(x, *, local) -> str: from .trace_rules import is_builtin_callable if isinstance(x, (list, tuple)): elems_repr = ",".join(const_repr(s, local=local) for s in x) if isinstance(x, list): return f"[{elems_repr}]" else: assert isinstance(x, tuple) if len(x) == 1: return f"({elems_repr},)" else: return f"({elems_repr})" elif isinstance(x, enum.Enum): # To workaround repr(Enum) returning invalid global reference before python 3.11 # by calling enum_repr and removing quotes to render enum in guard code. return enum_repr(x, local=local).replace("'", "") elif is_builtin_callable(x): return x.__name__ elif isinstance(x, type): def fullname(o): klass = o.__class__ module = klass.__module__ if module == "builtins": return klass.__qualname__ # avoid outputs like 'builtins.str' return module + "." + klass.__qualname__ return fullname(x) else: return f"{x!r}" def dict_keys_repr(const_keys, *, local) -> str: keys_str = ",".join(const_repr(s, local=local) for s in const_keys) return "[" + keys_str + "]" GLOBAL_KEY_PREFIX = "__dict_key" from torch._subclasses import UnsupportedFakeTensorException # noqa: F401 def get_safe_global_name(tx, root, obj): # The global_mangled_class_name should be different for different # invocations of torch.compile. Otherwise, we can run into a situation # where multiple torch.compile invocations re-use the same global name, # but the global's lifetime is tied to the first invocation (and # may be deleted when the first torch.compile invocation is deleted) # We mangle it based off of the output_graph's id. return f"{root}_{id(obj)}_c{tx.output.compile_id}" def wrap_fake_exception(fn): try: return fn() except UnsupportedFakeTensorException as e: from .exc import unimplemented msg = f"Unsupported: {e.reason} with fake tensor propagation." log.warning(msg) unimplemented(msg, from_exc=e) def deepcopy_to_fake_tensor(obj, fake_mode): with torch._subclasses.fake_tensor.FakeCopyMode(fake_mode): return wrap_fake_exception(lambda: copy.deepcopy(obj)) def rmse(ref, res): """ Calculate root mean squared error """ return torch.sqrt(torch.mean(torch.square(ref - res))) def same( ref, res, fp64_ref=None, cos_similarity=False, tol=1e-4, equal_nan=False, exact_dtype=True, relax_numpy_equality=False, ignore_non_fp=False, log_error=log.error, use_larger_multiplier_for_smaller_tensor=False, ): """Check correctness to see if ref and res match""" if fp64_ref is None: fp64_ref = ref if isinstance(ref, (list, tuple, torch.nn.ParameterList, torch.Size)): assert isinstance(res, (list, tuple)), f"type mismatch {type(ref)} {type(res)}" if len(ref) != len(res): log_error("Length mismatch") return False return len(ref) == len(res) and all( same( ai, bi, fp64_refi, cos_similarity, tol, equal_nan, exact_dtype, relax_numpy_equality, ignore_non_fp, log_error=log_error, use_larger_multiplier_for_smaller_tensor=use_larger_multiplier_for_smaller_tensor, ) for ai, bi, fp64_refi in zip(ref, res, fp64_ref) ) elif type(ref).__name__ == "QuestionAnsweringModelOutput": # This skips checking accuracy for start_logits/end_logits. # Tentatively, start_logits/end_logits appear to be very prone to # inaccuracies and is somewhat subsumed by checking the loss. return same( ref.loss, res.loss, fp64_ref.loss, cos_similarity, tol, equal_nan, exact_dtype, relax_numpy_equality, ignore_non_fp, log_error=log_error, use_larger_multiplier_for_smaller_tensor=use_larger_multiplier_for_smaller_tensor, ) elif isinstance(ref, dict): assert isinstance(res, dict) assert set(ref.keys()) == set( res.keys() ), f"keys mismatch {set(ref.keys())} == {set(res.keys())}" for k in sorted(ref.keys()): if not ( same( ref[k], res[k], fp64_ref[k], cos_similarity=cos_similarity, tol=tol, equal_nan=equal_nan, exact_dtype=exact_dtype, relax_numpy_equality=relax_numpy_equality, ignore_non_fp=ignore_non_fp, log_error=log_error, use_larger_multiplier_for_smaller_tensor=use_larger_multiplier_for_smaller_tensor, ) ): log_error("Accuracy failed for key name %s", k) return False return True elif isinstance(ref, set): assert isinstance(res, set) assert set(ref) == set(res), f"elements mismatch {set(ref)} == {set(res)}" return True elif isinstance(ref, (torch.Tensor, float)): assert not isinstance(ref, torch._subclasses.FakeTensor) assert not isinstance(res, torch._subclasses.FakeTensor) def to_tensor(t): return t if isinstance(t, torch.Tensor) else torch.tensor(t) ref, res, fp64_ref = (to_tensor(val) for val in (ref, res, fp64_ref)) if ref.is_sparse: assert res.is_sparse ref = ref.to_dense() res = res.to_dense() assert isinstance(res, torch.Tensor), f"type mismatch {type(ref)} {type(res)}" if exact_dtype: if ref.dtype != res.dtype: log_error("dtype mismatch %s, %s", ref.dtype, res.dtype) return False if ref.dtype == torch.bool: if ignore_non_fp: return True # triton stores bool as int8, so add this for more accurate checking r = torch.allclose( ref.to(dtype=torch.uint8), res.to(dtype=torch.uint8), atol=tol, rtol=tol, equal_nan=equal_nan, ) if not r: log_error("Accuracy failed: uint8 tensor did not match") return r if cos_similarity: ref = ref.flatten().to(torch.float32) res = res.flatten().to(torch.float32) if torch.allclose(ref, res, atol=tol, rtol=tol, equal_nan=True): # early exit that handles zero/nan better # cosine_similarity(zeros(10), zeros(10), dim=0) is 0 return True score = torch.nn.functional.cosine_similarity(ref, res, dim=0, eps=1e-6) if score < 0.99: log.warning("Similarity score=%s", score.cpu().detach().item()) return score >= 0.99 else: if not exact_dtype: ref = ref.to(res.dtype) # First try usual allclose if torch.allclose(ref, res, atol=tol, rtol=tol, equal_nan=equal_nan): return True # Check error from fp64 version if fp64_ref.dtype == torch.float64: ref_error = rmse(fp64_ref, ref).item() # ref unable to produce this with stable numerics in this precision, ignore if math.isnan(ref_error): log.warning( "Found nan in reference. Consider running in higher precision." ) res_error = rmse(fp64_ref, res).item() # In the case of using AMP (Automatic Mixed Precision), certain models have # failed the benchmark's correctness check. However, the end-to-end model's # accuracy when comparing AMP with FP32 is within a difference of less than 0.1%. # Thus, it's possible that the correctness check failures for these models are # false alarms. We use multiplier of 3 instead of 2 to avoid these false alarms. multiplier = 3.0 if res.dtype == torch.bfloat16 else 2.0 if use_larger_multiplier_for_smaller_tensor and ( fp64_ref.numel() <= 10 and tol >= 4 * 1e-2 ): multiplier = 10.0 elif use_larger_multiplier_for_smaller_tensor and ( fp64_ref.numel() <= 500 and tol >= 4 * 1e-2 ): multiplier = 5.0 elif ( fp64_ref.numel() < 1000 or (ref.ndim == 4 and ref.shape[-1] == ref.shape[-2] == 1) # large tol means a benchmark has been specified as REQUIRE_HIGHER_TOLERANCE or tol >= 2 * 1e-2 ): # In the presence of noise, noise might dominate our error # metric for smaller tensors. # Similary, for 1x1 kernels, there seems to be high noise with amp. multiplier = 3.0 passes_test = res_error <= (multiplier * ref_error + tol / 10.0) if ( not passes_test and equal_nan and math.isnan(ref_error) and math.isnan(res_error) # Some unit test for the accuracy minifier relies on # returning false in this case. and not inductor_config.cpp.inject_relu_bug_TESTING_ONLY ): passes_test = True if not passes_test: log_error( "RMSE (res-fp64): %.5f, (ref-fp64): %.5f and shape=%s. res.dtype: %s, multiplier: %f, tol: %f" ", use_larger_multiplier_for_smaller_tensor: %d", res_error, ref_error, res.size(), res.dtype, multiplier, tol, use_larger_multiplier_for_smaller_tensor, ) return passes_test if ignore_non_fp: return True log_error("Accuracy failed: allclose not within tol=%s", tol) return False elif isinstance(ref, (str, int, type(None), bool, torch.device)): if ignore_non_fp: return True r = ref == res if not r: log_error("Accuracy failed (%s): %s != %s", type(ref), ref, res) return r elif is_numpy_int_type(ref) or is_numpy_float_type(ref): if relax_numpy_equality and not ( is_numpy_int_type(res) or is_numpy_float_type(res) ): ref = ref.item() r = (type(ref) is type(res)) and (ref == res) if not r: log_error("Accuracy failed (numpy): %s != %s", ref, res) return r elif is_numpy_ndarray(ref): return (type(ref) is type(res)) and same( torch.as_tensor(ref), torch.as_tensor(res), fp64_ref, cos_similarity=cos_similarity, tol=tol, equal_nan=equal_nan, exact_dtype=exact_dtype, relax_numpy_equality=relax_numpy_equality, ignore_non_fp=ignore_non_fp, log_error=log_error, use_larger_multiplier_for_smaller_tensor=use_larger_multiplier_for_smaller_tensor, ) elif type(ref).__name__ in ( "MaskedLMOutput", "Seq2SeqLMOutput", "CausalLMOutputWithCrossAttentions", "LongformerMaskedLMOutput", "Instances", "SquashedNormal", "Boxes", "Normal", "TanhTransform", "Foo", "Variable", ): assert type(ref) is type(res) return all( same( getattr(ref, key), getattr(res, key), getattr(fp64_ref, key), cos_similarity=cos_similarity, tol=tol, equal_nan=equal_nan, exact_dtype=exact_dtype, relax_numpy_equality=relax_numpy_equality, ignore_non_fp=ignore_non_fp, log_error=log_error, use_larger_multiplier_for_smaller_tensor=use_larger_multiplier_for_smaller_tensor, ) for key in ref.__dict__.keys() ) else: raise RuntimeError(f"unsupported type: {type(ref).__name__}") def format_func_info(code): short_filename = code.co_filename.split("/")[-1] return f"'{code.co_name}' ({short_filename}:{code.co_firstlineno})" @contextlib.contextmanager def disable_cache_limit(): prior = config.cache_size_limit config.cache_size_limit = sys.maxsize prior_acc_limit = config.accumulated_cache_size_limit config.accumulated_cache_size_limit = sys.maxsize try: yield finally: config.cache_size_limit = prior config.accumulated_cache_size_limit = prior_acc_limit # map from transformed code back to original user code orig_code_map = ExactWeakKeyDictionary() # keep a record of code_obj -> list of guard failure reasons for logging guard_failures: DefaultDict[Any, List[Any]] = collections.defaultdict(list) # Keep a record of graph break reasons for logging graph_break_reasons: List[torch._dynamo.output_graph.GraphCompileReason] = [] # keep record of compiled code, if we are in "error if recompile" # to track code that dynamo has compiled previously seen_code_map = ExactWeakKeyDictionary() class CompileProfiler: """Utility for profiling how and what dynamo would compile. Can be used for * diagnosing recompilation issues * determining an appropriate compile cache limit * (TODO)confirming which functions got compiled/skipped """ def __init__(self): self.frame_count = 0 self.op_count = 0 self.backend_ctx_ctor = disable_cache_limit def __call__(self, gm: torch.fx.GraphModule, example_inputs): self.frame_count += 1 for node in gm.graph.nodes: if "call" in node.op: self.op_count += 1 return gm.forward # no-op __enter__ and __exit__ to preserve BC def __enter__(self): return self def __exit__(self, typ, val, traceback): pass def get_metrics(self): return {"guard_failures": guard_failures} def report(self): metrics = self.get_metrics() gf = metrics["guard_failures"] def num_recompiles(code): return len(gf[code]) def recompile_reasons(code): return "\n".join([str(x) for x in gf[code]]) summarized_gf = [ [format_func_info(code), num_recompiles(code), recompile_reasons(code)] for code in gf ] def graph_break_report(): if "graph_break" in counters: graph_breaks = counters["graph_break"] return tabulate( [[msg, graph_breaks[msg]] for msg in graph_breaks], headers=["Graph Break Reason", "Count"], ) def recompilation_report(): if len(gf): max_recompiles = max(num_recompiles(code) for code in gf) recomp_table = tabulate( summarized_gf, headers=["Function", "Recompiles", "Recompile Reasons"], ) return recomp_table + textwrap.dedent( f""" Set torch._dynamo.config.cache_size_limit to {max_recompiles} to avoid being cache limited. """ ) report = textwrap.dedent( """ Torchdynamo Profiler Report =========================== Graph Breaks ------------ Graph breaks happen when torchdynamo encounters code it can't safely trace. If you want to find out why breaks are happening, check below for each break reason You may gain additional insight by passing `fullgraph=True` to torch.compile, to stop at the first break. """ ) report += graph_break_report() or "No graph breaks detected." report += textwrap.dedent( """ Recompilation ------------- These subgraphs were recompiled more than once due to guard failures Guard failures indicate some condition assumed to be static by the tracer changed, making it unsafe to reuse the compiled program. """ ) report += recompilation_report() or "No recompilation detected.\n" return report # return same dir unless user changes config between calls @functools.lru_cache(None) def _get_debug_dir(root_dir): dir_name = ( "run_" + datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S_%f") # use pid to avoid conflicts among ranks + "-pid_" + str(os.getpid()) ) return os.path.join(root_dir, dir_name) def get_debug_dir(): debug_root = config.debug_dir_root return _get_debug_dir(debug_root) def extract_fake_example_value(node, required=True): if "example_value" in node.meta and is_fake(node.meta["example_value"]): return node.meta["example_value"] elif required: from torch._dynamo.exc import unimplemented unimplemented("`FakeTensor` example value was required but not available") else: return None def ensure_graph_fake(e, tx): assert maybe_get_fake_mode(e) is tx.fake_mode return e def get_fake_values_from_nodes(tx, nodes, allow_non_graph_fake): def visit(n: torch.fx.Node): if n.op == "call_function" and "example_value" not in n.meta: # fake tensor validity is checked inside get_fake_value using # ensure_graph_fake return get_fake_value(n, tx, allow_non_graph_fake) out = n.meta["example_value"] if not allow_non_graph_fake and isinstance(out, torch.Tensor): return ensure_graph_fake(out, tx) return out return torch.fx.node.map_arg(nodes, visit) def get_fake_value(node, tx, allow_non_graph_fake=False): """ Run the computation represented by `node` using fake tensors and return the result. allow_non_graph_fake: whether to allow the return result to be: 1. non-fake or 2. fake that is not created by this instance of Dynamo. If `True`, you must be prepared to deal with such return values, ideally by further wrapping them as this graph's fakes. """ from torch.utils._sympy.value_ranges import ValueRangeError from .exc import ( TorchRuntimeError, unimplemented, Unsupported, UserError, UserErrorType, ) op = node.op # FX Node should always return the same fake value if "example_value" in node.meta and is_fake(node.meta["example_value"]): return node.meta["example_value"] args, kwargs = get_fake_values_from_nodes( tx, (node.args, node.kwargs), allow_non_graph_fake ) nnmodule = None if op == "call_method" and len(args) > 0 and isinstance(args[0], torch.nn.Module): # If the first argument is nn.Module, should copy to fake mode. args = (deepcopy_to_fake_tensor(args[0], tx.fake_mode),) + tuple(args[1:]) if op == "call_module": nnmodule = tx.output.nn_modules[node.target] if is_lazy_module(nnmodule) and hasattr(nnmodule, "_initialize_hook"): # In the case of a lazy module, we want to run # the pre-hooks which initialize it. # Afterwards, lazy module deletes its pre-hooks # to avoid treating it as lazy on subsequent recompile. nnmodule._infer_parameters(nnmodule, args) # no matter it's lazy module or not, we should copy to fake mode. nnmodule = deepcopy_to_fake_tensor(nnmodule, tx.fake_mode) try: with tx.fake_mode, enable_python_dispatcher(): ret_val = wrap_fake_exception( lambda: run_node(tx.output, node, args, kwargs, nnmodule) ) except Unsupported: raise except RuntimeError as e: cause: BaseException = e if e.__cause__ is not None: cause = e.__cause__ if isinstance( cause, torch._subclasses.fake_tensor.DataDependentOutputException ): unimplemented( f"data dependent operator: {cause.func}; " "to enable, set torch._dynamo.config.capture_scalar_outputs = True" ) elif isinstance( cause, torch._subclasses.fake_tensor.DynamicOutputShapeException ): if not torch._dynamo.config.capture_dynamic_output_shape_ops: unimplemented( f"dynamic shape operator: {cause.func}; " "to enable, set torch._dynamo.config.capture_dynamic_output_shape_ops = True" ) else: unimplemented( f"dynamic shape operator: {cause.func}; " "Operator does not have a meta kernel that supports dynamic output shapes, " "please report an issue to PyTorch" ) elif isinstance( cause, torch._subclasses.fake_tensor.UnsupportedOperatorException ): op = cause.func import_suggestion = "" if isinstance(op, torch._ops.OpOverload): maybe_pystub = torch._C._dispatch_pystub( op._schema.name, op._schema.overload_name ) if maybe_pystub is not None: module, ctx = maybe_pystub import_suggestion = ( f"It's possible that the support was implemented in " f"module `{module}` and you may need to `import {module}`" f"({ctx}), otherwise " ) unimplemented( f"unsupported operator: {cause.func} ({import_suggestion}see " "path_to_url#heading=h.64r4npvq0w0" " for how to fix)" ) elif isinstance( cause, torch.fx.experimental.symbolic_shapes.GuardOnDataDependentSymNode ): raise UserError( # noqa: B904 UserErrorType.CONSTRAINT_VIOLATION, "Tried to use data-dependent value in the subsequent computation. " "This can happen when we encounter unbounded dynamic value that is unknown during tracing time. " "You will need to explicitly give hint to the compiler. Please take a look at " f"torch._check OR torch._check_is_size APIs. {cause}", case_name="constrain_as_size_example", ) elif isinstance(cause, ValueRangeError): raise UserError(UserErrorType.CONSTRAINT_VIOLATION, e.args[0]) from e elif isinstance(cause, TypeError) and "argument" in str(cause): unimplemented(f"TypeError {node.target}: {cause}") raise TorchRuntimeError(str(e)).with_traceback(e.__traceback__) from None if not allow_non_graph_fake: _ = pytree.tree_map_only( torch.Tensor, functools.partial(ensure_graph_fake, tx=tx), ret_val ) return ret_val _current_node = threading.local() def get_current_node(): return getattr(_current_node, "value", None) @contextmanager def set_current_node(node): old = get_current_node() _current_node.value = node try: yield finally: _current_node.value = old def run_node(tracer, node, args, kwargs, nnmodule): """ Runs a given node, with the given args and kwargs. Behavior is dictated by a node's op. run_node is useful for extracting real values out of nodes. See get_real_value for more info on common usage. Note: The tracer arg is only used for 'get_attr' ops Note: The nnmodule arg is only used for 'call_module' ops Nodes that are not call_function, call_method, call_module, or get_attr will raise an AssertionError. """ op = node.op with set_current_node(node): def make_error_message(e): return f"Failed running {op} {node.target}(*{args}, **{kwargs}):\n" + str(e) try: if op == "call_function": return node.target(*args, **kwargs) elif op == "call_method": return getattr(args[0], node.target)(*args[1:], **kwargs) elif op == "call_module": assert nnmodule is not None return nnmodule(*args, **kwargs) elif op == "get_attr": return tracer.output_graph.get_submodule(node.target) elif op == "placeholder": assert "example_value" in node.meta return node.meta["example_value"] except (NotImplementedError, UnsupportedFakeTensorException) as e: # NB: mimic how wrap_fake_exception does it from .exc import unimplemented unimplemented(make_error_message(e), from_exc=e) except Exception as e: raise RuntimeError(make_error_message(e)).with_traceback( e.__traceback__ ) from e raise AssertionError(op) def get_real_value(node, tracer): """ Run the actual computation represented by `node` and return the result. This will execute any dependent nodes in the graph as well. """ from .exc import TorchRuntimeError cache = tracer.real_value_cache if node in cache: return cache[node] op = node.op args, kwargs = torch.fx.node.map_arg( (node.args, node.kwargs), lambda n: get_real_value(n, tracer), ) if op == "placeholder" and "grapharg" in node.meta: return node.meta["grapharg"].example if op == "call_module": nn_module = tracer.output_graph.nn_modules[node.target] if not is_lazy_module(nn_module): nn_module = copy.deepcopy(nn_module) else: # In the case of a lazy module, we want to run # the pre-hooks which initialize it nn_module(*args, **kwargs) else: nn_module = None try: real_value = run_node(tracer, node, args, kwargs, nn_module) cache[node] = real_value except RuntimeError as e: raise TorchRuntimeError(str(e)).with_traceback(e.__traceback__) from None return real_value def assert_no_fake_params_or_buffers(gm): from torch._subclasses.fake_tensor import FakeTensorConfig, is_fake def stack_or_hint(t): if FakeTensorConfig.debug: import traceback return f"FAKE TENSOR CREATION TRACEBACK: \n {traceback.format_list(t._debug_trace)}" else: return "Enable TORCH_FAKE_TENSOR_DEBUG=1 to get creation stack traces on fake tensors." for name, buffer in gm.named_buffers(): assert not is_fake( buffer ), f"Unexpected fake buffer {name} {stack_or_hint(buffer)}" for name, param in gm.named_parameters(): assert not is_fake( param ), f"Unexpected fake param {name} {stack_or_hint(param)}" def fqn(obj: Any): """ Returns the fully qualified name of the object. """ return f"{obj.__module__}.{obj.__qualname__}" def ifdynstaticdefault(count1, count2): if torch._dynamo.config.assume_static_by_default: return count1 else: return count2 def import_submodule(mod: types.ModuleType): """ Ensure all the files in a given submodule are imported """ for filename in sorted(os.listdir(os.path.dirname(cast(str, mod.__file__)))): if filename.endswith(".py") and filename[0] != "_": importlib.import_module(f"{mod.__name__}.{filename[:-3]}") def object_has_getattribute(value: Any): try: if isinstance( inspect.getattr_static(type(value), "__getattribute__"), types.FunctionType, ): return True except AttributeError: pass return False def get_custom_getattr(value: Any, ignore_nn_module_getattr: bool = False): try: getattr_fn = inspect.getattr_static(type(value), "__getattr__") except AttributeError: getattr_fn = None if ignore_nn_module_getattr and getattr_fn is torch.nn.Module.__getattr__: # ignore this case of getattr getattr_fn = None return getattr_fn class TensorStaticReason(enum.Enum): PARAMETER = 2 NOT_TENSOR = 4 NN_MODULE_PROPERTY = 5 def tensor_static_reason_to_message(reason: TensorStaticReason): if reason == TensorStaticReason.PARAMETER: return "mark_dynamic on parameter, parameters are always static today." if reason == TensorStaticReason.NOT_TENSOR: return "mark_dynamic on a non tensor, how did this happen?" if reason == TensorStaticReason.NN_MODULE_PROPERTY: return "tensor is static because it is nn module associated." raise AssertionError(f"Illegal reason {reason}") def tensor_always_has_static_shape( tensor: Union[torch.Tensor, Any], is_tensor: bool, guard_source: torch._guards.GuardSource, ) -> Tuple[bool, Optional[TensorStaticReason]]: """ Given a tensor, source, and is_tensor flag, determine if a shape should be static. Args: tensor - the real tensor to evaluate, parameters force a static shape. is_tensor - internal dynamo check, essentially "is_tensor": target_cls is TensorVariable, tensors not in a TensorVariable for whatever reason are forced static. Returns a tuple, where the first element is the bool of whether or not this tensor should have a static shape. The second element is a TensorStaticReason, useful for passing to tensor_static_reason_to_message if needed. """ if ( guard_source.is_specialized_nn_module() and config.force_nn_module_property_static_shapes ): return True, TensorStaticReason.NN_MODULE_PROPERTY if type(tensor) is torch.nn.Parameter and config.force_parameter_static_shapes: return True, TensorStaticReason.PARAMETER if not is_tensor: return True, TensorStaticReason.NOT_TENSOR return False, None def lazy_format_graph_tabular(fn_name, gm): def inner(): try: from tabulate import tabulate # TODO: Check that this is installed except ImportError: return ( "Tabulate module missing, please install tabulate to log the graph in tabular format, logging code instead:\n" + str(lazy_format_graph_code(fn_name, gm)) ) node_specs = [ [n.op, n.name, n.target, n.args, n.kwargs] for n in gm.graph.nodes ] graph_str = tabulate( node_specs, headers=["opcode", "name", "target", "args", "kwargs"] ) return _format_graph_code(fn_name, gm.forward.__code__.co_filename, graph_str) return LazyString(inner) def format_bytecode(prefix, name, filename, line_no, code): return f"{prefix} {name} {filename} line {line_no} \n{dis.Bytecode(code).dis()}\n" forward_hook_names = ["_forward_pre_hooks", "_forward_hooks"] backward_hook_names = ["_backward_pre_hooks", "_backward_hooks"] state_dict_hook_names = [ "_state_dict_pre_hooks", "_state_dict_hooks", "_load_state_dict_pre_hooks", "_load_state_dict_post_hooks", ] all_hook_names = forward_hook_names + backward_hook_names + state_dict_hook_names def nn_module_has_global_hooks(): # This is limited to backward hooks for now because NNModuleVariable # supports fwd hooks underneath. return len(torch.nn.modules.module._global_backward_hooks) or len( torch.nn.modules.module._global_backward_pre_hooks ) def nn_module_get_all_hooks( mod, check_forward_hooks=False, check_backward_hooks=False, check_state_dict_hooks=False, ): """ Sometimes its useful to differentiate between types of hooks such as forward/backward/pre hooks executed during module.__call__, and state_dict hooks which are executed separately. """ hook_dicts_to_check = [] check_all_hooks = ( not check_forward_hooks and not check_backward_hooks and not check_state_dict_hooks ) if check_forward_hooks or check_all_hooks: hook_dicts_to_check.extend(forward_hook_names) if check_backward_hooks or check_all_hooks: hook_dicts_to_check.extend(backward_hook_names) if check_state_dict_hooks: hook_dicts_to_check.extend(state_dict_hook_names) all_hooks = [] for hook_dict_name in hook_dicts_to_check: hooks = getattr(mod, hook_dict_name, []) for hook_name in hooks: hook = hooks[hook_name] all_hooks.append(hook) return all_hooks def nnmodule_has_hooks( mod, check_forward_hooks=False, check_backward_hooks=False, check_state_dict_hooks=False, ): """ Helper function to check if a module has any hooks attached to it. """ hooks = nn_module_get_all_hooks( mod, check_forward_hooks=check_forward_hooks, check_backward_hooks=check_backward_hooks, check_state_dict_hooks=check_state_dict_hooks, ) return bool(hooks) def to_numpy_helper(value): """Convert tensor and tnp.ndarray to numpy.ndarray.""" if is_fake(value): return value if isinstance(value, tnp.ndarray): return to_numpy_helper(value.tensor) elif isinstance(value, torch.Tensor): return value.numpy(force=True) elif isinstance(value, (tuple, list)): return type(value)(to_numpy_helper(obj) for obj in value) else: return value def numpy_to_tensor(value): """Convert tnp.ndarray to tensor, leave other types intact. If a list/tuple, loop through it to convert.""" assert np is not None if isinstance(value, np.ndarray): return torch.as_tensor(value) if isinstance(value, tnp.ndarray): return value.tensor elif isinstance(value, (tuple, list)): return type(value)(numpy_to_tensor(obj) for obj in value) else: return value class numpy_to_tensor_wrapper: def __init__(self, f): self.f = f self.__name__ = "wrapped_" + self.f.__name__ def __repr__(self): return f"<Wrapped function <original {self.f.__name__}>>" def __call__(self, *args, **kwargs): out = self.f(*args, **kwargs) return numpy_to_tensor(out) def numpy_attr_wrapper(obj, name): if isinstance(obj, tnp.ndarray): out = getattr(obj, name) return numpy_to_tensor(out) elif isinstance(obj, torch.Tensor): out = getattr(tnp.ndarray(obj), name) return numpy_to_tensor(out) class numpy_method_wrapper: """Convert obj from torch.Tensor to tnp.ndarray and call method. Then convert result back to torch.Tensor.""" def __init__(self, method: str): self.method = method self.__name__ = "wrapped_" + self.method def __repr__(self): return f"<Wrapped method <original {self.method}>>" def __call__(self, *args, **kwargs): obj = args[0] if isinstance(obj, torch.Tensor): obj = tnp.ndarray(obj) method_callable = getattr(obj, self.method) out = method_callable(*args[1:], **kwargs) return numpy_to_tensor(out) class numpy_operator_wrapper: """Implements dunder methods for tnp.ndarray via functions from the operator library""" def __init__(self, op: Callable[..., Any]): self.op = op self.__name__ = f"wrapped_{op.__name__}" def __repr__(self): return f"<Wrapped operator <original {self.__name__}>>" def __call__(self, *args, **kwargs): assert not kwargs args = ( tnp.ndarray(arg) if isinstance(arg, torch.Tensor) else arg for arg in args ) out = self.op(*args) return numpy_to_tensor(out) def defake(x): if not isinstance(x, FakeTensor): return x size: torch._prims_common.ShapeType stride: torch._prims_common.StrideType if x._has_symbolic_sizes_strides: size = [] for s in x.size(): if isinstance(s, torch.SymInt): size.append(s.node.shape_env.size_hint(s.node.expr)) else: size.append(s) stride = [] for s in x.stride(): if isinstance(s, torch.SymInt): stride.append(s.node.shape_env.size_hint(s.node.expr)) else: stride.append(s) else: size = x.size() stride = x.stride() y = torch.empty_strided( size, stride, dtype=x.dtype, device=x.device, requires_grad=x.requires_grad, ) y.zero_() return y def is_utils_checkpoint(obj): # Lazy import to avoid circular dependencies import torch.utils.checkpoint return obj is torch.utils.checkpoint.checkpoint def build_checkpoint_variable(**options): import torch._higher_order_ops.wrap as higher_order_ops from .variables.higher_order_ops import TorchHigherOrderOperatorVariable # TODO - This is a temporary situation where we have two versions of # checkpointing implementation. We will converge on one and remove the other. activation_checkpoint_op: torch._ops.HigherOrderOperator = ( higher_order_ops.tag_activation_checkpoint ) if torch._functorch.config.functionalize_rng_ops: activation_checkpoint_op = higher_order_ops.wrap_activation_checkpoint return TorchHigherOrderOperatorVariable.make( activation_checkpoint_op, **options, ) def is_compile_supported(device_type): from .eval_frame import is_dynamo_supported compile_supported = is_dynamo_supported() if device_type == "cpu": pass elif device_type == "cuda" and compile_supported: compile_supported = has_triton() else: compile_supported = False return compile_supported # The following 3.11 source code functions are adapted from # path_to_url # in order to output source code corresponding to bytecode in 3.11+. # We need our own versions since we want to support multiline expressions. def _fix_offset(str: str, offset: int) -> int: """ Convert byte offset `offset` of `str` into character offset. Byte offset is used for 3.11+ instruction column data. Takes things like unicode characters into consideration. Unchanged from CPython implementation. """ as_utf8 = str.encode("utf-8") return len(as_utf8[:offset].decode("utf-8", errors="replace")) @dataclasses.dataclass class _Anchors: # inclusive left_end_lineno: int left_end_offset: int right_start_lineno: int # exclusive right_start_offset: int def _extract_anchors_from_expr(segment: str) -> Optional[_Anchors]: """ Given source code `segment` corresponding to a bytecode instruction, determine: - for binary ops, the location of the binary op - for indexing, the location of the brackets. `segment` is expected to be a valid Python expression """ assert sys.version_info >= (3, 11) import ast try: # Without brackets, `segment` is parsed as a statement. # We expect an expression, so wrap `segment` in # brackets to handle multi-line expressions. tree = ast.parse("(\n" + segment + "\n)") except SyntaxError: return None if len(tree.body) != 1: return None lines = segment.split("\n") # get character index given byte offset def normalize(lineno, offset): return _fix_offset(lines[lineno], offset) # Gets the next valid character index in `lines`, if # the current location is not valid. Handles empty lines. def next_valid_char(lineno, col): while lineno < len(lines) and col >= len(lines[lineno]): col = 0 lineno += 1 assert lineno < len(lines) and col < len(lines[lineno]) return lineno, col # Get the next valid character index in `lines`. def increment(lineno, col): col += 1 lineno, col = next_valid_char(lineno, col) assert lineno < len(lines) and col < len(lines[lineno]) return lineno, col # Get the next valid character at least on the next line def nextline(lineno, col): col = 0 lineno += 1 lineno, col = next_valid_char(lineno, col) assert lineno < len(lines) and col < len(lines[lineno]) return lineno, col statement = tree.body[0] if isinstance(statement, ast.Expr): expr = statement.value if isinstance(expr, ast.BinOp): # ast gives locations for BinOp subexpressions, e.g. # ( left_expr ) + ( right_expr ) # left^^^^^ right^^^^^ # -2 since end_lineno is 1-indexed and because we added an extra # bracket to `segment` when calling ast.parse cur_lineno = cast(int, expr.left.end_lineno) - 2 cur_col = normalize(cur_lineno, expr.left.end_col_offset) cur_lineno, cur_col = next_valid_char(cur_lineno, cur_col) # Heuristic to find the operator character. # The original CPython implementation did not look for ), \, or #, # leading to incorrect anchor location, e.g. # (x) + (y) # ~~^~~~~~~ while (ch := lines[cur_lineno][cur_col]).isspace() or ch in ")\\#": if ch in "\\#": cur_lineno, cur_col = nextline(cur_lineno, cur_col) else: cur_lineno, cur_col = increment(cur_lineno, cur_col) # binary op is 1 or 2 characters long, on the same line right_col = cur_col + 1 if ( right_col < len(lines[cur_lineno]) and not (ch := lines[cur_lineno][right_col]).isspace() and ch not in "\\#" ): right_col += 1 # right_col can be invalid since it is exclusive return _Anchors(cur_lineno, cur_col, cur_lineno, right_col) elif isinstance(expr, ast.Subscript): # ast gives locations for value and slice subexpressions, e.g. # ( value_expr ) [ slice_expr ] # value^^^^^ slice^^^^^ # subscript^^^^^^^^^^^^^^^^^^^^ # find left bracket (first '[' after value) left_lineno = cast(int, expr.value.end_lineno) - 2 left_col = normalize(left_lineno, expr.value.end_col_offset) left_lineno, left_col = next_valid_char(left_lineno, left_col) while lines[left_lineno][left_col] != "[": left_lineno, left_col = increment(left_lineno, left_col) # find right bracket (final character of expression) right_lineno = cast(int, expr.end_lineno) - 2 right_col = normalize(right_lineno, expr.end_col_offset) return _Anchors(left_lineno, left_col, right_lineno, right_col) elif isinstance(expr, ast.Call): # ( func_expr ) (args, kwargs) # func^^^^^ # call^^^^^^^^^^^^^^^^^^^^^^^^ # find left bracket (first '(' after func) left_lineno = cast(int, expr.func.end_lineno) - 2 left_col = normalize(left_lineno, expr.func.end_col_offset) left_lineno, left_col = next_valid_char(left_lineno, left_col) while lines[left_lineno][left_col] != "(": left_lineno, left_col = increment(left_lineno, left_col) # find right bracket (final character of expression) right_lineno = cast(int, expr.end_lineno) - 2 right_col = normalize(right_lineno, expr.end_col_offset) return _Anchors(left_lineno, left_col, right_lineno, right_col) return None def get_instruction_source_311(code: types.CodeType, inst: dis.Instruction) -> str: """ Python 3.11+ only. Returns lines of source code (from code object `code`) corresponding to `inst`'s location data, and underlines relevant code to `inst`. Example: CALL on `g`: f(g( ^^ h(x))) ^^^^^ We need our own implementation since `format_frame_summary` in Python's `traceback` module doesn't handle multi-line expressions (and their anchor extraction code is not completely correct). """ assert inst.positions is not None if inst.positions.lineno is None: return "" # The rstrip + "\n" pattern is used throughout this function to handle # linecache.getline errors. Error lines are treated as empty strings "", but we want # to treat them as blank lines "\n". first_line = linecache.getline(code.co_filename, inst.positions.lineno).rstrip() if inst.positions.end_lineno is None: return first_line if inst.positions.col_offset is None or inst.positions.end_col_offset is None: return first_line # character index of the start of the instruction start_offset = _fix_offset(first_line, inst.positions.col_offset) # character index of the end of the instruction # compute later since end may be a different line end_offset = None # expression corresponding to the instruction so we can get anchors segment = "" # underline markers to be printed - start with `~` marker and replace with `^` later markers = [] # Compute segment and initial markers if inst.positions.end_lineno == inst.positions.lineno: end_offset = _fix_offset(first_line, inst.positions.end_col_offset) segment = first_line[start_offset:end_offset] markers.append(" " * start_offset + "~" * (end_offset - start_offset)) else: segment = first_line[start_offset:] + "\n" markers.append(" " * start_offset + "~" * (len(first_line) - start_offset)) last_line = linecache.getline( code.co_filename, inst.positions.end_lineno ).rstrip() end_offset = _fix_offset(last_line, inst.positions.end_col_offset) for lineno in range(inst.positions.lineno + 1, inst.positions.end_lineno): line = linecache.getline(code.co_filename, lineno).rstrip() segment += line + "\n" # don't underline leading spaces num_spaces = len(line) - len(line.lstrip()) markers.append(" " * num_spaces + "~" * (len(line) - num_spaces)) segment += last_line[:end_offset] num_spaces = len(last_line) - len(last_line.lstrip()) markers.append(" " * num_spaces + "~" * (end_offset - num_spaces)) anchors: Optional[_Anchors] = None try: anchors = _extract_anchors_from_expr(segment) except AssertionError: pass # replace `~` markers with `^` where necessary if anchors is None: markers = [marker.replace("~", "^") for marker in markers] else: # make markers mutable mutable_markers: List[List[str]] = [list(marker) for marker in markers] # anchor positions do not take start_offset into account if anchors.left_end_lineno == 0: anchors.left_end_offset += start_offset if anchors.right_start_lineno == 0: anchors.right_start_offset += start_offset # Turn `~`` markers between anchors to `^` for lineno in range(len(markers)): for col in range(len(mutable_markers[lineno])): if lineno < anchors.left_end_lineno: continue if lineno == anchors.left_end_lineno and col < anchors.left_end_offset: continue if ( lineno == anchors.right_start_lineno and col >= anchors.right_start_offset ): continue if lineno > anchors.right_start_lineno: continue if mutable_markers[lineno][col] == "~": mutable_markers[lineno][col] = "^" # make markers into strings again markers = ["".join(marker) for marker in mutable_markers] result = "" for i in range(len(markers)): result += ( linecache.getline(code.co_filename, inst.positions.lineno + i).rstrip() + "\n" ) result += markers[i] + "\n" return result def get_static_address_type(t): if isinstance(t, torch.Tensor): return getattr(t, "_dynamo_static_input_type", None) return None def is_rng_state_getter_or_setter(value): getters = ( # The following two functions are not identical, so don't remove anyone! torch._C.Generator.get_state, torch.default_generator.get_state, torch.get_rng_state, torch.cuda.get_rng_state, ) setters = ( torch._C.Generator.set_state, torch.default_generator.set_state, torch.set_rng_state, torch.cuda.set_rng_state, ) return value in (*setters, *getters) def is_tensor_base_attr_getter(value): return ( isinstance(value, types.MethodWrapperType) and value.__name__ == "__get__" and value.__self__.__objclass__ is torch._C._TensorBase # type: ignore[attr-defined] ) def is_torch_function_object(value): return hasattr(value, "__torch_function__") def has_torch_function(vt: torch._dynamo.variables.base.VariableTracker) -> bool: from torch._dynamo.variables import LazyVariableTracker, UserDefinedObjectVariable from torch._dynamo.variables.torch_function import TensorWithTFOverrideVariable if isinstance(vt, TensorWithTFOverrideVariable): return True if isinstance(vt, LazyVariableTracker): LazyVariableTracker.realize(vt) return isinstance(vt, UserDefinedObjectVariable) and hasattr( vt.value, "__torch_function__" ) # see note [Tensor Fakification and Symbol Caching] def to_fake_tensor(t, fake_mode): symbolic_context = None source = None if tracing_context := torch._guards.TracingContext.try_get(): if t in tracing_context.tensor_to_context: symbolic_context = tracing_context.tensor_to_context[t] source = symbolic_context.tensor_source return fake_mode.from_tensor( t, static_shapes=False, symbolic_context=symbolic_context, source=source ) def get_first_attr(obj, *attrs): """ Return the first available attribute or throw an exception if none is present. """ for attr in attrs: if hasattr(obj, attr): return getattr(obj, attr) raise AssertionError(f"{obj} does not has any of the attributes: {attrs}") @contextlib.contextmanager def maybe_enable_compiled_autograd(should_enable, fullgraph=True, dynamic=True): if not should_enable: yield else: def compiler_fn(gm): def inner_compiler(gm_, example_inputs_): torch._dynamo.utils.counters["compiled_autograd"]["compiles"] += 1 return torch._inductor.compile(gm_, example_inputs_) return torch.compile( gm, backend=inner_compiler, fullgraph=fullgraph, dynamic=dynamic ) with torch._dynamo.compiled_autograd.enable(compiler_fn) as ctx: yield ctx def invalid_removeable_handle(): # need a subclass so weakref works class Invalid(dict): # type: ignore[type-arg] pass return RemovableHandle(Invalid()) # Returns a "proxy" (new object with the same class and dict) for (non-GraphModule) nn.Module's. # Attribute changes to the original object/proxy will be reflected in the other. # This is useful for cases where we want a keep-alive reference to a module without increasing # its reference count. def nn_module_proxy(mod): if not isinstance(mod, torch.nn.Module): return mod if isinstance(mod, torch.fx.GraphModule): # Dynamo-generated GM's shouldn't contain user-created GM's return mod proxy = mod.__class__.__new__(mod.__class__) proxy.__dict__ = mod.__dict__ return proxy class GmWrapper(torch.nn.Module): def __init__(self, gm, unflatten_fn): super().__init__() self.gm = gm self.unflatten_fn = unflatten_fn def forward(self, *args): args: List[Any] = list(args) return self.gm(*self.unflatten_fn(args)) def flatten_graph_inputs(gm: torch.fx.GraphModule, inputs, compile_gm): """ Mutate inputs so that they are flat and wrap gm such that it accepts those inputs. This is needed for graphs that take bumpy inputs. """ inputs_idx_to_clear = [ i for i, node in enumerate(gm.graph.nodes) if node.op == "placeholder" and node.meta.get("steal_arg", False) ] if torch._dynamo.compiled_autograd.in_compiled_autograd_region: # fast path, avoid pytree overhead # compiled autograd inputs are always a list of tensors, maybe followed by symints assert inputs_idx_to_clear == [0] assert isinstance(inputs[0], list) boxed_inputs_count = len(inputs[0]) def flatten_fn(args): return args[0] + list(args[1:]) def unflatten_fn(flat_args): return (flat_args[:boxed_inputs_count], *flat_args[boxed_inputs_count:]) compiled_fn = compile_gm(GmWrapper(gm, unflatten_fn), flatten_fn(inputs)) else: # slow path, don't know inputs structure flat_inputs, spec = pytree.tree_flatten(inputs) unflatten_fn = functools.partial(pytree.tree_unflatten, treespec=spec) compiled_fn = compile_gm(GmWrapper(gm, unflatten_fn), flat_inputs) # note this doesn't check the spec, assuming it is the same flatten_fn = pytree.arg_tree_leaves def wrapper(*args): flat_args = flatten_fn(args) # flat_args is a new list, so we need to clear references from the old list for i in inputs_idx_to_clear: args[i].clear() # this call is boxed to avoid increasing refcount until we reach aot_module_simplified forward return compiled_fn(flat_args) return wrapper def get_locals_to_steal(maybe_gm): if not isinstance(maybe_gm, torch.fx.GraphModule) or not hasattr(maybe_gm, "meta"): return [] return maybe_gm.meta.get("locals_to_steal", []) def set_locals_to_steal(gm, locals_to_steal): gm.meta["locals_to_steal"] = locals_to_steal class Lit: def __init__(self, s): self.s = s def __repr__(self): return self.s warn_once_cache: Set[str] = set() def warn_once(msg, stacklevel=1): # Dynamo causes all warnings.warn (in user code and in Dynamo code) to print all the time. # path_to_url # warn_once is a workaround: if the msg has been warned on before, then we will not # warn again. # NB: it's totally ok to store a cache of all the strings: this is what warnings.warn does as well. if msg in warn_once_cache: return warn_once_cache.add(msg) warnings.warn(msg, stacklevel=stacklevel + 1) def strip_color_from_string(text): # This regular expression matches ANSI escape codes ansi_escape = re.compile(r"\x1B[@-_][0-?]*[ -/]*[@-~]") return ansi_escape.sub("", text) @contextlib.contextmanager def _disable_saved_tensors_hooks_during_tracing(): # See NOTE: [Deferring tensor pack/unpack hooks until runtime] try: prior = torch._C._autograd._saved_tensors_hooks_set_tracing(True) yield finally: torch._C._autograd._saved_tensors_hooks_set_tracing(prior) def is_parameter_freezing(): return torch._inductor.config.freezing and not torch.is_grad_enabled() def get_torch_function_mode_stack(filter_ignored=True): from .variables.torch_function import IGNORED_MODES stack = [_get_function_stack_at(i) for i in range(_len_torch_function_stack())] if filter_ignored: stack = [mode for mode in stack if type(mode) not in IGNORED_MODES] return stack def get_torch_function_mode_stack_at(ind): assert ind < _len_torch_function_stack() and ind >= 0 return torch._C._get_function_stack_at(ind) def set_torch_function_mode_stack(stack): for i in range(_len_torch_function_stack()): _pop_torch_function_stack() for mode in stack: _push_on_torch_function_stack(mode) def verify_guard_fn_signature(value): fn = value.__metadata_guard__ sig = inspect.signature(fn) if len(sig.parameters) != 2: from .exc import InternalTorchDynamoError raise InternalTorchDynamoError( "Tensor subclass method __metadata_guard__ must take exactly two subclass metadata arguments" ) if fn.__self__ != value.__class__: from .exc import InternalTorchDynamoError raise InternalTorchDynamoError( "Tensor subclass method __metadata_guard__ must be a classmethod" ) def does_not_override_dict_iter_methods(user_cls): return ( user_cls.items in (dict.items, collections.OrderedDict.items) and user_cls.values in (dict.values, collections.OrderedDict.values) and user_cls.keys in (dict.keys, collections.OrderedDict.keys) and user_cls.__iter__ in (dict.__iter__, collections.OrderedDict.__iter__) ) # Helper function to extract relevant parts of a tensor's __dict__ to store in node meta. # To avoid ref cycles, it's important that no tensors are present here, so leave those out. def _extract_tensor_dict(t): KEYS_TO_COPY = [ "_dynamo_static_input_type", "tag", ] tensor_dict = { key: copy.copy(t.__dict__[key]) for key in KEYS_TO_COPY if key in t.__dict__ } return tensor_dict # This is useful for reconstructing within the Dynamo graph the non-graph-input objects # whose lifetime is governed by the user. # e.g. torch.cuda.Event is a prime example. user_obj_id_to_weakref: Dict[int, weakref.ReferenceType[object]] = {} def get_user_object_from_id(obj_id): obj = user_obj_id_to_weakref[obj_id]() assert obj is not None, "User object is no longer alive" return obj def store_user_object_weakref(obj): obj_id = id(obj) user_obj_id_to_weakref[obj_id] = weakref.ref(obj) ```
```objective-c /* Public domain. */ #ifndef _LINUX_MUTEX_H #define _LINUX_MUTEX_H #include <sys/stdint.h> #include <sys/rwlock.h> #include <linux/list.h> #include <linux/spinlock_types.h> #include <linux/lockdep.h> #define DEFINE_MUTEX(x) struct rwlock x = RWLOCK_INITIALIZER(#x) #define mutex_lock_interruptible_nested(rwl, subc) \ mutex_lock_interruptible(rwl) #define mutex_lock(rwl) rw_enter_write(rwl) #define mutex_lock_nest_lock(rwl, sub) rw_enter_write(rwl) #define mutex_lock_nested(rwl, sub) rw_enter_write(rwl) #define mutex_trylock(rwl) (rw_enter(rwl, RW_WRITE | RW_NOSLEEP) == 0) #define mutex_unlock(rwl) rw_exit_write(rwl) #define mutex_is_locked(rwl) (rw_status(rwl) != 0) #define mutex_destroy(rwl) static inline int mutex_lock_interruptible(struct rwlock *rwl) { if (rw_enter(rwl, RW_WRITE | RW_INTR) != 0) return -EINTR; return 0; } enum mutex_trylock_recursive_result { MUTEX_TRYLOCK_FAILED, MUTEX_TRYLOCK_SUCCESS, MUTEX_TRYLOCK_RECURSIVE }; static inline enum mutex_trylock_recursive_result mutex_trylock_recursive(struct rwlock *rwl) { if (rw_status(rwl) == RW_WRITE) return MUTEX_TRYLOCK_RECURSIVE; if (mutex_trylock(rwl)) return MUTEX_TRYLOCK_SUCCESS; return MUTEX_TRYLOCK_FAILED; } int atomic_dec_and_mutex_lock(volatile int *, struct rwlock *); #endif ```
Brien Thomas "B. T." Collins (October 17, 1940 – March 19, 1993) was an American politician from California and a member of the Republican party. Early years Born in New York City, Collins served as a Green Beret Captain during the Vietnam War and lost his right arm and right leg to a grenade attack in 1967. Upon returning to the United States, Collins enrolled at Santa Clara University, earning a B.A. in 1970 and a J.D. in 1973. Executive branch In 1979, Collins was appointed by Democratic Governor Jerry Brown as Director of the California Conservation Corps. During his California Conservation Corps service, Collins gained notoriety for drinking a beaker of malathion to demonstrate his belief that it was safe. Although a Democrat, Brown nevertheless appointed the conservative Republican Collins to replace Gray Davis as his chief of staff, a position Collins held from 1981 until Brown left office in 1983. Collins served as chief deputy to Republican California State Treasurer Tom Hayes from 1989 until 1991, when Hayes left office and Republican Governor Pete Wilson appointed him as director of the California Youth Authority. State Assembly After Sacramento-area Republican Tim Leslie won a special election to the California State Senate to replace John Doolittle, who had been elected to Congress, Wilson encouraged Collins to run for Leslie's vacant seat in the State Assembly. Collins won a special election that September for the Sacramento-area 5th District against fellow Republican Barbara Alby, and narrowly beat her again in the 1992 GOP primary. Death Collins died of a sudden heart attack March 19, 1993 in Sacramento while serving his second term in the State Assembly. Alby won the special election to replace him. Several sites in Sacramento have been named in his honor, including the BT Collins Juvenile Justice Center in Sacramento. When the Sacramento Army Depot was redesignated as an Army Reserve Center in the mid-1990s, it was renamed the B.T. Collins Army Reserve Center. There is also a park in the City of Folsom named the B.T. Collins City Park located at 828 Willow Creek Drive, Folsom, California. The men's restroom in the Santa Clara University School of Law library was named the "B.T. Collins Memorial Latrine" in his honor; it features a plaque over the urinal with a quote from Collins: "If it ain't in Gilbert's, it ain't the Law." Electoral history References Further reading External links B.T. Collins candidate information at JoinCalifornia.com B.T. Collins Scholarship official site B.T. Collins "Captain Hook" Scholarship at Santa Clara University School of Law B.T. Collins remembered on 25th Anniversary of his passing at KFBK (AM) 20th-century American politicians Republican Party members of the California State Assembly Jerry Brown Chiefs of staff to United States state governors American politicians with disabilities American amputees United States Army personnel of the Vietnam War Members of the United States Army Special Forces United States Army officers Santa Clara University alumni 1993 deaths 1940 births
The Kaimosi blind snake (Afrotyphlops kaimosae) is a species of snake in the family Typhlopidae. References Endemic fauna of Kenya kaimosae Reptiles described in 1935
```assembly ;****************************************************************************** ;* SSE-optimized functions for the DCA decoder ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* ;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* ;* You should have received a copy of the GNU Lesser General Public ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "libavutil/x86/x86util.asm" SECTION .text %macro SETZERO 1 %if cpuflag(sse2) && notcpuflag(avx) pxor %1, %1 %else xorps %1, %1, %1 %endif %endmacro %macro SHUF 3 %if cpuflag(avx) mova %3, [%2 - 16] vperm2f128 %1, %3, %3, 1 vshufps %1, %1, %1, q0123 %elif cpuflag(sse2) pshufd %1, [%2], q0123 %else mova %1, [%2] shufps %1, %1, q0123 %endif %endmacro %macro INNER_LOOP 1 ; reading backwards: ptr1 = synth_buf + j + i; ptr2 = synth_buf + j - i ;~ a += window[i + j] * (-synth_buf[15 - i + j]) ;~ b += window[i + j + 16] * (synth_buf[i + j]) SHUF m5, ptr2 + j + (15 - 3) * 4, m6 mova m6, [ptr1 + j] %if ARCH_X86_64 SHUF m11, ptr2 + j + (15 - 3) * 4 - mmsize, m12 mova m12, [ptr1 + j + mmsize] %endif %if cpuflag(fma3) fmaddps m2, m6, [win + %1 + j + 16 * 4], m2 fnmaddps m1, m5, [win + %1 + j], m1 %if ARCH_X86_64 fmaddps m8, m12, [win + %1 + j + mmsize + 16 * 4], m8 fnmaddps m7, m11, [win + %1 + j + mmsize], m7 %endif %else ; non-FMA mulps m6, m6, [win + %1 + j + 16 * 4] mulps m5, m5, [win + %1 + j] %if ARCH_X86_64 mulps m12, m12, [win + %1 + j + mmsize + 16 * 4] mulps m11, m11, [win + %1 + j + mmsize] %endif addps m2, m2, m6 subps m1, m1, m5 %if ARCH_X86_64 addps m8, m8, m12 subps m7, m7, m11 %endif %endif ; cpuflag(fma3) ;~ c += window[i + j + 32] * (synth_buf[16 + i + j]) ;~ d += window[i + j + 48] * (synth_buf[31 - i + j]) SHUF m6, ptr2 + j + (31 - 3) * 4, m5 mova m5, [ptr1 + j + 16 * 4] %if ARCH_X86_64 SHUF m12, ptr2 + j + (31 - 3) * 4 - mmsize, m11 mova m11, [ptr1 + j + mmsize + 16 * 4] %endif %if cpuflag(fma3) fmaddps m3, m5, [win + %1 + j + 32 * 4], m3 fmaddps m4, m6, [win + %1 + j + 48 * 4], m4 %if ARCH_X86_64 fmaddps m9, m11, [win + %1 + j + mmsize + 32 * 4], m9 fmaddps m10, m12, [win + %1 + j + mmsize + 48 * 4], m10 %endif %else ; non-FMA mulps m5, m5, [win + %1 + j + 32 * 4] mulps m6, m6, [win + %1 + j + 48 * 4] %if ARCH_X86_64 mulps m11, m11, [win + %1 + j + mmsize + 32 * 4] mulps m12, m12, [win + %1 + j + mmsize + 48 * 4] %endif addps m3, m3, m5 addps m4, m4, m6 %if ARCH_X86_64 addps m9, m9, m11 addps m10, m10, m12 %endif %endif ; cpuflag(fma3) sub j, 64 * 4 %endmacro ; void ff_synth_filter_inner_<opt>(float *synth_buf, float synth_buf2[32], ; const float window[512], float out[32], ; intptr_t offset, float scale) %macro SYNTH_FILTER 0 cglobal synth_filter_inner, 0, 6 + 4 * ARCH_X86_64, 7 + 6 * ARCH_X86_64, \ synth_buf, synth_buf2, window, out, off, scale %define scale m0 %if ARCH_X86_32 || WIN64 %if cpuflag(sse2) && notcpuflag(avx) movd scale, scalem SPLATD m0 %else VBROADCASTSS m0, scalem %endif ; Make sure offset is in a register and not on the stack %define OFFQ r4q %else SPLATD xmm0 %if cpuflag(avx) vinsertf128 m0, m0, xmm0, 1 %endif %define OFFQ offq %endif ; prepare inner counter limit 1 mov r5q, 480 sub r5q, offmp and r5q, -64 shl r5q, 2 %if ARCH_X86_32 || notcpuflag(avx) mov OFFQ, r5q %define i r5q mov i, 16 * 4 - (ARCH_X86_64 + 1) * mmsize ; main loop counter %else %define i 0 %define OFFQ r5q %endif %define buf2 synth_buf2q %if ARCH_X86_32 mov buf2, synth_buf2mp %endif .mainloop: ; m1 = a m2 = b m3 = c m4 = d SETZERO m3 SETZERO m4 mova m1, [buf2 + i] mova m2, [buf2 + i + 16 * 4] %if ARCH_X86_32 %define ptr1 r0q %define ptr2 r1q %define win r2q %define j r3q mov win, windowm mov ptr1, synth_bufm %if ARCH_X86_32 || notcpuflag(avx) add win, i add ptr1, i %endif %else ; ARCH_X86_64 %define ptr1 r6q %define ptr2 r7q ; must be loaded %define win r8q %define j r9q SETZERO m9 SETZERO m10 mova m7, [buf2 + i + mmsize] mova m8, [buf2 + i + mmsize + 16 * 4] lea win, [windowq + i] lea ptr1, [synth_bufq + i] %endif mov ptr2, synth_bufmp ; prepare the inner loop counter mov j, OFFQ %if ARCH_X86_32 || notcpuflag(avx) sub ptr2, i %endif .loop1: INNER_LOOP 0 jge .loop1 mov j, 448 * 4 sub j, OFFQ jz .end sub ptr1, j sub ptr2, j add win, OFFQ ; now at j-64, so define OFFSET sub j, 64 * 4 .loop2: INNER_LOOP 64 * 4 jge .loop2 .end: %if ARCH_X86_32 mov buf2, synth_buf2m ; needed for next iteration anyway mov outq, outmp ; j, which will be set again during it %endif ;~ out[i] = a * scale; ;~ out[i + 16] = b * scale; mulps m1, m1, scale mulps m2, m2, scale %if ARCH_X86_64 mulps m7, m7, scale mulps m8, m8, scale %endif ;~ synth_buf2[i] = c; ;~ synth_buf2[i + 16] = d; mova [buf2 + i + 0 * 4], m3 mova [buf2 + i + 16 * 4], m4 %if ARCH_X86_64 mova [buf2 + i + 0 * 4 + mmsize], m9 mova [buf2 + i + 16 * 4 + mmsize], m10 %endif ;~ out[i] = a; ;~ out[i + 16] = a; mova [outq + i + 0 * 4], m1 mova [outq + i + 16 * 4], m2 %if ARCH_X86_64 mova [outq + i + 0 * 4 + mmsize], m7 mova [outq + i + 16 * 4 + mmsize], m8 %endif %if ARCH_X86_32 || notcpuflag(avx) sub i, (ARCH_X86_64 + 1) * mmsize jge .mainloop %endif RET %endmacro %if ARCH_X86_32 INIT_XMM sse SYNTH_FILTER %endif INIT_XMM sse2 SYNTH_FILTER INIT_YMM avx SYNTH_FILTER INIT_YMM fma3 SYNTH_FILTER ```
Events from the year 1749 in Ireland. Incumbent Monarch: George II Events 3 June – radical apothecary Charles Lucas begins publication of The Censor, or Citizens' Journal in Dublin. August–September – Charles Wesley makes his second visit to Ireland. 16 October – the Irish House of Commons threatens Charles Lucas with prosecution and he is forced to flee. James Simon's An essay towards an historical account of Irish coins is published in Dublin. Births 22 January – John Barclay, soldier, politician, jurist and businessman in America (died 1824) July – Jocelyn Deane, politician (died 1780) Robert Barber, quartermaster on HMS Adventure during the second voyage of James Cook (died 1783) Thomas Burke, artist (died 1815) William Richardson, landowner and politician (died 1822) Edward Smyth, sculptor (died 1812) James Whitelaw, historian, writer, statistician and philanthropist (died 1813) Approximate date – Brian Merriman, Irish language poet (died 1805) Deaths 3 January – John Ussher, politician (born 1703) 22 January – Matthew Concanen, writer, poet and lawyer (born 1701) 20 February (hanged at Tyburn) – Usher Gahagan, classical scholar. May – Samuel Boyse, poet (born 1702/3) 21 September – Sir John Bingham, 5th Baronet, politician (born 1690) Approximate date – Eamonn Laidir Ó Flaithbertaigh, Jacobite. References Years of the 18th century in Ireland Ireland 1740s in Ireland
Hesycha microphthalma is a species of beetle in the family Cerambycidae. It was described by Martins and Galileo in 1990. It is known from Brazil. References Onciderini Beetles described in 1990
The Indochinese barbet (Psilopogon annamensis), also called Annam barbet, is a bird belonging to the family Megalaimidae. It inhabits tropical and subtropical forests. It is found in Laos, Vietnam and Cambodia. It used to be considered a subspecies of the black-browed barbet. References Indochinese barbet Birds of Laos Birds of Vietnam Indochinese barbet
100 Lekë (100 L) has a value of 100 Albanian lek. It exists as both a coin and a banknote. References Currencies of Albania One-hundred-base-unit coins
```python from flask import Flask, request, make_response app = Flask(__name__) @app.route('/XSS_param', methods =['GET']) def XSS1(): param = request.args.get('param', 'not set') other_var = param + '' html = open('templates/XSS_param.html').read() not_dangerous = "" resp = make_response(html.replace('{{ param }}', not_dangerous)) return resp if __name__ == '__main__': app.run(debug= True) ```
```c /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains C code routines that are called by the SQLite parser ** when syntax rules are reduced. The routines in this file handle the ** following kinds of SQL syntax: ** ** CREATE TABLE ** DROP TABLE ** CREATE INDEX ** DROP INDEX ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK */ #include "sqliteInt.h" /* ** This routine is called when a new SQL statement is beginning to ** be parsed. Initialize the pParse structure as needed. */ void sqlite3BeginParse(Parse *pParse, int explainFlag){ pParse->explain = (u8)explainFlag; pParse->nVar = 0; } #ifndef SQLITE_OMIT_SHARED_CACHE /* ** The TableLock structure is only used by the sqlite3TableLock() and ** codeTableLocks() functions. */ struct TableLock { int iDb; /* The database containing the table to be locked */ int iTab; /* The root page of the table to be locked */ u8 isWriteLock; /* True for write lock. False for a read lock */ const char *zName; /* Name of the table */ }; /* ** Record the fact that we want to lock a table at run-time. ** ** The table to be locked has root page iTab and is found in database iDb. ** A read or a write lock can be taken depending on isWritelock. ** ** This routine just records the fact that the lock is desired. The ** code to make the lock occur is generated by a later call to ** codeTableLocks() which occurs during sqlite3FinishCoding(). */ void sqlite3TableLock( Parse *pParse, /* Parsing context */ int iDb, /* Index of the database containing the table to lock */ int iTab, /* Root page number of the table to be locked */ u8 isWriteLock, /* True for a write lock */ const char *zName /* Name of the table to be locked */ ){ Parse *pToplevel = sqlite3ParseToplevel(pParse); int i; int nBytes; TableLock *p; assert( iDb>=0 ); for(i=0; i<pToplevel->nTableLock; i++){ p = &pToplevel->aTableLock[i]; if( p->iDb==iDb && p->iTab==iTab ){ p->isWriteLock = (p->isWriteLock || isWriteLock); return; } } nBytes = sizeof(TableLock) * (pToplevel->nTableLock+1); pToplevel->aTableLock = sqlite3DbReallocOrFree(pToplevel->db, pToplevel->aTableLock, nBytes); if( pToplevel->aTableLock ){ p = &pToplevel->aTableLock[pToplevel->nTableLock++]; p->iDb = iDb; p->iTab = iTab; p->isWriteLock = isWriteLock; p->zName = zName; }else{ pToplevel->nTableLock = 0; pToplevel->db->mallocFailed = 1; } } /* ** Code an OP_TableLock instruction for each table locked by the ** statement (configured by calls to sqlite3TableLock()). */ static void codeTableLocks(Parse *pParse){ int i; Vdbe *pVdbe; pVdbe = sqlite3GetVdbe(pParse); assert( pVdbe!=0 ); /* sqlite3GetVdbe cannot fail: VDBE already allocated */ for(i=0; i<pParse->nTableLock; i++){ TableLock *p = &pParse->aTableLock[i]; int p1 = p->iDb; sqlite3VdbeAddOp4(pVdbe, OP_TableLock, p1, p->iTab, p->isWriteLock, p->zName, P4_STATIC); } } #else #define codeTableLocks(x) #endif /* ** Return TRUE if the given yDbMask object is empty - if it contains no ** 1 bits. This routine is used by the DbMaskAllZero() and DbMaskNotZero() ** macros when SQLITE_MAX_ATTACHED is greater than 30. */ #if SQLITE_MAX_ATTACHED>30 int sqlite3DbMaskAllZero(yDbMask m){ int i; for(i=0; i<sizeof(yDbMask); i++) if( m[i] ) return 0; return 1; } #endif /* ** This routine is called after a single SQL statement has been ** parsed and a VDBE program to execute that statement has been ** prepared. This routine puts the finishing touches on the ** VDBE program and resets the pParse structure for the next ** parse. ** ** Note that if an error occurred, it might be the case that ** no VDBE code was generated. */ void sqlite3FinishCoding(Parse *pParse){ sqlite3 *db; Vdbe *v; assert( pParse->pToplevel==0 ); db = pParse->db; if( db->mallocFailed ) return; if( pParse->nested ) return; if( pParse->nErr ) return; /* Begin by generating some termination code at the end of the ** vdbe program */ v = sqlite3GetVdbe(pParse); assert( !pParse->isMultiWrite || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)); if( v ){ while( sqlite3VdbeDeletePriorOpcode(v, OP_Close) ){} sqlite3VdbeAddOp0(v, OP_Halt); #if SQLITE_USER_AUTHENTICATION if( pParse->nTableLock>0 && db->init.busy==0 ){ sqlite3UserAuthInit(db); if( db->auth.authLevel<UAUTH_User ){ pParse->rc = SQLITE_AUTH_USER; sqlite3ErrorMsg(pParse, "user not authenticated"); return; } } #endif /* The cookie mask contains one bit for each database file open. ** (Bit 0 is for main, bit 1 is for temp, and so forth.) Bits are ** set for each database that is used. Generate code to start a ** transaction on each used database and to verify the schema cookie ** on each used database. */ if( db->mallocFailed==0 && (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) ){ int iDb, i; assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init ); sqlite3VdbeJumpHere(v, 0); for(iDb=0; iDb<db->nDb; iDb++){ if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue; sqlite3VdbeUsesBtree(v, iDb); sqlite3VdbeAddOp4Int(v, OP_Transaction, /* Opcode */ iDb, /* P1 */ DbMaskTest(pParse->writeMask,iDb), /* P2 */ pParse->cookieValue[iDb], /* P3 */ db->aDb[iDb].pSchema->iGeneration /* P4 */ ); if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1); } #ifndef SQLITE_OMIT_VIRTUALTABLE for(i=0; i<pParse->nVtabLock; i++){ char *vtab = (char *)sqlite3GetVTable(db, pParse->apVtabLock[i]); sqlite3VdbeAddOp4(v, OP_VBegin, 0, 0, 0, vtab, P4_VTAB); } pParse->nVtabLock = 0; #endif /* Once all the cookies have been verified and transactions opened, ** obtain the required table-locks. This is a no-op unless the ** shared-cache feature is enabled. */ codeTableLocks(pParse); /* Initialize any AUTOINCREMENT data structures required. */ sqlite3AutoincrementBegin(pParse); /* Code constant expressions that where factored out of inner loops */ if( pParse->pConstExpr ){ ExprList *pEL = pParse->pConstExpr; pParse->okConstFactor = 0; for(i=0; i<pEL->nExpr; i++){ sqlite3ExprCode(pParse, pEL->a[i].pExpr, pEL->a[i].u.iConstExprReg); } } /* Finally, jump back to the beginning of the executable code. */ sqlite3VdbeAddOp2(v, OP_Goto, 0, 1); } } /* Get the VDBE program ready for execution */ if( v && ALWAYS(pParse->nErr==0) && !db->mallocFailed ){ assert( pParse->iCacheLevel==0 ); /* Disables and re-enables match */ /* A minimum of one cursor is required if autoincrement is used * See ticket [a696379c1f08866] */ if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1; sqlite3VdbeMakeReady(v, pParse); pParse->rc = SQLITE_DONE; pParse->colNamesSet = 0; }else{ pParse->rc = SQLITE_ERROR; } pParse->nTab = 0; pParse->nMem = 0; pParse->nSet = 0; pParse->nVar = 0; DbMaskZero(pParse->cookieMask); } /* ** Run the parser and code generator recursively in order to generate ** code for the SQL statement given onto the end of the pParse context ** currently under construction. When the parser is run recursively ** this way, the final OP_Halt is not appended and other initialization ** and finalization steps are omitted because those are handling by the ** outermost parser. ** ** Not everything is nestable. This facility is designed to permit ** INSERT, UPDATE, and DELETE operations against SQLITE_MASTER. Use ** care if you decide to try to use this routine for some other purposes. */ void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){ va_list ap; char *zSql; char *zErrMsg = 0; sqlite3 *db = pParse->db; # define SAVE_SZ (sizeof(Parse) - offsetof(Parse,nVar)) char saveBuf[SAVE_SZ]; if( pParse->nErr ) return; assert( pParse->nested<10 ); /* Nesting should only be of limited depth */ va_start(ap, zFormat); zSql = sqlite3VMPrintf(db, zFormat, ap); va_end(ap); if( zSql==0 ){ return; /* A malloc must have failed */ } pParse->nested++; memcpy(saveBuf, &pParse->nVar, SAVE_SZ); memset(&pParse->nVar, 0, SAVE_SZ); sqlite3RunParser(pParse, zSql, &zErrMsg); sqlite3DbFree(db, zErrMsg); sqlite3DbFree(db, zSql); memcpy(&pParse->nVar, saveBuf, SAVE_SZ); pParse->nested--; } #if SQLITE_USER_AUTHENTICATION /* ** Return TRUE if zTable is the name of the system table that stores the ** list of users and their access credentials. */ int sqlite3UserAuthTable(const char *zTable){ return sqlite3_stricmp(zTable, "sqlite_user")==0; } #endif /* ** Locate the in-memory structure that describes a particular database ** table given the name of that table and (optionally) the name of the ** database containing the table. Return NULL if not found. ** ** If zDatabase is 0, all databases are searched for the table and the ** first matching table is returned. (No checking for duplicate table ** names is done.) The search order is TEMP first, then MAIN, then any ** auxiliary databases added using the ATTACH command. ** ** See also sqlite3LocateTable(). */ Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){ Table *p = 0; int i; assert( zName!=0 ); /* All mutexes are required for schema access. Make sure we hold them. */ assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) ); #if SQLITE_USER_AUTHENTICATION /* Only the admin user is allowed to know that the sqlite_user table ** exists */ if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){ return 0; } #endif for(i=OMIT_TEMPDB; i<db->nDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; assert( sqlite3SchemaMutexHeld(db, j, 0) ); p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName); if( p ) break; } return p; } /* ** Locate the in-memory structure that describes a particular database ** table given the name of that table and (optionally) the name of the ** database containing the table. Return NULL if not found. Also leave an ** error message in pParse->zErrMsg. ** ** The difference between this routine and sqlite3FindTable() is that this ** routine leaves an error message in pParse->zErrMsg where ** sqlite3FindTable() does not. */ Table *sqlite3LocateTable( Parse *pParse, /* context in which to report errors */ int isView, /* True if looking for a VIEW rather than a TABLE */ const char *zName, /* Name of the table we are looking for */ const char *zDbase /* Name of the database. Might be NULL */ ){ Table *p; /* Read the database schema. If an error occurs, leave an error message ** and code in pParse and return NULL. */ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ return 0; } p = sqlite3FindTable(pParse->db, zName, zDbase); if( p==0 ){ const char *zMsg = isView ? "no such view" : "no such table"; if( zDbase ){ sqlite3ErrorMsg(pParse, "%s: %s.%s", zMsg, zDbase, zName); }else{ sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName); } pParse->checkSchema = 1; } #if SQLITE_USER_AUTHENICATION else if( pParse->db->auth.authLevel<UAUTH_User ){ sqlite3ErrorMsg(pParse, "user not authenticated"); p = 0; } #endif return p; } /* ** Locate the table identified by *p. ** ** This is a wrapper around sqlite3LocateTable(). The difference between ** sqlite3LocateTable() and this function is that this function restricts ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be ** non-NULL if it is part of a view or trigger program definition. See ** sqlite3FixSrcList() for details. */ Table *sqlite3LocateTableItem( Parse *pParse, int isView, struct SrcList_item *p ){ const char *zDb; assert( p->pSchema==0 || p->zDatabase==0 ); if( p->pSchema ){ int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema); zDb = pParse->db->aDb[iDb].zName; }else{ zDb = p->zDatabase; } return sqlite3LocateTable(pParse, isView, p->zName, zDb); } /* ** Locate the in-memory structure that describes ** a particular index given the name of that index ** and the name of the database that contains the index. ** Return NULL if not found. ** ** If zDatabase is 0, all databases are searched for the ** table and the first matching index is returned. (No checking ** for duplicate index names is done.) The search order is ** TEMP first, then MAIN, then any auxiliary databases added ** using the ATTACH command. */ Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){ Index *p = 0; int i; /* All mutexes are required for schema access. Make sure we hold them. */ assert( zDb!=0 || sqlite3BtreeHoldsAllMutexes(db) ); for(i=OMIT_TEMPDB; i<db->nDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ Schema *pSchema = db->aDb[j].pSchema; assert( pSchema ); if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zName) ) continue; assert( sqlite3SchemaMutexHeld(db, j, 0) ); p = sqlite3HashFind(&pSchema->idxHash, zName); if( p ) break; } return p; } /* ** Reclaim the memory used by an index */ static void freeIndex(sqlite3 *db, Index *p){ #ifndef SQLITE_OMIT_ANALYZE sqlite3DeleteIndexSamples(db, p); #endif if( db==0 || db->pnBytesFreed==0 ) sqlite3KeyInfoUnref(p->pKeyInfo); sqlite3ExprDelete(db, p->pPartIdxWhere); sqlite3DbFree(db, p->zColAff); if( p->isResized ) sqlite3DbFree(db, p->azColl); #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 sqlite3_free(p->aiRowEst); #endif sqlite3DbFree(db, p); } /* ** For the index called zIdxName which is found in the database iDb, ** unlike that index from its Table then remove the index from ** the index hash table and free all memory structures associated ** with the index. */ void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){ Index *pIndex; Hash *pHash; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pHash = &db->aDb[iDb].pSchema->idxHash; pIndex = sqlite3HashInsert(pHash, zIdxName, 0); if( ALWAYS(pIndex) ){ if( pIndex->pTable->pIndex==pIndex ){ pIndex->pTable->pIndex = pIndex->pNext; }else{ Index *p; /* Justification of ALWAYS(); The index must be on the list of ** indices. */ p = pIndex->pTable->pIndex; while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; } if( ALWAYS(p && p->pNext==pIndex) ){ p->pNext = pIndex->pNext; } } freeIndex(db, pIndex); } db->flags |= SQLITE_InternChanges; } /* ** Look through the list of open database files in db->aDb[] and if ** any have been closed, remove them from the list. Reallocate the ** db->aDb[] structure to a smaller size, if possible. ** ** Entry 0 (the "main" database) and entry 1 (the "temp" database) ** are never candidates for being collapsed. */ void sqlite3CollapseDatabaseArray(sqlite3 *db){ int i, j; for(i=j=2; i<db->nDb; i++){ struct Db *pDb = &db->aDb[i]; if( pDb->pBt==0 ){ sqlite3DbFree(db, pDb->zName); pDb->zName = 0; continue; } if( j<i ){ db->aDb[j] = db->aDb[i]; } j++; } memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j])); db->nDb = j; if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0])); sqlite3DbFree(db, db->aDb); db->aDb = db->aDbStatic; } } /* ** Reset the schema for the database at index iDb. Also reset the ** TEMP schema. */ void sqlite3ResetOneSchema(sqlite3 *db, int iDb){ Db *pDb; assert( iDb<db->nDb ); /* Case 1: Reset the single schema identified by iDb */ pDb = &db->aDb[iDb]; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); assert( pDb->pSchema!=0 ); sqlite3SchemaClear(pDb->pSchema); /* If any database other than TEMP is reset, then also reset TEMP ** since TEMP might be holding triggers that reference tables in the ** other database. */ if( iDb!=1 ){ pDb = &db->aDb[1]; assert( pDb->pSchema!=0 ); sqlite3SchemaClear(pDb->pSchema); } return; } /* ** Erase all schema information from all attached databases (including ** "main" and "temp") for a single database connection. */ void sqlite3ResetAllSchemasOfConnection(sqlite3 *db){ int i; sqlite3BtreeEnterAll(db); for(i=0; i<db->nDb; i++){ Db *pDb = &db->aDb[i]; if( pDb->pSchema ){ sqlite3SchemaClear(pDb->pSchema); } } db->flags &= ~SQLITE_InternChanges; sqlite3VtabUnlockList(db); sqlite3BtreeLeaveAll(db); sqlite3CollapseDatabaseArray(db); } /* ** This routine is called when a commit occurs. */ void sqlite3CommitInternalChanges(sqlite3 *db){ db->flags &= ~SQLITE_InternChanges; } /* ** Delete memory allocated for the column names of a table or view (the ** Table.aCol[] array). */ static void sqliteDeleteColumnNames(sqlite3 *db, Table *pTable){ int i; Column *pCol; assert( pTable!=0 ); if( (pCol = pTable->aCol)!=0 ){ for(i=0; i<pTable->nCol; i++, pCol++){ sqlite3DbFree(db, pCol->zName); sqlite3ExprDelete(db, pCol->pDflt); sqlite3DbFree(db, pCol->zDflt); sqlite3DbFree(db, pCol->zType); sqlite3DbFree(db, pCol->zColl); } sqlite3DbFree(db, pTable->aCol); } } /* ** Remove the memory data structures associated with the given ** Table. No changes are made to disk by this routine. ** ** This routine just deletes the data structure. It does not unlink ** the table data structure from the hash table. But it does destroy ** memory structures of the indices and foreign keys associated with ** the table. ** ** The db parameter is optional. It is needed if the Table object ** contains lookaside memory. (Table objects in the schema do not use ** lookaside memory, but some ephemeral Table objects do.) Or the ** db parameter can be used with db->pnBytesFreed to measure the memory ** used by the Table object. */ void sqlite3DeleteTable(sqlite3 *db, Table *pTable){ Index *pIndex, *pNext; TESTONLY( int nLookaside; ) /* Used to verify lookaside not used for schema */ assert( !pTable || pTable->nRef>0 ); /* Do not delete the table until the reference count reaches zero. */ if( !pTable ) return; if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return; /* Record the number of outstanding lookaside allocations in schema Tables ** prior to doing any free() operations. Since schema Tables do not use ** lookaside, this number should not change. */ TESTONLY( nLookaside = (db && (pTable->tabFlags & TF_Ephemeral)==0) ? db->lookaside.nOut : 0 ); /* Delete all indices associated with this table. */ for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ pNext = pIndex->pNext; assert( pIndex->pSchema==pTable->pSchema ); if( !db || db->pnBytesFreed==0 ){ char *zName = pIndex->zName; TESTONLY ( Index *pOld = ) sqlite3HashInsert( &pIndex->pSchema->idxHash, zName, 0 ); assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) ); assert( pOld==pIndex || pOld==0 ); } freeIndex(db, pIndex); } /* Delete any foreign keys attached to this table. */ sqlite3FkDelete(db, pTable); /* Delete the Table structure itself. */ sqliteDeleteColumnNames(db, pTable); sqlite3DbFree(db, pTable->zName); sqlite3DbFree(db, pTable->zColAff); sqlite3SelectDelete(db, pTable->pSelect); #ifndef SQLITE_OMIT_CHECK sqlite3ExprListDelete(db, pTable->pCheck); #endif #ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3VtabClear(db, pTable); #endif sqlite3DbFree(db, pTable); /* Verify that no lookaside memory was used by schema tables */ assert( nLookaside==0 || nLookaside==db->lookaside.nOut ); } /* ** Unlink the given table from the hash tables and the delete the ** table structure with all its indices and foreign keys. */ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){ Table *p; Db *pDb; assert( db!=0 ); assert( iDb>=0 && iDb<db->nDb ); assert( zTabName ); assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); testcase( zTabName[0]==0 ); /* Zero-length table names are allowed */ pDb = &db->aDb[iDb]; p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, 0); sqlite3DeleteTable(db, p); db->flags |= SQLITE_InternChanges; } /* ** Given a token, return a string that consists of the text of that ** token. Space to hold the returned string ** is obtained from sqliteMalloc() and must be freed by the calling ** function. ** ** Any quotation marks (ex: "name", 'name', [name], or `name`) that ** surround the body of the token are removed. ** ** Tokens are often just pointers into the original SQL text and so ** are not \000 terminated and are not persistent. The returned string ** is \000 terminated and is persistent. */ char *sqlite3NameFromToken(sqlite3 *db, Token *pName){ char *zName; if( pName ){ zName = sqlite3DbStrNDup(db, (char*)pName->z, pName->n); sqlite3Dequote(zName); }else{ zName = 0; } return zName; } /* ** Open the sqlite_master table stored in database number iDb for ** writing. The table is opened using cursor 0. */ void sqlite3OpenMasterTable(Parse *p, int iDb){ Vdbe *v = sqlite3GetVdbe(p); sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(iDb)); sqlite3VdbeAddOp4Int(v, OP_OpenWrite, 0, MASTER_ROOT, iDb, 5); if( p->nTab==0 ){ p->nTab = 1; } } /* ** Parameter zName points to a nul-terminated buffer containing the name ** of a database ("main", "temp" or the name of an attached db). This ** function returns the index of the named database in db->aDb[], or ** -1 if the named db cannot be found. */ int sqlite3FindDbName(sqlite3 *db, const char *zName){ int i = -1; /* Database number */ if( zName ){ Db *pDb; int n = sqlite3Strlen30(zName); for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite3Strlen30(pDb->zName) && 0==sqlite3StrICmp(pDb->zName, zName) ){ break; } } } return i; } /* ** The token *pName contains the name of a database (either "main" or ** "temp" or the name of an attached db). This routine returns the ** index of the named database in db->aDb[], or -1 if the named db ** does not exist. */ int sqlite3FindDb(sqlite3 *db, Token *pName){ int i; /* Database number */ char *zName; /* Name we are searching for */ zName = sqlite3NameFromToken(db, pName); i = sqlite3FindDbName(db, zName); sqlite3DbFree(db, zName); return i; } /* The table or view or trigger name is passed to this routine via tokens ** pName1 and pName2. If the table name was fully qualified, for example: ** ** CREATE TABLE xxx.yyy (...); ** ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if ** the table name is not fully qualified, i.e.: ** ** CREATE TABLE yyy(...); ** ** Then pName1 is set to "yyy" and pName2 is "". ** ** This routine sets the *ppUnqual pointer to point at the token (pName1 or ** pName2) that stores the unqualified table name. The index of the ** database "xxx" is returned. */ int sqlite3TwoPartName( Parse *pParse, /* Parsing and code generating context */ Token *pName1, /* The "xxx" in the name "xxx.yyy" or "xxx" */ Token *pName2, /* The "yyy" in the name "xxx.yyy" */ Token **pUnqual /* Write the unqualified object name here */ ){ int iDb; /* Database holding the object */ sqlite3 *db = pParse->db; if( ALWAYS(pName2!=0) && pName2->n>0 ){ if( db->init.busy ) { sqlite3ErrorMsg(pParse, "corrupt database"); pParse->nErr++; return -1; } *pUnqual = pName2; iDb = sqlite3FindDb(db, pName1); if( iDb<0 ){ sqlite3ErrorMsg(pParse, "unknown database %T", pName1); pParse->nErr++; return -1; } }else{ assert( db->init.iDb==0 || db->init.busy ); iDb = db->init.iDb; *pUnqual = pName1; } return iDb; } /* ** This routine is used to check if the UTF-8 string zName is a legal ** unqualified name for a new schema object (table, index, view or ** trigger). All names are legal except those that begin with the string ** "sqlite_" (in upper, lower or mixed case). This portion of the namespace ** is reserved for internal use. */ int sqlite3CheckObjectName(Parse *pParse, const char *zName){ if( !pParse->db->init.busy && pParse->nested==0 && (pParse->db->flags & SQLITE_WriteSchema)==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName); return SQLITE_ERROR; } return SQLITE_OK; } /* ** Return the PRIMARY KEY index of a table */ Index *sqlite3PrimaryKeyIndex(Table *pTab){ Index *p; for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){} return p; } /* ** Return the column of index pIdx that corresponds to table ** column iCol. Return -1 if not found. */ i16 sqlite3ColumnOfIndex(Index *pIdx, i16 iCol){ int i; for(i=0; i<pIdx->nColumn; i++){ if( iCol==pIdx->aiColumn[i] ) return i; } return -1; } /* ** Begin constructing a new table representation in memory. This is ** the first of several action routines that get called in response ** to a CREATE TABLE statement. In particular, this routine is called ** after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp ** flag is true if the table should be stored in the auxiliary database ** file instead of in the main database file. This is normally the case ** when the "TEMP" or "TEMPORARY" keyword occurs in between ** CREATE and TABLE. ** ** The new table record is initialized and put in pParse->pNewTable. ** As more of the CREATE TABLE statement is parsed, additional action ** routines will be called to add more information to this record. ** At the end of the CREATE TABLE statement, the sqlite3EndTable() routine ** is called to complete the construction of the new table record. */ void sqlite3StartTable( Parse *pParse, /* Parser context */ Token *pName1, /* First part of the name of the table or view */ Token *pName2, /* Second part of the name of the table or view */ int isTemp, /* True if this is a TEMP table */ int isView, /* True if this is a VIEW */ int isVirtual, /* True if this is a VIRTUAL table */ int noErr /* Do nothing if table already exists */ ){ Table *pTable; char *zName = 0; /* The name of the new table */ sqlite3 *db = pParse->db; Vdbe *v; int iDb; /* Database number to create the table in */ Token *pName; /* Unqualified name of the table to create */ /* The table or view name to create is passed to this routine via tokens ** pName1 and pName2. If the table name was fully qualified, for example: ** ** CREATE TABLE xxx.yyy (...); ** ** Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if ** the table name is not fully qualified, i.e.: ** ** CREATE TABLE yyy(...); ** ** Then pName1 is set to "yyy" and pName2 is "". ** ** The call below sets the pName pointer to point at the token (pName1 or ** pName2) that stores the unqualified table name. The variable iDb is ** set to the index of the database that the table or view is to be ** created in. */ iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ) return; if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ sqlite3ErrorMsg(pParse, "temporary table name must be unqualified"); return; } if( !OMIT_TEMPDB && isTemp ) iDb = 1; pParse->sNameToken = *pName; zName = sqlite3NameFromToken(db, pName); if( zName==0 ) return; if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto begin_table_error; } if( db->init.iDb==1 ) isTemp = 1; #ifndef SQLITE_OMIT_AUTHORIZATION assert( (isTemp & 1)==isTemp ); { int code; char *zDb = db->aDb[iDb].zName; if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ goto begin_table_error; } if( isView ){ if( !OMIT_TEMPDB && isTemp ){ code = SQLITE_CREATE_TEMP_VIEW; }else{ code = SQLITE_CREATE_VIEW; } }else{ if( !OMIT_TEMPDB && isTemp ){ code = SQLITE_CREATE_TEMP_TABLE; }else{ code = SQLITE_CREATE_TABLE; } } if( !isVirtual && sqlite3AuthCheck(pParse, code, zName, 0, zDb) ){ goto begin_table_error; } } #endif /* Make sure the new table name does not collide with an existing ** index or table name in the same database. Issue an error message if ** it does. The exception is if the statement being parsed was passed ** to an sqlite3_declare_vtab() call. In that case only the column names ** and types will be used, so there is no need to test for namespace ** collisions. */ if( !IN_DECLARE_VTAB ){ char *zDb = db->aDb[iDb].zName; if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ goto begin_table_error; } pTable = sqlite3FindTable(db, zName, zDb); if( pTable ){ if( !noErr ){ sqlite3ErrorMsg(pParse, "table %T already exists", pName); }else{ assert( !db->init.busy ); sqlite3CodeVerifySchema(pParse, iDb); } goto begin_table_error; } if( sqlite3FindIndex(db, zName, zDb)!=0 ){ sqlite3ErrorMsg(pParse, "there is already an index named %s", zName); goto begin_table_error; } } pTable = sqlite3DbMallocZero(db, sizeof(Table)); if( pTable==0 ){ db->mallocFailed = 1; pParse->rc = SQLITE_NOMEM; pParse->nErr++; goto begin_table_error; } pTable->zName = zName; pTable->iPKey = -1; pTable->pSchema = db->aDb[iDb].pSchema; pTable->nRef = 1; pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) ); assert( pParse->pNewTable==0 ); pParse->pNewTable = pTable; /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ #ifndef SQLITE_OMIT_AUTOINCREMENT if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){ assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pTable->pSchema->pSeqTab = pTable; } #endif /* Begin generating the code that will insert the table record into ** the SQLITE_MASTER table. Note in particular that we must go ahead ** and allocate the record number for the table entry now. Before any ** PRIMARY KEY or UNIQUE keywords are parsed. Those keywords will cause ** indices to be created and the table record must come before the ** indices. Hence, the record number for the table must be allocated ** now. */ if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ int j1; int fileFormat; int reg1, reg2, reg3; sqlite3BeginWriteOperation(pParse, 0, iDb); #ifndef SQLITE_OMIT_VIRTUALTABLE if( isVirtual ){ sqlite3VdbeAddOp0(v, OP_VBegin); } #endif /* If the file format and encoding in the database have not been set, ** set them now. */ reg1 = pParse->regRowid = ++pParse->nMem; reg2 = pParse->regRoot = ++pParse->nMem; reg3 = ++pParse->nMem; sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT); sqlite3VdbeUsesBtree(v, iDb); j1 = sqlite3VdbeAddOp1(v, OP_If, reg3); VdbeCoverage(v); fileFormat = (db->flags & SQLITE_LegacyFileFmt)!=0 ? 1 : SQLITE_MAX_FILE_FORMAT; sqlite3VdbeAddOp2(v, OP_Integer, fileFormat, reg3); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, reg3); sqlite3VdbeAddOp2(v, OP_Integer, ENC(db), reg3); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_TEXT_ENCODING, reg3); sqlite3VdbeJumpHere(v, j1); /* This just creates a place-holder record in the sqlite_master table. ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** ** The rowid for the new entry is left in register pParse->regRowid. ** The root page number of the new table is left in reg pParse->regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ #if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) if( isView || isVirtual ){ sqlite3VdbeAddOp2(v, OP_Integer, 0, reg2); }else #endif { pParse->addrCrTab = sqlite3VdbeAddOp2(v, OP_CreateTable, iDb, reg2); } sqlite3OpenMasterTable(pParse, iDb); sqlite3VdbeAddOp2(v, OP_NewRowid, 0, reg1); sqlite3VdbeAddOp2(v, OP_Null, 0, reg3); sqlite3VdbeAddOp3(v, OP_Insert, 0, reg3, reg1); sqlite3VdbeChangeP5(v, OPFLAG_APPEND); sqlite3VdbeAddOp0(v, OP_Close); } /* Normal (non-error) return. */ return; /* If an error occurs, we jump here */ begin_table_error: sqlite3DbFree(db, zName); return; } /* ** This macro is used to compare two strings in a case-insensitive manner. ** It is slightly faster than calling sqlite3StrICmp() directly, but ** produces larger code. ** ** WARNING: This macro is not compatible with the strcmp() family. It ** returns true if the two strings are equal, otherwise false. */ #define STRICMP(x, y) (\ sqlite3UpperToLower[*(unsigned char *)(x)]== \ sqlite3UpperToLower[*(unsigned char *)(y)] \ && sqlite3StrICmp((x)+1,(y)+1)==0 ) /* ** Add a new column to the table currently being constructed. ** ** The parser calls this routine once for each column declaration ** in a CREATE TABLE statement. sqlite3StartTable() gets called ** first to get things going. Then this routine is called for each ** column. */ void sqlite3AddColumn(Parse *pParse, Token *pName){ Table *p; int i; char *z; Column *pCol; sqlite3 *db = pParse->db; if( (p = pParse->pNewTable)==0 ) return; #if SQLITE_MAX_COLUMN if( p->nCol+1>db->aLimit[SQLITE_LIMIT_COLUMN] ){ sqlite3ErrorMsg(pParse, "too many columns on %s", p->zName); return; } #endif z = sqlite3NameFromToken(db, pName); if( z==0 ) return; for(i=0; i<p->nCol; i++){ if( STRICMP(z, p->aCol[i].zName) ){ sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); sqlite3DbFree(db, z); return; } } if( (p->nCol & 0x7)==0 ){ Column *aNew; aNew = sqlite3DbRealloc(db,p->aCol,(p->nCol+8)*sizeof(p->aCol[0])); if( aNew==0 ){ sqlite3DbFree(db, z); return; } p->aCol = aNew; } pCol = &p->aCol[p->nCol]; memset(pCol, 0, sizeof(p->aCol[0])); pCol->zName = z; /* If there is no type specified, columns have the default affinity ** 'NONE'. If there is a type specified, then sqlite3AddColumnType() will ** be called next to set pCol->affinity correctly. */ pCol->affinity = SQLITE_AFF_NONE; pCol->szEst = 1; p->nCol++; } /* ** This routine is called by the parser while in the middle of ** parsing a CREATE TABLE statement. A "NOT NULL" constraint has ** been seen on a column. This routine sets the notNull flag on ** the column currently under construction. */ void sqlite3AddNotNull(Parse *pParse, int onError){ Table *p; p = pParse->pNewTable; if( p==0 || NEVER(p->nCol<1) ) return; p->aCol[p->nCol-1].notNull = (u8)onError; } /* ** Scan the column type name zType (length nType) and return the ** associated affinity type. ** ** This routine does a case-independent search of zType for the ** substrings in the following table. If one of the substrings is ** found, the corresponding affinity is returned. If zType contains ** more than one of the substrings, entries toward the top of ** the table take priority. For example, if zType is 'BLOBINT', ** SQLITE_AFF_INTEGER is returned. ** ** Substring | Affinity ** -------------------------------- ** 'INT' | SQLITE_AFF_INTEGER ** 'CHAR' | SQLITE_AFF_TEXT ** 'CLOB' | SQLITE_AFF_TEXT ** 'TEXT' | SQLITE_AFF_TEXT ** 'BLOB' | SQLITE_AFF_NONE ** 'REAL' | SQLITE_AFF_REAL ** 'FLOA' | SQLITE_AFF_REAL ** 'DOUB' | SQLITE_AFF_REAL ** ** If none of the substrings in the above table are found, ** SQLITE_AFF_NUMERIC is returned. */ char sqlite3AffinityType(const char *zIn, u8 *pszEst){ u32 h = 0; char aff = SQLITE_AFF_NUMERIC; const char *zChar = 0; if( zIn==0 ) return aff; while( zIn[0] ){ h = (h<<8) + sqlite3UpperToLower[(*zIn)&0xff]; zIn++; if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */ aff = SQLITE_AFF_TEXT; zChar = zIn; }else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */ aff = SQLITE_AFF_TEXT; }else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */ aff = SQLITE_AFF_TEXT; }else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */ && (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){ aff = SQLITE_AFF_NONE; if( zIn[0]=='(' ) zChar = zIn; #ifndef SQLITE_OMIT_FLOATING_POINT }else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */ && aff==SQLITE_AFF_NUMERIC ){ aff = SQLITE_AFF_REAL; }else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */ && aff==SQLITE_AFF_NUMERIC ){ aff = SQLITE_AFF_REAL; }else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */ && aff==SQLITE_AFF_NUMERIC ){ aff = SQLITE_AFF_REAL; #endif }else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */ aff = SQLITE_AFF_INTEGER; break; } } /* If pszEst is not NULL, store an estimate of the field size. The ** estimate is scaled so that the size of an integer is 1. */ if( pszEst ){ *pszEst = 1; /* default size is approx 4 bytes */ if( aff<SQLITE_AFF_NUMERIC ){ if( zChar ){ while( zChar[0] ){ if( sqlite3Isdigit(zChar[0]) ){ int v = 0; sqlite3GetInt32(zChar, &v); v = v/4 + 1; if( v>255 ) v = 255; *pszEst = v; /* BLOB(k), VARCHAR(k), CHAR(k) -> r=(k/4+1) */ break; } zChar++; } }else{ *pszEst = 5; /* BLOB, TEXT, CLOB -> r=5 (approx 20 bytes)*/ } } } return aff; } /* ** This routine is called by the parser while in the middle of ** parsing a CREATE TABLE statement. The pFirst token is the first ** token in the sequence of tokens that describe the type of the ** column currently under construction. pLast is the last token ** in the sequence. Use this information to construct a string ** that contains the typename of the column and store that string ** in zType. */ void sqlite3AddColumnType(Parse *pParse, Token *pType){ Table *p; Column *pCol; p = pParse->pNewTable; if( p==0 || NEVER(p->nCol<1) ) return; pCol = &p->aCol[p->nCol-1]; assert( pCol->zType==0 ); pCol->zType = sqlite3NameFromToken(pParse->db, pType); pCol->affinity = sqlite3AffinityType(pCol->zType, &pCol->szEst); } /* ** The expression is the default value for the most recently added column ** of the table currently under construction. ** ** Default value expressions must be constant. Raise an exception if this ** is not the case. ** ** This routine is called by the parser while in the middle of ** parsing a CREATE TABLE statement. */ void sqlite3AddDefaultValue(Parse *pParse, ExprSpan *pSpan){ Table *p; Column *pCol; sqlite3 *db = pParse->db; p = pParse->pNewTable; if( p!=0 ){ pCol = &(p->aCol[p->nCol-1]); if( !sqlite3ExprIsConstantOrFunction(pSpan->pExpr, db->init.busy) ){ sqlite3ErrorMsg(pParse, "default value of column [%s] is not constant", pCol->zName); }else{ /* A copy of pExpr is used instead of the original, as pExpr contains ** tokens that point to volatile memory. The 'span' of the expression ** is required by pragma table_info. */ sqlite3ExprDelete(db, pCol->pDflt); pCol->pDflt = sqlite3ExprDup(db, pSpan->pExpr, EXPRDUP_REDUCE); sqlite3DbFree(db, pCol->zDflt); pCol->zDflt = sqlite3DbStrNDup(db, (char*)pSpan->zStart, (int)(pSpan->zEnd - pSpan->zStart)); } } sqlite3ExprDelete(db, pSpan->pExpr); } /* ** Designate the PRIMARY KEY for the table. pList is a list of names ** of columns that form the primary key. If pList is NULL, then the ** most recently added column of the table is the primary key. ** ** A table can have at most one primary key. If the table already has ** a primary key (and this is the second primary key) then create an ** error. ** ** If the PRIMARY KEY is on a single column whose datatype is INTEGER, ** then we will try to use that column as the rowid. Set the Table.iPKey ** field of the table under construction to be the index of the ** INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is ** no INTEGER PRIMARY KEY. ** ** If the key is not an INTEGER PRIMARY KEY, then create a unique ** index for the key. No index is created for INTEGER PRIMARY KEYs. */ void sqlite3AddPrimaryKey( Parse *pParse, /* Parsing context */ ExprList *pList, /* List of field names to be indexed */ int onError, /* What to do with a uniqueness conflict */ int autoInc, /* True if the AUTOINCREMENT keyword is present */ int sortOrder /* SQLITE_SO_ASC or SQLITE_SO_DESC */ ){ Table *pTab = pParse->pNewTable; char *zType = 0; int iCol = -1, i; int nTerm; if( pTab==0 || IN_DECLARE_VTAB ) goto primary_key_exit; #ifdef GD_ENABLE_NEWSQL_SERVER /* for test */ goto primary_key_exit; #endif if( pTab->tabFlags & TF_HasPrimaryKey ){ sqlite3ErrorMsg(pParse, "table \"%s\" has more than one primary key", pTab->zName); goto primary_key_exit; } pTab->tabFlags |= TF_HasPrimaryKey; if( pList==0 ){ iCol = pTab->nCol - 1; pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY; zType = pTab->aCol[iCol].zType; nTerm = 1; }else{ nTerm = pList->nExpr; for(i=0; i<nTerm; i++){ for(iCol=0; iCol<pTab->nCol; iCol++){ if( sqlite3StrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ){ pTab->aCol[iCol].colFlags |= COLFLAG_PRIMKEY; zType = pTab->aCol[iCol].zType; break; } } } } if( nTerm==1 && zType && sqlite3StrICmp(zType, "INTEGER")==0 && sortOrder==SQLITE_SO_ASC ){ pTab->iPKey = iCol; pTab->keyConf = (u8)onError; assert( autoInc==0 || autoInc==1 ); pTab->tabFlags |= autoInc*TF_Autoincrement; if( pList ) pParse->iPkSortOrder = pList->a[0].sortOrder; }else if( autoInc ){ #ifndef SQLITE_OMIT_AUTOINCREMENT sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an " "INTEGER PRIMARY KEY"); #endif }else{ Vdbe *v = pParse->pVdbe; Index *p; if( v ) pParse->addrSkipPK = sqlite3VdbeAddOp0(v, OP_Noop); p = sqlite3CreateIndex(pParse, 0, 0, 0, pList, onError, 0, 0, sortOrder, 0); if( p ){ p->idxType = SQLITE_IDXTYPE_PRIMARYKEY; if( v ) sqlite3VdbeJumpHere(v, pParse->addrSkipPK); } pList = 0; } primary_key_exit: sqlite3ExprListDelete(pParse->db, pList); return; } /* ** Add a new CHECK constraint to the table currently under construction. */ void sqlite3AddCheckConstraint( Parse *pParse, /* Parsing context */ Expr *pCheckExpr /* The check expression */ ){ #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; sqlite3 *db = pParse->db; if( pTab && !IN_DECLARE_VTAB && !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt) ){ pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr); if( pParse->constraintName.n ){ sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1); } }else #endif { sqlite3ExprDelete(pParse->db, pCheckExpr); } } /* ** Set the collation function of the most recently parsed table column ** to the CollSeq given. */ void sqlite3AddCollateType(Parse *pParse, Token *pToken){ Table *p; int i; char *zColl; /* Dequoted name of collation sequence */ sqlite3 *db; if( (p = pParse->pNewTable)==0 ) return; i = p->nCol-1; db = pParse->db; zColl = sqlite3NameFromToken(db, pToken); if( !zColl ) return; if( sqlite3LocateCollSeq(pParse, zColl) ){ Index *pIdx; sqlite3DbFree(db, p->aCol[i].zColl); p->aCol[i].zColl = zColl; /* If the column is declared as "<name> PRIMARY KEY COLLATE <type>", ** then an index may have been created on this column before the ** collation type was added. Correct this if it is the case. */ for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ assert( pIdx->nKeyCol==1 ); if( pIdx->aiColumn[0]==i ){ pIdx->azColl[0] = p->aCol[i].zColl; } } }else{ sqlite3DbFree(db, zColl); } } /* ** This function returns the collation sequence for database native text ** encoding identified by the string zName, length nName. ** ** If the requested collation sequence is not available, or not available ** in the database native encoding, the collation factory is invoked to ** request it. If the collation factory does not supply such a sequence, ** and the sequence is available in another text encoding, then that is ** returned instead. ** ** If no versions of the requested collations sequence are available, or ** another error occurs, NULL is returned and an error message written into ** pParse. ** ** This routine is a wrapper around sqlite3FindCollSeq(). This routine ** invokes the collation factory if the named collation cannot be found ** and generates an error message. ** ** See also: sqlite3FindCollSeq(), sqlite3GetCollSeq() */ CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName){ sqlite3 *db = pParse->db; u8 enc = ENC(db); u8 initbusy = db->init.busy; CollSeq *pColl; pColl = sqlite3FindCollSeq(db, enc, zName, initbusy); if( !initbusy && (!pColl || !pColl->xCmp) ){ pColl = sqlite3GetCollSeq(pParse, enc, pColl, zName); } return pColl; } /* ** Generate code that will increment the schema cookie. ** ** The schema cookie is used to determine when the schema for the ** database changes. After each schema change, the cookie value ** changes. When a process first reads the schema it records the ** cookie. Thereafter, whenever it goes to access the database, ** it checks the cookie to make sure the schema has not changed ** since it was last read. ** ** This plan is not completely bullet-proof. It is possible for ** the schema to change multiple times and for the cookie to be ** set back to prior value. But schema changes are infrequent ** and the probability of hitting the same cookie value is only ** 1 chance in 2^32. So we're safe enough. */ void sqlite3ChangeCookie(Parse *pParse, int iDb){ int r1 = sqlite3GetTempReg(pParse); sqlite3 *db = pParse->db; Vdbe *v = pParse->pVdbe; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); sqlite3VdbeAddOp2(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, r1); sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_SCHEMA_VERSION, r1); sqlite3ReleaseTempReg(pParse, r1); } /* ** Measure the number of characters needed to output the given ** identifier. The number returned includes any quotes used ** but does not include the null terminator. ** ** The estimate is conservative. It might be larger that what is ** really needed. */ static int identLength(const char *z){ int n; for(n=0; *z; n++, z++){ if( *z=='"' ){ n++; } } return n + 2; } /* ** The first parameter is a pointer to an output buffer. The second ** parameter is a pointer to an integer that contains the offset at ** which to write into the output buffer. This function copies the ** nul-terminated string pointed to by the third parameter, zSignedIdent, ** to the specified offset in the buffer and updates *pIdx to refer ** to the first byte after the last byte written before returning. ** ** If the string zSignedIdent consists entirely of alpha-numeric ** characters, does not begin with a digit and is not an SQL keyword, ** then it is copied to the output buffer exactly as it is. Otherwise, ** it is quoted using double-quotes. */ static void identPut(char *z, int *pIdx, char *zSignedIdent){ unsigned char *zIdent = (unsigned char*)zSignedIdent; int i, j, needQuote; i = *pIdx; for(j=0; zIdent[j]; j++){ if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; } needQuote = sqlite3Isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID || zIdent[j]!=0 || j==0; if( needQuote ) z[i++] = '"'; for(j=0; zIdent[j]; j++){ z[i++] = zIdent[j]; if( zIdent[j]=='"' ) z[i++] = '"'; } if( needQuote ) z[i++] = '"'; z[i] = 0; *pIdx = i; } /* ** Generate a CREATE TABLE statement appropriate for the given ** table. Memory to hold the text of the statement is obtained ** from sqliteMalloc() and must be freed by the calling function. */ static char *createTableStmt(sqlite3 *db, Table *p){ int i, k, n; char *zStmt; char *zSep, *zSep2, *zEnd; Column *pCol; n = 0; for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){ n += identLength(pCol->zName) + 5; } n += identLength(p->zName); if( n<50 ){ zSep = ""; zSep2 = ","; zEnd = ")"; }else{ zSep = "\n "; zSep2 = ",\n "; zEnd = "\n)"; } n += 35 + 6*p->nCol; zStmt = sqlite3DbMallocRaw(0, n); if( zStmt==0 ){ db->mallocFailed = 1; return 0; } sqlite3_snprintf(n, zStmt, "CREATE TABLE "); k = sqlite3Strlen30(zStmt); identPut(zStmt, &k, p->zName); zStmt[k++] = '('; for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){ static const char * const azType[] = { /* SQLITE_AFF_NONE */ "", /* SQLITE_AFF_TEXT */ " TEXT", /* SQLITE_AFF_NUMERIC */ " NUM", /* SQLITE_AFF_INTEGER */ " INT", /* SQLITE_AFF_REAL */ " REAL" }; int len; const char *zType; sqlite3_snprintf(n-k, &zStmt[k], zSep); k += sqlite3Strlen30(&zStmt[k]); zSep = zSep2; identPut(zStmt, &k, pCol->zName); assert( pCol->affinity-SQLITE_AFF_NONE >= 0 ); assert( pCol->affinity-SQLITE_AFF_NONE < ArraySize(azType) ); testcase( pCol->affinity==SQLITE_AFF_NONE ); testcase( pCol->affinity==SQLITE_AFF_TEXT ); testcase( pCol->affinity==SQLITE_AFF_NUMERIC ); testcase( pCol->affinity==SQLITE_AFF_INTEGER ); testcase( pCol->affinity==SQLITE_AFF_REAL ); zType = azType[pCol->affinity - SQLITE_AFF_NONE]; len = sqlite3Strlen30(zType); assert( pCol->affinity==SQLITE_AFF_NONE || pCol->affinity==sqlite3AffinityType(zType, 0) ); memcpy(&zStmt[k], zType, len); k += len; assert( k<=n ); } sqlite3_snprintf(n-k, &zStmt[k], "%s", zEnd); return zStmt; } /* ** Resize an Index object to hold N columns total. Return SQLITE_OK ** on success and SQLITE_NOMEM on an OOM error. */ static int resizeIndexObject(sqlite3 *db, Index *pIdx, int N){ char *zExtra; int nByte; if( pIdx->nColumn>=N ) return SQLITE_OK; assert( pIdx->isResized==0 ); nByte = (sizeof(char*) + sizeof(i16) + 1)*N; zExtra = sqlite3DbMallocZero(db, nByte); if( zExtra==0 ) return SQLITE_NOMEM; memcpy(zExtra, pIdx->azColl, sizeof(char*)*pIdx->nColumn); pIdx->azColl = (char**)zExtra; zExtra += sizeof(char*)*N; memcpy(zExtra, pIdx->aiColumn, sizeof(i16)*pIdx->nColumn); pIdx->aiColumn = (i16*)zExtra; zExtra += sizeof(i16)*N; memcpy(zExtra, pIdx->aSortOrder, pIdx->nColumn); pIdx->aSortOrder = (u8*)zExtra; pIdx->nColumn = N; pIdx->isResized = 1; return SQLITE_OK; } /* ** Estimate the total row width for a table. */ static void estimateTableWidth(Table *pTab){ unsigned wTable = 0; const Column *pTabCol; int i; for(i=pTab->nCol, pTabCol=pTab->aCol; i>0; i--, pTabCol++){ wTable += pTabCol->szEst; } if( pTab->iPKey<0 ) wTable++; pTab->szTabRow = sqlite3LogEst(wTable*4); } /* ** Estimate the average size of a row for an index. */ static void estimateIndexWidth(Index *pIdx){ unsigned wIndex = 0; int i; const Column *aCol = pIdx->pTable->aCol; for(i=0; i<pIdx->nColumn; i++){ i16 x = pIdx->aiColumn[i]; assert( x<pIdx->pTable->nCol ); wIndex += x<0 ? 1 : aCol[pIdx->aiColumn[i]].szEst; } pIdx->szIdxRow = sqlite3LogEst(wIndex*4); } /* Return true if value x is found any of the first nCol entries of aiCol[] */ static int hasColumn(const i16 *aiCol, int nCol, int x){ while( nCol-- > 0 ) if( x==*(aiCol++) ) return 1; return 0; } /* ** This routine runs at the end of parsing a CREATE TABLE statement that ** has a WITHOUT ROWID clause. The job of this routine is to convert both ** internal schema data structures and the generated VDBE code so that they ** are appropriate for a WITHOUT ROWID table instead of a rowid table. ** Changes include: ** ** (1) Convert the OP_CreateTable into an OP_CreateIndex. There is ** no rowid btree for a WITHOUT ROWID. Instead, the canonical ** data storage is a covering index btree. ** (2) Bypass the creation of the sqlite_master table entry ** for the PRIMARY KEY as the primary key index is now ** identified by the sqlite_master table entry of the table itself. ** (3) Set the Index.tnum of the PRIMARY KEY Index object in the ** schema to the rootpage from the main table. ** (4) Set all columns of the PRIMARY KEY schema object to be NOT NULL. ** (5) Add all table columns to the PRIMARY KEY Index object ** so that the PRIMARY KEY is a covering index. The surplus ** columns are part of KeyInfo.nXField and are not used for ** sorting or lookup or uniqueness checks. ** (6) Replace the rowid tail on all automatically generated UNIQUE ** indices with the PRIMARY KEY columns. */ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ Index *pIdx; Index *pPk; int nPk; int i, j; sqlite3 *db = pParse->db; Vdbe *v = pParse->pVdbe; /* Convert the OP_CreateTable opcode that would normally create the ** root-page for the table into an OP_CreateIndex opcode. The index ** created will become the PRIMARY KEY index. */ if( pParse->addrCrTab ){ assert( v ); sqlite3VdbeGetOp(v, pParse->addrCrTab)->opcode = OP_CreateIndex; } /* Bypass the creation of the PRIMARY KEY btree and the sqlite_master ** table entry. */ if( pParse->addrSkipPK ){ assert( v ); sqlite3VdbeGetOp(v, pParse->addrSkipPK)->opcode = OP_Goto; } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. */ if( pTab->iPKey>=0 ){ ExprList *pList; pList = sqlite3ExprListAppend(pParse, 0, 0); if( pList==0 ) return; pList->a[0].zName = sqlite3DbStrDup(pParse->db, pTab->aCol[pTab->iPKey].zName); pList->a[0].sortOrder = pParse->iPkSortOrder; assert( pParse->pNewTable==pTab ); pPk = sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0); if( pPk==0 ) return; pPk->idxType = SQLITE_IDXTYPE_PRIMARYKEY; pTab->iPKey = -1; }else{ pPk = sqlite3PrimaryKeyIndex(pTab); } pPk->isCovering = 1; assert( pPk!=0 ); nPk = pPk->nKeyCol; /* Make sure every column of the PRIMARY KEY is NOT NULL */ for(i=0; i<nPk; i++){ pTab->aCol[pPk->aiColumn[i]].notNull = 1; } pPk->uniqNotNull = 1; /* The root page of the PRIMARY KEY is the table root page */ pPk->tnum = pTab->tnum; /* Update the in-memory representation of all UNIQUE indices by converting ** the final rowid column into one or more columns of the PRIMARY KEY. */ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ int n; if( IsPrimaryKeyIndex(pIdx) ) continue; for(i=n=0; i<nPk; i++){ if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ) n++; } if( n==0 ){ /* This index is a superset of the primary key */ pIdx->nColumn = pIdx->nKeyCol; continue; } if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return; for(i=0, j=pIdx->nKeyCol; i<nPk; i++){ if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ){ pIdx->aiColumn[j] = pPk->aiColumn[i]; pIdx->azColl[j] = pPk->azColl[i]; j++; } } assert( pIdx->nColumn>=pIdx->nKeyCol+n ); assert( pIdx->nColumn>=j ); } /* Add all table columns to the PRIMARY KEY index */ if( nPk<pTab->nCol ){ if( resizeIndexObject(db, pPk, pTab->nCol) ) return; for(i=0, j=nPk; i<pTab->nCol; i++){ if( !hasColumn(pPk->aiColumn, j, i) ){ assert( j<pPk->nColumn ); pPk->aiColumn[j] = i; pPk->azColl[j] = "BINARY"; j++; } } assert( pPk->nColumn==j ); assert( pTab->nCol==j ); }else{ pPk->nColumn = pTab->nCol; } } /* ** This routine is called to report the final ")" that terminates ** a CREATE TABLE statement. ** ** The table structure that other action routines have been building ** is added to the internal hash tables, assuming no errors have ** occurred. ** ** An entry for the table is made in the master table on disk, unless ** this is a temporary table or db->init.busy==1. When db->init.busy==1 ** it means we are reading the sqlite_master table because we just ** connected to the database or because the sqlite_master table has ** recently changed, so the entry for this table already exists in ** the sqlite_master table. We do not want to create it again. ** ** If the pSelect argument is not NULL, it means that this routine ** was called to create a table generated from a ** "CREATE TABLE ... AS SELECT ..." statement. The column names of ** the new table will match the result set of the SELECT. */ void sqlite3EndTable( Parse *pParse, /* Parse context */ Token *pCons, /* The ',' token after the last column defn. */ Token *pEnd, /* The ')' before options in the CREATE TABLE */ u8 tabOpts, /* Extra table options. Usually 0. */ Select *pSelect /* Select from a "CREATE ... AS SELECT" */ ){ Table *p; /* The new table */ sqlite3 *db = pParse->db; /* The database connection */ int iDb; /* Database in which the table lives */ Index *pIdx; /* An implied index of the table */ if( (pEnd==0 && pSelect==0) || db->mallocFailed ){ return; } p = pParse->pNewTable; if( p==0 ) return; assert( !db->init.busy || !pSelect ); /* If the db->init.busy is 1 it means we are reading the SQL off the ** "sqlite_master" or "sqlite_temp_master" table on the disk. ** So do not write to the disk again. Extract the root page number ** for the table from the db->init.newTnum field. (The page number ** should have been put there by the sqliteOpenCb routine.) */ if( db->init.busy ){ p->tnum = db->init.newTnum; } /* Special processing for WITHOUT ROWID Tables */ if( tabOpts & TF_WithoutRowid ){ if( (p->tabFlags & TF_Autoincrement) ){ sqlite3ErrorMsg(pParse, "AUTOINCREMENT not allowed on WITHOUT ROWID tables"); return; } if( (p->tabFlags & TF_HasPrimaryKey)==0 ){ sqlite3ErrorMsg(pParse, "PRIMARY KEY missing on table %s", p->zName); }else{ p->tabFlags |= TF_WithoutRowid; convertToWithoutRowidTable(pParse, p); } } iDb = sqlite3SchemaToIndex(db, p->pSchema); #ifndef SQLITE_OMIT_CHECK /* Resolve names in all CHECK constraint expressions. */ if( p->pCheck ){ sqlite3ResolveSelfReference(pParse, p, NC_IsCheck, 0, p->pCheck); } #endif /* !defined(SQLITE_OMIT_CHECK) */ /* Estimate the average row size for the table and for all implied indices */ estimateTableWidth(p); for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ estimateIndexWidth(pIdx); } /* If not initializing, then create a record for the new table ** in the SQLITE_MASTER table of the database. ** ** If this is a TEMPORARY table, write the entry into the auxiliary ** file instead of into the main database file. */ if( !db->init.busy ){ int n; Vdbe *v; char *zType; /* "view" or "table" */ char *zType2; /* "VIEW" or "TABLE" */ char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */ v = sqlite3GetVdbe(pParse); if( NEVER(v==0) ) return; sqlite3VdbeAddOp1(v, OP_Close, 0); /* ** Initialize zType for the new view or table. */ if( p->pSelect==0 ){ /* A regular table */ zType = "table"; zType2 = "TABLE"; #ifndef SQLITE_OMIT_VIEW }else{ /* A view */ zType = "view"; zType2 = "VIEW"; #endif } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the ** new table is in register pParse->regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used ** by the new table. ** ** A shared-cache write-lock is not required to write to the new table, ** as a schema-lock must have already been obtained to create it. Since ** a schema-lock excludes all other database users, the write-lock would ** be redundant. */ if( pSelect ){ SelectDest dest; Table *pSelTab; assert(pParse->nTab==1); sqlite3VdbeAddOp3(v, OP_OpenWrite, 1, pParse->regRoot, iDb); sqlite3VdbeChangeP5(v, OPFLAG_P2ISREG); pParse->nTab = 2; sqlite3SelectDestInit(&dest, SRT_Table, 1); sqlite3Select(pParse, pSelect, &dest); sqlite3VdbeAddOp1(v, OP_Close, 1); if( pParse->nErr==0 ){ pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect); if( pSelTab==0 ) return; assert( p->aCol==0 ); p->nCol = pSelTab->nCol; p->aCol = pSelTab->aCol; pSelTab->nCol = 0; pSelTab->aCol = 0; sqlite3DeleteTable(db, pSelTab); } } /* Compute the complete text of the CREATE statement */ if( pSelect ){ zStmt = createTableStmt(db, p); }else{ Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; n = (int)(pEnd2->z - pParse->sNameToken.z); if( pEnd2->z[0]!=';' ) n += pEnd2->n; zStmt = sqlite3MPrintf(db, "CREATE %s %.*s", zType2, n, pParse->sNameToken.z ); } /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all ** the information we've collected. */ sqlite3NestedParse(pParse, "UPDATE %Q.%s " "SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q " "WHERE rowid=#%d", db->aDb[iDb].zName, SCHEMA_TABLE(iDb), zType, p->zName, p->zName, pParse->regRoot, zStmt, pParse->regRowid ); sqlite3DbFree(db, zStmt); sqlite3ChangeCookie(pParse, iDb); #ifndef SQLITE_OMIT_AUTOINCREMENT /* Check to see if we need to create an sqlite_sequence table for ** keeping track of autoincrement keys. */ if( p->tabFlags & TF_Autoincrement ){ Db *pDb = &db->aDb[iDb]; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( pDb->pSchema->pSeqTab==0 ){ sqlite3NestedParse(pParse, "CREATE TABLE %Q.sqlite_sequence(name,seq)", pDb->zName ); } } #endif /* Reparse everything to update our internal data structures */ sqlite3VdbeAddParseSchemaOp(v, iDb, sqlite3MPrintf(db, "tbl_name='%q' AND type!='trigger'", p->zName)); } /* Add the table to the in-memory representation of the database. */ if( db->init.busy ){ Table *pOld; Schema *pSchema = p->pSchema; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } pParse->pNewTable = 0; db->flags |= SQLITE_InternChanges; #ifndef SQLITE_OMIT_ALTERTABLE if( !p->pSelect ){ const char *zName = (const char *)pParse->sNameToken.z; int nName; assert( !pSelect && pCons && pEnd ); if( pCons->z==0 ){ pCons = pEnd; } nName = (int)((const char *)pCons->z - zName); p->addColOffset = 13 + sqlite3Utf8CharLen(zName, nName); } #endif } } #ifndef SQLITE_OMIT_VIEW /* ** The parser calls this routine in order to create a new VIEW */ void sqlite3CreateView( Parse *pParse, /* The parsing context */ Token *pBegin, /* The CREATE token that begins the statement */ Token *pName1, /* The token that holds the name of the view */ Token *pName2, /* The token that holds the name of the view */ Select *pSelect, /* A SELECT statement that will become the new view */ int isTemp, /* TRUE for a TEMPORARY view */ int noErr /* Suppress error messages if VIEW already exists */ ){ Table *p; int n; const char *z; Token sEnd; DbFixer sFix; Token *pName = 0; int iDb; sqlite3 *db = pParse->db; if( pParse->nVar>0 ){ sqlite3ErrorMsg(pParse, "parameters are not allowed in views"); sqlite3SelectDelete(db, pSelect); return; } sqlite3StartTable(pParse, pName1, pName2, isTemp, 1, 0, noErr); p = pParse->pNewTable; if( p==0 || pParse->nErr ){ sqlite3SelectDelete(db, pSelect); return; } sqlite3TwoPartName(pParse, pName1, pName2, &pName); iDb = sqlite3SchemaToIndex(db, p->pSchema); sqlite3FixInit(&sFix, pParse, iDb, "view", pName); if( sqlite3FixSelect(&sFix, pSelect) ){ sqlite3SelectDelete(db, pSelect); return; } /* Make a copy of the entire SELECT statement that defines the view. ** This will force all the Expr.token.z values to be dynamically ** allocated rather than point to the input string - which means that ** they will persist after the current sqlite3_exec() call returns. */ p->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE); sqlite3SelectDelete(db, pSelect); if( db->mallocFailed ){ return; } if( !db->init.busy ){ sqlite3ViewGetColumnNames(pParse, p); } /* Locate the end of the CREATE VIEW statement. Make sEnd point to ** the end. */ sEnd = pParse->sLastToken; if( ALWAYS(sEnd.z[0]!=0) && sEnd.z[0]!=';' ){ sEnd.z += sEnd.n; } sEnd.n = 0; n = (int)(sEnd.z - pBegin->z); z = pBegin->z; while( ALWAYS(n>0) && sqlite3Isspace(z[n-1]) ){ n--; } sEnd.z = &z[n-1]; sEnd.n = 1; /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ sqlite3EndTable(pParse, 0, &sEnd, 0, 0); return; } #endif /* SQLITE_OMIT_VIEW */ #if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) /* ** The Table structure pTable is really a VIEW. Fill in the names of ** the columns of the view in the pTable structure. Return the number ** of errors. If an error is seen leave an error message in pParse->zErrMsg. */ int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){ Table *pSelTab; /* A fake table from which we get the result set */ Select *pSel; /* Copy of the SELECT that implements the view */ int nErr = 0; /* Number of errors encountered */ int n; /* Temporarily holds the number of cursors assigned */ sqlite3 *db = pParse->db; /* Database connection for malloc errors */ sqlite3_xauth xAuth; /* Saved xAuth pointer */ assert( pTable ); #ifndef SQLITE_OMIT_VIRTUALTABLE if( sqlite3VtabCallConnect(pParse, pTable) ){ return SQLITE_ERROR; } if( IsVirtual(pTable) ) return 0; #endif #ifndef SQLITE_OMIT_VIEW /* A positive nCol means the columns names for this view are ** already known. */ if( pTable->nCol>0 ) return 0; /* A negative nCol is a special marker meaning that we are currently ** trying to compute the column names. If we enter this routine with ** a negative nCol, it means two or more views form a loop, like this: ** ** CREATE VIEW one AS SELECT * FROM two; ** CREATE VIEW two AS SELECT * FROM one; ** ** Actually, the error above is now caught prior to reaching this point. ** But the following test is still important as it does come up ** in the following: ** ** CREATE TABLE main.ex1(a); ** CREATE TEMP VIEW ex1 AS SELECT a FROM ex1; ** SELECT * FROM temp.ex1; */ if( pTable->nCol<0 ){ sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName); return 1; } assert( pTable->nCol>=0 ); /* If we get this far, it means we need to compute the table names. ** Note that the call to sqlite3ResultSetOfSelect() will expand any ** "*" elements in the results set of the view and will assign cursors ** to the elements of the FROM clause. But we do not want these changes ** to be permanent. So the computation is done on a copy of the SELECT ** statement that defines the view. */ assert( pTable->pSelect ); pSel = sqlite3SelectDup(db, pTable->pSelect, 0); if( pSel ){ u8 enableLookaside = db->lookaside.bEnabled; n = pParse->nTab; sqlite3SrcListAssignCursors(pParse, pSel->pSrc); pTable->nCol = -1; db->lookaside.bEnabled = 0; #ifndef SQLITE_OMIT_AUTHORIZATION xAuth = db->xAuth; db->xAuth = 0; pSelTab = sqlite3ResultSetOfSelect(pParse, pSel); db->xAuth = xAuth; #else pSelTab = sqlite3ResultSetOfSelect(pParse, pSel); #endif db->lookaside.bEnabled = enableLookaside; pParse->nTab = n; if( pSelTab ){ assert( pTable->aCol==0 ); pTable->nCol = pSelTab->nCol; pTable->aCol = pSelTab->aCol; pSelTab->nCol = 0; pSelTab->aCol = 0; sqlite3DeleteTable(db, pSelTab); assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) ); pTable->pSchema->schemaFlags |= DB_UnresetViews; }else{ pTable->nCol = 0; nErr++; } sqlite3SelectDelete(db, pSel); } else { nErr++; } #endif /* SQLITE_OMIT_VIEW */ return nErr; } #endif /* !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) */ #ifndef SQLITE_OMIT_VIEW /* ** Clear the column names from every VIEW in database idx. */ static void sqliteViewResetAll(sqlite3 *db, int idx){ HashElem *i; assert( sqlite3SchemaMutexHeld(db, idx, 0) ); if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){ Table *pTab = sqliteHashData(i); if( pTab->pSelect ){ sqliteDeleteColumnNames(db, pTab); pTab->aCol = 0; pTab->nCol = 0; } } DbClearProperty(db, idx, DB_UnresetViews); } #else # define sqliteViewResetAll(A,B) #endif /* SQLITE_OMIT_VIEW */ /* ** This function is called by the VDBE to adjust the internal schema ** used by SQLite when the btree layer moves a table root page. The ** root-page of a table or index in database iDb has changed from iFrom ** to iTo. ** ** Ticket #1728: The symbol table might still contain information ** on tables and/or indices that are the process of being deleted. ** If you are unlucky, one of those deleted indices or tables might ** have the same rootpage number as the real table or index that is ** being moved. So we cannot stop searching after the first match ** because the first match might be for one of the deleted indices ** or tables and not the table/index that is actually being moved. ** We must continue looping until all tables and indices with ** rootpage==iFrom have been converted to have a rootpage of iTo ** in order to be certain that we got the right one. */ #ifndef SQLITE_OMIT_AUTOVACUUM void sqlite3RootPageMoved(sqlite3 *db, int iDb, int iFrom, int iTo){ HashElem *pElem; Hash *pHash; Db *pDb; assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); pDb = &db->aDb[iDb]; pHash = &pDb->pSchema->tblHash; for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ Table *pTab = sqliteHashData(pElem); if( pTab->tnum==iFrom ){ pTab->tnum = iTo; } } pHash = &pDb->pSchema->idxHash; for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ Index *pIdx = sqliteHashData(pElem); if( pIdx->tnum==iFrom ){ pIdx->tnum = iTo; } } } #endif /* ** Write code to erase the table with root-page iTable from database iDb. ** Also write code to modify the sqlite_master table and internal schema ** if a root-page of another table is moved by the btree-layer whilst ** erasing iTable (this can happen with an auto-vacuum database). */ static void destroyRootPage(Parse *pParse, int iTable, int iDb){ Vdbe *v = sqlite3GetVdbe(pParse); int r1 = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_Destroy, iTable, r1, iDb); sqlite3MayAbort(pParse); #ifndef SQLITE_OMIT_AUTOVACUUM /* OP_Destroy stores an in integer r1. If this integer ** is non-zero, then it is the root page number of a table moved to ** location iTable. The following code modifies the sqlite_master table to ** reflect this. ** ** The "#NNN" in the SQL is a special constant that means whatever value ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ sqlite3NestedParse(pParse, "UPDATE %Q.%s SET rootpage=%d WHERE #%d AND rootpage=#%d", pParse->db->aDb[iDb].zName, SCHEMA_TABLE(iDb), iTable, r1, r1); #endif sqlite3ReleaseTempReg(pParse, r1); } /* ** Write VDBE code to erase table pTab and all associated indices on disk. ** Code to update the sqlite_master tables and internal schema definitions ** in case a root-page belonging to another table is moved by the btree layer ** is also added (this can happen with an auto-vacuum database). */ static void destroyTable(Parse *pParse, Table *pTab){ #ifdef SQLITE_OMIT_AUTOVACUUM Index *pIdx; int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); destroyRootPage(pParse, pTab->tnum, iDb); for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ destroyRootPage(pParse, pIdx->tnum, iDb); } #else /* If the database may be auto-vacuum capable (if SQLITE_OMIT_AUTOVACUUM ** is not defined), then it is important to call OP_Destroy on the ** table and index root-pages in order, starting with the numerically ** largest root-page number. This guarantees that none of the root-pages ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the ** following were coded: ** ** OP_Destroy 4 0 ** ... ** OP_Destroy 5 0 ** ** and root page 5 happened to be the largest root-page number in the ** database, then root page 5 would be moved to page 4 by the ** "OP_Destroy 4 0" opcode. The subsequent "OP_Destroy 5 0" would hit ** a free-list page. */ int iTab = pTab->tnum; int iDestroyed = 0; while( 1 ){ Index *pIdx; int iLargest = 0; if( iDestroyed==0 || iTab<iDestroyed ){ iLargest = iTab; } for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ int iIdx = pIdx->tnum; assert( pIdx->pSchema==pTab->pSchema ); if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){ iLargest = iIdx; } } if( iLargest==0 ){ return; }else{ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); assert( iDb>=0 && iDb<pParse->db->nDb ); destroyRootPage(pParse, iLargest, iDb); iDestroyed = iLargest; } } #endif } /* ** Remove entries from the sqlite_statN tables (for N in (1,2,3)) ** after a DROP INDEX or DROP TABLE command. */ static void sqlite3ClearStatTables( Parse *pParse, /* The parsing context */ int iDb, /* The database number */ const char *zType, /* "idx" or "tbl" */ const char *zName /* Name of index or table */ ){ int i; const char *zDbName = pParse->db->aDb[iDb].zName; for(i=1; i<=4; i++){ char zTab[24]; sqlite3_snprintf(sizeof(zTab),zTab,"sqlite_stat%d",i); if( sqlite3FindTable(pParse->db, zTab, zDbName) ){ sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE %s=%Q", zDbName, zTab, zType, zName ); } } } /* ** Generate code to drop a table. */ void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, int isView){ Vdbe *v; sqlite3 *db = pParse->db; Trigger *pTrigger; Db *pDb = &db->aDb[iDb]; v = sqlite3GetVdbe(pParse); assert( v!=0 ); sqlite3BeginWriteOperation(pParse, 1, iDb); #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTab) ){ sqlite3VdbeAddOp0(v, OP_VBegin); } #endif /* Drop all triggers associated with the table being dropped. Code ** is generated to remove entries from sqlite_master and/or ** sqlite_temp_master if required. */ pTrigger = sqlite3TriggerList(pParse, pTab); while( pTrigger ){ assert( pTrigger->pSchema==pTab->pSchema || pTrigger->pSchema==db->aDb[1].pSchema ); sqlite3DropTriggerPtr(pParse, pTrigger); pTrigger = pTrigger->pNext; } #ifndef SQLITE_OMIT_AUTOINCREMENT /* Remove any entries of the sqlite_sequence table associated with ** the table being dropped. This is done before the table is dropped ** at the btree level, in case the sqlite_sequence table needs to ** move as a result of the drop (can happen in auto-vacuum mode). */ if( pTab->tabFlags & TF_Autoincrement ){ sqlite3NestedParse(pParse, "DELETE FROM %Q.sqlite_sequence WHERE name=%Q", pDb->zName, pTab->zName ); } #endif /* Drop all SQLITE_MASTER table and index entries that refer to the ** table. The program name loops through the master table and deletes ** every row that refers to a table of the same name as the one being ** dropped. Triggers are handled separately because a trigger can be ** created in the temp database that refers to a table in another ** database. */ sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE tbl_name=%Q and type!='trigger'", pDb->zName, SCHEMA_TABLE(iDb), pTab->zName); if( !isView && !IsVirtual(pTab) ){ destroyTable(pParse, pTab); } /* Remove the table entry from SQLite's internal schema and modify ** the schema cookie. */ if( IsVirtual(pTab) ){ sqlite3VdbeAddOp4(v, OP_VDestroy, iDb, 0, 0, pTab->zName, 0); } sqlite3VdbeAddOp4(v, OP_DropTable, iDb, 0, 0, pTab->zName, 0); sqlite3ChangeCookie(pParse, iDb); sqliteViewResetAll(db, iDb); } /* ** This routine is called to do the work of a DROP TABLE statement. ** pName is the name of the table to be dropped. */ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){ Table *pTab; Vdbe *v; sqlite3 *db = pParse->db; int iDb; if( db->mallocFailed ){ goto exit_drop_table; } assert( pParse->nErr==0 ); assert( pName->nSrc==1 ); if( noErr ) db->suppressErr++; pTab = sqlite3LocateTableItem(pParse, isView, &pName->a[0]); if( noErr ) db->suppressErr--; if( pTab==0 ){ if( noErr ) sqlite3CodeVerifyNamedSchema(pParse, pName->a[0].zDatabase); goto exit_drop_table; } iDb = sqlite3SchemaToIndex(db, pTab->pSchema); assert( iDb>=0 && iDb<db->nDb ); /* If pTab is a virtual table, call ViewGetColumnNames() to ensure ** it is initialized. */ if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){ goto exit_drop_table; } #ifndef SQLITE_OMIT_AUTHORIZATION { int code; const char *zTab = SCHEMA_TABLE(iDb); const char *zDb = db->aDb[iDb].zName; const char *zArg2 = 0; if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ goto exit_drop_table; } if( isView ){ if( !OMIT_TEMPDB && iDb==1 ){ code = SQLITE_DROP_TEMP_VIEW; }else{ code = SQLITE_DROP_VIEW; } #ifndef SQLITE_OMIT_VIRTUALTABLE }else if( IsVirtual(pTab) ){ code = SQLITE_DROP_VTABLE; zArg2 = sqlite3GetVTable(db, pTab)->pMod->zName; #endif }else{ if( !OMIT_TEMPDB && iDb==1 ){ code = SQLITE_DROP_TEMP_TABLE; }else{ code = SQLITE_DROP_TABLE; } } if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){ goto exit_drop_table; } if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ goto exit_drop_table; } } #endif if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName); goto exit_drop_table; } #ifndef SQLITE_OMIT_VIEW /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if( isView && pTab->pSelect==0 ){ sqlite3ErrorMsg(pParse, "use DROP TABLE to delete table %s", pTab->zName); goto exit_drop_table; } if( !isView && pTab->pSelect ){ sqlite3ErrorMsg(pParse, "use DROP VIEW to delete view %s", pTab->zName); goto exit_drop_table; } #endif /* Generate code to remove the table from the master table ** on disk. */ v = sqlite3GetVdbe(pParse); if( v ){ sqlite3BeginWriteOperation(pParse, 1, iDb); sqlite3ClearStatTables(pParse, iDb, "tbl", pTab->zName); sqlite3FkDropTable(pParse, pName, pTab); sqlite3CodeDropTable(pParse, pTab, iDb, isView); } exit_drop_table: sqlite3SrcListDelete(db, pName); } /* ** This routine is called to create a new foreign key on the table ** currently under construction. pFromCol determines which columns ** in the current table point to the foreign key. If pFromCol==0 then ** connect the key to the last column inserted. pTo is the name of ** the table referred to (a.k.a the "parent" table). pToCol is a list ** of tables in the parent pTo table. flags contains all ** information about the conflict resolution algorithms specified ** in the ON DELETE, ON UPDATE and ON INSERT clauses. ** ** An FKey structure is created and added to the table currently ** under construction in the pParse->pNewTable field. ** ** The foreign key is set for IMMEDIATE processing. A subsequent call ** to sqlite3DeferForeignKey() might change this to DEFERRED. */ void sqlite3CreateForeignKey( Parse *pParse, /* Parsing context */ ExprList *pFromCol, /* Columns in this table that point to other table */ Token *pTo, /* Name of the other table */ ExprList *pToCol, /* Columns in the other table */ int flags /* Conflict resolution algorithms. */ ){ sqlite3 *db = pParse->db; #ifndef SQLITE_OMIT_FOREIGN_KEY FKey *pFKey = 0; FKey *pNextTo; Table *p = pParse->pNewTable; int nByte; int i; int nCol; char *z; assert( pTo!=0 ); if( p==0 || IN_DECLARE_VTAB ) goto fk_end; if( pFromCol==0 ){ int iCol = p->nCol-1; if( NEVER(iCol<0) ) goto fk_end; if( pToCol && pToCol->nExpr!=1 ){ sqlite3ErrorMsg(pParse, "foreign key on %s" " should reference only one column of table %T", p->aCol[iCol].zName, pTo); goto fk_end; } nCol = 1; }else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ sqlite3ErrorMsg(pParse, "number of columns in foreign key does not match the number of " "columns in the referenced table"); goto fk_end; }else{ nCol = pFromCol->nExpr; } nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1; if( pToCol ){ for(i=0; i<pToCol->nExpr; i++){ nByte += sqlite3Strlen30(pToCol->a[i].zName) + 1; } } pFKey = sqlite3DbMallocZero(db, nByte ); if( pFKey==0 ){ goto fk_end; } pFKey->pFrom = p; pFKey->pNextFrom = p->pFKey; z = (char*)&pFKey->aCol[nCol]; pFKey->zTo = z; memcpy(z, pTo->z, pTo->n); z[pTo->n] = 0; sqlite3Dequote(z); z += pTo->n+1; pFKey->nCol = nCol; if( pFromCol==0 ){ pFKey->aCol[0].iFrom = p->nCol-1; }else{ for(i=0; i<nCol; i++){ int j; for(j=0; j<p->nCol; j++){ if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ pFKey->aCol[i].iFrom = j; break; } } if( j>=p->nCol ){ sqlite3ErrorMsg(pParse, "unknown column \"%s\" in foreign key definition", pFromCol->a[i].zName); goto fk_end; } } } if( pToCol ){ for(i=0; i<nCol; i++){ int n = sqlite3Strlen30(pToCol->a[i].zName); pFKey->aCol[i].zCol = z; memcpy(z, pToCol->a[i].zName, n); z[n] = 0; z += n+1; } } pFKey->isDeferred = 0; pFKey->aAction[0] = (u8)(flags & 0xff); /* ON DELETE action */ pFKey->aAction[1] = (u8)((flags >> 8 ) & 0xff); /* ON UPDATE action */ assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) ); pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash, pFKey->zTo, (void *)pFKey ); if( pNextTo==pFKey ){ db->mallocFailed = 1; goto fk_end; } if( pNextTo ){ assert( pNextTo->pPrevTo==0 ); pFKey->pNextTo = pNextTo; pNextTo->pPrevTo = pFKey; } /* Link the foreign key to the table as the last step. */ p->pFKey = pFKey; pFKey = 0; fk_end: sqlite3DbFree(db, pFKey); #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ sqlite3ExprListDelete(db, pFromCol); sqlite3ExprListDelete(db, pToCol); } /* ** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED ** clause is seen as part of a foreign key definition. The isDeferred ** parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. ** The behavior of the most recently created foreign key is adjusted ** accordingly. */ void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){ #ifndef SQLITE_OMIT_FOREIGN_KEY Table *pTab; FKey *pFKey; if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; assert( isDeferred==0 || isDeferred==1 ); /* EV: R-30323-21917 */ pFKey->isDeferred = (u8)isDeferred; #endif } /* ** Generate code that will erase and refill index *pIdx. This is ** used to initialize a newly created index or to recompute the ** content of an index in response to a REINDEX command. ** ** if memRootPage is not negative, it means that the index is newly ** created. The register specified by memRootPage contains the ** root page number of the index. If memRootPage is negative, then ** the index already exists and must be cleared before being refilled and ** the root page number of the index is taken from pIndex->tnum. */ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ Table *pTab = pIndex->pTable; /* The table that is indexed */ int iTab = pParse->nTab++; /* Btree cursor used for pTab */ int iIdx = pParse->nTab++; /* Btree cursor used for pIndex */ int iSorter; /* Cursor opened by OpenSorter (if in use) */ int addr1; /* Address of top of loop */ int addr2; /* Address to jump to for next iteration */ int tnum; /* Root page of index */ int iPartIdxLabel; /* Jump to this label to skip a row */ Vdbe *v; /* Generate code into this virtual machine */ KeyInfo *pKey; /* KeyInfo for index */ int regRecord; /* Register holding assembled index record */ sqlite3 *db = pParse->db; /* The database connection */ int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema); #ifndef SQLITE_OMIT_AUTHORIZATION if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0, db->aDb[iDb].zName ) ){ return; } #endif /* Require a write-lock on the table to perform this operation */ sqlite3TableLock(pParse, iDb, pTab->tnum, 1, pTab->zName); v = sqlite3GetVdbe(pParse); if( v==0 ) return; if( memRootPage>=0 ){ tnum = memRootPage; }else{ tnum = pIndex->tnum; } pKey = sqlite3KeyInfoOfIndex(pParse, pIndex); /* Open the sorter cursor if we are to use one. */ iSorter = pParse->nTab++; sqlite3VdbeAddOp4(v, OP_SorterOpen, iSorter, 0, pIndex->nKeyCol, (char*) sqlite3KeyInfoRef(pKey), P4_KEYINFO); /* Open the table. Loop through all rows of the table, inserting index ** records into the sorter. */ sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead); addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0); VdbeCoverage(v); regRecord = sqlite3GetTempReg(pParse); sqlite3GenerateIndexKey(pParse,pIndex,iTab,regRecord,0,&iPartIdxLabel,0,0); sqlite3VdbeAddOp2(v, OP_SorterInsert, iSorter, regRecord); sqlite3ResolvePartIdxLabel(pParse, iPartIdxLabel); sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addr1); if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb); sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb, (char *)pKey, P4_KEYINFO); sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0)); addr1 = sqlite3VdbeAddOp2(v, OP_SorterSort, iSorter, 0); VdbeCoverage(v); assert( pKey!=0 || db->mallocFailed || pParse->nErr ); if( IsUniqueIndex(pIndex) && pKey!=0 ){ int j2 = sqlite3VdbeCurrentAddr(v) + 3; sqlite3VdbeAddOp2(v, OP_Goto, 0, j2); addr2 = sqlite3VdbeCurrentAddr(v); sqlite3VdbeAddOp4Int(v, OP_SorterCompare, iSorter, j2, regRecord, pIndex->nKeyCol); VdbeCoverage(v); sqlite3UniqueConstraint(pParse, OE_Abort, pIndex); }else{ addr2 = sqlite3VdbeCurrentAddr(v); } sqlite3VdbeAddOp3(v, OP_SorterData, iSorter, regRecord, iIdx); sqlite3VdbeAddOp3(v, OP_IdxInsert, iIdx, regRecord, 1); sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3VdbeAddOp2(v, OP_SorterNext, iSorter, addr2); VdbeCoverage(v); sqlite3VdbeJumpHere(v, addr1); sqlite3VdbeAddOp1(v, OP_Close, iTab); sqlite3VdbeAddOp1(v, OP_Close, iIdx); sqlite3VdbeAddOp1(v, OP_Close, iSorter); } /* ** Allocate heap space to hold an Index object with nCol columns. ** ** Increase the allocation size to provide an extra nExtra bytes ** of 8-byte aligned space after the Index object and return a ** pointer to this extra space in *ppExtra. */ Index *sqlite3AllocateIndexObject( sqlite3 *db, /* Database connection */ i16 nCol, /* Total number of columns in the index */ int nExtra, /* Number of bytes of extra space to alloc */ char **ppExtra /* Pointer to the "extra" space */ ){ Index *p; /* Allocated index object */ int nByte; /* Bytes of space for Index object + arrays */ nByte = ROUND8(sizeof(Index)) + /* Index structure */ ROUND8(sizeof(char*)*nCol) + /* Index.azColl */ ROUND8(sizeof(LogEst)*(nCol+1) + /* Index.aiRowLogEst */ sizeof(i16)*nCol + /* Index.aiColumn */ sizeof(u8)*nCol); /* Index.aSortOrder */ p = sqlite3DbMallocZero(db, nByte + nExtra); if( p ){ char *pExtra = ((char*)p)+ROUND8(sizeof(Index)); p->azColl = (char**)pExtra; pExtra += ROUND8(sizeof(char*)*nCol); p->aiRowLogEst = (LogEst*)pExtra; pExtra += sizeof(LogEst)*(nCol+1); p->aiColumn = (i16*)pExtra; pExtra += sizeof(i16)*nCol; p->aSortOrder = (u8*)pExtra; p->nColumn = nCol; p->nKeyCol = nCol - 1; *ppExtra = ((char*)p) + nByte; } return p; } /* ** Create a new index for an SQL table. pName1.pName2 is the name of the index ** and pTblList is the name of the table that is to be indexed. Both will ** be NULL for a primary key or an index that is created to satisfy a ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable ** as the table to be indexed. pParse->pNewTable is a table that is ** currently being constructed by a CREATE TABLE statement. ** ** pList is a list of columns to be indexed. pList will be NULL if this ** is a primary key or unique-constraint on the most recent column added ** to the table currently under construction. ** ** If the index is created successfully, return a pointer to the new Index ** structure. This is used by sqlite3AddPrimaryKey() to mark the index ** as the tables primary key (Index.idxType==SQLITE_IDXTYPE_PRIMARYKEY) */ Index *sqlite3CreateIndex( Parse *pParse, /* All information about this parse */ Token *pName1, /* First part of index name. May be NULL */ Token *pName2, /* Second part of index name. May be NULL */ SrcList *pTblName, /* Table to index. Use pParse->pNewTable if 0 */ ExprList *pList, /* A list of columns to be indexed */ int onError, /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ Token *pStart, /* The CREATE token that begins this statement */ Expr *pPIWhere, /* WHERE clause for partial indices */ int sortOrder, /* Sort order of primary key when pList==NULL */ int ifNotExist /* Omit error if index already exists */ ){ Index *pRet = 0; /* Pointer to return */ Table *pTab = 0; /* Table to be indexed */ Index *pIndex = 0; /* The index to be created */ char *zName = 0; /* Name of the index */ int nName; /* Number of characters in zName */ int i, j; DbFixer sFix; /* For assigning database names to pTable */ int sortOrderMask; /* 1 to honor DESC in index. 0 to ignore. */ sqlite3 *db = pParse->db; Db *pDb; /* The specific table containing the indexed database */ int iDb; /* Index of the database that is being written */ Token *pName = 0; /* Unqualified name of the index to create */ struct ExprList_item *pListItem; /* For looping over pList */ const Column *pTabCol; /* A column in the table */ int nExtra = 0; /* Space allocated for zExtra[] */ int nExtraCol; /* Number of extra columns needed */ char *zExtra = 0; /* Extra space after the Index object */ Index *pPk = 0; /* PRIMARY KEY index for WITHOUT ROWID tables */ assert( pParse->nErr==0 ); /* Never called with prior errors */ if( db->mallocFailed || IN_DECLARE_VTAB ){ goto exit_create_index; } if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ goto exit_create_index; } /* ** Find the table that is to be indexed. Return early if not found. */ if( pTblName!=0 ){ /* Use the two-part index name to determine the database ** to search for the table. 'Fix' the table name to this db ** before looking up the table. */ assert( pName1 && pName2 ); iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pName); if( iDb<0 ) goto exit_create_index; assert( pName && pName->z ); #ifndef SQLITE_OMIT_TEMPDB /* If the index name was unqualified, check if the table ** is a temp table. If so, set the database to 1. Do not do this ** if initialising a database schema. */ if( !db->init.busy ){ pTab = sqlite3SrcListLookup(pParse, pTblName); if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){ iDb = 1; } } #endif sqlite3FixInit(&sFix, pParse, iDb, "index", pName); if( sqlite3FixSrcList(&sFix, pTblName) ){ /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ assert(0); } pTab = sqlite3LocateTableItem(pParse, 0, &pTblName->a[0]); assert( db->mallocFailed==0 || pTab==0 ); if( pTab==0 ) goto exit_create_index; if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ sqlite3ErrorMsg(pParse, "cannot create a TEMP index on non-TEMP table \"%s\"", pTab->zName); goto exit_create_index; } if( !HasRowid(pTab) ) pPk = sqlite3PrimaryKeyIndex(pTab); }else{ assert( pName==0 ); assert( pStart==0 ); pTab = pParse->pNewTable; if( !pTab ) goto exit_create_index; iDb = sqlite3SchemaToIndex(db, pTab->pSchema); } pDb = &db->aDb[iDb]; assert( pTab!=0 ); assert( pParse->nErr==0 ); if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 && db->init.busy==0 #if SQLITE_USER_AUTHENTICATION && sqlite3UserAuthTable(pTab->zName)==0 #endif && sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 ){ sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName); goto exit_create_index; } #ifndef SQLITE_OMIT_VIEW if( pTab->pSelect ){ sqlite3ErrorMsg(pParse, "views may not be indexed"); goto exit_create_index; } #endif #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTab) ){ sqlite3ErrorMsg(pParse, "virtual tables may not be indexed"); goto exit_create_index; } #endif /* ** Find the name of the index. Make sure there is not already another ** index or table with the same name. ** ** Exception: If we are reading the names of permanent indices from the ** sqlite_master table (because some other process changed the schema) and ** one of the index names collides with the name of a temporary table or ** index, then we will continue to process this index. ** ** If pName==0 it means that we are ** dealing with a primary key or UNIQUE constraint. We have to invent our ** own name. */ if( pName ){ zName = sqlite3NameFromToken(db, pName); if( zName==0 ) goto exit_create_index; assert( pName->z!=0 ); if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto exit_create_index; } if( !db->init.busy ){ if( sqlite3FindTable(db, zName, 0)!=0 ){ sqlite3ErrorMsg(pParse, "there is already a table named %s", zName); goto exit_create_index; } } if( sqlite3FindIndex(db, zName, pDb->zName)!=0 ){ if( !ifNotExist ){ sqlite3ErrorMsg(pParse, "index %s already exists", zName); }else{ assert( !db->init.busy ); sqlite3CodeVerifySchema(pParse, iDb); } goto exit_create_index; } }else{ int n; Index *pLoop; for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n); if( zName==0 ){ goto exit_create_index; } } /* Check for authorization to create an index. */ #ifndef SQLITE_OMIT_AUTHORIZATION { const char *zDb = pDb->zName; if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ goto exit_create_index; } i = SQLITE_CREATE_INDEX; if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX; if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){ goto exit_create_index; } } #endif /* If pList==0, it means this routine was called to make a primary ** key out of the last column added to the table under construction. ** So create a fake list to simulate this. */ if( pList==0 ){ pList = sqlite3ExprListAppend(pParse, 0, 0); if( pList==0 ) goto exit_create_index; pList->a[0].zName = sqlite3DbStrDup(pParse->db, pTab->aCol[pTab->nCol-1].zName); pList->a[0].sortOrder = (u8)sortOrder; } /* Figure out how many bytes of space are required to store explicitly ** specified collation sequence names. */ for(i=0; i<pList->nExpr; i++){ Expr *pExpr = pList->a[i].pExpr; if( pExpr ){ assert( pExpr->op==TK_COLLATE ); nExtra += (1 + sqlite3Strlen30(pExpr->u.zToken)); } } /* ** Allocate the index structure. */ nName = sqlite3Strlen30(zName); nExtraCol = pPk ? pPk->nKeyCol : 1; pIndex = sqlite3AllocateIndexObject(db, pList->nExpr + nExtraCol, nName + nExtra + 1, &zExtra); if( db->mallocFailed ){ goto exit_create_index; } assert( EIGHT_BYTE_ALIGNMENT(pIndex->aiRowLogEst) ); assert( EIGHT_BYTE_ALIGNMENT(pIndex->azColl) ); pIndex->zName = zExtra; zExtra += nName + 1; memcpy(pIndex->zName, zName, nName+1); pIndex->pTable = pTab; pIndex->onError = (u8)onError; pIndex->uniqNotNull = onError!=OE_None; pIndex->idxType = pName ? SQLITE_IDXTYPE_APPDEF : SQLITE_IDXTYPE_UNIQUE; pIndex->pSchema = db->aDb[iDb].pSchema; pIndex->nKeyCol = pList->nExpr; if( pPIWhere ){ sqlite3ResolveSelfReference(pParse, pTab, NC_PartIdx, pPIWhere, 0); pIndex->pPartIdxWhere = pPIWhere; pPIWhere = 0; } assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); /* Check to see if we should honor DESC requests on index columns */ if( pDb->pSchema->file_format>=4 ){ sortOrderMask = -1; /* Honor DESC */ }else{ sortOrderMask = 0; /* Ignore DESC */ } /* Scan the names of the columns of the table to be indexed and ** load the column indices into the Index structure. Report an error ** if any column is not found. ** ** TODO: Add a test to make sure that the same column is not named ** more than once within the same index. Only the first instance of ** the column will ever be used by the optimizer. Note that using the ** same column more than once cannot be an error because that would ** break backwards compatibility - it needs to be a warning. */ for(i=0, pListItem=pList->a; i<pList->nExpr; i++, pListItem++){ const char *zColName = pListItem->zName; int requestedSortOrder; char *zColl; /* Collation sequence name */ for(j=0, pTabCol=pTab->aCol; j<pTab->nCol; j++, pTabCol++){ if( sqlite3StrICmp(zColName, pTabCol->zName)==0 ) break; } if( j>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "table %s has no column named %s", pTab->zName, zColName); pParse->checkSchema = 1; goto exit_create_index; } assert( j<=0x7fff ); pIndex->aiColumn[i] = (i16)j; if( pListItem->pExpr ){ int nColl; assert( pListItem->pExpr->op==TK_COLLATE ); zColl = pListItem->pExpr->u.zToken; nColl = sqlite3Strlen30(zColl) + 1; assert( nExtra>=nColl ); memcpy(zExtra, zColl, nColl); zColl = zExtra; zExtra += nColl; nExtra -= nColl; }else{ zColl = pTab->aCol[j].zColl; if( !zColl ) zColl = "BINARY"; } if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ goto exit_create_index; } pIndex->azColl[i] = zColl; requestedSortOrder = pListItem->sortOrder & sortOrderMask; pIndex->aSortOrder[i] = (u8)requestedSortOrder; if( pTab->aCol[j].notNull==0 ) pIndex->uniqNotNull = 0; } if( pPk ){ for(j=0; j<pPk->nKeyCol; j++){ int x = pPk->aiColumn[j]; if( hasColumn(pIndex->aiColumn, pIndex->nKeyCol, x) ){ pIndex->nColumn--; }else{ pIndex->aiColumn[i] = x; pIndex->azColl[i] = pPk->azColl[j]; pIndex->aSortOrder[i] = pPk->aSortOrder[j]; i++; } } assert( i==pIndex->nColumn ); }else{ pIndex->aiColumn[i] = -1; pIndex->azColl[i] = "BINARY"; } sqlite3DefaultRowEst(pIndex); if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex); if( pTab==pParse->pNewTable ){ /* This routine has been called to create an automatic index as a ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or ** a PRIMARY KEY or UNIQUE clause following the column definitions. ** i.e. one of: ** ** CREATE TABLE t(x PRIMARY KEY, y); ** CREATE TABLE t(x, y, UNIQUE(x, y)); ** ** Either way, check to see if the table already has such an index. If ** so, don't bother creating this one. This only applies to ** automatically created indices. Users can do as they wish with ** explicit indices. ** ** Two UNIQUE or PRIMARY KEY constraints are considered equivalent ** (and thus suppressing the second one) even if they have different ** sort orders. ** ** If there are different collating sequences or if the columns of ** the constraint occur in different orders, then the constraints are ** considered distinct and both result in separate indices. */ Index *pIdx; for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ int k; assert( IsUniqueIndex(pIdx) ); assert( pIdx->idxType!=SQLITE_IDXTYPE_APPDEF ); assert( IsUniqueIndex(pIndex) ); if( pIdx->nKeyCol!=pIndex->nKeyCol ) continue; for(k=0; k<pIdx->nKeyCol; k++){ const char *z1; const char *z2; if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break; z1 = pIdx->azColl[k]; z2 = pIndex->azColl[k]; if( z1!=z2 && sqlite3StrICmp(z1, z2) ) break; } if( k==pIdx->nKeyCol ){ if( pIdx->onError!=pIndex->onError ){ /* This constraint creates the same index as a previous ** constraint specified somewhere in the CREATE TABLE statement. ** However the ON CONFLICT clauses are different. If both this ** constraint and the previous equivalent constraint have explicit ** ON CONFLICT clauses this is an error. Otherwise, use the ** explicitly specified behavior for the index. */ if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ sqlite3ErrorMsg(pParse, "conflicting ON CONFLICT clauses specified", 0); } if( pIdx->onError==OE_Default ){ pIdx->onError = pIndex->onError; } } goto exit_create_index; } } } /* Link the new Index structure to its table and to the other ** in-memory database structures. */ if( db->init.busy ){ Index *p; assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) ); p = sqlite3HashInsert(&pIndex->pSchema->idxHash, pIndex->zName, pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ db->mallocFailed = 1; goto exit_create_index; } db->flags |= SQLITE_InternChanges; if( pTblName!=0 ){ pIndex->tnum = db->init.newTnum; } } /* If this is the initial CREATE INDEX statement (or CREATE TABLE if the ** index is an implied index for a UNIQUE or PRIMARY KEY constraint) then ** emit code to allocate the index rootpage on disk and make an entry for ** the index in the sqlite_master table and populate the index with ** content. But, do not do this if we are simply reading the sqlite_master ** table to parse the schema, or if this index is the PRIMARY KEY index ** of a WITHOUT ROWID table. ** ** If pTblName==0 it means this index is generated as an implied PRIMARY KEY ** or UNIQUE index in a CREATE TABLE statement. Since the table ** has just been created, it contains no data and the index initialization ** step can be skipped. */ else if( pParse->nErr==0 && (HasRowid(pTab) || pTblName!=0) ){ Vdbe *v; char *zStmt; int iMem = ++pParse->nMem; v = sqlite3GetVdbe(pParse); if( v==0 ) goto exit_create_index; /* Create the rootpage for the index */ sqlite3BeginWriteOperation(pParse, 1, iDb); sqlite3VdbeAddOp2(v, OP_CreateIndex, iDb, iMem); /* Gather the complete text of the CREATE INDEX statement into ** the zStmt variable */ if( pStart ){ int n = (int)(pParse->sLastToken.z - pName->z) + pParse->sLastToken.n; if( pName->z[n-1]==';' ) n--; /* A named index with an explicit CREATE INDEX statement */ zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s", onError==OE_None ? "" : " UNIQUE", n, pName->z); }else{ /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ zStmt = 0; } /* Add an entry in sqlite_master for this index */ sqlite3NestedParse(pParse, "INSERT INTO %Q.%s VALUES('index',%Q,%Q,#%d,%Q);", db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName, pTab->zName, iMem, zStmt ); sqlite3DbFree(db, zStmt); /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. */ if( pTblName ){ sqlite3RefillIndex(pParse, pIndex, iMem); sqlite3ChangeCookie(pParse, iDb); sqlite3VdbeAddParseSchemaOp(v, iDb, sqlite3MPrintf(db, "name='%q' AND type='index'", pIndex->zName)); sqlite3VdbeAddOp1(v, OP_Expire, 0); } } /* When adding an index to the list of indices for a table, make ** sure all indices labeled OE_Replace come after all those labeled ** OE_Ignore. This is necessary for the correct constraint check ** processing (in sqlite3GenerateConstraintChecks()) as part of ** UPDATE and INSERT statements. */ if( db->init.busy || pTblName==0 ){ if( onError!=OE_Replace || pTab->pIndex==0 || pTab->pIndex->onError==OE_Replace){ pIndex->pNext = pTab->pIndex; pTab->pIndex = pIndex; }else{ Index *pOther = pTab->pIndex; while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ pOther = pOther->pNext; } pIndex->pNext = pOther->pNext; pOther->pNext = pIndex; } pRet = pIndex; pIndex = 0; } /* Clean up before exiting */ exit_create_index: if( pIndex ) freeIndex(db, pIndex); sqlite3ExprDelete(db, pPIWhere); sqlite3ExprListDelete(db, pList); sqlite3SrcListDelete(db, pTblName); sqlite3DbFree(db, zName); return pRet; } /* ** Fill the Index.aiRowEst[] array with default information - information ** to be used when we have not run the ANALYZE command. ** ** aiRowEst[0] is supposed to contain the number of elements in the index. ** Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the ** number of rows in the table that match any particular value of the ** first column of the index. aiRowEst[2] is an estimate of the number ** of rows that match any particular combination of the first 2 columns ** of the index. And so forth. It must always be the case that * ** aiRowEst[N]<=aiRowEst[N-1] ** aiRowEst[N]>=1 ** ** Apart from that, we have little to go on besides intuition as to ** how aiRowEst[] should be initialized. The numbers generated here ** are based on typical values found in actual indices. */ void sqlite3DefaultRowEst(Index *pIdx){ /* 10, 9, 8, 7, 6 */ LogEst aVal[] = { 33, 32, 30, 28, 26 }; LogEst *a = pIdx->aiRowLogEst; int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol); int i; /* Set the first entry (number of rows in the index) to the estimated ** number of rows in the table. Or 10, if the estimated number of rows ** in the table is less than that. */ a[0] = pIdx->pTable->nRowLogEst; if( a[0]<33 ) a[0] = 33; assert( 33==sqlite3LogEst(10) ); /* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is ** 6 and each subsequent value (if any) is 5. */ memcpy(&a[1], aVal, nCopy*sizeof(LogEst)); for(i=nCopy+1; i<=pIdx->nKeyCol; i++){ a[i] = 23; assert( 23==sqlite3LogEst(5) ); } assert( 0==sqlite3LogEst(1) ); if( IsUniqueIndex(pIdx) ) a[pIdx->nKeyCol] = 0; } /* ** This routine will drop an existing named index. This routine ** implements the DROP INDEX statement. */ void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){ Index *pIndex; Vdbe *v; sqlite3 *db = pParse->db; int iDb; assert( pParse->nErr==0 ); /* Never called with prior errors */ if( db->mallocFailed ){ goto exit_drop_index; } assert( pName->nSrc==1 ); if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ goto exit_drop_index; } pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase); if( pIndex==0 ){ if( !ifExists ){ sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0); }else{ sqlite3CodeVerifyNamedSchema(pParse, pName->a[0].zDatabase); } pParse->checkSchema = 1; goto exit_drop_index; } if( pIndex->idxType!=SQLITE_IDXTYPE_APPDEF ){ sqlite3ErrorMsg(pParse, "index associated with UNIQUE " "or PRIMARY KEY constraint cannot be dropped", 0); goto exit_drop_index; } iDb = sqlite3SchemaToIndex(db, pIndex->pSchema); #ifndef SQLITE_OMIT_AUTHORIZATION { int code = SQLITE_DROP_INDEX; Table *pTab = pIndex->pTable; const char *zDb = db->aDb[iDb].zName; const char *zTab = SCHEMA_TABLE(iDb); if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ goto exit_drop_index; } if( !OMIT_TEMPDB && iDb ) code = SQLITE_DROP_TEMP_INDEX; if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ goto exit_drop_index; } } #endif /* Generate code to remove the index and from the master table */ v = sqlite3GetVdbe(pParse); if( v ){ sqlite3BeginWriteOperation(pParse, 1, iDb); sqlite3NestedParse(pParse, "DELETE FROM %Q.%s WHERE name=%Q AND type='index'", db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName ); sqlite3ClearStatTables(pParse, iDb, "idx", pIndex->zName); sqlite3ChangeCookie(pParse, iDb); destroyRootPage(pParse, pIndex->tnum, iDb); sqlite3VdbeAddOp4(v, OP_DropIndex, iDb, 0, 0, pIndex->zName, 0); } exit_drop_index: sqlite3SrcListDelete(db, pName); } /* ** pArray is a pointer to an array of objects. Each object in the ** array is szEntry bytes in size. This routine uses sqlite3DbRealloc() ** to extend the array so that there is space for a new object at the end. ** ** When this function is called, *pnEntry contains the current size of ** the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes ** in total). ** ** If the realloc() is successful (i.e. if no OOM condition occurs), the ** space allocated for the new object is zeroed, *pnEntry updated to ** reflect the new size of the array and a pointer to the new allocation ** returned. *pIdx is set to the index of the new array entry in this case. ** ** Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains ** unchanged and a copy of pArray returned. */ void *sqlite3ArrayAllocate( sqlite3 *db, /* Connection to notify of malloc failures */ void *pArray, /* Array of objects. Might be reallocated */ int szEntry, /* Size of each object in the array */ int *pnEntry, /* Number of objects currently in use */ int *pIdx /* Write the index of a new slot here */ ){ char *z; int n = *pnEntry; if( (n & (n-1))==0 ){ int sz = (n==0) ? 1 : 2*n; void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry); if( pNew==0 ){ *pIdx = -1; return pArray; } pArray = pNew; } z = (char*)pArray; memset(&z[n * szEntry], 0, szEntry); *pIdx = n; ++*pnEntry; return pArray; } /* ** Append a new element to the given IdList. Create a new IdList if ** need be. ** ** A new IdList is returned, or NULL if malloc() fails. */ IdList *sqlite3IdListAppend(sqlite3 *db, IdList *pList, Token *pToken){ int i; if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(IdList) ); if( pList==0 ) return 0; } pList->a = sqlite3ArrayAllocate( db, pList->a, sizeof(pList->a[0]), &pList->nId, &i ); if( i<0 ){ sqlite3IdListDelete(db, pList); return 0; } pList->a[i].zName = sqlite3NameFromToken(db, pToken); return pList; } /* ** Delete an IdList. */ void sqlite3IdListDelete(sqlite3 *db, IdList *pList){ int i; if( pList==0 ) return; for(i=0; i<pList->nId; i++){ sqlite3DbFree(db, pList->a[i].zName); } sqlite3DbFree(db, pList->a); sqlite3DbFree(db, pList); } /* ** Return the index in pList of the identifier named zId. Return -1 ** if not found. */ int sqlite3IdListIndex(IdList *pList, const char *zName){ int i; if( pList==0 ) return -1; for(i=0; i<pList->nId; i++){ if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i; } return -1; } /* ** Expand the space allocated for the given SrcList object by ** creating nExtra new slots beginning at iStart. iStart is zero based. ** New slots are zeroed. ** ** For example, suppose a SrcList initially contains two entries: A,B. ** To append 3 new entries onto the end, do this: ** ** sqlite3SrcListEnlarge(db, pSrclist, 3, 2); ** ** After the call above it would contain: A, B, nil, nil, nil. ** If the iStart argument had been 1 instead of 2, then the result ** would have been: A, nil, nil, nil, B. To prepend the new slots, ** the iStart value would be 0. The result then would ** be: nil, nil, nil, A, B. ** ** If a memory allocation fails the SrcList is unchanged. The ** db->mallocFailed flag will be set to true. */ SrcList *sqlite3SrcListEnlarge( sqlite3 *db, /* Database connection to notify of OOM errors */ SrcList *pSrc, /* The SrcList to be enlarged */ int nExtra, /* Number of new slots to add to pSrc->a[] */ int iStart /* Index in pSrc->a[] of first new slot */ ){ int i; /* Sanity checking on calling parameters */ assert( iStart>=0 ); assert( nExtra>=1 ); assert( pSrc!=0 ); assert( iStart<=pSrc->nSrc ); /* Allocate additional space if needed */ if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){ SrcList *pNew; int nAlloc = pSrc->nSrc+nExtra; int nGot; pNew = sqlite3DbRealloc(db, pSrc, sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) ); if( pNew==0 ){ assert( db->mallocFailed ); return pSrc; } pSrc = pNew; nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1; pSrc->nAlloc = nGot; } /* Move existing slots that come after the newly inserted slots ** out of the way */ for(i=pSrc->nSrc-1; i>=iStart; i--){ pSrc->a[i+nExtra] = pSrc->a[i]; } pSrc->nSrc += nExtra; /* Zero the newly allocated slots */ memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra); for(i=iStart; i<iStart+nExtra; i++){ pSrc->a[i].iCursor = -1; } /* Return a pointer to the enlarged SrcList */ return pSrc; } /* ** Append a new table name to the given SrcList. Create a new SrcList if ** need be. A new entry is created in the SrcList even if pTable is NULL. ** ** A SrcList is returned, or NULL if there is an OOM error. The returned ** SrcList might be the same as the SrcList that was input or it might be ** a new one. If an OOM error does occurs, then the prior value of pList ** that is input to this routine is automatically freed. ** ** If pDatabase is not null, it means that the table has an optional ** database name prefix. Like this: "database.table". The pDatabase ** points to the table name and the pTable points to the database name. ** The SrcList.a[].zName field is filled with the table name which might ** come from pTable (if pDatabase is NULL) or from pDatabase. ** SrcList.a[].zDatabase is filled with the database name from pTable, ** or with NULL if no database is specified. ** ** In other words, if call like this: ** ** sqlite3SrcListAppend(D,A,B,0); ** ** Then B is a table name and the database name is unspecified. If called ** like this: ** ** sqlite3SrcListAppend(D,A,B,C); ** ** Then C is the table name and B is the database name. If C is defined ** then so is B. In other words, we never have a case where: ** ** sqlite3SrcListAppend(D,A,0,C); ** ** Both pTable and pDatabase are assumed to be quoted. They are dequoted ** before being added to the SrcList. */ SrcList *sqlite3SrcListAppend( sqlite3 *db, /* Connection to notify of malloc failures */ SrcList *pList, /* Append to this SrcList. NULL creates a new SrcList */ Token *pTable, /* Table to append */ Token *pDatabase /* Database of the table */ ){ struct SrcList_item *pItem; assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */ if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(SrcList) ); if( pList==0 ) return 0; pList->nAlloc = 1; } pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc); if( db->mallocFailed ){ sqlite3SrcListDelete(db, pList); return 0; } pItem = &pList->a[pList->nSrc-1]; if( pDatabase && pDatabase->z==0 ){ pDatabase = 0; } if( pDatabase ){ Token *pTemp = pDatabase; pDatabase = pTable; pTable = pTemp; } pItem->zName = sqlite3NameFromToken(db, pTable); pItem->zDatabase = sqlite3NameFromToken(db, pDatabase); return pList; } /* ** Assign VdbeCursor index numbers to all tables in a SrcList */ void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){ int i; struct SrcList_item *pItem; assert(pList || pParse->db->mallocFailed ); if( pList ){ for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){ if( pItem->iCursor>=0 ) break; pItem->iCursor = pParse->nTab++; if( pItem->pSelect ){ sqlite3SrcListAssignCursors(pParse, pItem->pSelect->pSrc); } } } } /* ** Delete an entire SrcList including all its substructure. */ void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){ int i; struct SrcList_item *pItem; if( pList==0 ) return; for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){ sqlite3DbFree(db, pItem->zDatabase); sqlite3DbFree(db, pItem->zName); sqlite3DbFree(db, pItem->zAlias); sqlite3DbFree(db, pItem->zIndex); sqlite3DeleteTable(db, pItem->pTab); sqlite3SelectDelete(db, pItem->pSelect); sqlite3ExprDelete(db, pItem->pOn); sqlite3IdListDelete(db, pItem->pUsing); } sqlite3DbFree(db, pList); } /* ** This routine is called by the parser to add a new term to the ** end of a growing FROM clause. The "p" parameter is the part of ** the FROM clause that has already been constructed. "p" is NULL ** if this is the first term of the FROM clause. pTable and pDatabase ** are the name of the table and database named in the FROM clause term. ** pDatabase is NULL if the database name qualifier is missing - the ** usual case. If the term has an alias, then pAlias points to the ** alias token. If the term is a subquery, then pSubquery is the ** SELECT statement that the subquery encodes. The pTable and ** pDatabase parameters are NULL for subqueries. The pOn and pUsing ** parameters are the content of the ON and USING clauses. ** ** Return a new SrcList which encodes is the FROM with the new ** term added. */ SrcList *sqlite3SrcListAppendFromTerm( Parse *pParse, /* Parsing context */ SrcList *p, /* The left part of the FROM clause already seen */ Token *pTable, /* Name of the table to add to the FROM clause */ Token *pDatabase, /* Name of the database containing pTable */ Token *pAlias, /* The right-hand side of the AS subexpression */ Select *pSubquery, /* A subquery used in place of a table name */ Expr *pOn, /* The ON clause of a join */ IdList *pUsing /* The USING clause of a join */ ){ struct SrcList_item *pItem; sqlite3 *db = pParse->db; if( !p && (pOn || pUsing) ){ sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", (pOn ? "ON" : "USING") ); goto append_from_error; } p = sqlite3SrcListAppend(db, p, pTable, pDatabase); if( p==0 || NEVER(p->nSrc==0) ){ goto append_from_error; } pItem = &p->a[p->nSrc-1]; assert( pAlias!=0 ); if( pAlias->n ){ pItem->zAlias = sqlite3NameFromToken(db, pAlias); } pItem->pSelect = pSubquery; pItem->pOn = pOn; pItem->pUsing = pUsing; return p; append_from_error: assert( p==0 ); sqlite3ExprDelete(db, pOn); sqlite3IdListDelete(db, pUsing); sqlite3SelectDelete(db, pSubquery); return 0; } /* ** Add an INDEXED BY or NOT INDEXED clause to the most recently added ** element of the source-list passed as the second argument. */ void sqlite3SrcListIndexedBy(Parse *pParse, SrcList *p, Token *pIndexedBy){ assert( pIndexedBy!=0 ); if( p && ALWAYS(p->nSrc>0) ){ struct SrcList_item *pItem = &p->a[p->nSrc-1]; assert( pItem->notIndexed==0 && pItem->zIndex==0 ); if( pIndexedBy->n==1 && !pIndexedBy->z ){ /* A "NOT INDEXED" clause was supplied. See parse.y ** construct "indexed_opt" for details. */ pItem->notIndexed = 1; }else{ pItem->zIndex = sqlite3NameFromToken(pParse->db, pIndexedBy); } } } /* ** When building up a FROM clause in the parser, the join operator ** is initially attached to the left operand. But the code generator ** expects the join operator to be on the right operand. This routine ** Shifts all join operators from left to right for an entire FROM ** clause. ** ** Example: Suppose the join is like this: ** ** A natural cross join B ** ** The operator is "natural cross join". The A and B operands are stored ** in p->a[0] and p->a[1], respectively. The parser initially stores the ** operator with A. This routine shifts that operator over to B. */ void sqlite3SrcListShiftJoinType(SrcList *p){ if( p ){ int i; assert( p->a || p->nSrc==0 ); for(i=p->nSrc-1; i>0; i--){ p->a[i].jointype = p->a[i-1].jointype; } p->a[0].jointype = 0; } } /* ** Begin a transaction */ void sqlite3BeginTransaction(Parse *pParse, int type){ sqlite3 *db; Vdbe *v; int i; assert( pParse!=0 ); db = pParse->db; assert( db!=0 ); /* if( db->aDb[0].pBt==0 ) return; */ if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ){ return; } v = sqlite3GetVdbe(pParse); if( !v ) return; if( type!=TK_DEFERRED ){ for(i=0; i<db->nDb; i++){ sqlite3VdbeAddOp2(v, OP_Transaction, i, (type==TK_EXCLUSIVE)+1); sqlite3VdbeUsesBtree(v, i); } } sqlite3VdbeAddOp2(v, OP_AutoCommit, 0, 0); } /* ** Commit a transaction */ void sqlite3CommitTransaction(Parse *pParse){ Vdbe *v; assert( pParse!=0 ); assert( pParse->db!=0 ); if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ){ return; } v = sqlite3GetVdbe(pParse); if( v ){ sqlite3VdbeAddOp2(v, OP_AutoCommit, 1, 0); } } /* ** Rollback a transaction */ void sqlite3RollbackTransaction(Parse *pParse){ Vdbe *v; assert( pParse!=0 ); assert( pParse->db!=0 ); if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ){ return; } v = sqlite3GetVdbe(pParse); if( v ){ sqlite3VdbeAddOp2(v, OP_AutoCommit, 1, 1); } } /* ** This function is called by the parser when it parses a command to create, ** release or rollback an SQL savepoint. */ void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ char *zName = sqlite3NameFromToken(pParse->db, pName); if( zName ){ Vdbe *v = sqlite3GetVdbe(pParse); #ifndef SQLITE_OMIT_AUTHORIZATION static const char * const az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; assert( !SAVEPOINT_BEGIN && SAVEPOINT_RELEASE==1 && SAVEPOINT_ROLLBACK==2 ); #endif if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ sqlite3DbFree(pParse->db, zName); return; } sqlite3VdbeAddOp4(v, OP_Savepoint, op, 0, 0, zName, P4_DYNAMIC); } } /* ** Make sure the TEMP database is open and available for use. Return ** the number of errors. Leave any error messages in the pParse structure. */ int sqlite3OpenTempDatabase(Parse *pParse){ sqlite3 *db = pParse->db; if( db->aDb[1].pBt==0 && !pParse->explain ){ int rc; Btree *pBt; static const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | SQLITE_OPEN_TEMP_DB; rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pBt, 0, flags); if( rc!=SQLITE_OK ){ sqlite3ErrorMsg(pParse, "unable to open a temporary database " "file for storing temporary tables"); pParse->rc = rc; return 1; } db->aDb[1].pBt = pBt; assert( db->aDb[1].pSchema ); if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){ db->mallocFailed = 1; return 1; } } return 0; } /* ** Record the fact that the schema cookie will need to be verified ** for database iDb. The code to actually verify the schema cookie ** will occur at the end of the top-level VDBE and will be generated ** later, by sqlite3FinishCoding(). */ void sqlite3CodeVerifySchema(Parse *pParse, int iDb){ Parse *pToplevel = sqlite3ParseToplevel(pParse); sqlite3 *db = pToplevel->db; assert( iDb>=0 && iDb<db->nDb ); assert( db->aDb[iDb].pBt!=0 || iDb==1 ); assert( iDb<SQLITE_MAX_ATTACHED+2 ); assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){ DbMaskSet(pToplevel->cookieMask, iDb); pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie; if( !OMIT_TEMPDB && iDb==1 ){ sqlite3OpenTempDatabase(pToplevel); } } } /* ** If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each ** attached database. Otherwise, invoke it for the database named zDb only. */ void sqlite3CodeVerifyNamedSchema(Parse *pParse, const char *zDb){ sqlite3 *db = pParse->db; int i; for(i=0; i<db->nDb; i++){ Db *pDb = &db->aDb[i]; if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zName)) ){ sqlite3CodeVerifySchema(pParse, i); } } } /* ** Generate VDBE code that prepares for doing an operation that ** might change the database. ** ** This routine starts a new transaction if we are not already within ** a transaction. If we are already within a transaction, then a checkpoint ** is set if the setStatement parameter is true. A checkpoint should ** be set for operations that might fail (due to a constraint) part of ** the way through and which will need to undo some writes without having to ** rollback the whole transaction. For operations where all constraints ** can be checked before any changes are made to the database, it is never ** necessary to undo a write and the checkpoint should not be set. */ void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){ Parse *pToplevel = sqlite3ParseToplevel(pParse); sqlite3CodeVerifySchema(pParse, iDb); DbMaskSet(pToplevel->writeMask, iDb); pToplevel->isMultiWrite |= setStatement; } /* ** Indicate that the statement currently under construction might write ** more than one entry (example: deleting one row then inserting another, ** inserting multiple rows in a table, or inserting a row and index entries.) ** If an abort occurs after some of these writes have completed, then it will ** be necessary to undo the completed writes. */ void sqlite3MultiWrite(Parse *pParse){ Parse *pToplevel = sqlite3ParseToplevel(pParse); pToplevel->isMultiWrite = 1; } /* ** The code generator calls this routine if is discovers that it is ** possible to abort a statement prior to completion. In order to ** perform this abort without corrupting the database, we need to make ** sure that the statement is protected by a statement transaction. ** ** Technically, we only need to set the mayAbort flag if the ** isMultiWrite flag was previously set. There is a time dependency ** such that the abort must occur after the multiwrite. This makes ** some statements involving the REPLACE conflict resolution algorithm ** go a little faster. But taking advantage of this time dependency ** makes it more difficult to prove that the code is correct (in ** particular, it prevents us from writing an effective ** implementation of sqlite3AssertMayAbort()) and so we have chosen ** to take the safe route and skip the optimization. */ void sqlite3MayAbort(Parse *pParse){ Parse *pToplevel = sqlite3ParseToplevel(pParse); pToplevel->mayAbort = 1; } /* ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT ** error. The onError parameter determines which (if any) of the statement ** and/or current transaction is rolled back. */ void sqlite3HaltConstraint( Parse *pParse, /* Parsing context */ int errCode, /* extended error code */ int onError, /* Constraint type */ char *p4, /* Error message */ i8 p4type, /* P4_STATIC or P4_TRANSIENT */ u8 p5Errmsg /* P5_ErrMsg type */ ){ Vdbe *v = sqlite3GetVdbe(pParse); assert( (errCode&0xff)==SQLITE_CONSTRAINT ); if( onError==OE_Abort ){ sqlite3MayAbort(pParse); } sqlite3VdbeAddOp4(v, OP_Halt, errCode, onError, 0, p4, p4type); if( p5Errmsg ) sqlite3VdbeChangeP5(v, p5Errmsg); } /* ** Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation. */ void sqlite3UniqueConstraint( Parse *pParse, /* Parsing context */ int onError, /* Constraint type */ Index *pIdx /* The index that triggers the constraint */ ){ char *zErr; int j; StrAccum errMsg; Table *pTab = pIdx->pTable; sqlite3StrAccumInit(&errMsg, 0, 0, 200); errMsg.db = pParse->db; for(j=0; j<pIdx->nKeyCol; j++){ char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; if( j ) sqlite3StrAccumAppend(&errMsg, ", ", 2); sqlite3StrAccumAppendAll(&errMsg, pTab->zName); sqlite3StrAccumAppend(&errMsg, ".", 1); sqlite3StrAccumAppendAll(&errMsg, zCol); } zErr = sqlite3StrAccumFinish(&errMsg); sqlite3HaltConstraint(pParse, IsPrimaryKeyIndex(pIdx) ? SQLITE_CONSTRAINT_PRIMARYKEY : SQLITE_CONSTRAINT_UNIQUE, onError, zErr, P4_DYNAMIC, P5_ConstraintUnique); } /* ** Code an OP_Halt due to non-unique rowid. */ void sqlite3RowidConstraint( Parse *pParse, /* Parsing context */ int onError, /* Conflict resolution algorithm */ Table *pTab /* The table with the non-unique rowid */ ){ char *zMsg; int rc; if( pTab->iPKey>=0 ){ zMsg = sqlite3MPrintf(pParse->db, "%s.%s", pTab->zName, pTab->aCol[pTab->iPKey].zName); rc = SQLITE_CONSTRAINT_PRIMARYKEY; }else{ zMsg = sqlite3MPrintf(pParse->db, "%s.rowid", pTab->zName); rc = SQLITE_CONSTRAINT_ROWID; } sqlite3HaltConstraint(pParse, rc, onError, zMsg, P4_DYNAMIC, P5_ConstraintUnique); } /* ** Check to see if pIndex uses the collating sequence pColl. Return ** true if it does and false if it does not. */ #ifndef SQLITE_OMIT_REINDEX static int collationMatch(const char *zColl, Index *pIndex){ int i; assert( zColl!=0 ); for(i=0; i<pIndex->nColumn; i++){ const char *z = pIndex->azColl[i]; assert( z!=0 || pIndex->aiColumn[i]<0 ); if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){ return 1; } } return 0; } #endif /* ** Recompute all indices of pTab that use the collating sequence pColl. ** If pColl==0 then recompute all indices of pTab. */ #ifndef SQLITE_OMIT_REINDEX static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){ Index *pIndex; /* An index associated with pTab */ for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ if( zColl==0 || collationMatch(zColl, pIndex) ){ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3RefillIndex(pParse, pIndex, -1); } } } #endif /* ** Recompute all indices of all tables in all databases where the ** indices use the collating sequence pColl. If pColl==0 then recompute ** all indices everywhere. */ #ifndef SQLITE_OMIT_REINDEX static void reindexDatabases(Parse *pParse, char const *zColl){ Db *pDb; /* A single database */ int iDb; /* The database index number */ sqlite3 *db = pParse->db; /* The database connection */ HashElem *k; /* For looping over tables in pDb */ Table *pTab; /* A table in the database */ assert( sqlite3BtreeHoldsAllMutexes(db) ); /* Needed for schema access */ for(iDb=0, pDb=db->aDb; iDb<db->nDb; iDb++, pDb++){ assert( pDb!=0 ); for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){ pTab = (Table*)sqliteHashData(k); reindexTable(pParse, pTab, zColl); } } } #endif /* ** Generate code for the REINDEX command. ** ** REINDEX -- 1 ** REINDEX <collation> -- 2 ** REINDEX ?<database>.?<tablename> -- 3 ** REINDEX ?<database>.?<indexname> -- 4 ** ** Form 1 causes all indices in all attached databases to be rebuilt. ** Form 2 rebuilds all indices in all databases that use the named ** collating function. Forms 3 and 4 rebuild the named index or all ** indices associated with the named table. */ #ifndef SQLITE_OMIT_REINDEX void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){ CollSeq *pColl; /* Collating sequence to be reindexed, or NULL */ char *z; /* Name of a table or index */ const char *zDb; /* Name of the database */ Table *pTab; /* A table in the database */ Index *pIndex; /* An index associated with pTab */ int iDb; /* The database index number */ sqlite3 *db = pParse->db; /* The database connection */ Token *pObjName; /* Name of the table or index to be reindexed */ /* Read the database schema. If an error occurs, leave an error message ** and code in pParse and return NULL. */ if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ return; } if( pName1==0 ){ reindexDatabases(pParse, 0); return; }else if( NEVER(pName2==0) || pName2->z==0 ){ char *zColl; assert( pName1->z ); zColl = sqlite3NameFromToken(pParse->db, pName1); if( !zColl ) return; pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0); if( pColl ){ reindexDatabases(pParse, zColl); sqlite3DbFree(db, zColl); return; } sqlite3DbFree(db, zColl); } iDb = sqlite3TwoPartName(pParse, pName1, pName2, &pObjName); if( iDb<0 ) return; z = sqlite3NameFromToken(db, pObjName); if( z==0 ) return; zDb = db->aDb[iDb].zName; pTab = sqlite3FindTable(db, z, zDb); if( pTab ){ reindexTable(pParse, pTab, 0); sqlite3DbFree(db, z); return; } pIndex = sqlite3FindIndex(db, z, zDb); sqlite3DbFree(db, z); if( pIndex ){ sqlite3BeginWriteOperation(pParse, 0, iDb); sqlite3RefillIndex(pParse, pIndex, -1); return; } sqlite3ErrorMsg(pParse, "unable to identify the object to be reindexed"); } #endif /* ** Return a KeyInfo structure that is appropriate for the given Index. ** ** The KeyInfo structure for an index is cached in the Index object. ** So there might be multiple references to the returned pointer. The ** caller should not try to modify the KeyInfo object. ** ** The caller should invoke sqlite3KeyInfoUnref() on the returned object ** when it has finished using it. */ KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){ if( pParse->nErr ) return 0; #ifndef SQLITE_OMIT_SHARED_CACHE if( pIdx->pKeyInfo && pIdx->pKeyInfo->db!=pParse->db ){ sqlite3KeyInfoUnref(pIdx->pKeyInfo); pIdx->pKeyInfo = 0; } #endif if( pIdx->pKeyInfo==0 ){ int i; int nCol = pIdx->nColumn; int nKey = pIdx->nKeyCol; KeyInfo *pKey; if( pIdx->uniqNotNull ){ pKey = sqlite3KeyInfoAlloc(pParse->db, nKey, nCol-nKey); }else{ pKey = sqlite3KeyInfoAlloc(pParse->db, nCol, 0); } if( pKey ){ assert( sqlite3KeyInfoIsWriteable(pKey) ); for(i=0; i<nCol; i++){ char *zColl = pIdx->azColl[i]; assert( zColl!=0 ); pKey->aColl[i] = strcmp(zColl,"BINARY")==0 ? 0 : sqlite3LocateCollSeq(pParse, zColl); pKey->aSortOrder[i] = pIdx->aSortOrder[i]; } if( pParse->nErr ){ sqlite3KeyInfoUnref(pKey); }else{ pIdx->pKeyInfo = pKey; } } } return sqlite3KeyInfoRef(pIdx->pKeyInfo); } #ifndef SQLITE_OMIT_CTE /* ** This routine is invoked once per CTE by the parser while parsing a ** WITH clause. */ With *sqlite3WithAdd( Parse *pParse, /* Parsing context */ With *pWith, /* Existing WITH clause, or NULL */ Token *pName, /* Name of the common-table */ ExprList *pArglist, /* Optional column name list for the table */ Select *pQuery /* Query used to initialize the table */ ){ sqlite3 *db = pParse->db; With *pNew; char *zName; /* Check that the CTE name is unique within this WITH clause. If ** not, store an error in the Parse structure. */ zName = sqlite3NameFromToken(pParse->db, pName); if( zName && pWith ){ int i; for(i=0; i<pWith->nCte; i++){ if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){ sqlite3ErrorMsg(pParse, "duplicate WITH table name: %s", zName); } } } if( pWith ){ int nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte); pNew = sqlite3DbRealloc(db, pWith, nByte); }else{ pNew = sqlite3DbMallocZero(db, sizeof(*pWith)); } assert( zName!=0 || pNew==0 ); assert( db->mallocFailed==0 || pNew==0 ); if( pNew==0 ){ sqlite3ExprListDelete(db, pArglist); sqlite3SelectDelete(db, pQuery); sqlite3DbFree(db, zName); pNew = pWith; }else{ pNew->a[pNew->nCte].pSelect = pQuery; pNew->a[pNew->nCte].pCols = pArglist; pNew->a[pNew->nCte].zName = zName; pNew->a[pNew->nCte].zErr = 0; pNew->nCte++; } return pNew; } /* ** Free the contents of the With object passed as the second argument. */ void sqlite3WithDelete(sqlite3 *db, With *pWith){ if( pWith ){ int i; for(i=0; i<pWith->nCte; i++){ struct Cte *pCte = &pWith->a[i]; sqlite3ExprListDelete(db, pCte->pCols); sqlite3SelectDelete(db, pCte->pSelect); sqlite3DbFree(db, pCte->zName); } sqlite3DbFree(db, pWith); } } #endif /* !defined(SQLITE_OMIT_CTE) */ ```
```javascript /** * Module dependencies. */ var assert = require('assert'); var isInNet = require('../isInNet'); describe('isInNet(host, pattern, mask)', function () { var tests = [ ["198.95.249.79", "198.95.249.79", "255.255.255.255", true], ["198.95.249.78", "198.95.249.79", "255.255.255.255", false], ["198.95.1.1", "198.95.0.0", "255.255.0.0", true], ["198.94.1.1", "198.95.0.0", "255.255.0.0", false] ]; tests.forEach(function (test) { var expected = test.pop(); it('should return `' + expected + '` for "' + test.join('", "') + '"', function (done) { isInNet(test[0], test[1], test[2], function (err, res) { if (err) return done(err); assert.equal(expected, res); done(); }); }); }); }); ```
Sasson Khakshouri (born November 23, 1942, in Tabriz, Iran) is an Iranian Jewish businessman and tennis promoter, best known for founding the Kremlin Cup. Early life and family Sasson Khakshouri was born in Tabriz, Iran, third child and first son out of eight children of Aziz and Nanne Khakshouri. The family belonged to the small Jewish community in Tabriz, which was in turn part of the larger Nash Didan community centered in Urmia. Sasson grew up in Tabriz, Rezaiyeh and Tehran. After his parents and younger siblings immigrated to Israel, he stayed to run and liquidate the family business. In 1964 Sasson married his second cousin Gollar, daughter of the renowned businessman Youssef Khakshouri, and moved to Hamburg. The couple has three children - Isaac, Nani and Allon. They have lived in Hamburg, Zurich and New York, before settling in Israel in 1996. During his years in Europe, Sasson Khakshouri has served in different roles in Jewish organizations such as Maccabi. and Keren HaYesod. Eastern Bloc Business The Khakshouri family had business with Russia already in Iran. Upon his immigration to Hamburg, Sasson joined his father in law's business, and took on the trade with the Eastern Bloc, mostly carpet trade with Russia. Between 1964 and 1989, he travelled across the iron curtain more than 300 times. His business with the Eastern Bloc continued well after the dissolution of the Soviet Union, and included Turkmenistan, Dagestan, Azerbaijan, Armenia, Georgia and more. Upon the advice of his wife Gollar, he continued to conduct business with the Eastern Bloc also as part of his tennis promotion activity. Tennis Promotion Khakshouri has always been keen on sports, playing basketball, organizing swimming classes and for a while heading Maccabi Germany. He became a tennis fan in the late 1970s, and due to his frequent business trips to Moscow, became especially interested in Russian tennis player Andrei Chesnokov. Kremlin Cup Establishing a world-class tennis tournament in Russia was an idea he vigorously promoted for four years without any prior knowledge or experience, and his efforts succeeded after meeting former Russian Tennis Federation member Boris Fomenko, who introduced him to many helpful figures in Russia, among them Alexander Vainshtein, Yegor Yakovlev, Shamil Tarpishchev, President Boris Yeltsin, and Prime Minister Ivan Silaev, who became tournament chairman and facilitated visa issues. Recruiting Gene Scott as tournament director was the winning shot. The tournament received an ATP Tour license, and the first Kremlin Cup took place in November 1990. Prime Minister Silaev said Sasson Khakshouri has "brought the sun in these dark times in our country" The Khakshouri family held the Kremlin Cup ATP Tour license until 1997. Uzbekistan President's Cup and promoting tennis in Uzbekistan Through Alexander Silaev, Ivan Silaev's son, Khakshouri was introduced to the Uzbek businessman Sanjar Kassimov, and through him to the Islam Karimov, the leader of Uzbekistan. Karimov asked Sasson to organize a similar tennis tournament in Uzbekistan, in order to "put it on the map". The first President's Cup took place in 1994 on clay surface, as an ATP Challenger, as conditions in Uzbekistan did not suffice for an ATP Tour license. This tournament, as well as men's challengers, satellite circuits, and Futures tournaments developed by Khakshouri and his team from the Israel Tennis Centers throughout the country, promoted not only tennis in Uzbekistan but also tourism, encouraged the state to upgrade flights, hotels and facilities, and in 1997 the President Cup was upgraded to ATP Tour. After the 2002 tournament, having achieved the goal of putting Uzbekistan on the map, the President's Cup was discontinued, and instead the Tashkent Open was established, without Khakshouri's involvement. Awards and recognition The Kremlin Cup and the President's Cup, won esteemed prizes from the ATP for their high standard of organization on several occasions. In 1996, Sasson had his bust sculpted and presented at the Museum of Olympic Glory in Tashkent, Uzbekistan. References External links Gold in the Dust, Memories of Sasson and Gollar Khakshouri An interview with Sasson Khakshouri in the Israeli Sports Channel (English and Hebrew) 1942 births Living people Iranian businesspeople Iranian Jews
```c++ #include "UEPyAssetUserData.h" #if WITH_EDITOR PyObject *py_ue_asset_import_data(ue_PyUObject * self, PyObject * args) { ue_py_check(self); UStruct *u_struct = (UStruct *)self->ue_object->GetClass(); UClassProperty *u_property = (UClassProperty *)u_struct->FindPropertyByName(TEXT("AssetImportData")); if (!u_property) { return PyErr_Format(PyExc_Exception, "UObject does not have asset import data."); } UAssetImportData *import_data = (UAssetImportData *)u_property->GetPropertyValue_InContainer(self->ue_object); FAssetImportInfo *import_info = &import_data->SourceData; PyObject *ret = PyList_New(import_info->SourceFiles.Num()); for (int i = 0; i < import_info->SourceFiles.Num(); i++) { PyObject *py_source_file = PyDict_New(); PyDict_SetItemString(py_source_file, "absolute_filepath", PyUnicode_FromString(TCHAR_TO_UTF8(*import_data->ResolveImportFilename(import_info->SourceFiles[i].RelativeFilename, NULL)))); PyDict_SetItemString(py_source_file, "relative_filepath", PyUnicode_FromString(TCHAR_TO_UTF8(*import_info->SourceFiles[i].RelativeFilename))); PyDict_SetItemString(py_source_file, "timestamp", PyLong_FromLong(import_info->SourceFiles[i].Timestamp.ToUnixTimestamp())); #if ENGINE_MINOR_VERSION > 19 PyDict_SetItemString(py_source_file, "filehash", PyUnicode_FromString(TCHAR_TO_UTF8(*LexToString(import_info->SourceFiles[i].FileHash)))); #else PyDict_SetItemString(py_source_file, "filehash", PyUnicode_FromString(TCHAR_TO_UTF8(*LexicalConversion::ToString(import_info->SourceFiles[i].FileHash)))); #endif PyList_SetItem(ret, i, py_source_file); } return ret; } PyObject *py_ue_asset_import_data_set_sources(ue_PyUObject * self, PyObject * args) { ue_py_check(self); PyObject *py_files; if (!PyArg_ParseTuple(args, "O:asset_import_data_set_sources", &py_files)) { return nullptr; } TArray<FString> filenames; UStruct *u_struct = (UStruct *)self->ue_object->GetClass(); UClassProperty *u_property = (UClassProperty *)u_struct->FindPropertyByName(TEXT("AssetImportData")); if (!u_property) { return PyErr_Format(PyExc_Exception, "UObject does not have asset import data."); } if (PyUnicodeOrString_Check(py_files)) { filenames.Add(FString(UTF8_TO_TCHAR(UEPyUnicode_AsUTF8(py_files)))); } else { PyObject *py_iter = PyObject_GetIter(py_files); if (!py_iter) { return PyErr_Format(PyExc_Exception, "argument is not a string or an interable of strings"); } while (PyObject *py_item = PyIter_Next(py_iter)) { if (!PyUnicodeOrString_Check(py_item)) { Py_DECREF(py_iter); return PyErr_Format(PyExc_Exception, "argument is not a string or an interable of strings"); } filenames.Add(FString(UTF8_TO_TCHAR(UEPyUnicode_AsUTF8(py_item)))); } Py_DECREF(py_iter); } UAssetImportData *import_data = (UAssetImportData *)u_property->GetPropertyValue_InContainer(self->ue_object); FAssetImportInfo *import_info = &import_data->SourceData; TArray<FAssetImportInfo::FSourceFile> sources; for (FString filename : filenames) { sources.Add(FAssetImportInfo::FSourceFile(filename)); } import_info->SourceFiles = sources; Py_RETURN_NONE; } #endif ```
Pioneer commonly refers to a settler who migrates to previously uninhabited or sparsely inhabited land. In the United States pioneer commonly refers to an American pioneer, a person in American history who migrated westward to settle in what is now the Western and Midwestern United States. Pioneer, The Pioneer, or pioneering may also refer to: Companies and organizations Pioneer Aerospace Corporation Pioneer Chicken, an American fast-food restaurant chain Pioneer Club Las Vegas, a casino in Las Vegas, Nevada, U.S. Pioneer Corporation, a Japanese electronics manufacturer Pioneer Energy, a Canadian gas station chain Pioneer Entertainment, a Japanese anime company Pioneer Hi-Bred, a U.S.-based agriculture company Pioneer Hotel & Gambling Hall, Laughlin, Nevada, U.S. Pioneer Instrument Company, an American aeronautical instrument manufacturer Pioneer movement, a communist youth organization Pioneer Natural Resources, an energy company in Texas, U.S. Pioneer Pictures, a former American film studio Pioneer Surgical Technology, a medical technology company in Michigan, U.S. Pioneer Total Abstinence Association, Irish Catholics who avoid alcohol Pioneers (missions agency), a Christian missions organization Entertainment Visual Arts The Pioneer (1904), painting by Frederick McCubbin, Australia The Pioneer (Visalia, California) (c. 1915), sculpture by Solon H. Borglum, California The Pioneer (Eugene, Oregon) (1919), sculpture by Alexander Phimister Proctor, Oregon The Pioneers (sculpture) (1928), sculpture by Lorado Taft, Illinois Pioneer Monument (disambiguation) for others named "Pioneer Monument" or "Pioneer Memorial" Films The Pioneers (1903 film), an American silent film directed by Wallace McCutcheon, Sr. The Pioneers (1916 film), an Australian silent film directed by Franklyn Barrett The Pioneers (1926 film), an Australian silent film directed by Raymond Longford The Pioneers (1941 film), an American film directed by Albert Herman The Pioneers (1980 film), a Taiwanese film starring Hsu Feng Pioneer (film), a 2013 Norwegian film directed by Erik Skjoldbjærg The Pioneers (2021 film), a Chinese film directed by Xu Zhangxiong Games Pioneer (pinball), a 1976 pinball machine produced by Gottlieb Pioneer (video game), a 2006 space trading and combat simulator Music Bands Pioneer (band), an American Christian music band The Pioneers (band), a Jamaican reggae vocal trio Albums The Pioneers (album) by MC Eiht and Spice 1, 2004 Pioneer (The Maine album), 2011 Pioneer (Pioneer album), self titled album, 2012 Pioneer (The Band Perry album), 2013 Songs "The Pioneers" (song) by Bloc Party, 2005 "Pioneer" by The Band Perry, from Pioneer, 2013 "Pioneer" (song) by Freddie, 2015 "Pioneers", by For King & Country from Burn the Ships, 2018 Literature Pioneer (magazine), a Soviet/Russian monthly magazine Pioneer (newspaper), various English-language newspapers The Pioneer (South Australia), a newspaper The Pioneer (India), an English-language newspaper published in India The Pioneers (novel), by James Fenimore Cooper The Pioneers: The Heroic Story of the Settlers Who Brought the American Ideal West, a 2019 book by David McCullough Military Pioneer (military), a soldier employed for engineering and construction tasks Pioneer Column, an 1890 force of the British South Africa Company AAI RQ-2 Pioneer, a U.S. military unmanned aerial vehicle RSD-10 Pioneer, a Soviet missile Scammell Pioneer Semi-trailer, a British tank recovery and transport vehicle Scottish Aviation Pioneer, a British military aircraft Places Australia Pioneer, Queensland Pioneer, Tasmania Pioneer River, in Queensland Shire of Pioneer, a former local government area United States Pioneer, Arizona Pioneer, California Pioneer, Florida Pioneer, Indiana Pioneer, Iowa Pioneer, Kansas Pioneer, Louisiana Pioneer, Missouri Pioneer, Nevada Pioneer, Ohio Pioneer, Tennessee Pioneer Township, Michigan Pioneer, Michigan Other places Pioneer, Alberta Pioneer, Singapore Rail transport Pioneer (locomotive), built in 1837 Pioneer (train), an Amtrak passenger train Pioneer MRT station, a transit station in Singapore Schools Pioneer High School (Ann Arbor, Michigan), U.S. Pioneer High School (San Jose, California), U.S. Pioneer High School (Whittier, California), U.S. Pioneer Junior College, Singapore Pioneer-Pleasant Vale Schools, (Garfield County, Oklahoma) U.S. Ships HMS Pioneer, several Royal Navy ships, 1800s Pioneer (sidewheeler 1849), one of the first steamboats in California, U.S., 1849 Pioneer (paddle-steamer), New Zealand gunboat, 1863 Pioneer (submarine), built for the American Civil War, 1861 Pioneer (schooner), ship at the South Street Seaport Museum in New York City, U.S., 1885 USS Pioneer, several U.S. Navy ships, 1800s – 1900s USC&GS Pioneer, several U.S. Coast and Geodetic Survey ships, 1900s MV P&O Pioneer, a British hybrid power seagoing ferry, introduced on the Dover–Calais route, 2023 Sports London Greenhouse Pioneers, an English basketball team Pioneer Bowl, a football game Pioneer Football League, a college conference Pioneer League (baseball), a minor league Pioneer Race Course, a former San Francisco horse racing course Sacred Heart Pioneers, the athletic teams of the Sacred Heart University Other Pioneer program, a series of U.S. lunar, solar, and interplanetary unmanned space missions launched from 1958 through 1978 Pioneer species, a species that colonizes an otherwise barren environment Pioneering (Scouting), creating structures with ropes and wood spars Young Pioneers (disambiguation) See also Pioneer Award (disambiguation) Pioneer Club (disambiguation) Pioneer Days (disambiguation) Pioneer League (disambiguation) Pioneer Township (disambiguation) Pionier (disambiguation) Pioner (disambiguation)
The Temple Riders is a Mormon motorcycle club founded in 1987. There are over 750 members in chapters spread out to many states and few countries. See also Bikers for Christ References External links http://www.templeriders.org/ Video: Temple Riders Rough Cut - Vimeo Latter Day Saint organizations Motorcycle clubs in the United States Organizations established in 1987
```c++ //===----- R600Packetizer.cpp - VLIW packetizer ---------------------------===// // // See path_to_url for license information. // //===your_sha256_hash------===// // /// \file /// This pass implements instructions packetization for R600. It unsets isLast /// bit of instructions inside a bundle and substitutes src register with /// PreviousVector when applicable. // //===your_sha256_hash------===// #include "MCTargetDesc/R600MCTargetDesc.h" #include "R600.h" #include "R600Subtarget.h" #include "llvm/CodeGen/DFAPacketizer.h" #include "llvm/CodeGen/MachineDominators.h" #include "llvm/CodeGen/MachineLoopInfo.h" #include "llvm/CodeGen/ScheduleDAG.h" using namespace llvm; #define DEBUG_TYPE "packets" namespace { class R600Packetizer : public MachineFunctionPass { public: static char ID; R600Packetizer() : MachineFunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesCFG(); AU.addRequired<MachineDominatorTree>(); AU.addPreserved<MachineDominatorTree>(); AU.addRequired<MachineLoopInfo>(); AU.addPreserved<MachineLoopInfo>(); MachineFunctionPass::getAnalysisUsage(AU); } StringRef getPassName() const override { return "R600 Packetizer"; } bool runOnMachineFunction(MachineFunction &Fn) override; }; class R600PacketizerList : public VLIWPacketizerList { private: const R600InstrInfo *TII; const R600RegisterInfo &TRI; bool VLIW5; bool ConsideredInstUsesAlreadyWrittenVectorElement; unsigned getSlot(const MachineInstr &MI) const { return TRI.getHWRegChan(MI.getOperand(0).getReg()); } /// \returns register to PV chan mapping for bundle/single instructions that /// immediately precedes I. DenseMap<unsigned, unsigned> getPreviousVector(MachineBasicBlock::iterator I) const { DenseMap<unsigned, unsigned> Result; I--; if (!TII->isALUInstr(I->getOpcode()) && !I->isBundle()) return Result; MachineBasicBlock::instr_iterator BI = I.getInstrIterator(); if (I->isBundle()) BI++; int LastDstChan = -1; do { bool isTrans = false; int BISlot = getSlot(*BI); if (LastDstChan >= BISlot) isTrans = true; LastDstChan = BISlot; if (TII->isPredicated(*BI)) continue; int OperandIdx = TII->getOperandIdx(BI->getOpcode(), R600::OpName::write); if (OperandIdx > -1 && BI->getOperand(OperandIdx).getImm() == 0) continue; int DstIdx = TII->getOperandIdx(BI->getOpcode(), R600::OpName::dst); if (DstIdx == -1) { continue; } Register Dst = BI->getOperand(DstIdx).getReg(); if (isTrans || TII->isTransOnly(*BI)) { Result[Dst] = R600::PS; continue; } if (BI->getOpcode() == R600::DOT4_r600 || BI->getOpcode() == R600::DOT4_eg) { Result[Dst] = R600::PV_X; continue; } if (Dst == R600::OQAP) { continue; } unsigned PVReg = 0; switch (TRI.getHWRegChan(Dst)) { case 0: PVReg = R600::PV_X; break; case 1: PVReg = R600::PV_Y; break; case 2: PVReg = R600::PV_Z; break; case 3: PVReg = R600::PV_W; break; default: llvm_unreachable("Invalid Chan"); } Result[Dst] = PVReg; } while ((++BI)->isBundledWithPred()); return Result; } void substitutePV(MachineInstr &MI, const DenseMap<unsigned, unsigned> &PVs) const { unsigned Ops[] = { R600::OpName::src0, R600::OpName::src1, R600::OpName::src2 }; for (unsigned Op : Ops) { int OperandIdx = TII->getOperandIdx(MI.getOpcode(), Op); if (OperandIdx < 0) continue; Register Src = MI.getOperand(OperandIdx).getReg(); const DenseMap<unsigned, unsigned>::const_iterator It = PVs.find(Src); if (It != PVs.end()) MI.getOperand(OperandIdx).setReg(It->second); } } public: // Ctor. R600PacketizerList(MachineFunction &MF, const R600Subtarget &ST, MachineLoopInfo &MLI) : VLIWPacketizerList(MF, MLI, nullptr), TII(ST.getInstrInfo()), TRI(TII->getRegisterInfo()) { VLIW5 = !ST.hasCaymanISA(); } // initPacketizerState - initialize some internal flags. void initPacketizerState() override { ConsideredInstUsesAlreadyWrittenVectorElement = false; } // ignorePseudoInstruction - Ignore bundling of pseudo instructions. bool ignorePseudoInstruction(const MachineInstr &MI, const MachineBasicBlock *MBB) override { return false; } // isSoloInstruction - return true if instruction MI can not be packetized // with any other instruction, which means that MI itself is a packet. bool isSoloInstruction(const MachineInstr &MI) override { if (TII->isVector(MI)) return true; if (!TII->isALUInstr(MI.getOpcode())) return true; if (MI.getOpcode() == R600::GROUP_BARRIER) return true; // XXX: This can be removed once the packetizer properly handles all the // LDS instruction group restrictions. return TII->isLDSInstr(MI.getOpcode()); } // isLegalToPacketizeTogether - Is it legal to packetize SUI and SUJ // together. bool isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) override { MachineInstr *MII = SUI->getInstr(), *MIJ = SUJ->getInstr(); if (getSlot(*MII) == getSlot(*MIJ)) ConsideredInstUsesAlreadyWrittenVectorElement = true; // Does MII and MIJ share the same pred_sel ? int OpI = TII->getOperandIdx(MII->getOpcode(), R600::OpName::pred_sel), OpJ = TII->getOperandIdx(MIJ->getOpcode(), R600::OpName::pred_sel); Register PredI = (OpI > -1)?MII->getOperand(OpI).getReg() : Register(), PredJ = (OpJ > -1)?MIJ->getOperand(OpJ).getReg() : Register(); if (PredI != PredJ) return false; if (SUJ->isSucc(SUI)) { for (unsigned i = 0, e = SUJ->Succs.size(); i < e; ++i) { const SDep &Dep = SUJ->Succs[i]; if (Dep.getSUnit() != SUI) continue; if (Dep.getKind() == SDep::Anti) continue; if (Dep.getKind() == SDep::Output) if (MII->getOperand(0).getReg() != MIJ->getOperand(0).getReg()) continue; return false; } } bool ARDef = TII->definesAddressRegister(*MII) || TII->definesAddressRegister(*MIJ); bool ARUse = TII->usesAddressRegister(*MII) || TII->usesAddressRegister(*MIJ); return !ARDef || !ARUse; } // isLegalToPruneDependencies - Is it legal to prune dependency between SUI // and SUJ. bool isLegalToPruneDependencies(SUnit *SUI, SUnit *SUJ) override { return false; } void setIsLastBit(MachineInstr *MI, unsigned Bit) const { unsigned LastOp = TII->getOperandIdx(MI->getOpcode(), R600::OpName::last); MI->getOperand(LastOp).setImm(Bit); } bool isBundlableWithCurrentPMI(MachineInstr &MI, const DenseMap<unsigned, unsigned> &PV, std::vector<R600InstrInfo::BankSwizzle> &BS, bool &isTransSlot) { isTransSlot = TII->isTransOnly(MI); assert (!isTransSlot || VLIW5); // Is the dst reg sequence legal ? if (!isTransSlot && !CurrentPacketMIs.empty()) { if (getSlot(MI) <= getSlot(*CurrentPacketMIs.back())) { if (ConsideredInstUsesAlreadyWrittenVectorElement && !TII->isVectorOnly(MI) && VLIW5) { isTransSlot = true; LLVM_DEBUG({ dbgs() << "Considering as Trans Inst :"; MI.dump(); }); } else return false; } } // Are the Constants limitations met ? CurrentPacketMIs.push_back(&MI); if (!TII->fitsConstReadLimitations(CurrentPacketMIs)) { LLVM_DEBUG({ dbgs() << "Couldn't pack :\n"; MI.dump(); dbgs() << "with the following packets :\n"; for (unsigned i = 0, e = CurrentPacketMIs.size() - 1; i < e; i++) { CurrentPacketMIs[i]->dump(); dbgs() << "\n"; } dbgs() << "because of Consts read limitations\n"; }); CurrentPacketMIs.pop_back(); return false; } // Is there a BankSwizzle set that meet Read Port limitations ? if (!TII->fitsReadPortLimitations(CurrentPacketMIs, PV, BS, isTransSlot)) { LLVM_DEBUG({ dbgs() << "Couldn't pack :\n"; MI.dump(); dbgs() << "with the following packets :\n"; for (unsigned i = 0, e = CurrentPacketMIs.size() - 1; i < e; i++) { CurrentPacketMIs[i]->dump(); dbgs() << "\n"; } dbgs() << "because of Read port limitations\n"; }); CurrentPacketMIs.pop_back(); return false; } // We cannot read LDS source registers from the Trans slot. if (isTransSlot && TII->readsLDSSrcReg(MI)) return false; CurrentPacketMIs.pop_back(); return true; } MachineBasicBlock::iterator addToPacket(MachineInstr &MI) override { MachineBasicBlock::iterator FirstInBundle = CurrentPacketMIs.empty() ? &MI : CurrentPacketMIs.front(); const DenseMap<unsigned, unsigned> &PV = getPreviousVector(FirstInBundle); std::vector<R600InstrInfo::BankSwizzle> BS; bool isTransSlot; if (isBundlableWithCurrentPMI(MI, PV, BS, isTransSlot)) { for (unsigned i = 0, e = CurrentPacketMIs.size(); i < e; i++) { MachineInstr *MI = CurrentPacketMIs[i]; unsigned Op = TII->getOperandIdx(MI->getOpcode(), R600::OpName::bank_swizzle); MI->getOperand(Op).setImm(BS[i]); } unsigned Op = TII->getOperandIdx(MI.getOpcode(), R600::OpName::bank_swizzle); MI.getOperand(Op).setImm(BS.back()); if (!CurrentPacketMIs.empty()) setIsLastBit(CurrentPacketMIs.back(), 0); substitutePV(MI, PV); MachineBasicBlock::iterator It = VLIWPacketizerList::addToPacket(MI); if (isTransSlot) { endPacket(std::next(It)->getParent(), std::next(It)); } return It; } endPacket(MI.getParent(), MI); if (TII->isTransOnly(MI)) return MI; return VLIWPacketizerList::addToPacket(MI); } }; bool R600Packetizer::runOnMachineFunction(MachineFunction &Fn) { const R600Subtarget &ST = Fn.getSubtarget<R600Subtarget>(); const R600InstrInfo *TII = ST.getInstrInfo(); MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>(); // Instantiate the packetizer. R600PacketizerList Packetizer(Fn, ST, MLI); // DFA state table should not be empty. assert(Packetizer.getResourceTracker() && "Empty DFA table!"); assert(Packetizer.getResourceTracker()->getInstrItins()); if (Packetizer.getResourceTracker()->getInstrItins()->isEmpty()) return false; // // Loop over all basic blocks and remove KILL pseudo-instructions // These instructions confuse the dependence analysis. Consider: // D0 = ... (Insn 0) // R0 = KILL R0, D0 (Insn 1) // R0 = ... (Insn 2) // Here, Insn 1 will result in the dependence graph not emitting an output // dependence between Insn 0 and Insn 2. This can lead to incorrect // packetization // for (MachineBasicBlock &MBB : Fn) { for (MachineInstr &MI : llvm::make_early_inc_range(MBB)) { if (MI.isKill() || MI.getOpcode() == R600::IMPLICIT_DEF || (MI.getOpcode() == R600::CF_ALU && !MI.getOperand(8).getImm())) MBB.erase(MI); } } // Loop over all of the basic blocks. for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end(); MBB != MBBe; ++MBB) { // Find scheduling regions and schedule / packetize each region. unsigned RemainingCount = MBB->size(); for(MachineBasicBlock::iterator RegionEnd = MBB->end(); RegionEnd != MBB->begin();) { // The next region starts above the previous region. Look backward in the // instruction stream until we find the nearest boundary. MachineBasicBlock::iterator I = RegionEnd; for(;I != MBB->begin(); --I, --RemainingCount) { if (TII->isSchedulingBoundary(*std::prev(I), &*MBB, Fn)) break; } I = MBB->begin(); // Skip empty scheduling regions. if (I == RegionEnd) { RegionEnd = std::prev(RegionEnd); --RemainingCount; continue; } // Skip regions with one instruction. if (I == std::prev(RegionEnd)) { RegionEnd = std::prev(RegionEnd); continue; } Packetizer.PacketizeMIs(&*MBB, &*I, RegionEnd); RegionEnd = I; } } return true; } } // end anonymous namespace INITIALIZE_PASS_BEGIN(R600Packetizer, DEBUG_TYPE, "R600 Packetizer", false, false) INITIALIZE_PASS_END(R600Packetizer, DEBUG_TYPE, "R600 Packetizer", false, false) char R600Packetizer::ID = 0; char &llvm::R600PacketizerID = R600Packetizer::ID; llvm::FunctionPass *llvm::createR600Packetizer() { return new R600Packetizer(); } ```
```go package spec_iterator func ParallelizedIndexRange(length int, parallelTotal int, parallelNode int) (startIndex int, count int) { if length == 0 { return 0, 0 } // We have more nodes than tests. Trivial case. if parallelTotal >= length { if parallelNode > length { return 0, 0 } else { return parallelNode - 1, 1 } } // This is the minimum amount of tests that a node will be required to run minTestsPerNode := length / parallelTotal // This is the maximum amount of tests that a node will be required to run // The algorithm guarantees that this would be equal to at least the minimum amount // and at most one more maxTestsPerNode := minTestsPerNode if length%parallelTotal != 0 { maxTestsPerNode++ } // Number of nodes that will have to run the maximum amount of tests per node numMaxLoadNodes := length % parallelTotal // Number of nodes that precede the current node and will have to run the maximum amount of tests per node var numPrecedingMaxLoadNodes int if parallelNode > numMaxLoadNodes { numPrecedingMaxLoadNodes = numMaxLoadNodes } else { numPrecedingMaxLoadNodes = parallelNode - 1 } // Number of nodes that precede the current node and will have to run the minimum amount of tests per node var numPrecedingMinLoadNodes int if parallelNode <= numMaxLoadNodes { numPrecedingMinLoadNodes = 0 } else { numPrecedingMinLoadNodes = parallelNode - numMaxLoadNodes - 1 } // Evaluate the test start index and number of tests to run startIndex = numPrecedingMaxLoadNodes*maxTestsPerNode + numPrecedingMinLoadNodes*minTestsPerNode if parallelNode > numMaxLoadNodes { count = minTestsPerNode } else { count = maxTestsPerNode } return } ```
```javascript // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --allow-natives-syntax (function ShiftRightWithDeoptUsage() { function g() {} function f() { var tmp = 1264475713; var tmp1 = tmp - (-913041544); g(); return 1 >> tmp1; } %PrepareFunctionForOptimization(f); %OptimizeFunctionOnNextCall(f); assertEquals(0, f()); })(); (function ShiftRightWithCallUsage() { var f = (function() { "use asm" // This is not a valid asm.js, we use the "use asm" here to // trigger Turbofan without deoptimization support. function g(x) { return x; } function f() { var tmp = 1264475713; var tmp1 = tmp - (-913041544); return g(1 >> tmp1, tmp1); } return f; })(); %PrepareFunctionForOptimization(f); %OptimizeFunctionOnNextCall(f); assertEquals(0, f()); })(); ```
The Voice of Ireland is the Irish edition of the international TV franchise The Voice, a reality singing competition created by media tycoon John de Mol. The first series began airing from 8 January 2012 on RTÉ One. The coaches originally were Bressie, Sharon Corr, Kian Egan and Brian Kennedy. Kennedy left after the first series and was replaced by Jamelia. After the second series, Corr quit the show owing to other commitments and was replaced by Dolores O'Riordan. Following series 3, Dolores and Jamelia quit. The coaches for series 4 were Bressie, Una Healy, Kian Egan and Rachel Stevens. The show was hosted by Kathryn Thomas and co-hosted by Eoghan McDermott, who also presented backstage show The Voice After Party in Series 3. The series was part of The Voice franchise and was based on a similar competition format in the Netherlands entitled The Voice of Holland. The show replaced The All Ireland Talent Show. One of the important premises of the show is the quality of the singing talent. Four coaches, themselves popular performing artists, train the talents in their group and occasionally perform with them. Talents are selected in blind auditions, where the coaches cannot see, but only hear the auditioner. The TV show "blind" auditions were held at the Helix, and were broadcast for the first five weeks of the series. The Battle Phase was broadcast over three weeks from the second week of February to the last week of February each year. The winner of the show is offered a recording contract with Universal Music Ireland worth €100,000. The current and final holder of the crown The Voice of Ireland is the series 5 champion, Michael Lawson. On 3 August 2016, it was announced that the show was going to be replaced by an Irish version of Strictly Come Dancing. History The show replaced The All Ireland Talent Show. The Voice of Ireland aired on RTÉ One and was produced by Screentime Shinawil Productions. Auditions The Blind Auditions for Series 1 took place at The Helix, Dublin, between 26 and 31 October 2011 in front of a live audience. The first series began on 8 January 2012 and finished on 29 April 2012. The Blind auditions for Series 2 took place at The Helix, Dublin, between 21 and 25 October 2012 at The Helix. The later seasons followed a very similar schedule. Scheduling and filming The show took place in The Helix in Dublin. The main show aired for 90 minutes. The results show aired for 30 minutes. The show aired on Sunday nights. Filming for the Blind Auditions took place in October each year in Dublin's Helix. Format The series consists of three phases: Blind audition Battle phase Live performance shows Blind audition Four coaches, all famous musicians, choose teams of artists through a blind audition process. Each coach has the length of the artists performance to decide if he or she wants that artist on his or her team (twelve in the first series, more in the second); if two or more coaches want the same artist then the singer gets to choose which coach they want to work with. An addition to the third season was that RTÉ 2fm selected 5 wildcards to audition. Battle phase Each team of singers is mentored and developed by their coach. In the second stage, coaches have two of their team members battle against each other by singing the same song, with the coach choosing which team member will advance to the next stage. For the third series a new feature was added whereby if an act lost their battle, they are not immediately out of the competition. Each coach has one 'Steal' where they get the opportunity to take one losing act and have them join their team for the live shows. They do this by pressing their 'I Want You' button. Live performance shows In the final phase, the remaining contestants compete against each other in live broadcasts. The television audience help to decide who moves on. When one team member remains for each coach, the contestants compete against each other in the finale. Post-The Voice of Ireland The winner of the show is offered a recording contract with Universal Music Ireland worth €100,000. Coaches and hosts Coaches' teams and their artists Key – Winning coach. Winners are in bold, eliminated contestants in small font. Series overview Warning: the following table presents a significant amount of different colors. Reception Series averages Ratings RTÉ described the first ever episode as "a great ratings success" as it pulled in an average of 708,000 viewers and peaked at 1.2 million. It was later reported that the first 5 episodes pulled in an average of 701,000 viewers a week. Audience ratings for the first series, initially promising, had plunged by 50% by the time the live shows were broadcast and were reported to be unfavourable when compared to ratings held by its predecessor The All Ireland Talent Show. The Voice After Party The Voice After Party is a spin-off show, discussing each show afterwards. Music releases by The Voice of Ireland contestants As of July 2016, The Voice of Ireland has had thirteen singles and four albums chart on the top 100 on the Irish Singles and Albums Charts. Singles Albums References 2016 Irish television series endings Irish talent shows Irish television series based on non-Irish television series RTÉ original programming
Tritotrisauropus is an ichnogenus of dinosaur footprint. See also List of dinosaur ichnogenera References Dinosaur trace fossils
William Lansing Gleason (November 18, 1899 – January 13, 1991) was a three-term mayor of Eau Gallie, Florida from 1930 to 1943 and 1950 to 1951. He was the son of William Henry Hunt Gleason, who was also mayor, and Flora Belle Lansing Gleason. His grandfather was William Henry Gleason, the founder of Eau Gallie, Florida, and 2nd Lieutenant Governor of Florida. He was involved in the local community including donating a coquina rock slab that the first school house in Brevard County now sits on at the Florida Institute of Technology. The auditorium on the campus of Florida Institute of Technology is named for him. Gleason Park was named for him. Lansing Island was also named for him. William Lansing Gleason also co-founded Indian Harbour Beach, Florida on June 6, 1955. References External material Melbourne Bicentennial Book. July 4, 1976. Noreda B. McKemy and Elaine Murray Stone. Library of Congress: 76-020298 Florida Tech Visitor's Guide - Page 5 Florida Institute of Technology Press Release October 2, 2005 Indian Harbour Beach City Homepage 1899 births 1991 deaths American city founders People from Indian Harbour Beach, Florida 20th-century American politicians People from Eau Gallie, Florida Lieutenant Governors of Florida
Skoropuskovsky () is an urban locality (an urban-type settlement) in Sergiyevo-Posadsky District of Moscow Oblast, Russia. Population: References Urban-type settlements in Moscow Oblast
Yazılı (also: Yazılıkaya, lit. 'inscribed rock'), Phrygian Yazılıkaya, or Midas Kenti (Midas city) is a neighbourhood of the municipality and district of Alpu, Eskişehir Province, Turkey. Its population is 45 (2022). It is located about 27 km south of Seyitgazi, 66 km south of Eskişehir, and 51 km north of Afyonkarahisar. It is known for its Phrygian archaeological remains and inscription mentioning Midas. The ancient remains consist of a settlement, sometimes Midas City and a number of rock-cut reliefs, of which the most famous is the Midas Monument, formerly identified as the tomb of Midas. There are two other rock-cut reliefs, known as the Unfinished monument and the Hyacinth monuments. The Midas Monument The most prominent feature of the site is the Midas Monument, a high rock-cut facade in the cliff face of the citadel. The relief takes the form of a pedimented temple front with acroteria, and an abstract geometric design which appears to imitate the terra cotta facings of buildings. There is a niche at the bottom center, with walls bearing graffiti that read (Mother, i.e. the goddess Cybele) and it probably held a statue of Cybele. The monument carries a dedication in Old Phrygian by Ates son of Arkias to Midas. The inscription mentions Midas with his titles: , probably meaning "leader of the people" and "ruler". The inscription is: The name Ates, a variant of Attis, is a prominent name in Phrygia, associated with royalty. The fact that the dedication is made to Midas may indicate that he had received posthumous ruler cult. Various indications place the date of the monument's construction in the early to mid seventh century BC, as one of the first in a series of rock cut monuments to be built in western Phrygia. The inscription probably indicates that the monument was erected after the death of Midas in the early seventh century BC. Another inscription, on the right side of the monument includes the letter yodh, which was added to the Phrygian alphabet in the mid-sixth century BC. It shows that the monument was complete before this date, since it was added after the monument was finished. The abstract designs on the facade are stylistically comparable to architectural terracottas of central Anatolia dating from before ca. 600 BC. Excavation history The site was excavated by the French Archaeological Institute immediately before and after the Second World War, and also in the 1990s by the Eskişehir Museum. Notes Bibliography Piotr Bienkowski, Alan Millard, Dictionary of the Ancient Near East, p. 198. Albert Gabriel, "Au sujet du «Monument de Midas»", Comptes rendus de l'académie des inscriptions 94:2:202-208 (1950) C.H.E. Haspels, The Highlands of Phrygia: Sites and Monuments, 1971, . Mark Henderson Munn, The Mother of the Gods, Athens, And the Tyranny of Asia William Mitchell Ramsay, "The Rock Necropoleis of Phrygia", Journal of Hellenic Studies 3, 1882. External links Midas City at Phrygian Monuments. Yazilikaya - Midas Sehri at the TAY Project (Archaeological Settlements of Turkey) Neighbourhoods in Han District Phrygia Archaeological sites in Central Anatolia
Taillecavat () is a commune located in the Gironde department and Nouvelle-Aquitaine region in southwestern France. The name of the commune in occitan is Talhacavat. Geography Taillecavat is located at one hour by car of Bordeaux and Agen. Fifteen minutes are needed to go to the city of Marmande (more than 30,000 people urban area). Taillecavat is neighboring of Lot-et-Garonne department, so it presents the advantage of an opening on both departments and the entertainment they offer. Population See also Communes of the Gironde department References Communes of Gironde
Police Tero Football Club (), formerly known as BEC-Tero Sasana Football Club is a Thai professional football club based in Bangkok. The club finished runners-up in the inaugural AFC Champions League competition in 2003. BEC-Tero Sasana Football Club merged with Police United Football Club in the 2017 season and changed its official name to Police Tero Football Club in the 2018 season. The club has won 2 Thai League 1 title, 1 Kor Royal Cups and 1 Thai League Cup. They were also the finalist in the 2002–03 AFC Champions League campaign. History Establishment of the club The team was established in 1992. It was previously known as Sasana Witthaya School team and was founded by Worawi Makudi. The first football match the team entered was in Division 3 of the football royal cup in 1993. In 1994, the team played in Division 2 of the football royal cup. In 1995, the team played in Division 1 of the football royal cup and in 1996, the team entered the Thai League for the first time. It was during this year, that Mr. Worawi Makudi and Mr. Brian L. Marcar, managing director of BEC-TERO Entertainment Public Co. Ltd., joined hands and renamed the team as Tero Sasana Football Club. The team was placed in 12th position among 18 teams in the Thai League. In 1997, Tero Sasana Football Club also played in the Thai League and this time was placed in fifth place. Later in 1998, BEC World Public Company Limited supported the Tero Sasana Football Club and changed the team's name to BEC Tero Sasana. The team won the third place when they played the Thai League. They were also one of the eight final teams to enter the final round of the Thai FA Cup. In 1999, the team entered the Thai League and again won third place. In the same year, they were among the final teams in the Thai FA Cup. The Thai giant and the final Asian Champions League 2000 was a very eventful year for BEC Tero Sasana FC. The team won its first championship award by winning the Thai League. It also received the championship award for the King's Cup. In 2001, BEC Tero Sasana FC was able to keep its championship and won the Thai Premier League for the second consecutive year. This greatly increased the fan base. In that year, the club participated in POMIS Cup in Maldives. The club's success continued for a few years and culminated with finishing runner-up in the 2002–03 AFC Champions League. The team were put alongside Asian heavyweights Kashima Antlers, Daejeon Citizen, and Shanghai Shenhua in Group A of the 2002–03 AFC Champions League; a group which they would top with 7 points. Bec Tero Sansana then faced Uzbekistan's Pakhtakor in the semi-final and defeated them 3–2 on aggregate, before losing to Al Ain in the two-legged Final, 2–1. Golden Generation In 2012 the club appointed Robert Procureur, former general manager of Muangthong United, to be the new Director of Football and appointed Andrew Ord as the club manager. Them built up a great team by pushing up many young players such as Adisorn Promrak, Peerapat Notchaiya, Tanaboon Kesarat, Chanathip Songkrasin, Narubadin Weerawatnodom, Tristan Do, Chenrop Samphaodi, Jaturong Pimkoon and the fan called "Golden Generation" and the club signed former Japan national team player Daiki Iwamasa that was the important to help the team win the Thai League Cup Trophy in 2014 from Daiki Iwamasa and Georgie Welcome's goals, its first trophy in 12 years. Decline and financial ruin After the club was relegated in 2016 (Saraburi F.C. was out of the Thai league due to money problems so the club was placed in the place of Saraburi), club president Brian L. Marcar sold the team to Inspire Entertainment, the owner of Muangthong United. Robert Procureur quit and star players such as Peerapat Notchaiya, Tanaboon Kesarat, Chanathip Songkrasin and Tristan Do joined various clubs, such as Muangthong United. Merging: BEC Tero Sasana and Police United In 2017 the club were taken over by the Royal Thai Police, who merged them with their own club, Police United. The club name change was not recognized in 2017, so in 2018, the club changed their name to Police Tero Football Club. Return to the Thai League 1 In October 2019, under head coach Rangsan Viwatchaichok, Police Tero were runners-up in the 2019 Thai League 2 and were promoted to the 2020 Thai League 1. Stadium and locations Season by season record P = Played W = Games won D = Games drawn L = Games lost F = Goals for A = Goals against Pts = Points Pos = Final position N/A = No answer TL = Thai League 1 QR1 = First Qualifying Round QR2 = Second Qualifying Round QR3 = Third Qualifying Round QR4 = Fourth Qualifying Round RInt = Intermediate Round R1 = Round 1 R2 = Round 2 R3 = Round 3 R4 = Round 4 R5 = Round 5 R6 = Round 6 GS = Group stage QF = Quarter-finals SF = Semi-finals RU = Runners-up S = Shared W = Winners Continental record Players First team squad (Captain) Out on loan Former players For details on former players, see :Category:BEC Tero Sasana F.C. players. Managerial history Head coaches by years (1996/97-present) Honours Domestic competitions League Thai League 1 Winners: 2000, 2001–02 Runners-up: 2002–03, 2003–04 Thai League 2 Runners-up: 2019 Cups FA Cup Runners-up: 2009 League Cup Winners: 2014 Kor Royal Cup Winners: 2000 Runners-up: 2002, 2004 Queen's Cup Runners-up: 2009 International competitions Asian AFC Champions League Runners-up: 2002–03 Asean ASEAN Club Championship Runners-up: 2003 Friendly Bhutan King's Cup Winners: 2004 References External links Official fanpage on Facebook Football clubs in Thailand Association football clubs established in 1992 P Sport in Bangkok 1992 establishments in Thailand Police association football clubs in Thailand
Alnus nitida, the west Himalayan alder, is a species in the genus Alnus, native to Pakistan, the western Himalayas, and Nepal. It is a tree reaching 20 to 25m, preferring to live along the banks of rivers. It is used locally for timber and firewood, and as a street tree. The bark is used in some places for tanning and dyeing purposes. It grows well in heavy, clay soils and tolerates infertile soils. The leaves are thin, oval to ovate, 3-6 inches long and 2-3 inches wide. Female flowers appear first, followed by male catkinss in September to October, which may be up to 19 cm long. The fruits are woody cones, typically 2.5-3.5 cm long. This tree may be attacked by the apple stem borer (Trirachys holosericeus). In some places, the bark is used as an anti-inflammatory. One study examined its chemical components and concluded it has antioxidant potential. References nitida Flora of Nepal Flora of Pakistan Flora of West Himalaya Plants described in 1847
The 1964 Grote Prijs Jef Scherens was the second edition of the Grote Prijs Jef Scherens cycle race and was held on 30 April 1964. The race started and finished in Leuven. The race was won by Norbert Kerckhove. General classification References 1964 1964 in road cycling 1964 in Belgian sport
Ernest Paul Devinat, (2 January 1890, Mâcon - 1 May 1980, Paris) was a French academic, civil servant and politician. In 1922 Albert Thomas appointed Devinat as head of the International Labour Organization's Employers' Organization Service and they both toured the United States in the winter of 1922/3. They met Edward Filene, a wealthy advocate of scientific management who had founded the Twentieth Century Fund. Filene offered to provide funds for the proposed International Management Institute soon to be established in Geneva. Works Selected works: 1912 Le Mouvement constitutionnel en Prusse de 1840 à 1847, Frédéric-Guillaume IV et les diètes provinciales, Nogent-le-Rotrou:Daupeley-Gouverneur 1923 L'Organisation internationale du travail, Paris: F. Alcan : M. Rivière 1927 L'organisation scientifique du travail en Europe 1927 Les conséquences sociales de la rationalisation économique 1935 La Politique agricole de la France with Henri Garnier 1951 La Politique de l'Union française, Paris: Châteaudun 1952 Formation de l'Europe 1956 Un renouveau franco-vietnamien est-il possible? References 1890 births 1980 deaths
The following were mayors of Salisbury, Wiltshire, England: 14th–16th centuries 1387: John Hethe, MP for Salisbury, 1388 1388, 1391: John Moner, MP for Salisbury, 1397 1395–1397: Richard Spencer, four times MP for Salisbury, 1395–1411 1397: John Moner 1402: Henry Man, six times MP for Salisbury, 1415–1429 1408-9: Walter Shirley 1416–17: Walter Shirley 1418: Robert Poynaunt, MP for Salisbury, 1420 1426-7: John Noble 1431, 1438: Henry Man 1487: Richard Bartholomew, MP for Salisbury, 1497, 1512 and 1515 1491–92: Thomas Coke, six times MP for Salisbury between 1489 and 1515 1507: Richard Bartholomew 1510–11: Thomas Coke 1517: John Abarough, MP for Salisbury, 1515 and 1523 1520–21: Thomas Brodegate, MP for Salisbury, 1515 1528: Robert South, MP for Salisbury, 1536 and 1539 1537–38: Henry Coldston, MP for Salisbury, 1539 1545: Robert Griffith, MP for Salisbury, 1554 1547: Thomas Chaffyn, MP for Salisbury, 1555 1558–59: Robert Eyre, MP for Salisbury, 1558 and 1563 1560–61: John Webbe, MP for Salisbury, 1558 1561–62: William Webbe, MP for Salisbury, 1559 1565: Anthony Weekes, MP for Salisbury, 1563 1577: John Bayley, MP for Salisbury, 1589 1584: Robert Bower, MP for Salisbury, 1593 1592–93: Giles Hutchens, MP for Salisbury, 1593 and 1597 17th century 1600 Mathew Bee 1601 Henry Byle 1602 Jacob Harvylande 1603 William Eaton 1604 Roger Barnes 1605 Thomas Hancocke 1606 Roger Gauntlett, MP for Salisbury 1607 Bartholomew Tookie 1608 Edward Roades 1609 Richard Gauntlett 1610 Bartholomew Tookie, MP for Salisbury 1611 Thomas Raye 1612 Laurence Horne 1613 Alexander Alford 1614 Henry Pearson 1615 Richard Godfrey 1616 Robert Maswell 1617 George Churchhouse 1618 John Wendover 1619 William Goodridge 1620 William Ray 1621 Maurice Green 1622 Thomas Sqibb 1623 Robert Jole 1624 Robert Checkford 1625 Wolstan Coward 1626 John Ivie 1627 James Abbot 1628 John Batt 1629 Thomas Hill 1630 Richard Carter 1631 Henry Byley 1632 Mathew Bee 1633 Nicholas Elliot 1634 John Dove, MP for Salisbury 1635 Maurice Bylerigg 1636 Richard Carter 1637 John Ranger or Banger 1638 Thomas Hancock 1639 William Joyce 1640 Richard Gauntlett 1641 Thomas Lawes 1642 Humphry Ditton 1643 Thomas Hancock 1644 Francis Dove 1645 Humphry Ditton 1646 Edward Edmunds 1647 John Ivie 1648 Richard Banks 1649 Francis Dove 1650 Thomas Keynon 1651 Thomas Ovyatt 1652 Thomas Ray jnr 1653 William Wilson 1654 Wichard Phelps 1655 William Stone 1656 Robert Good 1657 Thomas Cutler 1658 Christopher Batt 1659 Thomas Abbot 1660 Maurice Green 1661 Thomas Gardiner 1662 Thomas Batter 1663 William Wilson 1664 John Joyce 1665 Thomas Williams 1666 Isaac A’Court 1667 William Slanne 1668 William Vyner 1669 Edmund Marke 1670 Ambrose West 1671 Christopher Gardiner 1672 Robert Jones 1673 James Bennett 1674 William Smith 1675 Thomas Keynton 1676 Giles Naish 1677 Oliver Shergold 1678 James Harris 1679 Roger Baskett 1680 John Priaulx 1681 Richard Minefye 1682 Andrew Bauden 1683 William Clements 1684 Thomas Wansborough 1685 Richard Eyre 1685 Christopher Gardiner 1686 Edward Faulkner 1687 George Clement 1688 John Hill 1689 Peter Phelps 1690 Thomas Haskett 1691 John Coleman 1692 Thomas Taylor 1693 John Parsons 1694 John Pain 1695 James Wyatt 1696 Francis Keynton 1697 Richard Long 1698 William Barnes 1699 Richard Hill 18th century 1700 George Flower 1700 William Waterman 1701 Thomas Abbot 1702 Johnathon Newman 1703 James Hayter 1704 Walter Ireland 1705 Henry Long 1706 William Green 1707 Joseph Gifford 1708 William Hillman 1709 John Prater 1710 Thomas Clifton 1711 John King 1712 Richard Marsh 1713 Walter Barry 1714 William Naish 1715 Edward Cornelius 1716 James Blake 1717 Edward Cornelius 1718 James Blake 1719 William Strugnell 1720 Silvester Pope 1721 Richard Spinney 1722 William Batt 1723 James Stone 1724 Johnathon Newman 1725 Henry Bennet 1726 Samuel Case 1727 Thomas Light 1728 Henry Case 1729 John Robbins 1730 George Flower 1731 Thomas Hull 1732 William Ruddel 1733 John Davis 1734 Daniel Floyd 1735 John Biggs 1736 John Hussey 1737 William Smith 1738 John Baker 1739 William Stone 1740 James Case 1741 Richard Samburn 1742 Matthew Pitts 1743 Robert Robbins 1744 John Talk 1745 Thomas Smith 1746 William Forty 1747 Thomas Baker 1748 Samuel Case 1749 John Thorpe 1750 Henry Brown 1751 James Wyatt 1751 John Case 1752 John Wansborough 1753 Nicholas Hicks 1754 Robert Powel 1755 John Maton 1756 Scrope Egerton 1757 John Blake 1758 William Hussey, clothier and MP 1759 Robert Wentworth 1760 Geoffrey Gowen 1761 William Talk 1762 James Bennett 1763 Edward Lambert 1764 Thomas Dennis 1765 John Gowan 1766 Joseph Wiles 1767 John Cooper, MP 1768 James Rothwell 1769 Sydenham Burrough 1770 Henry Penruddocke Wyndham, MP 1771 Robert Cooper 1772 John Tanner 1773 Rawlins Hillman 1774 John Edgar 1775 William Little 1776 John Elderton 1777 Thomas Hussy 1778 Nathaniel Wick 1779 Edward Eastman 1780 Joseph Hinxman 1781 William Stephens 1782 Nathaniel Still 1783 John Wyche 1784 Thomas Long 1785 James Easton 1786 George Maton 1787 Eadward Hinxman 1788 George Yalden Fort 1789 Henry Hinxman 1790 Michael Burrough from 18 Nov 1790 1791 Robert Freemantle 1792 James Goddard 1793 Thomas Brown 1794 Joseph Tanner 1795 William Boucher 1796 Thomas Goddard 1797 Joseph Tanner 1798 Paul Lagas Burnett 1799 Henry Smith 19th century 1800 William French 1801 Edward Stevens 1802 James Sutton 1803 Joseph Everett 1804 William Ghost 1805 John Pern Tinney 1806 Johnathan Fishlake 1807 Hezekiah Wyche 1808 Thomas Wilkie 1809 James Hussy 1810 John Pinkney 1811 Edward Davies 1812 William Bird Brodie 1813 William Andrews 1814 Charles George Brodie 1815 Rev. Christopher Rigby Collins 1816 William Woolfryes 1817 Henry Emley 1818 John Atkinson 1819 Joseph Tanner 1820 Thomas Webb Dyke 1821 Thomas Wynch 1822 George Atkinson 1823 Joseph Tanner 1824 Thomas Webb Dyke 1825 Thomas Wynch 1826 George Atkinson 1827 Joseph Bouverie Hussy Tanner 1828 Thomas Ogdon Stevens 1829 George Sutton 1830 John Pinkney 1831 William Fawcett 1832 John Beere 1833 John Lush Alford 1834–35 John Cother 1835–36 William Smith 1836–37 Charles Finch 1837–38 Alexander Lucas 1838–39 Richard Hetley 1839–40 Thomas Norwood Chubb 1840–41 Robert Mackrell 1841–42 William Blackmore 1842–43 William Corbin Finch MD 1843–44 James Hussey 1844–45 Edward Edmund Peach Kelsey 1845–46 William Brownjohn 1846–47 George Fulford 1847–48 Robert Farrant 1848–49 Robert Farrant 1849–50 Thomas Robert Moore MD 1850–51 George Brown 1851–52 Edward Edmund Peach Kelsey 1852–53 Edward Edmund Peach Kelsey 1853–54 John Lambert 1854–55 Thomas Pain 1855–56 Abraham Jackson 1856–57 Thomas Pain 1857–58 Coard William Squarey 1858–59 Philip Pickney Cother 1859–60 William Woodlands 1860–61 Philip Watson Ottoway 1861–62 Charles Mann Cornwallis Whatman 1862–63 John Style 1863–64 John Waters 1864–65 Richard Henry Rigden 1865–66 Robert Stokes 1866–67 John Alfred Lush MD 1867–68 Stephen Eldridge 1868–69 William Aylward 1869–70 Charles Richard Norton 1870–71 William Fawcett Jnr 1871–72 John Harding Jackson 1873–74 Henry Brown 1874–75 Samuel Ralph Atkins 1875–76 Charles Henry Radcliffe 1876–77 John Keynes 1877–78 Richard Monkhouse Wilson 1878–79 Joseph Williams Lovibond 1879–80 William Hicks 1880–81 Edward Frederick Kelsey 1881–82 William Leach 1882–83 Charles Moody 1883–84 Thomas Stephen Futcher 1884–85 George Fulford 1885–86 William Maxwell Hammick 1886–87 Frederick Griffen 1887–88 Edward Waters 1888–89 Samuel Parker 1889–90 George Nodder 1890–91 Joseph Williams Lovibond 1891–92 William Marlow 1892–93 Arthur Whitehead 1893–94 Charles Haskins 1894–95 Edward Foulger Pye Smith 1895–96 Arthur Russell Malden 1896–97 Arthur Whitehead 1897–98 Howard Harris 1898–99 Edward Alexander 1899–1900 David Stevens 20th century 1900–01 Henry George Gregory 1901–02 John Alfred Folliott 1902–03 Edward John Brittan 1903–04 Charles John Woodrow 1904–05 James Keith Dowden 1905–06 Frank Baker 1906–07 Samuel Grove 1907–08 Robert Michael Hall 1908–09 Tom Perkins 1909–10 Richard Arthur Wilson 1910–11 Frank Shepherd 1911–12 William Pritchard 1912–13 Frederick Sutton 1913–14 James Macklin 1914–15 James Macklin 1915–16 James Macklin 1916–17 James Macklin 1917–18 James Macklin 1918–19 James Macklin 1919–20 Howard Lapham 1920–21 Thomas William Berry 1921–22 Edward Sidney Humby 1922-22 Henry Bywater Medway 1922–23 Francis Herbert Wort 1923–24 Reuben Bracher 1924–25 Robert Bousie 1925–26 James Brothers 1926–27 John Cattrell Hudson 1927–28 Edith Maud Hulse (the first lady mayor) 1928–29 Alfred Salisbury-Jones 1929–30 Harry Medway 1930–31 Alfred Hinxman 1931–32 John Sidney Rambridge 1932–33 Gideon Hancock 1933–34 Edwin James Case 1934–35 Edward Herbert Major 1935–36 Charles Scammel 1936–37 Maurice Rawlence 1937–38 Charles Thomas 1938–39 William Cornelius Bridge 1939–40 William Cornelius Bridge 1940–41 Gerald Earl Thornton 1941–42 George Albert Berry 1942–43 Sidney Clarke 1943–44 Ernest Railton Grant 1944–45 Alfred Courtney 1945–46 Herbert Barber 1946–47 Fred Sanders 1947–48 Roland Graham Gordon 1948–49 Stanley Narcissus Bigwood 1949–50 Horace Edward Randall 1950–51 Arthur Albert Maidment 1951–52 George Chivers Whatley 1952–53 William James Rothwell 1953–54 Hedley John Annetts 1954–55 Francis James Moore 1955–56 Charles Joseph Lee 1956–57 Edward Percy Adlam 1957–58 Alfred Edward Batt 1958–59 Arthur Albert Maidment 1959–60 William James Rothwell 1960–61 Harold Reginald Kidwell 1961 Arthur Christopher Hoy 1961–62 Stanley Arthur Vokes 1962–63 Harold Gordon Batt 1964–65 Alfred Henry Crane 1965–66 William Eric Glazebrook 1966–67 William Stephen Biddle 1967–68 Beatrice Dorothy Brown 1968–69 Stewart Anthony Snook 1969–70 Margaret Josephine Benson 1970–71 William Hezekiah Lambert 1972–73 Hilda Elizabeth Barker 1973–74 George William Shingler 1974–75 Francis William Grandfield 1975–76 George Hubert Anthony Stocken 1976–77 Timothy Sherwood Hattersley 1977–78 Ivan Cecil Light 1978–79 Arthur Walter James Lawrence 1979–80 Kenneth Anthony Edwards 1980–81 Douglas Anthony Stephenson 1981–82 Derek Ashton Alford 1982–83 Beverly Head 1983–84 Peter John Dalton 1984–85 Pamela Irene Edwards 1985–86 Thomas Cameron Cowie 1986–87 William John Quirke McGrath 1987–88 Elizabeth Margaret Grant 1988–89 Pauline Denise D Stocken 1989–90 Margaret Mary Jackson 1990–91 Kathleen Cooper Joel 1991–92 Gloria Celia Tudhope 1992–93 Dorothy Joan Jones 1993–94 Peter Noel Chubb 1994–95 Patricia Mary Errington Rycroft 1995–96 Richard Terrence Rogers 1996–97 Beryl Mary Jay 1997–98 Paul Sample 1998–99 Olwen Tanner 1999–2000 David McCarthy 21st century 2000–01 Steve Fear 2001–02 Ian Tomes 2002–03 Sue Mallory 2003–04 Bobbie Chettleburgh 2004–05 Jeremy Nettle 2005–06 Patrick Paisey 2006–07 Sheila Warrander 2007–08 Kevin Cardy 2008–09 Iris Evans 2009–10 Bobbie Chettleburgh 2010–11 Brian Dalton 2011–12 John Abbott 2012–13 John Collier 2013–14 Penny Brown 2014–15 Jo Broom 2015–16 Andrew Roberts 2016–17 Derek Brown 2017–18 John Lindley 2018–19 Mike Osment 2019–21 John Walsh 2021–22 Caroline Corbin 2022–23 Tom Corbin 2023–24 Atquil Hoque References Salisbury mayors of Salisbury
David Stuart Holmes Rosenthal (born 1948 in Cambridge, United Kingdom) is a British-American computer scientist. Biography Rosenthal is the son of Michael David Holmes Rosenthal and Marjorie Mary "Molly" Rosenthal (both deceased). His brother Mark Geoffrey Thomas Rosenthal ran to be a member of the UK Parliament for Ynys Môn in 2015. Rosenthal received an MA degree from Trinity College, Cambridge, England, and a PhD from Imperial College, London. In the 1980s he worked on the Andrew Project at Carnegie Mellon University with James Gosling. In 1985 he joined Sun Microsystems, and developed the NeWS Network extensible Window System with Gosling and co-authored a book on it. He developed the Inter-Client Communication Conventions Manual (ICCCM) for the X Window System in 1988, and was issued a patent on a security system for X. In 1993 he became employee #4 and chief scientist at Nvidia, and then joined Vitria Technology in 1996. In 1999 he rejoined Sun and was a distinguished engineer. He became chief scientist for the LOCKSS project, first at Sun and then since 2002 at Stanford University. His research concerned computer data storage long-term protection techniques. He holds 23 patents. References External links DSHR's blog British emigrants to the United States Carnegie Mellon University faculty Stanford University staff Alumni of Trinity College, Cambridge Alumni of Imperial College London American computer scientists X Window System people Nvidia people Sun Microsystems people Computer graphics professionals 1948 births Living people
```python # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # # path_to_url # # Unless required by applicable law or agreed to in writing, # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # specific language governing permissions and limitations # pylint: disable=invalid-name, unused-argument """CoreML codegen supported operators.""" import tvm.ir from tvm.contrib.target.coreml import _convert_map from ...expr import Constant def _register_coreml_op(op_name): """Register a function to check the given operator is supported by Core ML. Paramters --------- op_name : Str The name of operator that will be registered. """ def _check_supported(expr): attrs, args = expr.attrs, expr.args if op_name == "nn.conv2d": if not isinstance(args[1], Constant): return False if attrs["kernel_layout"] not in ["HWIO", "OIHW"]: return False return True tvm.ir.register_op_attr(op_name, "target.coremlcompiler", _check_supported) for op in _convert_map: _register_coreml_op(op) ```
Transmembrane protein 251, also known as C14orf109 or UPF0694, is a protein that in humans is encoded by the TMEM251 gene. One notable feature of this protein is the presence of proline residues on one of its predicted transmembrane domains., which is a determinant of the intramitochondrial sorting of inner membrane proteins. Gene The TMEM251 gene is located on human chromosome 14, at 14q32.12, on the plus strand. The gene size is 1,277 base pairs. It contains 3 distinct introns, and transcription produces six different mRNAs that appear to differ by truncation of the 3' end. There are 2 transcript variants that encode for the TMEM251 protein, with the longer one being 169 base pairs in length, and the shorter one being 131 base pairs in length. The first transcript variant encodes a shorter predicted protein, while the second transcript variant encodes a protein with a longer N-terminus. Both consists of two exons that include the entire coding sequence for the TMEM251 protein. Figure 1: Chromosome 14 overview. TMEM251 is positioned at 14q32.12, marked by a red line. Promoter According to Genomatix's ElDorado program, the promoter region of TMEM251 is predicted to be 680 base pairs in length. The promoter region starts 500 base pairs upstream of the 5’ UTR of TMEM251 mRNA transcript and contains part of this 5’ UTR. Transcription Factors Various transcription factors are predicted to bind within the conserved parts of the promoter (upstream regulatory) region, on both the plus and minus strands. The transcription factors with the highest matrix scores include NKX homeodomain factors, GATA-binding factors, two-handed zinc finger, E2F transcription factor, and T-box transcription factors. No vertebrate TATA binding protein factors, RNA polymerase transcription factor II B, CCAAT binding factors, or CCAAT enhancer binding proteins were found. Protein The TMEM251 protein is 169 amino acids in length. The molecular weight of this protein is 18,747 Daltons, with an isoelectric point of 8.38. It is known to be a type IV multi-pass membrane because it spans the membrane twice in alpha-helical configuration, with its N-terminal domains targeted to the lumen. The TMEM251 protein contains a domain of unknown function, part of the domain family DUF4583, spanning from amino acids 35-160. TMEM251 has two isoforms, TMEM251.1 and TMEM251.2. Protein Composition Leucine is the most abundant amino acid by volume (15.37%). TMEM251 has very low abundance of Cysteine, Asparagine, and Aspartic acid. It has one negative charge cluster from amino acid 67–82. No repeats are identified. The same patterns are observed in TMEM251's primate orthologs. Tissue Expression In the human body, microarray-assessed tissue expression patterns show TMEM251 to be highly expressed in ascites, bladder, bone, embryonic tissue, intestine, and skin. In terms of clinical relevance, TMEM251 is expressed in breast carcinoma, dendritic cell line, hepatocellular carcinoma, neuroblastoma, glioblastoma, adult B-acute lymphoblastic leukemia, and blood mononuclear tissues (75-98%). Over-expression of the TMEM251 gene has not been linked as a causal factor in any of these disease states The conditions under which TMEM251 rises include occupational benzene exposure, acute cold exposure, macular degeneration and dermal fibroblast, and asthma. These microarray-assessed samples have low percentage rank on NCBI Geo (mostly below 50%). The conditions under which TMEM251 falls include infantile-onset Pompe disease, caseous tuberculosis granulomas, and endurance exercise training. These samples have relatively high percentage rank (mostly above 70%). Figure 2: EST Profile data shows the tissue expression of TMEM251 in humans. Homology and Evolution TMEM251 has no paralogs in humans. It does have orthologs within eukaryotes. Conservation has only been found in primates, not in bacteria, plants, or fungus. The following table represents a small selection of orthologs found using searches in BLAST and BLAT, sorted by % identity. This is by no means a comprehensive list, however it does show the vast diversity of species where TMEM251 orthologs are found. The TMEM251 gene first appeared on the planet around 400 million years ago (MYA), since the most distant orthologs are found in fish which diverged from humans around the same time. The size of the gene family, which is a set of similar genes that are formed by duplication of an original gene, is around 120 genes. Gene duplication, resulting in paralogous genes, occurred approximately 371.2 million years ago. Post-Translational Modifications Using various tools at ExPASy, the following are possible post-translational modifications for TMEM251: 3 possible Serine phosphorylation sites, no Threonine or Tyrosine phosphorylation sites. PKC phosphorylation site on Threonine-26. N-terminal acetylation site at the A position of –MLAFSE. SUMO interaction site on amino acids 139–143. 4 O-beta-N-acetylglucosamine attachment sites All post-translational modifications are conserved in vertebrates. Protein Secondary Structure Using various tools at ExPASy, TMEM251 secondary structure consists of the following: 74.6% Beta-sheet. 71.6% alpha helix. 8.9% turns It is predicted to have two transmembrane helices, of 23 amino acids in length each. The average hydrophobicity is predicted to be 0.19. Figure 3: TMEM251 predicted secondary structure from SOSUI. Mutation TMEM251 has a multitude of mutations in its 5'UTR, coding sequence, and 3'UTR. The majority of the mutations observed are missense mutations. References Proteins
```javascript // adds .remark-code-has-line-highlighted class to <pre> parent elements // of code chunks containing highlighted lines with class .remark-code-line-highlighted (function(d) { const hlines = d.querySelectorAll('.remark-code-line-highlighted'); const preParents = []; const findPreParent = function(line, p = 0) { if (p > 1) return null; // traverse up no further than grandparent const el = line.parentElement; return el.tagName === "PRE" ? el : findPreParent(el, ++p); }; for (let line of hlines) { let pre = findPreParent(line); if (pre && !preParents.includes(pre)) preParents.push(pre); } preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted")); })(document); ```
The interwar period of Polish football began in the late fall of 1918 after First World War, when Poland regained independence, which had been lost at the end of 18th century (see: Partitions of Poland). The newly created country soon started to organize its administration and several national organizations. Among them was the PZPN – Polski Zwiazek Pilki Noznej (Polish Football Association), which was created on 20 and 21 December 1919 in Warsaw. According to some sources, several officials representing around 30 Polish Football clubs were then present in Warsaw, but the list of them has been lost. Many Polish Football clubs were not founded in 1918, but much earlier. The first centers of Polish football were Kraków and Lwów, where a club were established as early as 1903 (Czarni Lwów, the first Polish sports club). However, before 1918 it was impossible to create an independent, uniquely Polish Federation, because Poland as such did not exist. Humble beginnings The freshly created Federation began, in late 1919, to organize first, historic Championships of Poland. This was a difficult task as the country's provinces had for 123 years been divided and had belonged to three different countries. Even such seemingly easy detail, as direct rail communication between main Polish cities – Warsaw, Kraków, Lwów, Wilno and Poznań, was virtually non-existent. To make matters worse, Poland was from the very beginning involved with wars with almost all neighbors (see: Polish–Soviet War, Polish–Ukrainian War, Polish–Lithuanian War, Great Poland Uprising, Silesian Uprisings, Border conflicts between Poland and Czechoslovakia). Considering those conflicts, it is not surprising that in these hectic months sports were not a priority for both fledgling government and Polish nation. Summer 1920 – unfinished championships However, some time in spring of 1920, officials from PZPN decided to organize first championships of the country. Firstly, the Association divided Poland (whose borders were then not yet determined) into five football districts – Warsaw, Kraków, Poznań, Łódź and Lwów. It was planned that in early summer of 1920 teams from these districts would play regional qualifying games and then, five champions would play each other in a central tournament. The last games of championships were supposed to take place some time in late October 1920. While planning those games, PZPN's officials did not predict that in summer of 1920 Red Army would reach the outskirts of Warsaw, and Poland's fate would be in grave danger (Russian westward offensive of 1918–1919). So, under the circumstances, only Western districts of Kraków and Poznań managed to carry out its games. Kraków's champion was Cracovia, Poznań's – Warta Poznań. Needless to add – Poland national team as such did not yet exist and no international friendlies took place. Crucial year – 1921 By mid-1921, the situation in Poland had calmed down. Conflicts were over (see: Peace of Riga) and the nation, while recuperating from all the wars, started to take interest in other activities, including sports. First, in early summer of 1921, teams from five districts played each other, in regional championships. The regional champions were: Cracovia Kraków, ŁKS Łódź, Warta Poznań, Pogoń Lwów and Polonia Warszawa. Cracovia Kraków – first champions During the final, nationwide games of the tournament, Cracovia proved to be the best, unbeaten team. Led by a legendary forward, Józef Kałuża, Kraków's squad won seven games, with only one draw (against Warta). The vice-champion of these historic games was Polonia Warszawa and in third place, Warta Poznań. National championships lasted for only two months, from late August until late October. The top scorer of the national games was Cracovia's forward Józef Kałuża, with 9 goals. First international friendly In late 1921, the freshly created Poland national team also played its first, historic, international friendly. On 18 December 1921 in Budapest, Poland lost to Hungary 0-1 (see: The first game: 18 December 1921. Hungary–Poland 1-0). Early 1920s Since 1922, Polish teams began regular games in championships of the country. In the years 1922–1926 the games were organized in the same fashion, as in 1921. First, regional games took place, then best teams would face each other in the national tournament. As Polish borders moved eastwards (Kresy Wschodnie) as well as westwards (Kresy Zachodnie), additional PZPN's districts were added. In 1922, in a nationwide tournament, 8 teams participated. Five of them were champions of the districts established back in 1920 (these teams were the same as in 1921), plus champions of three new districts – Upper Silesia (Ruch Wielkie Hajduki), Lublin (Wojskowy KS Lublin) and Wilno (Strzelec Wilno). Also, since 1922, Poland National Team started to play international games on regular basis. Back then, no FIFA World Cup existed, so the only way to prove side's quality were friendlies or Olympic Games. National Championships 1922–1926 – dominance of Pogoń Lwów Starting in 1922, Pogoń Lwów for four successive seasons was champion of Poland, with the exception of 1924. In this year, due to the 1924 Summer Olympics in Paris, no championships were organized. The reason for this was so that the National Team would be adequately prepared for its games in the Olympics. Pogoń thus was the champion in the years 1922, 1923, 1925 and 1926. Lwów's squad was unequaled in the country, with its leader in excellent athlete, Wacław Kuchar, who in 1922 and 1926 was the top scorer of Poland. Another Pogoń star was Mieczysław Batsch – also a forward, who together with Kuchar and some other Lwów's players regularly represented the Poland national team. Apart from Pogoń, in 1922–1926 other important teams were: Wisła Kraków, Warta Poznań, Polonia Warszawa, Cracovia. In 1925, another district was added to the nationwide games. This time it was Toruń, with its champion, Toruński KS. Thus, by 1927 there were 9 districts of PZPN – Warsaw, Łódź, Poznań, Kraków, Lwów, Lublin, Wilno, Upper Silesia and Toruń. Each of them sent its champion to the national tournament. National Team 1922–1926 – First victory Back in December 1921, just after Hungary vs. Poland friendly, officials from both federations agreed that the next game would take place in Poland. As in early 1920s, Cracovia was regarded as the most influential club, the first international on Polish soil took place on Cracovia's stadium. The Hungarians supposedly were happy with this, as Kraków is in southern Poland, quite close to Budapest. The game occurred on 14 May 1922. Polish football fans must have been in great anticipation of this event, because they filled up the stadium, with 16,000 of them showing up. Supporters intent on seeing this historic game came not only from Kraków, but also from other parts of the country. They were disappointed – Poland lost to its renowned rival 0-3 but, according to some sources, white-reds did not deserve such harsh punishment. Two weeks later, Polish team went a long way to Stockholm, to face Sweden. This time, at the Olympic Stadium, with 16,000 spectators, Poland won the first game in its history. The Poles beat their opponents 2–1, with goals by Józef Klotz (on a penalty kick) and Józef Garbień. It must be mentioned, that in 1922 it took almost four days for the Poles to get by trains and ferry from Kraków, via Warsaw, Berlin, Stralsund and Malmö, to the capital of Sweden. This victory, over an experienced Swedish side, was a turning point for the Poles. The National Team quickly took advantage of it, as more nations showed interest in facing white-reds. On 3 September 1922, in Cernăuţi, Poland tied 1–1 with Romania and on October 1, in Zagreb, Poles beat Yugoslavia 3–1, with two goals by Józef Kałuża. In 1923, the first game occurred as late as 3 June. In Kraków, the Poles lost 1–2 to Yugoslavia (goal by Kałuża). This goal is also significant – it was the first one scored on home turf. Fans had to wait for next match until 2 September, when in Lwów, on the Czarni Lwów's stadium, Poland tied 1–1 with Romania. Soon after, white-reds traveled north. On September 25 in Helsinki, Poland lost 3–5 to Finland, two days later, in Tallinn, the Poles beat Estonia 4–1. The last game in 1923 took place in Kraków. On 1 November, the Poles tied 2–2 with Sweden. Failure at the 1924 Olympic Games In 1924, all efforts of PZPN were directed towards one aim – the 1924 Summer Olympics in Paris. Due to this fact, games for national championships did not take place, and manager Adam Obrubański was given a free hand in choosing players that would represent the nation in France. Obrubanski, after checking some 40 athletes, chose the roster and went to Stockholm, for the last pre-Olympic friendly. However, on 14 May 1924, Poland was routed by the Swedes 1-5 (goal by Mieczysław Batsch). With the Games approaching, fans back in the country were uneasy and their worst predictions turned out right. Upon arriving at Paris, the Poles found out that they would face Hungary. The game, which took place on 26 May 1924 at Stade Bergeyre, was a disaster. The white-reds fought hard in the first half, which they lost 0–1. Alas, after the break, the Poles lost strength and went down by 0–5. The Olympic dream was over, with Uruguay becoming the champion. After the Olympics, National Team until the end of 1926 In spite of defeat in Paris, Polish players, who for the first time had played in an international tournament, learned an important lesson. Also, Polish officials got acquainted with football officials from United States, who came to France with their team. So, on June 10 in Warsaw, Poland faced the Olympic Team of USA. This game was another letdown for home fans, as the hosts lost 2–3. For the rest of the period described (1924–1926), Poland rated poorly, occasionally winning some games against such teams as Estonia, Finland or Turkey, but also losing many, with Hungary, amateur team of Czechoslovakia or Sweden. The biggest success of these years was the routing of Finland 7–1 on 8 August 1926 in Poznań. Also, on 12 September 1926, Poland beat Turkey 6–1, this game taking place in Lwów. However, those teams were regarded as somehow "second class". Facing tougher opponents, the Poles would most likely lose (like on 1 November 1925, in Kraków, Poland – Sweden 2-6 or on 20 August 1926 in Budapest, Hungary – Poland 4–1). At the end of 1926, Poland went to Scandinavia. On October 3 in Stockholm, the Poles lost to Sweden 3-1 and a week later in Oslo, Poland beat Norway 4–3. Among players, who would represent the country, majority of them came from Kraków's clubs, Cracovia and Wisła, Pogoń Lwów, Warta Poznań, Polonia Warszawa and ŁKS Łódź. This means that just like in the early 1920s, the same teams played key roles in Polish football. After Adam Obrubanski, Poland's managers were Tadeusz Kuchar and then Tadeusz Synowiec. The late 1920s and early 1930s 1927 brought a major change, as the Polish football League was created. The National Team's outlook did not change significantly, without any major achievements and international successes. Creation of the Polish Football League In December 1926 in Warsaw, representatives from several Polish clubs met each other. The purpose of this meeting was simple – to discuss the possibility of creating a Football League. It is unclear who came up with this idea (some say this was due to numerous changes, introduced at that time in Poland, after the May Coup). Obviously, a League was a much more practical solution than hitherto practised two-stage (regional and then central) games. To the dismay of clubs’ officials, PZPN did not like the idea of the League and the Association wanted to thwart it. However, it turned out that virtually all but one Polish club supported the League and decided to create it, no matter what PZPN's representatives thought of it. In late February 1927, at the PZPN's meeting in Warsaw, its officials openly opposed the League, but the clubs, allegedly egged on by some generals from Polish Army (which, after May Coup of 1926, played a key role in all aspects of public life), would not obey. The creation of the League was announced on March 1, 1927. Cracovia Kraków It has been mentioned that all clubs but one supported the League. The only opponent was Cracovia – a very influential and strong organization in Polish Football of the 1920s. Cracovia's boycott was because its director, Dr. Edward Cetnarowski, at the same time held the post of the director of PZPN. It must be mentioned that Cetnarowski was a personality known not only in Poland, but also in other countries. It was due to his efforts that in September 1923 his beloved club, Cracovia, went on a tour to Spain. The Kraków side's results were impressive – a 1–1 tie with FC Barcelona and a 0–1 loss to Real Madrid. In October, also thanks to Cetnarowski, FC Sevilla came to Kraków and lost 2–3 to Cracovia. Early years of the League – dominance of Wisła Kraków The games of the first, historic League Championships started on April 3, 1927. All major teams (except for Cracovia) took part in it. This is the list of the teams (in the order given below in which the League finished in November 1927): Wisła Kraków 1. FC Katowice (German-minority team from Katowice) Warta Poznań Pogoń Lwów Legia Warszawa Klub Turystow Łódź ŁKS Łódź Polonia Warszawa Czarni Lwów Toruński KS Toruń Hasmonea Lwów (Jewish-minority team from Lwów) Ruch Wielkie Hajduki Warszawianka Warszawa Jutrzenka Kraków (Jewish-minority team from Kraków, which finished last and was relegated) Polish-German rivalry symbolized by Wisła Kraków and 1.FC Katowice In this first season of the League, the fight for the Championship was decided between two powerful teams – Wisła Kraków and 1.FC Katowice. This rivalry was treated very seriously, not only by the two sides involved, but also by the whole nation. 1.FC was regarded as the team supported by German minority, while Wisła, at the end of this historic season, represented ambitions of all Poles. Some time in Autumn 1927 in Katowice, an ill-fated game between 1.FC and Wisła took place. The stakes were very high – the winner would become the Champion. Wisła won 2–0 in Katowice. The League in the years 1928–1932 In 1928 Cracovia finally decided to enter the League, which was gladly accepted by all fans of Football. However, Championships were once again won by Wisła, with such excellent players as Henryk Reyman, Mieczyslaw Balcer and Jan Kotlarczyk. Warta Poznań was second and Legia Warszawa third. This was also the last year of 1.FC's dominance. The team finished fifth, to be relegated forever at the end of 1929 season. In 1929 yet another team (after Cracovia, Pogoń Lwów and Wisła) was added to the list of Champions of Poland. This time it was Warta Poznań, who finished one point ahead of Garbarnia Kraków. However, after the last game, on December 1, 1929, it was Garbarnia Kraków that was celebrating the Championship. Two weeks later, in mid-December, PZPN's officials changed the result of the Warta – Klub Turystow Łódź game. Originally, Warta lost 1–2, but due to a walkover (it was decided that one of Łódź's players did not have all necessary documents), this was changed to 3–0 in favor of Poznań's side. As a result of the decision, Warta (with 33 points) became the Champion, Garbarnia finished second with 32 points and Klub Turystow was relegated. In 1930, Cracovia regained the Championship, (to repeat this success in 1932) and a year later another Kraków side, Garbarnia, won the League. It is clear that the 1927–1932 period was marked by the dominance of teams from Kraków. During this time, only once (Warta Poznań, 1929) the Championship was won by a side from a different city. The 1931 Champion, Garbarnia, was unique as this was the first time that the League had been won by a side whose all players had been bought from other teams. National Team in 1927–1932 In 1927, due to conflict between PZPN and Polish football clubs about the creation of the League, only one international game took place. On June 19, in Bucharest, Poland tied 3–3 with Romania. The new manager, Tadeusz Synowiec, faced a big problem in this match. As most teams refused to send their players, he had to get support almost solely from Cracovia. Kraków's side sent as many as 7 players, the remaining 4 came from Katowice's second-class clubs such as Pogoń Katowice and Policyjny KS. Considering this, the tie with Romania was a good result. Polish fans had to wait for an international friendly for as long as a year. In June 1928 in Warsaw, Poland tied 3–3 with USA (the Americans came to Europe for Amsterdam's 1928 Summer Olympics), and accepted the offer. By then, the conflict between PZPN and clubs was over, so new manager Tadeusz Kuchar was able to try all the players he wanted. Poland were losing 2-3 until the 89th minute when they were awarded a penalty kick. None of the home players wanted to take the kick until eventually Zygmunt Steuermann, a forward from Jewish-minority team Hasmonea Lwów, stepped forward and scored the equalising goal. On July 1, for the first time ever, the national team came to Katowice. Poland beat Sweden 2–1, with around 20,000 fans cheering the victory. To please Katowice's fans, Tadeusz Kuchar called up the two best players from 1. FC Katowice – forward Karol Kossok and a very talented defender Erich Heidenreich. The first one gladly accepted the offer and came out on the field, but Heidenreich wrote a letter to PZPN. The player stated that even though he was pleased and honored, he considered himself a German, thus would not play in a white-red jersey. Polish officials were not happy with this (Heidenreich was considered the best defender in the League), but had to comply with his decision. At the end of 1928, Poland for the first time faced its immediate neighbor and one of Football powerhouses – Czechoslovakia. In Prague, on October 27, white-reds lost 2–3. In the years 1929–1932 the national team was considered in Europe as a second-class side, which was proved by international authorities in 1929. In 1929–1930, an international competition, The Amateur Central European Cup took place. Poland was included in these games, together with the amateur teams of Hungary, Czechoslovakia and Austria. First, official teams of these nations played in the "real" Central European Cup. This was a clear sign that the European elite did not feel that playing such a weak opponent as Poland was useful. Evidence in support of this came in Budapest, when the Poles were routed 1-5 by the official Hungarian team. As games against amateur teams are not considered official by FIFA, for several months Poland did not play any official matches. The breakthrough came at the end of September 1930, in Stockholm. The white-reds beat Sweden 3–0, but the hopes of Polish fans, augmented by a 6–0 victory over Latvia (October 1930, Warsaw), faded away on June 14, 1931, also in Poland's capital. On this day, the hosts faced Czechoslovakia, one of the best teams in the world. The Poles were routed 0–4, and the Czechoslovaks scored their first goal as early as in the 30th second. At the end of the described period, in mid-October 1931, Poland traveled to Brussels, where they lost 1–2 to Belgium. Then, on October 25 in Poznań, the hosts beat Yugoslavia 6–3. This success was the last game of manager Stefan Loth (who died in summer of 1936). Starting in 1932, the national team was managed by former forward of Cracovia, Józef Kałuża, who would lead it to its biggest successes and who would stay on this post until September 1939. 1932–1936 The dominance of two early centers of Polish Football – Kraków and Lwów, slowly came to an end. The new manager of the National Team, Józef Kałuża, was a huge fan of teams and players from Polish Upper Silesia (see: Silesian Voivodeship (1920–1939)). Thus, more and more sportsmen from this region appeared in the national lineup, eventually dominating it. Also the League was subject to the reign of Ruch Chorzów. This team won the Championships in the years 1933, 1934, 1935 and 1936. The Polish Football League 1932–1936 As has been said, the early 1930s marked a decline of the dominance of Kraków and Lwów as centers of Polish Football. The point of gravity slowly moved towards the west – to the Polish part of Upper Silesia, which had belonged to Poland since 1921 (see: Silesian Uprisings). In 1932 the champion was Cracovia, but starting in 1933, Ruch Chorzów (then: Ruch Wielkie Hajduki) completely dominated the league, being the champion for 4 times in a row. Ruch, with such excellent players as Teodor Peterek, Ernest Wilimowski and Gerard Wodarz was by far the best team in those years. For example, in 1934 it finished seven points ahead of second Cracovia. Other important teams of these years were: Cracovia Kraków, Wisła Kraków, Pogoń Lwów and Warta Poznań. In 1933 and 1934 there were 12 teams in the League. In 1935 this number was cut to 11 and in 1936 – to 10. Football officials did it on purpose – with fewer teams, the competition was supposed to be harder, which would attract fans to the stadiums. However, supporters’ turnout was not impressive, with Ruch Chorzów as the most popular team, both at home and away. In late 1935 (the league held its games in the spring-summer-fall system) fans were shocked to find that Cracovia, the legend of this sport, was relegated to the A-class. The Kraków side's absence lasted for a year – it returned in 1937, to become the champion. Early years of Kałuża as a manager Józef Kałuża was one of the best players of the 1910s and 1920s Polish Football. His career in Cracovia started in 1912 and ended in 1931. Then, Kałuża started another job – that of a manager. Firstly, for a short time in Legia Warszawa, then returned to Cracovia. Even though not born in Kraków, he was a great admirer of this city, and there died in October 1944. Kałuża's post as a manager of the National Team was decided on 20–21 February 1932, during the General Meeting of PZPN. There, in the election, he beat the main rival, former star of Pogoń Lwów, Wacław Kuchar. It must be mentioned that the post of the manager of the National Team of Poland was not well-paid in the 1930s. Clearly, Kałuża's significance was great; he was widely respected, but to support himself, he had to continue working as a teacher in Kraków's high school. Back then, PZPN was not as rich as it is today. The manager was provided with some money to cover costs of travels and accommodation, but this was not regarded a regular salary. Football officials in Poland must have been pleased with Kałuża – unlike his predecessors, who would be rotated after just a few months, he held the seat firmly until the last days of interwar Poland (see: Invasion of Poland). Kałuża's first games Kałuża's debut as Polish coach could not have been better. The new trainer went with his team to Zagreb, to face an always-dangerous team of Yugoslavia. On May 29, 1932, Poland, quite unexpectedly, routed the rivals 3–0. Nobody was expecting this to happen and it was a shock. Then, on July 10 at Warsaw, the white-reds beat 2-0 Sweden and fans realized that under Kałuża, the national team can finally be put together and achieve some successes. 1932 ended with yet more achievements. On October 2, a so-called double match took place (such games were popular in 1930s European Football). The reserve Poland team beat 2-1 Latvia at Warsaw, and at the same hour the first lineup faced Romania in Bucharest. Romania (with several of its starters of Hungarian nationality from Transylvania) was regarded a very strong team. The Poles, however, overwhelmed it 5-0 and this was the biggest success of Polish Football so far. This game is significant also for another reason. In Polish lineup there were two newcomers from Upper Silesia – Ewald Urban and Gerard Wodarz. Both performed excellently, each scoring a goal. This meant that Kałuża started to notice the Upper Silesians, and after a few years players from there would totally dominate the national team. The remaining three goals were scored by Legia Warszawa's Jozef Nawrot. FIFA World Cup 1934 – unsuccessful qualifier with Czechoslovakia At the beginning of 1933 Polish fans, heady with successes, were full of high hopes and expectations. These feelings were blunted on June 4 at Warsaw, when white-reds were defeated 0-1 by Belgium. This was a huge setback and cold water on heads of some fans. The game against Belgium was yet another step towards "Silesiazation" of the national team. Apart from Urban and Wodarz, two more players from this region were fielded. These were Edmund Giemsa and Karol Dziwisz. All four were from Ruch Chorzów. Fifth Silesian in the lineup was Karol Pazurek from Pogoń Katowice. On September 10, 1933, Poland at Warsaw beat Yugoslavia 4–3, but attention of fans already turned on Czechoslovakia. To qualify to the 1934 FIFA World Cup, Poland had to beat its southern neighbors, whose team was regarded as one of the best in the world. The first leg occurred October 15 in Warsaw. The white-reds, after a fierce battle, lost 1-2 (Polish lone goal on a penalty by Legia Warszawa's Henryk Martyna). This was a huge disappointment, and facing the second leg in Prague, nobody believed in success. At the end of 1933, due to thaw of Polish-German relations, the team headed for Berlin. On December 3 the Germans won 1–0, with the goal in the 89th minute. All throughout winter and early spring of 1934, Football fans were waiting for game with Czechoslovakia, scheduled on April 15. However, just a few days before the match, Polish Ministry of Foreign Affairs banned the team from traveling to Prague, due to tense situation between two neighbors. As a result, the Czechoslovaks qualified and during the World Cup in Italy proved their skills, becoming the runner-up. 1934–1936 Years marked by rising fame of Ernest Wilimowski Soon after events of April 1934, the team traveled by train on a tournee to Scandinavia. From Katowice, via Berlin, they went to Copenhagen, where on May 21 the Poles lost 2–4 to Denmark. Two days later, at Stockholm, white-reds faced Sweden, also losing 2–4. These games are important for one reason. Match against Denmark was the debut of a 17-year-old Ernest Wilimowski. The young forward of Ruch Chorzów was a rising star, which was proven in Stockholm, where "Ezi" scored a goal. The remaining games of the described period were not marked by any significant achievements. Poland lost several prestigious games (2-5 vs Germany in Warsaw, 1-4 vs. Jugoslavia in Belgrad, 1-4 vs. Romania in Bucharest or 2-5 vs. Austria in Wien). The team plunged into mediocrity, winning only 6–3 with Latvia and 1–0 with Austria (on October 6, 1935, at Warsaw, lone goal by Pogoń Lwów's Michał Matyas). This game was the only notable success of the 1934 – early 1936 period. Wilimowski played in some of these matches, but the young player needed time to establish his position. 1936 Olympic Games in Berlin Olympic experiences of Polish football team were by 1936 few and far between. In 1920 Summer Olympics, at Antwerp, white-reds did not participate, due to Polish–Soviet War. In 1924 at Paris, Poland was routed 0-5 by Hungary. As a result of this failure, the team did not even bother itself to travel to the 1928 Summer Olympics in Amsterdam. Then, 1932 Summer Olympics in Los Angeles were too far away and too expensive for Polish football officials. Morale among both fans and officials was at the beginning of 1936 very low. Newspapers were urging PZPN to fire Kałuża, but eventually this did not happen, as the coach was strongly supported by representatives from Upper Silesia – the strongest and richest district of PZPN. Even though 1936 Olympics were to be held in the neighboring capital, not everyone in Poland favored the idea of National Team's participation in this event. Officials from both Kraków and Lwów rejected it, only to be convinced by an unexpected victory 2–0 over Belgium (February 16, 1936, Brussels). This was a good sign, which changed the general feelings. In mid-June 1936, after a long discussion, PZPN officially permitted the National Team to participate in the Games. Kałuża did not have time – he quickly organized a training camp in Warsaw, calling 36 players. After a while this number was cut down to 25 and then – to 18. Among them was Ernest Wilimowski, who was regarded by the manager as a key player, essential for his plans. A few weeks before the games, "Ezi" was disqualified for alleged excessive drinking and did not go to Berlin. This was a huge mistake of Polish officials. They recklessly got rid of a top forward, thus reducing Poland's chances for a medal. Józef Kałuża had to agree with the decision, but obviously he was very unhappy. Without Wilimowski in the lineup, white-reds lost most of their firepower. Games vs. Hungary, Great Britain and Austria 1936 Summer Olympics was the second (after 1924 Summer Olympics) major international tournament in which the Poles participated. Considering this fact, it is understandable that both officials and players were nervous before stepping onto the field for the first game. The opponent was the amateur team of Hungary. On August 5 at Berlin's Post-Stadion the white-reds faced Hungary. The opponents, obeying the regulations, fielded their amateur players. With Poland, the situation was more complicated. Officially, there were not any football professionals in the country. All players worked somewhere on a daily basis, so as such they were amateurs. In some cases however, these jobs were just covers and all some athletes did was playing. Thus, Polish lineup consisted of its best players from top League teams. Also, it must be mentioned that games against Hungary, Great Britain and Austria are not considered by FIFA as official, so they simply do not count in any statistics. Poland won the first game with ease, beating the Hungarians 3-0 (two goals by Hubert Gad, one by Gerard Wodarz). Then, white-reds faced amateurs from Great Britain. This was a tougher opponent, but again – no players from English or Scottish professional teams were fielded. The only athlete who eventually turned pro was Bernard Joy, later representing Arsenal London. This game, which took place on August 8, was a show of two players – Gerard Wodarz (who scored 3 goals, with additional strikes by Hubert Gad and Ryszard Piec) and Joy, who netted twice. Poland won 5–4, but the match was very nail-biting. It is enough to say that at some point the Poles were winning 5–1, only then to let 3 goals. Fortunately, the British did not have enough time to tie. Then, on August 11, at Berlin Olympic Stadium, in the semifinal Poland faced amateur team of Austria. Stakes were high, as the winner would qualify to the final. Perhaps because of this, white-reds were nervous and did not play their part, losing 1-3 (lone goal by Hubert Gad). Huge crowd of 80,000 was very partisan, supporting Austria, which also was a disadvantage. Chance of Olympic gold was missed. The match against Norway After losing to Austria, the Poles had to content themselves with the game for the bronze medal. This time, for unknown reasons, Norway fielded its first lineup, so this match is regarded as an official international game. The angry Polish officials decided to punish some players, claiming they did not play hard enough against Austria, so the starting roster was much different. It did not help much, as morale in the team was very low. The white-reds scored the first goal (scored by Gerard Wodarz), then the opponents answered with two from Arne Brustad. Poland managed to tie (with Teodor Peterek scoring), only to let Brustad score his third goal of the day. Norway won 3-2 thus receiving bronze medals. 1936–1939: the last years of interwar Poland During the period described, the National Team slowly recovered from the Olympic failure, eventually managing to qualify for the 1938 FIFA World Cup (see: Poland at 1938 FIFA World Cup). In the last game of interwar Poland, the white-reds in Warsaw beat 4-2 Hungary (see: The Last Game (August 27, 1939)). This was the biggest success of Polish football in the years 1918–1939. According to some experts, had the Second World War not started, Poland would have achieved success in the planned 1942 FIFA World Cup, which was supposed to take place either in Brazil or Argentina. Manager Józef Kałuża had gathered a group of excellent, prospective players, with Ernest Wilimowski as the top star. Kałuża had plans and vision; however, on September 1, 1939, it all changed forever. Poland ceased to exist, only to return to the map of Europe in 1945. By then, however, the situation was radically different. Polish Football League 1936–1939 Ruch Chorzów was still the dominant team, winning the Championships in 1936 and 1938. In 1937 Ruch's streak of four consecutive champions was broken by Cracovia, and in 1939 the championships were not finished. By August 31, 1939, after some 12 games, Ruch was the leader of the 10-team League. Last games of this summer occurred on August 20. Then, a break was planned, because the National Team was going to play a few international friendlies. Games were to be re-introduced on September 10. As a result of the Second World War, borders of Poland changed significantly. Lwów, one of the centers of Polish football (with such teams as Pogoń Lwów, Czarni Lwów and Lechia Lwów) was annexed by The Soviet Union and all these teams ceased to exist. Lwów's football officials and players moved westwards, creating such clubs as Polonia Bytom, Odra Opole and Pogoń Szczecin (see: Recovered Territories). Another important center, Wilno (with the team Śmigły Wilno), was also annexed by the Soviets (see: Polish areas annexed by the Soviet Union). This is the list of the ten teams that participated in the games for the last Championships of interwar Poland. Teams are presented according to their position on the table, as of August 31, 1939: 1. Ruch Chorzów 2. Wisła Kraków 3. Pogoń Lwów 4. AKS Chorzów 5. Warta Poznań 6. Cracovia 7. Polonia Warszawa 8. Garbarnia Kraków 9. Warszawianka Warszawa 10. Union Touring Łódź The national Team in 1936–37 Both players and manager Kałuża did not have much time to recuperate and analyze the Olympics. League teams were waiting for their key players, and less than a month after the Berlin game vs. Norway, Poland played in another double match. On September 6, 1936, the reserve team faced Latvia in Riga, on the same day the first team went to Belgrad, to play Yugoslavia. Both matches were highly unsuccessful. In Riga, Polish second team tied 3–3 with a much-weaker opponent. However, the game in Belgrade was a real disaster. After a very poor performance, the visitors lost 3-9 (two goals by Teodor Peterek, one by Gerard Wodarz), which was a clear sign of athletic and personal slump of Polish team. For the next months Poland was struggling to recover from this drubbing. The White-reds did not manage to beat Germany (1-1, Warsaw, September 13, 1936) or Denmark (1-2, Copenhagen, October 4, 1936, in this game Ernest Wilimowski finally returned to the team). The first signs of improvement appeared in mid-1937. On June 23 in Warsaw Poland beat Sweden 3–1, only to lose 2–4 to Romania a few days later (July 4, Łódź). A crucial game occurred on September 12, 1937, in Warsaw. The hosts beat Denmark 3-1 which brought hope and eventually started a series of great games, climaxing during the 1938 FIFA World Cup. Match after match, the performance of Polish players improved. Results were impressive. Firstly, in a World Cup qualifier at Warsaw (see: Poland at 1938 FIFA World Cup), Poland beat Yugoslavia 4-0 (October 10, 1937). Interesting is the fact that all goals were scored by players from Chorzów's clubs – Leonard Piątek (2), Ernest Wilimowski and Gerard Wodarz. Manager Kałuża betted on players from Polish Upper Silesia (seven of them appeared in the lineup) and was not disappointed. On the same day in Katowice the reserve team beat 2-1 Latvia. These games were a huge boost for the Poles. Winter break was marked by a great level of optimism, and quality of Polish team was assured by the invitation from then very strong team of Switzerland. White-reds faced the Swiss on March 13, 1938, in Zürich, to achieve a 3–3 tie. Again – all goals were scored by players from Chorzów (Wilimowski, Piatek, Jerzy Wostal). Also, in the lineup there were as many as eight Upper Silesians, which was a clear proof of this region's dominance in Polish football. In spring of 1938, just before the World Cup, the Poles were in their best shape. This was proven on May 22 in Warsaw, when the hosts, playing in front of 25,000 fans, routed Ireland 6–0. This match is regarded as one of the best performances of the interwar period. Apart from Wilimowski, who again showed his extraordinary skills and scored once, virtually all players played their hearts out. Out of them, one has to single out the scorers – Jan Wasiewicz, Leonard Piątek (2) and Gerard Wodarz. The game against Ireland was the last friendly before World Cup. It raised spirits and gave hope. 1938 FIFA World Cup It is enough to say that Poles, after an impressive game (and amazing show by Ernest Wilimowski) lost 5–6 to Brazil, which automatically eliminated them from the tournament. Also, it is worth mentioning that seven starters (Ernest Wilimowski, Wilhelm Góra, Ewald Dytko, Gerard Wodarz, Leonard Piątek, Erwin Nyc and Ryszard Piec) were from Upper Silesia (see: Autonomous Silesian Voivodeship). Out of remaining four, three (Edward Madejski, Antoni Gałecki and Władysław Szczepaniak) came from Polish heartland and the last one, Fryderyk Scherfke, was an ethnic German from Poznań. Last months of interwar Poland After the loss to Brazil, the Poles needed time to recuperate and rethink the tactics. The next friendly occurred three months later, on September 18, 1938. In Chemnitz, the Germans beat their visitors 4-1 (goal by Teodor Peterek). Compared to the Strasbourg match, there was only one change in the lineup – forward Fryderyk Scherfke was replaced by Peterek. According to witnesses, Poland played a good game, but missed countless good opportunities. Germans, however, netted all their chances. A week later, on September 25, in a double game, the first team faced Yugoslavia in Warsaw (4-4, goals by Józef Korbas, Ernest Wilimowski – 2 and Leonard Piątek), and reserves went to Riga, where they lost 1–2 to Latvia. This was a surprising defeat, but the worst was yet to come. In the next five games Poland did not manage to beat their opponents. Firstly, on October 23 in Warsaw, the hosts tied 2–2 with Norway (goals by Wilimowski and Ryszard Piec). Then, in late November, white-reds went on a long train and ferry journey to Dublin, where they lost 2–3 to Ireland (goals by Wilimowski and Piatek). The first game of 1939 was a disaster. On January 22, at Paris's Parc des Princes, the French routed Poland 4–0. It must be mentioned that January is the time of winter break in Polish Football League, so the players were completely unprepared for this game. However, Polish officials did not want to refuse invitation from their French counterparts, and thus the match turned out really badly for white-reds. In freezing rain, hosts were faster and stronger and ambitious Poles were no match to them. On May 27, 1939, in Łódź, Poland faced Belgium. This time again the white-reds did not manage to win, achieving a 3–3 tie (two goals by Wilimowski, one by Jerzy Wostal). Also on June 4 in Warsaw, facing Switzerland, the hosts tied 1-1, with Poland's lone goal by Piatek. The last game of interwar Poland took place August 27, 1939 in Warsaw. Hosts faced Hungary, beating them 4–2. This was the day of Ernest Wilimowski, who scored 3 goals and set up the 4th one. The game is described here: The last game: August 27, 1939. Poland – Hungary 4-2. On September 3, also in Warsaw, Poland was going to face Bulgaria. Three days later, white-reds were supposed to travel to Belgrade, to play Yugoslavia. These games never took place. On September 1, 1939, Germany invaded Poland (see: Invasion of Poland). Then, on September 17, Soviet Union joined the Nazis (see: Molotov–Ribbentrop Pact). Poland disappeared from the map of Europe, and the occupiers banned Poles from practising any sports. See also President of Poland's Football Cup (1936–1939) Lower Level Football Leagues in Interwar Poland Polish Football League 1927–1939 Further reading Encyklopedia Piłkarska Fuji. Biało-czerwoni. Dzieje reprezentacji Polski (1) (Polish Football Encyclopedia. History of the Polish National Team (1)) Katowice 1991, Encyklopedia Piłkarska Fuji. Kolekcja klubów. Lwów i Wilno w Ekstraklasie (Polish Football Encyclopedia. The History of Polish Football in Prewar Eastern Regions of Poland), Katowice 1997, Encyklopedia Piłkarska Fuji. Liga Polska (Polish Football Encyclopedia. History of Polish Championships), Katowice 2000, , External links Extensive digital collection of Polish football posters and other documents from the interwar period History of football in Poland Second Polish Republic
Jose "Joe" Sanson Espinosa III (born June 20, 1956), also known as Joe III, is a Filipino politician who served as mayor of Iloilo City from 2017 to 2019. Early life Espinosa III was born on June 20, 1956, in Iloilo City. He is the eighth child of Jose "Mor" Espinosa Jr. and Lolita V. Sanson. At an early age, He attended and graduated from the A. Montes Elementary School, finished high school at the University of Iloilo, earned his bachelor's degree in political science and economics at the University of San Agustin, and later graduated from the School of Law and Graduate Studies at the same university. Political career Espinosa III's political career earned prominence during his short term as City Legal Officer. He continued his political career as an Iloilo City Councilor for three consecutive terms, from 1989 to 1998. He was elected Iloilo City Vice Mayor in 2010 and served until his appointment in 2017 by the Department of Interior and Local Government (DILG) as the new mayor of Iloilo City after the dismissal order on Mayor Jed Patrick Mabilog. He served the remainder of Mabilog's term until 2019, after he lost his reelection against his brother-in-law and former Mayor of Iloilo City, Jerry Treñas. In the 2022 election, he lost the congressman position race against reelectionist Iloilo City congresswoman Julienne Baronda, whom he defeated in the vice mayoral race in the 2010 elections. Personal life Espinosa III is married to Gina Agnes Divinagracia Sarabia, a gemologist, and they have four daughters, namely: Regine Amparo, Maria Patricia, Beatrice Mary Agnes, and Ma. Christina Isabel. References |- |- 1956 births Living people People from Iloilo City Hiligaynon people Visayan people Filipino Roman Catholics Mayors of Iloilo City
Florent Manaudou (; born 12 November 1990) is a French competitive swimmer, an Olympic champion of the 50-meter freestyle at the 2012 London Olympics, and the younger brother of Laure Manaudou, a 2004 Olympic gold medalist in swimming. He currently holds the world record in the 50-meter backstroke (short course). He competes for the Energy Standard Swim Club in the International Swimming League. Personal life Manaudou is the son of a French father and a Dutch mother. He first began swimming under the direction of his older brother, and later joined the swimming club of Marseilles, France. In 2007, he was the Junior Champion of France of the 50-meter freestyle event. In 2009, he joined the French Army and is currently in an artillery regiment. In 2022, he transitioned to competing for CN Antibes after formerly competing only for the CN Marseille (CNM) swim club. As of 2023, he continues to compete for CN Marseille in competitions such as the Belgian Open Swimming Championships. He and his sister Laure are the first siblings to both win Olympic gold medals in swimming. Manaudou was awarded the Knight of the French National Order of the Légion d'Honneur for his "eminent merits" in swimming for his performance in 2012. In September 2021, Manaudou announced his engagement to his girlfriend of over a year and a half, Danish swimmer and Olympic gold medalist Pernille Blume. The following month Manaudou was present in the audience to support his fiancée Pernille Blume as she competed on Vild med dans. Swimming career 2011 World Championships In his only individual event at the 2011 World Aquatics Championships in Shanghai, the 50-meter butterfly, Manaudou placed fifth in the final with a time of 23.49. It was slightly slower than the times he posted in the heats (23.31) and semifinals (23.32). Manaudou also competed in the heats of the 4×100-meter medley relay and as the butterfly leg, had a split of 54.02. The French team did not advance to the final with an overall time of 3:36.21. 2012 Summer Olympics At the French Olympic Trials, Manaudou qualified for the 2012 London Olympics in London by finishing second behind Amaury Leveaux in the 50-meter freestyle with a time of 21.95. Despite entering the Olympics with only the 10th fastest time in the men's 50-meter freestyle in the world that year, Manaudou won the gold medal in that event (which was the only event he entered). He thus became the first French gold-medalist of the men's 50-meter freestyle and the sixth French Olympic champion in an individual event. Swimming in lane 7 in the final, Manaudou had a time of 21.34 seconds, finishing ahead of second-place finisher Cullen Jones and third-place finisher César Cielo, the defending champion and world record holder, to win the gold medal. Manaudou's time was slightly slower than the Olympic record of 21.30 set by Cielo in 2008, but was an unofficial fastest time swam in textile (that is, not wearing a high-tech suit). Going into the final, Manaudou recorded a time of 22.09 in the heats and 21.80 in the semifinals. 2012 Short Course Competitions Following the Olympics, Manaudou competed at the 2012 European Short Course Championships and the 2012 World Short Course Championships held at the end of 2012. At the European Championships in Chartres, Manaudou won five gold medals including an individual title in the 50-meter freestyle with a time of 20.70. At the World Short Course Championships in Istanbul, Manaudou won one silver and bronze medal. In his specialty event, the 50-meter freestyle, Manaudou placed second behind Russian swimmer Vladimir Morozov (who he beat in Chartres) by three tenths of a second (0.33) with a time of 20.88. 2013 World Championships At the 2013 World Aquatics Championships in Barcelona, Manaudou won gold in the 4×100-meter freestyle relay with Yannick Agnel, Fabien Gilot, and Jérémy Stravius. Swimming the second leg, Manaudou recorded a time of 47.93 while the French team had an aggregated time of 3:11.18. In the 50-meter freestyle, Manaudou lead the heats and semifinals with times of 21.72 and 21.37. In the final however, he finished 5th with a time of 21.64. Manaudou also competed in the 50-meter butterfly and finished 8th with a time of 23.35. 2014 Manaudou won six medals at the 2014 World Short Course Championships (including three golds) and four gold medals at the 2014 European Aquatics Championships in Berlin. At the World Short Course Championships, Manaudou broke the first world records of his career in the 50-meter backstroke and freestyle. 2015 Manaudou won three gold medals at the 2015 World Aquatics Championships in Kazan, including the 50 m freestyle where he swam the fastest time ever in textile in 21.19. 2016 Summer Olympics Manaudou failed in his bid to qualify for the 2016 Olympic Games 100m freestyle when he only finished third at the French national championships held on April 1 in Montpellier. He had been hoping to pull off a 50m-100m freestyle double at the 2016 Olympic Games in Rio de Janeiro but his time of 48.10sec was bettered by Jérémy Stravius (47.97) and Clement Mignon (48.01). Only the top two finishers would qualify for the 2016 Olympic Games. Manaudou, the reigning Olympic/World/European champion in the 50m freestyle, had been the second fastest over the 100m freestyle this season. However, he qualified to represent France in the 50 m freestyle, where he won silver, and was part of the French 4 × 100 m freestyle team that also won silver. 2019 International Swimming League Manaudou swam with swim club Energy Standard as part of the inaugural season of the International Swimming League, co-captaining the team alongside Sarah Sjöström. He won races in freestyle, butterfly, and freestyle skins. 2020 Summer Olympics Manaudou qualified for the 50 metre freestyle at the 2020 Summer Olympics by winning the 50 metre freestyle at the FFN Golden Tour event 'Camille Muffat' in Marseille, France with a season-best time of 21.72 seconds. At the Olympic Games themselves, in Tokyo, Japan in 2021 due to the COVID-19 pandemic, he qualified second fastest from the prelims heats to the semifinals of the 50 metre freestyle with a time of 21.65 seconds. In the semifinals the next day, he lowered his time to 21.53 seconds, advancing to the final ranked second overall. In the final Manaudou won the silver medal ahead of bronze medalist Bruno Fratus of Brazil and behind gold medalist Caeleb Dressel of the United States with a time of 21.55 seconds, which marked the third-consecutive Olympic medal Manaudou had won in the 50 metre freestyle at the Olympic Games, after winning the gold medal in 2012 and the silver medal in 2016, then behind gold medalist Anthony Ervin of the United States. He also competed in the 4×100 metre freestyle relay where his relay team placed sixth in the final. 2023 At the 2023 Belgian Open Swimming Championships, held in April in Antwerp, Belgium, Manaudou won the gold medal in the 50 metre freestyle on day two with a 2023 World Aquatics Championships qualifying time of 21.98 seconds. The third and final day, he won a second gold medal, this time in the 50 metre butterfly with a World Championships qualifying time of 23.42 seconds. Two months later, he placed second in the 50 metre butterfly on the first day of the 2023 French Elite Swimming Championships in Rennes, finishing 0.38 seconds behind first-place finisher Maxime Grousset with a time of 23.44 seconds. Two days later, he achieved a time of 48.12 seconds in the preliminaries of the 100 metre freestyle to rank first before withdrawing from competing in the final. On day five, he won the gold medal and national title in the 50 metre freestyle with a 2023 World Aquatics Championships qualifying time of 21.62 seconds. Personal best times Awards SwimSwam Top 100 (Men's): 2021 (#25), 2022 (#77) Television Florent Manaudou has also appeared on TV series such as Vestiaires (France 2) and (TF1). In 2018, he appears on TV Series Section de recherches (TF1, season 12). See also List of world records in swimming List of European records in swimming List of French records in swimming World record progression 50 metres backstroke World record progression 50 metres freestyle Chronological summary of the 2012 Summer Olympics Chronological summary of the 2016 Summer Olympics Chronological summary of the 2020 Summer Olympics References External links 1990 births Living people Olympic swimmers for France Swimmers at the 2012 Summer Olympics Swimmers at the 2016 Summer Olympics Swimmers at the 2020 Summer Olympics Olympic gold medalists for France People from Villeurbanne French male backstroke swimmers French male breaststroke swimmers French male butterfly swimmers French male freestyle swimmers French people of Dutch descent Medalists at the FINA World Swimming Championships (25 m) Medalists at the 2012 Summer Olympics Medalists at the 2016 Summer Olympics Medalists at the 2020 Summer Olympics World record holders in swimming World Aquatics Championships medalists in swimming European Aquatics Championships medalists in swimming European champions for France Olympic silver medalists for France Olympic gold medalists in swimming Olympic silver medalists in swimming Sportspeople from Lyon Metropolis
Jack Dutton, (27 August 192829 November 2011) was a South African Army officer who served in the Korean War. Early life He was born in Tulbagh, Cape Province, and matriculated from Rondebosch Boys' High School in 1945. In 1947, he joined the Union Defence Forces. Military career In 1953, he was one of 12 officers sent to Korea where he was seconded to the Royal Tank Regiment. In 1964, he was appointed as Officer Commanding 1 Special Service Battalion. In 1968, he became Officer Commanding Eastern Province Command at the rank of Brigadier. He was then appointed Director of Armour. In 1973, he was promoted to major-general as Chief of Army Staff Operations from 1 July 1973. In 1976 he became Chief of Staff Operations with the rank of Lieutenant-general. Diplomatic service While still in the Army he was appointed South African ambassador to Chile. Awards and decorations Order of Bernardo O'Higgins References South African Army generals 1928 births 2011 deaths Ambassadors of South Africa to Chile Alumni of Rondebosch Boys' High School People from Tulbagh South African military personnel of the Korean War
An incomplete list of films produced in Brazil in the 1960s. For an A-Z list of films currently on Wikipedia see :Category:Brazilian films External links Brazilian film at the Internet Movie Database 1960s Brazilian Films
Bezerk 2.0 is a 2006 album by Welsh glam metal band Tigertailz, released on Demolition Records. It is seen as a follow-up to the original album Bezerk released on Music For Nations in 1990. It goes back to the more pop metal sound the band had at the time rather than the heavier sound they used on albums such as Banzai! and Wazbones. The album features similar artwork to the original Bezerk album. Track listing "Bezerk" (Instrumental) - 1:26 "Do It Up" - 3:33 "One Beat of Your Heart" - 4:05 "I Believe" - 5:25 "TVOD" - 3:30 "Falling Down" - 3:49 "Make Me Bleed" - 5:49 "Get Real" - 3:22 "Annie'z Gone" - 4:35 "For Hate'z Sake" - 5:37 "Sugar Fever" - 3:24 "Dirty Needlez" - 4:13 "Interview" (Bonus track) References Review: Bezerk 2.0, BBC Wales 2006 albums Tigertailz albums
Roscoea debilis is a perennial herbaceous plant found in Yunnan, China. Most members of the ginger family (Zingiberaceae), to which it belongs, are tropical, but R. debilis, like other species of Roscoea, grows in much colder mountainous regions. Description Roscoea debilis is a perennial herbaceous plant. Like all members of the genus Roscoea, it dies back each year to a short vertical rhizome, to which are attached the tuberous roots. When growth begins again, "pseudostems" are produced: structures which resemble stems but are actually formed from the tightly wrapped bases (sheaths) of its leaves. Plants are usually tall, occasionally as short or as tall as . It has five to seven leaves. The first two or three consist only of pinkish brown sheaths; the remaining leaves have blades usually long by wide. The blades are narrowed at the base, appearing to form a stalk. At the junction of the blade and sheath there is a small pinkish brown ligule, extending to about . Flowers appear in June to August in the wild. The stem (peduncle) of the flower spike (inflorescence) is either held within the leaf sheaths or sometimes slightly extended from them. One to three flowers open together and are purple, red or white. The narrow bracts which subtend the flowers are long, longer than the calyx. Each flower has the typical structure for Roscoea (see the diagrams in that article). There is a tube-shaped outer calyx, long, with a two-lobed apex. Next the three petals (the corolla) form a tube, longer than the calyx at , terminating in three lobes, a hooded upright central lobe, about long and two similarly sized side lobes. Inside the petals are structures formed from four sterile stamens (staminodes): two lateral staminodes form what appear to be small upright petals, which are about long with a narrowed base; two central staminodes are fused to form a lip or labellum, long by about wide. The labellum bends slightly downwards and has a narrowed base for about 5–6 mm (0.2 in) after which there are some white lines. It is split into two narrow lobes at the end. The single functional stamen has a white anther, about long, with long spurs formed from the connective tissue between the two capsules of the anther. The ovary is long. Taxonomy Roscoea debilis was first described scientifically by François Gagnepain in a publication which appeared in 1902. The specific epithet debilis means "weak"; Gagnepain described it as "remarkable for its slenderness". Two varieties are recognized. R. debilis var. debilis has leaf blades which are softly hairy (pubescent) on the underside; in R. debilis var. limprichtii they are hairless (glabrous). Evolution and phylogeny The family Zingiberaceae is mainly tropical in distribution. The unusual mountainous distribution of Roscoea may have evolved relatively recently and be a response to the uplift taking place in the region in the last 50 million years or so due to the collision of the Indian and Asian tectonic plates. Species of Roscoea divide into two clear groups, a Himalayan clade and a "Chinese" clade (which includes some species from outside China). The two clades correspond to a geographical separation, being divided by the Brahmaputra River as it flows south at the end of the Himalayan mountain chain. It has been suggested that the genus may have originated in this area and then spread westwards along the Himalayas and eastwards into the mountains of China and its southern neighbours. R. debilis falls into the area of distribution of the Chinese clade, although it was not included in the analysis by Ngamriabsakul et al. Distribution and habitat Roscoea debilis occurs in Yunnan, China, growing at altitudes of in grassland. References debilis Endemic flora of Yunnan Plants described in 1902