text
stringlengths 1
22.8M
|
|---|
```xml
// See LICENSE.txt for license information.
import {Model} from '@nozbe/watermelondb';
import {field} from '@nozbe/watermelondb/decorators';
import {MM_TABLES} from '@constants/database';
import type CustomEmojiModelInterface from '@typings/database/models/servers/custom_emoji';
const {CUSTOM_EMOJI} = MM_TABLES.SERVER;
/** The CustomEmoji model describes all the custom emojis used in the Mattermost app */
export default class CustomEmojiModel extends Model implements CustomEmojiModelInterface {
/** table (name) : CustomEmoji */
static table = CUSTOM_EMOJI;
/** name : The custom emoji's name*/
@field('name') name!: string;
}
```
|
In the early colonial history of the United States, higher education was designed for men only. Since the 1800s, women's positions and opportunities in the educational sphere have increased. Since the late 1970s and early 1980s, women have surpassed men in number of bachelor's degrees and master's degrees conferred annually in the United States and women have continuously been the growing majority ever since, with men comprising a continuously lower minority in earning either degree. The same asymmetry has occurred with Doctorate degrees since 2005 with women being the continuously growing majority and men a continuously lower minority.
Statistics
Since the early 1970s, women have surpassed men in terms of college enrollment and graduation rates.
According to Ellen DuBois and Lynn Dumenil, they estimate that the number of bachelor and doctorate degrees from 1950 to 1980 for women are:
The statistics for enrollment of women in higher education in the 1930s varies depending upon the type of census performed in that year.
According to the U.S. Office of Education, the total number of enrollment for women in higher education the U.S. in 1930 was 480,802. This information was gathered by the U.S. Office of Education on a biannual basis, and reflects an estimate for the academic year (Fall 1929 - Spring 1930).
The U.S. Department of Commerce and Bureau of the Census performed a preliminary estimate for the same year (1930) of women in higher education in the U.S. The total number was 481,000 enrolled. This estimate was based on a calendar year census, in contrast to the academic year estimate performed by the U.S. Office of Education in the same year.
Surpassing equality and overrepresentation
Total undergraduate degree figures show that females outnumbered their male counterparts for the first time in the late 1970s. However, since 1981, women have steadily been outpacing men in bachelor's degrees earned, from only a 1% lead in 1980 to 33% advantage in 2015. Which means for every 100 males that graduate, 134 women do, however women have an additional privilege, "5,864 verified private scholarships, showed that there are 4 times as many scholarships specifically designated for women as opposed to those for men.".
Graph of Degree Attainment over time
History
Colonial
In Colonial America elementary education was widespread in New England, but limited elsewhere. New England Puritans believed it was necessary to study the Bible, so boys and girls were taught to read at an early age. It was also required that each town pay for a primary school. About 10 percent enjoyed secondary schooling. Few girls attended formal schools, but most were able to get some education at home or at so-called "Dame schools" where women taught basic reading and writing skills in their own houses. By 1750, nearly 90% of New England's women and almost all of its men could read and write. There was no higher education for women.
Tax-supported schooling for girls began as early as 1767 in New England. It was optional and some towns proved reluctant. Northampton, Massachusetts, for example, was a late adopter because it had many rich families who dominated the political and social structures and they did not want to pay taxes to aid poor families [requires citation]. Northampton assessed taxes on all households, rather than only on those with children, and used the funds to support a grammar school to prepare boys for college. Not until after 1800 did Northampton educate girls with public money. In contrast, the town of Sutton, Massachusetts, was diverse in terms of social leadership and religion at an early point in its history. Sutton paid for its schools by means of taxes on households with children only, thereby creating an active constituency in favor of universal education for both boys and girls.
Historians point out that reading and writing were different skills in the colonial era. School taught both, but in places without schools reading was mainly taught to boys and also a few privileged girls. Men handled worldly affairs and needed to read and write. Girls only needed to read (especially religious materials). This educational disparity between reading and writing explains why the colonial women often could read, but could not write and could not sign their names—they used an "X".
Across the South, there was very little public schooling. Most parents either home schooled their children using peripatetic tutors or sent them to small local private schools. A study of women's signatures in Georgia indicates a high degree of literacy in areas with schools. In South Carolina, scores of school projects were advertised in the South Carolina Gazette beginning in 1732.
Early colonial ideology
Ideologies held by the majority of early colonial society regarding women's access to education contributed greatly to the lack of opportunity for education among these women. Seventeenth-century attitudes did not stress significant importance on women's education, as evidenced by early opinions in the New England colonies. This majority also considered their access to education as unnecessary or dangerous, as their commonly held roles as mothers prevented society from seeing other possible abilities that would demand a need for education. The primary source of respect among these colonial New England women derived from their completion of domestic tasks, not a desire for or fulfillment of intellectual practices.
Structurally, men undoubtedly held a much greater position of power and control than women, as proves true historically. As a result of this imbalance, an inferior perspective to which women became viewed under carried over into intellectual opportunities. Overall, their abilities were not considered level with those of their male counterparts, so no pressing need to further develop their intellect was acknowledged.
However, as samplers and penbooks show,, female children developed basic literacy. Most mothers were able to teach young children at home, and women like Anne Bradstreet and Philis Wheatley wrote published poetry. Samuel Sewall's diary references describe his children, boys and girls alike, taking turns reading Scriptures at night, and being praised equally for doing well. The 1770 diarist Anne Winslow Green wrote to tell her mother that her Aunt Deeming was quite literate, correcting her letters home; this same woman later recounted her own appeals for aid when, as a Tory during the American Revolutionary War, she tried to escape with a carriage of furniture and other belongings after the Siege of Boston was lifted. But resistance to the admission of upper levels of education persisted.
These public attitudes that did not recognize a need for women's education eventually changed. The number of advocates for women's improved access to educational institutions grew gradually. New England's town school in Farmington, Connecticut saw a push for the school to include young girls as well as boys by a minority of people in 1687, a battle which would then extend into the next few centuries.
19th century
In the first half of the 19th century, only a minority of American children, both girls and boys, spent any meaningful time in a classroom. An even smaller minority received any secondary education.
Emma Willard
Emma Willard (1787-1870), was a New York educator and writer who dedicated her life to women's education. She worked in several schools and founded the first school for women's higher education, the Troy Female Seminary in Troy, New York, which is now Emma Willard School. With the success of her school, she was able to travel across the country and abroad, to promote education for women. Willard pioneered the teaching of science, mathematics, and social studies to young women. She believed in establishing her own guidelines for better education for women, and her book proceeds helped improve female education throughout the world. Willard coauthored one of the most widely used textbooks of American history, as well as the first historical atlas of the U.S. The maps, graphs, and pictures added the details of the nation's geography into the broad popular image of the country as a large, powerful complex nation. Republican motherhood idealized a "ladylike atmosphere" and "cultivation". Willard's Female Seminary became a much copied modeled in part because it helped young women fit into their "place in society". She thought the notion of female college graduates "absurd". Elizabeth Cady Stanton, a graduate of Willard's Seminary, was resentful of this attitude, a formative experience that contributed to her feminist activism in later life.
Colleges for women
At the college level, a few private schools followed Oberlin's 1833 example of enrolling women, but notably the state schools restricted admission to men.
The second half of the 19th century, on the other hand, produced relatively rapid gains for women's education in the United States. The founding of Vassar in 1865 was followed by Wellesley in 1875, Smith in the same year, Bryn Mawr in 1885, Radcliffe in 1879, and Barnard in 1889. Such institutions were fed by a steady stream of female high school graduates, who throughout this period comprised a majority of graduates. High school enrollment trebled in the 1890s, with girls continuing to represent the lion's share. The expansion of both secondary and tertiary public education that began in 1867 and lasted until the early 20th century created greater opportunities for women. Between 1867 and 1915, 304 new colleges and universities were established, bringing the American total to 563 such institutions. On the liberal arts faculties of state colleges such as Colorado, Iowa, Kansas, Minnesota, Nebraska, Texas, and Washington, women outnumbered men; indeed, the president of the University of Wisconsin was urging quota restrictions.
20th century
Coinciding with the beginnings of the first wave of feminism in the 20th century came the attempt by women to gain equal rights to education in the United States. After long battles against gender oppression women finally obtained the right to be educated through several government acts/conventions, the opening of facilities willing to educate them, and the opportunity to continue into higher education.
Before the education reform that occurred during the Progressive Era, boys and girls often had different course programs of study. It was not uncommon for girls to be educated towards the jobs society deemed appropriate, such as secretary, journalist, or social-service worker. The idea of a "differentiated curriculum" between boys and girls was common throughout schools in the United States. This caused the high school education system to become a more "efficient site for the construction of gender". During this time, there was a push to make women a better "domesticated citizen" rather than a scholar. The voices of many women were just beginning to be heard in society as well as the education system, but there was still opposition from some as to the credibility of their words. Girls of different races and ethnicities were also entering the public school system at this time. Often, the course of scholarly study was impacted by the race of the individual.
1930s
The 1930s marked great economic hardship with the onset of the decade-long Great Depression in late 1929. A college major had to be a practical one in terms of the job hunt. How to justify college expenses became very real for women and their families. A study in 1924 that surveyed nearly sixteen-hundred woman PhD recipients concluded that seventy percent required grants, scholarships, and fellowships in order to cover the expense associated with earning a higher degree. Despite the financial support, the majority of these women were required to save money for years before pursuing their degrees because the aid was never enough. Despite these disadvantages, the 1930s marked the peak of woman PhD earners. These degrees varied in fields and began to legitimize fields for women that were once off-limits.
The "self-support" that these women engaged in to help finance their education became a widely accepted necessity. Both men and women were forced to find ways of supporting their education at this period of time. To help lessen the financial burden faced by families trying to educate their children, the National Youth Administration was created by the United States Government. Between 1935 and 1943, the NYA spent nearly 93 million dollars providing financial assistance. Despite the growing increasing opportunities for women in education, there was a constant need to justify the expense. As the number of college graduates increased, those who were displaced during the Great Depression had to compete with a younger and more-educated group of people.
Controversies
Education was a controversial topic in the 1930s, " and sex-segregated school systems protected "the virtue of female high school students." ." Home economics and industrial education were new elements of the high school curriculum unmistakably designed for women's occupations. These classes taught women practical skills such as sewing, cooking, and using the new domestic inventions of the era; unfortunately, this "formal training offered women little advantage in the struggle for stable work at a liveable wage."
The 1930s also saw tremendous changes in women's education at the college level. In 1900, there were 85,338 female college students in the United States and 5,237 earned their bachelor's degrees; by 1940, there were 600,953 female college students and 77,000 earned bachelor's degrees. This increase was partially explained by the "contemporary discourse that reinforced the need for higher education for women in their positions as wives, mothers, citizens, and professionals."
Because the proper role for a white, middle-class woman in 1930s American society was that of wife and mother, arguments in favor of women's education emphasized concepts of eugenics and citizenship. Education showed women how to exercise their civic responsibilities, and it showed them the importance of the vote. Participation in student government trained women "early to become leaders later." One study showed that in 1935, 62 percent of women college graduates voted compared to only 50 percent of women who did not attend college.
The basic assumption in the 1930s was that women should marry. There was also the perception that college educated women were less likely to marry, either because they "waited too long" or because the college experience which broadened their minds deluded them into believing "marriage should be between equals." Others argued college made women better wives and mothers because it "imparted practical skills."
The 1930s also marked the 10th anniversary of Women's suffrage in the United States. Despite earning the right to vote, women were still largely refused any role in positions of political power that allow them to make political change for their gender. Despite growing numbers of women graduates, many were denied positions that they were qualified for in favor of men. This struggle sparked new examples of political activism and increased support for an Equal Rights Amendment.
Areas of study
Teaching and nursing were the top two fields for women throughout the 1930s, but home economics also experienced a great surge in popularity during the Depression. Home economics brought a scientific language to the traditional women's sphere of the home and raised "homemaking to the status of a respectable--though definitely female--occupation." Social work, child development, and nursery school educational programs were also popular.
In addition to this strong vocational orientation in American education during the opening decades of the twentieth century, women began to make slow inroads into traditionally male dominated areas of education such as business, science, medicine, architecture, engineering, and law. Women were also able to gain positions of responsibility within the federal government because of the watershed events of the New Deal.
Women's colleges
Prior to the American Civil War few colleges admitted women. Founded in 1772 as a primary school, Salem College is the oldest female educational establishment. However, it did not award college degrees until 1890.
Some were founded as co-educational institutions; Oberlin Collegiate Institute, after 1850 Oberlin College, founded in 1833, was the first college to accept both women and African Americans as students.
Other early coeducational schools included Hillsdale College, founded as Michigan Central College in Spring Arbor, Michigan in 1844, the short-lived New-York Central College in McGraw, New York (1849–1860), and Antioch College, founded by noted educator Horace Mann in 1852 in Yellow Springs, Ohio. Hollins University, founded as the co-educational Valley Union Seminary in Roanoke, Virginia, in 1842; it became all female in 1852;
A number of colleges were founded before the Civil War with all-female student bodies, including (among others, in addition to Salem): Mount Holyoke College of South Hadley, Massachusetts, founded in 1837 by Mary Lyon as Mount Holyoke Female Seminary; Wesleyan College of Macon, Georgia, founded in 1836 as Georgia Female College, and is the first college in the world chartered to grant degrees to women; Queens College (now Queens University) of Charlotte, North Carolina, founded in 1857 as Charlotte Female Institute; Averett College (now Averett University) of Danville, Virginia, founded in 1859 as Union women's College; and Vassar College, founded in Poughkeepsie, New York in 1861.
With the start of the war many males were in uniform so more opportunities arose for women to fill the empty space in schools and the universities became more willing to admit the women. Slowly more educational institutions opened their doors to women; today, there are 60 women's colleges in the United States offering educational programs that parallel co-educational universities both in subject matter and in quality.
Government action
In 1848 the Seneca Falls Convention was held in New York to gain support for education and suffrage but it had little immediate impact. This convention is significant because it created a foundation for efforts toward equal education for women, even though it was not actually achieved until much later.
The Morrill Land-Grant Colleges Act of 1862 founded universities to educate both men and women in practical fields of study, though women's courses were still centered around home economics. By 1870 30% of colleges were co-educational, later in the 1930s women-only colleges were established that expanded opportunities for courses of study to include more intellectual development as opposed to domestic instruction.
In July 1975 "Title IX regulations became effective as law" (Margaret Fund of NWLC, 2012). The law provided one year for compliance to elementary schools and three years for compliance to high schools and post secondary institutions. Through the 1970s the law's enactment, opposition towards the legislation, and initial compliance for the law were the focus. According to the Margaret Fund (2012), in 1982 a court case was won upholding the nondiscriminatory acts in employment, the case title is as follows, 1982 North Haven Bd. of Ed. v. Bell, 456 U.S. 512 (1982). In 1984, the case Grove City v. Bell, 465 U.S. 555 (1984) a, "U.S. Supreme Court decision held that federal spending clause statutes only apply to those programs or activities that receive direct federal financial assistance, effectively ending Title IX applicability to athletics" (Margaret Fund of NWLC). This decision is later remedied in the late 1980s by the Civil Rights Restoration Act of 1987. In 1988, this act was passed by Congress and reversed the damage from the Grove City v. Bell decision. The Margaret Fund (2012) states, "It over-rode the Grove City v. Bell decision by expanding the definition of program or activity that receives Federal financial assistance" (Margaret Fund of NWLC, para.5). During the 1990s three significant changes or continuations to the law were made in the course of the decade. First, a Supreme Court decision allowed an individual to sue for monetary retributions by citing the Title IX Act. Second, the disclosure act in 1994 stated that all institutions under Title IX were to report publicly on their operations, with an effective implementation date set for 1996. Third, the ORC distributed requirements to institutions and schools which are explained and outlined more clearly the regulations for Title IX. The significant events in the 2000s allow schools to use e-mail surveys, and due to a Supreme Court case in 2009, lawsuits on the basis of sexual discrimination under Title IX can be brought by parents.
Timeline
1727: Founded in 1727 by the Sisters of the Order of Saint Ursula, Ursuline Academy, New Orleans, enjoys the distinction of being both the oldest continuously operating school for girls and the oldest Catholic school in the United States.
1742: Moravians in Pennsylvania established the first all-girls boarding school in America, the Bethlehem Female Seminary to serve the Moravian community in and near Bethlehem. In 1863 it became a college. In 1913 it became Moravian Seminary and College for Women. Historians accept Moravian as the oldest—though not continuously operational because of its current co-ed status—specifically female institute of higher learning in the United States.
1772: Salem Academy and College began as a school for young girls in 1772 in the Moravian town of Salem, North Carolina which had been established just six years earlier by Moravian missionaries. It is the oldest educational institution for both girls and women in the United States.
1783: Washington College in Chestertown, Maryland, appointed the first women instructors at any American college. Elizabeth Callister Peale and Sarah Callister taught painting and drawing.
1803: Bradford Academy in Bradford, Massachusetts was the first higher educational institution to admit women in Massachusetts. It was founded as a co-educational institution, but became exclusively for women in 1837.
1826: The first American public high schools for girls were opened in New York and Boston.
1828: The South Carolina Female Collegiate Institute was founded in Columbia, South Carolina.
1829: The first public examination of an American girl in geometry was held.
1831: As a private institution in 1831, Mississippi College became the first coeducational college in the United States to grant a degree to a woman. In December 1831 it granted degrees to two women, Alice Robinson and Catherine Hall.
Ingham University in Le Roy, New York, was the first women's college in New York State and the first chartered women's university in the United States. It was founded in 1835 as the Attica (NY) Female Seminary by Mariette and Emily E. Ingham, who moved the school to Le Roy in 1837. The school was chartered on April 6, 1852 as the Ingham Collegiate Institute, and a full university charter was granted in April 1857. After financial difficulties, the college closed in 1892 and its property was sold at auction in 1895.[1] Over several years, the college's former buildings were demolished; the stone from the Arts Conservatory, the last campus building to be dismantled, was used to build the Woodward Memorial Library at the same location in Le Roy.[2]
Ingham University was the alma mater of Sarah Frances Whiting, who later founded the physics department and establish the astronomical observatory at Wellesley College.[3]
1836: Georgia Female College (now Wesleyan College), Macon, Georgia: It is the oldest (and the first) school which was established from inception as a full college for women offering the same education as men. Awarded the first known baccalaureate degree to a woman.
1837: Bradford Academy in Bradford, Massachusetts, due to declining enrollment, became a single-sexed institution for the education of women exclusively.
1837: Mount Holyoke College, first called Mount Holyoke Seminary, was founded by Mary Lyon in South Hadley, Massachusetts.
1844: Margaret Fuller is the first woman permitted to use the Harvard College library
1849: Elizabeth Blackwell, born in England, became the first woman to earn a medical degree from an American college, Geneva Medical College in New York.
1850: Lucy Sessions earned a literary degree from Oberlin College, becoming the first African American woman in the United States to receive a college degree.
1851: The Adelphean Society, now called Alpha Delta Pi Women's Fraternity, was founded at Wesleyan Female College in Macon, Georgia and became the first secret society for women.
1855: The University of Iowa becomes the first coeducational public or state university in the United States.
1858: Mary Fellows became the first woman west of the Mississippi River to receive a baccalaureate degree (from Cornell College).
1862: Mary Jane Patterson became the first African-American woman to earn a BA in 1862. She earned her degree from Oberlin College.
1863: Mary Corinna Putnam Jacobi graduated from the New York College of Pharmacy in 1863, which made her the first woman to graduate from a United States school of pharmacy.
1864: Rebecca Crumpler became the first African-American woman to graduate from a U.S. college with a medical degree and the first and only African-American woman to obtain the Doctress of Medicine degree from New England Female Medical College in Boston, MA.
1866: Lucy Hobbs Taylor became the first American woman to earn a dental degree, which she earned from the Ohio College of Dental Surgery.
1866: Sarah Jane Woodson Early became the first African-American woman to serve as a professor. Xenia, Ohio's Wilberforce University hired her to teach Latin and English in 1866.
1869: Fanny Jackson Coppin was named principal of the Institute for Colored Youth in Philadelphia, becoming the first African-American woman to head an institution for higher learning in the United States.
1870: Ada Kepley became the first American woman to earn a law degree, from Northwestern School of Law.
1870: Ellen Swallow Richards became the first American woman to earn a degree in chemistry, which she earned from Vassar College in 1870.
1871: Frances Elizabeth Willard became the first female college president in the United States, as president of Evanston College for Ladies in Illinois.
1871: Harriette Cooke became the first woman college professor in the United States appointed full professor with a salary equal to her male peers.
1871: Japanese women are allowed to study in the USA (though not yet in Japan itself).
1873: Linda Richards became the first American woman to earn a degree in nursing.
1877: Helen Magill White became the first American woman to earn a Ph.D., which she earned at Boston University in the subject of Greek.
1878: Mary L. Page became the first American woman to earn a degree in architecture, which she earned from the University of Illinois, Urbana-Champaign.
1879: Mary Eliza Mahoney became the first African-American in the U.S. to earn a diploma in nursing, which she earned from the School of Nursing, New England Hospital for Woman and Children in Boston.
1881: American Association of University Women founded.
1883: Susan Hayhurst became the first woman to receive a pharmacy degree in the United States, which she received from the Philadelphia College of Pharmacy.
1886: Winifred Edgerton Merrill became the first American woman to earn a PhD in mathematics, which she earned from Columbia University.
1889: Maria Louise Baldwin became the first African-American female principal in Massachusetts and the Northeast, supervising white faculty and a predominantly white student body at the Agassiz Grammar School in Cambridge.
1889: Susan La Flesche Picotte became the first Native American woman to earn a medical degree, which she earned from Woman's Medical College of Pennsylvania.
1890: Ida Gray became the first African-American woman to earn a Doctor of Dental Surgery degree, which she earned from the University of Michigan.
1892: Laura Eisenhuth became the first woman elected to state office as Superintendent of Public Instruction.
1894: Margaret Floy Washburn became the first woman to be officially awarded the PhD degree in psychology, which she earned at Cornell University under E. B. Titchener.
Late 1800s, exact date unknown: Anandibai Joshi from India, Keiko Okami from Japan, and Sabat Islambouli from Syria became the first women from their respective countries (and in Joshi's case the first Hindu woman) to get a degree in western medicine, which they each got from the Women's Medical College of Pennsylvania (WMCP), where they were all students in 1885.
1900: Otelia Cromwell became the first African-American woman to graduate from Smith College in Northampton, Massachusetts.
1903: Mignon Nicholson became the first woman in North America to earn a veterinary degree, which she earned from McKillip Veterinary College in Chicago, Illinois.
1904: Helen Keller graduated from Radcliffe, becoming the first deafblind person to earn a Bachelor of Arts degree.
1905: Nora Stanton Blatch Barney, born in England, became the first woman to earn a degree in any type of engineering in the United States, which she earned from Cornell University. It was a degree in civil engineering.
1908: Alpha Kappa Alpha sorority, the first African-American Greek letter organization for woman, was founded at Howard University.
1909: Ella Flagg Young became the first female superintendent of a large city school system.
1915: Lillian Gilbreth earned a PhD in industrial psychology from Brown University, which was the first degree ever granted in industrial psychology. Her dissertation was titled "Some Aspects of Eliminating Waste in Teaching".
1917: Sigma Delta Tau sorority, a Jewish women's Greek letter organization was founded at Cornell University in response to antisemitism.
1918: The College of William & Mary admitted 24 women to the entering undergraduate class.
1921: Sadie Tanner Mossell became the first African-American woman to earn a Ph.D. in the U.S. when she earned a Ph.D. in Economics from the University of Pennsylvania
1922: Sigma Gamma Rho sorority was founded. It was the fourth African-American Greek letter organization for women, and the first African-American sorority established on a predominantly white campus, Butler University in Indianapolis, Indiana.
1922: Lorna Myrtle Hodgkinson became the first woman to earn a Ph.D. from Harvard, which she earned in education.
1923: Virginia Proctor Powell Florence became the first African-American woman to earn a degree in library science. She earned the degree in 1923 from the Carnegie Library School, which later became part of the University of Pittsburgh.
1925: Zora Neale Hurston became the first African-American woman to be admitted to Barnard college.
1926: Dr. May Edward Chinn became the first African-American woman to graduate from the University and Bellevue Hospital Medical College.
1929: Jenny Rosenthal Bramley, born in Moscow, became the first woman to earn a Ph.D. in physics in the United States, which she earned from New York University.
1931: Jane Matilda Bolin was the first African-American woman to graduate from Yale Law School.
1932: Dorothy B. Porter became the first African-American woman to earn an advanced degree in library science (MLS) from Columbia University.
1933: Inez Beverly Prosser became the first African-American woman to earn a PhD in psychology, which she earned from the University of Cincinnati.
1934: Ruth Winifred Howard became the second African-American woman in the United States to receive a Ph.D. in psychology, which she earned from the University of Minnesota.
1935: Jesse Jarue Mark became the first African American woman to earn a Ph.D. in botany, which she earned at Iowa State University.
1936: Flemmie Kittrell became the first African American woman to earn a Ph.D. in nutrition, which she earned at Cornell University.
1937: Anna Johnson Julian became the first African-American woman to receive a Ph.D. in sociology from the University of Pennsylvania.
1940: Roger Arliner Young became the first African-American woman to earn a Ph.D. in zoology, which she earned from the University of Pennsylvania. Marion Thompson Wright became the first African-American woman in the United States to earn a Ph.D. in History, which she earned at Columbia University.
1941: Ruth Lloyd became the first African-American woman to earn a Ph.D. in anatomy, which she earned from Western Reserve University.
1941: Merze Tate became the first African American woman to earn a Ph.D. in government and international relations from Harvard University.
1942: Margurite Thomas became the first African American woman to earn a Ph.D. in geology, which she earned from Catholic University.
1943: Euphemia Haynes became the first African-American woman to earn a Ph.D. in Mathematics, which she earned from Catholic University.
1945: Harvard Medical School admitted women for the first time.
1947: Marie Maynard Daly became the first African-American woman to earn a Ph.D. in chemistry, which she earned from Columbia University.
1949: Joanne Simpson (formerly Joanne Malkus, born Joanne Gerould) was the first woman in the United States to receive a Ph.D. in meteorology, which she received in 1949 from the University of Chicago.
1951: Maryly Van Leer Peck, became Vanderbilt University's first chemical engineer graduate. Peck also became the first woman to receive an M.S. and a Ph.D. in chemical engineering from the University of Florida.
1952: Georgia Tech's president Blake R. Van Leer admitted the first women to the school and his wife Ella Wall Van Leer setup support groups for future female engineers.
1962: Martha Bernal, who was born in Texas, became the first Latina to earn a PhD in psychology, which she earned in clinical psychology from Indiana University Bloomington.
1963: Grace Alele-Williams became the first Nigerian woman to earn any doctorate when she earned her Ph.D. in Mathematics Education from the University of Chicago.
1965: Sister Mary Kenneth Keller (1914? – 1985) became the first American woman to earn a PhD in Computer Science, which she earned at the University of Wisconsin–Madison. Her thesis was titled "Inductive Inference on Computer Generated Patterns."
1972: Title IX was passed, making discrimination against any person based on their sex in any federally funded educational program(s) in America illegal.
1972: Willie Hobbs Moore became the first African-American woman to earn a Ph.D. in Physics, which she earned from the University of Michigan.
1975: In 1975, Lorene Rogers became the first woman named president of a major research university, The University of Texas.
1975: On July 1, 1975, Jeanne Sinkford became the first female dean of a dental school when she was appointed the dean of Howard University, School of Dentistry.
1976: U.S. service academies (US Military Academy, US Naval Academy, US Air Force Academy and the US Coast Guard Academy) first admitted women in 1976.
1977: The American Association of Dental Schools (founded in 1923 and renamed the American Dental Education Association in 2000) had Nancy Goorey as its first female president in 1977.
1977–1978: For the first time, more associate degrees are conferred on women than men in the United States. More associate degrees have been conferred on women every year since.
1979: Christine Economides became the first American woman to earn a PhD in petroleum engineering, which she earned from Stanford University.
1979: Jenny Patrick became the first African-American woman in the United States to earn a Ph.D. in chemical engineering, which she earned from the Massachusetts Institute of Technology.
1980: Women and men were enrolled in American colleges in equal numbers for the first time.
1981–1982: For the first time, more bachelor's degrees are conferred on women than men in the United States. More bachelor's degrees have been conferred on women every year since.
1982: Mississippi University for Women v. Hogan, 458 U.S. 718 (1982) was a case decided 5–4 by the Supreme Court of the United States. The court held that the single-sex admissions policy of the Mississippi University for Women violated the Equal Protection Clause of the Fourteenth Amendment to the United States Constitution.
1982: Judith Hauptman earned her PhD in Talmudic studies from the Jewish Theological Seminary of New York, thus making her the first woman to earn a PhD in Talmud.
1983: Christine Darden became the first African-American woman in the U.S. to earn a Ph.D. degree in mechanical engineering, which she earned from George Washington University.
1984: The U.S. Supreme Court's 1984 ruling Grove City College v. Bell held that Title IX applied only to those programs receiving direct federal aid. The case reached the Supreme Court when Grove City College disagreed with the Department of Education's assertion that it was required to comply with Title IX. Grove City College was not a federally funded institution; however, they did accept students who were receiving Basic Educational Opportunity Grants through a Department of Education program. The Department of Education's stance was that, because some of its students were receiving federal grants, the school was receiving federal assistance and Title IX applied to it. The Court decided that since Grove City College was only receiving federal funding through the grant program, only that program had to be in compliance. The ruling was a major victory for those opposed to Title IX, as it made many institutions' sports programs outside of the rule of Title IX and, thus, reduced the scope of Title IX.
1986–1987: For the first time, more master's degrees are conferred on women than men in the United States. More master's degrees have been conferred on women every year since.
1987: Johnnetta Cole became the first African-American president of Spelman College.
1988: The Civil Rights Restoration Act was passed in 1988 which extended Title IX coverage to all programs of any educational institution that receives any federal assistance, both direct and indirect.
1994: Judith Rodin became the first permanent female president of an Ivy League University (specifically, the University of Pennsylvania.)
1994: In 1994, the Equity in Athletics Disclosure Act, sponsored by congresswoman Cardiss Collins, required federally assisted higher education institutions to disclose information on roster sizes for men's and women's teams, as well as budgets for recruiting, scholarships, coaches' salaries, and other expenses, annually.
1996: United States v. Virginia, , was a landmark case in which the Supreme Court of the United States struck down the Virginia Military Institute (VMI)'s long-standing male-only admission policy in a 7–1 decision. (Justice Clarence Thomas, whose son was enrolled at VMI at the time, recused himself.)
2001: Ruth Simmons became the eighteenth president of Brown University, which made her the first African-American woman to lead an Ivy League institution.
2004–2005: For the first time, more doctoral degrees are conferred on women than men in the United States. More doctoral degrees have been conferred on women every year since. As of 2011, among adults 25 and older, 10.6 million U.S. women have master's degrees or higher, compared to 10.5 million men. Measured by shares, about 10.2 percent of women have advanced degrees compared to 10.9 percent of men—a gap steadily narrowing in recent years. Women still trail men in professional subcategories such as business, science and engineering, but when it comes to finishing college, roughly 20.1 million women have bachelor's degrees, compared to nearly 18.7 million men—a gap of more than 1.4 million that has remained steady in recent years.
2006: On November 24, 2006, the Title IX regulations were amended to provide greater flexibility in the operation of single-sex classes or extracurricular activities at the primary or secondary school level.
See also
Women's colleges in the United States
Timeline of women's colleges in the United States
List of girls' schools in the United States
Educational Inequality
Education in the United States
Coeducation
History of education in the United States
Female seminary
References
Further reading
Bush, V. Barbara, et al. eds. From diplomas to doctorates : the success of black women in higher education and its implications for equal educational opportunities for all (2009) online
Eisenmann, Linda. Historical Dictionary of Women's Education in the United States (1998) online
Evans, Stephanie Y. Black women in the ivory tower, 1850-1954 : an intellectual history (2008) online, in higher education
Gordon, Lynn D. Gender and Higher Education in the Progressive Era (1990).
Guy-Sheftall, Beverly. "Black Women and Higher Education: Spelman and Bennett Colleges Revisited." The Journal of Negro Education, Vol. 51, No. 3, The Impact of Black Women in Education: An Historical Overview (Summer, 1982), pp. 278–287.
Hannum, Kelly M., et al. "Women leaders within higher education in the United States: Supports, barriers, and experiences of being a senior leader." Advancing Women in Leadership Journal 35 (2015): 65-75. online
Hine, Darlene Clark, ed. Black Women in America: An Historical Encyclopedia (2 vols. 1993).
Hobbs, Catherine, ed. Nineteenth-Century Women Learn to Write (1995).
Horowitz, Helen Lefkowitz. Alma Mater: Design and Experience in the Women's Colleges from Their Nineteenth-Century Beginnings to the 1930s (1984).
Kornbluh, Joyce, and Mary Frederickson, eds. Sisterhood and Solidarity: Workers' Education for Women, 1914–1984 (1984).
Lasser, Carol, ed. Educating Men and Women Together: Coeducation in a Changing World (1987).
Murphy, Marjorie. Blackboard Unions: The AFT and the NEA, 1900–1980 (1990).
Oates, Mary J., ed. Higher Education for Catholic Women: An Historical Anthology (Garland, 1987).
Rossiter, Margaret W. "Doctorates for American Women, 1868-1907". History of Education Quarterly 22, no. 2 (Summer): 159–183.
Rury, John L. Education and Women's Work: Female Schooling and the Division of Labor in Urban America, 1870–1930 (1991).
Sicherman, Barbara, and Carol Hurd Green, eds. Notable American Women: The Modern Period (4 vol. Belknap Press, 1980).
Solomon, Barbara Miller. In the Company of Educated Women: A History of Women and Higher Education in America (1985). online
Walch, Timothy. Parish School: American Catholic Parochial Education from Colonial Times to the Present (1996).
Woody, Thomas. A History of Women's Education in the United States (2 vols. 1929) vol 1 online also see vol 2 online
Wyman, Andrea. Rural women teachers in the United States (1997) online
Historiography
Eisenmann, Linda. “Reconsidering a Classic: Assessing the History of Women's Higher Education a Dozen Years after Barbara Solomon.” Harvard Educational Review, 67 (Winter 1997): 689–717.
Nash, Margaret A. "The historiography of education for girls and women in the United States." in William J Reese, William J. and John J. Rury, eds. Rethinking the History of American Education (2008) pp 143–159. excerpt
McClelland, Averil Evans. The education of women in the United States: A guide to theory, teaching, and research (Routledge, 2014).
Seller, Maxine Schwartz, ed. Women Educators in the United States, 1820–1993: A BioBibliographic Sourcebook (Greenwood Press, 1994).
External links
"Married Teachers" Los Angeles Herald, March 16, 1900—editorial arguing against employment of married teachers in Los Angeles, California
United States
History of women in the United States
|
```c
/*
* B53 switch driver main logic
*
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/delay.h>
#include <linux/export.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/switch.h>
#include <linux/phy.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/platform_data/b53.h>
#include "b53_regs.h"
#include "b53_priv.h"
/* buffer size needed for displaying all MIBs with max'd values */
#define B53_BUF_SIZE 1188
struct b53_mib_desc {
u8 size;
u8 offset;
const char *name;
};
/* BCM5365 MIB counters */
static const struct b53_mib_desc b53_mibs_65[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "TxExcessiveCollision" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "Pkts1024to1522Octets" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
{ },
};
#define B63XX_MIB_TXB_ID 0 /* TxOctets */
#define B63XX_MIB_RXB_ID 14 /* RxOctets */
/* BCM63xx MIB counters */
static const struct b53_mib_desc b53_mibs_63xx[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x0c, "TxQoSPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "TxExcessiveCollision" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x3c, "TxQoSOctets" },
{ 8, 0x44, "RxOctets" },
{ 4, 0x4c, "RxUndersizePkts" },
{ 4, 0x50, "RxPausePkts" },
{ 4, 0x54, "Pkts64Octets" },
{ 4, 0x58, "Pkts65to127Octets" },
{ 4, 0x5c, "Pkts128to255Octets" },
{ 4, 0x60, "Pkts256to511Octets" },
{ 4, 0x64, "Pkts512to1023Octets" },
{ 4, 0x68, "Pkts1024to1522Octets" },
{ 4, 0x6c, "RxOversizePkts" },
{ 4, 0x70, "RxJabbers" },
{ 4, 0x74, "RxAlignmentErrors" },
{ 4, 0x78, "RxFCSErrors" },
{ 8, 0x7c, "RxGoodOctets" },
{ 4, 0x84, "RxDropPkts" },
{ 4, 0x88, "RxUnicastPkts" },
{ 4, 0x8c, "RxMulticastPkts" },
{ 4, 0x90, "RxBroadcastPkts" },
{ 4, 0x94, "RxSAChanges" },
{ 4, 0x98, "RxFragments" },
{ 4, 0xa0, "RxSymbolErrors" },
{ 4, 0xa4, "RxQoSPkts" },
{ 8, 0xa8, "RxQoSOctets" },
{ 4, 0xb0, "Pkts1523to2047Octets" },
{ 4, 0xb4, "Pkts2048to4095Octets" },
{ 4, 0xb8, "Pkts4096to8191Octets" },
{ 4, 0xbc, "Pkts8192to9728Octets" },
{ 4, 0xc0, "RxDiscarded" },
{ }
};
#define B53XX_MIB_TXB_ID 0 /* TxOctets */
#define B53XX_MIB_RXB_ID 12 /* RxOctets */
/* MIB counters */
static const struct b53_mib_desc b53_mibs[] = {
{ 8, 0x00, "TxOctets" },
{ 4, 0x08, "TxDropPkts" },
{ 4, 0x10, "TxBroadcastPkts" },
{ 4, 0x14, "TxMulticastPkts" },
{ 4, 0x18, "TxUnicastPkts" },
{ 4, 0x1c, "TxCollisions" },
{ 4, 0x20, "TxSingleCollision" },
{ 4, 0x24, "TxMultipleCollision" },
{ 4, 0x28, "TxDeferredTransmit" },
{ 4, 0x2c, "TxLateCollision" },
{ 4, 0x30, "TxExcessiveCollision" },
{ 4, 0x38, "TxPausePkts" },
{ 8, 0x50, "RxOctets" },
{ 4, 0x58, "RxUndersizePkts" },
{ 4, 0x5c, "RxPausePkts" },
{ 4, 0x60, "Pkts64Octets" },
{ 4, 0x64, "Pkts65to127Octets" },
{ 4, 0x68, "Pkts128to255Octets" },
{ 4, 0x6c, "Pkts256to511Octets" },
{ 4, 0x70, "Pkts512to1023Octets" },
{ 4, 0x74, "Pkts1024to1522Octets" },
{ 4, 0x78, "RxOversizePkts" },
{ 4, 0x7c, "RxJabbers" },
{ 4, 0x80, "RxAlignmentErrors" },
{ 4, 0x84, "RxFCSErrors" },
{ 8, 0x88, "RxGoodOctets" },
{ 4, 0x90, "RxDropPkts" },
{ 4, 0x94, "RxUnicastPkts" },
{ 4, 0x98, "RxMulticastPkts" },
{ 4, 0x9c, "RxBroadcastPkts" },
{ 4, 0xa0, "RxSAChanges" },
{ 4, 0xa4, "RxFragments" },
{ 4, 0xa8, "RxJumboPkts" },
{ 4, 0xac, "RxSymbolErrors" },
{ 4, 0xc0, "RxDiscarded" },
{ }
};
static int b53_do_vlan_op(struct b53_device *dev, u8 op)
{
unsigned int i;
b53_write8(dev, B53_ARLIO_PAGE, dev->vta_regs[0], VTA_START_CMD | op);
for (i = 0; i < 10; i++) {
u8 vta;
b53_read8(dev, B53_ARLIO_PAGE, dev->vta_regs[0], &vta);
if (!(vta & VTA_START_CMD))
return 0;
usleep_range(100, 200);
}
return -EIO;
}
static void b53_set_vlan_entry(struct b53_device *dev, u16 vid, u16 members,
u16 untag)
{
if (is5325(dev)) {
u32 entry = 0;
if (members) {
entry = ((untag & VA_UNTAG_MASK_25) << VA_UNTAG_S_25) |
members;
if (dev->core_rev >= 3)
entry |= VA_VALID_25_R4 | vid << VA_VID_HIGH_S;
else
entry |= VA_VALID_25;
}
b53_write32(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_25, entry);
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, vid |
VTA_RW_STATE_WR | VTA_RW_OP_EN);
} else if (is5365(dev)) {
u16 entry = 0;
if (members)
entry = ((untag & VA_UNTAG_MASK_65) << VA_UNTAG_S_65) |
members | VA_VALID_65;
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_WRITE_65, entry);
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_65, vid |
VTA_RW_STATE_WR | VTA_RW_OP_EN);
} else {
b53_write16(dev, B53_ARLIO_PAGE, dev->vta_regs[1], vid);
b53_write32(dev, B53_ARLIO_PAGE, dev->vta_regs[2],
(untag << VTE_UNTAG_S) | members);
b53_do_vlan_op(dev, VTA_CMD_WRITE);
}
}
void b53_set_forwarding(struct b53_device *dev, int enable)
{
u8 mgmt;
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (enable)
mgmt |= SM_SW_FWD_EN;
else
mgmt &= ~SM_SW_FWD_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
}
static void b53_enable_vlan(struct b53_device *dev, int enable)
{
u8 mgmt, vc0, vc1, vc4 = 0, vc5;
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL0, &vc0);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL1, &vc1);
if (is5325(dev) || is5365(dev)) {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_25, &vc5);
} else if (is63xx(dev)) {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_63XX, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_63XX, &vc5);
} else {
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4, &vc4);
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, &vc5);
}
mgmt &= ~SM_SW_FWD_MODE;
if (enable) {
vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID;
vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN;
vc4 &= ~VC4_ING_VID_CHECK_MASK;
vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S;
vc5 |= VC5_DROP_VTABLE_MISS;
if (is5325(dev))
vc0 &= ~VC0_RESERVED_1;
if (is5325(dev) || is5365(dev))
vc1 |= VC1_RX_MCST_TAG_EN;
if (!is5325(dev) && !is5365(dev)) {
if (dev->allow_vid_4095)
vc5 |= VC5_VID_FFF_EN;
else
vc5 &= ~VC5_VID_FFF_EN;
}
} else {
vc0 &= ~(VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID);
vc1 &= ~(VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN);
vc4 &= ~VC4_ING_VID_CHECK_MASK;
vc5 &= ~VC5_DROP_VTABLE_MISS;
if (is5325(dev) || is5365(dev))
vc4 |= VC4_ING_VID_VIO_FWD << VC4_ING_VID_CHECK_S;
else
vc4 |= VC4_ING_VID_VIO_TO_IMP << VC4_ING_VID_CHECK_S;
if (is5325(dev) || is5365(dev))
vc1 &= ~VC1_RX_MCST_TAG_EN;
if (!is5325(dev) && !is5365(dev))
vc5 &= ~VC5_VID_FFF_EN;
}
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL0, vc0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL1, vc1);
if (is5325(dev) || is5365(dev)) {
/* enable the high 8 bit vid check on 5325 */
if (is5325(dev) && enable)
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3,
VC3_HIGH_8BIT_EN);
else
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_25, vc5);
} else if (is63xx(dev)) {
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3_63XX, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_63XX, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5_63XX, vc5);
} else {
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_CTRL3, 0);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4, vc4);
b53_write8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, vc5);
}
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
}
static int b53_set_jumbo(struct b53_device *dev, int enable, int allow_10_100)
{
u32 port_mask = 0;
u16 max_size = JMS_MIN_SIZE;
if (is5325(dev) || is5365(dev))
return -EINVAL;
if (enable) {
port_mask = dev->enabled_ports;
max_size = JMS_MAX_SIZE;
if (allow_10_100)
port_mask |= JPM_10_100_JUMBO_EN;
}
b53_write32(dev, B53_JUMBO_PAGE, dev->jumbo_pm_reg, port_mask);
return b53_write16(dev, B53_JUMBO_PAGE, dev->jumbo_size_reg, max_size);
}
static int b53_flush_arl(struct b53_device *dev)
{
unsigned int i;
b53_write8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL,
FAST_AGE_DONE | FAST_AGE_DYNAMIC | FAST_AGE_STATIC);
for (i = 0; i < 10; i++) {
u8 fast_age_ctrl;
b53_read8(dev, B53_CTRL_PAGE, B53_FAST_AGE_CTRL,
&fast_age_ctrl);
if (!(fast_age_ctrl & FAST_AGE_DONE))
return 0;
mdelay(1);
}
pr_warn("time out while flushing ARL\n");
return -EINVAL;
}
static void b53_enable_ports(struct b53_device *dev)
{
unsigned i;
b53_for_each_port(dev, i) {
u8 port_ctrl;
u16 pvlan_mask;
/*
* prevent leaking packets between wan and lan in unmanaged
* mode through port vlans.
*/
if (dev->enable_vlan || is_cpu_port(dev, i))
pvlan_mask = 0x1ff;
else if (is531x5(dev) || is5301x(dev))
/* BCM53115 may use a different port as cpu port */
pvlan_mask = BIT(dev->sw_dev.cpu_port);
else
pvlan_mask = BIT(B53_CPU_PORT);
/* BCM5325 CPU port is at 8 */
if ((is5325(dev) || is5365(dev)) && i == B53_CPU_PORT_25)
i = B53_CPU_PORT;
if (dev->chip_id == BCM5398_DEVICE_ID && (i == 6 || i == 7))
/* disable unused ports 6 & 7 */
port_ctrl = PORT_CTRL_RX_DISABLE | PORT_CTRL_TX_DISABLE;
else if (i == B53_CPU_PORT)
port_ctrl = PORT_CTRL_RX_BCST_EN |
PORT_CTRL_RX_MCST_EN |
PORT_CTRL_RX_UCST_EN;
else
port_ctrl = 0;
b53_write16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(i),
pvlan_mask);
/* port state is handled by bcm63xx_enet driver */
if (!is63xx(dev) && !(is5301x(dev) && i == 6))
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(i),
port_ctrl);
}
}
static void b53_enable_mib(struct b53_device *dev)
{
u8 gc;
b53_read8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &gc);
gc &= ~(GC_RESET_MIB | GC_MIB_AC_EN);
b53_write8(dev, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc);
}
static int b53_apply(struct b53_device *dev)
{
int i;
/* clear all vlan entries */
if (is5325(dev) || is5365(dev)) {
for (i = 1; i < dev->sw_dev.vlans; i++)
b53_set_vlan_entry(dev, i, 0, 0);
} else {
b53_do_vlan_op(dev, VTA_CMD_CLEAR);
}
b53_enable_vlan(dev, dev->enable_vlan);
/* fill VLAN table */
if (dev->enable_vlan) {
for (i = 0; i < dev->sw_dev.vlans; i++) {
struct b53_vlan *vlan = &dev->vlans[i];
if (!vlan->members)
continue;
b53_set_vlan_entry(dev, i, vlan->members, vlan->untag);
}
b53_for_each_port(dev, i)
b53_write16(dev, B53_VLAN_PAGE,
B53_VLAN_PORT_DEF_TAG(i),
dev->ports[i].pvid);
} else {
b53_for_each_port(dev, i)
b53_write16(dev, B53_VLAN_PAGE,
B53_VLAN_PORT_DEF_TAG(i), 1);
}
b53_enable_ports(dev);
if (!is5325(dev) && !is5365(dev))
b53_set_jumbo(dev, dev->enable_jumbo, 1);
return 0;
}
static void b53_switch_reset_gpio(struct b53_device *dev)
{
int gpio = dev->reset_gpio;
if (gpio < 0)
return;
/*
* Reset sequence: RESET low(50ms)->high(20ms)
*/
gpio_set_value(gpio, 0);
mdelay(50);
gpio_set_value(gpio, 1);
mdelay(20);
dev->current_page = 0xff;
}
static int b53_configure_ports_of(struct b53_device *dev)
{
struct device_node *dn, *pn;
u32 port_num;
dn = of_get_child_by_name(dev_of_node(dev->dev), "ports");
for_each_available_child_of_node(dn, pn) {
struct device_node *fixed_link;
if (of_property_read_u32(pn, "reg", &port_num))
continue;
if (port_num > B53_CPU_PORT)
continue;
fixed_link = of_get_child_by_name(pn, "fixed-link");
if (fixed_link) {
u32 spd;
u8 po = GMII_PO_LINK;
phy_interface_t mode;
of_get_phy_mode(pn, &mode);
if (!of_property_read_u32(fixed_link, "speed", &spd)) {
switch (spd) {
case 10:
po |= GMII_PO_SPEED_10M;
break;
case 100:
po |= GMII_PO_SPEED_100M;
break;
case 2000:
if (is_imp_port(dev, port_num))
po |= PORT_OVERRIDE_SPEED_2000M;
else
po |= GMII_PO_SPEED_2000M;
fallthrough;
case 1000:
po |= GMII_PO_SPEED_1000M;
break;
}
}
if (of_property_read_bool(fixed_link, "full-duplex"))
po |= PORT_OVERRIDE_FULL_DUPLEX;
if (of_property_read_bool(fixed_link, "pause"))
po |= GMII_PO_RX_FLOW;
if (of_property_read_bool(fixed_link, "asym-pause"))
po |= GMII_PO_TX_FLOW;
if (is_imp_port(dev, port_num)) {
po |= PORT_OVERRIDE_EN;
if (is5325(dev) &&
mode == PHY_INTERFACE_MODE_REVMII)
po |= PORT_OVERRIDE_RV_MII_25;
b53_write8(dev, B53_CTRL_PAGE,
B53_PORT_OVERRIDE_CTRL, po);
if (is5325(dev) &&
mode == PHY_INTERFACE_MODE_REVMII) {
b53_read8(dev, B53_CTRL_PAGE,
B53_PORT_OVERRIDE_CTRL, &po);
if (!(po & PORT_OVERRIDE_RV_MII_25))
pr_err("Failed to enable reverse MII mode\n");
return -EINVAL;
}
} else {
po |= GMII_PO_EN;
b53_write8(dev, B53_CTRL_PAGE,
B53_GMII_PORT_OVERRIDE_CTRL(port_num),
po);
}
}
}
return 0;
}
static int b53_configure_ports(struct b53_device *dev)
{
u8 cpu_port = dev->sw_dev.cpu_port;
/* configure MII port if necessary */
if (is5325(dev)) {
u8 mii_port_override;
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
&mii_port_override);
/* reverse mii needs to be enabled */
if (!(mii_port_override & PORT_OVERRIDE_RV_MII_25)) {
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
mii_port_override | PORT_OVERRIDE_RV_MII_25);
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
&mii_port_override);
if (!(mii_port_override & PORT_OVERRIDE_RV_MII_25)) {
pr_err("Failed to enable reverse MII mode\n");
return -EINVAL;
}
}
} else if (is531x5(dev) && cpu_port == B53_CPU_PORT) {
u8 mii_port_override;
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
&mii_port_override);
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
mii_port_override | PORT_OVERRIDE_EN |
PORT_OVERRIDE_LINK);
/* BCM47189 has another interface connected to the port 5 */
if (dev->enabled_ports & BIT(5)) {
u8 po_reg = B53_GMII_PORT_OVERRIDE_CTRL(5);
u8 gmii_po;
b53_read8(dev, B53_CTRL_PAGE, po_reg, &gmii_po);
gmii_po |= GMII_PO_LINK |
GMII_PO_RX_FLOW |
GMII_PO_TX_FLOW |
GMII_PO_EN;
b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
}
} else if (is5301x(dev)) {
if (cpu_port == 8) {
u8 mii_port_override;
b53_read8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
&mii_port_override);
mii_port_override |= PORT_OVERRIDE_LINK |
PORT_OVERRIDE_RX_FLOW |
PORT_OVERRIDE_TX_FLOW |
PORT_OVERRIDE_SPEED_2000M |
PORT_OVERRIDE_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
mii_port_override);
/* TODO: Ports 5 & 7 require some extra handling */
} else {
u8 po_reg = B53_GMII_PORT_OVERRIDE_CTRL(cpu_port);
u8 gmii_po;
b53_read8(dev, B53_CTRL_PAGE, po_reg, &gmii_po);
gmii_po |= GMII_PO_LINK |
GMII_PO_RX_FLOW |
GMII_PO_TX_FLOW |
GMII_PO_EN |
GMII_PO_SPEED_2000M;
b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
}
}
return 0;
}
static int b53_switch_reset(struct b53_device *dev)
{
int ret = 0;
u8 mgmt;
b53_switch_reset_gpio(dev);
if (is539x(dev)) {
b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x83);
b53_write8(dev, B53_CTRL_PAGE, B53_SOFTRESET, 0x00);
}
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (!(mgmt & SM_SW_FWD_EN)) {
mgmt &= ~SM_SW_FWD_MODE;
mgmt |= SM_SW_FWD_EN;
b53_write8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, mgmt);
b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
if (!(mgmt & SM_SW_FWD_EN)) {
pr_err("Failed to enable switch!\n");
return -EINVAL;
}
}
/* enable all ports */
b53_enable_ports(dev);
if (dev->dev->of_node)
ret = b53_configure_ports_of(dev);
else
ret = b53_configure_ports(dev);
if (ret)
return ret;
b53_enable_mib(dev);
return b53_flush_arl(dev);
}
/*
* Swconfig glue functions
*/
static int b53_global_get_vlan_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
val->value.i = priv->enable_vlan;
return 0;
}
static int b53_global_set_vlan_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
priv->enable_vlan = val->value.i;
return 0;
}
static int b53_global_get_jumbo_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
val->value.i = priv->enable_jumbo;
return 0;
}
static int b53_global_set_jumbo_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
priv->enable_jumbo = val->value.i;
return 0;
}
static int b53_global_get_4095_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
val->value.i = priv->allow_vid_4095;
return 0;
}
static int b53_global_set_4095_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
priv->allow_vid_4095 = val->value.i;
return 0;
}
static int b53_global_get_ports(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
val->len = snprintf(priv->buf, B53_BUF_SIZE, "0x%04x",
priv->enabled_ports);
val->value.s = priv->buf;
return 0;
}
static int b53_port_get_pvid(struct switch_dev *dev, int port, int *val)
{
struct b53_device *priv = sw_to_b53(dev);
*val = priv->ports[port].pvid;
return 0;
}
static int b53_port_set_pvid(struct switch_dev *dev, int port, int val)
{
struct b53_device *priv = sw_to_b53(dev);
if (val > 15 && is5325(priv))
return -EINVAL;
if (val == 4095 && !priv->allow_vid_4095)
return -EINVAL;
priv->ports[port].pvid = val;
return 0;
}
static int b53_vlan_get_ports(struct switch_dev *dev, struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
struct switch_port *port = &val->value.ports[0];
struct b53_vlan *vlan = &priv->vlans[val->port_vlan];
int i;
val->len = 0;
if (!vlan->members)
return 0;
for (i = 0; i < dev->ports; i++) {
if (!(vlan->members & BIT(i)))
continue;
if (!(vlan->untag & BIT(i)))
port->flags = BIT(SWITCH_PORT_FLAG_TAGGED);
else
port->flags = 0;
port->id = i;
val->len++;
port++;
}
return 0;
}
static int b53_vlan_set_ports(struct switch_dev *dev, struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
struct switch_port *port;
struct b53_vlan *vlan = &priv->vlans[val->port_vlan];
int i;
/* only BCM5325 and BCM5365 supports VID 0 */
if (val->port_vlan == 0 && !is5325(priv) && !is5365(priv))
return -EINVAL;
/* VLAN 4095 needs special handling */
if (val->port_vlan == 4095 && !priv->allow_vid_4095)
return -EINVAL;
port = &val->value.ports[0];
vlan->members = 0;
vlan->untag = 0;
for (i = 0; i < val->len; i++, port++) {
vlan->members |= BIT(port->id);
if (!(port->flags & BIT(SWITCH_PORT_FLAG_TAGGED))) {
vlan->untag |= BIT(port->id);
priv->ports[port->id].pvid = val->port_vlan;
};
}
/* ignore disabled ports */
vlan->members &= priv->enabled_ports;
vlan->untag &= priv->enabled_ports;
return 0;
}
static int b53_port_get_link(struct switch_dev *dev, int port,
struct switch_port_link *link)
{
struct b53_device *priv = sw_to_b53(dev);
if (is_cpu_port(priv, port)) {
link->link = 1;
link->duplex = 1;
link->speed = is5325(priv) || is5365(priv) ?
SWITCH_PORT_SPEED_100 : SWITCH_PORT_SPEED_1000;
link->aneg = 0;
} else if (priv->enabled_ports & BIT(port)) {
u32 speed;
u16 lnk, duplex;
b53_read16(priv, B53_STAT_PAGE, B53_LINK_STAT, &lnk);
b53_read16(priv, B53_STAT_PAGE, priv->duplex_reg, &duplex);
lnk = (lnk >> port) & 1;
duplex = (duplex >> port) & 1;
if (is5325(priv) || is5365(priv)) {
u16 tmp;
b53_read16(priv, B53_STAT_PAGE, B53_SPEED_STAT, &tmp);
speed = SPEED_PORT_FE(tmp, port);
} else {
b53_read32(priv, B53_STAT_PAGE, B53_SPEED_STAT, &speed);
speed = SPEED_PORT_GE(speed, port);
}
link->link = lnk;
if (lnk) {
link->duplex = duplex;
switch (speed) {
case SPEED_STAT_10M:
link->speed = SWITCH_PORT_SPEED_10;
break;
case SPEED_STAT_100M:
link->speed = SWITCH_PORT_SPEED_100;
break;
case SPEED_STAT_1000M:
link->speed = SWITCH_PORT_SPEED_1000;
break;
}
}
link->aneg = 1;
} else {
link->link = 0;
}
return 0;
}
static int b53_port_set_link(struct switch_dev *sw_dev, int port,
struct switch_port_link *link)
{
struct b53_device *dev = sw_to_b53(sw_dev);
/*
* TODO: BCM63XX requires special handling as it can have external phys
* and ports might be GE or only FE
*/
if (is63xx(dev))
return -ENOTSUPP;
if (port == sw_dev->cpu_port)
return -EINVAL;
if (!(BIT(port) & dev->enabled_ports))
return -EINVAL;
if (link->speed == SWITCH_PORT_SPEED_1000 &&
(is5325(dev) || is5365(dev)))
return -EINVAL;
if (link->speed == SWITCH_PORT_SPEED_1000 && !link->duplex)
return -EINVAL;
return switch_generic_set_link(sw_dev, port, link);
}
static int b53_phy_read16(struct switch_dev *dev, int addr, u8 reg, u16 *value)
{
struct b53_device *priv = sw_to_b53(dev);
if (priv->ops->phy_read16)
return priv->ops->phy_read16(priv, addr, reg, value);
return b53_read16(priv, B53_PORT_MII_PAGE(addr), reg, value);
}
static int b53_phy_write16(struct switch_dev *dev, int addr, u8 reg, u16 value)
{
struct b53_device *priv = sw_to_b53(dev);
if (priv->ops->phy_write16)
return priv->ops->phy_write16(priv, addr, reg, value);
return b53_write16(priv, B53_PORT_MII_PAGE(addr), reg, value);
}
static int b53_global_reset_switch(struct switch_dev *dev)
{
struct b53_device *priv = sw_to_b53(dev);
/* reset vlans */
priv->enable_vlan = 0;
priv->enable_jumbo = 0;
priv->allow_vid_4095 = 0;
memset(priv->vlans, 0, sizeof(*priv->vlans) * dev->vlans);
memset(priv->ports, 0, sizeof(*priv->ports) * dev->ports);
return b53_switch_reset(priv);
}
static int b53_global_apply_config(struct switch_dev *dev)
{
struct b53_device *priv = sw_to_b53(dev);
/* disable switching */
b53_set_forwarding(priv, 0);
b53_apply(priv);
/* enable switching */
b53_set_forwarding(priv, 1);
return 0;
}
static int b53_global_reset_mib(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *priv = sw_to_b53(dev);
u8 gc;
b53_read8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, &gc);
b53_write8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc | GC_RESET_MIB);
mdelay(1);
b53_write8(priv, B53_MGMT_PAGE, B53_GLOBAL_CONFIG, gc & ~GC_RESET_MIB);
mdelay(1);
return 0;
}
static int b53_port_get_mib(struct switch_dev *sw_dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct b53_device *dev = sw_to_b53(sw_dev);
const struct b53_mib_desc *mibs;
int port = val->port_vlan;
int len = 0;
if (!(BIT(port) & dev->enabled_ports))
return -1;
if (is5365(dev)) {
if (port == 5)
port = 8;
mibs = b53_mibs_65;
} else if (is63xx(dev)) {
mibs = b53_mibs_63xx;
} else {
mibs = b53_mibs;
}
dev->buf[0] = 0;
for (; mibs->size > 0; mibs++) {
u64 val;
if (mibs->size == 8) {
b53_read64(dev, B53_MIB_PAGE(port), mibs->offset, &val);
} else {
u32 val32;
b53_read32(dev, B53_MIB_PAGE(port), mibs->offset,
&val32);
val = val32;
}
len += snprintf(dev->buf + len, B53_BUF_SIZE - len,
"%-20s: %llu\n", mibs->name, val);
}
val->len = len;
val->value.s = dev->buf;
return 0;
}
static int b53_port_get_stats(struct switch_dev *sw_dev, int port,
struct switch_port_stats *stats)
{
struct b53_device *dev = sw_to_b53(sw_dev);
const struct b53_mib_desc *mibs;
int txb_id, rxb_id;
u64 rxb, txb;
if (!(BIT(port) & dev->enabled_ports))
return -EINVAL;
txb_id = B53XX_MIB_TXB_ID;
rxb_id = B53XX_MIB_RXB_ID;
if (is5365(dev)) {
if (port == 5)
port = 8;
mibs = b53_mibs_65;
} else if (is63xx(dev)) {
mibs = b53_mibs_63xx;
txb_id = B63XX_MIB_TXB_ID;
rxb_id = B63XX_MIB_RXB_ID;
} else {
mibs = b53_mibs;
}
dev->buf[0] = 0;
if (mibs->size == 8) {
b53_read64(dev, B53_MIB_PAGE(port), mibs[txb_id].offset, &txb);
b53_read64(dev, B53_MIB_PAGE(port), mibs[rxb_id].offset, &rxb);
} else {
u32 val32;
b53_read32(dev, B53_MIB_PAGE(port), mibs[txb_id].offset, &val32);
txb = val32;
b53_read32(dev, B53_MIB_PAGE(port), mibs[rxb_id].offset, &val32);
rxb = val32;
}
stats->tx_bytes = txb;
stats->rx_bytes = rxb;
return 0;
}
static struct switch_attr b53_global_ops_25[] = {
{
.type = SWITCH_TYPE_INT,
.name = "enable_vlan",
.description = "Enable VLAN mode",
.set = b53_global_set_vlan_enable,
.get = b53_global_get_vlan_enable,
.max = 1,
},
{
.type = SWITCH_TYPE_STRING,
.name = "ports",
.description = "Available ports (as bitmask)",
.get = b53_global_get_ports,
},
};
static struct switch_attr b53_global_ops_65[] = {
{
.type = SWITCH_TYPE_INT,
.name = "enable_vlan",
.description = "Enable VLAN mode",
.set = b53_global_set_vlan_enable,
.get = b53_global_get_vlan_enable,
.max = 1,
},
{
.type = SWITCH_TYPE_STRING,
.name = "ports",
.description = "Available ports (as bitmask)",
.get = b53_global_get_ports,
},
{
.type = SWITCH_TYPE_INT,
.name = "reset_mib",
.description = "Reset MIB counters",
.set = b53_global_reset_mib,
},
};
static struct switch_attr b53_global_ops[] = {
{
.type = SWITCH_TYPE_INT,
.name = "enable_vlan",
.description = "Enable VLAN mode",
.set = b53_global_set_vlan_enable,
.get = b53_global_get_vlan_enable,
.max = 1,
},
{
.type = SWITCH_TYPE_STRING,
.name = "ports",
.description = "Available Ports (as bitmask)",
.get = b53_global_get_ports,
},
{
.type = SWITCH_TYPE_INT,
.name = "reset_mib",
.description = "Reset MIB counters",
.set = b53_global_reset_mib,
},
{
.type = SWITCH_TYPE_INT,
.name = "enable_jumbo",
.description = "Enable Jumbo Frames",
.set = b53_global_set_jumbo_enable,
.get = b53_global_get_jumbo_enable,
.max = 1,
},
{
.type = SWITCH_TYPE_INT,
.name = "allow_vid_4095",
.description = "Allow VID 4095",
.set = b53_global_set_4095_enable,
.get = b53_global_get_4095_enable,
.max = 1,
},
};
static struct switch_attr b53_port_ops[] = {
{
.type = SWITCH_TYPE_STRING,
.name = "mib",
.description = "Get port's MIB counters",
.get = b53_port_get_mib,
},
};
static struct switch_attr b53_no_ops[] = {
};
static const struct switch_dev_ops b53_switch_ops_25 = {
.attr_global = {
.attr = b53_global_ops_25,
.n_attr = ARRAY_SIZE(b53_global_ops_25),
},
.attr_port = {
.attr = b53_no_ops,
.n_attr = ARRAY_SIZE(b53_no_ops),
},
.attr_vlan = {
.attr = b53_no_ops,
.n_attr = ARRAY_SIZE(b53_no_ops),
},
.get_vlan_ports = b53_vlan_get_ports,
.set_vlan_ports = b53_vlan_set_ports,
.get_port_pvid = b53_port_get_pvid,
.set_port_pvid = b53_port_set_pvid,
.apply_config = b53_global_apply_config,
.reset_switch = b53_global_reset_switch,
.get_port_link = b53_port_get_link,
.set_port_link = b53_port_set_link,
.get_port_stats = b53_port_get_stats,
.phy_read16 = b53_phy_read16,
.phy_write16 = b53_phy_write16,
};
static const struct switch_dev_ops b53_switch_ops_65 = {
.attr_global = {
.attr = b53_global_ops_65,
.n_attr = ARRAY_SIZE(b53_global_ops_65),
},
.attr_port = {
.attr = b53_port_ops,
.n_attr = ARRAY_SIZE(b53_port_ops),
},
.attr_vlan = {
.attr = b53_no_ops,
.n_attr = ARRAY_SIZE(b53_no_ops),
},
.get_vlan_ports = b53_vlan_get_ports,
.set_vlan_ports = b53_vlan_set_ports,
.get_port_pvid = b53_port_get_pvid,
.set_port_pvid = b53_port_set_pvid,
.apply_config = b53_global_apply_config,
.reset_switch = b53_global_reset_switch,
.get_port_link = b53_port_get_link,
.set_port_link = b53_port_set_link,
.get_port_stats = b53_port_get_stats,
.phy_read16 = b53_phy_read16,
.phy_write16 = b53_phy_write16,
};
static const struct switch_dev_ops b53_switch_ops = {
.attr_global = {
.attr = b53_global_ops,
.n_attr = ARRAY_SIZE(b53_global_ops),
},
.attr_port = {
.attr = b53_port_ops,
.n_attr = ARRAY_SIZE(b53_port_ops),
},
.attr_vlan = {
.attr = b53_no_ops,
.n_attr = ARRAY_SIZE(b53_no_ops),
},
.get_vlan_ports = b53_vlan_get_ports,
.set_vlan_ports = b53_vlan_set_ports,
.get_port_pvid = b53_port_get_pvid,
.set_port_pvid = b53_port_set_pvid,
.apply_config = b53_global_apply_config,
.reset_switch = b53_global_reset_switch,
.get_port_link = b53_port_get_link,
.set_port_link = b53_port_set_link,
.get_port_stats = b53_port_get_stats,
.phy_read16 = b53_phy_read16,
.phy_write16 = b53_phy_write16,
};
struct b53_chip_data {
u32 chip_id;
const char *dev_name;
const char *alias;
u16 vlans;
u16 enabled_ports;
u8 cpu_port;
u8 vta_regs[3];
u8 duplex_reg;
u8 jumbo_pm_reg;
u8 jumbo_size_reg;
const struct switch_dev_ops *sw_ops;
};
#define B53_VTA_REGS \
{ B53_VT_ACCESS, B53_VT_INDEX, B53_VT_ENTRY }
#define B53_VTA_REGS_9798 \
{ B53_VT_ACCESS_9798, B53_VT_INDEX_9798, B53_VT_ENTRY_9798 }
#define B53_VTA_REGS_63XX \
{ B53_VT_ACCESS_63XX, B53_VT_INDEX_63XX, B53_VT_ENTRY_63XX }
static const struct b53_chip_data b53_switch_chips[] = {
{
.chip_id = BCM5325_DEVICE_ID,
.dev_name = "BCM5325",
.alias = "bcm5325",
.vlans = 16,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT_25,
.duplex_reg = B53_DUPLEX_STAT_FE,
.sw_ops = &b53_switch_ops_25,
},
{
.chip_id = BCM5365_DEVICE_ID,
.dev_name = "BCM5365",
.alias = "bcm5365",
.vlans = 256,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT_25,
.duplex_reg = B53_DUPLEX_STAT_FE,
.sw_ops = &b53_switch_ops_65,
},
{
.chip_id = BCM5395_DEVICE_ID,
.dev_name = "BCM5395",
.alias = "bcm5395",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM5397_DEVICE_ID,
.dev_name = "BCM5397",
.alias = "bcm5397",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_9798,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM5398_DEVICE_ID,
.dev_name = "BCM5398",
.alias = "bcm5398",
.vlans = 4096,
.enabled_ports = 0x7f,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_9798,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53115_DEVICE_ID,
.dev_name = "BCM53115",
.alias = "bcm53115",
.vlans = 4096,
.enabled_ports = 0x1f,
.vta_regs = B53_VTA_REGS,
.cpu_port = B53_CPU_PORT,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53125_DEVICE_ID,
.dev_name = "BCM53125",
.alias = "bcm53125",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53128_DEVICE_ID,
.dev_name = "BCM53128",
.alias = "bcm53128",
.vlans = 4096,
.enabled_ports = 0x1ff,
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM63XX_DEVICE_ID,
.dev_name = "BCM63xx",
.alias = "bcm63xx",
.vlans = 4096,
.enabled_ports = 0, /* pdata must provide them */
.cpu_port = B53_CPU_PORT,
.vta_regs = B53_VTA_REGS_63XX,
.duplex_reg = B53_DUPLEX_STAT_63XX,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK_63XX,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE_63XX,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53010_DEVICE_ID,
.dev_name = "BCM53010",
.alias = "bcm53011",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53011_DEVICE_ID,
.dev_name = "BCM53011",
.alias = "bcm53011",
.vlans = 4096,
.enabled_ports = 0x1bf,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53012_DEVICE_ID,
.dev_name = "BCM53012",
.alias = "bcm53011",
.vlans = 4096,
.enabled_ports = 0x1bf,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53018_DEVICE_ID,
.dev_name = "BCM53018",
.alias = "bcm53018",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
{
.chip_id = BCM53019_DEVICE_ID,
.dev_name = "BCM53019",
.alias = "bcm53019",
.vlans = 4096,
.enabled_ports = 0x1f,
.cpu_port = B53_CPU_PORT_25, /* TODO: auto detect */
.vta_regs = B53_VTA_REGS,
.duplex_reg = B53_DUPLEX_STAT_GE,
.jumbo_pm_reg = B53_JUMBO_PORT_MASK,
.jumbo_size_reg = B53_JUMBO_MAX_SIZE,
.sw_ops = &b53_switch_ops,
},
};
static int b53_switch_init_of(struct b53_device *dev)
{
struct device_node *dn, *pn;
const char *alias;
u32 port_num;
u16 ports = 0;
dn = of_get_child_by_name(dev_of_node(dev->dev), "ports");
if (!dn)
return -EINVAL;
for_each_available_child_of_node(dn, pn) {
const char *label;
int len;
if (of_property_read_u32(pn, "reg", &port_num))
continue;
if (port_num > B53_CPU_PORT)
continue;
ports |= BIT(port_num);
label = of_get_property(pn, "label", &len);
if (label && !strcmp(label, "cpu"))
dev->sw_dev.cpu_port = port_num;
}
dev->enabled_ports = ports;
if (!of_property_read_string(dev_of_node(dev->dev), "lede,alias",
&alias))
dev->sw_dev.alias = devm_kstrdup(dev->dev, alias, GFP_KERNEL);
return 0;
}
static int b53_switch_init(struct b53_device *dev)
{
struct switch_dev *sw_dev = &dev->sw_dev;
unsigned i;
int ret;
for (i = 0; i < ARRAY_SIZE(b53_switch_chips); i++) {
const struct b53_chip_data *chip = &b53_switch_chips[i];
if (chip->chip_id == dev->chip_id) {
sw_dev->name = chip->dev_name;
if (!sw_dev->alias)
sw_dev->alias = chip->alias;
if (!dev->enabled_ports)
dev->enabled_ports = chip->enabled_ports;
dev->duplex_reg = chip->duplex_reg;
dev->vta_regs[0] = chip->vta_regs[0];
dev->vta_regs[1] = chip->vta_regs[1];
dev->vta_regs[2] = chip->vta_regs[2];
dev->jumbo_pm_reg = chip->jumbo_pm_reg;
sw_dev->ops = chip->sw_ops;
sw_dev->cpu_port = chip->cpu_port;
sw_dev->vlans = chip->vlans;
break;
}
}
if (!sw_dev->name)
return -EINVAL;
/* check which BCM5325x version we have */
if (is5325(dev)) {
u8 vc4;
b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL4_25, &vc4);
/* check reserved bits */
switch (vc4 & 3) {
case 1:
/* BCM5325E */
break;
case 3:
/* BCM5325F - do not use port 4 */
dev->enabled_ports &= ~BIT(4);
break;
default:
/* On the BCM47XX SoCs this is the supported internal switch.*/
#ifndef CONFIG_BCM47XX
/* BCM5325M */
return -EINVAL;
#else
break;
#endif
}
} else if (dev->chip_id == BCM53115_DEVICE_ID) {
u64 strap_value;
b53_read48(dev, B53_STAT_PAGE, B53_STRAP_VALUE, &strap_value);
/* use second IMP port if GMII is enabled */
if (strap_value & SV_GMII_CTRL_115)
sw_dev->cpu_port = 5;
}
if (dev_of_node(dev->dev)) {
ret = b53_switch_init_of(dev);
if (ret)
return ret;
}
dev->enabled_ports |= BIT(sw_dev->cpu_port);
sw_dev->ports = fls(dev->enabled_ports);
dev->ports = devm_kzalloc(dev->dev,
sizeof(struct b53_port) * sw_dev->ports,
GFP_KERNEL);
if (!dev->ports)
return -ENOMEM;
dev->vlans = devm_kzalloc(dev->dev,
sizeof(struct b53_vlan) * sw_dev->vlans,
GFP_KERNEL);
if (!dev->vlans)
return -ENOMEM;
dev->buf = devm_kzalloc(dev->dev, B53_BUF_SIZE, GFP_KERNEL);
if (!dev->buf)
return -ENOMEM;
dev->reset_gpio = b53_switch_get_reset_gpio(dev);
if (dev->reset_gpio >= 0) {
ret = devm_gpio_request_one(dev->dev, dev->reset_gpio,
GPIOF_OUT_INIT_HIGH, "robo_reset");
if (ret)
return ret;
}
return b53_switch_reset(dev);
}
struct b53_device *b53_swconfig_switch_alloc(struct device *base, struct b53_io_ops *ops,
void *priv)
{
struct b53_device *dev;
dev = devm_kzalloc(base, sizeof(*dev), GFP_KERNEL);
if (!dev)
return NULL;
dev->dev = base;
dev->ops = ops;
dev->priv = priv;
mutex_init(&dev->reg_mutex);
return dev;
}
EXPORT_SYMBOL(b53_swconfig_switch_alloc);
int b53_swconfig_switch_detect(struct b53_device *dev)
{
u32 id32;
u16 tmp;
u8 id8;
int ret;
ret = b53_read8(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id8);
if (ret)
return ret;
switch (id8) {
case 0:
/*
* BCM5325 and BCM5365 do not have this register so reads
* return 0. But the read operation did succeed, so assume
* this is one of them.
*
* Next check if we can write to the 5325's VTA register; for
* 5365 it is read only.
*/
b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, 0xf);
b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_TABLE_ACCESS_25, &tmp);
if (tmp == 0xf)
dev->chip_id = BCM5325_DEVICE_ID;
else
dev->chip_id = BCM5365_DEVICE_ID;
break;
case BCM5395_DEVICE_ID:
case BCM5397_DEVICE_ID:
case BCM5398_DEVICE_ID:
dev->chip_id = id8;
break;
default:
ret = b53_read32(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id32);
if (ret)
return ret;
switch (id32) {
case BCM53115_DEVICE_ID:
case BCM53125_DEVICE_ID:
case BCM53128_DEVICE_ID:
case BCM53010_DEVICE_ID:
case BCM53011_DEVICE_ID:
case BCM53012_DEVICE_ID:
case BCM53018_DEVICE_ID:
case BCM53019_DEVICE_ID:
dev->chip_id = id32;
break;
default:
pr_err("unsupported switch detected (BCM53%02x/BCM%x)\n",
id8, id32);
return -ENODEV;
}
}
if (dev->chip_id == BCM5325_DEVICE_ID)
return b53_read8(dev, B53_STAT_PAGE, B53_REV_ID_25,
&dev->core_rev);
else
return b53_read8(dev, B53_MGMT_PAGE, B53_REV_ID,
&dev->core_rev);
}
EXPORT_SYMBOL(b53_swconfig_switch_detect);
int b53_swconfig_switch_register(struct b53_device *dev)
{
int ret;
if (dev->pdata) {
dev->chip_id = dev->pdata->chip_id;
dev->enabled_ports = dev->pdata->enabled_ports;
dev->sw_dev.alias = dev->pdata->alias;
}
if (!dev->chip_id && b53_swconfig_switch_detect(dev))
return -EINVAL;
ret = b53_switch_init(dev);
if (ret)
return ret;
pr_info("found switch: %s, rev %i\n", dev->sw_dev.name, dev->core_rev);
return register_switch(&dev->sw_dev, NULL);
}
EXPORT_SYMBOL(b53_swconfig_switch_register);
MODULE_AUTHOR("Jonas Gorski <jogo@openwrt.org>");
MODULE_DESCRIPTION("B53 switch library");
MODULE_LICENSE("Dual BSD/GPL");
```
|
Two or three Abbasid expeditions to East Africa are mentioned in the late Arabic Book of the Zanj. The Abbasid caliphs al-Manṣūr (754–775), Hārūn al-Rashīd (786–809) and al-Maʾmūn (813–833) are reputed to have sent punitive expeditions to the Islamized city-states of the Somali coast and set up governors there. The Book of the Zanj does not survive in any copy earlier than the 20th century and its historical reliability is highly questionable for the early Islamic period.
The 9th-century writer al-Jāḥiẓ records an Omani expedition to East Africa in the late 7th century, but it was defeated. According to the Book of the Zanj, Islam came to Mogadishu and Kilwa in 694–695 during the reign of the Umayyad caliph Marwān I. Both the Book of the Zanj and the Pate Chronicle, which places it slightly later in 696–697, attribute the arrival of Syrian Muslims to caliphal initiative. The inhabitants of the coast accepted Islam and agreed to pay the kharāj to the caliphs. The Abbasids, who took over from the Umayyads in 750, sent an emissary, Yahya ibn ʿUmar al-ʿAnazī, to the East African cities in 765–766. The sultans of Mogadishu, Mārka, Barāwa, Faza, Sīwī, Bata, Manda (Munda), Ṭaqa, Lamu (Āmu), Ūzi, Malindi (Malūdi), Uyūmba, Kilifi, Basāsa, Zanzibar, Kilwa and Waybu (possibly a tributary of the Shebelle) are among those who accepted the emissary. Gervase Mathew dates this to 766–767 and considers it a military expedition.
In 804, according to the Book, the Zanj (Zunūj) refused to pay the kharāj and Hārūn sent an emir with soldiers against them. He replaced the Arab wālīs (governors) with Persians from Shīrāz in every village from Mogadishu to Kilwa. The Pate Chronicle also mentions Hārūn sending the Persians. The Persians were loyal for many years, but they stopped sending the kharāj even during the reign of Hārūn and entered open rebellion during the Miḥna of al-Maʾmūn, when he espoused the createdness of the Quran. The Zanj sent a manifesto to Baghdad and the caliph sent an army of 50,000 (raised either in Iraq or Egypt) to Malindi, which caused the leaders of the rebellion to flee into the nyika (brush country). They returned when the army left, but paid the outstanding kharāj and accepted the opinion of al-Maʾmūn. The Book of the Zanj dates these events to 837–838, which is not consistent with the reign of al-Maʾmūn.
According to Neville Chittick, these accounts in the Book of the Zanj must be given up as mythical. Archaeological evidence does not support extensive Arab or Persian settlement in these places at so early a date. He notes, however, that a gold dinar of Hārūn al-Rashīd dated to 798 or 799 has been found at Pemba, which is usually identified with the Qanbalū of Arabic sources. He suggests that if the accounts in the Book of the Zanj bear any relation to history it is probably to be found in the early settlement of Muslims on the East African coast associated with this coin find. Felix Chami et al. cast doubt on any Arab expeditions to East Africa after that recorded by al-Jāḥiẓ.
Notes
References
9th-century conflicts
Rebellions against the Abbasid Caliphate
Wars involving the states and peoples of Africa
Military history of Somalia
|
```xml
export const retrieveUser = jest.fn();
export const siteBanUser = jest.fn();
export const removeUserSiteBan = jest.fn();
```
|
```go
//
//
// 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 types
import (
"encoding"
"fmt"
"reflect"
"strings"
)
// UnmarshallableBool typedef for builtin bool
// because builtin type's methods can't be declared
type UnmarshallableBool bool
// UnmarshalText implements the encoding.TextUnmarshaler interface.
// Returns boolean true if the string is "1" or "true" or "True"
// Returns boolean false if the string is "0" or "false" or "False
func (b *UnmarshallableBool) UnmarshalText(data []byte) error {
s := strings.ToLower(string(data))
switch s {
case "1", "true":
*b = true
case "0", "false":
*b = false
default:
return fmt.Errorf("boolean unmarshal error: invalid input %s", s)
}
return nil
}
// UnmarshallableString typedef for builtin string
type UnmarshallableString string
// UnmarshalText implements the encoding.TextUnmarshaler interface.
// Returns the string
func (s *UnmarshallableString) UnmarshalText(data []byte) error {
*s = UnmarshallableString(data)
return nil
}
// CommonArgs contains the IgnoreUnknown argument
// and must be embedded by all Arg structs
type CommonArgs struct {
IgnoreUnknown UnmarshallableBool `json:"ignoreunknown,omitempty"`
}
// GetKeyField is a helper function to receive Values
// Values that represent a pointer to a struct
func GetKeyField(keyString string, v reflect.Value) reflect.Value {
return v.Elem().FieldByName(keyString)
}
// UnmarshalableArgsError is used to indicate error unmarshalling args
// from the args-string in the form "K=V;K2=V2;..."
type UnmarshalableArgsError struct {
error
}
// LoadArgs parses args from a string in the form "K=V;K2=V2;..."
func LoadArgs(args string, container interface{}) error {
if args == "" {
return nil
}
containerValue := reflect.ValueOf(container)
pairs := strings.Split(args, ";")
unknownArgs := []string{}
for _, pair := range pairs {
kv := strings.Split(pair, "=")
if len(kv) != 2 {
return fmt.Errorf("ARGS: invalid pair %q", pair)
}
keyString := kv[0]
valueString := kv[1]
keyField := GetKeyField(keyString, containerValue)
if !keyField.IsValid() {
unknownArgs = append(unknownArgs, pair)
continue
}
var keyFieldInterface interface{}
switch {
case keyField.Kind() == reflect.Ptr:
keyField.Set(reflect.New(keyField.Type().Elem()))
keyFieldInterface = keyField.Interface()
case keyField.CanAddr() && keyField.Addr().CanInterface():
keyFieldInterface = keyField.Addr().Interface()
default:
return UnmarshalableArgsError{fmt.Errorf("field '%s' has no valid interface", keyString)}
}
u, ok := keyFieldInterface.(encoding.TextUnmarshaler)
if !ok {
return UnmarshalableArgsError{fmt.Errorf(
"ARGS: cannot unmarshal into field '%s' - type '%s' does not implement encoding.TextUnmarshaler",
keyString, reflect.TypeOf(keyFieldInterface))}
}
err := u.UnmarshalText([]byte(valueString))
if err != nil {
return fmt.Errorf("ARGS: error parsing value of pair %q: %w", pair, err)
}
}
isIgnoreUnknown := GetKeyField("IgnoreUnknown", containerValue).Bool()
if len(unknownArgs) > 0 && !isIgnoreUnknown {
return fmt.Errorf("ARGS: unknown args %q", unknownArgs)
}
return nil
}
```
|
```smalltalk
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNetCore.Identity;
using Newtonsoft.Json;
namespace Ombi.Store.Entities
{
public class OmbiUser : IdentityUser
{
public string Alias { get; set; }
public UserType UserType { get; set; }
/// <summary>
/// This will be the unique Plex/Emby user id reference
/// </summary>
public string ProviderUserId { get; set; }
public DateTime? LastLoggedIn { get; set; }
public string Language { get; set; }
/// <summary>
/// Used to get the Streaming information for media
/// </summary>
[Required]
public string StreamingCountry { get; set; }
public int? MovieRequestLimit { get; set; }
public int? EpisodeRequestLimit { get; set; }
public int? MusicRequestLimit { get; set; }
public RequestLimitType? MovieRequestLimitType { get; set; }
public RequestLimitType? EpisodeRequestLimitType { get; set; }
public RequestLimitType? MusicRequestLimitType { get; set; }
public string UserAccessToken { get; set; }
public string MediaServerToken { get; set; }
public List<NotificationUserId> NotificationUserIds { get; set; }
public List<UserNotificationPreferences> UserNotificationPreferences { get; set; }
[NotMapped]
public bool IsEmbyConnect => UserType == UserType.EmbyConnectUser;
[NotMapped]
public virtual string UserAlias => string.IsNullOrEmpty(Alias) ? UserName : Alias;
[NotMapped]
public bool EmailLogin { get; set; }
[NotMapped] public bool IsSystemUser => UserType == UserType.SystemUser;
[JsonIgnore]
public override string PasswordHash
{
get => base.PasswordHash;
set => base.PasswordHash = value;
}
[JsonIgnore]
public override string SecurityStamp
{
get => base.SecurityStamp;
set => base.SecurityStamp = value;
}
[JsonIgnore]
public override string ConcurrencyStamp
{
get => base.ConcurrencyStamp;
set => base.ConcurrencyStamp = value;
}
}
public enum RequestLimitType
{
Day = 0,
Week = 1,
Month = 2,
}
}
```
|
```c++
#ifndef BKCRACK_TYPES_HPP
#define BKCRACK_TYPES_HPP
/// \file types.hpp
/// \brief Useful types, constants and utility functions
#include <array>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <vector>
/// Base exception type
class BaseError : public std::runtime_error
{
public:
/// Constructor
explicit BaseError(const std::string& type, const std::string& description);
};
// utility functions
/// \return the least significant byte of x
constexpr auto lsb(std::uint32_t x) -> std::uint8_t
{
return x;
}
/// \return the most significant byte of x
constexpr auto msb(std::uint32_t x) -> std::uint8_t
{
return x >> 24;
}
// constants
/// Constant value for bit masking
template <int begin, int end>
constexpr auto mask = std::uint32_t{~0u << begin & ~0u >> (32 - end)};
/// \brief Maximum difference between 32-bits integers A and B[x,32)
/// knowing that A = B + b and b is a byte.
///
/// The following equations show how the difference is bounded by the given constants:
///
/// A = B + b
/// A = B[0,x) + B[x,32) + b
/// A - B[x,32) = B[0,x) + b
/// A - B[x,32) <= 0xffffffff[0,x) + 0xff
template <int x>
constexpr auto maxdiff = std::uint32_t{mask<0, x> + 0xff};
#endif // BKCRACK_TYPES_HPP
```
|
```php
<?php return array(
4 => array('id' => 4 , 'alpha2' => 'af', 'alpha3' => 'afg', 'name' => 'Afganistanas'),
8 => array('id' => 8 , 'alpha2' => 'al', 'alpha3' => 'alb', 'name' => 'Albanija'),
12 => array('id' => 12 , 'alpha2' => 'dz', 'alpha3' => 'dza', 'name' => 'Alyras'),
20 => array('id' => 20 , 'alpha2' => 'ad', 'alpha3' => 'and', 'name' => 'Andora'),
24 => array('id' => 24 , 'alpha2' => 'ao', 'alpha3' => 'ago', 'name' => 'Angola'),
28 => array('id' => 28 , 'alpha2' => 'ag', 'alpha3' => 'atg', 'name' => 'Antigva ir Barbuda'),
32 => array('id' => 32 , 'alpha2' => 'ar', 'alpha3' => 'arg', 'name' => 'Argentina'),
51 => array('id' => 51 , 'alpha2' => 'am', 'alpha3' => 'arm', 'name' => 'Armnija'),
36 => array('id' => 36 , 'alpha2' => 'au', 'alpha3' => 'aus', 'name' => 'Australija'),
40 => array('id' => 40 , 'alpha2' => 'at', 'alpha3' => 'aut', 'name' => 'Austrija'),
31 => array('id' => 31 , 'alpha2' => 'az', 'alpha3' => 'aze', 'name' => 'Azerbaidanas'),
44 => array('id' => 44 , 'alpha2' => 'bs', 'alpha3' => 'bhs', 'name' => 'Bahamos'),
48 => array('id' => 48 , 'alpha2' => 'bh', 'alpha3' => 'bhr', 'name' => 'Bahreinas'),
112 => array('id' => 112, 'alpha2' => 'by', 'alpha3' => 'blr', 'name' => 'Baltarusija'),
50 => array('id' => 50 , 'alpha2' => 'bd', 'alpha3' => 'bgd', 'name' => 'Bangladeas'),
52 => array('id' => 52 , 'alpha2' => 'bb', 'alpha3' => 'brb', 'name' => 'Barbadosas'),
56 => array('id' => 56 , 'alpha2' => 'be', 'alpha3' => 'bel', 'name' => 'Belgija'),
84 => array('id' => 84 , 'alpha2' => 'bz', 'alpha3' => 'blz', 'name' => 'Belizas'),
204 => array('id' => 204, 'alpha2' => 'bj', 'alpha3' => 'ben', 'name' => 'Beninas'),
64 => array('id' => 64 , 'alpha2' => 'bt', 'alpha3' => 'btn', 'name' => 'Butanas'),
68 => array('id' => 68 , 'alpha2' => 'bo', 'alpha3' => 'bol', 'name' => 'Bolivija'),
70 => array('id' => 70 , 'alpha2' => 'ba', 'alpha3' => 'bih', 'name' => 'Bosnija ir Hercegovina'),
72 => array('id' => 72 , 'alpha2' => 'bw', 'alpha3' => 'bwa', 'name' => 'Botsvana'),
76 => array('id' => 76 , 'alpha2' => 'br', 'alpha3' => 'bra', 'name' => 'Brazilija'),
96 => array('id' => 96 , 'alpha2' => 'bn', 'alpha3' => 'brn', 'name' => 'Brunjus'),
100 => array('id' => 100, 'alpha2' => 'bg', 'alpha3' => 'bgr', 'name' => 'Bulgarija'),
854 => array('id' => 854, 'alpha2' => 'bf', 'alpha3' => 'bfa', 'name' => 'Burkina Faso'),
108 => array('id' => 108, 'alpha2' => 'bi', 'alpha3' => 'bdi', 'name' => 'Burundis'),
140 => array('id' => 140, 'alpha2' => 'cf', 'alpha3' => 'caf', 'name' => 'Centrins Afrikos Respublika'),
148 => array('id' => 148, 'alpha2' => 'td', 'alpha3' => 'tcd', 'name' => 'adas'),
152 => array('id' => 152, 'alpha2' => 'cl', 'alpha3' => 'chl', 'name' => 'il'),
203 => array('id' => 203, 'alpha2' => 'cz', 'alpha3' => 'cze', 'name' => 'ekija'),
208 => array('id' => 208, 'alpha2' => 'dk', 'alpha3' => 'dnk', 'name' => 'Danija'),
384 => array('id' => 384, 'alpha2' => 'ci', 'alpha3' => 'civ', 'name' => 'Dramblio Kaulo Krantas'),
212 => array('id' => 212, 'alpha2' => 'dm', 'alpha3' => 'dma', 'name' => 'Dominika'),
214 => array('id' => 214, 'alpha2' => 'do', 'alpha3' => 'dom', 'name' => 'Dominikos Respublika'),
262 => array('id' => 262, 'alpha2' => 'dj', 'alpha3' => 'dji', 'name' => 'Dibutis'),
818 => array('id' => 818, 'alpha2' => 'eg', 'alpha3' => 'egy', 'name' => 'Egiptas'),
218 => array('id' => 218, 'alpha2' => 'ec', 'alpha3' => 'ecu', 'name' => 'Ekvadoras'),
232 => array('id' => 232, 'alpha2' => 'er', 'alpha3' => 'eri', 'name' => 'Eritrja'),
233 => array('id' => 233, 'alpha2' => 'ee', 'alpha3' => 'est', 'name' => 'Estija'),
231 => array('id' => 231, 'alpha2' => 'et', 'alpha3' => 'eth', 'name' => 'Etiopija'),
242 => array('id' => 242, 'alpha2' => 'fj', 'alpha3' => 'fji', 'name' => 'Fidis'),
266 => array('id' => 266, 'alpha2' => 'ga', 'alpha3' => 'gab', 'name' => 'Gabonas'),
270 => array('id' => 270, 'alpha2' => 'gm', 'alpha3' => 'gmb', 'name' => 'Gambija'),
288 => array('id' => 288, 'alpha2' => 'gh', 'alpha3' => 'gha', 'name' => 'Gana'),
300 => array('id' => 300, 'alpha2' => 'gr', 'alpha3' => 'grc', 'name' => 'Graikija'),
308 => array('id' => 308, 'alpha2' => 'gd', 'alpha3' => 'grd', 'name' => 'Grenada'),
268 => array('id' => 268, 'alpha2' => 'ge', 'alpha3' => 'geo', 'name' => 'Gruzija'),
320 => array('id' => 320, 'alpha2' => 'gt', 'alpha3' => 'gtm', 'name' => 'Gvatemala'),
324 => array('id' => 324, 'alpha2' => 'gn', 'alpha3' => 'gin', 'name' => 'Gvinja'),
624 => array('id' => 624, 'alpha2' => 'gw', 'alpha3' => 'gnb', 'name' => 'Bisau Gvinja'),
328 => array('id' => 328, 'alpha2' => 'gy', 'alpha3' => 'guy', 'name' => 'Gajana'),
332 => array('id' => 332, 'alpha2' => 'ht', 'alpha3' => 'hti', 'name' => 'Haitis'),
340 => array('id' => 340, 'alpha2' => 'hn', 'alpha3' => 'hnd', 'name' => 'Hondras'),
348 => array('id' => 348, 'alpha2' => 'hu', 'alpha3' => 'hun', 'name' => 'Vengrija'),
352 => array('id' => 352, 'alpha2' => 'is', 'alpha3' => 'isl', 'name' => 'Islandija'),
356 => array('id' => 356, 'alpha2' => 'in', 'alpha3' => 'ind', 'name' => 'Indija'),
360 => array('id' => 360, 'alpha2' => 'id', 'alpha3' => 'idn', 'name' => 'Indonezija'),
364 => array('id' => 364, 'alpha2' => 'ir', 'alpha3' => 'irn', 'name' => 'Iranas'),
368 => array('id' => 368, 'alpha2' => 'iq', 'alpha3' => 'irq', 'name' => 'Irakas'),
372 => array('id' => 372, 'alpha2' => 'ie', 'alpha3' => 'irl', 'name' => 'Airija'),
376 => array('id' => 376, 'alpha2' => 'il', 'alpha3' => 'isr', 'name' => 'Izraelis'),
380 => array('id' => 380, 'alpha2' => 'it', 'alpha3' => 'ita', 'name' => 'Italija'),
388 => array('id' => 388, 'alpha2' => 'jm', 'alpha3' => 'jam', 'name' => 'Jamaika'),
392 => array('id' => 392, 'alpha2' => 'jp', 'alpha3' => 'jpn', 'name' => 'Japonija'),
400 => array('id' => 400, 'alpha2' => 'jo', 'alpha3' => 'jor', 'name' => 'Jordanija'),
116 => array('id' => 116, 'alpha2' => 'kh', 'alpha3' => 'khm', 'name' => 'Kamboda'),
120 => array('id' => 120, 'alpha2' => 'cm', 'alpha3' => 'cmr', 'name' => 'Kamernas'),
124 => array('id' => 124, 'alpha2' => 'ca', 'alpha3' => 'can', 'name' => 'Kanada'),
156 => array('id' => 156, 'alpha2' => 'cn', 'alpha3' => 'chn', 'name' => 'Kinija'),
170 => array('id' => 170, 'alpha2' => 'co', 'alpha3' => 'col', 'name' => 'Kolumbija'),
174 => array('id' => 174, 'alpha2' => 'km', 'alpha3' => 'com', 'name' => 'Komorai'),
178 => array('id' => 178, 'alpha2' => 'cg', 'alpha3' => 'cog', 'name' => 'Kongo Respublika'),
180 => array('id' => 180, 'alpha2' => 'cd', 'alpha3' => 'cod', 'name' => 'Kongo Demokratin Respublika'),
188 => array('id' => 188, 'alpha2' => 'cr', 'alpha3' => 'cri', 'name' => 'Kosta Rika'),
191 => array('id' => 191, 'alpha2' => 'hr', 'alpha3' => 'hrv', 'name' => 'Kroatija'),
192 => array('id' => 192, 'alpha2' => 'cu', 'alpha3' => 'cub', 'name' => 'Kuba'),
196 => array('id' => 196, 'alpha2' => 'cy', 'alpha3' => 'cyp', 'name' => 'Kipras'),
398 => array('id' => 398, 'alpha2' => 'kz', 'alpha3' => 'kaz', 'name' => 'Kazachstanas'),
404 => array('id' => 404, 'alpha2' => 'ke', 'alpha3' => 'ken', 'name' => 'Kenija'),
296 => array('id' => 296, 'alpha2' => 'ki', 'alpha3' => 'kir', 'name' => 'Kiribatis'),
408 => array('id' => 408, 'alpha2' => 'kp', 'alpha3' => 'prk', 'name' => 'iaurs Korja'),
410 => array('id' => 410, 'alpha2' => 'kr', 'alpha3' => 'kor', 'name' => 'Piet Korja'),
414 => array('id' => 414, 'alpha2' => 'kw', 'alpha3' => 'kwt', 'name' => 'Kuveitas'),
417 => array('id' => 417, 'alpha2' => 'kg', 'alpha3' => 'kgz', 'name' => 'Kirgizija'),
418 => array('id' => 418, 'alpha2' => 'la', 'alpha3' => 'lao', 'name' => 'Laosas'),
428 => array('id' => 428, 'alpha2' => 'lv', 'alpha3' => 'lva', 'name' => 'Latvija'),
422 => array('id' => 422, 'alpha2' => 'lb', 'alpha3' => 'lbn', 'name' => 'Libanas'),
426 => array('id' => 426, 'alpha2' => 'ls', 'alpha3' => 'lso', 'name' => 'Lesotas'),
430 => array('id' => 430, 'alpha2' => 'lr', 'alpha3' => 'lbr', 'name' => 'Liberija'),
434 => array('id' => 434, 'alpha2' => 'ly', 'alpha3' => 'lby', 'name' => 'Libija'),
438 => array('id' => 438, 'alpha2' => 'li', 'alpha3' => 'lie', 'name' => 'Lichtenteinas'),
440 => array('id' => 440, 'alpha2' => 'lt', 'alpha3' => 'ltu', 'name' => 'Lietuva'),
442 => array('id' => 442, 'alpha2' => 'lu', 'alpha3' => 'lux', 'name' => 'Liuksemburgas'),
807 => array('id' => 807, 'alpha2' => 'mk', 'alpha3' => 'mkd', 'name' => 'Makedonija'),
450 => array('id' => 450, 'alpha2' => 'mg', 'alpha3' => 'mdg', 'name' => 'Madagaskaras'),
454 => array('id' => 454, 'alpha2' => 'mw', 'alpha3' => 'mwi', 'name' => 'Malavis'),
458 => array('id' => 458, 'alpha2' => 'my', 'alpha3' => 'mys', 'name' => 'Malaizija'),
462 => array('id' => 462, 'alpha2' => 'mv', 'alpha3' => 'mdv', 'name' => 'Maldyvai'),
466 => array('id' => 466, 'alpha2' => 'ml', 'alpha3' => 'mli', 'name' => 'Malis'),
470 => array('id' => 470, 'alpha2' => 'mt', 'alpha3' => 'mlt', 'name' => 'Malta'),
584 => array('id' => 584, 'alpha2' => 'mh', 'alpha3' => 'mhl', 'name' => 'Maralo salos'),
478 => array('id' => 478, 'alpha2' => 'mr', 'alpha3' => 'mrt', 'name' => 'Mauritanija'),
480 => array('id' => 480, 'alpha2' => 'mu', 'alpha3' => 'mus', 'name' => 'Mauricijus'),
484 => array('id' => 484, 'alpha2' => 'mx', 'alpha3' => 'mex', 'name' => 'Meksika'),
583 => array('id' => 583, 'alpha2' => 'fm', 'alpha3' => 'fsm', 'name' => 'Mikronezija'),
498 => array('id' => 498, 'alpha2' => 'md', 'alpha3' => 'mda', 'name' => 'Moldavija'),
492 => array('id' => 492, 'alpha2' => 'mc', 'alpha3' => 'mco', 'name' => 'Monakas'),
496 => array('id' => 496, 'alpha2' => 'mn', 'alpha3' => 'mng', 'name' => 'Mongolija'),
499 => array('id' => 499, 'alpha2' => 'me', 'alpha3' => 'mne', 'name' => 'Juodkalnija'),
504 => array('id' => 504, 'alpha2' => 'ma', 'alpha3' => 'mar', 'name' => 'Marokas'),
508 => array('id' => 508, 'alpha2' => 'mz', 'alpha3' => 'moz', 'name' => 'Mozambikas'),
104 => array('id' => 104, 'alpha2' => 'mm', 'alpha3' => 'mmr', 'name' => 'Mianmaras'),
516 => array('id' => 516, 'alpha2' => 'na', 'alpha3' => 'nam', 'name' => 'Namibija'),
520 => array('id' => 520, 'alpha2' => 'nr', 'alpha3' => 'nru', 'name' => 'Nauru'),
524 => array('id' => 524, 'alpha2' => 'np', 'alpha3' => 'npl', 'name' => 'Nepalas'),
528 => array('id' => 528, 'alpha2' => 'nl', 'alpha3' => 'nld', 'name' => 'Nyderlandai'),
554 => array('id' => 554, 'alpha2' => 'nz', 'alpha3' => 'nzl', 'name' => 'Naujoji Zelandija'),
558 => array('id' => 558, 'alpha2' => 'ni', 'alpha3' => 'nic', 'name' => 'Nikaragva'),
562 => array('id' => 562, 'alpha2' => 'ne', 'alpha3' => 'ner', 'name' => 'Nigeris'),
566 => array('id' => 566, 'alpha2' => 'ng', 'alpha3' => 'nga', 'name' => 'Nigerija'),
578 => array('id' => 578, 'alpha2' => 'no', 'alpha3' => 'nor', 'name' => 'Norvegija'),
512 => array('id' => 512, 'alpha2' => 'om', 'alpha3' => 'omn', 'name' => 'Omanas'),
586 => array('id' => 586, 'alpha2' => 'pk', 'alpha3' => 'pak', 'name' => 'Pakistanas'),
585 => array('id' => 585, 'alpha2' => 'pw', 'alpha3' => 'plw', 'name' => 'Palau'),
591 => array('id' => 591, 'alpha2' => 'pa', 'alpha3' => 'pan', 'name' => 'Panama'),
250 => array('id' => 250, 'alpha2' => 'fr', 'alpha3' => 'fra', 'name' => 'Pranczija'),
598 => array('id' => 598, 'alpha2' => 'pg', 'alpha3' => 'png', 'name' => 'Papua Naujoji Gvinja'),
600 => array('id' => 600, 'alpha2' => 'py', 'alpha3' => 'pry', 'name' => 'Paragvajus'),
226 => array('id' => 226, 'alpha2' => 'gq', 'alpha3' => 'gnq', 'name' => 'Pusiaujo Gvinja'),
604 => array('id' => 604, 'alpha2' => 'pe', 'alpha3' => 'per', 'name' => 'Peru'),
608 => array('id' => 608, 'alpha2' => 'ph', 'alpha3' => 'phl', 'name' => 'Filipinai'),
616 => array('id' => 616, 'alpha2' => 'pl', 'alpha3' => 'pol', 'name' => 'Lenkija'),
620 => array('id' => 620, 'alpha2' => 'pt', 'alpha3' => 'prt', 'name' => 'Portugalija'),
634 => array('id' => 634, 'alpha2' => 'qa', 'alpha3' => 'qat', 'name' => 'Kataras'),
642 => array('id' => 642, 'alpha2' => 'ro', 'alpha3' => 'rou', 'name' => 'Rumunija'),
643 => array('id' => 643, 'alpha2' => 'ru', 'alpha3' => 'rus', 'name' => 'Rusija'),
646 => array('id' => 646, 'alpha2' => 'rw', 'alpha3' => 'rwa', 'name' => 'Ruanda'),
222 => array('id' => 222, 'alpha2' => 'sv', 'alpha3' => 'slv', 'name' => 'Salvadoras'),
659 => array('id' => 659, 'alpha2' => 'kn', 'alpha3' => 'kna', 'name' => 'Sent Kitsas ir Nevis'),
662 => array('id' => 662, 'alpha2' => 'lc', 'alpha3' => 'lca', 'name' => 'Sent Lusija'),
670 => array('id' => 670, 'alpha2' => 'vc', 'alpha3' => 'vct', 'name' => 'Sent Vinsentas ir Grenadinai'),
882 => array('id' => 882, 'alpha2' => 'ws', 'alpha3' => 'wsm', 'name' => 'Samoa'),
674 => array('id' => 674, 'alpha2' => 'sm', 'alpha3' => 'smr', 'name' => 'San Marinas'),
678 => array('id' => 678, 'alpha2' => 'st', 'alpha3' => 'stp', 'name' => 'San Tom ir Prinsip'),
682 => array('id' => 682, 'alpha2' => 'sa', 'alpha3' => 'sau', 'name' => 'Saudo Arabija'),
686 => array('id' => 686, 'alpha2' => 'sn', 'alpha3' => 'sen', 'name' => 'Senegalas'),
688 => array('id' => 688, 'alpha2' => 'rs', 'alpha3' => 'srb', 'name' => 'Serbija'),
690 => array('id' => 690, 'alpha2' => 'sc', 'alpha3' => 'syc', 'name' => 'Seieliai'),
694 => array('id' => 694, 'alpha2' => 'sl', 'alpha3' => 'sle', 'name' => 'Siera Leon'),
702 => array('id' => 702, 'alpha2' => 'sg', 'alpha3' => 'sgp', 'name' => 'Singapras'),
246 => array('id' => 246, 'alpha2' => 'fi', 'alpha3' => 'fin', 'name' => 'Suomija'),
703 => array('id' => 703, 'alpha2' => 'sk', 'alpha3' => 'svk', 'name' => 'Slovakija'),
705 => array('id' => 705, 'alpha2' => 'si', 'alpha3' => 'svn', 'name' => 'Slovnija'),
90 => array('id' => 90 , 'alpha2' => 'sb', 'alpha3' => 'slb', 'name' => 'Saliamono Salos'),
706 => array('id' => 706, 'alpha2' => 'so', 'alpha3' => 'som', 'name' => 'Somalis'),
710 => array('id' => 710, 'alpha2' => 'za', 'alpha3' => 'zaf', 'name' => 'PAR'),
728 => array('id' => 728, 'alpha2' => 'ss', 'alpha3' => 'ssd', 'name' => 'Piet Sudanas'),
724 => array('id' => 724, 'alpha2' => 'es', 'alpha3' => 'esp', 'name' => 'Ispanija'),
144 => array('id' => 144, 'alpha2' => 'lk', 'alpha3' => 'lka', 'name' => 'ri Lanka'),
729 => array('id' => 729, 'alpha2' => 'sd', 'alpha3' => 'sdn', 'name' => 'Sudanas'),
740 => array('id' => 740, 'alpha2' => 'sr', 'alpha3' => 'sur', 'name' => 'Surinamas'),
748 => array('id' => 748, 'alpha2' => 'sz', 'alpha3' => 'swz', 'name' => 'Svazilendas'),
752 => array('id' => 752, 'alpha2' => 'se', 'alpha3' => 'swe', 'name' => 'vedija'),
756 => array('id' => 756, 'alpha2' => 'ch', 'alpha3' => 'che', 'name' => 'veicarija'),
760 => array('id' => 760, 'alpha2' => 'sy', 'alpha3' => 'syr', 'name' => 'Sirija'),
762 => array('id' => 762, 'alpha2' => 'tj', 'alpha3' => 'tjk', 'name' => 'Tadikija'),
834 => array('id' => 834, 'alpha2' => 'tz', 'alpha3' => 'tza', 'name' => 'Tanzanija'),
764 => array('id' => 764, 'alpha2' => 'th', 'alpha3' => 'tha', 'name' => 'Tailandas'),
626 => array('id' => 626, 'alpha2' => 'tl', 'alpha3' => 'tls', 'name' => 'Ryt Timoras'),
768 => array('id' => 768, 'alpha2' => 'tg', 'alpha3' => 'tgo', 'name' => 'Togas'),
776 => array('id' => 776, 'alpha2' => 'to', 'alpha3' => 'ton', 'name' => 'Tonga'),
780 => array('id' => 780, 'alpha2' => 'tt', 'alpha3' => 'tto', 'name' => 'Trinidadas ir Tobagas'),
788 => array('id' => 788, 'alpha2' => 'tn', 'alpha3' => 'tun', 'name' => 'Tunisas'),
792 => array('id' => 792, 'alpha2' => 'tr', 'alpha3' => 'tur', 'name' => 'Turkija'),
795 => array('id' => 795, 'alpha2' => 'tm', 'alpha3' => 'tkm', 'name' => 'Turkmnija'),
798 => array('id' => 798, 'alpha2' => 'tv', 'alpha3' => 'tuv', 'name' => 'Tuvalu'),
800 => array('id' => 800, 'alpha2' => 'ug', 'alpha3' => 'uga', 'name' => 'Uganda'),
804 => array('id' => 804, 'alpha2' => 'ua', 'alpha3' => 'ukr', 'name' => 'Ukraina'),
784 => array('id' => 784, 'alpha2' => 'ae', 'alpha3' => 'are', 'name' => 'Jungtiniai Arab Emyratai'),
826 => array('id' => 826, 'alpha2' => 'gb', 'alpha3' => 'gbr', 'name' => 'Jungtin Karalyst'),
840 => array('id' => 840, 'alpha2' => 'us', 'alpha3' => 'usa', 'name' => 'Jungtins Valstijos'),
858 => array('id' => 858, 'alpha2' => 'uy', 'alpha3' => 'ury', 'name' => 'Urugvajus'),
860 => array('id' => 860, 'alpha2' => 'uz', 'alpha3' => 'uzb', 'name' => 'Uzbekistanas'),
548 => array('id' => 548, 'alpha2' => 'vu', 'alpha3' => 'vut', 'name' => 'Vanuatu'),
862 => array('id' => 862, 'alpha2' => 've', 'alpha3' => 'ven', 'name' => 'Venesuela'),
276 => array('id' => 276, 'alpha2' => 'de', 'alpha3' => 'deu', 'name' => 'Vokietija'),
704 => array('id' => 704, 'alpha2' => 'vn', 'alpha3' => 'vnm', 'name' => 'Vietnamas'),
887 => array('id' => 887, 'alpha2' => 'ye', 'alpha3' => 'yem', 'name' => 'Jemenas'),
894 => array('id' => 894, 'alpha2' => 'zm', 'alpha3' => 'zmb', 'name' => 'Zambija'),
716 => array('id' => 716, 'alpha2' => 'zw', 'alpha3' => 'zwe', 'name' => 'Zimbabv'),
132 => array('id' => 132, 'alpha2' => 'cv', 'alpha3' => 'cpv', 'name' => 'aliasis Kyulys'),
);
```
|
GOP Varieté Essen is a theatre in Essen, North Rhine-Westphalia, Germany.
Theatres in Essen
Buildings and structures in Essen
|
{{Infobox song
| name = Faith of the Heart
| cover = Rod Stewart - Faith of the Heart.jpg
| alt =
| caption = United States single cover
| type = single
| artist = Rod Stewart
| album = Patch Adams: Original Motion Picture Soundtrack
| B-side = 'Patch Adams "Main Title
| released =
| recorded = 1999
| studio =
| venue =
| genre = Pop rock
| length = 4:17
| label = Universal
| writer = Diane Warren
| producer = Guy Roche
| prev_title = When We Were the New Boys
| prev_year = 1998
| next_title = Run Back Into Your Arms
| next_year = 2000
}}
"Faith of the Heart" is a song written by Diane Warren and performed by Rod Stewart, for the soundtrack to the 1998 film, Patch Adams. Stewart's version charted at number 3 on the US Adult Contemporary chart and number 60 on the UK Singles Chart. It was warmly received by critics. The song was later covered in 1999 by Susan Ashton for her album Closer and released as her first single in the country music genre.
It was also recorded by English tenor Russell Watson as "Where My Heart Will Take Me" in order to be used as a theme to the 2001 television series Star Trek: Enterprise. This version of the song was used on four occasions as wake-up calls onboard Space Shuttle missions, and performed by Watson at the 2002 Commonwealth Games. Watson also recorded a special version of the song to be played for the final wake up of the New Horizons exploration spacecraft on December 6, 2014.
Development and release
"Faith of the Heart" appeared on the soundtrack to the 1998 film Patch Adams. It was released on the Universal Records label and produced by Guy Roche. The B-side of the release was the main title theme to the film. The song was released less than a month after Stewart's separation from his wife Rachel Hunter.
Reception
The song was most successful in the Billboard Adult Contemporary within the United States, reaching third place in the chart. The performance of the single placed it in twentieth spot on the Billboard Adult Contemporary chart for the year end 1999.
William Ruhlmann at the website Allmusic described "Faith of the Heart" as a power ballad which is "a standard effort for its genre". Chuck Taylor, reviewed the song for Billboard and said that it was one of Stewart's "more enjoyable performances in the last couple of years", and thought that the song could have just as easily been sung by Celine Dion or LeAnn Rimes.
Susan Ashton cover version
Susan Ashton was previously known for being a singer of contemporary Christian music, but decided to move into the country music genre after signing a deal with Columbia Records. She developed the album Closer, which featured a cover of the Rod Stewart single "Faith of the Heart". It was the first release from the album, but was not as successful as the following single, "You're Lucky I Love You". She considered between 800 and 1000 songs to appear on the album, reducing the number down to ten.
Reception
Tim Anderson, writing in his Country Beat column for Yakima Herald-Republic described Susan Ashton's "Faith of the Heart" as "a definite winner" but that it "did take a couple listens to really hook" him. The release of the single by Ashton was predicted by Brian Mansfield for USA Today as being the first of a career that would increase sales for the country music genre following Aston's previous success with Christian music.
Russell Watson cover version
"Where My Heart Will Take Me" is a reworked version of "Faith of the Heart" which was performed by English tenor Russell Watson as the theme song to the 2001 television series Star Trek: Enterprise. It was also used on four occasions as wake-up calls on Space Shuttle missions, and was performed by Watson at the opening ceremony of the 2002 Commonwealth Games. It was poorly received by some Star Trek fans who created petitions and protested against the use of the song as a theme.
Development and release
It was the first time that an actual vocal theme was used in a Star Trek series. Watson had been approached by the producers of Enterprise and the song's writer, Diane Warren. As he was a fan of Star Trek and as Warren had already written a song for his second album, he agreed to the proposal. The song was featured on the soundtrack to Enterprise and Watson's 2002 album, Encore. The song was re-recorded for the third and fourth seasons of Enterprise. An instrumental version of the theme was played over the closing credits of the series' first episode, "Broken Bow", but was not used again in the series. One two-part episode from its fourth season, "In a Mirror, Darkly", replaced the theme with a different instrumental composition to reflect that storyline taking place in an alternate universe. As of 2019 it stands as the only Star Trek theme by a female composer.
The song has been used on four occasions as the music selected for wake-up calls on space missions. The first was on 16 June 2002 for the Space Shuttle Endeavour during mission STS-111 to the International Space Station. It was again used on 2 August 2005 for mission STS-114, the first mission of the Space Shuttle programme following the Space Shuttle Columbia disaster. It was broadcast to the seven crew of the Space Shuttle Discovery, and had been chosen as a surprise for the crew by Deputy Shuttle Programme Manager Wayne Hale. NASA astronaut Richard Mastracchio selected "Where My Heart Will Take Me" for broadcast on 9 August 2007 onboard Endeavour for STS-118. The final broadcast on board a Space Shuttle was on May 23, 2009 during STS-125, the final Space Shuttle servicing mission to the Hubble Space Telescope. On this occasion it was broadcast to the crew of the Space Shuttle Atlantis. It was the third science fiction themed wake-up call in a row, the previous day having been the Cantina Band composition by John Williams for Star Wars, and two days prior was Alexander Courage's Theme from Star Trek.
Reception
Following the pilot episode of Star Trek: Enterprise, "Broken Bow", and the debut of the song as the series' theme tune, the reception among Star Trek fans was mostly negative. Such was the response, that online petitions were formed and a protest held outside Paramount Studios against the use of the song. One petition stated that "We wish to express our unmitigated disgust with the theme song that has been selected for the new 'Enterprise' series, it is not fit to be scraped off the bottom of a Klingon's boot." Actor Simon Pegg, who played engineer Montgomery Scott in Star Trek and Star Trek Beyond later said that he had never watched Enterprise due to the song, which he described as "dreadful soft-rock" and "probably the most hideous Star Trek moment in history". The song was mentioned in the review of the Enterprise first season DVD set by DVD Talk. It was called "sappy", and the reviewer said that it "never felt appropriate and serves only to undercut the emotional strength of the images on screen".
Executive producer of Enterprise, Rick Berman, praised the song, saying that it was a song "that's got a lot of hopefulness and uplifting qualities to it. And I like it. I've met a lot of other people who like it, but I've also heard a tremendous amount of banter about people who don't." Enterprise'' co-creator Brannon Braga also defended the song, saying of the protest, "There are some people who love the song and there are people who think it's cheesy. They came with a petition with 1,000 signatures. But plenty of people find the song very uplifting." Watson also said of the response to the song, "Something new happens, and people aren't quite sure of it. But they'll get used to it. By the time they've watched the 20th episode, they'll be thinking, 'Well, it's not that bad after all."
Live performances
Russell Watson performed "Where My Heart Will Take Me" as part of the opening ceremony of the 2002 Commonwealth Games, alongside a choir. The choir subsequently performed the song at a ceremony to mark the retirement of Bishop Christopher Mayfield from his post as Bishop of Manchester.
Charts
Rod Stewart version
Year-end charts
Susan Ashton version
References
External links
1999 singles
Rod Stewart songs
Songs written by Diane Warren
Songs written for films
Susan Ashton songs
Rock ballads
1998 songs
Television drama theme songs
1990s ballads
Star Trek: Enterprise
Universal Records singles
Capitol Records Nashville singles
|
Ryu Won-woo (; born 5 August 1990) is a South Korean footballer who plays as a goalkeeper for Pohang Steelers.
External links
1990 births
Living people
Sportspeople from Gwangju
South Korean men's footballers
Men's association football goalkeepers
Jeonnam Dragons players
Gwangju FC players
Bucheon FC 1995 players
Pohang Steelers players
K League 1 players
K League 2 players
|
Everything Ecstatic is the fourth album by Four Tet, released on 23 May 2005.
The video for lead single "Smile Around the Face" features actor Mark Heap.
Track listing
"A Joy" – 3:07
"Smile Around the Face" – 4:30
"Fuji Check" – 0:23
"Sun Drums and Soil" – 6:14
"Clouding" – 1:43
"And Then Patterns" – 4:42
"High Fives" – 5:06
"Turtle Turtle Up" – 2:09
"Sleep, Eat Food, Have Visions" – 7:43
"You Were There With Me" – 5:52
DVD edition
A DVD edition of the album, featuring a video for each of the tracks, was released on 7 November 2005 and comes with a bonus CD of previously unreleased material, Everything Ecstatic Part 2, the track listing of which is as follows:
"Turtle Turtle Up (extended version)" – 16:16
"Sun Drums and Soil (part 2)" – 5:31
"Watching Wavelength" – 4:31
"This is Six Minutes" – 6:03
"Ending" – 0:50
Everything Ecstatic Part 2 was later released separately on vinyl through Domino Records.
Charts
References
External links
Everything Ecstatic release page from the Domino Records website
2005 albums
Domino Recording Company albums
Four Tet albums
Albums produced by Kieran Hebden
|
```css
/*! jQuery UI - v1.10.4 - 2014-02-16
* path_to_url
.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}
```
|
White Haven is a borough in Luzerne County, Pennsylvania, United States. It is located along the Lehigh River. The population was 1,163 at the 2020 census.
History
Establishment
White Haven was created in 1824 by industrialist Josiah White. It was later incorporated as a borough in 1842.
Coal mining and railroads
Early European explorers to the Wyoming Valley encountered a new form of coal, known as anthracite, that was abundant throughout the region. At the time, anthracite was a valuable commodity without a good use. On February 11, 1808, Wilkes-Barre Judge Jesse Fell created the first iron grate in the valley to successfully burn anthracite. This invention increased the popularity of anthracite as a fuel source. This led to the expansion of the coal industry in Northeastern Pennsylvania. Throughout the 1800s, canals and railroads were constructed to aid in the mining and transportation of coal. Luzerne County witnessed a population boom with the expansion of the coal mining industry.
The Lehigh Coal and Navigation Company chartered the Lehigh and Susquehanna Railroad on March 31, 1837, in order to link Wilkes-Barre to White Haven. Construction of the railroad began in 1839 and was completed in the 1840s. The arduous route required the construction of a tunnel and three inclined planes, including Ashley Planes.
With the completion of the Lehigh and Susquehanna Railroad, the canal industry, which had existed for no more than one generation, faced a rapid extinction. The Lehigh and Susquehanna Railroad moved Wyoming Valley anthracite from its various coal fields to White Haven; over the Appalachian Mountains that had posed such a challenge to settlers for 150 years. Once the Lehigh and Susquehanna Railroad reached White Haven, an extensive transportation network expeditiously and economically delivered the Wyoming Valley's anthracite to a waiting market. By 1867, the Lehigh Valley Railroad, which was first established in the Hazleton area's coal fields, was linked to Wilkes-Barre, and then in 1869, the Lehigh Valley Railroad was connected to other rail systems in New York state.
Geography
White Haven is located at (41.059532, -75.776123). The borough is south of Wilkes-Barre, and west of the I-476 and I-80 interchange. According to the U.S. Census Bureau, the borough has a total area of , of which is land and , or 2.12%, is water. White Haven's elevation is above sea level.
Recreation
Lehigh Gorge State Park, which encompasses the Lehigh River, provides White Haven and the surrounding communities with a plethora of recreational activities. Water released from the Francis E. Walter Dam makes the river deep enough for boating. White water rafting is a very popular recreational activity in the park. Other activities include fishing, hiking, bicycling, sight-seeing, snowmobiling, and much more.
Demographics
As of the census of 2000, there were 1,182 people, 468 households, and 329 families residing in the borough. The population density was . There were 515 housing units at an average density of . The racial makeup of the borough was 98.39% White, 0.08% Native American, 1.27% Asian, and 0.25% from two or more races. Hispanic or Latino of any race were 0.76% of the population.
The main ancestries reported by White Haven residents on the 2000 Census were Polish, with 17% of the population, Italian with 13%, Irish with 10%, Slovak with 8%, and German with 6%. However, Czechoslovakian, Carpatho Rusyn, Eastern European and Slavic were all reported by about one percent of the population, so the Slovak population might have come in second to Polish if the census had allowed reporting of more than two ancestries.
There were 468 households, out of which 34.0% had children under the age of 18 living with them, 52.6% were married couples living together, 12.8% had a female householder with no husband present, and 29.5% were non-families. 26.5% of all households were made up of individuals, and 14.1% had someone living alone who was 65 years of age or older. The average household size was 2.53 and the average family size was 3.06.
In the borough the population was spread out, with 27.3% under the age of 18, 7.3% from 18 to 24, 28.0% from 25 to 44, 20.9% from 45 to 64, and 16.5% who were 65 years of age or older. The median age was 37 years. For every 100 females there were 87.3 males. For every 100 females age 18 and over, there were 88.8 males.
The median income for a household in the borough was $37,438, and the median income for a family was $43,846. Males had a median income of $32,159 versus $27,386 for females. The per capita income for the borough was $18,768. About 4.5% of families and 6.4% of the population were below the poverty line, including 8.3% of those under age 18 and 8.8% of those age 65 or over.
Notable people
Evelyn Colon, a formerly unidentified murder victim found in White Haven in 1976 and identified in 2021
John J. Dempsey, governor of New Mexico
Warren Newton Dusenberry, educator
Liz Lemon, fictional character played by Tina Fey on the NBC comedy 30 Rock
Edith King, actress
Brad Kocher, Major League baseball catcher
Ron Mrozinski, Major League baseball pitcher
A. Mitchell Palmer, Attorney General in the cabinet of Woodrow Wilson
Darin Young, professional darts player
See also
Lehigh Valley Railroad Engine House, White Haven
References
External links
Populated places established in 1824
Boroughs in Luzerne County, Pennsylvania
1842 establishments in Pennsylvania
Populated places on the Lehigh River
|
"Save Me" is a song by the American songwriter Aimee Mann. It appears on the Magnolia soundtrack, which was released on December 7, 1999.
Reception
"Save Me" was nominated for an Academy Award for Best Original Song; Mann performed it at the 72nd Academy Awards. It lost to "You'll Be in My Heart", by Phil Collins, from the Disney movie Tarzan. By way of introduction to a live performance, Mann has referred to "Save Me" as "the song that lost an Oscar to Phil Collins and his cartoon monkey love song." "Save Me" was also nominated for a Grammy Award for Best Female Pop Vocal Performance.
In 2022, Pitchfork named "Save Me" the 193rd best song of the 1990s. The critic Eric Torres wrote: "Subtly informed by a long period of disappointment, 'Save Me' is wry but surefooted ... The featherlight production and songwriting belie its inevitable punch: Here, Mann underscores the raw tenderness that comes with searching for help."
Mann later said the song "really gave a blood transfusion to my career. But it wasn't like I went from playing to five people to 5,000 people. It was just a real influx of energy." The song was written about Dave Foley, according to a 2012 interview with him.
Music video
The music video, shot during the filming of Magnolia, was directed by the film's director, Paul Thomas Anderson, and uses many of the film's actors, including Julianne Moore, Philip Seymour Hoffman, Tom Cruise, William H. Macy, and John C. Reilly. The video inserts Mann into various scenes from the film as she performs the song. Unlike many such music videos, the "Save Me" video used no digital manipulation; the scenes were shot at the end of filming days with Mann and actors who were asked to stay in place.
References
1999 songs
Aimee Mann songs
Songs written for films
Songs written by Aimee Mann
Rock ballads
Music videos directed by Paul Thomas Anderson
Reprise Records singles
|
```java
/*
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser
* or (at your option) any later version.
*
* This library 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.
*
* you can get a copy from path_to_url or write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.jaudiotagger.tag.id3.framebody;
import org.jaudiotagger.tag.InvalidTagException;
import org.jaudiotagger.tag.datatype.*;
import org.jaudiotagger.tag.id3.ID3TextEncodingConversion;
import org.jaudiotagger.tag.id3.ID3v24Frames;
import org.jaudiotagger.tag.id3.valuepair.TextEncoding;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
/**
* Ownership frame.
*
*
* The ownership frame might be used as a reminder of a made transaction
* or, if signed, as proof. Note that the "USER" and "TOWN" frames are
* good to use in conjunction with this one. The frame begins, after the
* frame ID, size and encoding fields, with a 'price payed' field. The
* first three characters of this field contains the currency used for
* the transaction, encoded according to ISO-4217 alphabetic
* currency code. Concatenated to this is the actual price payed, as a
* numerical string using "." as the decimal separator. Next is an 8
* character date string (YYYYMMDD) followed by a string with the name
* of the seller as the last field in the frame. There may only be one
* "OWNE" frame in a tag.
* <p><table border=0 width="70%">
* <tr><td><Header for 'Ownership frame', ID: "OWNE"></td></tr>
* <tr><td>Text encoding </td><td>$xx </td></tr>
* <tr><td>Price payed </td><td><text string> $00 </td></tr>
* <tr><td>Date of purch. </td><td><text string> </td></tr>
* <tr><td>Seller</td><td><text string according to encoding></td></tr>
* </table>
*
* <p>For more details, please refer to the ID3 specifications:
* <ul>
* <li><a href="path_to_url">ID3 v2.3.0 Spec</a>
* </ul>
*
* @author : Paul Taylor
* @author : Eric Farng
* @version $Id$
*/
public class FrameBodyOWNE extends AbstractID3v2FrameBody implements ID3v24FrameBody, ID3v23FrameBody
{
/**
* Creates a new FrameBodyOWNE datatype.
*/
public FrameBodyOWNE()
{
// this.setObject("Text Encoding", new Byte((byte) 0));
// this.setObject("Price Paid", "");
// this.setObject("Date Of Purchase", "");
// this.setObject("Seller", "");
}
public FrameBodyOWNE(FrameBodyOWNE body)
{
super(body);
}
/**
* Creates a new FrameBodyOWNE datatype.
*
* @param textEncoding
* @param pricePaid
* @param dateOfPurchase
* @param seller
*/
public FrameBodyOWNE(byte textEncoding, String pricePaid, String dateOfPurchase, String seller)
{
this.setObjectValue(DataTypes.OBJ_TEXT_ENCODING, textEncoding);
this.setObjectValue(DataTypes.OBJ_PRICE_PAID, pricePaid);
this.setObjectValue(DataTypes.OBJ_PURCHASE_DATE, dateOfPurchase);
this.setObjectValue(DataTypes.OBJ_SELLER_NAME, seller);
}
/**
* Creates a new FrameBodyOWNE datatype.
*
* @param byteBuffer
* @param frameSize
* @throws InvalidTagException if unable to create framebody from buffer
*/
public FrameBodyOWNE(ByteBuffer byteBuffer, int frameSize) throws InvalidTagException
{
super(byteBuffer, frameSize);
}
/**
* The ID3v2 frame identifier
*
* @return the ID3v2 frame identifier for this frame type
*/
public String getIdentifier()
{
return ID3v24Frames.FRAME_ID_OWNERSHIP;
}
/**
* If the seller name cannot be encoded using current encoder, change the encoder
*/
public void write(ByteArrayOutputStream tagBuffer)
{
//Ensure valid for type
setTextEncoding(ID3TextEncodingConversion.getTextEncoding(getHeader(), getTextEncoding()));
//Ensure valid for data
if (!((AbstractString) getObject(DataTypes.OBJ_SELLER_NAME)).canBeEncoded())
{
this.setTextEncoding(ID3TextEncodingConversion.getUnicodeTextEncoding(getHeader()));
}
super.write(tagBuffer);
}
/**
*
*/
protected void setupObjectList()
{
objectList.add(new NumberHashMap(DataTypes.OBJ_TEXT_ENCODING, this, TextEncoding.TEXT_ENCODING_FIELD_SIZE));
objectList.add(new StringNullTerminated(DataTypes.OBJ_PRICE_PAID, this));
objectList.add(new StringDate(DataTypes.OBJ_PURCHASE_DATE, this));
objectList.add(new TextEncodedStringSizeTerminated(DataTypes.OBJ_SELLER_NAME, this));
}
}
```
|
David Patrick Brown (born 29 May 1989) is an English footballer who plays as a striker. He came through the Leeds United Academy, before moving to Nottingham Forest. He scored on his Football League debut for Bradford City. Throughout his career he has won 3 promotions and has claimed Player of the year on one occasion in 2015.
Career
Brown was born in York, North Yorkshire, and spent ten years in Leeds United's youth set up before he moved to Nottingham Forest at the start of the 2007–08 season. In November 2007, he joined Eastwood Town on an initial one-month loan, which was later extended for a second month. He returned to Forest in January 2008, after scoring five goals in ten games with Eastwood. He departed Forest and joined Bradford City on deadline day. After scoring twice in a 4–4 reserve game with Sunderland and another against Hull City, he was handed a contract until the end of the season. He made his debut two days later on 2 February 2008 as a second-half substitute and scored six minutes after he came on to give Bradford a 1–0 victory over Macclesfield Town. On 29 April 2008, Brown along with another 12 players out of contract were deemed to be surplus to requirements at Valley Parade and was released by manager Stuart McCall. He played five games for City, all as substitute.
Following his departure, Brown joined Conference National club York City on trial in July 2008, scoring twice in a pre-season friendly game against Tadcaster Albion, which York won 6–0. However, York manager Colin Walker said Brown and two other trialists were only making up the numbers and were unlikely to be signed permanently. Later the same month, he was given a trial at Northern Premier League Premier Division side Guiseley, coming on as a second-half substitute in a 2–1 pre-season friendly victory over former side Bradford City. After scoring 2 goals in another pre-season game against a Leeds United XI, he joined Guiseley on a permanent basis.
In January 2009, he joined Northern Premier League Division One North side Halifax Town along with fellow Bradford City player Paul Evans. Brown's debut was as a substitute one day after signing for Halifax, when he scored the final goal during a 4–1 victory against Wakefield.
Brown finished the season with Halifax, but in June 2009, he returned to Conference North side Eastwood Town, where he had previously played on loan.
References
External links
1989 births
Living people
People from Tadcaster
English men's footballers
Men's association football forwards
Leeds United F.C. players
Nottingham Forest F.C. players
Eastwood Town F.C. players
Bradford City A.F.C. players
Guiseley A.F.C. players
FC Halifax Town players
Bradford (Park Avenue) A.F.C. players
English Football League players
Tadcaster Albion A.F.C. players
Garforth Town A.F.C. players
|
```javascript
function foo() {
return a ? b : (c = d, z);
}
```
|
The 2011 Grand Prix de Denain was the 53rd edition of the Grand Prix de Denain cycle race and was held on 14 April 2011. The race started and finished in Denain. The race was won by Jimmy Casper.
General classification
References
2011
2011 in road cycling
2011 in French sport
|
The Canadian federal budget for fiscal year 1987-1988 was presented by Minister of Finance Michael Wilson in the House of Commons of Canada on 18 February 1987.
External links
Budget Speech
Budget Papers
References
Canadian budgets
1987 in Canadian law
1987 government budgets
1987 in Canadian politics
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="path_to_url">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug|Win32">
<Configuration>debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="checked|Win32">
<Configuration>checked</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="profile|Win32">
<Configuration>profile</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="release|Win32">
<Configuration>release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C23AC35D-E93E-B90C-CAD0-151A87D76CEA}</ProjectGuid>
<RootNamespace>SnippetMBP</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetMBP/debug\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)DEBUG</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;_DEBUG;PX_DEBUG=1;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonDEBUG_x86.lib PhysX3DEBUG_x86.lib PhysX3CookingDEBUG_x86.lib PhysX3CharacterKinematicDEBUG_x86.lib PhysX3ExtensionsDEBUG.lib PhysX3VehicleDEBUG.lib PxPvdSDKDEBUG_x86.lib PxTaskDEBUG_x86.lib PxFoundationDEBUG_x86.lib PsFastXmlDEBUG_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsDEBUG.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)DEBUG.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationDEBUG_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKDEBUG_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetMBP/checked\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)CHECKED</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='checked|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_CHECKED=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/LIBPATH:../../../Lib/vc14win32 PhysX3CommonCHECKED_x86.lib PhysX3CHECKED_x86.lib PhysX3CookingCHECKED_x86.lib PhysX3CharacterKinematicCHECKED_x86.lib PhysX3ExtensionsCHECKED.lib PhysX3VehicleCHECKED.lib PxPvdSDKCHECKED_x86.lib PxTaskCHECKED_x86.lib PxFoundationCHECKED_x86.lib PsFastXmlCHECKED_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsCHECKED.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)CHECKED.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationCHECKED_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKCHECKED_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetMBP/profile\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)PROFILE</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='profile|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_PROFILE=1;PX_NVTX=1;PX_SUPPORT_PVD=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3CommonPROFILE_x86.lib PhysX3PROFILE_x86.lib PhysX3CookingPROFILE_x86.lib PhysX3CharacterKinematicPROFILE_x86.lib PhysX3ExtensionsPROFILE.lib PhysX3VehiclePROFILE.lib PxPvdSDKPROFILE_x86.lib PxTaskPROFILE_x86.lib PxFoundationPROFILE_x86.lib PsFastXmlPROFILE_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtilsPROFILE.lib /DEBUG</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)PROFILE.exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundationPROFILE_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDKPROFILE_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<OutDir>./../../../bin/vc14win32\</OutDir>
<IntDir>./Win32/SnippetMBP/release\</IntDir>
<TargetExt>.exe</TargetExt>
<TargetName>$(ProjectName)</TargetName>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules />
<CodeAnalysisRuleAssemblies />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release|Win32'">
<ClCompile>
<TreatWarningAsError>true</TreatWarningAsError>
<StringPooling>true</StringPooling>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<RuntimeTypeInfo>false</RuntimeTypeInfo>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointModel>Fast</FloatingPointModel>
<AdditionalOptions>/MP /Wall /wd4514 /wd4820 /wd4127 /wd4710 /wd4711 /wd4435 /wd4577 /wd4464 /wd4350 /wd4668 /wd4365 /wd4548 /d2Zi+</AdditionalOptions>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>./../../../Include;./../../../../PxShared/include;./../../../../PxShared/src/foundation/include;./../../../../PxShared/src/fastxml/include;./../../Graphics/include/win32/GL;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;PHYSX_PROFILE_SDK;RENDER_SNIPPET;NDEBUG;PX_SUPPORT_PVD=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<WarningLevel>Level4</WarningLevel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile></PrecompiledHeaderFile>
<ProgramDataBaseFileName>$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalOptions>/INCREMENTAL:NO /LIBPATH:../../../Lib/vc14win32 PhysX3Common_x86.lib PhysX3_x86.lib PhysX3Cooking_x86.lib PhysX3CharacterKinematic_x86.lib PhysX3Extensions.lib PhysX3Vehicle.lib PxPvdSDK_x86.lib PxTask_x86.lib PxFoundation_x86.lib PsFastXml_x86.lib /LIBPATH:../../lib/vc14win32 SnippetUtils.lib</AdditionalOptions>
<AdditionalDependencies>Winmm.lib;OpenGL32.lib;glut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
<AdditionalLibraryDirectories>./../../../Common/lib/vc14win32;./../../lib/vc14win32;./../../../../PxShared/lib/vc14win32;./../../Graphics/lib/win32/glut;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ProgramDatabaseFile>$(TargetDir)\$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<ResourceCompile>
</ResourceCompile>
<ProjectReference>
</ProjectReference>
<PostBuildEvent>
<Command>XCOPY "../../../../PxShared/bin\vc14win32\PxFoundation_x86.dll" "$(OutDir)" /D /Y
 XCOPY "../../../../PxShared/bin\vc14win32\PxPvdSDK_x86.dll" "$(OutDir)" /D /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetCommon\ClassicMain.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\SnippetMBP\SnippetMBP.cpp">
</ClCompile>
<ClCompile Include="..\..\SnippetMBP\SnippetMBPRender.cpp">
</ClCompile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetUtils.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="./SnippetRender.vcxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"></ImportGroup>
</Project>
```
|
```c++
/////////////////////////////////////////////////////////////////////////////
//
//
// (See accompanying file LICENSE_1_0.txt or copy at
// path_to_url
//
// See path_to_url for documentation.
//
/////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP
#define BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/detail/ebo_functor_holder.hpp>
#include <boost/intrusive/detail/tree_value_compare.hpp>
namespace boost {
namespace intrusive {
namespace detail {
template < class KeyTypeKeyCompare
, class ValueTraits
, class KeyOfValue
>
struct key_nodeptr_comp_types
{
typedef ValueTraits value_traits;
typedef typename value_traits::value_type value_type;
typedef typename value_traits::node_ptr node_ptr;
typedef typename value_traits::const_node_ptr const_node_ptr;
typedef typename detail::if_c
< detail::is_same<KeyOfValue, void>::value
, detail::identity<value_type>
, KeyOfValue
>::type key_of_value;
typedef tree_value_compare
<typename ValueTraits::pointer, KeyTypeKeyCompare, key_of_value> base_t;
};
//This function object transforms a key comparison type to
//a function that can compare nodes or nodes with nodes or keys.
template < class KeyTypeKeyCompare
, class ValueTraits
, class KeyOfValue = void
>
struct key_nodeptr_comp
//Use public inheritance to avoid MSVC bugs with closures
: public key_nodeptr_comp_types<KeyTypeKeyCompare, ValueTraits, KeyOfValue>::base_t
{
private:
struct sfinae_type;
public:
typedef key_nodeptr_comp_types<KeyTypeKeyCompare, ValueTraits, KeyOfValue> types_t;
typedef typename types_t::value_traits value_traits;
typedef typename types_t::value_type value_type;
typedef typename types_t::node_ptr node_ptr;
typedef typename types_t::const_node_ptr const_node_ptr;
typedef typename types_t::base_t base_t;
typedef typename types_t::key_of_value key_of_value;
template <class P1>
struct is_same_or_nodeptr_convertible
{
static const bool same_type = is_same<P1,const_node_ptr>::value || is_same<P1,node_ptr>::value;
static const bool value = same_type || is_convertible<P1, const_node_ptr>::value;
};
BOOST_INTRUSIVE_FORCEINLINE base_t base() const
{ return static_cast<const base_t&>(*this); }
BOOST_INTRUSIVE_FORCEINLINE key_nodeptr_comp(KeyTypeKeyCompare kcomp, const ValueTraits *traits)
: base_t(kcomp), traits_(traits)
{}
//pred(pnode)
template<class T1>
BOOST_INTRUSIVE_FORCEINLINE bool operator()(const T1 &t1, typename enable_if_c< is_same_or_nodeptr_convertible<T1>::value, sfinae_type* >::type = 0) const
{ return base().get()(key_of_value()(*traits_->to_value_ptr(t1))); }
//operator() 2 arg
//pred(pnode, pnode)
template<class T1, class T2>
BOOST_INTRUSIVE_FORCEINLINE bool operator()
(const T1 &t1, const T2 &t2, typename enable_if_c< is_same_or_nodeptr_convertible<T1>::value && is_same_or_nodeptr_convertible<T2>::value, sfinae_type* >::type = 0) const
{ return base()(*traits_->to_value_ptr(t1), *traits_->to_value_ptr(t2)); }
//pred(pnode, key)
template<class T1, class T2>
BOOST_INTRUSIVE_FORCEINLINE bool operator()
(const T1 &t1, const T2 &t2, typename enable_if_c< is_same_or_nodeptr_convertible<T1>::value && !is_same_or_nodeptr_convertible<T2>::value, sfinae_type* >::type = 0) const
{ return base()(*traits_->to_value_ptr(t1), t2); }
//pred(key, pnode)
template<class T1, class T2>
BOOST_INTRUSIVE_FORCEINLINE bool operator()
(const T1 &t1, const T2 &t2, typename enable_if_c< !is_same_or_nodeptr_convertible<T1>::value && is_same_or_nodeptr_convertible<T2>::value, sfinae_type* >::type = 0) const
{ return base()(t1, *traits_->to_value_ptr(t2)); }
//pred(key, key)
template<class T1, class T2>
BOOST_INTRUSIVE_FORCEINLINE bool operator()
(const T1 &t1, const T2 &t2, typename enable_if_c< !is_same_or_nodeptr_convertible<T1>::value && !is_same_or_nodeptr_convertible<T2>::value, sfinae_type* >::type = 0) const
{ return base()(t1, t2); }
const ValueTraits *const traits_;
};
} //namespace detail{
} //namespace intrusive{
} //namespace boost{
#endif //BOOST_INTRUSIVE_DETAIL_KEY_NODEPTR_COMP_HPP
```
|
```scss
.Hero .container {
position: absolute;
background: #fff;
box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
cursor: pointer;
height: 120px;
overflow: hidden;
transition: background 0.5s;
padding: 12px;
width: 384px;
h1 {
margin-top: 0;
line-height: 84px;
letter-spacing: normal;
color: #494949;
margin-left: 24px;
transition: color 0.5s;
}
#get-started {
left: 400px;
opacity: 0;
color: white;
animation: pulse 2s infinite;
}
#project-desc {
opacity: 1;
left: 36px;
}
p {
transition: opacity 0.5s, left 0.5s;
font-size: 1rem;
line-height: 30px;
position: absolute;
bottom: 12px;
}
&:hover {
background: #17b8be;
h1 {
color: white;
}
#project-desc {
opacity: 0;
left: -100px;
}
#get-started {
opacity: 1;
left: 36px;
}
}
}
.container.f.fw {
display: none;
}
.container {
hr.short {
display: none;
}
&.markdown-body {
h2 + h4,
h2 + h5 {
margin-top: 0;
}
h4,
h5 {
margin-top: 2em;
font-size: 1.1em;
line-height: 1.5em;
font-weight: 600;
text-decoration: underline;
& ~ ul code,
& ~ p code {
background: rgba(#00ADE6, 0.1);
}
& ~ p,
& ~ pre,
& ~ ul {
margin-left: 2em;
font-size: 0.9em;
line-height: 1.5em;
@media (max-width: 400px) {
margin-left: 1em;
}
& + h2 {
margin-top: 2em;
}
}
}
}
.Contributors.m-top {
margin-top: 0;
.Contributor {
width: 8rem;
height: 10rem;
background: none;
margin: 10px;
img {
border-radius: 50%;
border: 4px solid #17b8be;
box-shadow: 0 0 0 #17b8be;
transition: border 0.5s, box-shadow 0.5s;
}
span {
display: block;
font-size: 1rem;
position: absolute;
margin-left: -8px;
bottom: 0;
color: #494949;
text-align: center;
text-shadow: none;
width: 8rem;
}
}
.Contributor:after {
content: '';
position: absolute;
left: 3px;
top: 3px;
width: calc(8rem - 10px);
height: calc(8rem - 10px);
border: 2px solid white;
border-radius: 50%;
}
.Contributor:hover {
img {
border-radius: 50%;
border: 4px solid white;
box-shadow: 0 0 20px #17b8be;
}
}
}
}
.inline-code.container > div {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
}
@keyframes pulse {
0% {
font-size: 16px;
color: #ddd;
}
70% {
font-size: 17px;
color: white;
}
100% {
font-size: 16px;
color: #ddd;
}
}
```
|
```java
/**
* This file is part of Skript.
*
* Skript is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* Skript 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 Skript. If not, see <path_to_url
*
*/
/**
* Support for script-based testing.
*/
@NonNullByDefault({DefaultLocation.PARAMETER, DefaultLocation.RETURN_TYPE, DefaultLocation.FIELD})
package ch.njol.skript.test.runner;
import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNullByDefault;
```
|
The 1919 Vernon Tigers season was the 11th season in the history of the Vernon Tigers baseball team. Playing in the Pacific Coast League (PCL), the team compiled a 111–70 record and won the PCL pennant. "Vinegar Bill" Essick was the team's manager from 1918 to 1925. Film star Roscoe "Fatty" Arbuckle was the team owner and president.
After the regular season ended, the Tigers defeated Mike Kelley's St. Paul Saints in a nine-game series at Washington Park in Los Angeles The series was billed as the "Little World Series" to determine the championship of western minor league baseball.
Bribery scandal
The Tigers' championship was marred by revelations of a gambling scandal involving first baseman Babe Borton. Borton admitted paying money to three players on the Salt Lake City Bees to throw games against the Tigers. Borton claimed that bribes had also been paid by a teammate to Portland and Seattle players, that the bribes were paid out of a pool of money funded by numerous teammates, and that the bribes were instigated by Vernor manager Bill Essick. Borton was released by the Tigers in 1920 and never again played professional baseball. Other accounts indicated that a Seattle gambler was behind the bribery scheme.
Position players
Third baseman/outfielder Bob Meusel led the Tigers with a .337 batting average, 221 hits, 38 doubles, 14 home runs, a .504 slugging percentage, and 330 total bases. His 221 hits ranked second in the PCL behind Sam Crawford. Meusel later played 10 seasons for the New York Yankees from 1920 to 1929.
Babe Borton compiled a .303 batting average with 15 doubles, 10 triples, and 14 home runs (tied with Meusel for third in the PCL).
Left fielder Hugh High, who played in the majors from 1913 to 1918, had a .317 average to finish second on the team behind Meusel.
Center fielder Chet Chadbourne, who played in the majors off-and-on from 1906 to 1918, ranked second on the team behind Meusel in hits (212), doubles (33), and total bases (269).
Pitchers
Wheezer Dell, a native of Tuscarora, Nevada, led the team with 25 wins, 50 pitching appearances, and 351 innings pitched. Dell won 103 games for Vernon from 1919 to 1922 and was later inducted into the Pacific Coast League Hall of Fame.
Art Fromme, who played in the majors from 1906 to 1915, also pitched well for the 1919 Tigers, compiling a 20-7 record and leading the team with a 2.23 earned run average.
Byron Houck, who played in the majors off and on from 1912 to 1918, compiled a 19-16 record with a 3.88 earned run average.
Happy Finneran, who pitched in the majors from 1912 to 1918, compiled a 14-4 record (.778 winning percentage) with a 2.49 earned run average.
1919 PCL standings
Statistics
Batting
Note: Pos = Position; G = Games played; AB = At bats; H = Hits; Avg. = Batting average; HR = Home runs; SLG = Slugging percentage
Pitching
Note: G = Games pitched; IP = Innings pitched; W = Wins; L = Losses; PCT = Win percentage; ERA = Earned run average; SO = Strikeouts
References
Further reading
"The Greatest Minor League: A History of the Pacific Coast League, 1903-1957", by Dennis Snelling (McFarland 2011
1919 in sports in California
Pacific Coast League seasons
|
Te Whānau-ā-Apanui is a Māori iwi (Iwi is the Māori word for tribe) located in the eastern Bay of Plenty and East Coast regions of New Zealand's North Island. In 2006, the iwi registered 11,808 members, representing 13 hapū.
History
Early history
During the 17th century, Apanui acquired vast amounts of land along the East Coast of the North Island. Through familial connection, he acquired land from Ngāti Porou and Ngāriki. He was given land extending from Pōtikirua to Puketapu, and from Taumata-ō-Apanui Hawai; the land in between was later won through conquest.
Modern history
Relations with Europeans were not generally hostile. Early European settlers showed little interest in the isolated region, which lacked deep-water harbours for shipping. However, visiting Europeans taught Te Whānau-ā-Apanui the skills of whaling and commercial agriculture. Both areas become major economic industries for the iwi in the early 20th century, and profits were directed into community development projects.
During the 1980s, the iwi experienced economic decline with the loss of major transport services, privatization of state assets and the eventual economic unfeasibility of its small-scale farming operations. This resulted in some emigration of iwi members from traditional tribal homelands.
There are three groups that have competed at The Matatini from Te Whānau a Apanui: Te Kapa Haka o Te Whānau a Apanui (3x Champions 2005, 2015 and 2023), Tutawake and Tauira-mai-tawhiti.
Hapū and marae
The iwi (tribe) consists of 13 hapū (sub-tribes).
Each is associated with a marae (communal ground) and wharenui (meeting house). Ki
Te Whānau a Haraawaka, of Tunapahore marae and Haraawaka wharenui
Te Whānau a Hikarukutai, of Maraenui marae and Te Iwarau wharenui
Te Whānau a Kahurautao, of Pāhāōa and Kahurautao wharenui
Te Whānau a Kaiaio, of Maungaroa marae and Kaiaio wharenui
Te Whānau a Kauaetangohia, of Whangaparāōa marae and Kauaetangohia / Te Putahou wharenui
Te Whānau a Maruhaeremuri, of Wairūrū marae and Hinemahuru / Mihi Kotukutuko wharenui
Te Whānau a Nuku, of Ōmāio marae and Rongomaihuatahi wharenui
Te Whānau a Pararaki, of Te Maru o Hinemaka marae and Pararaki wharenui
Te Whānau a Rutaia, of Ōtūwhare marae and Te Poho o Rūtāia wharenui, and Rongohaere marae and Rongohaere wharenui
Te Whānau a Tapaeururangi, of Pōtaka marae and Te Ēhutu / Te Pae o Ngā Pakanga wharenui
Te Whānau a Te Ēhutu, of Te Kaha marae and Tūkākī wharenui
Te Whānau a Toihau / Hiinetekahu, of Waiōrore marae and Toihau wharenui
Te Whānau a Tutawake, of Whitianga marae and Tūtawake wharenui
Governance
Te Rūnanga o te Whānau
Te Rūnanga o te Whānau represents Te Whānau a Apanui during resource consent applications under the Resource Management Act, but forwards each application on to the directly affected hapū. It is based on Te Kaha, and governed by representatives from at least ten hapū.
The charitable trust is involved in social services and local economic development. It manages a fisheries operation, and invests in the development of local forestry and other industries. Its Cyberwaka rural community project provides information technology training.
Negotiations team
The Crown has recognised Te Whānau a Apanui Negotiations Team to represent the iwi during Treaty of Waitangi settlement negotiations. The terms of the negotiation were signed with the Crown in September 2017.
Local government
The tribal area of the iwi is within the territory of the Ōpōtiki District Council.
It is also within the wider territory of Bay of Plenty Regional Council.
Media
Sea 92FM
Pan-tribal iwi station Sea 92FM broadcasts to members of Te Whānau-ā-Apanui, Te Whakatōhea and Ngāitai in the Ōpōtiki area. It is operated by pan-tribal service provider Whakaatu Whanaunga Trust, and is available on . It operates the low-power Opotiki 88.1 FM, geared towards a young demographic.
Boy (Movie)
In 2010, Taika Waititi directed and acted in Boy, which was a film based in Te Whānau-ā-Apanui.
Notable people
Mihi Kōtukutuku Stirling Māori tribal leader and orator
Dr Rina Winifred Moore, first female Māori doctor
Ākenehi Hei, Māori district nurse, midwife, first Māori to become a qualified nurse
Fanny Howie, singer and composer
Tame Poata, tohunga moko, master moko artist
Karauria Tiweka Anaru, New Zealand interpreter, law clerk, local politician and community leader
Hoani Waititi, educationalist and community leader
Archbishop Brown Turei, Bishop of Aotearoa – the Tikanga Māori Archbishop and Primate of the Anglican Church in New Zealand, Aotearoa and Polynesia.
Major John Hikitia Te Rangi Waititi, army commander of the 28th Maori Battalion (C Company)
Roka Paora, Māori language expert, translator, author and educator
Wiremu Karuwha Tawhai, educator and actor
Moana-Nui-a-Kiwa Ngarimu, first Māori recipient of the Victoria Cross for New Zealand medal, 28th Maori Battalion (C Company)
Willie Apiata, second Māori recipient of the Victoria Cross for New Zealand medal
Sir Monita Delamere, rugby player (Māori All Blacks), Ringatū faith leader and community leader
Dame June Mariu (née Waititi), first Māori captain and first winning captain of the Silver Ferns, Māori community leader, educator and sportswoman
Sir Wira Gardiner, soldier, public servant, and writer
Cliff Whiting, artist
Dean Whiting, artist and restoration expert
Paratene Matchitt, sculptor and painter
Roka Ngarimu-Cameron, master weaver
Taiarahia Black, academic, professor and father of Otere Black
George Gage, Ringatū faith leader
Albert Oliphant Stewart, tribal leader, law clerk, interpreter, local politician, rate collector
Rona Hurley , tobacco grower and buyer
Anne Delamere, New Zealand public servant
Pae Ruha, Māori leader, educator
Witi Ihimaera, author, writer, academic
Pāora Kīngi Delamere, Ringatū faith leader, carpenter, boat builder, farmer
Heta Hingston, lawyer, jurist, judge of the Māori Land Court 1984-1999, and Chief Justice of Niue until 2010
Tuariki Delamere, former politician (Minister of Immigration, Minister of Pacific Island Affairs, Associate Minister of Finance, and Associate Minister of Health)
Claudette Hauiti, politician
Rawiri Waititi, politician, co-leader of Te Pāti Māori
Taika Waititi, filmmaker
Tweedie Waititi, filmmaker
Ainsley Gardiner, film producer
Riwia Brown, playwriter and screenwriter
Whirimako Black, musician
Rob Ruha, musician, weaver, artist
Maisey Rika, musician
Troy Kingi, musician
Ria Hall, musician
Leonard Tamahae Cohen, Bluegrass musician, Founding member Hamilton County Bluegrass Band
Tayi Tibble, poet
Olivia Aroha Giles, contemporary creative specialising in art textiles, design, illustration and writing
Kahurangi Waititi, netball player
Kerry-Anne Tomlinson, cricket player
Reuben Parkinson, rugby player (Japan NRU Team) and older brother of Matua Parkinson
Matua Parkinson, rugby player (Māori All Blacks, and NZ Sevens Team), tv personality and younger brother of Reuben Parkinson
Charlie Ngatai, rugby player Māori All Blacks
Sandra Ioane (née Wihongi), rugby player (Black Ferns) and mother of Akira & Rieko Ioane
Akira Ioane, rugby player (Māori All Blacks, All Blacks and NZ Sevens Team)
Rieko Ioane, rugby player (Māori All Blacks, All Blacks and NZ Sevens Team)
Ruahei Demant, rugby player (Black Ferns captain)
Kiritapu Demant, rugby player (Black Ferns), barber
Stacey Fluhler, rugby player (Black Ferns and NZ Sevens Team) and sister to Beaudein Waaka
Beaudein Waaka, rugby player (NZ Sevens Team) and brother to Stacey Fluhler
Natalie Delamere, rugby player (Black Ferns)
Luka Connor, rugby player (Black Ferns)
Pari Pari Parkinson, rugby player (Māori All Blacks)
Otere Black, rugby player (Māori All Blacks) and son of Taiarahia Black
Hoani Matenga, rugby player (Māori All Blacks)
Kharl Wirepa, fashion designer
Te Kapa Haka o Te Whānau-ā-Apanui (3x Te Matatini Champions 2005, 2015 and 2023)
See also
List of Māori iwi
References
Bay of Plenty Region
Gisborne District
|
A rocket docket is a court or other tribunal that is noted for its speedy disposition of cases and controversies that come before it, often by maintaining strict adherence to the law as pertains to filing deadlines, etc.
The term was originally applied to the United States District Court for the Eastern District of Virginia, after Judge Albert V. Bryan Jr., who ran the federal courthouse in Alexandria, decided that justice was being dispensed too slowly for his liking. The court earned the nickname among attorneys practicing there in the 1970s, who told stories of Bryan ruling on the spot when motions were argued, and trying entire cases in one afternoon. As of September 2011, the Eastern District of Virginia had the shortest average time from filing to disposition for civil cases that went to trial (at 12.1 months) and was second (behind the Eastern District of Pennsylvania) in median time for resolution of all civil cases.
Later the term was applied to the United States District Court for the Eastern District of Texas. Other jurisdictions that have been characterized as rocket dockets include the United States District Court for the Northern District of California; the United States District Court for the Southern District of California; the United States District Court for the Northern District of Georgia; and the United States District Court for the Western District of Wisconsin.
The U.S. Patent & Trademark Office has designated its expedited examination of design patent applications as a rocket docket.
In Jefferson County (Louisville), Kentucky a team of prosecutors is assigned to the Progressive Criminal Justice Plan, referred to as the "rocket docket," for speedy resolution of certain criminal matters.
Another notable "rocket docket" court involved Lee County, Florida (Fort Myers), home of numerous foreclosure proceedings due to the collapse of the Florida housing market as a result of the financial crisis of 2007–2008, part of the 2010 United States foreclosure crisis. On some days, the court heard up to 1,000 cases per day; assuming an 8-hour day, this equates to less than 30 seconds per case. The entire case frequently consists of two questions: whether the homeowner is behind on payments, and whether they are still in the house. If yes, the judge allows the homeowner 60 days to come to an agreement with the bank for payments or lose the house.
References
Legal procedure
Judiciaries
|
Roopa Unnikrishnan is an Indian-born American sports shooter and innovation consultant, based in New York City. In 1998, she was the first Indian woman to ever win a gold medal at the Commonwealth Games, in the 50m rifle prone position event.
Biography
Unnikrishnan won the Arjuna Award, India's highest sporting prize (equivalent to sports hall of fame) presented by India's President in 1999. The award recognized her multiple global medals, including gold medal and record in the XVI Commonwealth Games, Kuala Lumpur, Malaysia, 1998, in women's prone sports rifle; Silver medal at the World Shooting Grand Prix, Ft. Benning, Georgia, 1998; hold several records at the South Asian level.
She has been a strong advocate for increased support for athletes in India, where they continue to be resource constrained.
Though Shooting is a "Half Blue" sport at Oxford, Unnikrishnan was awarded an Extraordinary Full Blue, since she had won the Commonwealth medal, helped the Oxford team win in university leagues, and was the Captain of the Oxford Women's Shooting Team.
In 1995, she won a Rhodes Scholarship from India.
She got her B.A. at Women's Christian College, Chennai; an M.A. at Ethiraj College, Chennai; an M.A. in Economic History at Balliol in Oxford; and an M.B.A from the Said School of Business in Oxford.
She is Head of Strategy at Harman International in New York City. She has contributed to The Economic Times and to Knowledge@Wharton.
In 2017, she published the book, The Career Catapult: Shake-up the Status Quo and Boost Your Professional Trajectory.
Personal life
Unnikrishnan became a US Citizen in 2013. She is married to Sreenath Sreenivasan, former Chief Digital Officer at the Metropolitan Museum of Art.
See also
Indians in the New York City metropolitan area
References
Year of birth missing (living people)
Living people
Commonwealth Games medallists in shooting
Commonwealth Games gold medallists for India
Commonwealth Games silver medallists for India
Women's Christian College, Chennai alumni
Shooters at the 1994 Commonwealth Games
Shooters at the 1998 Commonwealth Games
Recipients of the Arjuna Award
Medallists at the 1994 Commonwealth Games
Medallists at the 1998 Commonwealth Games
|
```asciidoc
[[glossary]]
= Glossary
:page-section-summary-toc: 1
* *Route*: The basic building block of the gateway.
It is defined by an ID, a destination URI, a collection of predicates, and a collection of filters. A route is matched if the aggregate predicate is true.
* *Predicate*: This is a path_to_url WebMvc.fn `RequestPredicate`]. The input type is a path_to_url WebMvc.fn `ServerRequest`].
This lets you match on anything from the HTTP request, such as headers or parameters.
* *Filter*: These are instances of path_to_url`HandlerFilterFunction`].
Here, you can modify requests and responses before or after sending the downstream request. Filters may also implement `Function<ServerRequest, ServerRequest>` and adapted to a `HandlerFilterFunction` by path_to_url#ofRequestProcessor(java.util.function.Function)[`HandlerFilterFunction.ofRequestProcessor()`] for 'before' filters. For 'after' filters, `BiFunction<ServerRequest,T extends ServerResponse,R extends ServerResponse>` may be implemented and adapted by path_to_url#ofResponseProcessor(java.util.function.BiFunction)[`HandlerFilterFunction.ofResponseProcessor()`].
```
|
Urikohime, Uriko-hime or Uriko Hime (うりこひめ; English: Princess Melon, Melon Maid or Melon Princess) is a Japanese folktale about a girl that is born out of a melon, adopted by a family and replaced by a creature named Amanojaku.
Summary
A melon comes washing down the stream until it is found by a human couple. They cut open the fruit and a girl appears out of it. They name her Urikohime (uri means "melon" in Japanese). They raise her and she becomes a beautiful young lady. One day, she is left alone at home and told to be careful of any stranger who comes knocking. Unfortunately, a youkai named Amanojaku sets its sights on the girl. The creature appears at her house and asks the girl to open. She opens the door just a bit and the creature forces its entry in her house.
In one version of the story, Amanojaku kills Urikohime and wears her skin. The creature replaces Urikohime as the couple's daughter, but its disguise is ruined when the girl, reincarnated as a little bird, reveals the deception and eventually regains her human form.
In another account, Urikohime becomes known for her great weaving abilities. Due to this, she is betrothed to a lord or prince. Before she marries, Amanojaku kills her and wears her dress, or ties her to a persimmon tree. The false bride is taken to the wedding on a palanquin, but the ruse is discovered. In the version where she is tied up, Urikohime cries out to anyone to hear and is rescued. The creature is chased away.
Alternate names
Scholar Kunio Yanagita indicated alternate names to the tale: Urikohimeko, Urihime, Urihimeko.
Distribution
According to Japanese folklorist Keigo Seki's notations, several variations are recorded in Japanese compilations. Further studies show that the tale can be found all over the Japanese archipelago. Hiroko Ikeda's index of Japanese tales lists 102 versions of the story.
According to Fanny Hagin Mayer, "most versions" of the story end on a tragic note, but all seem to indicate the great weaving skills of Urikohime. Scholar Kunio Yanagita listed the tale Nishiki Chōja as one version of the story that contains a happy ending.
Analysis
Japanese scholarship argues for some relationship between this tale and Aarne-Thompson-Uther Index tale type ATU 408, "The Three Citrons", since both tales involve a maiden born of a fruit and her replacement for a false bride (in the tale type) and for evil creature Amanojaku (in Japanese versions). In fact, professor Hiroko Ikeda classified the story of Urikohime as type 408B in his Japanese catalogue.
Attention has also been drawn to the motif of "The False Bride" that exists in both tales: in Urikohime, the youkai or ogress wears the skin of the slain girl. Folklorist Christine Goldberg recognizes that this is the motif Disguised Flayer (motif K1941 in the Motif-Index of Folk-Literature). This disguise is also used by heroines in other folktales.
Professor Fanny Hagin Mayer remarked on the characters of the elderly couple that adopts Urikohime, which appear in several other Japanese folktales as a set. The elderly woman teaches her adopted daughter skills in weaving.
See also
Momotaro
The Tale of the Bamboo Cutter
References
Bibliography
Further reading
剣持 弘子 [Kendo, Hiroko].「瓜子姫」 —話型分析及び「三つのオレンジ」との関係— ("Urikohime": Analysis and Relation with "Three Oranges"). In: 『口承文芸研究』nr. 11 (March, 1988). pp. 45-57.
External links
Link to a variant of Urikohime and similar tales
Japanese fairy tales
Japanese folklore
ATU 400-459
es:Urikohime to Amanojaku
ja:うりこひめとあまのじゃく
zh:瓜子姬與天邪鬼
|
Matteo Luigi Brunori (; born Matteo Luigi Brunori Sandri on 1 November 1994) is an Italian professional footballer who plays as a forward and captains club Palermo.
Club career
Early years
Brunori made his Serie C debut for Foligno on 5 June 2011, in a game against Ternana.
On 1 August 2019, he joined Pescara on loan from Parma with an obligation to buy.
On 24 January 2020, Pescara bought out his rights early and immediately re-sold him to Juventus U23.
On 24 August 2020, he became a new Entella player on loan with an option to buy.
Palermo
On 9 August 2021, he joined Palermo on loan. He made his debut with rosanero in a Coppa Italia Serie C game on 21 August 2021, which Palermo won 4–1 against Picerno. On 26 September, Brunori scored his first goal in a 1–1 away draw against Monterosi Tuscia. On 6 February 2022, he scored both of Palermo's goals in a 2–2 away against Campobasso, which allowed him to break the 10-goal barrier.
Brunori scored another brace in the following home match, which Palermo won 3–1 against Juve Stabia. With his goal against Turris, he surpassed his personal-best tally of 13 goals, which he had reached in the 2018-2019 season with Arezzo, and surpassed Lorenzo Lucca as top scorer of Palermo in Serie C. On 6 March, he scoring a goal in a win against Vibonese, reaching Şükrü Gülesin as player with more consecutive goals scored for Palermo (7). Brunori broke the record in the next match against Avellino.
On 24 April, in the last league match against Bari, Brunori scored one of the two goals that allowed Palermo to qualify for the play-offs. The following 10 June, he won the "Trofeo Facco" for the best goal of 2021–22 Serie C.
In the play-offs, Brunori contributed to the final promotion of Palermo, scoring four goals in 8 games, against Virtus Entella, Feralpisalò (2 goals) and Padova, in the final.
On 17 July 2022, a couple of weeks after the end of the loan deal, Palermo announced to have permanently signed Brunori from Juventus, agreeing on a four-year contract with the striker. On his debut as a permanent Palermo player, Brunori scored his first hat-trick with a Rosanero jersey in a 3–2 Coppa Italia home win against Reggiana. On 6 June 2023, after captaining Palermo and scoring 17 goals on his first Serie B season with the Sicilians, Brunori signed a contract extension until 30 June 2027.
International career
On 15 December 2022, Brunori was called up by Italy national team manager Roberto Mancini as part of the 69-player squad of "players of national interest" for a stage in Coverciano to be held from 20 to 22 December.
Personal life
Born in Brazil to Italian parents, Brunori moved back to Assisi with his family at one year of age. He was raised by his mother alone, and later changed his full surname from "Brunori Sandri" to just "Brunori", choosing to keep only his mother's one.
On 11 June 2022, just two days before Palermo's promotion playoff final against Padova, Brunori married his long-time partner Dalila at the Castello di Naro, in the city of Cagli; the marriage was originally scheduled to be held in 2020 but was then postponed due to the COVID-19 pandemic in Italy.
Career statistics
Club
Honours
Juventus U23
Coppa Italia Serie C: 2019–20
References
External links
1994 births
People from Macaé
Footballers from Rio de Janeiro (state)
Sportspeople from Rio de Janeiro (state)
Living people
Italian men's footballers
Italy men's youth international footballers
Brazilian men's footballers
Brazilian people of Italian descent
Men's association football forwards
ASD Città di Foligno 1928 players
AC Reggiana 1919 players
Aurora Pro Patria 1919 players
ACR Messina players
SS Arezzo players
Delfino Pescara 1936 players
Juventus Next Gen players
Virtus Entella players
Palermo FC players
Serie B players
Serie C players
Serie D players
|
```php
<?php
namespace Illuminate\Contracts\Pagination;
interface Paginator
{
/**
* Get the URL for a given page.
*
* @param int $page
* @return string
*/
public function url($page);
/**
* Add a set of query string values to the paginator.
*
* @param array|string $key
* @param string|null $value
* @return $this
*/
public function appends($key, $value = null);
/**
* Get / set the URL fragment to be appended to URLs.
*
* @param string|null $fragment
* @return $this|string
*/
public function fragment($fragment = null);
/**
* The the URL for the next page, or null.
*
* @return string|null
*/
public function nextPageUrl();
/**
* Get the URL for the previous page, or null.
*
* @return string|null
*/
public function previousPageUrl();
/**
* Get all of the items being paginated.
*
* @return array
*/
public function items();
/**
* Get the "index" of the first item being paginated.
*
* @return int
*/
public function firstItem();
/**
* Get the "index" of the last item being paginated.
*
* @return int
*/
public function lastItem();
/**
* Determine how many items are being shown per page.
*
* @return int
*/
public function perPage();
/**
* Determine the current page being paginated.
*
* @return int
*/
public function currentPage();
/**
* Determine if there are enough items to split into multiple pages.
*
* @return bool
*/
public function hasPages();
/**
* Determine if there is more items in the data store.
*
* @return bool
*/
public function hasMorePages();
/**
* Determine if the list of items is empty or not.
*
* @return bool
*/
public function isEmpty();
/**
* Render the paginator using a given Presenter.
*
* @param \Illuminate\Contracts\Pagination\Presenter|null $presenter
* @return string
*/
public function render(Presenter $presenter = null);
}
```
|
Anytime is the third studio album by American singer Brian McKnight. It was released by Mercury Records on September 23, 1997, in the United States. Following his moderately successful second album I Remember You (1995), McKnight consulted a wider range of collaborators to work with him on the album, including producers Sean Combs, Keith Thomas, Poke & Tone and songwriters Diane Warren, and Peter Black. While McKnight would provide most of the material by himself, Anytime deviated from the urban adult contemporary sound of his older work, with the former acts taking his music further into the hip hop soul genre.
Upon its release, the album garnered generally mixed reviews from music critics and broke into the top 20 on the US Billboard 200, while becoming McKnight's first album to top the Top R&B/Hip-Hop Albums chart. A steady seller, it was certified double platinum by the Recording Industry Association of America (RIAA), indicating sales in excess of 2.0 units, and spawned several singles, including the top 20 hit "You Should Be Mine (Don't Waste Your Time)". Anytime marked McKnight's last record with Mercury Records before moving to Motown Records.
Background
Anytime marked McKnight's third studio album with Mercury Records. While his previous album I Remember You (1995) was certified gold by the Recording Industry Association of America (RIAA), it only sold half as much as its predecessor Brian McKnight (1992). Feeling initially pressured after what he called "the pseudo-failure of the I Remember You album,” McKnight, who was used to writing and producing most of his music by himself, decided to work with a wider range of musicians on the Anytime, including Sean "Puffy" Combs, Keith Thomas, Poke & Tone, Diane Warren, and Peter Black. With Anytime exposing McKnight to a wider audience, McKnight elaborated in a 2012 interview: "If Anytime was the spark, then Back at One became the fire. I was doing things then that I had never done before, that an audience had never heard or seen."
Critical reception
Anytime garnered generally mixed reviews from music critics. Stephen Thomas Erlewine from Allmusic felt that McKnight "continues with the mellow, romantic urban R&B that has become his trademark, but there's a new twist [...] McKnight hasn't exhausted its possibilities yet – Anytime is as strong as its predecessor – but "You Should Be Mine" and "Hold Me" suggest that he may be better off pursuing a new, hip-hop-influenced direction." In a contemporary review, The Rolling Stone Album Guide wrote that Anytime "signaled the start of a new phase in McKnight's career." In his review for Vibe, Darren McNeill called Anytime a "collection of mostly tired joints [...] McKnight's solo effort pales in comparison to work by emerging-soul craftsmen like Eric Benét and Rahsaan Patterson." In his consumer guide for The Village Voice, critic Robert Christgau gave Anytime a "cut" rating, indicating "an album that isn't worth your time or money – sometimes a Neither, more often a Dud."
Chart performance
In the United States, Anytime became McKnight's highest-charting album yet, peaking at number 13 on the Billboard 200. McKnight's first album to do so, it also reached the top on Billboards Top R&B/Hip-Hop Albums chart, spending three weeks at number one. According to Soundscan, Anytime had sold 1.7 million copies by January 1999. It was eventually certified double pltianum by the Recording Industry Association of America (RIAA), indicating sales in excess of 2.0 million copies. Billboard ranked the album fourth on its 1998 Top R&B/Hip-Hop Albums year-end chart.
Singles
The lead single "You Should Be Mine (Don't Waste Your Time)" became McKnight's biggest hit in four years, peaking at number 17 on the US Billboard Hot 100 and number 4 on the Hot R&B/Hip-Hop Songs chart. It featured rapper Mase, whose own career was at its peak during 1997. The title track was an even bigger hit, reaching number 6 on the Billboard Hot 100 Airplay chart in May 1998. Since it was not released as a physical single, it was ineligible to chart on the Hot 100, but was still one of the most played songs on the radio during 1998. Anytimes third single "The Only One for Me" hit number 14 on the Rhythmic Top 40, as again no physical single was released for it. The fourth and final single was "Hold Me" hit number 35 on the Hot 100 and number 12 on the Hot R&B/Hip-Hop Songs. The music video for "Hold Me" was released for the week ending on November 8, 1998.
Track listing
Samples
"Anytime" contains an uncredited sample of "Outside Your Door" performed by Meshell Ndegeocello.
"You Should Be Mine (Don't Waste Your Time)" contains a sample from "I Got Ants in My Pants", written and performed by James Brown.
"Hold Me" contains an interpolation of "I Get Around", written by Roger Troutman, Larry Troutman, Shirley Murdock, Tupac Shakur, Ronald R. Brooks, and Gregory E. Jacobs.
"Jam Knock" contains an interpolation of "I Can't Wait", written by John Robert Smith.
Personnel
Musicians
Brian McKnight – lead vocals, background vocals , all instruments , keyboards , additional keyboards , keyboard programming , rhythm and vocal arrangement
Murray Adler – violin
Rick Baptist – trumpet/cornet
Bob Becker – viola
Peter Black – all instruments
Gary Bovyer – bass clarinet
Denyse Buffum – viola
Susan Chatman – violin
Ron Clark – violin
Jon Clarke – English horn
DJ (Step Up) Clue – background vocals
Lisa Cochran – background vocals
Larry Corbett – cello
Louise De Tullio – alto flute
David Duke – French horn
Bruce Dukov – violin
Chris Ermacoff – cello
Charles Farrar – drum programming
Kim Fleming – background vocals
Armen Garabedian – violin
Berj Garabedian – violin
James Getzoff – violin
Harris Goldman – violin
Endre Granat – violin
Mark Hammond – drum programming
Scott Haupert – viola
Tom Hemby – classical guitar
Dann Huff – guitars
Rodney Jerkins – additional drum programming
Suzie Katayama – orchestra contractor/coordinator and cello
Peter Kent – violin
Dan Greco – percussion
Janet Lakatos – viola
Joy Lyle – violin
Mike Markman – violin
Mase – rap vocals
Jerry McPherson – guitars
Joe Meyer – French horn
Bill K. Meyers – orchestra arrangement
Oscar Meza, Jr. – bass
Ralph Morrison – violin
Anthony Nance – drum programming , all instruments
Maria Newman – viola
Bob Peterson – violin
Poke & Tone – drum programming
Barbra Porter – violin
Kelly Price – background vocals and vocal arrangement
Steve Richards – cello
Cory Rooney – keyboards
Jay Rosen – violin
Anatoly Rosinsky – violin
Gerry Rotella – alto flute
John Scanlon – viola
Haim Shtrum – violin
Dan Smith – cello
Rudy Stein – cello
Troy Taylor – background vocals and drum programming , rhythm and vocal arrangement
Keith Thomas – arrangements, piano, synthesizer, and bass programming
Brad Warnaar – French horn
John Wittenberg – violin
Don Williams – percussion
Willie Max – background vocals
Ken Yerke – violin
David Young – bass
Bob Zimmitt – percussion
Technical
Tom Bender – assistant mix engineer
Brant Biles – mix engineer
Peter Black – mix engineer
"Bassy" Bob Brockmann – mix engineer
Andy Cardenas – recording engineer
Doug Elkins – assistant engineer
Dan Evans – production coordinator
Mick Guzauski – mix engineer
Doug "The Colonel" Kern – assistant engineer
Paul Logus – mix engineer
John "JM" Meredith – second engineer
Carl Nappa – recording engineer
Axel Niehaus – recording engineer
Greg Parker – assistant engineer
Joe Perrera – recording engineer
Herb Powers – mastering engineer
Pierre Smith – second engineer
Ed Rasso – assistant mix engineer
David Retinas – orchestra engineer
Shaun Shankel – production coordinator
Mary Ann Souza – assistant engineer
Rich Travali – recording and mixing engineer
Bill Whittington – recording engineer
Chris Wood – recording engineer
Charts
Weekly charts
Year-end charts
Certifications
References
External links
1997 albums
Brian McKnight albums
Albums produced by Brian McKnight
Albums produced by Troy Taylor (record producer)
|
Christine Sharon Grant is an American chemical engineer who is the Associate Dean of Faculty Advancement at North Carolina State University. Her research considers surface and environmental science. She is the 2022 President of the American Institute of Chemical Engineers.
Early life and education
Grant was born in upstate New York. Her father taught music and her mother taught science, and she grew up doing science experiments in her home and garden. Grant took part in the Program to Increase Minority Engineering Graduates (PIMEG) at General Electric, which first introduced her to careers in technology. She earned her bachelor's degree at Brown University, where she was in the second cohort of students to major in chemical engineering. As an undergraduate student, she was President of the Brown University National Society of Black Engineers. She moved to Georgia Tech for her graduate studies. She completed her doctoral research in 1989, during which she studied electro-osmotic dewatering of ultrafine minerals.
Research and career
Grant studies the mechanisms that underpin fouling and decontamination. Her work investigates the chemical and transport processes that occur at the solid-liquid interface, and drive the formation and removal of deposits. Amongst the industrial areas considered by Grant are the removal of organics from glass, the removal of calcium compounds from stainless steel and the deposition of lubricants in disk drive assemblies. She has demonstrated that additives can be used to reduce the degradation and aggregation of lubricants at high temperatures. She joined the faculty at North Carolina State University in 1989. She was one of the first African-American women to be made a full professor of chemical engineering.
Academic service
Grant is committed to improving diversity and equity in chemical engineering. She has been honored for her work as a mentor and educator. She was named the first ever Associate Dean of Faculty Advancement and Special Initiatives at North Carolina State University in 2008 and still serves in this position. In this capacity she started mentoring programs, oversaw initiatives to widen participation and created "Faculty Development Television", a professional development program for members of staff. Grant is the founder of STEM Resilience, an organization that seeks to support marginalized groups in science, technology and engineering.
Grant has held various leadership positions in the American Institute of Chemical Engineers (AIChE): she was the first African-American woman to be elected Fellow of the society and has served as chair of the Minority Affairs Committee and on the board of directors. She was elected president 2021.
Grant is also a director of the Broadening Participation in Engineering (BPE) and Historically Black Colleges and Universities - Excellence in Research (HBCU - EiR) programs at the National Science Foundation (NSF).
Awards and honors
American Association for the Advancement of Science Mentor Award
American Institute of Chemical Engineers Pioneers of Diversity Award
Fellow of the American Institute of Chemical Engineers
American Chemical Society Stanley C. Israel Regional Award
Winifred Burks-Houck Professional Leadership Award from the National Organization for the Professional Advancement of Black Chemists and Chemical Engineers (NOBCChE)
National Organization for the Professional Advancement of Black Chemists and Chemical Engineers Professional Leadership Award
American Institute of Chemical Engineers Pioneers of Diversity Award
National Organization for the Professional Advancement of Black Chemists and Chemical Engineers Joseph N. Cannon Award
American Institute of Chemical Engineers William W. Grimes Award for Excellence in Chemical Engineering
Inducted into Sigma Xi Scientific Research Society
Council for Chemical Research (CCR) Diversity Award
Selected to participate in 12th Annual US Frontiers of Engineering Symposium by the National Academy of Engineering (NAE)
National Academy of Engineering - CASEE Boeing Senior Fellowship
National Consortium for Graduate Degrees for Minorities in Engineering (GEM) Distinguished Alumni Academic Award
NSF Presidential Award for Excellence in Science, Math and Engineering Mentoring (PAESMEM)
Selected publications
Decuir-Cunby, Jessica T.; Grant, Christine; Gregory, Bradley. (January 2013). "Exploring career trajectories for women of color in engineering: The experiences of African American and Latina engineering professors". Journal of Women and Minorities in Science and Engineering. 19 (3): 209–225. doi:10.1615/JWomenMinorScienEng.2013005769.
References
Living people
Year of birth missing (living people)
American chemical engineers
American women academics
21st-century African-American scientists
African-American women scientists
Brown University School of Engineering alumni
North Carolina State University faculty
Georgia Tech alumni
21st-century African-American women
20th-century African-American academics
20th-century American academics
20th-century African-American scientists
21st-century African-American academics
21st-century American academics
|
```yaml
# Do not edit. Data is from res/country/metadata and path_to_url
atmOperators: [UOB, POSB, DBS, OCBC, OCBC Bank, Citibank, HSBC, State Bank of India, POSB ATM, DBS/POSB, BOC, UOB ATM, Standard Chartered, SAM, Maybank, ICBC, AXS]
centerLineStyle: white
chargingStationOperators: [Greenlots, 'Tesla, Inc.', Singapore Power, Charge+, BlueSG, Shell, Tesla, Shell Recharge Solutions, SP Mobility]
defaultSpeedLimitHasUrbanOrRural: false
isLeftHandTraffic: true
mobileCountryCode: 525
noParkingLineStyle: double yellow
noStandingLineStyle: yellow zig-zags
noStoppingLineStyle: double yellow zig-zags
officialLanguages: [en, ms, zh, ta]
orchardProduces: [coconut, tomato]
parcelLockerBrand: [Pick, POPStation]
popularReligions: [buddhist, christian, muslim, chinese_folk, taoist, hindu]
postboxesHaveCollectionTimes: true
postboxesHaveRef: true
```
|
```xml
import { OnInit, Directive } from "@angular/core";
import { firstValueFrom, Observable } from "rxjs";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service";
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
import { DialogService, SimpleDialogOptions } from "@bitwarden/components";
@Directive()
export class PremiumComponent implements OnInit {
isPremium$: Observable<boolean>;
price = 10;
refreshPromise: Promise<any>;
cloudWebVaultUrl: string;
extensionRefreshFlagEnabled: boolean;
constructor(
protected i18nService: I18nService,
protected platformUtilsService: PlatformUtilsService,
protected apiService: ApiService,
protected configService: ConfigService,
private logService: LogService,
protected dialogService: DialogService,
private environmentService: EnvironmentService,
billingAccountProfileStateService: BillingAccountProfileStateService,
) {
this.isPremium$ = billingAccountProfileStateService.hasPremiumFromAnySource$;
}
async ngOnInit() {
this.cloudWebVaultUrl = await firstValueFrom(this.environmentService.cloudWebVaultUrl$);
this.extensionRefreshFlagEnabled = await this.configService.getFeatureFlag(
FeatureFlag.ExtensionRefresh,
);
}
async refresh() {
try {
this.refreshPromise = this.apiService.refreshIdentityToken();
await this.refreshPromise;
this.platformUtilsService.showToast("success", null, this.i18nService.t("refreshComplete"));
} catch (e) {
this.logService.error(e);
}
}
async purchase() {
const dialogOpts: SimpleDialogOptions = {
title: { key: "continueToBitwardenDotCom" },
content: {
key: this.extensionRefreshFlagEnabled ? "premiumPurchaseAlertV2" : "premiumPurchaseAlert",
},
type: "info",
};
if (this.extensionRefreshFlagEnabled) {
dialogOpts.acceptButtonText = { key: "continue" };
dialogOpts.cancelButtonText = { key: "close" };
}
const confirmed = await this.dialogService.openSimpleDialog(dialogOpts);
if (confirmed) {
this.platformUtilsService.launchUri(
`${this.cloudWebVaultUrl}/#/settings/subscription/premium`,
);
}
}
async manage() {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "premiumManage" },
content: { key: "premiumManageAlert" },
type: "info",
});
if (confirmed) {
this.platformUtilsService.launchUri(
`${this.cloudWebVaultUrl}/#/settings/subscription/premium`,
);
}
}
}
```
|
```c++
/// Source : path_to_url
/// Author : liuyubobobo
/// Time : 2022-03-25
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
/// Using Stack
/// Time Complexity: O(n)
/// Space Complexity: O(n)
class Solution {
public:
int calPoints(vector<string>& ops) {
vector<int> v;
for(const string& e: ops)
if(isdigit(e[0]) || e[0] == '-'){
int x = atoi(e.c_str());
v.push_back(x);
}
else if(e == "+")
v.push_back(v.back() + v[v.size() - 2]);
else if(e == "D")
v.push_back(2 * v.back());
else
v.pop_back();
return accumulate(v.begin(), v.end(), 0);
}
};
int main() {
return 0;
}
```
|
Jye Mullane (born 29 July 1981) is an Australian former professional rugby league footballer who played in Australia for the Cronulla-Sutherland Sharks and Manly-Warringah Sea Eagles.
In 2005 he signed with NSW Waratahs Australian Rugby Union and played domestically for Southern Districts Rebels (2006) and Northern Suburbs (2007). At this time the Australian Rugby Championship (ARC) was established nationally. Jye represented the Central Coast Rays in successfully taking out the maiden premiership. From this Jye relocated to France debuting with the successful Lézignan Sangliers 2007 premiership winning team before signing on with Beziers rugby ProD2 competition.
Mullane went onto play six seasons in France spanning both rugby league and rugby union before returning to Australia to assist his local junior club De La Salle win an A grade Final in 2013
Playing career
Mullane debuted in 2002, as a 21-year-old and played a total of 30 first grade matches spanning four years. He switched codes in 2007, playing at Northern Suburbs club rugby, Central Coast Rays (now defunct APC) before signing a one-year deal with NSW Waratahs.
In 2008, he left for France, playing for Lezignan Corbieres where he helped win their first premiership in 30 years. Joining Béziers (ASBH) rugby France in the Pro D2 in 2008. Since returning to rugby league for Lezignan 2009, he helped them remain the champions of the French Elite competition for four years in a row with two French cup titles.
References
External links
Jye Mullane player profile-Lezignan
1981 births
Living people
Australian expatriate rugby league players
Australian expatriate sportspeople in the United States
Australian rugby league players
Australian rugby union players
New Haven Warriors players
Cronulla-Sutherland Sharks players
Lézignan Sangliers players
Expatriate rugby league players in France
New South Wales Waratahs players
Rugby league five-eighths
Rugby league halfbacks
Manly Warringah Sea Eagles players
Rugby league players from Sydney
Northern Suburbs Rugby Club players
|
```swift
//
// BMSubtitles.swift
// Pods
//
// Created by BrikerMan on 2017/4/2.
//
//
import Foundation
public class BMSubtitles {
public var groups: [Group] = []
/// subtitles delay, positive:fast, negative:forward
public var delay: TimeInterval = 0
public struct Group: CustomStringConvertible {
var index: Int
var start: TimeInterval
var end : TimeInterval
var text : String
init(_ index: Int, _ start: NSString, _ end: NSString, _ text: NSString) {
self.index = index
self.start = Group.parseDuration(start as String)
self.end = Group.parseDuration(end as String)
self.text = text as String
}
static func parseDuration(_ fromStr:String) -> TimeInterval {
var h: TimeInterval = 0.0, m: TimeInterval = 0.0, s: TimeInterval = 0.0, c: TimeInterval = 0.0
let scanner = Scanner(string: fromStr)
scanner.scanDouble(&h)
scanner.scanString(":", into: nil)
scanner.scanDouble(&m)
scanner.scanString(":", into: nil)
scanner.scanDouble(&s)
scanner.scanString(",", into: nil)
scanner.scanDouble(&c)
return (h * 3600.0) + (m * 60.0) + s + (c / 1000.0)
}
public var description: String {
return "Subtile Group ==========\nindex : \(index),\nstart : \(start)\nend :\(end)\ntext :\(text)"
}
}
public init(url: URL, encoding: String.Encoding? = nil) {
DispatchQueue.global(qos: .background).async {[weak self] in
do {
let string: String
if let encoding = encoding {
string = try String(contentsOf: url, encoding: encoding)
} else {
string = try String(contentsOf: url)
}
self?.groups = BMSubtitles.parseSubRip(string) ?? []
} catch {
print("| BMPlayer | [Error] failed to load \(url.absoluteString) \(error.localizedDescription)")
}
}
}
/**
Search for target group for time
- parameter time: target time
- returns: result group or nil
*/
public func search(for time: TimeInterval) -> Group? {
let result = groups.first(where: { group -> Bool in
if group.start - delay <= time && group.end - delay >= time {
return true
}
return false
})
return result
}
/**
Parse str string into Group Array
- parameter payload: target string
- returns: result group
*/
fileprivate static func parseSubRip(_ payload: String) -> [Group]? {
var groups: [Group] = []
let scanner = Scanner(string: payload)
while !scanner.isAtEnd {
var indexString: NSString?
scanner.scanUpToCharacters(from: .newlines, into: &indexString)
var startString: NSString?
scanner.scanUpTo(" --> ", into: &startString)
// skip spaces and newlines by default.
scanner.scanString("-->", into: nil)
var endString: NSString?
scanner.scanUpToCharacters(from: .newlines, into: &endString)
var textString: NSString?
scanner.scanUpTo("\r\n\r\n", into: &textString)
if let text = textString {
textString = text.trimmingCharacters(in: .whitespaces) as NSString
textString = text.replacingOccurrences(of: "\r", with: "") as NSString
}
if let indexString = indexString,
let index = Int(indexString as String),
let start = startString,
let end = endString,
let text = textString {
let group = Group(index, start, end, text)
groups.append(group)
}
}
return groups
}
}
```
|
The Eltang stone (also Stenderup stone, listed as DR 35 in the Rundata catalog (DK SJy 1), is a Viking Age runestone (now at the National Museum of Denmark, catalogue nr. D 52/1950).
The stone was discovered in 1866 in North-Stenderup, Eltang parish, Vejle, Region of Southern Denmark, Denmark, about 2 km north of Kolding, on the estate of one Mr. Flensbourg, who gave it to the Oldnordisk Museum (which merged into the National Museum of Denmark in 1892).
The Danske Runeindskrifter database of the Copenhagen University's Nordisk Forskningsinstitut dates it to the later Viking Age (the range of AD 900-1200 cited as a "fairly safe" estimate).
It is a granite slab, measuring 66 cm high and 60 cm wide at a thickness between 4 and 10 cm. The lower right part of the slab is broken off, but the runic inscription is preserved in its entirety.
The inscription consists of nine runic horizontal staves, running top to bottom, enclosed in a frame.
The Danske Runeindskrifter database reads i??iæþik?? (after Moltke (1985); transcribing the Younger Futhark ár rune as æ).
The inscription is discussed in greater detail by George Stephens (1868).
Stephens places it in the 9th century, i.e. the early phase of development of the Younger Futhark.
He interprets the five first staves as sam-staves, to be read as the same rune attached to the stave twice, and to be read twice, as it were
{|
|- valign=middle
|
|
|
|
|
| rowspan=2 |
|- valign=middle
|
|
|
|
|
|}
This results in a transcription of , read as ioþin þiki ioþin.
Stephens takes this as a reference to Woþin ("which in many dialects was softened to Oþin [...] I look upon the i as a Jutlandish prefix") and he translates "O Woden receive [thy servant] Woden!". He notes that (assuming his interpretation is correct) this is the first instance of the theonym Odin found recorded on a Scandinavian runestone.
References
George Stephens, The Runic Hall in the Danish Old-Northern Museum (1868), p. 6.
Erik Moltke, Runes and their origin, Denmark and elsewhere, National Museum of Denmark, 1985, p. 523.
Eltang-sten at Projektet Samnordisk runtextdatabas (2004)
Runestones in Denmark
Odin
|
Fanny Titus Hazen (May 9, 1840 – January 15, 1930) served as an army nurse during the American Civil War. Later in life, she was president of the National Association of Army Nurses of the Civil War.
Early life
Fanny Hallycarnie Titus was born in Vershire, Vermont in 1840, the eldest of the eleven children of Simeon Bacon Titus and Eliza Jane Morris Titus. Her grandfathers William Morris and Lenox Titus both served in the American Revolutionary War. She was raised partly in Lawrence, Massachusetts, living with her grandmother to attend school there.
Career
Three of Titus's brothers served in the Union Army; two died from their wounds and illnesses in the service, and one was a prisoner at Andersonville. Though she was younger than the minimum age preferred for nurses, she joined the Army nursing corps in 1864 under Dorothea Dix, trained under Caroline Burghardt, and worked at Columbia Hospital in Washington, D.C. until the end of the war in 1865. "So hour after hour I watched the life-light flicker and die of many noble men whose lives were a sacrifice for their country," she recalled later in a memoir for Mary A. Gardner Holland's Our Army Nurses (1897).
She was president of the Massachusetts Army Nurses Association in 1918, and president of the National Association of Army Nurses of the Civil War. She was a delegate to national meetings of the Woman's Relief Corps in California (1886) and Indiana (1893). She was also active in the Daughters of the American Revolution and in the Cambridge Equal Suffrage Association.
Personal life
Fanny Titus married Charles Richard Hazen, a Union Army veteran, in Vermont in 1866. They lived in Massachusetts and had four children; two sons died in childhood. Her parents lived with her in their last years; both died in 1903. She had a dressmaking business in Cambridge, Massachusetts. She was widowed when Charles Hazen died in 1916, and she died in Cambridge in 1930, aged 89 years. Her grave is in Cambridge Cemetery.
References
External links
Vermont Public Radio, "Lawless: Breaking Down Gender Stereotypes" (March 22, 2011), a radio story about Vermont women in the Civil War, including Fanny Titus Hazen.
1840 births
1930 deaths
American Civil War nurses
American women nurses
People from Vershire, Vermont
People of Vermont in the American Civil War
|
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hot Cofee</title>
</head>
<style>
body {
background: #8acdeb;
}
#container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.steam {
position: absolute;
height: 150px;
width: 150px;
border-radius: 50%;
background-color: #fff;
margin-top: -75px;
margin-left: 75px;
z-index: 0;
opacity: 0;
}
#steam1 {
-webkit-animation: steam1 4s ease-out infinite;
animation: steam1 4s ease-out infinite;
}
#steam3 {
-webkit-animation: steam1 4s ease-out 1s infinite;
animation: steam1 4s ease-out 1s infinite;
}
@-webkit-keyframes steam1 {
0% {transform: translateY(0) translateX(0) scale(0.25); opacity: 0.2;}
100% {transform: translateY(-200px) translateX(-20px) scale(1); opacity: 0;}
}
@keyframes steam1 {
0% {transform: translateY(0) translateX(0) scale(0.25); opacity: 0.2;}
100% {transform: translateY(-200px) translateX(-20px) scale(1); opacity: 0;}
}
#steam2 {
-webkit-animation: steam2 4s ease-out 0.5s infinite;
animation: steam2 4s ease-out 0.5s infinite;
}
#steam4 {
-webkit-animation: steam2 4s ease-out 1.5s infinite;
animation: steam2 4s ease-out 1.5s infinite;
}
@-webkit-keyframes steam2 {
0% {transform: translateY(0) translateX(0) scale(0.25); opacity: 0.2;}
100% {transform: translateY(-200px) translateX(20px) scale(1); opacity: 0;}
}
@keyframes steam2 {
0% {transform: translateY(0) translateX(0) scale(0.25); opacity: 0.2;}
100% {transform: translateY(-200px) translateX(20px) scale(1); opacity: 0;}
}
#cup {
z-index: 1;
}
#cup-body {
position: absolute;
height: 200px;
width: 300px;
border-radius: 0 0 150px 150px;
background-color: #fff;
margin: auto;
display: inline-block;
overflow: hidden;
z-index: 1;
}
#cup-shade {
position: relative;
height: 300px;
width: 200px;
background-color: #F3F3F3;
display: inline-block;
margin-left: 42%;
margin-top: -3px;
transform: rotate(50deg);
z-index: 1;
}
#cup-handle {
position: relative;
height: 75px;
width: 80px;
border-radius: 0 150px 150px 0;
border: 15px solid #F3F3F3;
margin-bottom: 95px;
margin-left: 250px;
display: inline-block;
z-index: 0;
}
#saucer {
position: absolute;
height: 30px;
width: 300px;
border-radius: 0 0 100px 100px;
background-color: #F9F9F9;
margin-top: -32px;
margin-left: 5px;
z-index: 2;
}
#shadow {
height: 10px;
width: 300px;
border-radius: 50%;
margin-top: -5px;
margin-left: 6px;
background-color: #7bb8d4;
}
</style>
<body>
<div id="container">
<div class="steam" id="steam1"> </div>
<div class="steam" id="steam2"> </div>
<div class="steam" id="steam3"> </div>
<div class="steam" id="steam4"> </div>
<div id="cup">
<div id="cup-body">
<div id="cup-shade"></div>
</div>
<div id="cup-handle"></div>
</div>
<div id="saucer"></div>
<div id="shadow"></div>
</div>
</body>
</html>
```
|
The Communist Party of Trinidad and Tobago was a pro-Albanian Marxist–Leninist political party in Trinidad and Tobago. The party was founded in 1979. One source claims it was founded by Hardial Bains, the leader of Communist Party of Canada (Marxist–Leninist). CPTT published Class Struggle.
Many of the members of this party renounced their hardline communist stances by the end of the 1980s, coinciding with the Fall of the Soviet Union. Former members Michael Als and Wade Mark were involved in party politics in the late 1990s. Wade Mark is a member of the executive of the United National Congress. Michael Als was a UNC candidate for the 2000 election.
References
Political parties established in 1979
Communist Party of Trinidad and Tobago
Political parties in Trinidad and Tobago
1979 establishments in Trinidad and Tobago
|
is a Latin title meaning "Emperor of All Spain". In Spain in the Middle Ages, the title "emperor" (from Latin imperator) was used under a variety of circumstances from the ninth century onwards, but its usage peaked, as a formal and practical title, between 1086 and 1157. It was primarily used by the kings of León and Castile, but it also found currency in the Kingdom of Navarre and was employed by the counts of Castile and at least one duke of Galicia. It signalled at various points the king's equality with the rulers of the Byzantine Empire and Holy Roman Empire, his rule by conquest or military superiority, his rule over several ethnic or religious groups, and his claim to suzerainty over the other kings of the peninsula, both Christian and Muslim. The use of the imperial title received scant recognition outside of Spain and it had become largely forgotten by the thirteenth century.
The analogous feminine title, "empress" (Latin imperatrix), was less frequently used for the consorts of the emperors. Only one reigning queen, Urraca, had occasion to use it, but did so sparingly.
History
Kings of Asturias
One of the earliest references to the Kingdom of Asturias, predecessor of the Kingdom of León, as an empire (imperium) is in the Chronicle of Alfonso III (881), which says that King Silo (774–83) "subjugated the people of Galicia to his imperial rule" (imperium). The reference is clearly to the rule of the Asturian king over several peoples, namely Asturians, Galicians and Basques.
A surviving charter of 863 refers to Ordoño I as "our lord, residing in the Asturias" (domno nostro Ordonio residente in Asturias), qualifying him as a "commanding prince" (imperante principe). This residential form of title was preferred because the Asturian kingdom at this stage was not ethnically unified or well-defined.
Kings of León
Alfonso III
There exist two diplomas dated to the reign of Alfonso III of Asturias and referring to him as emperor, but both are early twelfth-century fabrications emanating from the scriptorium of the Diocese of Mondoñedo and Bishop Gonzalo, designed to bolster that church's claims in a dispute of 1102. The first document, dated to 866 or 867, confirmed by Alfonso, who signs as "I, Alfonso, of all Spain emperor, who is unworthily permitted to be called the Catholic". The other refers to him simply as "Alfonso, Emperor of Spain" (Adefonsus Hispaniae imperator). The forger may have borrowed these exalted titles from the chancery of Alfonso VI, who was using the title imperator totius Hispaniae at the time. The subscription lists of both these charters (that is, the list of those who witnessed or confirmed them) are compatible with the dates, and it has been suggested that the clauses referring to Alfonso as emperor are derived from authentic (albeit now lost) charters.
There exists a letter purportedly written by Alfonso III to the clergy of the Cathedral of Tours in 906, wherein the king is arranging to purchase an "imperial crown made of gold and precious stones, fitting to his dignity" (corona imperialis) kept at Tours. Alfonso almost invariably calls himself simply "King Alfonso" (Adefonsus rex) in his surviving charters, but in the letter he uses the elaborate and high-ranking style "Alfonso by the power and assent of Christ king of Spain" (Adefonsus pro Christi nutu at que potentia Hispaniae rex). A similarly grandiose title is given to Alfonso in the contemporary Chronica Prophetica (883): "glorious Alfonso in all the Spains to reign" (gloriosus Adefonsus in omni Spanie regnaturus). The authenticity of the letter is still debated.
Besides the apocryphal charters, there are genuine, posthumous documents referring to Alfonso as emperor. In one that dates from 917, in the reign of his son Ordoño II of León, the king confirms as "Ordoño, son of the Emperor Alfonso the Great" (Ordonius, filius Adephonsi Magni imperatoris). A document from 950 can also be cited that refers to Alfonso with the imperial title. The pertinent passage reads: "They put in place a border with Gonzalo, son of our lord emperor Prince Alfonso".
Tenth century
A royal diploma of 922, where Ordoño II refers to himself as emperor, is the first recorded instance of a Leonese king doing so. The charter reads, "I, the most serene emperor Ordoño" (Ego serenissimus imperator Ordonius). Ordoño II's successor, Ramiro II (931–51), is not titled "emperor" in any contemporary document, but a charter dated 940 and preserved as a copy in the cartulary of the monastery of Eslonza is dated by "our reigning lord and emperor" (regnante domino et imperatore nostro), the reigning king being Ramiro II. Although he apparently avoided the imperial style himself, his subjects and his successor did not. Private documents of his reign commonly refer to him as the "great king" (rex magnus), as in a document of 930 ("reigning Ramiro, prince and great king in León"). In a private charter from the first year of Ramiro's son Ordoño III (952), the king is called "our reigning lord prince Ordoño, heir of the lord emperor Ramiro" (regnante principe nostro domno Hordonio, prolis domini Ranimiri imperatoris) and the charter was given "at Simancas in the presence of the emperor" (perrexerunt ad Septemanka in presentia imperatoris). In a charter of 954, Ordoño is described as "most lordly emperor, son of Ramiro" (dominisimo imperatori Ranimiro filius).
Contemporary documents of the reign of Ramiro III of León use the magnified titles basileus and magnus rex ("great king"). The former is a Latinisation of the Greek for "king" and was the title employed by the Byzantine Emperors. To western European ears it had an imperial inflection. During the regency of Ramiro's aunt, the nun Elvira Ramírez, the king confirmed a document of 1 May 974 as "Flavius Ramiro, prince, anointed great basileus in the kingdom ... I confirm with my own hand. Elvira, basilea, paternal aunt of the king". The Roman personal name Flavius, which originally meant "blond", was popular among Romanised barbarians, and the kings of the Visigoths took to using it as a Byzantine-sounding title, to give themselves legitimacy. Its use in a document of the tenth century harkens back to Visigothic rule and peninsular unity. A judicial document that emanated from the royal court in 976 refers to a certain royal servant as "in the palace of the most lordly king–emperor ... in obedient service to his most lordly emperor".
Eleventh century
In the first decades of the eleventh century, the Catalan Abbot Oliba referred to the kings of León, Alfonso V and Bermudo III, as imperatores. Two charters of Sancho Garcés III of Pamplona for the monastic house of San Juan de la Peña, both erroneously dated to 1025, use the same dating clause identify Bermudo III as "emperor in Galicia". It is not clear what the imperial title means in this charter, which appears to have been issued before Sancho's conquest of the city of León, when Bermudo was reduced to ruling Galicia, for the conquest came in 1034 and the charter was drawn between Bermudo's accession in 1028 and the death of Duke Sancho VI of Gascony on 4 October 1032. There exists a charter of 1036 issued by Ramiro I of Aragon, which lists the sovereigns then reigning in Spain thus: "Emperor Bermudo in León, and Count Ferdinand in Castile, and King García in Pamplona, and King Ramiro in Aragon, and King Gonzalo in Ribagorza".
Kings of Navarre
The imperial title is found in the section of the Códice de Roda conventionally called the "Genealogies of Roda" (Genealogías de Roda), where Sancho Garcés I of Pamplona (905–25) is named "excellent emperor Sancho Garcés". This manuscript is thought to date from the late tenth century and may not reflect contemporary usage. Likewise, it appears to derive from an Iberian Arabic original, and the imperial title may be an imprecise representation of some Arabic title such as Caliph. The "Genealogies" also refer to Sancho Garcés's daughter as "Sancha, wife of Emperor Ordoño of León", referring to Ordoño II, whose third and final wife she was. In the Codex the other kings of León are simply styled "kings" (regis), although Ordoño II's successor, Ramiro II, is called "great king" (Ranimirus rex Magnus).
In 1034 the city of León was conquered by Sancho III of Pamplona, known as "the Great". The imperial pretensions of Sancho and his titulature have been vigorously debated ever since Ramón Menéndez Pidal referred to him as an "anti-emperor" (antiemperador). Sancho never styled himself "emperor" in any of his charters, but he did occasionally employ imperial terminology. The most extensive title he ever used occurs in a document of 26 December 1032: "the aforementioned most serene King Sancho reigning in Pamplona and in Aragon and in Sobrarbe and in Ribagorza as well as in all Gascony and also in the whole of Castile, and overlording, it may be said, amply in León, that is, in Astorga ruling (inperante) by the grace of God". In the preceding document the "imperial" term is connected with his rule in Astorga, but in a document dated 19 March 1033 it is connected with Gascony—"King Sancho Garcés reigning in Aragon and in Castile and in León, from Zamora as far as in Barcelona, and ruling (imperante) the whole of Gascony"—while in another of unknown date it refers to his rule of Castile—"the most serene King Sancho reigning by the grace of God in Pamplona, in Aragon, in Sobrarbe, in Ribagorza, in Gascony, and ruling (imperante) in the whole of Castile by God's grace". The only charter that styles Sancho "emperor" is a later forgery found in the cartulary of San Juan de la Peña that reads, "Sancho, King and Emperor in Castile and in Pamplona and in Aragon and in Sobrarbe and in Ribagorza".
In a certain charter Sancho III issued in 1032, while he was in La Rioja, and preserved in the cartulary of Albelda, he refers to the city of León as the imperiali culmine ("summit of the empire"): "Our Lord [Jesus Christ] reigning over all and under his empire (imperium) [Sancho] king in Aragon and in Pamplona and in Castile and in the Tierra de Campos as well as in León the imperial acme". There are also two authentic surviving documents that refer to Sancho's imperium (empire, rule), both from 1034. The first, dated 24 September and preserved in the cartulary of San Juan de la Peña, connects his imperium with all his domains: "[in] the times of King Sancho holding [his] empire in Aragon and in Pamplona and in Castile and in León". The other, from the archives of the Cathedral of León, describes León as an imperium: "the kingdom [and] empire [of] King Sancho in León".
In the twelfth and thirteenth centuries, scribes began to refer to Sancho as rex Hispaniarum—"King of the Spains"—a style which implied his lordship over all the Iberian domains. Two forged charters from the monastery of San Salvador de Oña, where Sancho was buried, call him this: "Sancho, king by the grace of God of the Spains" There is another charter, likewise forged, from the abbey of San Millán de la Cogolla which calls him "Sancho, by the grace of God of the Spains king, overseeing day by day all Spain". Although they shed no light on Sancho's self-perception, these medieval forgeries are "plainly valid for understanding the vision that later generations had of Sancho the Great as ‘king of the Spains’ and not of an ethnicity or a petty kingdom." An anonymous twelfth-century text recording the refoundation of the Diocese of Palencia by Sancho III notes that "with reason he could be called ‘king of the kings of Spain’."
A title nearly equivalent to rex Hispaniarium was used of Sancho during his lifetime. In the same letter in which he referred to Alfonso V of León as "emperor", Abbot Oliva called Sancho the "Iberian king" (rex ibericus). The letter was addressed to Sancho:
For the lord and venerable Iberian king, Oliba, bishop of the holy see of Vic, with all the community of Santa Maria de Ripoll governed by him, desires the joys of life both present and future.
Another contemporary source from outside Sancho's realms refers to him with a title nearly equivalent to the strictly anachronistic rex Hispaniarium. In his Historiarium sui temporis libri quinque, the French chronicler Ralph Glaber lists the kings have maintained friendly relations with Robert II of France by sending him gifts and petitioning him for aid. Among them is Sancio rege Navarriae Hispaniarium. This title is susceptible to more than one interpretation, and literally translates as "Sancho king of Navarre of the Spains".
Between 1033 and 1035 Sancho III may even have minted coins bearing the imperial title with reference to his capital of Nájera—NAIARA / IMPERATOR—although these may instead be coins of Sancho I, of Alfonso the Battler, or of Alfonso VII. Menéndez Pidal argued that the coin was issued between 1033 and 1035, after Sancho's conquest of León, but P. Germán de Iruña suggests that it might have been issued before 1030.
The fourteenth-century Chronicle of San Juan de la Peña, in its fourteenth chapter, notes that "because of the wide lands that he possessed and which he was made to dominate Sancho was called ‘emperor’."
Counts of Castile
The imperial style was used on several occasions by the last Counts of Castile, nominal subjects of the Leonese kings. In a fuero granted to Castrojeriz in 974, which survives in a thirteenth-century confirmation, Count García Fernández refers to himself as "I, García Fernández, by the grace of God count and emperor of Castile" (Ego Garssia Ferdinandi, gratia Dei comes et imperator Castelle). Ramón Menéndez Pidal argued that this text originally read imperante Castelle ("ruling Castile") and was mangled at the time of the confirmation. Alfonso García Gallo rejected this on the grounds that an imperante phrase with a different structure is used in the dating clause of the fuero and that two different structures would have been employed for the same terminology. In 987, in a charter of donation to the church of Santillana del Mar, García Fernández again styled himself emperor: "I, Count García Fernández, and the Countess Doña Eva, from the count [and/of the] emperor eternal greetings in [the name of] the Lord God " (Ego Garcia Fredenandiz comes, et donna Aba cometissa, comitis imperatoris in Domino Deo et eterna salutem).
There also survive documents from Castile which make reference to the imperator terrae ("emperor of the land"), but the relevance of these was disputed by Mayer and Menéndez Pidal, who disagreed whether they referred to the Count of Castile or the King of León. The charters date from 968, when the count was Fernán González and the king was Ramiro III, and 1042, when the count, Ferdinand I, was also king.
Banu Gómez
Another local count, who with the help of Almanzor would briefly expel king Bermudo II and control the eastern part of the Kingdom of León as well as its capitol, would likewise express imperial pretensions. The record of a 992 plea would be dated to "the sixth year of the imperium of our Lord, Count García Gómez".
Rulers of León and Castile
Ferdinand I
Upon the death of his elder brother García Sánchez III of Navarre in 1054, Ferdinand I of Castile and León gained a position of preeminence among the Christian kings of Iberia. He was first called "emperor" by the notaries employed by his half-brother, Ramiro I of Aragon, the same ones who in 1036 called Ferdinand's predecessor Bermudo III "emperor". In a royal Aragonese charter of that same year, before Ferdinand had even defeated Bermudo and taken his kingdom at the Battle of Tamarón, Ramiro refers to his brother as "emperor in Castile and in León and in Astorga". A similarly-worded charter was issued in 1041 and again in 1061, where the order of kingdoms is reversed and Astorga ignored: "emperor in León and in Castile".
Ferdinand is sometimes said to have had himself crowned "Emperor of Spain" in 1056, but this is based only on the first use of the imperial style in a charter of his own, preserved in the cartulary of Arlanza: "under the rule of the emperor King Ferdinand and the empress Queen Sancha ruling the kingdom in León and in Galicia as well as in Castile" (sub imperio imperatoris Fredinandi regis et Sancie regine imperatrice regnum regentes in Legione et in Gallecia vel in Castella). This title was only used on one other occasion during his reign. A document of 1058 dates itself "in the time of the most serene prince Lord Ferdinand and his consort Queen Sancha" (in tempore serenissimi principis domni Fredinandi et ejus conjugis Sanciae reginae) and later qualifies him as "this emperor, the aforesaid Ferdinand" (perrexerunt ad ipsum imperatorem jam dictum Fredenandum). The Chronicon complutense, probably written shortly after Ferdinand's death, extols him as the "exceedingly strong emperor" (imperator fortissimus) when mentioning the Siege of Coimbra.
After Ferdinand's death in 1065, his children took to calling him "emperor". In 1072, Alfonso VI, Fedinand's second son, referred to himself as "offspring of the Emperor Ferdinand". Two years later (1074), Urraca of Zamora and Elvira of Toro referred to themselves as "daughters of the Emperor Ferdinand the Great". In a later charter of 1087, Ferdinand is referred to first as "king", then as "great emperor", and finally just as "emperor" alongside his consort, who is first called "queen" then "empress". Sancha's epigraph at the Basilica of San Isidoro calls her "Queen of all Hispania" ("Regina totius Hispaniæ").
In the fourteenth century a story appeared in various chronicles according to which the Pope, the Holy Roman Emperor, and the King of France demanded a tribute from Ferdinand I. In certain versions the Pope is named Urban (although it could not have been either Urban I or Urban II) and in other versions Victor (which is plausibly identifiable with Victor II). According to this late account, the king was prepared to pay, but the Cid (who in reality was a young and very minor figure during Ferdinand's reign) declared war on Pope, Emperor and Frenchman, who rescinded their demand. For this reason "Don Ferdinand was afterwards called ‘the Great’: the peer of an emperor". In the sixteenth century this account re-appeared, extended and elaborated, in its most complete form in the Jesuit historian Juan de Mariana. He wrote that in 1055 at the Council of Florence, the Emperor Henry III urged Victor II to prohibit under severe penalties the use of the imperial title by Ferdinand of León. This story is generally regarded as apocryphal, although some modern authors have accepted it uncritically or seen a kernel of historical truth in it. Spanish historian A. Ballesteros argued that Ferdinand adopted the title in opposition to Henry III's imperial pretensions. German historian E. E. Stengel believed the version found in Mariana on the grounds that the latter probably used the now lost acts of the Council of Florence. Juan Beneyto Pérez was willing to accept it as based on tradition and Ernst Steindorff, the nineteenth-century student of the reign of Henry III, as being authentically transmitted via the romancero. Menéndez Pidal accepted the account of Mariana, but placed it in the year 1065.
Alfonso VI
Ferdinand I divided his lands between his sons. The Historia Roderici calls his second son, Sancho II of León and Castile, rex tocius Castelle et dominator Hyspaniae ("king of all Castile and dominator of Spain"). His youngest son, García, was only posthumously called "emperor" on account of his feats in battle. His second son, Alfonso VI, survived both brothers and, with García in prison, was ruling all of his father's realms by 1072. He was the first Spanish ruler to consistently style himself "emperor" (imperator). Before 1079 he also used the titles "King of Spain" (rex Hispaniae) or "King of all Spain" (rex totius Hispaniae).
Origins
The first use of the imperial title by Alfonso VI comes from a diploma of 1075, where he is called simply imperator, although he subscribed the charter with the title rex (king).
The earliest use of the imperial title by Alfonso VI that comes down to us is found in a royal charter issued 17 October 1077, but preserved only as a copy. The same notary who wrote up this charter also wrote up a private charter the original of which survives, dated 29 January 1078 and confirmed by Alfonso VI as emperor. The earliest original royal charter to use the imperial style dates to 7 April 1079. The timing of the adoption of the imperial style suggests that it may have been in response to claims by Pope Gregory VII to suzerainty over the whole Iberian peninsula. A papal letter written 28 June 1077 could not have been received by Alfonso more than twelve weeks before the date of the first known usage of the title "emperor" by him. This letter was addressed to the "kings, counts, and other princes of Spain" (regibus, comitibus, ceterisque principibus Hyspaniae), an indication that Gregory did not regard Alfonso as unique among Spanish rulers. The term "Kingdom of Spain" was employed in this letter to refer to the Christian part of the peninsula and not to Alfonso's kingdom in particular, since the legates Gregory said he was sending there never even entered the latter.
Gregory had perhaps been inspired by his victory over the Holy Roman Emperor Henry IV in the Walk to Canossa that year. In his letter he promised to send two legates to Spain, Bishop Amadeus of Olorón and Abbot Frotard of Saint-Pons-de-Thomiéres. It is certain that these legates never entered Alfonso's kingdom, although they were in Catalonia in late 1077 and early 1078, and that the king and his ally, Abbot Hugh I of Cluny, requested another legate. In a papal letter dated 7 May 1078 Gregory confirmed that he was sending Cardinal Richard to Castile "as the King of Spain has asked and your counsel has desired" (sicut rex Hispaniae rogavit et vos consilium dedistis). Alfonso had already been described as "King of the Spains" (Hispaniarum rex) in a letter to Hugh of Cluny on 10 July 1077.
Other possible incentives for Alfonso to stress his hegemony over the Iberian peninsula include the submission of most of the taifas (Islamic factional kingdoms) to his suzerainty by the payment of parias (tribute) by 1073, and the annexation of La Rioja and those parts of Castile belonging to Navarre after the assassination of Sancho Garcés IV in 1076.
Imperator totius Hispaniae
Beginning in 1077 Alfonso instituted the use of the style ego Adefonsus imperator totius Hispaniae ("I, Alfonso, emperor of all Spain") and its use soon became regular. This title was used throughout the period 1079–81, which represents the peak of his imperial pretensions before his capture of the city of Toledo, ancient capital of the Visigoths. In 1080 he introduced the form ego Adefonsus Hispaniarum imperator ("I, Alfonso, emperor of the Spains"), which he used again in 1090. His most elaborate imperial title was ego Adefonsus imperator totius Castelle et Toleto necnon et Nazare seu Alave ("I, Alfonso, emperor of all Castile and of Toledo also and of Nájera, or Álava").
The charter of consecration of the Cathedral of Toledo on 18 December 1086, a feast day of the Virgin Mary, is the most copied eleventh-century charter from Spain. The charter is a pseudo-original: a close copy of the original, which was drawn up by the notary Sisnandus Astruariz, with some embellishments, such as the intitulario of Alfonso VI, who is called Esperie imperator ("emperor of Hesperia", meaning "the west", an archaic name for the Iberian peninsula) as opposed to the expected Ispanie imperator.
Alfonso seems to have regarded his conquest of Toledo in 1085/6 as having given him dominion over the other kingdoms of Spain, both Christian and Muslim. On four occasions after that date (1087, 1088, 1093, and 1099) he styled himself "I, Alfonso, constituted above all the Spains emperor" (ego, Adefonsus, constitutus super omnes Spanie imperator). Several times he explicitly referred to his rule of Toledo in an imperial styling:
1088: "I, Alfonso, of all the empire of Spain and kingdom of Toledo" (ego Adefonsus totius imperii Hispaniae et Toleti regni)
1096, 1099, and 1100 (four times total): "I, Alfonso, magnificent conqueror of the empire of Toledo" (ego Adefonsus Toletani imperii magnificus triunphator)
1097 and 1099: "I, Alfonso, by the grace of God Toledan emperor" (ego Adefonsus Dei gratia Toletanus imperator)
Contemporary private charters also use the imperial title, with variants of "emperor of all Spain" and "emperor of Toledo" both appearing. Twice, in 1098 and 1104, the elaborate dating clause "the king Don Alfonso reigning in Toledo and ruling (imperante) the Christians and the Pagans in all the kingdoms of Spain" is used. The Historia silense, written shortly after his reign in the ambit of the Leonese royal court, refers to Alfonso twice as the "orthodox Spanish emperor" (ortodoxus Yspanus imperator).
Alfonso's imperial title was recognised outside of his kingdom. In 1078, a document from the Diocese of Roda in Aragon, names as the most powerful rulers in Christendom "Henry, ruling (imperante) the Romans; Philip, the Franks; [and] Alfonso, the Spaniards", a possible allusion to Alfonso's imperial rank. On at least four occasions in his dating clauses (1081, 1086, 1092, and 1093), Sanchor Ramírez, ruler of Aragon and Pamplona, referred to Alfonso VI as imperatore domino Adefonso ("the lord emperor Alfonso") ruling either in Legione ("in León") or in Leone et in Castella atque in Toleto ("in León and in Castile and also in Toledo"). In the clause of 1086 and also in dating clauses of the Aragonese king for 1087, 1089, 1090, and 1093 wherein Alfonso's only title is rex (king), the Leonese king is named before the king whose charter it is, a clear indication that Sancho recognised an order of precedence or hierarchy which placed Alfonso at the top. Sancho's brother, García, Bishop of Jaca, was perhaps too keenly aware of the reality of this hierarchy, for Sancho eventually came to suspect that his brother was planning to hand over Alquézar to Alfonso, "to subvert the kingdom of his brother and exalt the empire of Alfonso" in the words of a contemporary charter. According to the Islamic historian Ibn Khaldun, Alfonso VI "used the title of emperor, that is to say, king of kings".
Alfonso was also the first Spanish monarch to use the term imperium to refer to an empire, the territory under the rule of an emperor, rather than as a synonym for power or authority. A royal diploma of 1084 refers to his having "convoked the bishops and abbots and also primates of my empire" for a synod. From 1088 there is also a direct reference to the "whole empire of Spain and kingdom of Toledo". Besides these there are the four contemporary references to Alfonso as Toletani imperii magnificus triunphator ("magnificent conqueror of the empire of Toledo") and the reference by Sancho Ramírez to the plot of his brother the bishop to favour the "empire of Alfonso" (Anfusi imperium).
Alfonso VI's son and heir, Sancho Alfónsez, is known in one interpolated and therefore inaccurate charter, dated 12 January 1102, as "Sancho son of the emperor" (Sancius filius Imperator).
Emperor of the Two Religions
There is some controversy over Alfonso's use of the title "Emperor of the Two Religions" (al-Imbraţūr dhī-l-Millatayn), which appears in a surviving letter he sent to King al-Mu‘tamid ibn Abbād of Seville. The two letters exchanged between the two kings in 1085 are preserved only in Arabic in the text of the fourteenth-century chronicle Al-Ḥulal al-Mawšiyya fi Ḍikr al-Ajbār al-Marrākušiyya. Most modern historians, such as Ambrosio Huici Miranda and Bernard F. Reilly, have questioned the authenticity of all the documents incorporated into this chronicle. Menéndez Pidal accepted their authenticity in his study of Alfonso's imperial title, and beginning in the late 1970s a debate opened up between medievalist Angus Mackay and orientalist Muhammad Benaboud on the one hand, arguing for their trustworthiness, and Hebraicist Norman Roth on the other, arguing against it.
Urraca
After the death of her husband, Duke Raymond of Galicia, and before the death of her father, the Emperor Alfonso VI, Urraca, in her capacity as ruler of Galicia styled herself "Empress of all Galicia" (tocius Gallecie imperatrix) in a charter of donation to the Diocese of Lugo dated 21 January 1108 and made "for [the benefit of] the soul of my [late] husband [lit. man] the most glorious Lord Duke Raymond" (pro anima viri mei gloriosissimi ducis domni Ramundi). Raymond had styled himself "Emperor of Galicia" (Gallecie imperator) on 17 March 1107, and the meaning of the title in this case is not clear. It is probable that Urraca's right to succeed Raymond was confirmed at a meeting of the royal court in León in December 1107 and that it was this which led her to briefly adopt the imperial style. There is an "altogether peculiar" charter surviving in a fifteenth-century copy, purportedly issued by Raymond of Galicia at Sahagún and dated, probably erroneously, to 1 April 1101. It refers to an "imperial army" (exercitatus imperatorum) under Raymond's command probably left to guard the Tagus valley during Alfonso VI's campaign against Valencia.
Two charters of 1112 refer to Queen Urraca as "empress" (imperatrix), including an original of 18 May. All the uses of this title by the queen come early in her reign, and perhaps formed "a conscious device to offset the authority of her ‘imperial’ husband", Alfonso the Battler, who was at the height of his power in the "dark days" of 1112. One of Urraca's most prolific known notaries, Martín Peláez, with fifteen surviving charters, three original, to his name, occasionally paired the title "chancellor" (cancellarius) for himself with that of "empress" for his sovereign. The use of a more dignified title than "notary" (notarius) may have been designed to buttress the use of the imperial title, which was probably considered excessively masculine, even in comparison to Urraca's regal powers. A charter of 6 September 1110 referring to Urraca as "queen and empress" (regina et imperatrix) and drawn up by a scribe named Petrus Vincentii is probably a falsification. There is another suspect charter, dating to 28 October 1114, while Urraca was wintering at Palencia with her court and Count Bertrán de Risnel, probably an ambassador from her husband's court. On that day she made a donation to the see of Palencia in which she appears with the title "Empress of all Spain" (totius hispaniae imperatrix), an exact feminine analogue of her father's usual lofty title, although this diploma survives only as a copy.
Although her use of the imperial styling was limited, much more so than that of her male predecessor and successor, Urraca did employ the title "Queen of Spain" on several occasions from the very beginning of her reign until the end. It is possible that the imperial style had connotations too strongly masculine, making a royal title equivalent in its claim of overarching sovereignty preferable. Her first act as queen, dated 22 July 1109, the day after her father's burial, was to confirm the privileges of the church of León. She signed the document as "Urraca by the pleasure of God queen of all Spain". On 26 June 1110, on the other side of her realm, Urraca issued a diploma to Diego López I de Haro of the Rioja, signing as "Queen of Spain" (Ispanie regina) and without mentioning her husband, who was then in Galicia.
Alfonso VII
Alfonso VI's successors, his daughter Urraca and her second husband Alfonso the Battler, used the imperial title only sporadically. Beginning in 1127 Urraca's son by her first husband, Alfonso VII of León and Castile used the title of his namesake grandfather frequently, and in 1135 he had himself crowned as emperor in León: he was the only Spanish imperator to have himself crowned as such and the last Spanish monarch to consistently employ the imperial style.
Alfonso used the title "emperor" on several occasions after his first coronation in 1111 (in Santiago de Compostela, as the candidate of a regional faction opposed to his mother) and before his mother's death in 1126: in 1117, 1118, 1124, 1125 and 1126. The first known occurrence of the title is a charter of 9 December 1117 issued at Sahagún, which was confirmed by the Archbishop of Toledo, Bernard, five bishops, and the most powerful lay nobles of the kingdom: Pedro Fróilaz de Traba, Froila Díaz, and Pedro Ansúrez.
The general use of the imperial title by Alfonso did not begin until after Urraca's death. The contemporary, anonymous account of his reign, the Chronica Adefonsi imperatoris ("Chronicle of Alfonso the Emperor"), consistently refers to him as "king" (rex) when recounting events prior to 1135 and always "emperor" (imperator) thereafter. In various documents, Alfonso VII had himself called "triumphant and ever undefeated" (triumphator et semper invictus), recalling Alfonso VI's use of a similar title in connexion with the imperial style. Generally Alfonso VII's use of the imperial title is distinct form that of his predecessors in having a clear juridical and hierarchical meaning (at least in his own eyes and probably those of his subjects). The Chronica Adefonsi describes the recognition Alfonso received at the assembly in León in 1135 as being due to his superiority over his neighbours:
Unlike the contemporary Holy Roman Emperors, Alfonso VII was not anointed prior to his imperial coronation, although he had been anointed for his royal coronation. The Estoria de España composed under the direction of Sancho IV of Castile in the thirteenth century claims that Alfonso's coronation as emperor was affirmed by Pope Innocent II upon request, but no Papal documents from Alfonso's reign refer to him as anything other than rex (king). A closer source, the contemporary Annales cameracenses, written by Lambert of Waterlos (died c.1170), do suggest wider European recognition of Alfonso's imperial stature. Under the year 1159 they refer to "our emperor" (the Holy Roman Emperor, Frederick I), the "Constantinopolitan emperor" (the Byzantine Emperor, Manuel I), and the "emperor of Galicia", that is, Alfonso VII.
Alfonso VII's usual title from 1136 on was simply "Emperor Alfonso" with a list of those regions he presumed to rule: e.g., "ruling in Toledo, León, Zaragoza, Nájera, Castile, and Galicia [as well as Barcelona and Provence as far as Mont Cenis]". He sometimes mentioned the Muslims territories he had re-conquered: in 1143 he ruled in Corduba (Córdoba), in 1151 in Baetia et Almariae (Baeza and Almería), and in 1156 in Baecie, Anduiar et Almarie (Baeza, Andújar, and Almería).
Alfonso VII made his acclamation and coronation in 1135 to appear spontaneous, probably a conscious likening to that of Charlemagne in 800. Contemporary sources both within and without the Iberian peninsula compare Alfonso favourably as "another Julius Caesar, a second Charlemagne [because of his successful campaigns against the Moors]". Herman of Laon (Hermannus monachus, "Herman the monk"), writing in his De miraculis sanctae Mariae Laudunensis de gestis venerabilis Bartholomaei episcopi et sancti Nortberti libri tres ("Three Books on the Miracles of Saint Mary of Lyon, on the Deeds of the Venerable Bishop Bartholomew, and on Saint Norbert"), notes that:
Lines 18–21 of the Poem of Almería, a fragmentary epic appendix to the Chronica Adefonsi celebrating Alfonso's conquest of Almería, also connects his imperial title to his following in Charlemagne's footsteps:
In the autumn of 1154 Louis VII of France and his wife Constance, a daughter of Alfonso VII, took the Way of Saint James and visited the realms of his father-in-law. Impressed by Alfonso's imperial title, on his return trip he issued a charter in which he refers to himself in the address as "ordained by the Providence of God the August Emperor of the Franks" (dei ordinante providentia Francorum Imperator Augustus) at Arzacq on Wednesday 9 February 1155. In the subscription clause he refers to himself merely as "the most serene king of the Franks" (serenissimi Regis francorum). This act, in favour of the Diocese of Maguelonne, does not survive in its original, but in two notarised copies made at Montpellier on 6 February 1311, now both in the national archives.
Ferdinand II
Alfonso VII's empire was divided on his death in 1157 between his sons, Sancho III receiving Castile and Ferdinand II receiving León. Sancho III died in 1158 and was succeeded by his son, Alfonso VIII, who was a small child. Ferdinand took the opportunity of his nephew's minority to assert his dominance, using the title "king of the Spanish" (rex Hispanorum) from 1163 until 1164 and then "king of the Spains" (rex Hispaniarum) from 1165 until 1175. He did not explicitly take an imperial title, but his choice of title demonstrates that the "imperial idea" was still alive at León after Alfonso VII.
Empresses consort
Besides the case of Elvira Ramírez, regent of Ramiro III of León, who was styled bassilea once during her lifetime, the title imperatrix (empress) was occasionally used for the consorts of those men who were styled imperator.
Sancha of León, daughter of Alfonso V and wife of Ferdinand I, was styled empress in the first of the two charters issued by her husband during his reign in which he called himself emperor. This one, dated 1056, is preserved in the cartulary of Arlanza and the relevant text reads: "under the rule of the emperor King Ferdinand and the queen-empress Sancha ruling [plural] the kingdom in León and in Galicia as well as in Castile" (sub imperio imperatoris Fredinandi regis et Sancie regine imperatrice regnum regentes in Legione et in Gallecia vel in Castella). The historian Charles Bishko continually refers to Sancha as "queen-empress" on the basis of this charter. In 1087, long after the deaths of Ferdinand (1065) and Sancha (1067), their eldest daughter, Urraca, referred to herself as "daughter of that king and emperor Ferdinand and Empress Sancha" (filia ejusdem regis et imperatoris Federnandi et Sancie imperatricis).
The fourth wife of Alfonso VI, Isabel (Elizabeth), probably of French or Burgundian origin, appears in contemporary charters as his "empress". On 14 May 1100 Alfonso issued his first act with her at his side: "with the will and assent of my consort the Empress Isabel ... on the road to Valencia where I was going to lead the Christians of that place".
In a document of 29 November 1152, Sancha Raimúndez, who herself was titled "queen" as an honorific granted by her brother, Alfonso VII, refers to her sister-in-law Richeza as empress: Domina Rica imperatrix et uxor domini ... imperatoris.
Outside of León and Castile
Alfonso the Battler
Alfonso the Battler used the imperial title after his marriage to Queen Urraca in 1109. According to later sources he ceased using it after her death in 1126. The Chronicle of San Juan de la Peña writes that after Alfonso VII's accession "he [Alfonso the Battler] did not wish to be called ‘emperor’, but rather king of Aragon, Pamplona and Navarre." This has been much repeated by subsequent historians. Despite this, charters survive from late in his reign (1130 and 1132) which show him still using the imperial style without reference to Castile or León, which he had ruled jure uxoris (in right of his wife). The text of a charter erroneously dated 1115 but actually belonging to 1130 reads: "king and emperor in Aragon and in Pamplona, in Sobrarbe and in Ribagorza".
A forgery dated 3 April 1108, before even his marriage to Urraca, titles Alfonso "emperor in Castile [and] Galicia" (imperator in Castella, Gallicia). A genuine charter dating to August 1115 refers to him as imperator ruling in Toledo and Castile.
Galicia and Portugal
The early twelfth-century Historia silense, a chronicle focussing on the reign of Ferdinand I and written from a royalist perspective, never refers to Ferdinand as "emperor", but it does describe his third son, García, who ruled Galicia after his death, as a "good emperor" because of his military victories:
For García placed confidence in his men. Therefore at that time, within the bounds of the empire, he was regarded by all soldiers as a distinguished knight, since in every war he had been accustomed to accomplishing at the same time the duties of a tireless soldier and a good emperor.
The word "emperor" in this context clearly refers to a military role. The word "empire" was used in one later charter from Portugal (1144), but in this case too it refers only to the authority or territorial power of the Portuguese king, Afonso Henriques:
I, King Alfonso, son of Count Henry, grandson of Alfonso [VI], emperor of Spain, holding the Portuguese empire (imperium Portucalense), make this charter of rights (fuero). . .
Late Middle Ages
Alfonso XI of Castile, reigned 1312–1350, used the title "by the grace of God, Emperor of Spain" (in Old Spanish) in the fuero he granted to Guadalajara in 1337: Don Alfonso, por la gracia de Dios, emperador de España. It had already been used of him in the Chronicle of Cardeña (1327), which says that "Lord Alfonso inherited the realm and was raised Emperor of Spain" (D. Alfonso heredó el regno, è fue alzado Emperador de España).
In the Late Middle Ages there spread belief in a "Last World Emperor who, at the end of days, would resign his imperium directly to God in Jerusalem at Golgotha". In Spain this belief was combined with Joachimism and prophecies attributed to Isidore of Seville to produce belief in a future Spanish emperor, variously named el Encubierto (the Hidden One), el Murciélago (the Bat) or el Nuevo David (the New David). It was thought that each succeeding Spanish king might be the hidden one who would defeat the Antichrist and begin the conquest of Islamdom from Granada to Mecca. These expectations reached a fever pitch during the reign of Ferdinand II of Aragon between 1480 and 1513.
Interpretation
The imperial title has at times been connected to (i) the independence of Spain from the Carolingian and Holy Roman Empires, (ii) the supremacy of one Spanish king over others, (iii) the king who held the Visigothic capital of Toledo or León, capital of the Visigothic "successor state", (iv) a military commander with success on the battlefield, (v) rule over multiple peoples (in an ethnic or religious sense), or (vi) propaganda, as in the case of Cluny or courtly historians or biographers.
Sovereignty and hierarchy
The first historians to seriously study the usage of the imperial title in certain documents pertaining to the kings of León were, around the same time, A. Schunter and Ernesto Mayer, who argued that it had been adopted in order to affirm the independence of the Leonese from the restored Roman Empire of Charlemagne (crowned by Pope Leo III in 800).
Of the historical development of the imperial concept in Spain one historian writes that the "constant idea, analogous to that of the German Emperor, of the hierarchical superiority of the Spanish Emperor over the other sovereigns of Spain, the restoration of the Gothic kingdom, the submission of the nobility, the pomp of the court and the fight against Islam [...] is a mere aspiration in Alfonso III, an attempt in Ordoño II and only a reality in Alfonso VI". The historian Roger Collins suggests that "the intermittent use of the title imperator, "emperor", by the rulers of Asturias and León from the tenth century onward seems to have indicated their hegemonial pretentions."
In 1152 Alfonso VII married the aforementioned, niece of Conrad III of Germany and cousin of Holy Roman Emperor Frederick I. The Catalan historian Joan Beneyto i Pérez has connected this marriage into the German royal family to Alfonso's use of the imperial title. The Jesuit historian Eleuterio Elorduy has connected it with Alfonso's voluntary division of his realm in 1154 between his sons Sancho and Ferdinand.
Cluny
Sometime between 1053 and 1065 Ferdinand I had pledged an annual census of 1,000 aurei to the Abbey of Cluny. This donation was re-established by Alfonso VI in 1077 and then in 1090 increased to 2,000 aurei by this same monarch. Known as the "Alfonsine census", it was "the biggest donation that Cluny ever received from king or layman, and it was never to be surpassed." "The emphatically imperial character of Cluny's bond with ... the Leonese-Castilian ruling dynasty" can be seen in a late eleventh-century codex of the De virginitate beatae Mariae of Ildephonsus of Toledo, which was presented by Abbot Hugh I of Cluny to Alfonso VI. This manuscript, now preserved at Parma, was illuminated at Cluny in gold letters on purple vellum, a style "reminiscent of the famous imperial presentation codices produced by the Echternach School" for the Holy Roman Emperors in the preceding two centuries. It may have been given on the occasion of the increase of the census in 1077 or perhaps on Hugh's visit to Burgos in 1090. Cluniac authors from this time, such as Peter the Venerable and Bernard of Clairvaux, do refer to the king of León and Castile as "emperor" (imperator). After a large gift to Cluny following his conquest of Huesca in 1097, Peter I of Aragon and Navarre was mentioned alongside the king of León in the daily intercessional prayers of the monks of Cluny. Peter's successor, Alfonso the Battler, may also have been mentioned in their prayers between 1109 and 1113, during his marriage to Alfonso VI's heiress, Queen Urraca.
Table of emperors
Notes
Bibliography
Arco Garay, Ricardo del. 1944. La idea de imperio en la política y la literatura españolas. Madrid.
Beneyto i Pérez, Joan. 1942. España y el problema de Europa: Contribución a la historia de la idea de imperio. Madrid.
Bishko, Charles Julian. 1984. "Liturgical Intercession at Cluny for the King-Emperors of León". Spanish and Portuguese Monastic History, 600–1300. London: Variorum Reprints. [Originally published in Studia Monastica, 7 (1961):53–82.]
Bishko, Charles Julian. 1984. "Count Henrique of Portugal, Cluny, and the Antecedents of the Pacto Sucessório". Spanish and Portuguese Monastic History, 600–1300. London: Variorum Reprints. [Originally published in Revista Portuguesa de Historia, 13 (1971): 155–90.]
Brown, Elizabeth A. R. and Michael W. Cothren. 1986. "The Twelfth-Century Crusading Window of the Abbey of Saint-Denis: Praeteritorum Enim Recordatio Futurorum est Exhibitio". Journal of the Warburg and Courtauld Institutes, 49: 1–40.
Collins, Roger. 1989. "The Arab Conquest of Spain, 710–797". Basil Blackwell.
Collins, Roger. 2000. "Visigothic Spain, 409–711". Spain: A History. Raymond Carr, ed. Oxford: Oxford University Press, 39–62.
Collins, Roger. 2012. Caliphs and Kings: Spain, 796–1031. London: Wiley Blackwell.
Cullinan, Margaret M. 1975. Imperator Hispaniae: The Genesis of ‘Spain’. PhD dissertation, City University of New York.
Dembińska, Maria. 1990. "A Polish Princess-Empress of Spain and Countess of Provence in the Twelfth Century". Frauen in Spatantike un Fruhmittelalter. Werner Affeldt, ed. Sigmaringne, 283–90.
Elorduy, Eleuterio. 1940. La idea de imperio en el pensamiento español y de otros pueblos. Madrid: Espasa-Calpe.
Fernández y González, F. 1867. "Significación e importancia de la idea del Imperio en España". Discursos leídos ante la Real Academia de la Historia, 3.
Fletcher, Richard A. 1978. The Episcopate in the Kingdom of León in the Twelfth Century. Oxford: Oxford University Press.
Fletcher, Richard A. 1984. Saint James's Catapult: The Life and Times of Diego Gelmírez of Santiago de Compostela. Oxford: Oxford University Press.
García Gallo, Alfonso. 1945. "El imperio medieval español". Arbor, 4(11): 199–228. [Reprinted in Historia de España, Florentino Pérez Embid, ed. (Madrid: 1953), 108–43.]
Gibert, Rafael. 1951. "Observaciones a la tesis del Imperio hispánico y los cinco reinos". Arbor, 18(63): 440–56.
González Jiménez, Manuel. 2010. "La idea imperial antes y después de Alfonso VI". Alfonso VI: Imperator totius orbis Hispanie. Fernando Suárez and Andrés Gambra, eds. Sanz y Torres, 11–29.
Hüffer, Hermann J. 1930. "Die leonesischen Hegemoniebestrebungen und Kaisertitel". Spanische Forschungen der Görresgesellschaft, 3: 337–84.
Hüffer, Hermann J. 1933. La idea imperial española. Madrid.
Iruña, P. Germán de. 1935. "Discutibles interpretaciones de la moneda de Sancho el Mayor". Revista Internacional de los Estudios Vascos = Révue Internationale des Études Basques, 26:655–60.
Iturmendi Morales, José. 1972. "En torno a la idea de Imperio en Alfonso X el Sabio". Revista de Estudios Políticos, 182: 83–158.
Lacarra de Miguel, José María. 1945. "Textos navarros del Códice de Roda". Estudios de Edad Media de la Corona de Aragón, 1: 194–283.
Larragueta, Santos García. "La Orden de San Juan en la crisis del Imperio Hispánico del siglo XII". Hispania, 12(49): 483–524.
Lipskey, Glenn Edward. 1972. The Chronicle of Alfonso the Emperor: A Translation of the Chronica Adefonsi imperatoris, with Study and Notes. PhD dissertation, Northwestern University.
López Ortiz, José. 1941. "Notas para el estudio de la idea imperial leonesa". Ciudad de Dios, 153: 186–90.
López Ortiz, José. 1942. "Las ideas imperiales en el medioevo español". Escorial, 6: 43–70.
Lourie, Elena. 1975. "The Will of Alfonso I, ‘El Batallador’, King of Aragon and Navarre: A Reassessment". Speculum, 50(4): 635–51.
Mackay, Angus. 2000. "The Late Middle Ages, 1250–1500". Spain: A History. Raymond Carr, ed. Oxford: Oxford University Press, 90–115.
Mackay, Angus and Muhammad Benaboud. 1978. "The Authenticity of Alfonso VI's Letter to Yūsuf B. Tāšufīn". Al-Andalus, 43: 233–37.
Mackay, Angus and Muhammad Benaboud. 1979. "Alfonso VI of León and Castile, ‘al-Imbraţūr dhū-l-Millatayn’". Bulletin of Hispanic Studies, 56(2): 95–102.
Mackay, Angus and Muhammad Benaboud. 1984. "Yet again Alfonso VI, ‘the Emperor, Lord of [the Adherents of] the Two Faiths, the Most Excellent Ruler’: A Rejoinder to Norman Roth". Bulletin of Hispanic Studies, 61(2): 171–81.
Maravall, José Antonio. 1973. "El pensamiento política de la Alta Edad Media". Estudios de historia del pensamiento española (Madrid, 1973), I, 35–66.
Maravall, José Antonio. 1973. "El concepto de monarquía en la Edad Media española". Estudios de historia del pensamiento española (Madrid, 1973), I, 69–89.
Martin, Georges. 1999. "L'escarboucle de Saint-Denis, le roi de France et l'empereur des Espagnes". Saint-Denis et la royauté: en l'honneur de Bernard Guenée. Claude Gauvard, ed. Paris, 439–62.
Martín Duque, Ángel J. 2002. "Del reino de Pamplona al reino de Navarra". Príncipe de Viana, 63(227): 841–50.
Martínez Díez, Gonzalo. 2007. Sancho III el Mayor: Rey de Pamplona, Rex Ibericus. Madrid: Marcial Pons Historia.
Mauntel, Christoph. 2017. "Ideas of Empire: A Comparative Study in Anglo-Saxon and Spanish Political Thought (from the Eighth to the Twelfth Century)". Viator, 48 (3): 1–25.
Menéndez Pidal, Ramón. 1929. La España del Cid, 2 vols. Madrid: Editorial Plutarco.
Menéndez Pidal, Ramón. 1932. "Adefonsus imperator toletanus, magnificus triumphator". Boletín de la Real Academia de la Historia, 100: 513–38. [Reprinted in Historia y epopeya (Madrid: 1934), 235–62, and in Idea imperial de Carlos V (Madrid: 1941), 127–63.]
Menéndez Pidal, Ramón. 1934. "El «Romanz del infant García» y Sancho de Navarra antiemperador". Historia y epopeya (Madrid), 33–98. [Reprinted in Idea imperial de Carlos V (Madrid: 1941), 73–125.]
Menéndez Pidal, Ramón. 1950. El imperio hispánico y los cinco reinos. Madrid: Instituto de Estudios Políticos.
Meyer, Bruno Berthold. 2002. Kastilien, die Staufer und das Imperium: ein Jahrhundert politischer Kontakte im Zeichen des Kaisertums. Matthiesen Verlag.
O'Callaghan, Joseph F. 1969. "The Beginnings of the Cortes of León-Castile". American Historical Review, 74(5): 1503–37.
O'Callaghan, Joseph F. 1990 "Image and Reality: The King Creates His Kingdom". Emperor of Culture: Alfonso X the Learned of Castile and His Thirteenth-Century Renaissance. Robert I. Burns, ed. Philadelphia: University of Pennsylvania Press.
Pérez Rodríguez, Antonino M. 1993. "Castilla, Cluny y la Crónica najerense". III Semana de Estudios Medievales de Nájera. Logroño: Instituto de Estudios Riojanos.
Pérez de Urbel, Justo. 1954. "La división del reino por Sancho el Mayor", Hispania, 14(54): 3–26.
Ramos y Loscertales, J. M. "La sucesión del rey Alfonso VI", Anuario de la historia del derecho español, 13 (1936–41): 36–99.
Reilly, Bernard F. 1976. "The Chancery of Alfonso VII of León-Castilla: The Period 1116–1135 Reconsidered". Speculum, 51(2): 243–61.
Reilly, Bernard F. 1982. The Kingdom of León-Castilla under Queen Urraca, 1109–1126. Princeton: Princeton University Press.
Reilly, Bernard F. 1985. "The Chancery of Alfonso VI of León-Castile (1065–1109)". Santiago, St.-Denis, and St. Peter. Bernard F. Reilly, ed. New York, 1–40.
Reilly, Bernard F. 1988. The Kingdom of León-Castilla under King Alfonso VI, 1065–1109. Princeton: Princeton University Press.
Reilly, Bernard F. 1998. The Kingdom of León-Castilla under King Alfonso VII, 1109–1157. Philadelphia: University of Pennsylvania Press.
Rodríguez, Justiniano. 1988. "Presencia de la nobleza navarra en la política leonese del siglo X". Princípe de Viana, Anejo, 8:161–170.
Rodríguez Latorre, Luis Eduardo. 1994. "Una ceca en el Camino: la ceca de Nájera". IV Semana de Estudios Medievales de Nájera, 2–6 August 1993. José Ignacio de la Iglesia Duarte, ed. Logroño: Instituto de Estudios Riojanos, 273–88.
Roth, Norman. 1984. "Again Alfonso VI, ‘Imbarātūr dhu’l-Millatayn’, and Some New Data". Bulletin of Hispanic Studies, 61(2): 165–69.
Roth, Norman. 1985. "Alfonso VI: An Answer to MacKay and Benaboud's Reply to Roth". Bulletin of Hispanic Studies, 62(2): 179–81.
Saitta, Armando. 1961. "Un problema storiografico: l'Impero Spagnolo Medievale". Momenti e figure della civiltà europea: saggi storici e storiografici, I. Storia e Letteratura: Raccolta di Studi e Testi, 176. Rome: Edizioni di Storia e Letteratura. [Originally published in Rivista storica italiana, 66 (1954), 2:240–85 and 3:377–409.]
Sánchez Candeira, Alfonso. 1951. El «regnum-imperium» leonés hasta 1037. Madrid.
Schramm, Percy Ernst. 1950. "Das kastilische König- und Kaisertum während der Reconquista". Festschrift für Gerhard Ritter (Tübingen), 87–139.
Sirantoine, Hélène. 2012. Imperator Hispaniae: les idéologies impériales dans le royaume de León (IXe–XIIe siècles). Madrid: Casa de Velázquez.
Steiger, A. 1946. "Alfonso X el Sabio y la idea imperial". Arbor, 6(18): 389–402.
Steindorff, Ernst. 1881. "Angeblicher Conflict zwischen Heinrich III. und Ferdinand I. von Castilien". Jahrbücher des Deutschen Reichs unter Heinrich III, II. Leipzig.
Ubieto Arteta, Antonio. 1956. "Navarra-Aragón y la idea imperial de Alfonso VII de Castilla". Estudios de la Edad Media en la Corona de Aragón, 6:41–82.
Ubieto Arteta, Antonio. 1960. "Estudios en torno a la división del Reino por Sancho el Mayor de Navarra". Príncipe de Viana, 21: 5–56, 163–236.
Titles in Spain
Emperors
11th century in Spain
12th century in Spain
Spanish monarchy
|
```xml
import {
FilterItem,
FilterWrapper,
} from "@erxes/ui-settings/src/permissions/styles";
import { ICategory, IPermission, IUserGroupDocument } from "../../types";
import { __, router } from "@erxes/ui/src/utils";
import { correctValue, generateModuleParams, generatedList } from "../../utils";
import Button from "@erxes/ui/src/components/Button";
import DataWithLoader from "@erxes/ui/src/components/DataWithLoader";
import GroupList from "../../containers/permission/GroupList";
import ModalTrigger from "@erxes/ui/src/components/ModalTrigger";
import { PERMISSIONS } from "../../constants";
import PermissionForm from "./PermissionForm";
import PermissionRow from "../../containers/permission/PermissionRow";
import React from "react";
import Select from "react-select";
import Table from "@erxes/ui/src/components/table";
import { Title } from "@erxes/ui-settings/src/styles";
import Wrapper from "@erxes/ui/src/layout/components/Wrapper";
import { isObject } from "util";
import { useLocation, useNavigate } from "react-router-dom";
type Props = {
queryParams: any;
refetchQueries: any;
permissions: IPermission[];
isLoading?: boolean;
totalCount?: number;
currentGroupName?: string;
permissionGroups?: IUserGroupDocument[];
categoryList?: ICategory[];
};
const PermissionList = (props: Props) => {
const location = useLocation();
const navigate = useNavigate();
const setFilter = (name: string, item: generatedList) => {
router.setParams(navigate, location, {
[name]: isObject(item) ? correctValue(item) : item,
page: null,
perPage: null,
});
};
const renderObjects = () => {
return <PermissionRow permissions={props.permissions} />;
};
const renderFilter = () => {
const { queryParams, categoryList } = props;
return (
<FilterWrapper>
<strong>{__("Filters")}:</strong>
<FilterItem id="permission-choose-module">
<Select
placeholder={__("Choose category")}
value={generateModuleParams(categoryList || []).find(
(o) => o.value === queryParams.categoryId
)}
options={generateModuleParams(categoryList || [])}
isClearable={true}
onChange={setFilter.bind(this, "categoryId")}
/>
</FilterItem>
<FilterItem id="permission-choose-action">
<Select
placeholder={__("Choose permission")}
value={generateModuleParams(PERMISSIONS).find(
(o) => o.value === queryParams.permission
)}
options={generateModuleParams(PERMISSIONS)}
isClearable={true}
onChange={setFilter.bind(this, "permission")}
/>
</FilterItem>
</FilterWrapper>
);
};
const renderData = () => {
return (
<Table $whiteSpace="nowrap" $hover={true} $bordered={true}>
<thead>
<tr>
<th>{__("Category")}</th>
<th>{__("Permission")}</th>
<th>{__("Group")}</th>
<th>{__("Actions")}</th>
</tr>
</thead>
<tbody>{renderObjects()}</tbody>
</Table>
);
};
const renderForm = (props) => {
const { categoryList, queryParams, refetchQueries } = props;
const extendedProps = {
...props,
groupId: queryParams && (queryParams.groupId || ""),
categoryList,
refetchQueries,
};
return <PermissionForm {...extendedProps} />;
};
const renderActionBar = () => {
const trigger = (
<Button
id="permission-new-permission"
btnStyle="success"
icon="plus-circle"
>
New permission
</Button>
);
const title = (
<Title>{props.currentGroupName || __("All permissions")}</Title>
);
const actionBarRight = (
<ModalTrigger
title="New permission"
size="lg"
trigger={trigger}
content={renderForm}
/>
);
return (
<Wrapper.ActionBar
left={title}
right={actionBarRight}
wideSpacing={true}
/>
);
};
const renderContent = () => {
const { isLoading, permissions } = props;
return (
<>
{renderFilter()}
<DataWithLoader
data={renderData()}
loading={isLoading || false}
count={permissions.length}
emptyText={__("There is no permissions in this group")}
emptyImage="/images/actions/11.svg"
/>
</>
);
};
const { queryParams, permissionGroups } = props;
const breadcrumb = [
{ title: "Settings", link: "/settings" },
{ title: __("Forum Permissions") },
];
return (
<Wrapper
header={
<Wrapper.Header
title={__("Forum Permissions")}
breadcrumb={breadcrumb}
/>
}
actionBar={renderActionBar()}
leftSidebar={
<GroupList
permissionGroups={permissionGroups}
queryParams={queryParams}
/>
}
content={renderContent()}
center={false}
hasBorder={true}
/>
);
};
export default PermissionList;
```
|
```java
/*
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.redexinline;
public @interface ForceInline {
}
```
|
```c++
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include "console.hpp"
#include <async/oneshot-event.hpp>
#include <async/promise.hpp>
#include <frg/std_compat.hpp>
#include <protocols/mbus/client.hpp>
#include <bragi/helpers-std.hpp>
#include <kerncfg.bragi.hpp>
async::result<helix::UniqueLane> enumerateKerncfgByteRing(const char *purpose) {
auto filter = mbus_ng::Conjunction{{
mbus_ng::EqualsFilter{"class", "kerncfg-byte-ring"},
mbus_ng::EqualsFilter{"purpose", purpose},
}};
auto enumerator = mbus_ng::Instance::global().enumerate(filter);
auto [_, events] = (co_await enumerator.nextEvents()).unwrap();
assert(events.size() == 1);
std::cout << "virtio-console: Found kerncfg" << std::endl;
auto entity = co_await mbus_ng::Instance::global().getEntity(events[0].id);
co_return (co_await entity.getRemoteLane()).unwrap();
}
async::result<std::tuple<size_t, uint64_t, uint64_t>>
getKerncfgByteRingPart(helix::BorrowedLane lane,
arch::dma_buffer_view chunk, uint64_t dequeue, uint64_t watermark) {
managarm::kerncfg::GetBufferContentsRequest req;
req.set_watermark(watermark);
req.set_size(chunk.size());
req.set_dequeue(dequeue);
auto [offer, sendReq, recvResp, recvBuffer] =
co_await helix_ng::exchangeMsgs(lane,
helix_ng::offer(
helix_ng::sendBragiHeadOnly(req, frg::stl_allocator{}),
helix_ng::recvInline(),
helix_ng::recvBuffer(chunk.data(), chunk.size())
)
);
HEL_CHECK(offer.error());
HEL_CHECK(sendReq.error());
HEL_CHECK(recvResp.error());
HEL_CHECK(recvBuffer.error());
auto resp = *bragi::parse_head_only<managarm::kerncfg::SvrResponse>(recvResp);
assert(resp.error() == managarm::kerncfg::Error::SUCCESS);
recvResp.reset();
co_return std::make_tuple(resp.size(), resp.effective_dequeue(), resp.new_dequeue());
}
namespace tty {
namespace virtio_console {
// --------------------------------------------------------
// Device
// --------------------------------------------------------
Device::Device(std::unique_ptr<virtio_core::Transport> transport)
: transport_{std::move(transport)} { }
async::detached Device::runDevice() {
transport_->finalizeFeatures();
transport_->claimQueues(2);
rxQueue_ = transport_->setupQueue(0);
txQueue_ = transport_->setupQueue(1);
auto maxPorts = transport_->space().load(spec::regs::maxPorts);
std::cout << "virtio-console: Device supports " << maxPorts << " ports" << std::endl;
transport_->runDevice();
auto dumpKerncfgRing = [this] (const char *name, size_t watermark) -> async::result<void> {
auto lane = co_await enumerateKerncfgByteRing(name);
uint64_t dequeue = 0;
arch::dma_buffer chunkBuffer{&dmaPool_, 1 << 16};
while (true) {
auto [size, effectiveDequeue, newDequeue] = co_await getKerncfgByteRingPart(
lane, chunkBuffer, dequeue, watermark);
// TODO: improve this by passing the "true" dequeue pointer to userspace.
if (dequeue != effectiveDequeue)
std::cerr << "virtio-console: warning, we possibly missed "
<< (effectiveDequeue - dequeue) << " bytes" << std::endl;
dequeue = newDequeue;
virtio_core::Chain chain;
chain.append(co_await txQueue_->obtainDescriptor());
chain.setupBuffer(virtio_core::hostToDevice, chunkBuffer.subview(0, size));
co_await txQueue_->submitDescriptor(chain.front());
}
};
async::detach(dumpKerncfgRing("heap-trace", 1024 * 1024));
async::detach(dumpKerncfgRing("kernel-profile", 1024));
async::detach(dumpKerncfgRing("os-trace", 1024));
co_return;
}
} } // namespace tty::virtio_console
```
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <atomic>
#include <type_traits>
#include "src/wasm/wasm-interpreter.h"
#include "src/base/overflowing-math.h"
#include "src/codegen/assembler-inl.h"
#include "src/compiler/wasm-compiler.h"
#include "src/numbers/conversions.h"
#include "src/objects/objects-inl.h"
#include "src/utils/boxed-float.h"
#include "src/utils/identity-map.h"
#include "src/utils/utils.h"
#include "src/wasm/decoder.h"
#include "src/wasm/function-body-decoder-impl.h"
#include "src/wasm/function-body-decoder.h"
#include "src/wasm/memory-tracing.h"
#include "src/wasm/module-compiler.h"
#include "src/wasm/wasm-arguments.h"
#include "src/wasm/wasm-engine.h"
#include "src/wasm/wasm-external-refs.h"
#include "src/wasm/wasm-limits.h"
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-objects-inl.h"
#include "src/zone/accounting-allocator.h"
#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
namespace wasm {
using base::ReadLittleEndianValue;
using base::ReadUnalignedValue;
using base::WriteLittleEndianValue;
using base::WriteUnalignedValue;
#define TRACE(...) \
do { \
if (FLAG_trace_wasm_interpreter) PrintF(__VA_ARGS__); \
} while (false)
#if V8_TARGET_BIG_ENDIAN
#define LANE(i, type) ((sizeof(type.val) / sizeof(type.val[0])) - (i)-1)
#else
#define LANE(i, type) (i)
#endif
#define FOREACH_INTERNAL_OPCODE(V) V(Breakpoint, 0xFF)
#define WASM_CTYPES(V) \
V(I32, int32_t) V(I64, int64_t) V(F32, float) V(F64, double) V(S128, Simd128)
#define FOREACH_SIMPLE_BINOP(V) \
V(I32Add, uint32_t, +) \
V(I32Sub, uint32_t, -) \
V(I32Mul, uint32_t, *) \
V(I32And, uint32_t, &) \
V(I32Ior, uint32_t, |) \
V(I32Xor, uint32_t, ^) \
V(I32Eq, uint32_t, ==) \
V(I32Ne, uint32_t, !=) \
V(I32LtU, uint32_t, <) \
V(I32LeU, uint32_t, <=) \
V(I32GtU, uint32_t, >) \
V(I32GeU, uint32_t, >=) \
V(I32LtS, int32_t, <) \
V(I32LeS, int32_t, <=) \
V(I32GtS, int32_t, >) \
V(I32GeS, int32_t, >=) \
V(I64Add, uint64_t, +) \
V(I64Sub, uint64_t, -) \
V(I64Mul, uint64_t, *) \
V(I64And, uint64_t, &) \
V(I64Ior, uint64_t, |) \
V(I64Xor, uint64_t, ^) \
V(I64Eq, uint64_t, ==) \
V(I64Ne, uint64_t, !=) \
V(I64LtU, uint64_t, <) \
V(I64LeU, uint64_t, <=) \
V(I64GtU, uint64_t, >) \
V(I64GeU, uint64_t, >=) \
V(I64LtS, int64_t, <) \
V(I64LeS, int64_t, <=) \
V(I64GtS, int64_t, >) \
V(I64GeS, int64_t, >=) \
V(F32Add, float, +) \
V(F32Sub, float, -) \
V(F32Eq, float, ==) \
V(F32Ne, float, !=) \
V(F32Lt, float, <) \
V(F32Le, float, <=) \
V(F32Gt, float, >) \
V(F32Ge, float, >=) \
V(F64Add, double, +) \
V(F64Sub, double, -) \
V(F64Eq, double, ==) \
V(F64Ne, double, !=) \
V(F64Lt, double, <) \
V(F64Le, double, <=) \
V(F64Gt, double, >) \
V(F64Ge, double, >=) \
V(F32Mul, float, *) \
V(F64Mul, double, *) \
V(F32Div, float, /) \
V(F64Div, double, /)
#define FOREACH_OTHER_BINOP(V) \
V(I32DivS, int32_t) \
V(I32DivU, uint32_t) \
V(I32RemS, int32_t) \
V(I32RemU, uint32_t) \
V(I32Shl, uint32_t) \
V(I32ShrU, uint32_t) \
V(I32ShrS, int32_t) \
V(I64DivS, int64_t) \
V(I64DivU, uint64_t) \
V(I64RemS, int64_t) \
V(I64RemU, uint64_t) \
V(I64Shl, uint64_t) \
V(I64ShrU, uint64_t) \
V(I64ShrS, int64_t) \
V(I32Ror, int32_t) \
V(I32Rol, int32_t) \
V(I64Ror, int64_t) \
V(I64Rol, int64_t) \
V(F32Min, float) \
V(F32Max, float) \
V(F64Min, double) \
V(F64Max, double) \
V(I32AsmjsDivS, int32_t) \
V(I32AsmjsDivU, uint32_t) \
V(I32AsmjsRemS, int32_t) \
V(I32AsmjsRemU, uint32_t) \
V(F32CopySign, Float32) \
V(F64CopySign, Float64)
#define FOREACH_I32CONV_FLOATOP(V) \
V(I32SConvertF32, int32_t, float) \
V(I32SConvertF64, int32_t, double) \
V(I32UConvertF32, uint32_t, float) \
V(I32UConvertF64, uint32_t, double)
#define FOREACH_OTHER_UNOP(V) \
V(I32Clz, uint32_t) \
V(I32Ctz, uint32_t) \
V(I32Popcnt, uint32_t) \
V(I32Eqz, uint32_t) \
V(I64Clz, uint64_t) \
V(I64Ctz, uint64_t) \
V(I64Popcnt, uint64_t) \
V(I64Eqz, uint64_t) \
V(F32Abs, Float32) \
V(F32Neg, Float32) \
V(F32Ceil, float) \
V(F32Floor, float) \
V(F32Trunc, float) \
V(F32NearestInt, float) \
V(F64Abs, Float64) \
V(F64Neg, Float64) \
V(F64Ceil, double) \
V(F64Floor, double) \
V(F64Trunc, double) \
V(F64NearestInt, double) \
V(I32ConvertI64, int64_t) \
V(I64SConvertF32, float) \
V(I64SConvertF64, double) \
V(I64UConvertF32, float) \
V(I64UConvertF64, double) \
V(I64SConvertI32, int32_t) \
V(I64UConvertI32, uint32_t) \
V(F32SConvertI32, int32_t) \
V(F32UConvertI32, uint32_t) \
V(F32SConvertI64, int64_t) \
V(F32UConvertI64, uint64_t) \
V(F32ConvertF64, double) \
V(F32ReinterpretI32, int32_t) \
V(F64SConvertI32, int32_t) \
V(F64UConvertI32, uint32_t) \
V(F64SConvertI64, int64_t) \
V(F64UConvertI64, uint64_t) \
V(F64ConvertF32, float) \
V(F64ReinterpretI64, int64_t) \
V(I32AsmjsSConvertF32, float) \
V(I32AsmjsUConvertF32, float) \
V(I32AsmjsSConvertF64, double) \
V(I32AsmjsUConvertF64, double) \
V(F32Sqrt, float) \
V(F64Sqrt, double)
namespace {
constexpr uint32_t kFloat32SignBitMask = uint32_t{1} << 31;
constexpr uint64_t kFloat64SignBitMask = uint64_t{1} << 63;
inline int32_t ExecuteI32DivS(int32_t a, int32_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapDivByZero;
return 0;
}
if (b == -1 && a == std::numeric_limits<int32_t>::min()) {
*trap = kTrapDivUnrepresentable;
return 0;
}
return a / b;
}
inline uint32_t ExecuteI32DivU(uint32_t a, uint32_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapDivByZero;
return 0;
}
return a / b;
}
inline int32_t ExecuteI32RemS(int32_t a, int32_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapRemByZero;
return 0;
}
if (b == -1) return 0;
return a % b;
}
inline uint32_t ExecuteI32RemU(uint32_t a, uint32_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapRemByZero;
return 0;
}
return a % b;
}
inline uint32_t ExecuteI32Shl(uint32_t a, uint32_t b, TrapReason* trap) {
return a << (b & 0x1F);
}
inline uint32_t ExecuteI32ShrU(uint32_t a, uint32_t b, TrapReason* trap) {
return a >> (b & 0x1F);
}
inline int32_t ExecuteI32ShrS(int32_t a, int32_t b, TrapReason* trap) {
return a >> (b & 0x1F);
}
inline int64_t ExecuteI64DivS(int64_t a, int64_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapDivByZero;
return 0;
}
if (b == -1 && a == std::numeric_limits<int64_t>::min()) {
*trap = kTrapDivUnrepresentable;
return 0;
}
return a / b;
}
inline uint64_t ExecuteI64DivU(uint64_t a, uint64_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapDivByZero;
return 0;
}
return a / b;
}
inline int64_t ExecuteI64RemS(int64_t a, int64_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapRemByZero;
return 0;
}
if (b == -1) return 0;
return a % b;
}
inline uint64_t ExecuteI64RemU(uint64_t a, uint64_t b, TrapReason* trap) {
if (b == 0) {
*trap = kTrapRemByZero;
return 0;
}
return a % b;
}
inline uint64_t ExecuteI64Shl(uint64_t a, uint64_t b, TrapReason* trap) {
return a << (b & 0x3F);
}
inline uint64_t ExecuteI64ShrU(uint64_t a, uint64_t b, TrapReason* trap) {
return a >> (b & 0x3F);
}
inline int64_t ExecuteI64ShrS(int64_t a, int64_t b, TrapReason* trap) {
return a >> (b & 0x3F);
}
inline uint32_t ExecuteI32Ror(uint32_t a, uint32_t b, TrapReason* trap) {
return (a >> (b & 0x1F)) | (a << ((32 - b) & 0x1F));
}
inline uint32_t ExecuteI32Rol(uint32_t a, uint32_t b, TrapReason* trap) {
return (a << (b & 0x1F)) | (a >> ((32 - b) & 0x1F));
}
inline uint64_t ExecuteI64Ror(uint64_t a, uint64_t b, TrapReason* trap) {
return (a >> (b & 0x3F)) | (a << ((64 - b) & 0x3F));
}
inline uint64_t ExecuteI64Rol(uint64_t a, uint64_t b, TrapReason* trap) {
return (a << (b & 0x3F)) | (a >> ((64 - b) & 0x3F));
}
inline float ExecuteF32Min(float a, float b, TrapReason* trap) {
return JSMin(a, b);
}
inline float ExecuteF32Max(float a, float b, TrapReason* trap) {
return JSMax(a, b);
}
inline Float32 ExecuteF32CopySign(Float32 a, Float32 b, TrapReason* trap) {
return Float32::FromBits((a.get_bits() & ~kFloat32SignBitMask) |
(b.get_bits() & kFloat32SignBitMask));
}
inline double ExecuteF64Min(double a, double b, TrapReason* trap) {
return JSMin(a, b);
}
inline double ExecuteF64Max(double a, double b, TrapReason* trap) {
return JSMax(a, b);
}
inline Float64 ExecuteF64CopySign(Float64 a, Float64 b, TrapReason* trap) {
return Float64::FromBits((a.get_bits() & ~kFloat64SignBitMask) |
(b.get_bits() & kFloat64SignBitMask));
}
inline int32_t ExecuteI32AsmjsDivS(int32_t a, int32_t b, TrapReason* trap) {
if (b == 0) return 0;
if (b == -1 && a == std::numeric_limits<int32_t>::min()) {
return std::numeric_limits<int32_t>::min();
}
return a / b;
}
inline uint32_t ExecuteI32AsmjsDivU(uint32_t a, uint32_t b, TrapReason* trap) {
if (b == 0) return 0;
return a / b;
}
inline int32_t ExecuteI32AsmjsRemS(int32_t a, int32_t b, TrapReason* trap) {
if (b == 0) return 0;
if (b == -1) return 0;
return a % b;
}
inline uint32_t ExecuteI32AsmjsRemU(uint32_t a, uint32_t b, TrapReason* trap) {
if (b == 0) return 0;
return a % b;
}
inline int32_t ExecuteI32AsmjsSConvertF32(float a, TrapReason* trap) {
return DoubleToInt32(a);
}
inline uint32_t ExecuteI32AsmjsUConvertF32(float a, TrapReason* trap) {
return DoubleToUint32(a);
}
inline int32_t ExecuteI32AsmjsSConvertF64(double a, TrapReason* trap) {
return DoubleToInt32(a);
}
inline uint32_t ExecuteI32AsmjsUConvertF64(double a, TrapReason* trap) {
return DoubleToUint32(a);
}
int32_t ExecuteI32Clz(uint32_t val, TrapReason* trap) {
return base::bits::CountLeadingZeros(val);
}
uint32_t ExecuteI32Ctz(uint32_t val, TrapReason* trap) {
return base::bits::CountTrailingZeros(val);
}
uint32_t ExecuteI32Popcnt(uint32_t val, TrapReason* trap) {
return base::bits::CountPopulation(val);
}
inline uint32_t ExecuteI32Eqz(uint32_t val, TrapReason* trap) {
return val == 0 ? 1 : 0;
}
int64_t ExecuteI64Clz(uint64_t val, TrapReason* trap) {
return base::bits::CountLeadingZeros(val);
}
inline uint64_t ExecuteI64Ctz(uint64_t val, TrapReason* trap) {
return base::bits::CountTrailingZeros(val);
}
inline int64_t ExecuteI64Popcnt(uint64_t val, TrapReason* trap) {
return base::bits::CountPopulation(val);
}
inline int32_t ExecuteI64Eqz(uint64_t val, TrapReason* trap) {
return val == 0 ? 1 : 0;
}
inline Float32 ExecuteF32Abs(Float32 a, TrapReason* trap) {
return Float32::FromBits(a.get_bits() & ~kFloat32SignBitMask);
}
inline Float32 ExecuteF32Neg(Float32 a, TrapReason* trap) {
return Float32::FromBits(a.get_bits() ^ kFloat32SignBitMask);
}
inline float ExecuteF32Ceil(float a, TrapReason* trap) { return ceilf(a); }
inline float ExecuteF32Floor(float a, TrapReason* trap) { return floorf(a); }
inline float ExecuteF32Trunc(float a, TrapReason* trap) { return truncf(a); }
inline float ExecuteF32NearestInt(float a, TrapReason* trap) {
return nearbyintf(a);
}
inline float ExecuteF32Sqrt(float a, TrapReason* trap) {
float result = sqrtf(a);
return result;
}
inline Float64 ExecuteF64Abs(Float64 a, TrapReason* trap) {
return Float64::FromBits(a.get_bits() & ~kFloat64SignBitMask);
}
inline Float64 ExecuteF64Neg(Float64 a, TrapReason* trap) {
return Float64::FromBits(a.get_bits() ^ kFloat64SignBitMask);
}
inline double ExecuteF64Ceil(double a, TrapReason* trap) { return ceil(a); }
inline double ExecuteF64Floor(double a, TrapReason* trap) { return floor(a); }
inline double ExecuteF64Trunc(double a, TrapReason* trap) { return trunc(a); }
inline double ExecuteF64NearestInt(double a, TrapReason* trap) {
return nearbyint(a);
}
inline double ExecuteF64Sqrt(double a, TrapReason* trap) { return sqrt(a); }
template <typename int_type, typename float_type>
int_type ExecuteConvert(float_type a, TrapReason* trap) {
if (is_inbounds<int_type>(a)) {
return static_cast<int_type>(a);
}
*trap = kTrapFloatUnrepresentable;
return 0;
}
template <typename int_type, typename float_type>
int_type ExecuteConvertSaturate(float_type a) {
TrapReason base_trap = kTrapCount;
int32_t val = ExecuteConvert<int_type>(a, &base_trap);
if (base_trap == kTrapCount) {
return val;
}
return std::isnan(a) ? 0
: (a < static_cast<float_type>(0.0)
? std::numeric_limits<int_type>::min()
: std::numeric_limits<int_type>::max());
}
template <typename dst_type, typename src_type, void (*fn)(Address)>
inline dst_type CallExternalIntToFloatFunction(src_type input) {
uint8_t data[std::max(sizeof(dst_type), sizeof(src_type))];
Address data_addr = reinterpret_cast<Address>(data);
WriteUnalignedValue<src_type>(data_addr, input);
fn(data_addr);
return ReadUnalignedValue<dst_type>(data_addr);
}
template <typename dst_type, typename src_type, int32_t (*fn)(Address)>
inline dst_type CallExternalFloatToIntFunction(src_type input,
TrapReason* trap) {
uint8_t data[std::max(sizeof(dst_type), sizeof(src_type))];
Address data_addr = reinterpret_cast<Address>(data);
WriteUnalignedValue<src_type>(data_addr, input);
if (!fn(data_addr)) *trap = kTrapFloatUnrepresentable;
return ReadUnalignedValue<dst_type>(data_addr);
}
inline uint32_t ExecuteI32ConvertI64(int64_t a, TrapReason* trap) {
return static_cast<uint32_t>(a & 0xFFFFFFFF);
}
int64_t ExecuteI64SConvertF32(float a, TrapReason* trap) {
return CallExternalFloatToIntFunction<int64_t, float,
float32_to_int64_wrapper>(a, trap);
}
int64_t ExecuteI64SConvertSatF32(float a) {
TrapReason base_trap = kTrapCount;
int64_t val = ExecuteI64SConvertF32(a, &base_trap);
if (base_trap == kTrapCount) {
return val;
}
return std::isnan(a) ? 0
: (a < 0.0 ? std::numeric_limits<int64_t>::min()
: std::numeric_limits<int64_t>::max());
}
int64_t ExecuteI64SConvertF64(double a, TrapReason* trap) {
return CallExternalFloatToIntFunction<int64_t, double,
float64_to_int64_wrapper>(a, trap);
}
int64_t ExecuteI64SConvertSatF64(double a) {
TrapReason base_trap = kTrapCount;
int64_t val = ExecuteI64SConvertF64(a, &base_trap);
if (base_trap == kTrapCount) {
return val;
}
return std::isnan(a) ? 0
: (a < 0.0 ? std::numeric_limits<int64_t>::min()
: std::numeric_limits<int64_t>::max());
}
uint64_t ExecuteI64UConvertF32(float a, TrapReason* trap) {
return CallExternalFloatToIntFunction<uint64_t, float,
float32_to_uint64_wrapper>(a, trap);
}
uint64_t ExecuteI64UConvertSatF32(float a) {
TrapReason base_trap = kTrapCount;
uint64_t val = ExecuteI64UConvertF32(a, &base_trap);
if (base_trap == kTrapCount) {
return val;
}
return std::isnan(a) ? 0
: (a < 0.0 ? std::numeric_limits<uint64_t>::min()
: std::numeric_limits<uint64_t>::max());
}
uint64_t ExecuteI64UConvertF64(double a, TrapReason* trap) {
return CallExternalFloatToIntFunction<uint64_t, double,
float64_to_uint64_wrapper>(a, trap);
}
uint64_t ExecuteI64UConvertSatF64(double a) {
TrapReason base_trap = kTrapCount;
int64_t val = ExecuteI64UConvertF64(a, &base_trap);
if (base_trap == kTrapCount) {
return val;
}
return std::isnan(a) ? 0
: (a < 0.0 ? std::numeric_limits<uint64_t>::min()
: std::numeric_limits<uint64_t>::max());
}
inline int64_t ExecuteI64SConvertI32(int32_t a, TrapReason* trap) {
return static_cast<int64_t>(a);
}
inline int64_t ExecuteI64UConvertI32(uint32_t a, TrapReason* trap) {
return static_cast<uint64_t>(a);
}
inline float ExecuteF32SConvertI32(int32_t a, TrapReason* trap) {
return static_cast<float>(a);
}
inline float ExecuteF32UConvertI32(uint32_t a, TrapReason* trap) {
return static_cast<float>(a);
}
inline float ExecuteF32SConvertI64(int64_t a, TrapReason* trap) {
return static_cast<float>(a);
}
inline float ExecuteF32UConvertI64(uint64_t a, TrapReason* trap) {
return CallExternalIntToFloatFunction<float, uint64_t,
uint64_to_float32_wrapper>(a);
}
inline float ExecuteF32ConvertF64(double a, TrapReason* trap) {
return DoubleToFloat32(a);
}
inline Float32 ExecuteF32ReinterpretI32(int32_t a, TrapReason* trap) {
return Float32::FromBits(a);
}
inline double ExecuteF64SConvertI32(int32_t a, TrapReason* trap) {
return static_cast<double>(a);
}
inline double ExecuteF64UConvertI32(uint32_t a, TrapReason* trap) {
return static_cast<double>(a);
}
inline double ExecuteF64SConvertI64(int64_t a, TrapReason* trap) {
return static_cast<double>(a);
}
inline double ExecuteF64UConvertI64(uint64_t a, TrapReason* trap) {
return CallExternalIntToFloatFunction<double, uint64_t,
uint64_to_float64_wrapper>(a);
}
inline double ExecuteF64ConvertF32(float a, TrapReason* trap) {
return static_cast<double>(a);
}
inline Float64 ExecuteF64ReinterpretI64(int64_t a, TrapReason* trap) {
return Float64::FromBits(a);
}
inline int32_t ExecuteI32ReinterpretF32(WasmValue a) {
return a.to_f32_boxed().get_bits();
}
inline int64_t ExecuteI64ReinterpretF64(WasmValue a) {
return a.to_f64_boxed().get_bits();
}
enum InternalOpcode {
#define DECL_INTERNAL_ENUM(name, value) kInternal##name = value,
FOREACH_INTERNAL_OPCODE(DECL_INTERNAL_ENUM)
#undef DECL_INTERNAL_ENUM
};
const char* OpcodeName(uint32_t val) {
switch (val) {
#define DECL_INTERNAL_CASE(name, value) \
case kInternal##name: \
return "Internal" #name;
FOREACH_INTERNAL_OPCODE(DECL_INTERNAL_CASE)
#undef DECL_INTERNAL_CASE
}
return WasmOpcodes::OpcodeName(static_cast<WasmOpcode>(val));
}
constexpr uint32_t kCatchInArity = 1;
} // namespace
class SideTable;
// Code and metadata needed to execute a function.
struct InterpreterCode {
const WasmFunction* function; // wasm function
BodyLocalDecls locals; // local declarations
const byte* orig_start; // start of original code
const byte* orig_end; // end of original code
byte* start; // start of (maybe altered) code
byte* end; // end of (maybe altered) code
SideTable* side_table; // precomputed side table for control flow.
const byte* at(pc_t pc) { return start + pc; }
};
// A helper class to compute the control transfers for each bytecode offset.
// Control transfers allow Br, BrIf, BrTable, If, Else, and End bytecodes to
// be directly executed without the need to dynamically track blocks.
class SideTable : public ZoneObject {
public:
ControlTransferMap map_;
uint32_t max_stack_height_ = 0;
SideTable(Zone* zone, const WasmModule* module, InterpreterCode* code)
: map_(zone) {
// Create a zone for all temporary objects.
Zone control_transfer_zone(zone->allocator(), ZONE_NAME);
// Represents a control flow label.
class CLabel : public ZoneObject {
explicit CLabel(Zone* zone, uint32_t target_stack_height, uint32_t arity)
: target_stack_height(target_stack_height),
arity(arity),
refs(zone) {}
public:
struct Ref {
const byte* from_pc;
const uint32_t stack_height;
};
const byte* target = nullptr;
uint32_t target_stack_height;
// Arity when branching to this label.
const uint32_t arity;
ZoneVector<Ref> refs;
static CLabel* New(Zone* zone, uint32_t stack_height, uint32_t arity) {
return new (zone) CLabel(zone, stack_height, arity);
}
// Bind this label to the given PC.
void Bind(const byte* pc) {
DCHECK_NULL(target);
target = pc;
}
// Reference this label from the given location.
void Ref(const byte* from_pc, uint32_t stack_height) {
// Target being bound before a reference means this is a loop.
DCHECK_IMPLIES(target, *target == kExprLoop);
refs.push_back({from_pc, stack_height});
}
void Finish(ControlTransferMap* map, const byte* start) {
DCHECK_NOT_NULL(target);
for (auto ref : refs) {
size_t offset = static_cast<size_t>(ref.from_pc - start);
auto pcdiff = static_cast<pcdiff_t>(target - ref.from_pc);
DCHECK_GE(ref.stack_height, target_stack_height);
spdiff_t spdiff =
static_cast<spdiff_t>(ref.stack_height - target_stack_height);
TRACE("control transfer @%zu: pc %d, stack %u->%u = -%u\n", offset,
pcdiff, ref.stack_height, target_stack_height, spdiff);
ControlTransferEntry& entry = (*map)[offset];
entry.pc_diff = pcdiff;
entry.sp_diff = spdiff;
entry.target_arity = arity;
}
}
};
// An entry in the control stack.
struct Control {
const byte* pc;
CLabel* end_label;
CLabel* else_label;
// Arity (number of values on the stack) when exiting this control
// structure via |end|.
uint32_t exit_arity;
// Track whether this block was already left, i.e. all further
// instructions are unreachable.
bool unreachable = false;
Control(const byte* pc, CLabel* end_label, CLabel* else_label,
uint32_t exit_arity)
: pc(pc),
end_label(end_label),
else_label(else_label),
exit_arity(exit_arity) {}
Control(const byte* pc, CLabel* end_label, uint32_t exit_arity)
: Control(pc, end_label, nullptr, exit_arity) {}
void Finish(ControlTransferMap* map, const byte* start) {
end_label->Finish(map, start);
if (else_label) else_label->Finish(map, start);
}
};
// Compute the ControlTransfer map.
// This algorithm maintains a stack of control constructs similar to the
// AST decoder. The {control_stack} allows matching {br,br_if,br_table}
// bytecodes with their target, as well as determining whether the current
// bytecodes are within the true or false block of an else.
ZoneVector<Control> control_stack(&control_transfer_zone);
// It also maintains a stack of all nested {try} blocks to resolve local
// handler targets for potentially throwing operations. These exceptional
// control transfers are treated just like other branches in the resulting
// map. This stack contains indices into the above control stack.
ZoneVector<size_t> exception_stack(zone);
uint32_t stack_height = 0;
uint32_t func_arity =
static_cast<uint32_t>(code->function->sig->return_count());
CLabel* func_label =
CLabel::New(&control_transfer_zone, stack_height, func_arity);
control_stack.emplace_back(code->orig_start, func_label, func_arity);
auto control_parent = [&]() -> Control& {
DCHECK_LE(2, control_stack.size());
return control_stack[control_stack.size() - 2];
};
auto copy_unreachable = [&] {
control_stack.back().unreachable = control_parent().unreachable;
};
for (BytecodeIterator i(code->orig_start, code->orig_end, &code->locals);
i.has_next(); i.next()) {
WasmOpcode opcode = i.current();
uint32_t exceptional_stack_height = 0;
if (WasmOpcodes::IsPrefixOpcode(opcode)) opcode = i.prefixed_opcode();
bool unreachable = control_stack.back().unreachable;
if (unreachable) {
TRACE("@%u: %s (is unreachable)\n", i.pc_offset(),
WasmOpcodes::OpcodeName(opcode));
} else {
auto stack_effect =
StackEffect(module, code->function->sig, i.pc(), i.end());
TRACE("@%u: %s (sp %d - %d + %d)\n", i.pc_offset(),
WasmOpcodes::OpcodeName(opcode), stack_height, stack_effect.first,
stack_effect.second);
DCHECK_GE(stack_height, stack_effect.first);
DCHECK_GE(kMaxUInt32, static_cast<uint64_t>(stack_height) -
stack_effect.first + stack_effect.second);
exceptional_stack_height = stack_height - stack_effect.first;
stack_height = stack_height - stack_effect.first + stack_effect.second;
if (stack_height > max_stack_height_) max_stack_height_ = stack_height;
}
if (!exception_stack.empty() && WasmOpcodes::IsThrowingOpcode(opcode)) {
// Record exceptional control flow from potentially throwing opcodes to
// the local handler if one is present. The stack height at the throw
// point is assumed to have popped all operands and not pushed any yet.
DCHECK_GE(control_stack.size() - 1, exception_stack.back());
const Control* c = &control_stack[exception_stack.back()];
if (!unreachable) c->else_label->Ref(i.pc(), exceptional_stack_height);
if (exceptional_stack_height + kCatchInArity > max_stack_height_) {
max_stack_height_ = exceptional_stack_height + kCatchInArity;
}
TRACE("handler @%u: %s -> try @%u\n", i.pc_offset(), OpcodeName(opcode),
static_cast<uint32_t>(c->pc - code->start));
}
switch (opcode) {
case kExprBlock:
case kExprLoop: {
bool is_loop = opcode == kExprLoop;
BlockTypeImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures, &i,
i.pc());
if (imm.type == kWasmBottom) {
imm.sig = module->signatures[imm.sig_index];
}
TRACE("control @%u: %s, arity %d->%d\n", i.pc_offset(),
is_loop ? "Loop" : "Block", imm.in_arity(), imm.out_arity());
CLabel* label =
CLabel::New(&control_transfer_zone, stack_height,
is_loop ? imm.in_arity() : imm.out_arity());
control_stack.emplace_back(i.pc(), label, imm.out_arity());
copy_unreachable();
if (is_loop) label->Bind(i.pc());
break;
}
case kExprIf: {
BlockTypeImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures, &i,
i.pc());
if (imm.type == kWasmBottom) {
imm.sig = module->signatures[imm.sig_index];
}
TRACE("control @%u: If, arity %d->%d\n", i.pc_offset(),
imm.in_arity(), imm.out_arity());
CLabel* end_label = CLabel::New(&control_transfer_zone, stack_height,
imm.out_arity());
CLabel* else_label =
CLabel::New(&control_transfer_zone, stack_height, 0);
control_stack.emplace_back(i.pc(), end_label, else_label,
imm.out_arity());
copy_unreachable();
if (!unreachable) else_label->Ref(i.pc(), stack_height);
break;
}
case kExprElse: {
Control* c = &control_stack.back();
copy_unreachable();
TRACE("control @%u: Else\n", i.pc_offset());
if (!control_parent().unreachable) {
c->end_label->Ref(i.pc(), stack_height);
}
DCHECK_NOT_NULL(c->else_label);
c->else_label->Bind(i.pc() + 1);
c->else_label->Finish(&map_, code->orig_start);
c->else_label = nullptr;
DCHECK_GE(stack_height, c->end_label->target_stack_height);
stack_height = c->end_label->target_stack_height;
break;
}
case kExprTry: {
BlockTypeImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures, &i,
i.pc());
if (imm.type == kWasmBottom) {
imm.sig = module->signatures[imm.sig_index];
}
TRACE("control @%u: Try, arity %d->%d\n", i.pc_offset(),
imm.in_arity(), imm.out_arity());
CLabel* end_label = CLabel::New(&control_transfer_zone, stack_height,
imm.out_arity());
CLabel* catch_label =
CLabel::New(&control_transfer_zone, stack_height, kCatchInArity);
control_stack.emplace_back(i.pc(), end_label, catch_label,
imm.out_arity());
exception_stack.push_back(control_stack.size() - 1);
copy_unreachable();
break;
}
case kExprCatch: {
DCHECK_EQ(control_stack.size() - 1, exception_stack.back());
Control* c = &control_stack.back();
exception_stack.pop_back();
copy_unreachable();
TRACE("control @%u: Catch\n", i.pc_offset());
if (!control_parent().unreachable) {
c->end_label->Ref(i.pc(), stack_height);
}
DCHECK_NOT_NULL(c->else_label);
c->else_label->Bind(i.pc() + 1);
c->else_label->Finish(&map_, code->orig_start);
c->else_label = nullptr;
DCHECK_GE(stack_height, c->end_label->target_stack_height);
stack_height = c->end_label->target_stack_height + kCatchInArity;
break;
}
case kExprBrOnExn: {
BranchOnExceptionImmediate<Decoder::kNoValidate> imm(&i, i.pc());
uint32_t depth = imm.depth.depth; // Extracted for convenience.
imm.index.exception = &module->exceptions[imm.index.index];
DCHECK_EQ(0, imm.index.exception->sig->return_count());
size_t params = imm.index.exception->sig->parameter_count();
// Taken branches pop the exception and push the encoded values.
uint32_t height = stack_height - 1 + static_cast<uint32_t>(params);
TRACE("control @%u: BrOnExn[depth=%u]\n", i.pc_offset(), depth);
Control* c = &control_stack[control_stack.size() - depth - 1];
if (!unreachable) c->end_label->Ref(i.pc(), height);
break;
}
case kExprEnd: {
Control* c = &control_stack.back();
TRACE("control @%u: End\n", i.pc_offset());
// Only loops have bound labels.
DCHECK_IMPLIES(c->end_label->target, *c->pc == kExprLoop);
if (!c->end_label->target) {
if (c->else_label) c->else_label->Bind(i.pc());
c->end_label->Bind(i.pc() + 1);
}
c->Finish(&map_, code->orig_start);
DCHECK_GE(stack_height, c->end_label->target_stack_height);
stack_height = c->end_label->target_stack_height + c->exit_arity;
control_stack.pop_back();
break;
}
case kExprBr: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&i, i.pc());
TRACE("control @%u: Br[depth=%u]\n", i.pc_offset(), imm.depth);
Control* c = &control_stack[control_stack.size() - imm.depth - 1];
if (!unreachable) c->end_label->Ref(i.pc(), stack_height);
break;
}
case kExprBrIf: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&i, i.pc());
TRACE("control @%u: BrIf[depth=%u]\n", i.pc_offset(), imm.depth);
Control* c = &control_stack[control_stack.size() - imm.depth - 1];
if (!unreachable) c->end_label->Ref(i.pc(), stack_height);
break;
}
case kExprBrTable: {
BranchTableImmediate<Decoder::kNoValidate> imm(&i, i.pc());
BranchTableIterator<Decoder::kNoValidate> iterator(&i, imm);
TRACE("control @%u: BrTable[count=%u]\n", i.pc_offset(),
imm.table_count);
if (!unreachable) {
while (iterator.has_next()) {
uint32_t j = iterator.cur_index();
uint32_t target = iterator.next();
Control* c = &control_stack[control_stack.size() - target - 1];
c->end_label->Ref(i.pc() + j, stack_height);
}
}
break;
}
default:
break;
}
if (WasmOpcodes::IsUnconditionalJump(opcode)) {
control_stack.back().unreachable = true;
}
}
DCHECK_EQ(0, control_stack.size());
DCHECK_EQ(func_arity, stack_height);
}
bool HasEntryAt(pc_t from) {
auto result = map_.find(from);
return result != map_.end();
}
ControlTransferEntry& Lookup(pc_t from) {
auto result = map_.find(from);
DCHECK(result != map_.end());
return result->second;
}
};
// The main storage for interpreter code. It maps {WasmFunction} to the
// metadata needed to execute each function.
class CodeMap {
Zone* zone_;
const WasmModule* module_;
ZoneVector<InterpreterCode> interpreter_code_;
public:
CodeMap(const WasmModule* module, const uint8_t* module_start, Zone* zone)
: zone_(zone), module_(module), interpreter_code_(zone) {
if (module == nullptr) return;
interpreter_code_.reserve(module->functions.size());
for (const WasmFunction& function : module->functions) {
if (function.imported) {
DCHECK(!function.code.is_set());
AddFunction(&function, nullptr, nullptr);
} else {
AddFunction(&function, module_start + function.code.offset(),
module_start + function.code.end_offset());
}
}
}
const WasmModule* module() const { return module_; }
InterpreterCode* GetCode(const WasmFunction* function) {
InterpreterCode* code = GetCode(function->func_index);
DCHECK_EQ(function, code->function);
return code;
}
InterpreterCode* GetCode(uint32_t function_index) {
DCHECK_LT(function_index, interpreter_code_.size());
return Preprocess(&interpreter_code_[function_index]);
}
InterpreterCode* Preprocess(InterpreterCode* code) {
DCHECK_EQ(code->function->imported, code->start == nullptr);
if (!code->side_table && code->start) {
// Compute the control targets map and the local declarations.
code->side_table = new (zone_) SideTable(zone_, module_, code);
}
return code;
}
void AddFunction(const WasmFunction* function, const byte* code_start,
const byte* code_end) {
InterpreterCode code = {
function, BodyLocalDecls(zone_), code_start,
code_end, const_cast<byte*>(code_start), const_cast<byte*>(code_end),
nullptr};
DCHECK_EQ(interpreter_code_.size(), function->func_index);
interpreter_code_.push_back(code);
}
void SetFunctionCode(const WasmFunction* function, const byte* start,
const byte* end) {
DCHECK_LT(function->func_index, interpreter_code_.size());
InterpreterCode* code = &interpreter_code_[function->func_index];
DCHECK_EQ(function, code->function);
code->orig_start = start;
code->orig_end = end;
code->start = const_cast<byte*>(start);
code->end = const_cast<byte*>(end);
code->side_table = nullptr;
Preprocess(code);
}
};
namespace {
struct ExternalCallResult {
enum Type {
// The function should be executed inside this interpreter.
INTERNAL,
// For indirect calls: Table or function does not exist.
INVALID_FUNC,
// For indirect calls: Signature does not match expected signature.
SIGNATURE_MISMATCH,
// The function was executed and returned normally.
EXTERNAL_RETURNED,
// The function was executed, threw an exception, and the stack was unwound.
EXTERNAL_UNWOUND,
// The function was executed and threw an exception that was locally caught.
EXTERNAL_CAUGHT
};
Type type;
// If type is INTERNAL, this field holds the function to call internally.
InterpreterCode* interpreter_code;
ExternalCallResult(Type type) : type(type) { // NOLINT
DCHECK_NE(INTERNAL, type);
}
ExternalCallResult(Type type, InterpreterCode* code)
: type(type), interpreter_code(code) {
DCHECK_EQ(INTERNAL, type);
}
};
// Like a static_cast from src to dst, but specialized for boxed floats.
template <typename dst, typename src>
struct converter {
dst operator()(src val) const { return static_cast<dst>(val); }
};
template <>
struct converter<Float64, uint64_t> {
Float64 operator()(uint64_t val) const { return Float64::FromBits(val); }
};
template <>
struct converter<Float32, uint32_t> {
Float32 operator()(uint32_t val) const { return Float32::FromBits(val); }
};
template <>
struct converter<uint64_t, Float64> {
uint64_t operator()(Float64 val) const { return val.get_bits(); }
};
template <>
struct converter<uint32_t, Float32> {
uint32_t operator()(Float32 val) const { return val.get_bits(); }
};
template <typename T>
V8_INLINE bool has_nondeterminism(T val) {
static_assert(!std::is_floating_point<T>::value, "missing specialization");
return false;
}
template <>
V8_INLINE bool has_nondeterminism<float>(float val) {
return std::isnan(val);
}
template <>
V8_INLINE bool has_nondeterminism<double>(double val) {
return std::isnan(val);
}
} // namespace
// Responsible for executing code directly.
class ThreadImpl {
struct Activation {
uint32_t fp;
sp_t sp;
Activation(uint32_t fp, sp_t sp) : fp(fp), sp(sp) {}
};
public:
ThreadImpl(Zone* zone, CodeMap* codemap,
Handle<WasmInstanceObject> instance_object,
Handle<Cell> reference_stack_cell)
: codemap_(codemap),
isolate_(instance_object->GetIsolate()),
instance_object_(instance_object),
reference_stack_cell_(reference_stack_cell),
frames_(zone),
activations_(zone) {}
//==========================================================================
// Implementation of public interface for WasmInterpreter::Thread.
//==========================================================================
WasmInterpreter::State state() { return state_; }
void InitFrame(const WasmFunction* function, WasmValue* args) {
DCHECK_EQ(current_activation().fp, frames_.size());
InterpreterCode* code = codemap()->GetCode(function);
size_t num_params = function->sig->parameter_count();
EnsureStackSpace(num_params);
Push(args, num_params);
PushFrame(code);
}
WasmInterpreter::State Run(int num_steps = -1) {
DCHECK(state_ == WasmInterpreter::STOPPED ||
state_ == WasmInterpreter::PAUSED);
DCHECK(num_steps == -1 || num_steps > 0);
if (num_steps == -1) {
TRACE(" => Run()\n");
} else if (num_steps == 1) {
TRACE(" => Step()\n");
} else {
TRACE(" => Run(%d)\n", num_steps);
}
state_ = WasmInterpreter::RUNNING;
Execute(frames_.back().code, frames_.back().pc, num_steps);
// If state_ is STOPPED, the current activation must be fully unwound.
DCHECK_IMPLIES(state_ == WasmInterpreter::STOPPED,
current_activation().fp == frames_.size());
return state_;
}
void Pause() { UNIMPLEMENTED(); }
void Reset() {
TRACE("----- RESET -----\n");
ResetStack(0);
frames_.clear();
state_ = WasmInterpreter::STOPPED;
trap_reason_ = kTrapCount;
possible_nondeterminism_ = false;
}
int GetFrameCount() {
DCHECK_GE(kMaxInt, frames_.size());
return static_cast<int>(frames_.size());
}
WasmValue GetReturnValue(uint32_t index) {
if (state_ == WasmInterpreter::TRAPPED) return WasmValue(0xDEADBEEF);
DCHECK_EQ(WasmInterpreter::FINISHED, state_);
Activation act = current_activation();
// Current activation must be finished.
DCHECK_EQ(act.fp, frames_.size());
return GetStackValue(act.sp + index);
}
WasmValue GetStackValue(sp_t index) {
DCHECK_GT(StackHeight(), index);
return stack_[index].ExtractValue(this, index);
}
void SetStackValue(sp_t index, WasmValue value) {
DCHECK_GT(StackHeight(), index);
stack_[index] = StackValue(value, this, index);
}
TrapReason GetTrapReason() { return trap_reason_; }
pc_t GetBreakpointPc() { return break_pc_; }
bool PossibleNondeterminism() { return possible_nondeterminism_; }
uint64_t NumInterpretedCalls() { return num_interpreted_calls_; }
void AddBreakFlags(uint8_t flags) { break_flags_ |= flags; }
void ClearBreakFlags() { break_flags_ = WasmInterpreter::BreakFlag::None; }
Handle<Cell> reference_stack_cell() const { return reference_stack_cell_; }
uint32_t NumActivations() {
return static_cast<uint32_t>(activations_.size());
}
uint32_t StartActivation() {
TRACE("----- START ACTIVATION %zu -----\n", activations_.size());
// If you use activations, use them consistently:
DCHECK_IMPLIES(activations_.empty(), frames_.empty());
DCHECK_IMPLIES(activations_.empty(), StackHeight() == 0);
uint32_t activation_id = static_cast<uint32_t>(activations_.size());
activations_.emplace_back(static_cast<uint32_t>(frames_.size()),
StackHeight());
state_ = WasmInterpreter::STOPPED;
return activation_id;
}
void FinishActivation(uint32_t id) {
TRACE("----- FINISH ACTIVATION %zu -----\n", activations_.size() - 1);
DCHECK_LT(0, activations_.size());
DCHECK_EQ(activations_.size() - 1, id);
// Stack height must match the start of this activation (otherwise unwind
// first).
DCHECK_EQ(activations_.back().fp, frames_.size());
DCHECK_LE(activations_.back().sp, StackHeight());
ResetStack(activations_.back().sp);
activations_.pop_back();
}
uint32_t ActivationFrameBase(uint32_t id) {
DCHECK_GT(activations_.size(), id);
return activations_[id].fp;
}
WasmInterpreter::Thread::ExceptionHandlingResult RaiseException(
Isolate* isolate, Handle<Object> exception) {
DCHECK_EQ(WasmInterpreter::TRAPPED, state_);
isolate->Throw(*exception); // Will check that none is pending.
if (HandleException(isolate) == WasmInterpreter::Thread::UNWOUND) {
DCHECK_EQ(WasmInterpreter::STOPPED, state_);
return WasmInterpreter::Thread::UNWOUND;
}
state_ = WasmInterpreter::PAUSED;
return WasmInterpreter::Thread::HANDLED;
}
uint32_t GetGlobalCount() {
return static_cast<uint32_t>(module()->globals.size());
}
WasmValue GetGlobalValue(uint32_t index) {
const WasmGlobal* global = &module()->globals[index];
switch (global->type) {
#define CASE_TYPE(wasm, ctype) \
case kWasm##wasm: { \
byte* ptr = GetGlobalPtr(global); \
return WasmValue( \
ReadLittleEndianValue<ctype>(reinterpret_cast<Address>(ptr))); \
break; \
}
WASM_CTYPES(CASE_TYPE)
#undef CASE_TYPE
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<FixedArray> global_buffer; // The buffer of the global.
uint32_t global_index = 0; // The index into the buffer.
GetGlobalBufferAndIndex(global, &global_buffer, &global_index);
Handle<Object> value(global_buffer->get(global_index), isolate_);
return WasmValue(handle_scope.CloseAndEscape(value));
}
default:
UNREACHABLE();
}
}
private:
// Handle a thrown exception. Returns whether the exception was handled inside
// the current activation. Unwinds the interpreted stack accordingly.
WasmInterpreter::Thread::ExceptionHandlingResult HandleException(
Isolate* isolate) {
DCHECK(isolate->has_pending_exception());
DCHECK_LT(0, activations_.size());
Activation& act = activations_.back();
while (frames_.size() > act.fp) {
Frame& frame = frames_.back();
InterpreterCode* code = frame.code;
if (code->side_table->HasEntryAt(frame.pc)) {
TRACE("----- HANDLE -----\n");
Push(WasmValue(handle(isolate->pending_exception(), isolate)));
isolate->clear_pending_exception();
frame.pc += JumpToHandlerDelta(code, frame.pc);
TRACE(" => handler #%zu (#%u @%zu)\n", frames_.size() - 1,
code->function->func_index, frame.pc);
return WasmInterpreter::Thread::HANDLED;
}
TRACE(" => drop frame #%zu (#%u @%zu)\n", frames_.size() - 1,
code->function->func_index, frame.pc);
ResetStack(frame.sp);
frames_.pop_back();
}
TRACE("----- UNWIND -----\n");
DCHECK_EQ(act.fp, frames_.size());
DCHECK_EQ(act.sp, StackHeight());
state_ = WasmInterpreter::STOPPED;
return WasmInterpreter::Thread::UNWOUND;
}
// Entries on the stack of functions being evaluated.
struct Frame {
InterpreterCode* code;
pc_t pc;
sp_t sp;
// Limit of parameters.
sp_t plimit() { return sp + code->function->sig->parameter_count(); }
// Limit of locals.
sp_t llimit() { return plimit() + code->locals.type_list.size(); }
};
// Safety wrapper for values on the operand stack represented as {WasmValue}.
// Most values are stored directly on the stack, only reference values are
// kept in a separate on-heap reference stack to make the GC trace them.
// TODO(mstarzinger): Optimize simple stack operations (like "get_local",
// "set_local", and "tee_local") so that they don't require a handle scope.
// TODO(mstarzinger): Consider optimizing activations that use no reference
// values to avoid allocating the reference stack entirely.
class StackValue {
public:
StackValue() = default; // Only needed for resizing the stack.
StackValue(WasmValue v, ThreadImpl* thread, sp_t index) : value_(v) {
if (IsReferenceValue()) {
value_ = WasmValue(Handle<Object>::null());
int ref_index = static_cast<int>(index);
thread->reference_stack().set(ref_index, *v.to_anyref());
}
}
WasmValue ExtractValue(ThreadImpl* thread, sp_t index) {
if (!IsReferenceValue()) return value_;
DCHECK(value_.to_anyref().is_null());
int ref_index = static_cast<int>(index);
Isolate* isolate = thread->isolate_;
Handle<Object> ref(thread->reference_stack().get(ref_index), isolate);
DCHECK(!ref->IsTheHole(isolate));
return WasmValue(ref);
}
bool IsReferenceValue() const { return value_.type() == kWasmAnyRef; }
void ClearValue(ThreadImpl* thread, sp_t index) {
if (!IsReferenceValue()) return;
int ref_index = static_cast<int>(index);
Isolate* isolate = thread->isolate_;
thread->reference_stack().set_the_hole(isolate, ref_index);
}
static void ClearValues(ThreadImpl* thread, sp_t index, int count) {
int ref_index = static_cast<int>(index);
thread->reference_stack().FillWithHoles(ref_index, ref_index + count);
}
static bool IsClearedValue(ThreadImpl* thread, sp_t index) {
int ref_index = static_cast<int>(index);
Isolate* isolate = thread->isolate_;
return thread->reference_stack().is_the_hole(isolate, ref_index);
}
private:
WasmValue value_;
};
friend class InterpretedFrameImpl;
CodeMap* codemap_;
Isolate* isolate_;
Handle<WasmInstanceObject> instance_object_;
std::unique_ptr<StackValue[]> stack_;
StackValue* stack_limit_ = nullptr; // End of allocated stack space.
StackValue* sp_ = nullptr; // Current stack pointer.
// The reference stack is pointed to by a {Cell} to be able to replace the
// underlying {FixedArray} when growing the stack. This avoids having to
// recreate or update the global handle keeping this object alive.
Handle<Cell> reference_stack_cell_; // References are on an on-heap stack.
ZoneVector<Frame> frames_;
WasmInterpreter::State state_ = WasmInterpreter::STOPPED;
pc_t break_pc_ = kInvalidPc;
TrapReason trap_reason_ = kTrapCount;
bool possible_nondeterminism_ = false;
uint8_t break_flags_ = 0; // a combination of WasmInterpreter::BreakFlag
uint64_t num_interpreted_calls_ = 0;
// Store the stack height of each activation (for unwind and frame
// inspection).
ZoneVector<Activation> activations_;
CodeMap* codemap() const { return codemap_; }
const WasmModule* module() const { return codemap_->module(); }
FixedArray reference_stack() const {
return FixedArray::cast(reference_stack_cell_->value());
}
void DoTrap(TrapReason trap, pc_t pc) {
TRACE("TRAP: %s\n", WasmOpcodes::TrapReasonMessage(trap));
state_ = WasmInterpreter::TRAPPED;
trap_reason_ = trap;
CommitPc(pc);
}
// Check if there is room for a function's activation.
void EnsureStackSpaceForCall(InterpreterCode* code) {
EnsureStackSpace(code->side_table->max_stack_height_ +
code->locals.type_list.size());
DCHECK_GE(StackHeight(), code->function->sig->parameter_count());
}
// Push a frame with arguments already on the stack.
void PushFrame(InterpreterCode* code) {
DCHECK_NOT_NULL(code);
DCHECK_NOT_NULL(code->side_table);
EnsureStackSpaceForCall(code);
++num_interpreted_calls_;
size_t arity = code->function->sig->parameter_count();
// The parameters will overlap the arguments already on the stack.
DCHECK_GE(StackHeight(), arity);
frames_.push_back({code, 0, StackHeight() - arity});
frames_.back().pc = InitLocals(code);
TRACE(" => PushFrame #%zu (#%u @%zu)\n", frames_.size() - 1,
code->function->func_index, frames_.back().pc);
}
pc_t InitLocals(InterpreterCode* code) {
for (auto p : code->locals.type_list) {
WasmValue val;
switch (p) {
#define CASE_TYPE(wasm, ctype) \
case kWasm##wasm: \
val = WasmValue(ctype{}); \
break;
WASM_CTYPES(CASE_TYPE)
#undef CASE_TYPE
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
val = WasmValue(isolate_->factory()->null_value());
break;
}
default:
UNREACHABLE();
break;
}
Push(val);
}
return code->locals.encoded_size;
}
void CommitPc(pc_t pc) {
DCHECK(!frames_.empty());
frames_.back().pc = pc;
}
bool SkipBreakpoint(InterpreterCode* code, pc_t pc) {
if (pc == break_pc_) {
// Skip the previously hit breakpoint when resuming.
break_pc_ = kInvalidPc;
return true;
}
return false;
}
void ReloadFromFrameOnException(Decoder* decoder, InterpreterCode** code,
pc_t* pc, pc_t* limit) {
Frame* top = &frames_.back();
*code = top->code;
*pc = top->pc;
*limit = top->code->end - top->code->start;
decoder->Reset(top->code->start, top->code->end);
}
int LookupTargetDelta(InterpreterCode* code, pc_t pc) {
return static_cast<int>(code->side_table->Lookup(pc).pc_diff);
}
int JumpToHandlerDelta(InterpreterCode* code, pc_t pc) {
ControlTransferEntry& control_transfer_entry = code->side_table->Lookup(pc);
DoStackTransfer(control_transfer_entry.sp_diff + kCatchInArity,
control_transfer_entry.target_arity);
return control_transfer_entry.pc_diff;
}
int DoBreak(InterpreterCode* code, pc_t pc, size_t depth) {
ControlTransferEntry& control_transfer_entry = code->side_table->Lookup(pc);
DoStackTransfer(control_transfer_entry.sp_diff,
control_transfer_entry.target_arity);
return control_transfer_entry.pc_diff;
}
pc_t ReturnPc(Decoder* decoder, InterpreterCode* code, pc_t pc) {
switch (code->orig_start[pc]) {
case kExprCallFunction: {
CallFunctionImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
return pc + 1 + imm.length;
}
case kExprCallIndirect: {
CallIndirectImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures,
decoder, code->at(pc));
return pc + 1 + imm.length;
}
default:
UNREACHABLE();
}
}
bool DoReturn(Decoder* decoder, InterpreterCode** code, pc_t* pc, pc_t* limit,
size_t arity) {
DCHECK_GT(frames_.size(), 0);
spdiff_t sp_diff = static_cast<spdiff_t>(StackHeight() - frames_.back().sp);
frames_.pop_back();
if (frames_.size() == current_activation().fp) {
// A return from the last frame terminates the execution.
state_ = WasmInterpreter::FINISHED;
DoStackTransfer(sp_diff, arity);
TRACE(" => finish\n");
return false;
} else {
// Return to caller frame.
Frame* top = &frames_.back();
*code = top->code;
decoder->Reset((*code)->start, (*code)->end);
*pc = ReturnPc(decoder, *code, top->pc);
*limit = top->code->end - top->code->start;
TRACE(" => Return to #%zu (#%u @%zu)\n", frames_.size() - 1,
(*code)->function->func_index, *pc);
DoStackTransfer(sp_diff, arity);
return true;
}
}
// Returns true if the call was successful, false if the stack check failed
// and the current activation was fully unwound.
bool DoCall(Decoder* decoder, InterpreterCode* target, pc_t* pc,
pc_t* limit) V8_WARN_UNUSED_RESULT {
frames_.back().pc = *pc;
PushFrame(target);
if (!DoStackCheck()) return false;
*pc = frames_.back().pc;
*limit = target->end - target->start;
decoder->Reset(target->start, target->end);
return true;
}
// Returns true if the tail call was successful, false if the stack check
// failed.
bool DoReturnCall(Decoder* decoder, InterpreterCode* target, pc_t* pc,
pc_t* limit) V8_WARN_UNUSED_RESULT {
DCHECK_NOT_NULL(target);
DCHECK_NOT_NULL(target->side_table);
EnsureStackSpaceForCall(target);
++num_interpreted_calls_;
Frame* top = &frames_.back();
// Drop everything except current parameters.
spdiff_t sp_diff = static_cast<spdiff_t>(StackHeight() - top->sp);
size_t arity = target->function->sig->parameter_count();
DoStackTransfer(sp_diff, arity);
*limit = target->end - target->start;
decoder->Reset(target->start, target->end);
// Rebuild current frame to look like a call to callee.
top->code = target;
top->pc = 0;
top->sp = StackHeight() - arity;
top->pc = InitLocals(target);
*pc = top->pc;
TRACE(" => ReturnCall #%zu (#%u @%zu)\n", frames_.size() - 1,
target->function->func_index, top->pc);
return true;
}
// Copies {arity} values on the top of the stack down the stack while also
// dropping {sp_diff} many stack values in total from the stack.
void DoStackTransfer(spdiff_t sp_diff, size_t arity) {
// before: |---------------| pop_count | arity |
// ^ 0 ^ dest ^ src ^ StackHeight()
// ^----< sp_diff >----^
//
// after: |---------------| arity |
// ^ 0 ^ StackHeight()
sp_t stack_height = StackHeight();
sp_t dest = stack_height - sp_diff;
sp_t src = stack_height - arity;
DCHECK_LE(dest, stack_height);
DCHECK_LE(dest, src);
if (arity && (dest != src)) {
StackValue* stack = stack_.get();
memmove(stack + dest, stack + src, arity * sizeof(StackValue));
// Also move elements on the reference stack accordingly.
reference_stack().MoveElements(
isolate_, static_cast<int>(dest), static_cast<int>(src),
static_cast<int>(arity), UPDATE_WRITE_BARRIER);
}
ResetStack(dest + arity);
}
inline Address EffectiveAddress(uint32_t index) {
// Compute the effective address of the access, making sure to condition
// the index even in the in-bounds case.
return reinterpret_cast<Address>(instance_object_->memory_start()) +
(index & instance_object_->memory_mask());
}
template <typename mtype>
inline Address BoundsCheckMem(uint32_t offset, uint32_t index) {
uint32_t effective_index = offset + index;
if (effective_index < index) {
return kNullAddress; // wraparound => oob
}
if (!IsInBounds(effective_index, sizeof(mtype),
instance_object_->memory_size())) {
return kNullAddress; // oob
}
return EffectiveAddress(effective_index);
}
inline bool BoundsCheckMemRange(uint32_t index, uint32_t* size,
Address* out_address) {
bool ok = ClampToBounds(
index, size, static_cast<uint32_t>(instance_object_->memory_size()));
*out_address = EffectiveAddress(index);
return ok;
}
template <typename ctype, typename mtype>
bool ExecuteLoad(Decoder* decoder, InterpreterCode* code, pc_t pc,
int* const len, MachineRepresentation rep) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc),
sizeof(ctype));
uint32_t index = Pop().to<uint32_t>();
Address addr = BoundsCheckMem<mtype>(imm.offset, index);
if (!addr) {
DoTrap(kTrapMemOutOfBounds, pc);
return false;
}
WasmValue result(
converter<ctype, mtype>{}(ReadLittleEndianValue<mtype>(addr)));
Push(result);
*len += imm.length;
if (FLAG_trace_wasm_memory) {
MemoryTracingInfo info(imm.offset + index, false, rep);
TraceMemoryOperation(ExecutionTier::kInterpreter, &info,
code->function->func_index, static_cast<int>(pc),
instance_object_->memory_start());
}
return true;
}
template <typename ctype, typename mtype>
bool ExecuteStore(Decoder* decoder, InterpreterCode* code, pc_t pc,
int* const len, MachineRepresentation rep) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc),
sizeof(ctype));
ctype val = Pop().to<ctype>();
uint32_t index = Pop().to<uint32_t>();
Address addr = BoundsCheckMem<mtype>(imm.offset, index);
if (!addr) {
DoTrap(kTrapMemOutOfBounds, pc);
return false;
}
WriteLittleEndianValue<mtype>(addr, converter<mtype, ctype>{}(val));
*len += imm.length;
if (FLAG_trace_wasm_memory) {
MemoryTracingInfo info(imm.offset + index, true, rep);
TraceMemoryOperation(ExecutionTier::kInterpreter, &info,
code->function->func_index, static_cast<int>(pc),
instance_object_->memory_start());
}
return true;
}
bool CheckDataSegmentIsPassiveAndNotDropped(uint32_t index, pc_t pc) {
DCHECK_LT(index, module()->num_declared_data_segments);
if (instance_object_->dropped_data_segments()[index]) {
DoTrap(kTrapDataSegmentDropped, pc);
return false;
}
return true;
}
bool CheckElemSegmentIsPassiveAndNotDropped(uint32_t index, pc_t pc) {
DCHECK_LT(index, module()->elem_segments.size());
if (instance_object_->dropped_elem_segments()[index]) {
DoTrap(kTrapElemSegmentDropped, pc);
return false;
}
return true;
}
template <typename type, typename op_type>
bool ExtractAtomicOpParams(Decoder* decoder, InterpreterCode* code,
Address* address, pc_t pc, int* const len,
type* val = nullptr, type* val2 = nullptr) {
MemoryAccessImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc + 1),
sizeof(type));
if (val2) *val2 = static_cast<type>(Pop().to<op_type>());
if (val) *val = static_cast<type>(Pop().to<op_type>());
uint32_t index = Pop().to<uint32_t>();
*address = BoundsCheckMem<type>(imm.offset, index);
if (!address) {
DoTrap(kTrapMemOutOfBounds, pc);
return false;
}
*len = 2 + imm.length;
return true;
}
bool ExecuteNumericOp(WasmOpcode opcode, Decoder* decoder,
InterpreterCode* code, pc_t pc, int* const len) {
switch (opcode) {
case kExprI32SConvertSatF32:
Push(WasmValue(ExecuteConvertSaturate<int32_t>(Pop().to<float>())));
return true;
case kExprI32UConvertSatF32:
Push(WasmValue(ExecuteConvertSaturate<uint32_t>(Pop().to<float>())));
return true;
case kExprI32SConvertSatF64:
Push(WasmValue(ExecuteConvertSaturate<int32_t>(Pop().to<double>())));
return true;
case kExprI32UConvertSatF64:
Push(WasmValue(ExecuteConvertSaturate<uint32_t>(Pop().to<double>())));
return true;
case kExprI64SConvertSatF32:
Push(WasmValue(ExecuteI64SConvertSatF32(Pop().to<float>())));
return true;
case kExprI64UConvertSatF32:
Push(WasmValue(ExecuteI64UConvertSatF32(Pop().to<float>())));
return true;
case kExprI64SConvertSatF64:
Push(WasmValue(ExecuteI64SConvertSatF64(Pop().to<double>())));
return true;
case kExprI64UConvertSatF64:
Push(WasmValue(ExecuteI64UConvertSatF64(Pop().to<double>())));
return true;
case kExprMemoryInit: {
MemoryInitImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
DCHECK_LT(imm.data_segment_index, module()->num_declared_data_segments);
*len += imm.length;
if (!CheckDataSegmentIsPassiveAndNotDropped(imm.data_segment_index,
pc)) {
return false;
}
auto size = Pop().to<uint32_t>();
auto src = Pop().to<uint32_t>();
auto dst = Pop().to<uint32_t>();
if (size == 0) {
return true;
}
Address dst_addr;
bool ok = BoundsCheckMemRange(dst, &size, &dst_addr);
auto src_max =
instance_object_->data_segment_sizes()[imm.data_segment_index];
// Use & instead of && so the clamp is not short-circuited.
ok &= ClampToBounds(src, &size, src_max);
Address src_addr =
instance_object_->data_segment_starts()[imm.data_segment_index] +
src;
memory_copy_wrapper(dst_addr, src_addr, size);
if (!ok) DoTrap(kTrapMemOutOfBounds, pc);
return ok;
}
case kExprDataDrop: {
DataDropImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
*len += imm.length;
if (!CheckDataSegmentIsPassiveAndNotDropped(imm.index, pc)) {
return false;
}
instance_object_->dropped_data_segments()[imm.index] = 1;
return true;
}
case kExprMemoryCopy: {
MemoryCopyImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
*len += imm.length;
auto size = Pop().to<uint32_t>();
auto src = Pop().to<uint32_t>();
auto dst = Pop().to<uint32_t>();
if (size == 0) {
return true;
}
Address dst_addr;
bool copy_backward = src < dst;
bool ok = BoundsCheckMemRange(dst, &size, &dst_addr);
// Trap without copying any bytes if we are copying backward and the
// copy is partially out-of-bounds. We only need to check that the dst
// region is out-of-bounds, because we know that {src < dst}, so the src
// region is always out of bounds if the dst region is.
if (ok || !copy_backward) {
Address src_addr;
// Use & instead of && so the bounds check is not short-circuited.
ok &= BoundsCheckMemRange(src, &size, &src_addr);
memory_copy_wrapper(dst_addr, src_addr, size);
}
if (!ok) DoTrap(kTrapMemOutOfBounds, pc);
return ok;
}
case kExprMemoryFill: {
MemoryIndexImmediate<Decoder::kNoValidate> imm(decoder,
code->at(pc + 1));
*len += imm.length;
auto size = Pop().to<uint32_t>();
auto value = Pop().to<uint32_t>();
auto dst = Pop().to<uint32_t>();
if (size == 0) {
return true;
}
Address dst_addr;
bool ok = BoundsCheckMemRange(dst, &size, &dst_addr);
memory_fill_wrapper(dst_addr, value, size);
if (!ok) DoTrap(kTrapMemOutOfBounds, pc);
return ok;
}
case kExprTableInit: {
TableInitImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
*len += imm.length;
if (!CheckElemSegmentIsPassiveAndNotDropped(imm.elem_segment_index,
pc)) {
return false;
}
auto size = Pop().to<uint32_t>();
auto src = Pop().to<uint32_t>();
auto dst = Pop().to<uint32_t>();
HandleScope scope(isolate_); // Avoid leaking handles.
bool ok = WasmInstanceObject::InitTableEntries(
instance_object_->GetIsolate(), instance_object_, imm.table.index,
imm.elem_segment_index, dst, src, size);
if (!ok) DoTrap(kTrapTableOutOfBounds, pc);
return ok;
}
case kExprElemDrop: {
ElemDropImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
*len += imm.length;
if (!CheckElemSegmentIsPassiveAndNotDropped(imm.index, pc)) {
return false;
}
instance_object_->dropped_elem_segments()[imm.index] = 1;
return true;
}
case kExprTableCopy: {
TableCopyImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc));
auto size = Pop().to<uint32_t>();
auto src = Pop().to<uint32_t>();
auto dst = Pop().to<uint32_t>();
HandleScope handle_scope(isolate_); // Avoid leaking handles.
bool ok = WasmInstanceObject::CopyTableEntries(
isolate_, instance_object_, imm.table_dst.index,
imm.table_src.index, dst, src, size);
if (!ok) DoTrap(kTrapTableOutOfBounds, pc);
*len += imm.length;
return ok;
}
case kExprTableGrow: {
TableIndexImmediate<Decoder::kNoValidate> imm(decoder,
code->at(pc + 1));
HandleScope handle_scope(isolate_);
auto table = handle(
WasmTableObject::cast(instance_object_->tables().get(imm.index)),
isolate_);
auto delta = Pop().to<uint32_t>();
auto value = Pop().to_anyref();
int32_t result = WasmTableObject::Grow(isolate_, table, delta, value);
Push(WasmValue(result));
*len += imm.length;
return true;
}
case kExprTableSize: {
TableIndexImmediate<Decoder::kNoValidate> imm(decoder,
code->at(pc + 1));
HandleScope handle_scope(isolate_);
auto table = handle(
WasmTableObject::cast(instance_object_->tables().get(imm.index)),
isolate_);
uint32_t table_size = table->current_length();
Push(WasmValue(table_size));
*len += imm.length;
return true;
}
case kExprTableFill: {
TableIndexImmediate<Decoder::kNoValidate> imm(decoder,
code->at(pc + 1));
HandleScope handle_scope(isolate_);
auto count = Pop().to<uint32_t>();
auto value = Pop().to_anyref();
auto start = Pop().to<uint32_t>();
auto table = handle(
WasmTableObject::cast(instance_object_->tables().get(imm.index)),
isolate_);
uint32_t table_size = table->current_length();
if (start > table_size) {
DoTrap(kTrapTableOutOfBounds, pc);
return false;
}
// Even when table.fill goes out-of-bounds, as many entries as possible
// are put into the table. Only afterwards we trap.
uint32_t fill_count = std::min(count, table_size - start);
WasmTableObject::Fill(isolate_, table, start, value, fill_count);
if (fill_count < count) {
DoTrap(kTrapTableOutOfBounds, pc);
return false;
}
*len += imm.length;
return true;
}
default:
FATAL("Unknown or unimplemented opcode #%d:%s", code->start[pc],
OpcodeName(code->start[pc]));
UNREACHABLE();
}
return false;
}
template <typename type, typename op_type, typename func>
op_type ExecuteAtomicBinopBE(type val, Address addr, func op) {
type old_val;
type new_val;
old_val = ReadUnalignedValue<type>(addr);
do {
new_val =
ByteReverse(static_cast<type>(op(ByteReverse<type>(old_val), val)));
} while (!(std::atomic_compare_exchange_strong(
reinterpret_cast<std::atomic<type>*>(addr), &old_val, new_val)));
return static_cast<op_type>(ByteReverse<type>(old_val));
}
template <typename type>
type AdjustByteOrder(type param) {
#if V8_TARGET_BIG_ENDIAN
return ByteReverse(param);
#else
return param;
#endif
}
bool ExecuteAtomicOp(WasmOpcode opcode, Decoder* decoder,
InterpreterCode* code, pc_t pc, int* const len) {
#if V8_TARGET_BIG_ENDIAN
constexpr bool kBigEndian = true;
#else
constexpr bool kBigEndian = false;
#endif
WasmValue result;
switch (opcode) {
#define ATOMIC_BINOP_CASE(name, type, op_type, operation, op) \
case kExpr##name: { \
type val; \
Address addr; \
op_type result; \
if (!ExtractAtomicOpParams<type, op_type>(decoder, code, &addr, pc, len, \
&val)) { \
return false; \
} \
static_assert(sizeof(std::atomic<type>) == sizeof(type), \
"Size mismatch for types std::atomic<" #type \
">, and " #type); \
if (kBigEndian) { \
auto oplambda = [](type a, type b) { return a op b; }; \
result = ExecuteAtomicBinopBE<type, op_type>(val, addr, oplambda); \
} else { \
result = static_cast<op_type>( \
std::operation(reinterpret_cast<std::atomic<type>*>(addr), val)); \
} \
Push(WasmValue(result)); \
break; \
}
ATOMIC_BINOP_CASE(I32AtomicAdd, uint32_t, uint32_t, atomic_fetch_add, +);
ATOMIC_BINOP_CASE(I32AtomicAdd8U, uint8_t, uint32_t, atomic_fetch_add, +);
ATOMIC_BINOP_CASE(I32AtomicAdd16U, uint16_t, uint32_t, atomic_fetch_add,
+);
ATOMIC_BINOP_CASE(I32AtomicSub, uint32_t, uint32_t, atomic_fetch_sub, -);
ATOMIC_BINOP_CASE(I32AtomicSub8U, uint8_t, uint32_t, atomic_fetch_sub, -);
ATOMIC_BINOP_CASE(I32AtomicSub16U, uint16_t, uint32_t, atomic_fetch_sub,
-);
ATOMIC_BINOP_CASE(I32AtomicAnd, uint32_t, uint32_t, atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I32AtomicAnd8U, uint8_t, uint32_t, atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I32AtomicAnd16U, uint16_t, uint32_t,
atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I32AtomicOr, uint32_t, uint32_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I32AtomicOr8U, uint8_t, uint32_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I32AtomicOr16U, uint16_t, uint32_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I32AtomicXor, uint32_t, uint32_t, atomic_fetch_xor, ^);
ATOMIC_BINOP_CASE(I32AtomicXor8U, uint8_t, uint32_t, atomic_fetch_xor, ^);
ATOMIC_BINOP_CASE(I32AtomicXor16U, uint16_t, uint32_t, atomic_fetch_xor,
^);
ATOMIC_BINOP_CASE(I32AtomicExchange, uint32_t, uint32_t, atomic_exchange,
=);
ATOMIC_BINOP_CASE(I32AtomicExchange8U, uint8_t, uint32_t, atomic_exchange,
=);
ATOMIC_BINOP_CASE(I32AtomicExchange16U, uint16_t, uint32_t,
atomic_exchange, =);
ATOMIC_BINOP_CASE(I64AtomicAdd, uint64_t, uint64_t, atomic_fetch_add, +);
ATOMIC_BINOP_CASE(I64AtomicAdd8U, uint8_t, uint64_t, atomic_fetch_add, +);
ATOMIC_BINOP_CASE(I64AtomicAdd16U, uint16_t, uint64_t, atomic_fetch_add,
+);
ATOMIC_BINOP_CASE(I64AtomicAdd32U, uint32_t, uint64_t, atomic_fetch_add,
+);
ATOMIC_BINOP_CASE(I64AtomicSub, uint64_t, uint64_t, atomic_fetch_sub, -);
ATOMIC_BINOP_CASE(I64AtomicSub8U, uint8_t, uint64_t, atomic_fetch_sub, -);
ATOMIC_BINOP_CASE(I64AtomicSub16U, uint16_t, uint64_t, atomic_fetch_sub,
-);
ATOMIC_BINOP_CASE(I64AtomicSub32U, uint32_t, uint64_t, atomic_fetch_sub,
-);
ATOMIC_BINOP_CASE(I64AtomicAnd, uint64_t, uint64_t, atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I64AtomicAnd8U, uint8_t, uint64_t, atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I64AtomicAnd16U, uint16_t, uint64_t,
atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I64AtomicAnd32U, uint32_t, uint64_t,
atomic_fetch_and, &);
ATOMIC_BINOP_CASE(I64AtomicOr, uint64_t, uint64_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I64AtomicOr8U, uint8_t, uint64_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I64AtomicOr16U, uint16_t, uint64_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I64AtomicOr32U, uint32_t, uint64_t, atomic_fetch_or, |);
ATOMIC_BINOP_CASE(I64AtomicXor, uint64_t, uint64_t, atomic_fetch_xor, ^);
ATOMIC_BINOP_CASE(I64AtomicXor8U, uint8_t, uint64_t, atomic_fetch_xor, ^);
ATOMIC_BINOP_CASE(I64AtomicXor16U, uint16_t, uint64_t, atomic_fetch_xor,
^);
ATOMIC_BINOP_CASE(I64AtomicXor32U, uint32_t, uint64_t, atomic_fetch_xor,
^);
ATOMIC_BINOP_CASE(I64AtomicExchange, uint64_t, uint64_t, atomic_exchange,
=);
ATOMIC_BINOP_CASE(I64AtomicExchange8U, uint8_t, uint64_t, atomic_exchange,
=);
ATOMIC_BINOP_CASE(I64AtomicExchange16U, uint16_t, uint64_t,
atomic_exchange, =);
ATOMIC_BINOP_CASE(I64AtomicExchange32U, uint32_t, uint64_t,
atomic_exchange, =);
#undef ATOMIC_BINOP_CASE
#define ATOMIC_COMPARE_EXCHANGE_CASE(name, type, op_type) \
case kExpr##name: { \
type old_val; \
type new_val; \
Address addr; \
if (!ExtractAtomicOpParams<type, op_type>(decoder, code, &addr, pc, len, \
&old_val, &new_val)) { \
return false; \
} \
static_assert(sizeof(std::atomic<type>) == sizeof(type), \
"Size mismatch for types std::atomic<" #type \
">, and " #type); \
old_val = AdjustByteOrder<type>(old_val); \
new_val = AdjustByteOrder<type>(new_val); \
std::atomic_compare_exchange_strong( \
reinterpret_cast<std::atomic<type>*>(addr), &old_val, new_val); \
Push(WasmValue(static_cast<op_type>(AdjustByteOrder<type>(old_val)))); \
break; \
}
ATOMIC_COMPARE_EXCHANGE_CASE(I32AtomicCompareExchange, uint32_t,
uint32_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I32AtomicCompareExchange8U, uint8_t,
uint32_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I32AtomicCompareExchange16U, uint16_t,
uint32_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I64AtomicCompareExchange, uint64_t,
uint64_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I64AtomicCompareExchange8U, uint8_t,
uint64_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I64AtomicCompareExchange16U, uint16_t,
uint64_t);
ATOMIC_COMPARE_EXCHANGE_CASE(I64AtomicCompareExchange32U, uint32_t,
uint64_t);
#undef ATOMIC_COMPARE_EXCHANGE_CASE
#define ATOMIC_LOAD_CASE(name, type, op_type, operation) \
case kExpr##name: { \
Address addr; \
if (!ExtractAtomicOpParams<type, op_type>(decoder, code, &addr, pc, \
len)) { \
return false; \
} \
static_assert(sizeof(std::atomic<type>) == sizeof(type), \
"Size mismatch for types std::atomic<" #type \
">, and " #type); \
result = WasmValue(static_cast<op_type>(AdjustByteOrder<type>( \
std::operation(reinterpret_cast<std::atomic<type>*>(addr))))); \
Push(result); \
break; \
}
ATOMIC_LOAD_CASE(I32AtomicLoad, uint32_t, uint32_t, atomic_load);
ATOMIC_LOAD_CASE(I32AtomicLoad8U, uint8_t, uint32_t, atomic_load);
ATOMIC_LOAD_CASE(I32AtomicLoad16U, uint16_t, uint32_t, atomic_load);
ATOMIC_LOAD_CASE(I64AtomicLoad, uint64_t, uint64_t, atomic_load);
ATOMIC_LOAD_CASE(I64AtomicLoad8U, uint8_t, uint64_t, atomic_load);
ATOMIC_LOAD_CASE(I64AtomicLoad16U, uint16_t, uint64_t, atomic_load);
ATOMIC_LOAD_CASE(I64AtomicLoad32U, uint32_t, uint64_t, atomic_load);
#undef ATOMIC_LOAD_CASE
#define ATOMIC_STORE_CASE(name, type, op_type, operation) \
case kExpr##name: { \
type val; \
Address addr; \
if (!ExtractAtomicOpParams<type, op_type>(decoder, code, &addr, pc, len, \
&val)) { \
return false; \
} \
static_assert(sizeof(std::atomic<type>) == sizeof(type), \
"Size mismatch for types std::atomic<" #type \
">, and " #type); \
std::operation(reinterpret_cast<std::atomic<type>*>(addr), \
AdjustByteOrder<type>(val)); \
break; \
}
ATOMIC_STORE_CASE(I32AtomicStore, uint32_t, uint32_t, atomic_store);
ATOMIC_STORE_CASE(I32AtomicStore8U, uint8_t, uint32_t, atomic_store);
ATOMIC_STORE_CASE(I32AtomicStore16U, uint16_t, uint32_t, atomic_store);
ATOMIC_STORE_CASE(I64AtomicStore, uint64_t, uint64_t, atomic_store);
ATOMIC_STORE_CASE(I64AtomicStore8U, uint8_t, uint64_t, atomic_store);
ATOMIC_STORE_CASE(I64AtomicStore16U, uint16_t, uint64_t, atomic_store);
ATOMIC_STORE_CASE(I64AtomicStore32U, uint32_t, uint64_t, atomic_store);
#undef ATOMIC_STORE_CASE
case kExprAtomicFence:
std::atomic_thread_fence(std::memory_order_seq_cst);
*len += 2;
break;
default:
UNREACHABLE();
return false;
}
return true;
}
byte* GetGlobalPtr(const WasmGlobal* global) {
DCHECK(!ValueTypes::IsReferenceType(global->type));
if (global->mutability && global->imported) {
return reinterpret_cast<byte*>(
instance_object_->imported_mutable_globals()[global->index]);
} else {
return instance_object_->globals_start() + global->offset;
}
}
void GetGlobalBufferAndIndex(const WasmGlobal* global,
Handle<FixedArray>* buffer, uint32_t* index) {
DCHECK(ValueTypes::IsReferenceType(global->type));
if (global->mutability && global->imported) {
*buffer =
handle(FixedArray::cast(
instance_object_->imported_mutable_globals_buffers().get(
global->index)),
isolate_);
Address idx = instance_object_->imported_mutable_globals()[global->index];
DCHECK_LE(idx, std::numeric_limits<uint32_t>::max());
*index = static_cast<uint32_t>(idx);
} else {
*buffer = handle(instance_object_->tagged_globals_buffer(), isolate_);
*index = global->offset;
}
}
bool ExecuteSimdOp(WasmOpcode opcode, Decoder* decoder, InterpreterCode* code,
pc_t pc, int* const len) {
switch (opcode) {
#define SPLAT_CASE(format, sType, valType, num) \
case kExpr##format##Splat: { \
WasmValue val = Pop(); \
valType v = val.to<valType>(); \
sType s; \
for (int i = 0; i < num; i++) s.val[i] = v; \
Push(WasmValue(Simd128(s))); \
return true; \
}
SPLAT_CASE(F64x2, float2, double, 2)
SPLAT_CASE(F32x4, float4, float, 4)
SPLAT_CASE(I64x2, int2, int64_t, 2)
SPLAT_CASE(I32x4, int4, int32_t, 4)
SPLAT_CASE(I16x8, int8, int32_t, 8)
SPLAT_CASE(I8x16, int16, int32_t, 16)
#undef SPLAT_CASE
#define EXTRACT_LANE_CASE(format, name) \
case kExpr##format##ExtractLane: { \
SimdLaneImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc)); \
*len += 1; \
WasmValue val = Pop(); \
Simd128 s = val.to_s128(); \
auto ss = s.to_##name(); \
Push(WasmValue(ss.val[LANE(imm.lane, ss)])); \
return true; \
}
EXTRACT_LANE_CASE(F64x2, f64x2)
EXTRACT_LANE_CASE(F32x4, f32x4)
EXTRACT_LANE_CASE(I64x2, i64x2)
EXTRACT_LANE_CASE(I32x4, i32x4)
EXTRACT_LANE_CASE(I16x8, i16x8)
EXTRACT_LANE_CASE(I8x16, i8x16)
#undef EXTRACT_LANE_CASE
#define BINOP_CASE(op, name, stype, count, expr) \
case kExpr##op: { \
WasmValue v2 = Pop(); \
WasmValue v1 = Pop(); \
stype s1 = v1.to_s128().to_##name(); \
stype s2 = v2.to_s128().to_##name(); \
stype res; \
for (size_t i = 0; i < count; ++i) { \
auto a = s1.val[LANE(i, s1)]; \
auto b = s2.val[LANE(i, s1)]; \
res.val[LANE(i, s1)] = expr; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
BINOP_CASE(F64x2Add, f64x2, float2, 2, a + b)
BINOP_CASE(F64x2Sub, f64x2, float2, 2, a - b)
BINOP_CASE(F64x2Mul, f64x2, float2, 2, a * b)
BINOP_CASE(F64x2Div, f64x2, float2, 2, base::Divide(a, b))
BINOP_CASE(F64x2Min, f64x2, float2, 2, JSMin(a, b))
BINOP_CASE(F64x2Max, f64x2, float2, 2, JSMax(a, b))
BINOP_CASE(F32x4Add, f32x4, float4, 4, a + b)
BINOP_CASE(F32x4Sub, f32x4, float4, 4, a - b)
BINOP_CASE(F32x4Mul, f32x4, float4, 4, a * b)
BINOP_CASE(F32x4Div, f32x4, float4, 4, a / b)
BINOP_CASE(F32x4Min, f32x4, float4, 4, JSMin(a, b))
BINOP_CASE(F32x4Max, f32x4, float4, 4, JSMax(a, b))
BINOP_CASE(I64x2Add, i64x2, int2, 2, base::AddWithWraparound(a, b))
BINOP_CASE(I64x2Sub, i64x2, int2, 2, base::SubWithWraparound(a, b))
BINOP_CASE(I64x2Mul, i64x2, int2, 2, base::MulWithWraparound(a, b))
BINOP_CASE(I64x2MinS, i64x2, int2, 2, a < b ? a : b)
BINOP_CASE(I64x2MinU, i64x2, int2, 2,
static_cast<uint64_t>(a) < static_cast<uint64_t>(b) ? a : b)
BINOP_CASE(I64x2MaxS, i64x2, int2, 2, a > b ? a : b)
BINOP_CASE(I64x2MaxU, i64x2, int2, 2,
static_cast<uint64_t>(a) > static_cast<uint64_t>(b) ? a : b)
BINOP_CASE(I32x4Add, i32x4, int4, 4, base::AddWithWraparound(a, b))
BINOP_CASE(I32x4Sub, i32x4, int4, 4, base::SubWithWraparound(a, b))
BINOP_CASE(I32x4Mul, i32x4, int4, 4, base::MulWithWraparound(a, b))
BINOP_CASE(I32x4MinS, i32x4, int4, 4, a < b ? a : b)
BINOP_CASE(I32x4MinU, i32x4, int4, 4,
static_cast<uint32_t>(a) < static_cast<uint32_t>(b) ? a : b)
BINOP_CASE(I32x4MaxS, i32x4, int4, 4, a > b ? a : b)
BINOP_CASE(I32x4MaxU, i32x4, int4, 4,
static_cast<uint32_t>(a) > static_cast<uint32_t>(b) ? a : b)
BINOP_CASE(S128And, i32x4, int4, 4, a & b)
BINOP_CASE(S128Or, i32x4, int4, 4, a | b)
BINOP_CASE(S128Xor, i32x4, int4, 4, a ^ b)
BINOP_CASE(I16x8Add, i16x8, int8, 8, base::AddWithWraparound(a, b))
BINOP_CASE(I16x8Sub, i16x8, int8, 8, base::SubWithWraparound(a, b))
BINOP_CASE(I16x8Mul, i16x8, int8, 8, base::MulWithWraparound(a, b))
BINOP_CASE(I16x8MinS, i16x8, int8, 8, a < b ? a : b)
BINOP_CASE(I16x8MinU, i16x8, int8, 8,
static_cast<uint16_t>(a) < static_cast<uint16_t>(b) ? a : b)
BINOP_CASE(I16x8MaxS, i16x8, int8, 8, a > b ? a : b)
BINOP_CASE(I16x8MaxU, i16x8, int8, 8,
static_cast<uint16_t>(a) > static_cast<uint16_t>(b) ? a : b)
BINOP_CASE(I16x8AddSaturateS, i16x8, int8, 8, SaturateAdd<int16_t>(a, b))
BINOP_CASE(I16x8AddSaturateU, i16x8, int8, 8, SaturateAdd<uint16_t>(a, b))
BINOP_CASE(I16x8SubSaturateS, i16x8, int8, 8, SaturateSub<int16_t>(a, b))
BINOP_CASE(I16x8SubSaturateU, i16x8, int8, 8, SaturateSub<uint16_t>(a, b))
BINOP_CASE(I8x16Add, i8x16, int16, 16, base::AddWithWraparound(a, b))
BINOP_CASE(I8x16Sub, i8x16, int16, 16, base::SubWithWraparound(a, b))
BINOP_CASE(I8x16Mul, i8x16, int16, 16, base::MulWithWraparound(a, b))
BINOP_CASE(I8x16MinS, i8x16, int16, 16, a < b ? a : b)
BINOP_CASE(I8x16MinU, i8x16, int16, 16,
static_cast<uint8_t>(a) < static_cast<uint8_t>(b) ? a : b)
BINOP_CASE(I8x16MaxS, i8x16, int16, 16, a > b ? a : b)
BINOP_CASE(I8x16MaxU, i8x16, int16, 16,
static_cast<uint8_t>(a) > static_cast<uint8_t>(b) ? a : b)
BINOP_CASE(I8x16AddSaturateS, i8x16, int16, 16, SaturateAdd<int8_t>(a, b))
BINOP_CASE(I8x16AddSaturateU, i8x16, int16, 16,
SaturateAdd<uint8_t>(a, b))
BINOP_CASE(I8x16SubSaturateS, i8x16, int16, 16, SaturateSub<int8_t>(a, b))
BINOP_CASE(I8x16SubSaturateU, i8x16, int16, 16,
SaturateSub<uint8_t>(a, b))
#undef BINOP_CASE
#define UNOP_CASE(op, name, stype, count, expr) \
case kExpr##op: { \
WasmValue v = Pop(); \
stype s = v.to_s128().to_##name(); \
stype res; \
for (size_t i = 0; i < count; ++i) { \
auto a = s.val[i]; \
res.val[i] = expr; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
UNOP_CASE(F64x2Abs, f64x2, float2, 2, std::abs(a))
UNOP_CASE(F64x2Neg, f64x2, float2, 2, -a)
UNOP_CASE(F32x4Abs, f32x4, float4, 4, std::abs(a))
UNOP_CASE(F32x4Neg, f32x4, float4, 4, -a)
UNOP_CASE(F32x4RecipApprox, f32x4, float4, 4, base::Recip(a))
UNOP_CASE(F32x4RecipSqrtApprox, f32x4, float4, 4, base::RecipSqrt(a))
UNOP_CASE(I64x2Neg, i64x2, int2, 2, base::NegateWithWraparound(a))
UNOP_CASE(I32x4Neg, i32x4, int4, 4, base::NegateWithWraparound(a))
UNOP_CASE(S128Not, i32x4, int4, 4, ~a)
UNOP_CASE(I16x8Neg, i16x8, int8, 8, base::NegateWithWraparound(a))
UNOP_CASE(I8x16Neg, i8x16, int16, 16, base::NegateWithWraparound(a))
#undef UNOP_CASE
#define CMPOP_CASE(op, name, stype, out_stype, count, expr) \
case kExpr##op: { \
WasmValue v2 = Pop(); \
WasmValue v1 = Pop(); \
stype s1 = v1.to_s128().to_##name(); \
stype s2 = v2.to_s128().to_##name(); \
out_stype res; \
for (size_t i = 0; i < count; ++i) { \
auto a = s1.val[i]; \
auto b = s2.val[i]; \
res.val[i] = expr ? -1 : 0; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
CMPOP_CASE(F64x2Eq, f64x2, float2, int2, 2, a == b)
CMPOP_CASE(F64x2Ne, f64x2, float2, int2, 2, a != b)
CMPOP_CASE(F64x2Gt, f64x2, float2, int2, 2, a > b)
CMPOP_CASE(F64x2Ge, f64x2, float2, int2, 2, a >= b)
CMPOP_CASE(F64x2Lt, f64x2, float2, int2, 2, a < b)
CMPOP_CASE(F64x2Le, f64x2, float2, int2, 2, a <= b)
CMPOP_CASE(F32x4Eq, f32x4, float4, int4, 4, a == b)
CMPOP_CASE(F32x4Ne, f32x4, float4, int4, 4, a != b)
CMPOP_CASE(F32x4Gt, f32x4, float4, int4, 4, a > b)
CMPOP_CASE(F32x4Ge, f32x4, float4, int4, 4, a >= b)
CMPOP_CASE(F32x4Lt, f32x4, float4, int4, 4, a < b)
CMPOP_CASE(F32x4Le, f32x4, float4, int4, 4, a <= b)
CMPOP_CASE(I64x2Eq, i64x2, int2, int2, 2, a == b)
CMPOP_CASE(I64x2Ne, i64x2, int2, int2, 2, a != b)
CMPOP_CASE(I64x2GtS, i64x2, int2, int2, 2, a > b)
CMPOP_CASE(I64x2GeS, i64x2, int2, int2, 2, a >= b)
CMPOP_CASE(I64x2LtS, i64x2, int2, int2, 2, a < b)
CMPOP_CASE(I64x2LeS, i64x2, int2, int2, 2, a <= b)
CMPOP_CASE(I64x2GtU, i64x2, int2, int2, 2,
static_cast<uint64_t>(a) > static_cast<uint64_t>(b))
CMPOP_CASE(I64x2GeU, i64x2, int2, int2, 2,
static_cast<uint64_t>(a) >= static_cast<uint64_t>(b))
CMPOP_CASE(I64x2LtU, i64x2, int2, int2, 2,
static_cast<uint64_t>(a) < static_cast<uint64_t>(b))
CMPOP_CASE(I64x2LeU, i64x2, int2, int2, 2,
static_cast<uint64_t>(a) <= static_cast<uint64_t>(b))
CMPOP_CASE(I32x4Eq, i32x4, int4, int4, 4, a == b)
CMPOP_CASE(I32x4Ne, i32x4, int4, int4, 4, a != b)
CMPOP_CASE(I32x4GtS, i32x4, int4, int4, 4, a > b)
CMPOP_CASE(I32x4GeS, i32x4, int4, int4, 4, a >= b)
CMPOP_CASE(I32x4LtS, i32x4, int4, int4, 4, a < b)
CMPOP_CASE(I32x4LeS, i32x4, int4, int4, 4, a <= b)
CMPOP_CASE(I32x4GtU, i32x4, int4, int4, 4,
static_cast<uint32_t>(a) > static_cast<uint32_t>(b))
CMPOP_CASE(I32x4GeU, i32x4, int4, int4, 4,
static_cast<uint32_t>(a) >= static_cast<uint32_t>(b))
CMPOP_CASE(I32x4LtU, i32x4, int4, int4, 4,
static_cast<uint32_t>(a) < static_cast<uint32_t>(b))
CMPOP_CASE(I32x4LeU, i32x4, int4, int4, 4,
static_cast<uint32_t>(a) <= static_cast<uint32_t>(b))
CMPOP_CASE(I16x8Eq, i16x8, int8, int8, 8, a == b)
CMPOP_CASE(I16x8Ne, i16x8, int8, int8, 8, a != b)
CMPOP_CASE(I16x8GtS, i16x8, int8, int8, 8, a > b)
CMPOP_CASE(I16x8GeS, i16x8, int8, int8, 8, a >= b)
CMPOP_CASE(I16x8LtS, i16x8, int8, int8, 8, a < b)
CMPOP_CASE(I16x8LeS, i16x8, int8, int8, 8, a <= b)
CMPOP_CASE(I16x8GtU, i16x8, int8, int8, 8,
static_cast<uint16_t>(a) > static_cast<uint16_t>(b))
CMPOP_CASE(I16x8GeU, i16x8, int8, int8, 8,
static_cast<uint16_t>(a) >= static_cast<uint16_t>(b))
CMPOP_CASE(I16x8LtU, i16x8, int8, int8, 8,
static_cast<uint16_t>(a) < static_cast<uint16_t>(b))
CMPOP_CASE(I16x8LeU, i16x8, int8, int8, 8,
static_cast<uint16_t>(a) <= static_cast<uint16_t>(b))
CMPOP_CASE(I8x16Eq, i8x16, int16, int16, 16, a == b)
CMPOP_CASE(I8x16Ne, i8x16, int16, int16, 16, a != b)
CMPOP_CASE(I8x16GtS, i8x16, int16, int16, 16, a > b)
CMPOP_CASE(I8x16GeS, i8x16, int16, int16, 16, a >= b)
CMPOP_CASE(I8x16LtS, i8x16, int16, int16, 16, a < b)
CMPOP_CASE(I8x16LeS, i8x16, int16, int16, 16, a <= b)
CMPOP_CASE(I8x16GtU, i8x16, int16, int16, 16,
static_cast<uint8_t>(a) > static_cast<uint8_t>(b))
CMPOP_CASE(I8x16GeU, i8x16, int16, int16, 16,
static_cast<uint8_t>(a) >= static_cast<uint8_t>(b))
CMPOP_CASE(I8x16LtU, i8x16, int16, int16, 16,
static_cast<uint8_t>(a) < static_cast<uint8_t>(b))
CMPOP_CASE(I8x16LeU, i8x16, int16, int16, 16,
static_cast<uint8_t>(a) <= static_cast<uint8_t>(b))
#undef CMPOP_CASE
#define REPLACE_LANE_CASE(format, name, stype, ctype) \
case kExpr##format##ReplaceLane: { \
SimdLaneImmediate<Decoder::kNoValidate> imm(decoder, code->at(pc)); \
*len += 1; \
WasmValue new_val = Pop(); \
WasmValue simd_val = Pop(); \
stype s = simd_val.to_s128().to_##name(); \
s.val[LANE(imm.lane, s)] = new_val.to<ctype>(); \
Push(WasmValue(Simd128(s))); \
return true; \
}
REPLACE_LANE_CASE(F64x2, f64x2, float2, double)
REPLACE_LANE_CASE(F32x4, f32x4, float4, float)
REPLACE_LANE_CASE(I64x2, i64x2, int2, int64_t)
REPLACE_LANE_CASE(I32x4, i32x4, int4, int32_t)
REPLACE_LANE_CASE(I16x8, i16x8, int8, int32_t)
REPLACE_LANE_CASE(I8x16, i8x16, int16, int32_t)
#undef REPLACE_LANE_CASE
case kExprS128LoadMem:
return ExecuteLoad<Simd128, Simd128>(decoder, code, pc, len,
MachineRepresentation::kSimd128);
case kExprS128StoreMem:
return ExecuteStore<Simd128, Simd128>(decoder, code, pc, len,
MachineRepresentation::kSimd128);
#define SHIFT_CASE(op, name, stype, count, expr) \
case kExpr##op: { \
uint32_t shift = Pop().to<uint32_t>(); \
WasmValue v = Pop(); \
stype s = v.to_s128().to_##name(); \
stype res; \
for (size_t i = 0; i < count; ++i) { \
auto a = s.val[i]; \
res.val[i] = expr; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
SHIFT_CASE(I64x2Shl, i64x2, int2, 2, static_cast<uint64_t>(a) << shift)
SHIFT_CASE(I64x2ShrS, i64x2, int2, 2, a >> shift)
SHIFT_CASE(I64x2ShrU, i64x2, int2, 2, static_cast<uint64_t>(a) >> shift)
SHIFT_CASE(I32x4Shl, i32x4, int4, 4, static_cast<uint32_t>(a) << shift)
SHIFT_CASE(I32x4ShrS, i32x4, int4, 4, a >> shift)
SHIFT_CASE(I32x4ShrU, i32x4, int4, 4, static_cast<uint32_t>(a) >> shift)
SHIFT_CASE(I16x8Shl, i16x8, int8, 8, static_cast<uint16_t>(a) << shift)
SHIFT_CASE(I16x8ShrS, i16x8, int8, 8, a >> shift)
SHIFT_CASE(I16x8ShrU, i16x8, int8, 8, static_cast<uint16_t>(a) >> shift)
SHIFT_CASE(I8x16Shl, i8x16, int16, 16, static_cast<uint8_t>(a) << shift)
SHIFT_CASE(I8x16ShrS, i8x16, int16, 16, a >> shift)
SHIFT_CASE(I8x16ShrU, i8x16, int16, 16,
static_cast<uint8_t>(a) >> shift)
#undef SHIFT_CASE
#define CONVERT_CASE(op, src_type, name, dst_type, count, start_index, ctype, \
expr) \
case kExpr##op: { \
WasmValue v = Pop(); \
src_type s = v.to_s128().to_##name(); \
dst_type res; \
for (size_t i = 0; i < count; ++i) { \
ctype a = s.val[LANE(start_index + i, s)]; \
res.val[LANE(i, res)] = expr; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
CONVERT_CASE(F32x4SConvertI32x4, int4, i32x4, float4, 4, 0, int32_t,
static_cast<float>(a))
CONVERT_CASE(F32x4UConvertI32x4, int4, i32x4, float4, 4, 0, uint32_t,
static_cast<float>(a))
CONVERT_CASE(I32x4SConvertF32x4, float4, f32x4, int4, 4, 0, double,
std::isnan(a) ? 0
: a<kMinInt ? kMinInt : a> kMaxInt
? kMaxInt
: static_cast<int32_t>(a))
CONVERT_CASE(I32x4UConvertF32x4, float4, f32x4, int4, 4, 0, double,
std::isnan(a)
? 0
: a<0 ? 0 : a> kMaxUInt32 ? kMaxUInt32
: static_cast<uint32_t>(a))
CONVERT_CASE(I32x4SConvertI16x8High, int8, i16x8, int4, 4, 4, int16_t,
a)
CONVERT_CASE(I32x4UConvertI16x8High, int8, i16x8, int4, 4, 4, uint16_t,
a)
CONVERT_CASE(I32x4SConvertI16x8Low, int8, i16x8, int4, 4, 0, int16_t, a)
CONVERT_CASE(I32x4UConvertI16x8Low, int8, i16x8, int4, 4, 0, uint16_t,
a)
CONVERT_CASE(I16x8SConvertI8x16High, int16, i8x16, int8, 8, 8, int8_t,
a)
CONVERT_CASE(I16x8UConvertI8x16High, int16, i8x16, int8, 8, 8, uint8_t,
a)
CONVERT_CASE(I16x8SConvertI8x16Low, int16, i8x16, int8, 8, 0, int8_t, a)
CONVERT_CASE(I16x8UConvertI8x16Low, int16, i8x16, int8, 8, 0, uint8_t,
a)
#undef CONVERT_CASE
#define PACK_CASE(op, src_type, name, dst_type, count, ctype, dst_ctype, \
is_unsigned) \
case kExpr##op: { \
WasmValue v2 = Pop(); \
WasmValue v1 = Pop(); \
src_type s1 = v1.to_s128().to_##name(); \
src_type s2 = v2.to_s128().to_##name(); \
dst_type res; \
int64_t min = std::numeric_limits<ctype>::min(); \
int64_t max = std::numeric_limits<ctype>::max(); \
for (size_t i = 0; i < count; ++i) { \
int32_t v = i < count / 2 ? s1.val[LANE(i, s1)] \
: s2.val[LANE(i - count / 2, s2)]; \
int64_t a = is_unsigned ? static_cast<int64_t>(v & 0xFFFFFFFFu) : v; \
res.val[LANE(i, res)] = \
static_cast<dst_ctype>(std::max(min, std::min(max, a))); \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
PACK_CASE(I16x8SConvertI32x4, int4, i32x4, int8, 8, int16_t, int16_t,
false)
PACK_CASE(I16x8UConvertI32x4, int4, i32x4, int8, 8, uint16_t, int16_t,
true)
PACK_CASE(I8x16SConvertI16x8, int8, i16x8, int16, 16, int8_t, int8_t,
false)
PACK_CASE(I8x16UConvertI16x8, int8, i16x8, int16, 16, uint8_t, int8_t,
true)
#undef PACK_CASE
case kExprS128Select: {
int4 bool_val = Pop().to_s128().to_i32x4();
int4 v2 = Pop().to_s128().to_i32x4();
int4 v1 = Pop().to_s128().to_i32x4();
int4 res;
for (size_t i = 0; i < 4; ++i) {
res.val[i] = v2.val[i] ^ ((v1.val[i] ^ v2.val[i]) & bool_val.val[i]);
}
Push(WasmValue(Simd128(res)));
return true;
}
#define ADD_HORIZ_CASE(op, name, stype, count) \
case kExpr##op: { \
WasmValue v2 = Pop(); \
WasmValue v1 = Pop(); \
stype s1 = v1.to_s128().to_##name(); \
stype s2 = v2.to_s128().to_##name(); \
stype res; \
for (size_t i = 0; i < count / 2; ++i) { \
res.val[LANE(i, s1)] = \
s1.val[LANE(i * 2, s1)] + s1.val[LANE(i * 2 + 1, s1)]; \
res.val[LANE(i + count / 2, s1)] = \
s2.val[LANE(i * 2, s1)] + s2.val[LANE(i * 2 + 1, s1)]; \
} \
Push(WasmValue(Simd128(res))); \
return true; \
}
ADD_HORIZ_CASE(I32x4AddHoriz, i32x4, int4, 4)
ADD_HORIZ_CASE(F32x4AddHoriz, f32x4, float4, 4)
ADD_HORIZ_CASE(I16x8AddHoriz, i16x8, int8, 8)
#undef ADD_HORIZ_CASE
case kExprS8x16Shuffle: {
Simd8x16ShuffleImmediate<Decoder::kNoValidate> imm(decoder,
code->at(pc));
*len += 16;
int16 v2 = Pop().to_s128().to_i8x16();
int16 v1 = Pop().to_s128().to_i8x16();
int16 res;
for (size_t i = 0; i < kSimd128Size; ++i) {
int lane = imm.shuffle[i];
res.val[LANE(i, v1)] = lane < kSimd128Size
? v1.val[LANE(lane, v1)]
: v2.val[LANE(lane - kSimd128Size, v1)];
}
Push(WasmValue(Simd128(res)));
return true;
}
case kExprS1x2AnyTrue:
case kExprS1x4AnyTrue:
case kExprS1x8AnyTrue:
case kExprS1x16AnyTrue: {
int4 s = Pop().to_s128().to_i32x4();
bool res = s.val[0] | s.val[1] | s.val[2] | s.val[3];
Push(WasmValue((res)));
return true;
}
#define REDUCTION_CASE(op, name, stype, count, operation) \
case kExpr##op: { \
stype s = Pop().to_s128().to_##name(); \
bool res = true; \
for (size_t i = 0; i < count; ++i) { \
res = res & static_cast<bool>(s.val[i]); \
} \
Push(WasmValue(res)); \
return true; \
}
REDUCTION_CASE(S1x2AllTrue, i64x2, int2, 2, &)
REDUCTION_CASE(S1x4AllTrue, i32x4, int4, 4, &)
REDUCTION_CASE(S1x8AllTrue, i16x8, int8, 8, &)
REDUCTION_CASE(S1x16AllTrue, i8x16, int16, 16, &)
#undef REDUCTION_CASE
default:
return false;
}
}
// Check if our control stack (frames_) exceeds the limit. Trigger stack
// overflow if it does, and unwinding the current frame.
// Returns true if execution can continue, false if the current activation was
// fully unwound.
// Do call this function immediately *after* pushing a new frame. The pc of
// the top frame will be reset to 0 if the stack check fails.
bool DoStackCheck() V8_WARN_UNUSED_RESULT {
// The goal of this stack check is not to prevent actual stack overflows,
// but to simulate stack overflows during the execution of compiled code.
// That is why this function uses FLAG_stack_size, even though the value
// stack actually lies in zone memory.
const size_t stack_size_limit = FLAG_stack_size * KB;
// Sum up the value stack size and the control stack size.
const size_t current_stack_size = (sp_ - stack_.get()) * sizeof(*sp_) +
frames_.size() * sizeof(frames_[0]);
if (V8_LIKELY(current_stack_size <= stack_size_limit)) {
return true;
}
// The pc of the top frame is initialized to the first instruction. We reset
// it to 0 here such that we report the same position as in compiled code.
frames_.back().pc = 0;
isolate_->StackOverflow();
return HandleException(isolate_) == WasmInterpreter::Thread::HANDLED;
}
void EncodeI32ExceptionValue(Handle<FixedArray> encoded_values,
uint32_t* encoded_index, uint32_t value) {
encoded_values->set((*encoded_index)++, Smi::FromInt(value >> 16));
encoded_values->set((*encoded_index)++, Smi::FromInt(value & 0xffff));
}
void EncodeI64ExceptionValue(Handle<FixedArray> encoded_values,
uint32_t* encoded_index, uint64_t value) {
EncodeI32ExceptionValue(encoded_values, encoded_index,
static_cast<uint32_t>(value >> 32));
EncodeI32ExceptionValue(encoded_values, encoded_index,
static_cast<uint32_t>(value));
}
// Allocate, initialize and throw a new exception. The exception values are
// being popped off the operand stack. Returns true if the exception is being
// handled locally by the interpreter, false otherwise (interpreter exits).
bool DoThrowException(const WasmException* exception,
uint32_t index) V8_WARN_UNUSED_RESULT {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<WasmExceptionTag> exception_tag(
WasmExceptionTag::cast(instance_object_->exceptions_table().get(index)),
isolate_);
uint32_t encoded_size = WasmExceptionPackage::GetEncodedSize(exception);
Handle<Object> exception_object =
WasmExceptionPackage::New(isolate_, exception_tag, encoded_size);
Handle<FixedArray> encoded_values = Handle<FixedArray>::cast(
WasmExceptionPackage::GetExceptionValues(isolate_, exception_object));
// Encode the exception values on the operand stack into the exception
// package allocated above. This encoding has to be in sync with other
// backends so that exceptions can be passed between them.
const WasmExceptionSig* sig = exception->sig;
uint32_t encoded_index = 0;
sp_t base_index = StackHeight() - sig->parameter_count();
for (size_t i = 0; i < sig->parameter_count(); ++i) {
WasmValue value = GetStackValue(base_index + i);
switch (sig->GetParam(i)) {
case kWasmI32: {
uint32_t u32 = value.to_u32();
EncodeI32ExceptionValue(encoded_values, &encoded_index, u32);
break;
}
case kWasmF32: {
uint32_t f32 = value.to_f32_boxed().get_bits();
EncodeI32ExceptionValue(encoded_values, &encoded_index, f32);
break;
}
case kWasmI64: {
uint64_t u64 = value.to_u64();
EncodeI64ExceptionValue(encoded_values, &encoded_index, u64);
break;
}
case kWasmF64: {
uint64_t f64 = value.to_f64_boxed().get_bits();
EncodeI64ExceptionValue(encoded_values, &encoded_index, f64);
break;
}
case kWasmS128: {
int4 s128 = value.to_s128().to_i32x4();
EncodeI32ExceptionValue(encoded_values, &encoded_index, s128.val[0]);
EncodeI32ExceptionValue(encoded_values, &encoded_index, s128.val[1]);
EncodeI32ExceptionValue(encoded_values, &encoded_index, s128.val[2]);
EncodeI32ExceptionValue(encoded_values, &encoded_index, s128.val[3]);
break;
}
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
Handle<Object> anyref = value.to_anyref();
encoded_values->set(encoded_index++, *anyref);
break;
}
default:
UNREACHABLE();
}
}
DCHECK_EQ(encoded_size, encoded_index);
Drop(static_cast<int>(sig->parameter_count()));
// Now that the exception is ready, set it as pending.
isolate_->Throw(*exception_object);
return HandleException(isolate_) == WasmInterpreter::Thread::HANDLED;
}
// Throw a given existing exception. Returns true if the exception is being
// handled locally by the interpreter, false otherwise (interpreter exits).
bool DoRethrowException(WasmValue exception) {
isolate_->ReThrow(*exception.to_anyref());
return HandleException(isolate_) == WasmInterpreter::Thread::HANDLED;
}
// Determines whether the given exception has a tag matching the expected tag
// for the given index within the exception table of the current instance.
bool MatchingExceptionTag(Handle<Object> exception_object, uint32_t index) {
Handle<Object> caught_tag =
WasmExceptionPackage::GetExceptionTag(isolate_, exception_object);
Handle<Object> expected_tag =
handle(instance_object_->exceptions_table().get(index), isolate_);
DCHECK(expected_tag->IsWasmExceptionTag());
return expected_tag.is_identical_to(caught_tag);
}
void DecodeI32ExceptionValue(Handle<FixedArray> encoded_values,
uint32_t* encoded_index, uint32_t* value) {
uint32_t msb = Smi::cast(encoded_values->get((*encoded_index)++)).value();
uint32_t lsb = Smi::cast(encoded_values->get((*encoded_index)++)).value();
*value = (msb << 16) | (lsb & 0xffff);
}
void DecodeI64ExceptionValue(Handle<FixedArray> encoded_values,
uint32_t* encoded_index, uint64_t* value) {
uint32_t lsb = 0, msb = 0;
DecodeI32ExceptionValue(encoded_values, encoded_index, &msb);
DecodeI32ExceptionValue(encoded_values, encoded_index, &lsb);
*value = (static_cast<uint64_t>(msb) << 32) | static_cast<uint64_t>(lsb);
}
// Unpack the values encoded in the given exception. The exception values are
// pushed onto the operand stack. Callers must perform a tag check to ensure
// the encoded values match the expected signature of the exception.
void DoUnpackException(const WasmException* exception,
Handle<Object> exception_object) {
Handle<FixedArray> encoded_values = Handle<FixedArray>::cast(
WasmExceptionPackage::GetExceptionValues(isolate_, exception_object));
// Decode the exception values from the given exception package and push
// them onto the operand stack. This encoding has to be in sync with other
// backends so that exceptions can be passed between them.
const WasmExceptionSig* sig = exception->sig;
uint32_t encoded_index = 0;
for (size_t i = 0; i < sig->parameter_count(); ++i) {
WasmValue value;
switch (sig->GetParam(i)) {
case kWasmI32: {
uint32_t u32 = 0;
DecodeI32ExceptionValue(encoded_values, &encoded_index, &u32);
value = WasmValue(u32);
break;
}
case kWasmF32: {
uint32_t f32_bits = 0;
DecodeI32ExceptionValue(encoded_values, &encoded_index, &f32_bits);
value = WasmValue(Float32::FromBits(f32_bits));
break;
}
case kWasmI64: {
uint64_t u64 = 0;
DecodeI64ExceptionValue(encoded_values, &encoded_index, &u64);
value = WasmValue(u64);
break;
}
case kWasmF64: {
uint64_t f64_bits = 0;
DecodeI64ExceptionValue(encoded_values, &encoded_index, &f64_bits);
value = WasmValue(Float64::FromBits(f64_bits));
break;
}
case kWasmS128: {
int4 s128 = {0, 0, 0, 0};
uint32_t* vals = reinterpret_cast<uint32_t*>(s128.val);
DecodeI32ExceptionValue(encoded_values, &encoded_index, &vals[0]);
DecodeI32ExceptionValue(encoded_values, &encoded_index, &vals[1]);
DecodeI32ExceptionValue(encoded_values, &encoded_index, &vals[2]);
DecodeI32ExceptionValue(encoded_values, &encoded_index, &vals[3]);
value = WasmValue(Simd128(s128));
break;
}
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
Handle<Object> anyref(encoded_values->get(encoded_index++), isolate_);
value = WasmValue(anyref);
break;
}
default:
UNREACHABLE();
}
Push(value);
}
DCHECK_EQ(WasmExceptionPackage::GetEncodedSize(exception), encoded_index);
}
void Execute(InterpreterCode* code, pc_t pc, int max) {
DCHECK_NOT_NULL(code->side_table);
DCHECK(!frames_.empty());
// There must be enough space on the stack to hold the arguments, locals,
// and the value stack.
DCHECK_LE(code->function->sig->parameter_count() +
code->locals.type_list.size() +
code->side_table->max_stack_height_,
stack_limit_ - stack_.get() - frames_.back().sp);
// Seal the surrounding {HandleScope} to ensure that all cases within the
// interpreter switch below which deal with handles open their own scope.
// This avoids leaking / accumulating handles in the surrounding scope.
SealHandleScope shs(isolate_);
Decoder decoder(code->start, code->end);
pc_t limit = code->end - code->start;
bool hit_break = false;
while (true) {
#define PAUSE_IF_BREAK_FLAG(flag) \
if (V8_UNLIKELY(break_flags_ & WasmInterpreter::BreakFlag::flag)) { \
hit_break = true; \
max = 0; \
}
DCHECK_GT(limit, pc);
DCHECK_NOT_NULL(code->start);
// Do first check for a breakpoint, in order to set hit_break correctly.
const char* skip = " ";
int len = 1;
byte orig = code->start[pc];
WasmOpcode opcode = static_cast<WasmOpcode>(orig);
if (WasmOpcodes::IsPrefixOpcode(opcode)) {
opcode = static_cast<WasmOpcode>(opcode << 8 | code->start[pc + 1]);
}
if (V8_UNLIKELY(orig == kInternalBreakpoint)) {
orig = code->orig_start[pc];
if (WasmOpcodes::IsPrefixOpcode(static_cast<WasmOpcode>(orig))) {
opcode =
static_cast<WasmOpcode>(orig << 8 | code->orig_start[pc + 1]);
}
if (SkipBreakpoint(code, pc)) {
// skip breakpoint by switching on original code.
skip = "[skip] ";
} else {
TRACE("@%-3zu: [break] %-24s:", pc, WasmOpcodes::OpcodeName(opcode));
TraceValueStack();
TRACE("\n");
hit_break = true;
break;
}
}
// If max is 0, break. If max is positive (a limit is set), decrement it.
if (max == 0) break;
if (max > 0) --max;
USE(skip);
TRACE("@%-3zu: %s%-24s:", pc, skip, WasmOpcodes::OpcodeName(opcode));
TraceValueStack();
TRACE("\n");
#ifdef DEBUG
// Compute the stack effect of this opcode, and verify later that the
// stack was modified accordingly.
std::pair<uint32_t, uint32_t> stack_effect =
StackEffect(codemap_->module(), frames_.back().code->function->sig,
code->orig_start + pc, code->orig_end);
sp_t expected_new_stack_height =
StackHeight() - stack_effect.first + stack_effect.second;
#endif
switch (orig) {
case kExprNop:
break;
case kExprBlock:
case kExprLoop:
case kExprTry: {
BlockTypeImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures,
&decoder, code->at(pc));
len = 1 + imm.length;
break;
}
case kExprIf: {
BlockTypeImmediate<Decoder::kNoValidate> imm(kAllWasmFeatures,
&decoder, code->at(pc));
WasmValue cond = Pop();
bool is_true = cond.to<uint32_t>() != 0;
if (is_true) {
// fall through to the true block.
len = 1 + imm.length;
TRACE(" true => fallthrough\n");
} else {
len = LookupTargetDelta(code, pc);
TRACE(" false => @%zu\n", pc + len);
}
break;
}
case kExprElse:
case kExprCatch: {
len = LookupTargetDelta(code, pc);
TRACE(" end => @%zu\n", pc + len);
break;
}
case kExprThrow: {
ExceptionIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
CommitPc(pc); // Needed for local unwinding.
const WasmException* exception = &module()->exceptions[imm.index];
if (!DoThrowException(exception, imm.index)) return;
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
continue; // Do not bump pc.
}
case kExprRethrow: {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
WasmValue ex = Pop();
CommitPc(pc); // Needed for local unwinding.
if (!DoRethrowException(ex)) return;
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
continue; // Do not bump pc.
}
case kExprBrOnExn: {
BranchOnExceptionImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
HandleScope handle_scope(isolate_); // Avoid leaking handles.
WasmValue ex = Pop();
Handle<Object> exception = ex.to_anyref();
if (MatchingExceptionTag(exception, imm.index.index)) {
imm.index.exception = &module()->exceptions[imm.index.index];
DoUnpackException(imm.index.exception, exception);
len = DoBreak(code, pc, imm.depth.depth);
TRACE(" match => @%zu\n", pc + len);
} else {
Push(ex); // Exception remains on stack.
TRACE(" false => fallthrough\n");
len = 1 + imm.length;
}
break;
}
case kExprSelectWithType: {
SelectTypeImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
len = 1 + imm.length;
V8_FALLTHROUGH;
}
case kExprSelect: {
WasmValue cond = Pop();
WasmValue fval = Pop();
WasmValue tval = Pop();
Push(cond.to<int32_t>() != 0 ? tval : fval);
break;
}
case kExprBr: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
len = DoBreak(code, pc, imm.depth);
TRACE(" br => @%zu\n", pc + len);
break;
}
case kExprBrIf: {
BranchDepthImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
WasmValue cond = Pop();
bool is_true = cond.to<uint32_t>() != 0;
if (is_true) {
len = DoBreak(code, pc, imm.depth);
TRACE(" br_if => @%zu\n", pc + len);
} else {
TRACE(" false => fallthrough\n");
len = 1 + imm.length;
}
break;
}
case kExprBrTable: {
BranchTableImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
BranchTableIterator<Decoder::kNoValidate> iterator(&decoder, imm);
uint32_t key = Pop().to<uint32_t>();
uint32_t depth = 0;
if (key >= imm.table_count) key = imm.table_count;
for (uint32_t i = 0; i <= key; i++) {
DCHECK(iterator.has_next());
depth = iterator.next();
}
len = key + DoBreak(code, pc + key, static_cast<size_t>(depth));
TRACE(" br[%u] => @%zu\n", key, pc + key + len);
break;
}
case kExprReturn: {
size_t arity = code->function->sig->return_count();
if (!DoReturn(&decoder, &code, &pc, &limit, arity)) return;
PAUSE_IF_BREAK_FLAG(AfterReturn);
continue; // Do not bump pc.
}
case kExprUnreachable: {
return DoTrap(kTrapUnreachable, pc);
}
case kExprEnd: {
break;
}
case kExprI32Const: {
ImmI32Immediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
Push(WasmValue(imm.value));
len = 1 + imm.length;
break;
}
case kExprI64Const: {
ImmI64Immediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
Push(WasmValue(imm.value));
len = 1 + imm.length;
break;
}
case kExprF32Const: {
ImmF32Immediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
Push(WasmValue(imm.value));
len = 1 + imm.length;
break;
}
case kExprF64Const: {
ImmF64Immediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
Push(WasmValue(imm.value));
len = 1 + imm.length;
break;
}
case kExprRefNull: {
Push(WasmValue(isolate_->factory()->null_value()));
break;
}
case kExprRefFunc: {
FunctionIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<WasmExternalFunction> function =
WasmInstanceObject::GetOrCreateWasmExternalFunction(
isolate_, instance_object_, imm.index);
Push(WasmValue(function));
len = 1 + imm.length;
break;
}
case kExprGetLocal: {
LocalIndexImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Push(GetStackValue(frames_.back().sp + imm.index));
len = 1 + imm.length;
break;
}
case kExprSetLocal: {
LocalIndexImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
HandleScope handle_scope(isolate_); // Avoid leaking handles.
WasmValue val = Pop();
SetStackValue(frames_.back().sp + imm.index, val);
len = 1 + imm.length;
break;
}
case kExprTeeLocal: {
LocalIndexImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
HandleScope handle_scope(isolate_); // Avoid leaking handles.
WasmValue val = Pop();
SetStackValue(frames_.back().sp + imm.index, val);
Push(val);
len = 1 + imm.length;
break;
}
case kExprDrop: {
Drop();
break;
}
case kExprCallFunction: {
CallFunctionImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
InterpreterCode* target = codemap()->GetCode(imm.index);
if (target->function->imported) {
CommitPc(pc);
ExternalCallResult result =
CallImportedFunction(target->function->func_index);
switch (result.type) {
case ExternalCallResult::INTERNAL:
// The import is a function of this instance. Call it directly.
DCHECK(!result.interpreter_code->function->imported);
break;
case ExternalCallResult::INVALID_FUNC:
case ExternalCallResult::SIGNATURE_MISMATCH:
// Direct calls are checked statically.
UNREACHABLE();
case ExternalCallResult::EXTERNAL_RETURNED:
PAUSE_IF_BREAK_FLAG(AfterCall);
len = 1 + imm.length;
break;
case ExternalCallResult::EXTERNAL_UNWOUND:
return;
case ExternalCallResult::EXTERNAL_CAUGHT:
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
continue; // Do not bump pc.
}
if (result.type != ExternalCallResult::INTERNAL) break;
}
// Execute an internal call.
if (!DoCall(&decoder, target, &pc, &limit)) return;
code = target;
PAUSE_IF_BREAK_FLAG(AfterCall);
continue; // Do not bump pc.
} break;
case kExprCallIndirect: {
CallIndirectImmediate<Decoder::kNoValidate> imm(
kAllWasmFeatures, &decoder, code->at(pc));
uint32_t entry_index = Pop().to<uint32_t>();
CommitPc(pc); // TODO(wasm): Be more disciplined about committing PC.
ExternalCallResult result =
CallIndirectFunction(imm.table_index, entry_index, imm.sig_index);
switch (result.type) {
case ExternalCallResult::INTERNAL:
// The import is a function of this instance. Call it directly.
if (!DoCall(&decoder, result.interpreter_code, &pc, &limit))
return;
code = result.interpreter_code;
PAUSE_IF_BREAK_FLAG(AfterCall);
continue; // Do not bump pc.
case ExternalCallResult::INVALID_FUNC:
return DoTrap(kTrapFuncInvalid, pc);
case ExternalCallResult::SIGNATURE_MISMATCH:
return DoTrap(kTrapFuncSigMismatch, pc);
case ExternalCallResult::EXTERNAL_RETURNED:
PAUSE_IF_BREAK_FLAG(AfterCall);
len = 1 + imm.length;
break;
case ExternalCallResult::EXTERNAL_UNWOUND:
return;
case ExternalCallResult::EXTERNAL_CAUGHT:
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
continue; // Do not bump pc.
}
} break;
case kExprReturnCall: {
CallFunctionImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
InterpreterCode* target = codemap()->GetCode(imm.index);
if (!target->function->imported) {
// Enter internal found function.
if (!DoReturnCall(&decoder, target, &pc, &limit)) return;
code = target;
PAUSE_IF_BREAK_FLAG(AfterCall);
continue; // Do not bump pc.
}
// Function is imported.
CommitPc(pc);
ExternalCallResult result =
CallImportedFunction(target->function->func_index);
switch (result.type) {
case ExternalCallResult::INTERNAL:
// Cannot import internal functions.
case ExternalCallResult::INVALID_FUNC:
case ExternalCallResult::SIGNATURE_MISMATCH:
// Direct calls are checked statically.
UNREACHABLE();
case ExternalCallResult::EXTERNAL_RETURNED:
len = 1 + imm.length;
break;
case ExternalCallResult::EXTERNAL_UNWOUND:
return;
case ExternalCallResult::EXTERNAL_CAUGHT:
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
continue;
}
size_t arity = code->function->sig->return_count();
if (!DoReturn(&decoder, &code, &pc, &limit, arity)) return;
PAUSE_IF_BREAK_FLAG(AfterReturn);
continue;
} break;
case kExprReturnCallIndirect: {
CallIndirectImmediate<Decoder::kNoValidate> imm(
kAllWasmFeatures, &decoder, code->at(pc));
uint32_t entry_index = Pop().to<uint32_t>();
CommitPc(pc); // TODO(wasm): Be more disciplined about committing PC.
// TODO(wasm): Calling functions needs some refactoring to avoid
// multi-exit code like this.
ExternalCallResult result =
CallIndirectFunction(imm.table_index, entry_index, imm.sig_index);
switch (result.type) {
case ExternalCallResult::INTERNAL: {
InterpreterCode* target = result.interpreter_code;
DCHECK(!target->function->imported);
// The function belongs to this instance. Enter it directly.
if (!DoReturnCall(&decoder, target, &pc, &limit)) return;
code = result.interpreter_code;
PAUSE_IF_BREAK_FLAG(AfterCall);
continue; // Do not bump pc.
}
case ExternalCallResult::INVALID_FUNC:
return DoTrap(kTrapFuncInvalid, pc);
case ExternalCallResult::SIGNATURE_MISMATCH:
return DoTrap(kTrapFuncSigMismatch, pc);
case ExternalCallResult::EXTERNAL_RETURNED: {
len = 1 + imm.length;
size_t arity = code->function->sig->return_count();
if (!DoReturn(&decoder, &code, &pc, &limit, arity)) return;
PAUSE_IF_BREAK_FLAG(AfterCall);
break;
}
case ExternalCallResult::EXTERNAL_UNWOUND:
return;
case ExternalCallResult::EXTERNAL_CAUGHT:
ReloadFromFrameOnException(&decoder, &code, &pc, &limit);
break;
}
} break;
case kExprGetGlobal: {
GlobalIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
HandleScope handle_scope(isolate_);
Push(GetGlobalValue(imm.index));
len = 1 + imm.length;
break;
}
case kExprSetGlobal: {
GlobalIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
const WasmGlobal* global = &module()->globals[imm.index];
switch (global->type) {
#define CASE_TYPE(wasm, ctype) \
case kWasm##wasm: { \
byte* ptr = GetGlobalPtr(global); \
WriteLittleEndianValue<ctype>(reinterpret_cast<Address>(ptr), \
Pop().to<ctype>()); \
break; \
}
WASM_CTYPES(CASE_TYPE)
#undef CASE_TYPE
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<FixedArray> global_buffer; // The buffer of the global.
uint32_t global_index = 0; // The index into the buffer.
GetGlobalBufferAndIndex(global, &global_buffer, &global_index);
global_buffer->set(global_index, *Pop().to_anyref());
break;
}
default:
UNREACHABLE();
}
len = 1 + imm.length;
break;
}
case kExprTableGet: {
TableIndexImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
HandleScope handle_scope(isolate_);
auto table = handle(
WasmTableObject::cast(instance_object_->tables().get(imm.index)),
isolate_);
uint32_t table_size = table->current_length();
uint32_t entry_index = Pop().to<uint32_t>();
if (entry_index >= table_size) {
return DoTrap(kTrapTableOutOfBounds, pc);
}
Handle<Object> value =
WasmTableObject::Get(isolate_, table, entry_index);
Push(WasmValue(value));
len = 1 + imm.length;
break;
}
case kExprTableSet: {
TableIndexImmediate<Decoder::kNoValidate> imm(&decoder, code->at(pc));
HandleScope handle_scope(isolate_);
auto table = handle(
WasmTableObject::cast(instance_object_->tables().get(imm.index)),
isolate_);
uint32_t table_size = table->current_length();
Handle<Object> value = Pop().to_anyref();
uint32_t entry_index = Pop().to<uint32_t>();
if (entry_index >= table_size) {
return DoTrap(kTrapTableOutOfBounds, pc);
}
WasmTableObject::Set(isolate_, table, entry_index, value);
len = 1 + imm.length;
break;
}
#define LOAD_CASE(name, ctype, mtype, rep) \
case kExpr##name: { \
if (!ExecuteLoad<ctype, mtype>(&decoder, code, pc, &len, \
MachineRepresentation::rep)) \
return; \
break; \
}
LOAD_CASE(I32LoadMem8S, int32_t, int8_t, kWord8);
LOAD_CASE(I32LoadMem8U, int32_t, uint8_t, kWord8);
LOAD_CASE(I32LoadMem16S, int32_t, int16_t, kWord16);
LOAD_CASE(I32LoadMem16U, int32_t, uint16_t, kWord16);
LOAD_CASE(I64LoadMem8S, int64_t, int8_t, kWord8);
LOAD_CASE(I64LoadMem8U, int64_t, uint8_t, kWord16);
LOAD_CASE(I64LoadMem16S, int64_t, int16_t, kWord16);
LOAD_CASE(I64LoadMem16U, int64_t, uint16_t, kWord16);
LOAD_CASE(I64LoadMem32S, int64_t, int32_t, kWord32);
LOAD_CASE(I64LoadMem32U, int64_t, uint32_t, kWord32);
LOAD_CASE(I32LoadMem, int32_t, int32_t, kWord32);
LOAD_CASE(I64LoadMem, int64_t, int64_t, kWord64);
LOAD_CASE(F32LoadMem, Float32, uint32_t, kFloat32);
LOAD_CASE(F64LoadMem, Float64, uint64_t, kFloat64);
#undef LOAD_CASE
#define STORE_CASE(name, ctype, mtype, rep) \
case kExpr##name: { \
if (!ExecuteStore<ctype, mtype>(&decoder, code, pc, &len, \
MachineRepresentation::rep)) \
return; \
break; \
}
STORE_CASE(I32StoreMem8, int32_t, int8_t, kWord8);
STORE_CASE(I32StoreMem16, int32_t, int16_t, kWord16);
STORE_CASE(I64StoreMem8, int64_t, int8_t, kWord8);
STORE_CASE(I64StoreMem16, int64_t, int16_t, kWord16);
STORE_CASE(I64StoreMem32, int64_t, int32_t, kWord32);
STORE_CASE(I32StoreMem, int32_t, int32_t, kWord32);
STORE_CASE(I64StoreMem, int64_t, int64_t, kWord64);
STORE_CASE(F32StoreMem, Float32, uint32_t, kFloat32);
STORE_CASE(F64StoreMem, Float64, uint64_t, kFloat64);
#undef STORE_CASE
#define ASMJS_LOAD_CASE(name, ctype, mtype, defval) \
case kExpr##name: { \
uint32_t index = Pop().to<uint32_t>(); \
ctype result; \
Address addr = BoundsCheckMem<mtype>(0, index); \
if (!addr) { \
result = defval; \
} else { \
/* TODO(titzer): alignment for asmjs load mem? */ \
result = static_cast<ctype>(*reinterpret_cast<mtype*>(addr)); \
} \
Push(WasmValue(result)); \
break; \
}
ASMJS_LOAD_CASE(I32AsmjsLoadMem8S, int32_t, int8_t, 0);
ASMJS_LOAD_CASE(I32AsmjsLoadMem8U, int32_t, uint8_t, 0);
ASMJS_LOAD_CASE(I32AsmjsLoadMem16S, int32_t, int16_t, 0);
ASMJS_LOAD_CASE(I32AsmjsLoadMem16U, int32_t, uint16_t, 0);
ASMJS_LOAD_CASE(I32AsmjsLoadMem, int32_t, int32_t, 0);
ASMJS_LOAD_CASE(F32AsmjsLoadMem, float, float,
std::numeric_limits<float>::quiet_NaN());
ASMJS_LOAD_CASE(F64AsmjsLoadMem, double, double,
std::numeric_limits<double>::quiet_NaN());
#undef ASMJS_LOAD_CASE
#define ASMJS_STORE_CASE(name, ctype, mtype) \
case kExpr##name: { \
WasmValue val = Pop(); \
uint32_t index = Pop().to<uint32_t>(); \
Address addr = BoundsCheckMem<mtype>(0, index); \
if (addr) { \
*(reinterpret_cast<mtype*>(addr)) = static_cast<mtype>(val.to<ctype>()); \
} \
Push(val); \
break; \
}
ASMJS_STORE_CASE(I32AsmjsStoreMem8, int32_t, int8_t);
ASMJS_STORE_CASE(I32AsmjsStoreMem16, int32_t, int16_t);
ASMJS_STORE_CASE(I32AsmjsStoreMem, int32_t, int32_t);
ASMJS_STORE_CASE(F32AsmjsStoreMem, float, float);
ASMJS_STORE_CASE(F64AsmjsStoreMem, double, double);
#undef ASMJS_STORE_CASE
case kExprMemoryGrow: {
MemoryIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
uint32_t delta_pages = Pop().to<uint32_t>();
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<WasmMemoryObject> memory(instance_object_->memory_object(),
isolate_);
int32_t result =
WasmMemoryObject::Grow(isolate_, memory, delta_pages);
Push(WasmValue(result));
len = 1 + imm.length;
// Treat one grow_memory instruction like 1000 other instructions,
// because it is a really expensive operation.
if (max > 0) max = std::max(0, max - 1000);
break;
}
case kExprMemorySize: {
MemoryIndexImmediate<Decoder::kNoValidate> imm(&decoder,
code->at(pc));
Push(WasmValue(static_cast<uint32_t>(instance_object_->memory_size() /
kWasmPageSize)));
len = 1 + imm.length;
break;
}
// We need to treat kExprI32ReinterpretF32 and kExprI64ReinterpretF64
// specially to guarantee that the quiet bit of a NaN is preserved on
// ia32 by the reinterpret casts.
case kExprI32ReinterpretF32: {
WasmValue val = Pop();
Push(WasmValue(ExecuteI32ReinterpretF32(val)));
break;
}
case kExprI64ReinterpretF64: {
WasmValue val = Pop();
Push(WasmValue(ExecuteI64ReinterpretF64(val)));
break;
}
#define SIGN_EXTENSION_CASE(name, wtype, ntype) \
case kExpr##name: { \
ntype val = static_cast<ntype>(Pop().to<wtype>()); \
Push(WasmValue(static_cast<wtype>(val))); \
break; \
}
SIGN_EXTENSION_CASE(I32SExtendI8, int32_t, int8_t);
SIGN_EXTENSION_CASE(I32SExtendI16, int32_t, int16_t);
SIGN_EXTENSION_CASE(I64SExtendI8, int64_t, int8_t);
SIGN_EXTENSION_CASE(I64SExtendI16, int64_t, int16_t);
SIGN_EXTENSION_CASE(I64SExtendI32, int64_t, int32_t);
#undef SIGN_EXTENSION_CASE
case kExprRefIsNull: {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
uint32_t result = Pop().to_anyref()->IsNull() ? 1 : 0;
Push(WasmValue(result));
break;
}
case kNumericPrefix: {
++len;
if (!ExecuteNumericOp(opcode, &decoder, code, pc, &len)) return;
break;
}
case kAtomicPrefix: {
if (!ExecuteAtomicOp(opcode, &decoder, code, pc, &len)) return;
break;
}
case kSimdPrefix: {
++len;
if (!ExecuteSimdOp(opcode, &decoder, code, pc, &len)) return;
break;
}
#define EXECUTE_SIMPLE_BINOP(name, ctype, op) \
case kExpr##name: { \
WasmValue rval = Pop(); \
WasmValue lval = Pop(); \
auto result = lval.to<ctype>() op rval.to<ctype>(); \
possible_nondeterminism_ |= has_nondeterminism(result); \
Push(WasmValue(result)); \
break; \
}
FOREACH_SIMPLE_BINOP(EXECUTE_SIMPLE_BINOP)
#undef EXECUTE_SIMPLE_BINOP
#define EXECUTE_OTHER_BINOP(name, ctype) \
case kExpr##name: { \
TrapReason trap = kTrapCount; \
ctype rval = Pop().to<ctype>(); \
ctype lval = Pop().to<ctype>(); \
auto result = Execute##name(lval, rval, &trap); \
possible_nondeterminism_ |= has_nondeterminism(result); \
if (trap != kTrapCount) return DoTrap(trap, pc); \
Push(WasmValue(result)); \
break; \
}
FOREACH_OTHER_BINOP(EXECUTE_OTHER_BINOP)
#undef EXECUTE_OTHER_BINOP
#define EXECUTE_UNOP(name, ctype, exec_fn) \
case kExpr##name: { \
TrapReason trap = kTrapCount; \
ctype val = Pop().to<ctype>(); \
auto result = exec_fn(val, &trap); \
possible_nondeterminism_ |= has_nondeterminism(result); \
if (trap != kTrapCount) return DoTrap(trap, pc); \
Push(WasmValue(result)); \
break; \
}
#define EXECUTE_OTHER_UNOP(name, ctype) EXECUTE_UNOP(name, ctype, Execute##name)
FOREACH_OTHER_UNOP(EXECUTE_OTHER_UNOP)
#undef EXECUTE_OTHER_UNOP
#define EXECUTE_I32CONV_FLOATOP(name, out_type, in_type) \
EXECUTE_UNOP(name, in_type, ExecuteConvert<out_type>)
FOREACH_I32CONV_FLOATOP(EXECUTE_I32CONV_FLOATOP)
#undef EXECUTE_I32CONV_FLOATOP
#undef EXECUTE_UNOP
default:
FATAL("Unknown or unimplemented opcode #%d:%s", code->start[pc],
OpcodeName(code->start[pc]));
UNREACHABLE();
}
#ifdef DEBUG
if (!WasmOpcodes::IsControlOpcode(opcode)) {
DCHECK_EQ(expected_new_stack_height, StackHeight());
}
#endif
pc += len;
if (pc == limit) {
// Fell off end of code; do an implicit return.
TRACE("@%-3zu: ImplicitReturn\n", pc);
size_t arity = code->function->sig->return_count();
DCHECK_EQ(StackHeight() - arity, frames_.back().llimit());
if (!DoReturn(&decoder, &code, &pc, &limit, arity)) return;
PAUSE_IF_BREAK_FLAG(AfterReturn);
}
#undef PAUSE_IF_BREAK_FLAG
}
state_ = WasmInterpreter::PAUSED;
break_pc_ = hit_break ? pc : kInvalidPc;
CommitPc(pc);
}
WasmValue Pop() {
DCHECK_GT(frames_.size(), 0);
DCHECK_GT(StackHeight(), frames_.back().llimit()); // can't pop into locals
StackValue stack_value = *--sp_;
// Note that {StackHeight} depends on the current {sp} value, hence this
// operation is split into two statements to ensure proper evaluation order.
WasmValue val = stack_value.ExtractValue(this, StackHeight());
stack_value.ClearValue(this, StackHeight());
return val;
}
void Drop(int n = 1) {
DCHECK_GE(StackHeight(), n);
DCHECK_GT(frames_.size(), 0);
// Check that we don't pop into locals.
DCHECK_GE(StackHeight() - n, frames_.back().llimit());
StackValue::ClearValues(this, StackHeight() - n, n);
sp_ -= n;
}
WasmValue PopArity(size_t arity) {
if (arity == 0) return WasmValue();
CHECK_EQ(1, arity);
return Pop();
}
void Push(WasmValue val) {
DCHECK_NE(kWasmStmt, val.type());
DCHECK_LE(1, stack_limit_ - sp_);
DCHECK(StackValue::IsClearedValue(this, StackHeight()));
StackValue stack_value(val, this, StackHeight());
// Note that {StackHeight} depends on the current {sp} value, hence this
// operation is split into two statements to ensure proper evaluation order.
*sp_++ = stack_value;
}
void Push(WasmValue* vals, size_t arity) {
DCHECK_LE(arity, stack_limit_ - sp_);
for (WasmValue *val = vals, *end = vals + arity; val != end; ++val) {
DCHECK_NE(kWasmStmt, val->type());
Push(*val);
}
}
void ResetStack(sp_t new_height) {
DCHECK_LE(new_height, StackHeight()); // Only allowed to shrink.
int count = static_cast<int>(StackHeight() - new_height);
StackValue::ClearValues(this, new_height, count);
sp_ = stack_.get() + new_height;
}
void EnsureStackSpace(size_t size) {
if (V8_LIKELY(static_cast<size_t>(stack_limit_ - sp_) >= size)) return;
size_t old_size = stack_limit_ - stack_.get();
size_t requested_size =
base::bits::RoundUpToPowerOfTwo64((sp_ - stack_.get()) + size);
size_t new_size = Max(size_t{8}, Max(2 * old_size, requested_size));
std::unique_ptr<StackValue[]> new_stack(new StackValue[new_size]);
if (old_size > 0) {
memcpy(new_stack.get(), stack_.get(), old_size * sizeof(*sp_));
}
sp_ = new_stack.get() + (sp_ - stack_.get());
stack_ = std::move(new_stack);
stack_limit_ = stack_.get() + new_size;
// Also resize the reference stack to the same size.
int grow_by = static_cast<int>(new_size - old_size);
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Handle<FixedArray> old_ref_stack(reference_stack(), isolate_);
Handle<FixedArray> new_ref_stack =
isolate_->factory()->CopyFixedArrayAndGrow(old_ref_stack, grow_by);
new_ref_stack->FillWithHoles(static_cast<int>(old_size),
static_cast<int>(new_size));
reference_stack_cell_->set_value(*new_ref_stack);
}
sp_t StackHeight() { return sp_ - stack_.get(); }
void TraceValueStack() {
#ifdef DEBUG
if (!FLAG_trace_wasm_interpreter) return;
HandleScope handle_scope(isolate_); // Avoid leaking handles.
Frame* top = frames_.size() > 0 ? &frames_.back() : nullptr;
sp_t sp = top ? top->sp : 0;
sp_t plimit = top ? top->plimit() : 0;
sp_t llimit = top ? top->llimit() : 0;
for (size_t i = sp; i < StackHeight(); ++i) {
if (i < plimit)
PrintF(" p%zu:", i);
else if (i < llimit)
PrintF(" l%zu:", i);
else
PrintF(" s%zu:", i);
WasmValue val = GetStackValue(i);
switch (val.type()) {
case kWasmI32:
PrintF("i32:%d", val.to<int32_t>());
break;
case kWasmI64:
PrintF("i64:%" PRId64 "", val.to<int64_t>());
break;
case kWasmF32:
PrintF("f32:%f", val.to<float>());
break;
case kWasmF64:
PrintF("f64:%lf", val.to<double>());
break;
case kWasmS128: {
// This defaults to tracing all S128 values as i32x4 values for now,
// when there is more state to know what type of values are on the
// stack, the right format should be printed here.
int4 s = val.to_s128().to_i32x4();
PrintF("i32x4:%d,%d,%d,%d", s.val[0], s.val[1], s.val[2], s.val[3]);
break;
}
case kWasmAnyRef: {
Handle<Object> ref = val.to_anyref();
if (ref->IsNull()) {
PrintF("ref:null");
} else {
PrintF("ref:0x%" V8PRIxPTR, ref->ptr());
}
break;
}
case kWasmStmt:
PrintF("void");
break;
default:
UNREACHABLE();
break;
}
}
#endif // DEBUG
}
ExternalCallResult TryHandleException(Isolate* isolate) {
DCHECK(isolate->has_pending_exception()); // Assume exceptional return.
if (HandleException(isolate) == WasmInterpreter::Thread::UNWOUND) {
return {ExternalCallResult::EXTERNAL_UNWOUND};
}
return {ExternalCallResult::EXTERNAL_CAUGHT};
}
ExternalCallResult CallExternalWasmFunction(Isolate* isolate,
Handle<Object> object_ref,
const WasmCode* code,
FunctionSig* sig) {
int num_args = static_cast<int>(sig->parameter_count());
WasmFeatures enabled_features = WasmFeaturesFromIsolate(isolate);
if (code->kind() == WasmCode::kWasmToJsWrapper &&
!IsJSCompatibleSignature(sig, enabled_features)) {
Drop(num_args); // Pop arguments before throwing.
isolate->Throw(*isolate->factory()->NewTypeError(
MessageTemplate::kWasmTrapTypeError));
return TryHandleException(isolate);
}
Handle<WasmDebugInfo> debug_info(instance_object_->debug_info(), isolate);
Handle<Code> wasm_entry = WasmDebugInfo::GetCWasmEntry(debug_info, sig);
TRACE(" => Calling external wasm function\n");
// Copy the arguments to one buffer.
CWasmArgumentsPacker packer(CWasmArgumentsPacker::TotalSize(sig));
sp_t base_index = StackHeight() - num_args;
for (int i = 0; i < num_args; ++i) {
WasmValue arg = GetStackValue(base_index + i);
switch (sig->GetParam(i)) {
case kWasmI32:
packer.Push(arg.to<uint32_t>());
break;
case kWasmI64:
packer.Push(arg.to<uint64_t>());
break;
case kWasmF32:
packer.Push(arg.to<float>());
break;
case kWasmF64:
packer.Push(arg.to<double>());
break;
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef:
packer.Push(arg.to_anyref()->ptr());
break;
default:
UNIMPLEMENTED();
}
}
Address call_target = code->instruction_start();
Execution::CallWasm(isolate, wasm_entry, call_target, object_ref,
packer.argv());
TRACE(" => External wasm function returned%s\n",
isolate->has_pending_exception() ? " with exception" : "");
// Pop arguments off the stack.
Drop(num_args);
if (isolate->has_pending_exception()) {
return TryHandleException(isolate);
}
// Push return values.
packer.Reset();
for (size_t i = 0; i < sig->return_count(); i++) {
switch (sig->GetReturn(i)) {
case kWasmI32:
Push(WasmValue(packer.Pop<uint32_t>()));
break;
case kWasmI64:
Push(WasmValue(packer.Pop<uint64_t>()));
break;
case kWasmF32:
Push(WasmValue(packer.Pop<float>()));
break;
case kWasmF64:
Push(WasmValue(packer.Pop<double>()));
break;
case kWasmAnyRef:
case kWasmFuncRef:
case kWasmExnRef: {
Handle<Object> ref(Object(packer.Pop<Address>()), isolate);
Push(WasmValue(ref));
break;
}
default:
UNIMPLEMENTED();
}
}
return {ExternalCallResult::EXTERNAL_RETURNED};
}
static WasmCode* GetTargetCode(Isolate* isolate, Address target) {
WasmCodeManager* code_manager = isolate->wasm_engine()->code_manager();
NativeModule* native_module = code_manager->LookupNativeModule(target);
if (native_module->is_jump_table_slot(target)) {
uint32_t func_index =
native_module->GetFunctionIndexFromJumpTableSlot(target);
if (!native_module->HasCode(func_index)) {
bool success = CompileLazy(isolate, native_module, func_index);
if (!success) {
DCHECK(isolate->has_pending_exception());
return nullptr;
}
}
return native_module->GetCode(func_index);
}
WasmCode* code = native_module->Lookup(target);
DCHECK_EQ(code->instruction_start(), target);
return code;
}
ExternalCallResult CallImportedFunction(uint32_t function_index) {
DCHECK_GT(module()->num_imported_functions, function_index);
HandleScope handle_scope(isolate_); // Avoid leaking handles.
ImportedFunctionEntry entry(instance_object_, function_index);
Handle<Object> object_ref(entry.object_ref(), isolate_);
WasmCode* code = GetTargetCode(isolate_, entry.target());
// In case a function's body is invalid and the function is lazily validated
// and compiled we may get an exception.
if (code == nullptr) return TryHandleException(isolate_);
FunctionSig* sig = module()->functions[function_index].sig;
return CallExternalWasmFunction(isolate_, object_ref, code, sig);
}
ExternalCallResult CallIndirectFunction(uint32_t table_index,
uint32_t entry_index,
uint32_t sig_index) {
HandleScope handle_scope(isolate_); // Avoid leaking handles.
uint32_t expected_sig_id = module()->signature_ids[sig_index];
DCHECK_EQ(expected_sig_id,
module()->signature_map.Find(*module()->signatures[sig_index]));
// Bounds check against table size.
if (entry_index >=
static_cast<uint32_t>(WasmInstanceObject::IndirectFunctionTableSize(
isolate_, instance_object_, table_index))) {
return {ExternalCallResult::INVALID_FUNC};
}
IndirectFunctionTableEntry entry(instance_object_, table_index,
entry_index);
// Signature check.
if (entry.sig_id() != static_cast<int32_t>(expected_sig_id)) {
return {ExternalCallResult::SIGNATURE_MISMATCH};
}
FunctionSig* signature = module()->signatures[sig_index];
Handle<Object> object_ref = handle(entry.object_ref(), isolate_);
WasmCode* code = GetTargetCode(isolate_, entry.target());
// In case a function's body is invalid and the function is lazily validated
// and compiled we may get an exception.
if (code == nullptr) return TryHandleException(isolate_);
if (!object_ref->IsWasmInstanceObject() || /* call to an import */
!instance_object_.is_identical_to(object_ref) /* cross-instance */) {
return CallExternalWasmFunction(isolate_, object_ref, code, signature);
}
DCHECK(code->kind() == WasmCode::kInterpreterEntry ||
code->kind() == WasmCode::kFunction);
return {ExternalCallResult::INTERNAL, codemap()->GetCode(code->index())};
}
inline Activation current_activation() {
return activations_.empty() ? Activation(0, 0) : activations_.back();
}
};
class InterpretedFrameImpl {
public:
InterpretedFrameImpl(ThreadImpl* thread, int index)
: thread_(thread), index_(index) {
DCHECK_LE(0, index);
}
const WasmFunction* function() const { return frame()->code->function; }
int pc() const {
DCHECK_LE(0, frame()->pc);
DCHECK_GE(kMaxInt, frame()->pc);
return static_cast<int>(frame()->pc);
}
int GetParameterCount() const {
DCHECK_GE(kMaxInt, function()->sig->parameter_count());
return static_cast<int>(function()->sig->parameter_count());
}
int GetLocalCount() const {
size_t num_locals = function()->sig->parameter_count() +
frame()->code->locals.type_list.size();
DCHECK_GE(kMaxInt, num_locals);
return static_cast<int>(num_locals);
}
int GetStackHeight() const {
bool is_top_frame =
static_cast<size_t>(index_) + 1 == thread_->frames_.size();
size_t stack_limit =
is_top_frame ? thread_->StackHeight() : thread_->frames_[index_ + 1].sp;
DCHECK_LE(frame()->sp, stack_limit);
size_t frame_size = stack_limit - frame()->sp;
DCHECK_LE(GetLocalCount(), frame_size);
return static_cast<int>(frame_size) - GetLocalCount();
}
WasmValue GetLocalValue(int index) const {
DCHECK_LE(0, index);
DCHECK_GT(GetLocalCount(), index);
return thread_->GetStackValue(static_cast<int>(frame()->sp) + index);
}
WasmValue GetStackValue(int index) const {
DCHECK_LE(0, index);
// Index must be within the number of stack values of this frame.
DCHECK_GT(GetStackHeight(), index);
return thread_->GetStackValue(static_cast<int>(frame()->sp) +
GetLocalCount() + index);
}
private:
ThreadImpl* thread_;
int index_;
ThreadImpl::Frame* frame() const {
DCHECK_GT(thread_->frames_.size(), index_);
return &thread_->frames_[index_];
}
};
namespace {
// Converters between WasmInterpreter::Thread and WasmInterpreter::ThreadImpl.
// Thread* is the public interface, without knowledge of the object layout.
// This cast is potentially risky, but as long as we always cast it back before
// accessing any data, it should be fine. UBSan is not complaining.
WasmInterpreter::Thread* ToThread(ThreadImpl* impl) {
return reinterpret_cast<WasmInterpreter::Thread*>(impl);
}
ThreadImpl* ToImpl(WasmInterpreter::Thread* thread) {
return reinterpret_cast<ThreadImpl*>(thread);
}
// Same conversion for InterpretedFrame and InterpretedFrameImpl.
InterpretedFrame* ToFrame(InterpretedFrameImpl* impl) {
return reinterpret_cast<InterpretedFrame*>(impl);
}
const InterpretedFrameImpl* ToImpl(const InterpretedFrame* frame) {
return reinterpret_cast<const InterpretedFrameImpl*>(frame);
}
} // namespace
//============================================================================
// Implementation of the pimpl idiom for WasmInterpreter::Thread.
// Instead of placing a pointer to the ThreadImpl inside of the Thread object,
// we just reinterpret_cast them. ThreadImpls are only allocated inside this
// translation unit anyway.
//============================================================================
WasmInterpreter::State WasmInterpreter::Thread::state() {
return ToImpl(this)->state();
}
void WasmInterpreter::Thread::InitFrame(const WasmFunction* function,
WasmValue* args) {
ToImpl(this)->InitFrame(function, args);
}
WasmInterpreter::State WasmInterpreter::Thread::Run(int num_steps) {
return ToImpl(this)->Run(num_steps);
}
void WasmInterpreter::Thread::Pause() { return ToImpl(this)->Pause(); }
void WasmInterpreter::Thread::Reset() { return ToImpl(this)->Reset(); }
WasmInterpreter::Thread::ExceptionHandlingResult
WasmInterpreter::Thread::RaiseException(Isolate* isolate,
Handle<Object> exception) {
return ToImpl(this)->RaiseException(isolate, exception);
}
pc_t WasmInterpreter::Thread::GetBreakpointPc() {
return ToImpl(this)->GetBreakpointPc();
}
int WasmInterpreter::Thread::GetFrameCount() {
return ToImpl(this)->GetFrameCount();
}
WasmInterpreter::FramePtr WasmInterpreter::Thread::GetFrame(int index) {
DCHECK_LE(0, index);
DCHECK_GT(GetFrameCount(), index);
return FramePtr(ToFrame(new InterpretedFrameImpl(ToImpl(this), index)));
}
WasmValue WasmInterpreter::Thread::GetReturnValue(int index) {
return ToImpl(this)->GetReturnValue(index);
}
TrapReason WasmInterpreter::Thread::GetTrapReason() {
return ToImpl(this)->GetTrapReason();
}
uint32_t WasmInterpreter::Thread::GetGlobalCount() {
return ToImpl(this)->GetGlobalCount();
}
WasmValue WasmInterpreter::Thread::GetGlobalValue(uint32_t index) {
return ToImpl(this)->GetGlobalValue(index);
}
bool WasmInterpreter::Thread::PossibleNondeterminism() {
return ToImpl(this)->PossibleNondeterminism();
}
uint64_t WasmInterpreter::Thread::NumInterpretedCalls() {
return ToImpl(this)->NumInterpretedCalls();
}
void WasmInterpreter::Thread::AddBreakFlags(uint8_t flags) {
ToImpl(this)->AddBreakFlags(flags);
}
void WasmInterpreter::Thread::ClearBreakFlags() {
ToImpl(this)->ClearBreakFlags();
}
uint32_t WasmInterpreter::Thread::NumActivations() {
return ToImpl(this)->NumActivations();
}
uint32_t WasmInterpreter::Thread::StartActivation() {
return ToImpl(this)->StartActivation();
}
void WasmInterpreter::Thread::FinishActivation(uint32_t id) {
ToImpl(this)->FinishActivation(id);
}
uint32_t WasmInterpreter::Thread::ActivationFrameBase(uint32_t id) {
return ToImpl(this)->ActivationFrameBase(id);
}
//============================================================================
// The implementation details of the interpreter.
//============================================================================
class WasmInterpreterInternals : public ZoneObject {
public:
// Create a copy of the module bytes for the interpreter, since the passed
// pointer might be invalidated after constructing the interpreter.
const ZoneVector<uint8_t> module_bytes_;
CodeMap codemap_;
ZoneVector<ThreadImpl> threads_;
WasmInterpreterInternals(Zone* zone, const WasmModule* module,
const ModuleWireBytes& wire_bytes,
Handle<WasmInstanceObject> instance_object)
: module_bytes_(wire_bytes.start(), wire_bytes.end(), zone),
codemap_(module, module_bytes_.data(), zone),
threads_(zone) {
Isolate* isolate = instance_object->GetIsolate();
Handle<Cell> reference_stack = isolate->global_handles()->Create(
*isolate->factory()->NewCell(isolate->factory()->empty_fixed_array()));
threads_.emplace_back(zone, &codemap_, instance_object, reference_stack);
}
~WasmInterpreterInternals() {
DCHECK_EQ(1, threads_.size());
GlobalHandles::Destroy(threads_[0].reference_stack_cell().location());
}
};
namespace {
void NopFinalizer(const v8::WeakCallbackInfo<void>& data) {
Address* global_handle_location =
reinterpret_cast<Address*>(data.GetParameter());
GlobalHandles::Destroy(global_handle_location);
}
Handle<WasmInstanceObject> MakeWeak(
Isolate* isolate, Handle<WasmInstanceObject> instance_object) {
Handle<WasmInstanceObject> weak_instance =
isolate->global_handles()->Create<WasmInstanceObject>(*instance_object);
Address* global_handle_location = weak_instance.location();
GlobalHandles::MakeWeak(global_handle_location, global_handle_location,
&NopFinalizer, v8::WeakCallbackType::kParameter);
return weak_instance;
}
} // namespace
//============================================================================
// Implementation of the public interface of the interpreter.
//============================================================================
WasmInterpreter::WasmInterpreter(Isolate* isolate, const WasmModule* module,
const ModuleWireBytes& wire_bytes,
Handle<WasmInstanceObject> instance_object)
: zone_(isolate->allocator(), ZONE_NAME),
internals_(new (&zone_) WasmInterpreterInternals(
&zone_, module, wire_bytes, MakeWeak(isolate, instance_object))) {}
WasmInterpreter::~WasmInterpreter() { internals_->~WasmInterpreterInternals(); }
void WasmInterpreter::Run() { internals_->threads_[0].Run(); }
void WasmInterpreter::Pause() { internals_->threads_[0].Pause(); }
bool WasmInterpreter::SetBreakpoint(const WasmFunction* function, pc_t pc,
bool enabled) {
InterpreterCode* code = internals_->codemap_.GetCode(function);
size_t size = static_cast<size_t>(code->end - code->start);
// Check bounds for {pc}.
if (pc < code->locals.encoded_size || pc >= size) return false;
// Make a copy of the code before enabling a breakpoint.
if (enabled && code->orig_start == code->start) {
code->start = reinterpret_cast<byte*>(zone_.New(size));
memcpy(code->start, code->orig_start, size);
code->end = code->start + size;
}
bool prev = code->start[pc] == kInternalBreakpoint;
if (enabled) {
code->start[pc] = kInternalBreakpoint;
} else {
code->start[pc] = code->orig_start[pc];
}
return prev;
}
bool WasmInterpreter::GetBreakpoint(const WasmFunction* function, pc_t pc) {
InterpreterCode* code = internals_->codemap_.GetCode(function);
size_t size = static_cast<size_t>(code->end - code->start);
// Check bounds for {pc}.
if (pc < code->locals.encoded_size || pc >= size) return false;
// Check if a breakpoint is present at that place in the code.
return code->start[pc] == kInternalBreakpoint;
}
bool WasmInterpreter::SetTracing(const WasmFunction* function, bool enabled) {
UNIMPLEMENTED();
return false;
}
int WasmInterpreter::GetThreadCount() {
return 1; // only one thread for now.
}
WasmInterpreter::Thread* WasmInterpreter::GetThread(int id) {
CHECK_EQ(0, id); // only one thread for now.
return ToThread(&internals_->threads_[id]);
}
void WasmInterpreter::AddFunctionForTesting(const WasmFunction* function) {
internals_->codemap_.AddFunction(function, nullptr, nullptr);
}
void WasmInterpreter::SetFunctionCodeForTesting(const WasmFunction* function,
const byte* start,
const byte* end) {
internals_->codemap_.SetFunctionCode(function, start, end);
}
ControlTransferMap WasmInterpreter::ComputeControlTransfersForTesting(
Zone* zone, const WasmModule* module, const byte* start, const byte* end) {
// Create some dummy structures, to avoid special-casing the implementation
// just for testing.
FunctionSig sig(0, 0, nullptr);
WasmFunction function{&sig, 0, 0, {0, 0}, false, false};
InterpreterCode code{
&function, BodyLocalDecls(zone), start, end, nullptr, nullptr, nullptr};
// Now compute and return the control transfers.
SideTable side_table(zone, module, &code);
return side_table.map_;
}
//============================================================================
// Implementation of the frame inspection interface.
//============================================================================
const WasmFunction* InterpretedFrame::function() const {
return ToImpl(this)->function();
}
int InterpretedFrame::pc() const { return ToImpl(this)->pc(); }
int InterpretedFrame::GetParameterCount() const {
return ToImpl(this)->GetParameterCount();
}
int InterpretedFrame::GetLocalCount() const {
return ToImpl(this)->GetLocalCount();
}
int InterpretedFrame::GetStackHeight() const {
return ToImpl(this)->GetStackHeight();
}
WasmValue InterpretedFrame::GetLocalValue(int index) const {
return ToImpl(this)->GetLocalValue(index);
}
WasmValue InterpretedFrame::GetStackValue(int index) const {
return ToImpl(this)->GetStackValue(index);
}
void InterpretedFrameDeleter::operator()(InterpretedFrame* ptr) {
delete ToImpl(ptr);
}
#undef TRACE
#undef LANE
#undef FOREACH_INTERNAL_OPCODE
#undef WASM_CTYPES
#undef FOREACH_SIMPLE_BINOP
#undef FOREACH_OTHER_BINOP
#undef FOREACH_I32CONV_FLOATOP
#undef FOREACH_OTHER_UNOP
} // namespace wasm
} // namespace internal
} // namespace v8
```
|
```yaml
name: emptyjs
description: An empty Node.js Pulumi program.
runtime: nodejs
```
|
```php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\ErrorHandler\ErrorEnhancer;
use Symfony\Component\ErrorHandler\Error\FatalError;
use Symfony\Component\ErrorHandler\Error\UndefinedFunctionError;
/**
* @author Fabien Potencier <fabien@symfony.com>
*/
class UndefinedFunctionErrorEnhancer implements ErrorEnhancerInterface
{
/**
* {@inheritdoc}
*/
public function enhance(\Throwable $error): ?\Throwable
{
if ($error instanceof FatalError) {
return null;
}
$message = $error->getMessage();
$messageLen = \strlen($message);
$notFoundSuffix = '()';
$notFoundSuffixLen = \strlen($notFoundSuffix);
if ($notFoundSuffixLen > $messageLen) {
return null;
}
if (0 !== substr_compare($message, $notFoundSuffix, -$notFoundSuffixLen)) {
return null;
}
$prefix = 'Call to undefined function ';
$prefixLen = \strlen($prefix);
if (0 !== strpos($message, $prefix)) {
return null;
}
$fullyQualifiedFunctionName = substr($message, $prefixLen, -$notFoundSuffixLen);
if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) {
$functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1);
$namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex);
$message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix);
} else {
$functionName = $fullyQualifiedFunctionName;
$message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName);
}
$candidates = [];
foreach (get_defined_functions() as $type => $definedFunctionNames) {
foreach ($definedFunctionNames as $definedFunctionName) {
if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) {
$definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1);
} else {
$definedFunctionNameBasename = $definedFunctionName;
}
if ($definedFunctionNameBasename === $functionName) {
$candidates[] = '\\'.$definedFunctionName;
}
}
}
if ($candidates) {
sort($candidates);
$last = array_pop($candidates).'"?';
if ($candidates) {
$candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
} else {
$candidates = '"'.$last;
}
$message .= "\nDid you mean to call ".$candidates;
}
return new UndefinedFunctionError($message, $error);
}
}
```
|
4-HO-DsBT (4-hydroxy-N,N-di-sec-butyltryptamine) is a tryptamine derivative which acts as a serotonin receptor agonist. It was first made by Alexander Shulgin and is mentioned in his book TiHKAL, but was never tested by him. However it has subsequently been tested in vitro and unlike the n-butyl and isobutyl isomers which are much weaker, the s-butyl derivative retains reasonable potency, with a similar 5-HT2A receptor affinity to MiPT but better selectivity over the 5-HT1A and 5-HT2B subtypes.
See also
4-HO-DiPT
4-HO-DBT
4-HO-McPeT
4-HO-PiPT
5-MeO-DBT
Dibutyltryptamine
N-t-Butyltryptamine
Robalzotan
References
Tryptamines
|
```java
/*
*
*
* 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
*/
package io.ballerina.compiler.syntax.tree;
import io.ballerina.compiler.internal.parser.tree.STNode;
import java.util.Objects;
/**
* This is a generated syntax tree node.
*
* @since 2.0.0
*/
public class CommitActionNode extends ActionNode {
public CommitActionNode(STNode internalNode, int position, NonTerminalNode parent) {
super(internalNode, position, parent);
}
public Token commitKeyword() {
return childInBucket(0);
}
@Override
public void accept(NodeVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T apply(NodeTransformer<T> visitor) {
return visitor.transform(this);
}
@Override
protected String[] childNames() {
return new String[]{
"commitKeyword"};
}
public CommitActionNode modify(
Token commitKeyword) {
if (checkForReferenceEquality(
commitKeyword)) {
return this;
}
return NodeFactory.createCommitActionNode(
commitKeyword);
}
public CommitActionNodeModifier modify() {
return new CommitActionNodeModifier(this);
}
/**
* This is a generated tree node modifier utility.
*
* @since 2.0.0
*/
public static class CommitActionNodeModifier {
private final CommitActionNode oldNode;
private Token commitKeyword;
public CommitActionNodeModifier(CommitActionNode oldNode) {
this.oldNode = oldNode;
this.commitKeyword = oldNode.commitKeyword();
}
public CommitActionNodeModifier withCommitKeyword(
Token commitKeyword) {
Objects.requireNonNull(commitKeyword, "commitKeyword must not be null");
this.commitKeyword = commitKeyword;
return this;
}
public CommitActionNode apply() {
return oldNode.modify(
commitKeyword);
}
}
}
```
|
```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.sql.parser.statement.core.statement.dal;
import org.apache.shardingsphere.sql.parser.statement.core.statement.AbstractSQLStatement;
/**
* Show binary logs statement.
*/
public abstract class ShowBinaryLogsStatement extends AbstractSQLStatement implements DALStatement {
}
```
|
Trinjan () was a Punjabi tradition of women gathering, spinning charkhas, and singing songs. It was customary in Punjabi culture, where women would sit together and engage in other domestic crafts like spinning, weaving, and singing. Trinjan was a symbol of women's strength, creativity, and emotional, cultural, ecological, and social ties.
Spinning
Hand spinning was integrally related to Trinjan, with women spinning and singing together in groups. Trinjan has long been a place of togetherness, collaborative wisdom, and shared abilities. The night trinjan was called as ',' and the day Trinjan was known as ' .'
Trinjan songs
'Trinjan' refers to assembling for activities such as plying 'Charkhas' and singing songs. Trinjan songs have a distinctive status in Punjabi folk music. Trinjan songs were an expression of contemporary women's desires and sorrows. The sound of the spinning wheel used to blend as if it was an instrument.
Dance
'Trinjan' a dance type include Punjabi Giddha and Kikkli dances.
Presently
These traditions began to dwindle as time passed. It has been lost as a result of industrialization, the Green Revolution, and individualism.
Gallery
See also
Spinning wheel
Phulkari
References
Punjabi culture
|
Đorđević (, ; also transliterated Djordjevic) is a Serbian surname, a patronymic derived from the given name Đorđe ("George", from Ancient Greek Georgios meaning "farmer"). It is predominantly worn by ethnic Serbs, an Eastern Orthodox Christian people.
Đorđević is the fifth most frequent surname in Serbia.
It may refer to:
Notable people
Aleksandar Đorđević (born 1967), retired Serbian professional basketball player and a present basketball
Aleksandar Đorđević (footballer) (born 1968), football coach and former player
Bojan Đorđević (born 1984), Serbian football player
Bora Đorđević (born 1952), Serbian singer, songwriter and poet
Boriša Đorđević (born 1953), retired Serbian football player
Borivoje Đorđević (born 1948), retired Serbian football player
Boško Đorđević (born 1953), retired Serbian football player
Damien Djordjevic (born 1984), French figure skater
Dragan Đorđević (born 1970), presidential candidate in the Serbian presidential election, 2004
Filip Đorđević (born 1987), Serbian football player
Jovan Đorđević (1826–1900), founder of the Novi Sad Serbian National Theatre and the National Theatre in Belgrade
Kristijan Đorđević (born 1976), retired Serbian football player
Marko Đorđević (footballer) (born 1983), Serbian football player
Marko Đorđević (skier) (born 1978), Serbian alpine skier
Milan Đorđević (born 1968), Serbian slalom canoer
Nataša Đorđević (born 1974), Serbian singer
Nebojša Đorđević (born 1973), Serbian tennis player
Nenad Đorđević (born 1979), Serbian football player
Predrag Đorđević (born 1972), retired Serbian football player
Puriša Đorđević (born 1924), Serbian film director and screenwriter
Sanja Đorđević (born 1969), Montenegrin Serb singer
Saša Đorđević (footballer) (born 1981), Serbian football player
Slavoljub Đorđević (born 1981), Serbian football player
Tatjana Đorđević (born 1985), Serbian singer
Vladimir Đorđević (born 1982), Serbian football player
Vlastimir Đorđević (born 1948), former Serbian colonel general
Zoran Đorđević (football manager) (born 1952), Serbian football manager
Zoran Đorđević (politician) (born 1970), Serbian politician and former Minister of Defense (2016–2017)
See also
Đurđević (disambiguation), a surname
Đorđić, a surname
References
Surnames of Serbian origin
Patronymic surnames
Surnames from given names
|
Induri is a village and gram panchayat in India, situated in Mawal taluka of Pune district in the state of Maharashtra. It encompasses an area of .
Administration
The village is administrated by a sarpanch, an elected representative who leads a gram panchayat. At the time of the 2011 Census of India, the village was a self-contained gram panchayat, meaning that there were no other constituent villages governed by the body.
Demographics
At the 2011 census, the village comprised 2,236 households. The population of 10,448 was split between 5,999 males and 4,449 females.
Notable people
Dadu Indurikar
See also
List of villages in Mawal taluka
References
Villages in Mawal taluka
Gram Panchayats in Pune district
|
```c++
/// Source : path_to_url
/// Author : liuyubobobo
/// Time : 2019-03-23
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
/// Multiplication Simulation
/// Time Complexity: O(K)
/// Space Complexity: O(K)
class Solution {
public:
int smallestRepunitDivByK(int K) {
if(K % 2 == 0 || K % 5 == 0) return -1;
unordered_set<int> visited;
int left = 0, len = 0;
while(true){
int i = 0;
for(i = 0; i <= 9; i ++)
if((K * i + left) % 10 == 1){
left = (K * i + left) / 10;
len ++;
break;
}
if(i == 10) return -1;
if(left == 0) return len;
if(visited.count(left)) break;
visited.insert(left);
}
return -1;
}
};
int main() {
cout << Solution().smallestRepunitDivByK(3) << endl;
return 0;
}
```
|
Slicker Than Your Average is the second studio album by British singer Craig David, released on 19 November 2002 by Atlantic Records. It peaked at number 4 on the UK Albums Chart, number 5 on the Australian ARIA Albums Chart, and number 32 on the U.S. Billboard 200. It was certified Gold by RIAA in the U.S. and double Platinum by the British Phonographic Industry in the UK. As of November 2013, the album has sold over 3.5 million copies worldwide.
The album was released in a number of different versions. The original release contained 13 new tracks. A six-track bonus remix CD was released in Asia that featured remixes of the singles "Rise and Fall" and "Hidden Agenda", as well as versions of "Fill Me In" and the B-side "Four Times a Lady" from the single, "What's Your Flava?".
Background and writing
After David managed to crack the American music industry with his hit debut studio album, Born to Do It, his musical style began to alter to appeal to the worldwide market on his second studio album. In an interview with ANDPOP's Adam Gonshor, David revealed the inspiration for some of the songs on the album. He was forced to stay in a hotel room for a week following the September 11 attacks in New York City in 2001, and it was this event that inspired him to write the song "World Filled with Love". In the interview, he said, "I was thinking, I'm actually in this world that's filled with madness, with this drama that's going on. Some of the things we were talking about in music, in the big picture, are so trivial...I thought music is a form of escapism, so I used it to write a song hopefully for positive means to say, we are in a world that's filled with love." David also commented that the album title could be looked at in two different ways: "On the one hand, it's coming across like I'm arrogant. On the other hand, it's saying I have a lot more composure on the album." The album was leaked onto the internet prior to its official release, but David was not too bothered as he felt that it "spreads the word".
Critical reception
Slicker Than Your Average received mixed to positive reviews from contemporary music critics. At Metacritic, which assigns a normalised rating out of 100 to reviews from mainstream critics, the album has an average score of 62 based on 14 reviews, indicating "generally favorable reviews". BBC Music's Keysha Davis wrote that "Slicker Than Your Average provides the listener with the opportunity to get into the mind of a truly gifted young star...there are enough club friendly tracks to ensure heavy rotation in the hottest nightspots". However, in reference to his success in the United States, she also pointed out "true fans may be a tad bit disappointed by the new super-slick musical direction". AllMusic's Christina Fuoco gave it a rating of three stars out of five and wrote "Slicker Than Your Average is stronger than the average sophomore effort...it proves that Craig David's abilities are innate". Pat Blashill, writing for Rolling Stone magazine, called it "one of the most subtle male R&B records in a good while" and gave it a 3/5 rating. Blender magazine's gave the album a rating of 4/5 and commented "David moves away from underground two-step...toward a modern, mainstream R&B record. Slicker is full of Timbaland-style production, booty-call ballads and even Spanish guitars. Sometimes being real means revealing the marshmallow within."
Ken Tucker, writing for Entertainment Weekly, gave the album a B− and wrote "David has a voice that's fresh and expressive, so it doesn't bode well that on what's only his second album, he's also an artist already reduced to singing about the burdens of fame." The Guardian Alexis Petridis wrote "His second album has its flaws, but they are largely generic: when it tries to fit too snugly into the R&B template, it tails off. At its best, however, it is a curiously unique record."
Track listing
Bonus tracks
Other releases
Asian Limited Edition – Bonus Remix CD
"What's Your Flava?" (Todd's underground flava vocal remix)
"Hidden Agenda" (Blacksmith rerub featuring Know ?uestion)
"Hidden Agenda" (Soulshock remix)
"Four Times a Lady"
"Rise & Fall" (Blacksmith hiphop rub featuring Fallacy)
"Fill me in" (Acoustic recorded in Seoul)
DVD
"Fill Me In" (Music Video)
"7 Days" (Music Video)
"Walking Away" (Music Video)
"Rendezvous" (Music Video)
"What's Your Flava" (Music Video)
"Hidden Agenda" (Music Video)
"Rise & Fall" (Music Video)
Notes
signifies remix and additional production.
Sample credits
"Personal" contains an interpolation of "T Shirt and Panties" by Jamie Foxx.
"Hidden Agenda" contains an interpolation of "Don't Talk" by Jon B.
Personnel
Credits adapted from album's liner notes.
Peter Biker – remix and additional producer (track 6)
Messiah Bolical – vocals (track 5)
Thomas Burbree – mixing (track 5), Pro Tools and post production (tracks 1-3, 5, 8)
Craig David – vocals (all tracks), producer (track 13)
Kevin "KD" Davis – mixing (track 12)
Steve Fitzmaurice – mixing (tracks 4, 13)
Marc Francs – mixing (track 3)
Rob Haggett – 2nd assistant engineer (tracks 6, 9)
Trevor "Trell" Henry – producer (tracks 1-3, 5, 8), mixing (tracks 1-3, 8), rap (track 1)
Mark Hill – producer (tracks 4, 6, 9, 12)
Katie Holmes – additional vocals (track 12)
Kenneth Karlin – producer and arranger (tracks 7, 10)
Darryl Lavictoire – mixing (tracks 3, 8), mix engineer (tracks 1, 2)
Manny Marroquin – mixing (tracks 7, 10)
Anthony Marshall – producer (tracks 1-3, 5, 8, 11), mixing (tracks 1-3, 8, 11)
Duke One – vocals (track 11)
Onyxstone – Garage MCing (track 5)
Fraser T Smith – producer (track 13)
Soulshock – producer, arranger, and mixing (tracks 7, 10), remix and additional production (track 6)
Mark "Spike" Stent – mixing (tracks 6, 9)
Sting – vocals (track 7)
David Treahearn – assistant mixing (tracks 6, 9)
Paul "P-Dub" Walton – Pro Tools (tracks 6, 9)
Charts
Weekly charts
Year-end charts
Certifications
References
External links
2002 albums
Craig David albums
|
```xml
import { format } from 'fecha';
import { G2Spec } from '../../../src';
import { SLIDER_CLASS_NAME } from '../../../src/interaction/sliderFilter';
import { dispatchValueChange } from './appl-line-slider-filter';
export function aaplLineSliderFilterTranspose(): G2Spec {
return {
type: 'line',
paddingLeft: 80,
coordinate: { transform: [{ type: 'transpose' }] },
data: {
type: 'fetch',
value: 'data/aapl.csv',
},
encode: {
x: (d) => new Date(d.date),
y: 'close',
},
axis: {
x: { title: false, size: 40 },
y: { title: false, size: 36 },
},
slider: {
x: { labelFormatter: (d) => format(d, 'YYYY/M/D') },
y: { labelFormatter: '~s' },
},
};
}
aaplLineSliderFilterTranspose.steps = ({ canvas }) => {
const { document } = canvas;
const sliders = document.getElementsByClassName(SLIDER_CLASS_NAME);
const [s1, s2] = sliders;
return [
{
changeState: () => {
dispatchValueChange(s1);
},
},
{
changeState: () => {
dispatchValueChange(s2);
},
},
];
};
```
|
Yumi's Cells () is a 2021 South Korean television series directed by Lee Sang-yeob and starring Kim Go-eun, Ahn Bo-hyun, Park Jin-young, Lee Yu-bi, and Park Ji-hyun. Based on the eponymous webtoon, it is a cell-based psychological romance that unravels the daily life of an ordinary office worker Yumi through the eyes of the cells in her head. The series premiered on tvN on September 17, 2021, and aired every Friday and Saturday at 22:50 (KST). It was also released simultaneously on both online streaming services TVING and iQIYI.
On September 8, 2021, TVING announced that the drama had sold broadcast rights in more than 160 countries around the world, including Europe, North America and Southeast Asia.
The second season premiered exclusively on TVING on June 10, 2022, releasing two episodes every Friday at 16:00 (KST). It was later aired on tvN from November 16, 2022, every Wednesday and Thursday at 22:30 (KST).
On September 15, 2022, it was announced that season 2 had been sold to Amazon Prime Video for broadcasting in Japan. Season 2 was also available on Amazon Prime Video in Indonesia, Thailand and the Philippines.
Series overview
Synopsis
Season 1
The drama tells the story of an ordinary office worker from the perspective of the brain cells in her head that control her every thought, feeling and action.
Yumi (Kim Go-eun) is an ordinary woman. Her love-cell falls into a coma following the shock of a failed relationship. The drama will depict her growth and transformation as her cells work hard to wake up the love cell.
Goo Woong (Ahn Bo-hyun) is a game developer who is an engineer to the core. Although he doesn't speak emotionally, he tries to wake up Yumi's love-cell with his simple and honest personality.
Season 2
After parting with Goo Woong, Yumi starts a new relationship with her co-worker Babi (Jinyoung) but they start to have issues after some time when he doesn't tell her the truth about certain things.
Cast
Main
Kim Go-eun as Kim Yumi, an ordinary office worker.
Ahn Bo-hyun as Goo Woong, a game developer and Yumi's second boyfriend and Sae-yi's love interest.
Jun Ho-young as teen Goo Woong
Park Jin-young as Yoo Babi, Yumi's co-worker and boyfriend.
Park Ji-hyun as Seo Sae-yi, Goo Woong's colleague. She dreams of becoming the best game art director.
Lee Yu-bi as Ruby, Yumi's co-worker who prides herself on mastering various dating techniques.
Yumi's cells
Love Cell (voice: Ahn Soi)
Yumi's prime cell that represents the people. It's the driving force behind Yumi's actions. Other cells wear blue, but it wears pink.
Emotional Cell (voice: Park Ji-yoon)
Emotional cell, responsible for emotion. It has a nocturnal temperament, so at night, it flutters blue leaves and gets wet with sensitivity.
Rational Cell (voice: Shim Kyu-hyuk)
The opposite cell responsible for ideal thinking. When working or having an important conversation, this is Yumi's busiest cell from the moment she wakes up to the moment she goes to sleep.
Hungry Cell (voice: Lee Jang-won)
Cell responsible for appetite and cravings. When this cell wakes up, Yumi's appetite explodes.
Naughty Cell (voice: Ahn Young-mi)
Clumsy sexuality cell that promotes racy thoughts. It spits out obscene words from time to time, most of which are muted.
Detective Cell (voice: Jeong Jae-heon)
Detective cell that analyzes and predicts people and situations around it. Serious reasoning with a tragic appearance.
Fashion Cell (voice: Kim Yeon-woo)
Fashion cell responsible for the sense of fashion.
Hysterious (voice: Um Sang-hyun)
Hysterious is responsible for hysteria.
Anxiety Cell (voice: Sa Moon-yeong)
Cell responsible for anxiety. It senses anxiety and even helps Yumi.
Inner Feeling Cell (voice: Sa Moon-yeong)
Rampage Cell (voice: Jeong Jae-heon)
Fussy Cell (voice: Sa Moon-yeong)
Lullaby Cell (voice: Jeong Jae-heon)
Cheapskate Cell (voice: Ahn Soi)
Reaction Doll No.1 (voice: Ahn Soi)
Stomach Cell (voice: Shim Kyu-hyuk)
I've-Seen-It-Somewhere Cell
Cleaning Cell
Tongue Cells (voice: Yoo Se-yoon)
Goo Woong's cells
Rational Cell (voice: Um Sang-hyun)
Humor Cell (voice: Jeong Jae-heon)
Love Cell
Babi's cells
Tongue Cells (voice: Kang Yu-mi)
Supporting
Joo Jong-hyuk as Louis
A game developer workaholic. Goo Woong, Seo Sae-yi, and he were college classmates, who have set up and run an online game company.
Jung Soon-won as Nam Joo-hyuk, Chief Nam.
Kim Cha-yoon as Lee Bonnie, an employee of Daehan Noodles' marketing department.
Mi Ram as Aida, Yumi's only friend and her co-worker.
Others
Season 1–2
Yoon Yoo-sun as Yumi's mother
Sung Ji-ru as Yumi's father
Kwon Seung-woo as Kang Han-byeol, Assistant Manager of Daehan Noodles' marketing department
Kim Mi-soo as Ja-young, Babi's ex-girlfriend
Season 1
Park Bo-eun as Information desk employee (ep. 8)
Jung Soo-ji as Si Leon (ep. 7–8)
Kim Hye-in as Hong Na-ri (ep. 7–8)
Jo Mo-se as wedding guest (ep. 13)
Kang Chan-yang as grocery store cashier (ep. 11)
Special appearance
Season 1
Choi Min-ho as Chae U-gi, Yumi's co-worker and unreciprocated crush.
Ahn Young-mi as Nung-cheol (Voice)
Lee Sang-yi as Ji Wu-gi, Yumi's ex-boyfriend.
Season 2
Shin Ye-eun as Yoo Da-eun, part-time worker at Jeju branch of Daehan Noodles.
Pyo Ji-hoon as Control Z, an illustrator who works with Yumi.
Jeon Seok-ho as Ahn Dae-young, editor-in-chief of Julie's Literature History.
Production
Casting
On December 31, 2020, it was reported that webtoon Yumi's Cells published on Naver by Lee Dong-gun with 3.2 billion accumulated views was being made into a television series and Kim Go-eun was confirmed as the female lead. In April 2021, the lead cast line-up was announced as Kim Go-eun, Ahn Bo-hyun, Lee Yu-bi, and Park Ji-hyun.
Filming
Filming of the series began in April 2021. On June 18, Ahn Bo-hyun revealed in an interview that he was currently filming Yumi's Cells and he has developed naturally tanned skin tone for the role of Goo Woong.
Animation
Yumi's Cells is being produced using a new format which combines live-action and 3D animation. It is the first time in a Korean drama that such a format is used to produce a TV series while using the Unreal Engine as its source. The 3D animation is produced by Locus Corporation (also known as Sidus Animation Studios), the producer of Red Shoes and the Seven Dwarfs, which is also producing an animated feature film based on the property with Studio N.
Original soundtrack
Season 1
Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7
Part 8
Part 9
Part 10
Part 11
Season 2
Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
Part 7
Part 8
Viewership
Season 1
The release of the second season on June 10 saw the number of TVING's paid subscribers increasing by more than 60% from the first to the second week, and the series took first place among all the platform original contents for five weeks in a row.
Season 2
Awards
Listicle
References
External links
Yumi's Cells (Season 1) at Daum
Yumi's Cells (Season 2) at Daum
Yumi's Cells on iQIYI
TVN (South Korean TV channel) television dramas
2021 South Korean television series debuts
2022 South Korean television series endings
Korean-language television shows
South Korean romance television series
Television series by Studio Dragon
South Korean web series
Television series by Studio N (Naver)
Television shows based on South Korean webtoons
TVING original programming
|
```java
/*
* 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, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.beam.runners.dataflow.worker.windmill.client.commits;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import com.google.api.services.dataflow.model.MapTask;
import com.google.common.truth.Correspondence;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import org.apache.beam.runners.dataflow.worker.FakeWindmillServer;
import org.apache.beam.runners.dataflow.worker.streaming.ComputationState;
import org.apache.beam.runners.dataflow.worker.streaming.ShardedKey;
import org.apache.beam.runners.dataflow.worker.streaming.Watermarks;
import org.apache.beam.runners.dataflow.worker.streaming.Work;
import org.apache.beam.runners.dataflow.worker.util.BoundedQueueExecutor;
import org.apache.beam.runners.dataflow.worker.windmill.Windmill;
import org.apache.beam.runners.dataflow.worker.windmill.client.getdata.FakeGetDataClient;
import org.apache.beam.runners.dataflow.worker.windmill.work.refresh.HeartbeatSender;
import org.apache.beam.vendor.grpc.v1p60p1.com.google.protobuf.ByteString;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMap;
import org.joda.time.Instant;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ErrorCollector;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
public class StreamingApplianceWorkCommitterTest {
@Rule public ErrorCollector errorCollector = new ErrorCollector();
private FakeWindmillServer fakeWindmillServer;
private StreamingApplianceWorkCommitter workCommitter;
private static Work createMockWork(long workToken) {
return Work.create(
Windmill.WorkItem.newBuilder()
.setKey(ByteString.EMPTY)
.setWorkToken(workToken)
.setCacheToken(1L)
.setShardingKey(2L)
.build(),
Watermarks.builder().setInputDataWatermark(Instant.EPOCH).build(),
Work.createProcessingContext(
"computationId",
new FakeGetDataClient(),
ignored -> {
throw new UnsupportedOperationException();
},
mock(HeartbeatSender.class)),
Instant::now,
Collections.emptyList());
}
private static ComputationState createComputationState(String computationId) {
return new ComputationState(
computationId,
new MapTask().setSystemName("system").setStageName("stage"),
mock(BoundedQueueExecutor.class),
ImmutableMap.of(),
null);
}
private StreamingApplianceWorkCommitter createWorkCommitter(
Consumer<CompleteCommit> onCommitComplete) {
return StreamingApplianceWorkCommitter.create(fakeWindmillServer::commitWork, onCommitComplete);
}
@Before
public void setUp() {
fakeWindmillServer =
new FakeWindmillServer(
errorCollector, ignored -> Optional.of(mock(ComputationState.class)));
}
@After
public void cleanUp() {
workCommitter.stop();
}
@Test
public void testCommit() {
List<CompleteCommit> completeCommits = new ArrayList<>();
workCommitter = createWorkCommitter(completeCommits::add);
List<Commit> commits = new ArrayList<>();
for (int i = 1; i <= 5; i++) {
Work work = createMockWork(i);
Windmill.WorkItemCommitRequest commitRequest =
Windmill.WorkItemCommitRequest.newBuilder()
.setKey(work.getWorkItem().getKey())
.setShardingKey(work.getWorkItem().getShardingKey())
.setWorkToken(work.getWorkItem().getWorkToken())
.setCacheToken(work.getWorkItem().getCacheToken())
.build();
commits.add(Commit.create(commitRequest, createComputationState("computationId-" + i), work));
}
workCommitter.start();
commits.forEach(workCommitter::commit);
Map<Long, Windmill.WorkItemCommitRequest> committed =
fakeWindmillServer.waitForAndGetCommits(commits.size());
for (Commit commit : commits) {
Windmill.WorkItemCommitRequest request =
committed.get(commit.work().getWorkItem().getWorkToken());
assertNotNull(request);
assertThat(request).isEqualTo(commit.request());
}
assertThat(completeCommits).hasSize(commits.size());
assertThat(completeCommits)
.comparingElementsUsing(
Correspondence.from(
(CompleteCommit completeCommit, Commit commit) ->
completeCommit.computationId().equals(commit.computationId())
&& completeCommit.status() == Windmill.CommitStatus.OK
&& completeCommit.workId().equals(commit.work().id())
&& completeCommit
.shardedKey()
.equals(
ShardedKey.create(
commit.request().getKey(), commit.request().getShardingKey())),
"expected to equal"))
.containsExactlyElementsIn(commits);
}
}
```
|
Beekman Verplanck Hoffman (born in Poughkeepsie, New York, 28 November 1789; died in Jamaica, Long Island, 10 December 1834) was a United States Navy officer.
Biography
He entered the Navy as midshipman on 4 July 1805, was commissioned lieutenant on 21 May 1812, and commander on 5 March 1817, and reached the grade of captain on 7 March 1829. He served first in the Argus under Captain Trippe, and was attached later to the frigate Constitution, and participated in all her battles. He was present at the victory over the English ship on 19 August 1812, at that over the on 29 December 1812, and at the combat with the and off Madeira on 20 February 1815, and carried the Cyane into New York.
In 1826 he was the first commanding officer of the sloop of war USS Boston.
Notes
References
1789 births
1834 deaths
United States Navy officers
|
Lars Borgersrud (born 11 March 1949) is a Norwegian military historian and government scholar. His work has largely centered on World War II in Norway.
Borgersrud formed close relations with leading figures of the Norwegian Maoist movement beginning in the late 1960s.
Career
Borgersrud's master's thesis from 1975 disclosed sensitive information regarding military personnel and organization prior to World War II and their possible effects on military preparedness prior to the invasion of Norway by Nazi Germany. As a student he was threatened with being prosecuted if he published his thesis. Nevertheless, Borgersrud eventually published three books with material from his work under the pseudonym "Ottar Strømme": Stille mobilisering, Unngå å irritere fienden and Den hemmelige hæren. In 1978, he also published the first volume of the secret report from Den militære undersøkelseskommisjonen av 1946, under the same pseudonym.
He was a contributor to the 1995 World War II encyclopedia Norsk krigsleksikon 1940-1945.
Research
His 1995 doctoral dissertation examined the Wollweber organization in Norway.
In the 2000s, he also participated in research on the fate of war children—children born during the German occupation of Norway who had German fathers and Norwegian mothers.
Denied access to governmental archive
While preparing the book Konspirasjon og kapitulasjon (2000), Borgersrud tried to survey Norwegian military officers with Nazi sympathies but met resistance and was denied access to historical documents from the National Archival Services of Norway.
Family
He was until 1982 married to professor and feminism activist Leikny Øgrim, daughter of XU member and physicist Otto Øgrim and sister of SUF(m-l) and AKP(m-l) ideologist Tron Øgrim. He is the father of rappers Elling and Aslak from Gatas Parlament.
References
Selected works
1949 births
Living people
20th-century Norwegian historians
University of Oslo alumni
Academic staff of the University of Oslo
Norwegian military historians
Historians of World War II
Place of birth missing (living people)
21st-century Norwegian historians
|
The Lincoln Town Car is a model line of full-size luxury sedans that was marketed by the Lincoln division of the American automaker Ford Motor Company. Deriving its name from a limousine body style, Lincoln marketed the Town Car from 1981 to 2011, with the nameplate previously serving as the flagship trim of the Lincoln Continental. Produced across three generations for thirty model years, the Town Car was marketed directly against luxury sedans from Cadillac and Chrysler.
Marketed nearly exclusively as a four-door sedan (a two-door sedan was offered for 1981 only), many examples of the Town Car were used for fleet and livery (limousine) service. From 1983 to its 2011 discontinuation, the Town Car was the longest car produced by Ford worldwide, becoming the longest mass-production car sold in North America from 1997 to 2011. While not a direct successor of the Town Car, the Lincoln MKS would become the longest American sedan until 2016 (overtaken by the Cadillac CT6).
From 1980 until 2007, the Lincoln Town Car was assembled in Wixom, Michigan, (Wixom Assembly) alongside the Lincoln Continental, LS, and Mark VI, VII, and VIII. After that factory closed, Town Car production moved to Southwold, Ontario, (St. Thomas Assembly) alongside the similar Ford Crown Victoria and the Mercury Grand Marquis. That factory was closed in September 2011; the final Lincoln Town Car came off the assembly line on August 29, 2011.
Within the Lincoln model line, the Town Car was not directly replaced; the nameplate was used from 2012 to 2019 to denote livery/limousine/hearse variants of the Lincoln MKT. For 2017, the revived Continental replaced the MKS, closely matching the Town Car in wheelbase and width.
Background
Etymology
In the 1920s, a town car was a body design typically used for limousines. The description originated from the horse-drawn carriage that featured an open chauffeur's compartment with a fixed roof for the passengers. During that era, the fixed rear roof horse-drawn carriage became a limousine and the term "de Ville" in French meant "for town (use)". In 1922, Edsel Ford purchased a custom-built Lincoln L-Series town car as a personal vehicle for his father, Henry Ford.
Later, the "sedan de Ville" was used as a model name by Cadillac, the primary rival to the Lincoln Continental from the 1950s to the 1990s.
Continental Town Car
1959-1960
For 1959, Lincoln augmented its pre-existing Continental lineup with the addition of two formal sedans known as the Town Car and Limousine. Both new vehicles featured pillared construction, interiors of broadcloth and scotch-grain leather as well as deep pile carpeting. No options were offered, all equipment including air conditioning being standard; the Limousine came with a glass partition between the front and rear seats.
In place of the reverse-slant roofline used by all other Continentals (including convertibles), the Town Car/Limousine was styled with a notchback roofline with a heavily padded vinyl top and an inset rear window. In addition to the slightly restrained styling, the change in the roofline was also functional. To add rear-seat legroom, the rear seat was repositioned without any modification to the wheelbase. In the years to follow, both Imperial and Cadillac would redesign the rooflines on their own range-topping vehicles (the LeBaron and Fleetwood Sixty-Special) to appear more formal and limousine-like.
One of the rarest vehicles ever produced by Ford Motor Company, 214 Town Cars and 83 Limousines were produced from 1959 until 1960; all were painted black.
1970-1979
For 1970, the Town Car name returned as a trim package option, including leather seating surfaces and deeper cut-pile carpeting. For 1971, a limited-edition (1500 produced) Golden Anniversary Continental Town Car commemorated the fiftieth anniversary of Lincoln. For 1972, the Town Car was introduced as a sub-model of the Lincoln Continental model line. On nearly all examples, a vinyl top covered the rear half of the roof, with a full-length configuration optional. A raised molding over the roof incorporated coach lamps on the B-pillars. For 1973, Lincoln introduced a two-door variant of the Continental Town Car, named the Town Coupe. As with the Town Car, the Town Coupe included a standard vinyl roof.
As part of the 1975 redesign of the Lincoln roofline, the Town Car adopted the oval opera windows of the Mark IV coupe, with the Town Coupe given a large rectangular opera window.
The Continental Town Car proved to be a success for the division, becoming the most popular Lincoln vehicle of the 1970s (as the Mark IV and Mark V were not technically branded as Lincolns).
1980
For the 1980 model year, Lincoln became the final American brand to market downsized full-size cars. In its redesign, the Lincoln Continental shifted from the largest production sedan in North America to a design with a smaller exterior footprint than Cadillac. The Continental Town Car returned as the top trim for the Lincoln model range; in its own downsizing, the Mark series introduced the Continental Mark VI. Though technically not badged a Lincoln, the Mark VI shared its chassis and much of the body with the Continental to reduce development and production costs.
While Lincoln had brought downsized model lines to production, from a marketing standpoint, the consolidation of the Continental, Continental Town Car/Town Coupe, and the Mark VI proved catastrophic. Following the early 1980 withdrawal of the slow-selling Lincoln Versailles, Lincoln-Mercury dealers offered three highly similar vehicles across a wide price range in the same showroom. The discontinuation of the Versailles also marked the return of Lincoln exclusively to the full-size sedan segment, leaving nothing to sell against European-brand luxury vehicles.
For the 1981 model year, Lincoln underwent a revision to transition its full-size model range from three nameplates to one, commencing a multi-year transition throughout all three Ford divisions. For 1981, the Continental went on hiatus, with Lincoln shifting the nameplate to a mid-size sedan for 1982. The Mark VI ended its model cycle in 1983; for 1984, the Mark VII exited the full-size segment, shifting the Mark Series into a different market segment.
First generation (1981–1989)
A model year removed from the extensive downsizing of its full-size model range, the Lincoln division underwent a revision of its nameplates. Following the discontinuation of the compact Versailles sedan, Lincoln was left marketing six nearly identical vehicles (Continental, Continental Town Car, and Continental Mark VI, all offered both as two-door and four-door sedans). For 1981, the Lincoln Town Car was introduced, consolidating the Continental and Continental Town Car into a single model line slotted below the Continental Mark VI.
Identical to the 1980 Lincoln Continental, the Lincoln Town Car was offered as a two-door and four-door sedan (the Town Coupe nameplate was discontinued). Largely overshadowed by its Continental Mark VI counterpart, the Town Car two-door was discontinued for 1982. As the Continental Mark VII was introduced for 1984, Lincoln pared its full-size line down solely to the Town Car four-door sedan.
At the time of its launch, the Town Car had been slated for replacement by front-wheel drive model lines (in anticipation of further volatility in fuel prices); as fuel prices began to stabilize, demand initially rose for the model line, leading Lincoln-Mercury to produce the Town Car through the 1980s with few visible changes. Over 200,000 were sold in 1988, the highest ever for the model line. However, this increase was mostly due to an extended 1988 Town Car model year which ran from March 1987 to October 1988 instead of the usual 12-month period. Conversely, the 1987 Town Car with its shortened model year only had sales of just over 76,000. Although remaining Lincoln's top-selling model, calendar-year sales declined each year for the Town Car between 1986 and 1989. This decline was mostly blamed on its aging design and the increased popularity of the Continental which had been fully redesigned for 1988.
Chassis
The 1980–1989 Lincoln Continental/Town Car utilized the Panther platform shared with Ford and Mercury. Delayed to the 1980 model year due to engineering issues, the Panther platform meant radically different exterior dimensions for the Lincoln models. Although extended three inches in wheelbase over its Ford/Mercury/Mark VI coupe counterparts, the 1980-1989 versions would have the shortest wheelbase ever used for a full-size Lincoln at the time (10 inches shorter than its 1979 predecessor). The 1980 Continental/Town Car was the shortest Lincoln since the Versailles. In the interest of fuel economy and handling, the Panther chassis reduced weight by up to compared to the 1970-1979 full-size Lincolns. As the lightest full-size Lincoln in 40 years, the 1980 Continental/Town Car came within less than 200 pounds of the curb weight of the compact-sized Versailles. The new Panther platform meant reduced overall size, better suspension geometry, and upgraded power steering with a reduced turning diameter by over 8 feet (compared to the 1979 Lincoln Continental). For 1984, gas-pressurized shocks were added.
To achieve better Corporate Average Fuel Economy (CAFE) results, Ford discontinued the 400 and 460 big-block V8s in its full-size cars. For 1980, a 4.9 L V8 (the 302 engine was marketed as a "5.0 L" V8) was standard. A V8 was available as an option. Following the introduction of the Lincoln Town Car in 1981, the V8 became the only available engine (with the 351 becoming an option for Ford and Mercury). In Canada, the 302 V8 remained carbureted until 1985. In 1986, the 302 V8 was revised to , following a redesign of the fuel-injection system with the introduction of sequential multi-port fuel injection. These engines are identifiable by their cast aluminum upper intake manifolds with a horizontal throttle body (vertical throttle plate); this replaced the traditional throttle body with a carburetor-style top-mounted air cleaner previously used. Introduced in the Lincoln Continental for 1980 and marketed in all Panther-platform vehicles in 1981, the Lincoln Town Car was equipped with the 4-speed AOD automatic overdrive transmission, the sole transmission of 1981-1989 examples.
All Town Cars from 1980 through 1989 were available with an optional trailer towing package that included dual exhausts, a 3.55:1 limited slip differential (code 'K') and an improved cooling package for the engine and transmission.
Body
Exterior
During the late 1970s, the sales of the Lincoln Continental had held steady and the Continental Mark V would go on to outsell its Cadillac Eldorado counterpart. In the development of the Lincoln Town Car, the design themes of the 1977-1979 Lincoln Continental and Mark V would both influence the exterior design of the 1980 Continental/Town Car. As with its predecessors, the Town Car featured nearly flat body sides, sharp-edged fenders, and a radiator-style grille. Hideaway headlamps gave way to exposed halogen headlamps (the first on a full-size Lincoln since 1969). Another first included fully framed door glass (retractable vent windows were now standard); in contrast to its Ford and Mercury counterparts, the window frames were painted matte black. While chrome trim remained around the headlamps and window frames, in a break from Lincoln tradition, it was deleted from the top of the fenders. Though mechanically similar to the Ford LTD and Mercury Marquis (the Ford LTD Crown Victoria and Mercury Grand Marquis after 1983), the Lincoln Town Car shared visible body panels only with the Continental Mark VI. In contrast to its Ford, Mercury, and Mark VI counterparts, the rooflines of 1981-1989 Town Cars feature a vertical quarter window in the C-pillar.
After only 4,935 two-door Town Cars were sold in 1981, the body style was discontinued for 1982. In the shift from rebadging the Continental to the Lincoln Town Car for 1981, Lincoln replaced the "Continental" badging above the headlights with "Town Car", which was removed in 1984.
A padded roof was standard equipment on all Town Cars, with its design determined by trim level. On standard-trim Town Cars, a leather-grained vinyl full-length covering with center pillar coach lamps was fitted. For Signature Series and Cartier trims, a padded vinyl coach roof (covering the rear half of the roof) with a frenched (smaller) rear window opening was fitted; the coach roof was also an option on standard-trim Town Cars. On non-Cartier Town Cars, a full-length cloth (canvas) roof was an option; imitating the look of a convertible, the design deleted the C-pillar quarter windows.
During the 1980s, the Lincoln Town Car would undergo several exterior revisions. For 1985, the model was given a mid-cycle facelift. In addition to (slightly) improving its aerodynamics, the design was intended to visually shorten the car (though the length was essentially unchanged). The front and rear bumpers were redesigned, better integrating them into the bodywork. The rear fascia was redesigned; distinguished by redesigned taillamps, and the trunk lid was better integrated with the rear fenders. For 1986, to meet federal regulations, a center brake light was added in the rear window. For 1988, the grille was updated with a brushed-metal panel between the taillamps, which now featured the reverse lamps.
1989 models are distinguished by special trim features including satin black paint for grille blades, trim between headlights, and amber (instead of clear) front parking lamps. The "Lincoln" front-end badging is moved from above the left headlight onto the grille and changed to a large sans-serif script. In the rear, the brushed-metal panel was given a pinstripe finish and all badging was moved from the panel onto the trunk lid. All models feature a landau roof with a smaller, more formal "frenched" rear window. All non-Cartier models also include an embedded Lincoln "star" emblems in their opera windows
Interior
The interior of the Lincoln Town Car featured many advanced luxury options for its time. Signature Series and Cartier models featured 6-way power seats (and manual seatback recliners) for the driver and front passenger; the Lincoln Town Car adopted a split front bench seat previously seen on the Mark coupes. Several electronic features included an optional digital display trip computer showing the driver "miles to empty" and (based on driver input) an "estimated time of arrival". A keypad-based keyless entry system unlocked the vehicle through a 5-digit combination (factory-programmed or owner-programmed). Mounted above the driver's door handle, the keypad allowed the driver to lock all four doors; after entering the code, the driver could unlock the doors or release the trunk lid. Along with keyfob-based systems, the keypad system is still in use on Ford and Lincoln vehicles (as of 2021).
As part of the 1985 update, the Lincoln Town Car was the first Ford vehicle to feature a CD player as an option (as part of a 12-speaker JBL premium stereo system); while 1984 was the final year for the option of 8-track players and CB radios for the Town Car. In a functional change, the horn button was moved from the turn-signal lever to the steering wheel hub. The door trim was changed from wood to upholstery matching the seats.
For 1986, the front-seat head restraints were replaced with a taller 4-way articulating design; walnut burl trim replaced much of the satin black trim on the lower dash. For 1988, the instrument cluster was updated; for Town Cars with analog gauges, the instrument panel was given round dials in square bezels. In addition, new wood trim was added to the dashboard and steering wheel.
Trim
At its 1980 launch, the Lincoln Town Car was offered in two trim levels, a standard/base trim and a Lincoln Town Car Signature Series (a name shared with the Mark VI, though with less exclusive features). In 1982, Lincoln adopted the Mark-Series tradition of Designer Series editions as the Cartier Edition was shifted from the Mark VI to the Town Car, becoming the top trim level; the Cartier Edition would remain part of the Town Car line through the 2003 model year.
Special editions
Cartier Designer Edition
In 1982, in a trim level shift, the Cartier Edition was moved from the Mark Series to the Lincoln Town Car. As before, the special-edition package consisted of exclusively coordinated exterior colors and interior designs, with the Cartier logo embroidered in place of the Lincoln "star" emblem on the seats. For 1987, the package underwent a redesign with a new upholstery design and new two-tone (metallic beige) platinum added alongside the traditional platinum silver and two-tone arctic white.
Sail America Commemorative EditionThis special edition 1987 Signature Series model came in white with a blue carriage roof and had a white leather interior with blue piping and special badging. Ford Motor Company was one of the corporate sponsors of the "Sail America Foundation" syndicate, and owner of the 1987 America's Cup winning yacht Stars & Stripes 87.
Special EditionThe 1988 Town Car Signature Series was available with a $2,461 (~$ in ) 'Special Edition package', which included a carriage roof (giving the appearance of a convertible top), wire-spoke aluminum wheels, JBL audio system, leather-wrapped steering wheel, and leather upholstery with contrasting-color piping. This replaced a proposed Gucci edition Town Car that had been in the works.
Gucci Edition1989 Signature Series Gucci Edition had a special blue canvas roof with fluorescent B-pillar light and a special blue badge on the C-pillar with the word signature. It was designated in the VIN as code 84.
Marketing
For the 1985 model year, the Cadillac DeVille and Fleetwood, traditional competitors of the Lincoln Town Car, shifted to front-wheel drive platforms (although, the Fleetwood Brougham retained its rear-drive platform and styling). At the time, Lincoln marketed the larger size of the Town Car as a selling point. In response to the downsized Cadillacs, Lincoln introduced a series of advertisements in late 1985 titled "The Valet" which depicted parking attendants having trouble distinguishing Cadillacs from lesser Buicks (Electras) and Oldsmobiles (Ninety-Eights), with the question "Is that a Cadillac?" answered by the response "No, it's an Oldsmobile...or Buick." At the end, the owner of a Lincoln would appear with the line "The Lincoln Town Car, please." The commercial campaign saw the emergence of a new advertising slogan for the brand, "Lincoln. What a Luxury Car Should Be." which was used into the 1990s. The marketing campaign was unable to turn around declining Town Car sales. It was only after an all-new redesigned Town Car was introduced in 1989 for the 1990 model year that sales temporarily rebounded.
Production
Second generation (FN36/116; 1990–1997)
After ten years on the market (nine of them as the Town Car) relatively unchanged, the Lincoln Town Car was given an extensive redesign inside and out, being launched on October 5, 1989, as a 1990 model. In a move to bring a new generation of buyers to the Lincoln brand, the Town Car adopted a far more contemporary image, bringing it in line with the Continental and Mark VII. In addition, the Town Car adopted a new range of safety and luxury features and would mark the debut of a powertrain that would see usage in a wide variety of Ford Motor Company vehicles. The Town Car was named the 1990 Motor Trend Car of the Year.
The Town Car's redesign gave the model a significant sales boost in 1990, helping Lincoln achieve record total sales that year. The second-generation Town Car became one of the best-selling full-size U.S. luxury sedans. Town Car sales quickly declined again and would drop below 100,000 in 1995 for the first time in over ten years. This decline mirrored what had been going on in the luxury car market as buyers’ tastes shifted more towards nimbler, performance-oriented models, and eventually SUVs.
Following the discontinuation of the Cadillac Fleetwood by General Motors after 1996, the Lincoln Town Car became the longest-length regular-production sedan sold in the United States.
Development
The second-generation Town Car was developed from 1985 until 1989 under the codename FN36, at a cost of US$650 million, led by project manager John Jay. Following its downsizing to the Panther platform in 1980, the Lincoln Town Car was originally slated to be discontinued by the middle of the decade and replaced by a smaller front-wheel drive sedan; after the 1979 fuel crisis, gasoline prices were predicted to reach $2.50 per gallon and Ford Motor Company had lost $1.5 billion for 1980. However, by 1984, full-size Lincoln sales had rapidly increased, with 1984 sales up 300% over 1980. Instead of ending the product cycle of the Lincoln Town Car, Ford product planners instead chose its front-wheel drive mid-size platform (of the Ford Taurus) to become the next-generation Lincoln Continental.
In August 1985, Ford designers began sketching and constructing clay models of competing designs under lead designer Gale Halderman and Ford Group Design Vice President Jack Telnack, with a final design chosen in May 1986; two full-scale (1:1) proposals were reviewed by a four-member design committee, chaired by CEO Donald Petersen, Jack Telnack, Ford President Harold Poling, and William Clay Ford, vice-chairman. Various proposals were considered ranging from a conservative update of the existing Town Car to a European-style body in the design language of the 1988 Lincoln Continental (FN-9, designed in 1984).
The final compromise of the committee sought to keep the identity of the Town Car while introducing a contemporary vehicle for the 1990s. In the interest of fuel economy, the Lincoln Town Car was required to become more aerodynamic (reducing wind noise), but key parts of its design were integrated into its design, with its radiator-style grille, chrome trim, and opera windows. In a major design constraint, the design team was not to make any major reductions in size to the Town Car, preserving its large interior and trunk space as key marketing points to buyers.
In 1984, a second factor driving the design of the FN36 project was initiated, as the United States government introduced regulations mandating passive restraints on vehicles produced after September 1, 1989; along with automatic seat belts, out of necessity, automakers began to reconsider the use of airbags as passive restraints. By 1988, dual airbags remained nearly unused in cars sold in the United States, with the exception of the Mercedes S-Class (Mercedes-Benz W126) and the Porsche 944. To comply with the legislation, Lincoln introduced the 1988 Continental with dual airbags, becoming the first Ford Motor Company (and first domestically produced vehicle) with them standard. As adding airbags to the 1988-1989 Town Car would require a redesign of the steering column and entire dashboard, dual airbag were moved to the FN36 project, making them an intended standard feature.
In March 1986, the design freeze for the project occurred, with an intended production start of mid-1989. The second-generation Lincoln Town Car would become the first domestic Ford vehicle engineered outside of the company and constructed by foreign suppliers, with International Automotive Design of Worthing, West Sussex, England handling the engineering, while Japan-based Ogihara Iron Works supplying all of the Town Car body panels from its own factory near the Wixom plant. To improve quality of prototypes, project managers broke from automotive industry precedent, requiring successive hand-built prototypes to be built to production-level quality to determine the locations and causes of specific issues of tooling and manufacturing. From 1988 until 1989, the Town Car would go from over a year behind its production date to two weeks ahead of schedule.
Chassis
To lower the development and production costs of the extensive redesign, Ford Motor Company retained the Panther platform for the Lincoln Town Car, continuing its use of rear-wheel drive. In a major change, rear air suspension (introduced as an option for all three Panther vehicles in 1988) became standard equipment on all Town Cars. For 1990, the Town Car was produced with 11-inch rear drum brakes (identical to its 1989 predecessor); for 1991, they were replaced by 10-inch solid rotor disc brakes.
Due to development delays in the Modular engine program, the 1990 Lincoln Town Car was released with the same powertrain as its predecessor: the small block V8 engine with a 4-speed AOD overdrive automatic. In October 1990, the 302 (marketed as 5.0 L) V8 was replaced by a 4.6 L SOHC Modular V8 for 1991 models; for the 1994 model year, the optional 210 hp dual-exhaust version of the engine became standard. Shared with the Ford Crown Victoria and Mercury Grand Marquis, the SOHC version of the 4.6 L Modular V8 would see use in a number of other Ford vehicles within the Ford light-truck line, remaining in production into 2014. For 1993, the AOD transmission was converted to electronic operation, becoming the AOD-E. In 1994, along with a mid-cycle refresh, the 1995 Town Car received the higher-torque 4R70W from the Lincoln Mark VIII.
Body
The second-generation Lincoln Town Car was designed by Gale Halderman and Ford Group Design Vice President Jack Telnack.
Exterior
In its redesign for the 1990 model year, Lincoln stylists sought a completely new design for the Town Car. Many traditional Lincoln styling cues were heavily reworked or abandoned completely. Although the Town Car would keep its formal notchback sedan roofline, the flat-sided fenders and angular lines seen since the Continentals and Mark IIIs of the late 1960s disappeared. Stylists made the body more aerodynamic reducing the drag coefficient from 0.46 to 0.36 (matching the 1988 Continental and besting the Mark VII). The 1990 Town Car still retained several styling influences, including its vertical taillights, radiator-style grille, hood ornament, alloy wheels, and vertical C-pillar window. In a move to market the Town Car to buyers of contemporary vehicles, several other changes were made. Although two-tone paint remained available (featuring a lower body accent color in gray metallic), monotone paint schemes would become increasingly standard. In a major change, a vinyl roof was no longer offered, since vinyl roofs declined in popularity among many buyers. Spoked aluminum wheels were dropped from the options list for 1990, while locking wire wheel discs remained through 1992.
In late 1992, the exterior was given a minor update with a new grille and slightly redesigned tail lamp lenses (distinguished by a "checkerboard" pattern) for 1993 models. As with the Crown Victoria and Grand Marquis, the Town Car received a larger update for the 1995 model year in late 1994 as the FN116. This facelift is distinguished by the deletion of the fixed quarter glass in the rear doors along with the redesign of the side mirrors (enlarged and changed to body-color). Although the bumper largely remained unchanged, the front fascia was updated as the headlamp clusters are changed to a clear-lens design and separated from the grille. The grille was redesigned, returning to the 1990-1992 design in a surround fitting closer to the body. The rear fascia saw the trim between the tail lamps redesigned, featuring additional running lights, while the reverse lamps were moved from the outer edges of the reflector panel to the center, beneath the lid lock cover (similar to the 1985 - 1987 models).
Interior
In a departure from the Lincoln Continental and Mark VII, the use of the Panther platform necessitated a degree of component sharing with the Ford and Mercury counterparts. Although fitted with its own seats and door panels, the Town Car was fitted with essentially the same dashboard as the Mercury Grand Marquis (versions with digital instruments retained the instrument panel layout from 1988 until 1989). In 1993, the wood trim was changed to an orange-toned walnut. Due to its popularity (and to better separate the Town Car from its Ford/Mercury counterparts), the digital instrument panel was made standard; as such, the climate-control system was converted to a digital display. New for the 1995 model year was an integrated, voice-activated in-car cellular telephone concealed in the center armrest, which featured a speakerphone as well as a rearview mirror-mounted microphone for hands-free calling.
As part of its 1995 Mid-cycle refresh, the interior saw a greater degree of change than the exterior. To bring the design up to date (and in line with the rest of the Lincoln line), the dashboard and door panels featured a curved design, while influenced by the Mark VIII, the 6-passenger design of the Town Car precluded the adoption of a center console in the interior. To increase storage space, the dual center armrests of the front seats on Signature and Cartier models were redesigned to include storage compartments (to hold cassettes and the optional cellular telephone). The dashboard design continued into the new door panels, now with an illuminated power window and seat adjuster cluster, and a back-lit power door lock switch placed higher on the door. Releases for the trunk and fuel door were moved from the dashboard onto the lower driver's door. Redesigned seat patterns now offered an available driver and front passenger electric heat feature. The radio antenna was integrated into the rear window. Although the basic controls of the interior remained common across all Panther vehicles, the Town Car gained a model-specific instrument panel, featuring italicized readouts.
For 1996, the climate controls were again redesigned; while Cartier Designer Editions featured genuine wood trim on the dashboard and door panels. In 1997, a few changes were made, the rear center armrest added a pair of cup holders, while Cartier models gained rear-seat vanity mirrors mounted in the headliner. Also in 1997, the trim level badges were moved to the front fenders in place of the "Town Car" badges. Subsequently, the rear side opera windows no longer featured their trim-level engravings.
Trim
Upon its redesign in October 1989, the Lincoln Town Car carried over its three previous trim levels: base, Signature Series, and Cartier Designer Edition. For 1991, the base trim was renamed Executive Series. From 1989 through 1996, the Lincoln Town Car was available with a factory towing package.
The Base (Executive Series from 1991MY onward) Town Car offered six-passenger seating with two bench seats, a four-speaker AM/FM stereo with cassette player, 6-way front power seats, a four-speed automatic overdrive transmission, cloth seating surfaces, fifteen-inch tires, dashboard clock, and keyless entry with Ford's SecuriCode keyless entry keypad.
The Signature Series added a digital vacuum fluorescent instrument cluster, trip computer, and standard alloy wheels. The Cartier Edition was fitted with the same features as the Signature Series, adding a JBL-branded sound system with an amplifier, a security system, alloy spoked wheels, and other details, such as cloth and leather seats. In a departure from tradition, starting in 1990, Cartier Designer Edition Town Cars were no longer available in a single color combination yearly, but in several different interior/exterior combinations. In addition, aside from gray lower body trim offered as an option for Signature Series Town Cars, Cartier Editions became the only two-tone versions of the Town Car.
Special editions
In addition to the three standard trims of the Lincoln Town Car, various special edition option packages were produced by Lincoln (excluding dealer-produced versions).
Jack Nicklaus Signature Series (1992-1997)The Jack Nicklaus Signature Series was a special-edition option package for the Town Car Signature Series featured a green exterior with a white top; the interior consisted of white leather with green accents. Another version of the package was sold with a white exterior and a standard roof; the interior trim was similar, with white leather seats and green carpets and trim.
Most Jack Nicklaus editions have ornaments and wording on the exterior trimmed in gold including green and gold "Golden Bear" badges on the front fenders. Options included on 1992 through 1997 Jack Nicklaus Signature Series included memory seats with power lumbar/recliner, leather seats, and monotone paint.
Regatta Edition (1994)The Regatta Edition was a maritime-themed special-edition option package for the Signature Series, with approximately 1,500 produced. The package consisted of White Oxford leather seats (with optional blue seat piping), with regatta blue carpeting; the doors and instrument panel featured matching blue-color trim.
The package was often paired with a white oxford vinyl carriage roof featuring embroidery on the C-pillar near the opera windows.
Spinnaker Edition (1995)Replacing the Regatta Edition, the Spinnaker Edition option package featured tri-coat paint, two-toned leather seats, the Spinnaker logo on the floor mats, and 16" spoked aluminum wheels.
Diamond Anniversary Edition (1996)To commemorate the 75th anniversary of Lincoln in 1996, the division sold a Diamond Anniversary Edition of the Town Car Signature Series (alongside the Continental and Mark VIII). Featuring a unique accent stripe, leather seats, wood instrument panel trim, window badging, cellular telephone, power moonroof, JBL audio system, auto electro-chromatic dimming mirror with compass, and traction assist, the Diamond Anniversary Edition included nearly every available option on the Lincoln Town Car.
Cypress Edition (1996)The Cypress Edition of the Signature Series featured Cypress Gold Frost exterior paint, a two-toned leather interior, and red Cypress tree badging.
Features
At its 1990 redesign, the Lincoln Town Car was offered with relatively few options, with nearly all features as standard equipment. On the Signature Series, the only options were leather seat trim, a moonroof, a 10-disc CD changer, a JBL sound system, a security system, and an onboard telephone.
The redesign highlighted several new features that had never been available before on the Town Car. A two-position driver's memory seat was standard on Cartier Editions (optional on Signature Series); the memory seats featured an 8-way adjustment for both seats and inflatable lumbar support. While technically a carryover feature from 1989, the Electrochromic Dimming Mirror was redesigned for the much wider rear window of the new Town Car.
A number of advances were made in the safety features available for the Lincoln Town Car, with ABS becoming an optional feature in 1990. Following the return of 4-wheel disc brakes to the Town Car in 1991 (for the first time since 1979), ABS became standard in 1992. Initially, the 1990 Town Car came with dual airbags as standard equipment. However, due to a March 14, 1990 fire at the facility where the passenger airbag's propellant was produced, the passenger airbag essentially became a delete option, with a credit on the window sticker issued for the price of the missing airbag. Upon the owner's request, for the price of the issued credit, the passenger airbag would be installed once supply became available. By the beginning of the 1992 model year, all Town Cars come equipped with dual airbags from the factory.
Production
Safety
National Highway Traffic Safety Administration (NHTSA) 1990 Lincoln Town Car Crash Test Ratings
Frontal Driver:
Third generation (FN145; 1998–2011)
The third generation of the Lincoln Town Car was unveiled at the 1997 New York International Auto Show, going on sale in November 1997. For the 1998 model year, all three Panther-platform sedans underwent complete exterior and interior redesigns, with the Town Car given the most extensive revision. Shifting away from the straight-lined design language used by full-size Lincoln sedans for over 35 years, the 1998 Town Car adopted the rounded exterior of the Lincoln Mark VIII and 1995 Lincoln Continental. The third-generation Town Car was introduced nearly concurrently with the Lincoln Navigator, the first SUV sold by the Lincoln division.
Due to organizational restructuring, the third generation Town Car marked several changes within Lincoln-Mercury. From 1999 to 2002, the Lincoln-Mercury division became a brand of Premier Automotive Group, a division of Ford created to manage its premium automotive brands acquired during the 1990s; following organizational difficulties (leading to Lincoln once again falling behind Cadillac in sales by 2000), Lincoln-Mercury was restored under its previous divisional structure during 2002. As part of The Way Forward, the 2007 closure of Wixom Assembly Plant was announced, initially putting the future of the Town Car at risk. To continue the Town Car, for the 2008 model year, production was transferred to the St. Thomas Assembly plant in Canada, alongside the Ford Crown Victoria and Mercury Grand Marquis.
Chassis & Powertrain
Under the hood, the 4.6L V8 received a power increase to 205 hp on single exhaust versions and 220 hp on dual exhaust versions. In a functional change, the coil packs were replaced by a coil-on-plug ignition system. Also, fail-safe cooling was introduced; it included a two-speed electronic radiator fan. Additionally, the 4R70W transmission was carried over and mandated the use of Ford's Mercon V fluid. Visually, several components were re-located; the coolant reservoir was moved from the passenger fender well and onto the radiator fan shroud, while the power steering reservoir was moved from the driver-side fender well to the front of the engine. Notably, the Town Car received an engine knock sensor; its Ford and Mercury counterparts did not receive one until 2003.
For the 2001 model year, the 4.6L V8 received "Performance Improved" (PI) cylinder heads, which increased horsepower to 220 hp on single exhaust versions and 235 hp on dual exhaust versions.
Body
Exterior
While three inches shorter than its 1997 predecessor, the 1998 Town Car gained two inches in width and an inch in height (becoming the tallest Lincoln sedan in 40 years). In a major break from Lincoln styling tradition, the Town Car abandoned many of the straight-edged lines of its predecessor. Adopting styling cues of the outgoing Mark VIII and the 1995 Continental, the Town Car adopted a curved design scheme in place of the previous straight-lined body. While the radiator grille was retained, its rectangular shape was changed to oval (its waterfall pattern was adopted by the Lincoln Navigator introduced alongside it), and the hood ornament was deleted.
The curved design scheme carried further to the rear of the Town Car, in the C-pillar (losing its opera windows) into the trunk lid. To differentiate from its Mercury counterpart, the Town Car switched to individual tail-lamps, deleting the filler panel on the trunk lid; a large chrome surround was used on the trunk lid to mount the license plate.
With the introduction of the Town Car L in 2001, the wheelbase was stretched by six inches. To produce the variant at a lower cost, the B-pillar was widened on 2001-02 versions to use the existing rear door assembly of the standard Town Car.
Interior
As with its predecessors, the 1998 Lincoln Town Car visibly shares few common interior parts with its Ford and Mercury counterparts (aside from its steering column and radio). To improve ergonomics, power seat controls on Signature and Cartier models are relocated from the seat to door panel (Executive Series, in 1999). Seat-mounted side airbags become standard on all Town Cars for 1999. In the same year, the Executive Series regained its rear-seat center armrest (initially deleted in a cost-cutting move). A new in-vehicle telematics system, called "RESCU", included a rearview mirror with integrated microphone and SOS and roadside assistance buttons, and replaced the previous in-car telephone with a portable Motorola Timeport cellular telephone that now featured voice recognition. The system was discontinued after the 2003 model year.
2003 Update and Re-engineering
Ford re-engineered the Panther platform for 2003, with the Lincoln Town Car once again receiving the most extensive revisions of all Panther platform vehicles. Despite these updates, the Town Car remained as a third-generation model until the end of production in 2011.
Extensive chassis updates were made, which included a new frame; it now utilized hydro-formed frame rails, an aluminum #2 cross-member, and was also fully boxed. According to Lincoln, the new frame improved safety as well as chassis rigidity; its resistance to vertical bending was increased by 20% and overall rigidity by 24%. The long running recirculating ball steering setup was replaced by a speed-sensitive rack and pinion setup; it was lighter than the outgoing unit, featured electronic variable assist, and increased steering precision while also reducing service complexity. For more precise handling, aluminum front lower control arms, new front upper control arms, updated steering knuckles, and coil-over front shocks were all adopted. Inverted mono-tube rear shocks were also introduced; they were also mounted to the outside of the frame rails. Moreover, improved brakes were introduced that featured a quiet EBD brake booster and mechanical panic assist; they optimized front-rear brake bias. To add, these revisions required that the Town Car use larger, 17-inch wheels with a high positive offset (flat-face design).
Mechanically, the Town Car also received several updates. A slightly revised 4.6L V8 was now paired to dual exhaust on all Town Cars; the exhaust system was also completely redesigned, with exhaust hangers now mounted to the frame rails for a reduction in NVH. These changes resulted in the Town Car producing 239 hp and 287 lb-ft of torque; this would be the final power increase for the Town Car. For better off-the-line acceleration, all Town Cars received a 3.27:1 rear axle ratio (shared with the Crown Victoria Police Interceptor). To increase oil life, the engine oil pan's capacity was enlarged to 6 quarts. Furthermore, a variable-speed electronic radiator fan replaced the outgoing two-speed unit. For improved carbon emissions, the EGR system was updated, and the fuel system was now return-less. Visually, the updated engine could be distinguished from its 2002 predecessor by a new engine cover, which featured a silver "V8" emblem, fan-shroud mounted power steering reservoir (formerly bolted to the engine), passenger-side oil fill cap (was on the driver side), passenger-side engine fuse box (was on the driver inner fender), and an accessory belt guard.
Until the end of production, minor mechanical revisions would continue to be made. For 2005, the Town Car adopted electronic throttle control; the move necessitated that the cruise function be moved to the engine computer and also required further electronic controls for the transmission (now renamed as the 4R70E). Furthermore, the 28-spline axle was replaced by an improved 31-spline unit. In a minor change, the Town Car received a heated PCV valve.
For 2006, the transmission received internal revisions once again and was renamed as the 4R75E.
All Town Cars received Flex Fuel capability for 2009, enabling them to run on E85, gasoline, or any mixture of both.
Exterior (2003-2011)
As part of the 2003 update, the entire body of the Town Car was restyled in an evolutionary fashion. To bring it in line with contemporary Lincoln vehicles, the lower body was squared off and the oval grille was redesigned in the style of the Lincoln LS; the hood ornament made its return after a 5-year absence. Additionally, the extended wheelbase Town Car L received model-specific lengthened rear doors. Also, the long-running Town Car badges were deleted from the front fenders. Moreover, while styled similarly to its 2002 predecessor, the rear fascia was updated, and the Town Car badge returned to the trunk lid for the first time since 1997.
Interior (2003-2011)
Several revisions were also made to the interior for 2003. While the dashboard was carried over from 2002, the center stack was streamlined; it featured a new radio, climate controls, and an analog clock (the latter was previously exclusive to the Cartier). In a minor change, the instrument cluster was updated with new gauge faces. Moreover, new seats were introduced with improved leather upholstery and larger front headrests for improved safety. Additionally, the door panels were redesigned with improved fit and finish. Alongside the Lincoln LS, the 2003 Town Car introduced an optional DVD-based satellite navigation system designed by Pioneer; it was later paired with THX sound processing. With the exception of the Executive Series, ultra-sonic parking assist was now standard alongside a power-open/close trunk lid.
Minor interior revisions would continue to be made: In 2005, the Town Car received a re-designed steering wheel and column as well as a front passenger weight sensor; it allowed for the restraint system to automatically enable or disable the front passenger airbag as needed. For 2006, the gauge cluster was revised and now featured a tachometer. Due to a new federal safety regulation, recessed window switches were introduced for 2009. Lastly, in 2011, updated head restraints were introduced in compliance with new federal safety standards.
Trim
The third generation Lincoln Town Car was initially produced in four trim levels: Executive Series, Signature Series, Signature Touring Sedan, and Cartier; trims would be re-structured several times until the end of production in 2011.
The base Executive Series offered standard rear air suspension, Lincoln's SecuriLock anti-theft system, Lincoln's SmartLock anti-lockout system, automatic headlamps, heated mirrors, all-speed traction control, an electronic message center with Lincoln's "Tripminder", anti-lock brakes, leather seats with an 8 way power driver seat/6 way power passenger seat (cloth was optional for 1998, front passenger seat became 8-way power in 1999), leather wrapped steering wheel with cruise control functions, a premium AM/FM/Cassette stereo with four speakers, electronic automatic temperature control (EATC), seat-mounted side airbags (1999 and newer), and 16" "Gear Tooth" aluminum wheels.
The mid-level Signature Series added an Alpine AM/FM/Cassette stereo (1998-2002), a two-driver memory function for the driver seat and mirrors, an electronic auto-dimming rear view mirror with a built in compass, two-way front seat head restraints and a front passenger lumbar function, a steering wheel with redundant audio/temperature controls, and 16" "Snowflake" aluminum wheels. Available equipment on the Signature series included heated front seats, a power moon roof, a six-disc CD changer, an integrated cellular phone, white-wall tires, and two tone paint.
From 1998-2002, the Signature Touring Sedan was slotted above the Signature Series. It was Lincoln's counterpart to the Handling and Performance Package offered on the Crown Victoria and Grand Marquis. Signature Touring models featured a 3.55:1 rear axle ratio for improved acceleration, a higher-stall 11.25-inch torque converter, dual exhaust, re-tuned suspension components with larger stabilizer bars & sport tuned steering, perforated leather seats, black birds-eye maple interior trim, an argent grille, monochromatic body-side moldings, and wider 16" "Chrome-Tech" wheels on touring tires.
The range-topping Cartier featured unique leather seat trim, heated front seats, dual exhaust, an analog dash clock, Cartier exterior badging, black Lincoln emblems, and 16" "Cartier" chrome aluminum wheels. Many of its free-standing options were shared with the Signature Series. A gold package was also available for the Cartier trim; it featured gold exterior badging.
For 2001, the trim levels were expanded as a six-inch extended wheelbase Town Car was introduced and marketed towards livery and limousine services. To accommodate the extended wheelbase, the B-pillars were widened; this was also done to facilitate the use of the same rear doors from the standard-wheelbase version. It was offered as both an Executive and Cartier version (named Executive L and Cartier L). According to Lincoln, the extended wheelbase offered an additional 7.8 cubic feet of passenger volume. Additionally, the Cartier L was equipped with rear illuminated vanity mirrors, heated rear seats, 4-way adjustable rear head restraints, and a center armrest that featured redundant controls for the radio, climate controls, and front passenger seat track to allow for more legroom.
A Premium Package was offered for both the Signature and Cartier trims from 1998-2002. It featured a six-disc CD changer and power moon roof. For 2002, the Premium package became a standalone trim level and was slotted above each respective trim that it was based on (Premium Signature Series, Premium Signature Touring, and Premium Cartier); it was not offered as an extended wheelbase version.
For its 2003 update, the Signature Touring Sedan was dropped from the lineup. The "Series" suffix was also dropped from the Executive and Signature (on sales brochures, in 2004). In addition, the long-wheelbase Executive L was restricted to fleet sales.
In 2004, several changes were made to the trim lineup. All Premium trims were dropped, and the standard wheelbase Executive was restricted to fleet sales. Furthermore, all iterations of the Cartier were discontinued; they were replaced by the new range-topping Ultimate/Ultimate L. The Ultimate trim was short-lived, as it was discontinued for 2005.
Trim levels were once again re-structured for 2005 as the Town Car was now offered in three trim levels for retail sale: Signature, Signature L, and Signature Limited.
Merely a retail version of its Executive L counterpart, the Signature L featured the same "Rear Seats Amenities Package"; it included heated rear seats, 4-way rear passenger headrests, dual rear cup holders with a tissue bin, rear seat illuminated visors, and a center armrest that featured redundant controls for the radio, climate controls, and front passenger seat track to allow for more legroom.
The new top-trim Signature Limited included a Soundmark Audiophile dual-media AM/FM/CD/Cassette radio with digital signal processing, 8 speakers, a subwoofer, and a 150 watt amp; heated front seats; power adjustable pedals with memory; an easy entry/exit driver seat; a full power trunk lid; power moon roof; as well as a wood trim steering wheel. Available options for the Signature Limited included HID headlamps, a THX certified audio system with satellite navigation, a power moon roof, a trunk organizer, 17" fluted aluminum wheels, and two tone paint; all optional equipment (except the moon roof) was shared with the Signature L.
In 2006, a Designer series trim was introduced and slotted above the Signature Limited as the new flagship Town Car. Designer models included a Provence leather interior with two-tone door panels, adjustable rear-seat headrests, brushed aluminum scuff plates, additional chrome exterior trim, and 17" 18-spoke chrome-aluminum wheels.
Coinciding with the shift in assembly plants, for 2008, the base Signature and top-trim Designer were permanently discontinued, leaving the Signature Limited and Signature L as the sole remaining models for retail sale until the end of production in 2011; the fleet-only Executive and Executive L would also continue until 2011. Furthermore, many available options were standardized or deleted outright, leaving HID headlamps, daytime running lamps, white-wall tires, 17" 18 spoke chrome-aluminum wheels and a trunk organizer as the only remaining options.
Special editions
Limited EditionFrom 2003-04, Lincoln offered a Limited Edition package for the Ultimate trim; it had Limited badges on the C-pillar, fog lights, heated and memory seats, as well as Arden inserts in the rims and grille. For 2005, the Limited Package was now offered on the Signature Limited with two-tone paint schemes (in addition to two-tone seats); the fog lights were also deleted from the package.
Pro SeriesOffered in 2004, a special Pro-series badge was placed on the C-pillars; having the background of a golf course. This badge was stitched onto the front seats, in addition to having chrome 9-spoke rims and a two-tone color scheme.
25th Anniversary EditionLincoln commemorated the 25th anniversary of the Town Car by offering a 25th Anniversary Edition package on the 2006 Signature Limited. The package included chrome B-pillar and door handles, unique Eucalyptus wood applique and matching steering wheel with wood inserts, scuff plates with "25th Anniversary Edition" and "25th-anniversary" badging, Provence leather individual 40/20/40 lounge seating with individual comfort, shirring, contrast piping and rear seat adjustable headrests, fog lamps, and 9-spoke chrome wheels.
Continental EditionOffered in 2010-11 was the Continental Edition package; available as an option only on the Signature Limited trim. The package added Continental badging, chrome 17-inch wheels, and accents to the B-pillars. On the interior, the Continental name was embroidered on the front seats and front floor mats.
Safety
The Lincoln Town Car was the first production sedan in the world to receive US five-star crash ratings in every category.
National Highway Traffic Safety Administration (NHTSA) 2003 Lincoln Town Car Crash Test Ratings (with side airbags)
Frontal Driver:
Frontal Passenger:
Side Impact (Driver):
Side Impact (Passenger):
Rollover:
National Highway Traffic Safety Administration (NHTSA) 1998* Lincoln Town Car Crash Test Ratings (with side air bags)
Frontal Driver:
Frontal Passenger:
Side Impact (Driver):
Side Impact (Passenger):
Rollover: N/A
Due to late airbag deployment and resultant injury risks, the Town Car was rated only "Acceptable" in the frontal offset test. Lincoln modified the deployment characteristics for the driver airbag in May 2003, which led to an improved rating of "Good" in the re-test.
Head restraints were updated for 2011, however, they were not re-tested by the IIHS.
Variants
Trim level timeline
Livery variants
Featuring a standard V8 engine, body-on-frame design, rear-wheel drive and large exterior and interior dimensions, the Town Car became popular in livery and commercial service. In commercial service, the typical Lincoln Town Car saw a life expectancy of well over 400,000 miles. Its basis on the Ford Panther chassis gave it powertrain and suspension commonality with the Mercury Grand Marquis and the Ford LTD Crown Victoria (later the Crown Victoria). This design made them durable even in the rough conditions taxi and livery cars are subjected to, and easy and cheap to repair when they did suffer damage.
The Lincoln Town Car was popular as a stretch limousine donor chassis; it was the most commonly used limousine and chauffeured car in the United States and Canada. Hearses and funeral cars were also built on the Town Car chassis, through Ford's QVM program; the chassis was modified by coachbuilders for use in the funeral business, though Cadillac has always dominated in this market.
Presidential State Car
A 1989 Lincoln Town Car was commissioned by United States President George H. W. Bush as the Presidential State Car of the United States to succeed the 1983 Cadillac Fleetwood used during the Ronald Reagan administration. The Presidential Town Car limousine arrived in 1989 and was the state car for the entire presidency of George H. W. Bush. It was succeeded by a 1993 Cadillac Fleetwood, used by his successor, Bill Clinton. As of 2021, the 1989 Lincoln Town Car is currently the last Lincoln vehicle to have served as a Presidential State Car.
Town Car L
A new "L" designation was used for extended-wheelbase Town Cars from 2000 to 2011. The L editions offered an additional of rear-seat legroom, as well as remote access audio and climate controls mounted in the rear center armrest. Also included was a two-way travel switch for the front passenger seat base (a feature shared with the extended-wheelbase Jaguar XJ). The L designation was applied to the top-of-line Cartier (2000–2003), Ultimate (2004 only), and Signature (2005–2011) trim levels. Fleet buyers received it under the Executive L trim designation.
For 2000–02 versions, the "L" edition is identified by a widened B-pillar, bearing the Lincoln "star" ornament; maintaining parts commonality with the standard Town Car. The 2003-2011 "L" editions had longer rear doors, featuring wider versions of the fixed windows.
Ballistic Protection Series
Starting in 2003, the Lincoln Town Car had been available featuring ballistic protection from the factory. Adding nearly $100,000 to the base price, the armored body and bulletproof glass increased the curb weight of the Town Car to nearly . Other changes included the suspension and brakes. A few dealers in the US were authorized to sell this series.
Hongqi CA7460
In China, FAW produced a licensed version of the Lincoln Town Car rebadged as the Hongqi CA7460(红旗,Red flag CA7460) and Hongqi Qijian(红旗旗舰,Flagship) from November 10, 1998 until 2005. The limousine version is currently called the Hongqi Limousine L1, L2 and L3 respectively. Pricing in 1998 was at 690,000 RMB (US$109,710) while limousines were added to the range. The L3 was introduced in 2001 and had a wheelbase of . For 2002, the L1 was introduced and had a wheelbase of and the L2 was introduced in 2003 and had the longest wheelbase out of the three with . Pricing for the limousine variant was 1,350,000 RMB (US$214,650).
Sales
Discontinuation
During the 2000s, in spite of declining sales, the Town Car remained one of the highest-selling American-brand luxury sedans. Outside of retail markets, it was the most used limousine and chauffeured car in the United States and Canada.
In 2006, as part of The Way Forward, Ford considered ending production of Lincoln's largest model as part of the 2007 closing of the Wixom Assembly Plant. Industry observer George Peterson said "It blows everybody’s mind that they are dropping the Town Car. Just think what Ford could do if they actually invested in a re-skin of Crown Victoria, Grand Marquis, and Town Car." Ultimately, Wixom Assembly was closed following the 2007 model year, with the production of the Town Car consolidated with the Ford Crown Victoria, Ford Crown Victoria Police Interceptor, and Mercury Grand Marquis in Canada at St. Thomas Assembly; the first Canadian-produced Town Car was assembled on January 10, 2008.
Following the 2007 model year, however, the Town Car was discontinued for retail sale in Canada, available exclusively for fleet and livery customers afterward. In 2009, the fate of all three Panther-platform models was determined when Ford announced the 2011 closure of the St. Thomas Assembly Plant. For the limousine and livery markets, Ford had promised availability of the Town Car through the 2011 model year; retail sales continued on a limited basis in the United States and for export. In 2010, Ford announced the closure of the Mercury brand at the end of the year, effectively making the Town Car the final model line sold for retail sale produced by St. Thomas Assembly (retail sales of the Crown Victoria ended after 2007).
On August 29, 2011, the final Town Car rolled off the assembly line, without any fanfare or announcement from Ford; St. Thomas Assembly produced its final vehicle (a 2012 Crown Victoria for export) on September 15, 2011.
While Lincoln has not developed a direct successor to the model line following its 2011 discontinuation, the use of the nameplate returned for 2012, denoting a variant of the Lincoln MKT designed for limousine/livery use. The MKT was discontinued after the 2019 model year without a direct replacement, marking the final use of the Town Car name; the nameplate was in use for 49 continuous years by Lincoln (30 as a distinct model line, 11 as a sub-model of the Continental, 8 of the MKT).
Awards
The Town Car has received several awards and recognitions.
Forbes magazine repeatedly named the Town Car one of the best cars to be chauffeured in along with other, often more expensive flagship sedans, such as the Mercedes-Benz S-Class, BMW 7 Series and Lexus LS. The Town Car Signature L features a rear seat comfort package which not only provides rear seat passengers with audio system and rear compartment climate controls, but also features a control function which allows for the rear seat occupants to move the passenger seat forward, a feature exclusive to few ultra-luxury sedans. In addition to its many amenities, the Signature L also features an unrivaled of rear legroom, and of rear shoulder room.
In 1990, upon the introduction of the second generation Town Car, the vehicle was named Motor Trend Car of the Year. However this award was later included by Car and Driver in a list of the poorly chosen car of the year award winners. Motor Trend has changed the criteria by which it awards its highest accolade: Originally, Car of the Year awards went to the vehicle model which was the most significantly improved over the previous year's design in all respects. Currently, no such consideration is given to contenders for this award, and vehicles are considered for the award even if in their first year of production.
See also
Ford Crown Victoria/Police Interceptor
Mercury Grand Marquis/Marauder
Ford Panther platform
Lincoln Mark Series
References
Flagship vehicles
Full-size vehicles
Limousines
Town Car
Rear-wheel-drive vehicles
Sedans
Cars introduced in 1980
1990s cars
2000s cars
2010s cars
Motor vehicles manufactured in the United States
Ford Panther platform
Cars discontinued in 2011
|
```javascript
/*
* Wire
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* 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
*
*/
import {Runtime} from '@wireapp/commons';
import {Shortcut} from 'src/script/ui/Shortcut';
import {ShortcutType} from 'src/script/ui/ShortcutType';
describe('Shortcut', () => {
const map = Shortcut.shortcutMap;
describe('getShortcut', () => {
describe('webapp', () => {
beforeEach(() => {
spyOn(Runtime, 'isDesktopApp').and.returnValue(false);
});
it('can get shortcut for mac', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(true);
const mac_shortcut = Shortcut.getShortcut(ShortcutType.ADD_PEOPLE);
expect(mac_shortcut).toBe(map[ShortcutType.ADD_PEOPLE].shortcut.webapp.macos);
});
it('can get shortcut for pc', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(false);
const pc_shortcut = Shortcut.getShortcut(ShortcutType.ADD_PEOPLE);
expect(pc_shortcut).toBe(map[ShortcutType.ADD_PEOPLE].shortcut.webapp.pc);
});
});
describe('electron', () => {
beforeEach(() => {
spyOn(Runtime, 'isDesktopApp').and.returnValue(true);
});
it('can get shortcut for electron mac', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(true);
const mac_shortcut = Shortcut.getShortcut(ShortcutType.ADD_PEOPLE);
expect(mac_shortcut).toBe(map[ShortcutType.ADD_PEOPLE].shortcut.electron.macos);
});
it('can get shortcut for electron pc', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(false);
const pc_shortcut = Shortcut.getShortcut(ShortcutType.ADD_PEOPLE);
expect(pc_shortcut).toBe(map[ShortcutType.ADD_PEOPLE].shortcut.electron.pc);
});
});
});
describe('getShortcutTooltip', () => {
describe('webapp', () => {
beforeEach(() => {
spyOn(Runtime, 'isDesktopApp').and.returnValue(false);
});
it('can create a beautified tooltip for webapp mac', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(true);
const mac_shortcut = Shortcut.getShortcutTooltip(ShortcutType.ADD_PEOPLE);
expect(mac_shortcut).toBe('K');
});
it('can create a beautified tooltip for webapp pc', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(false);
const pc_shortcut = Shortcut.getShortcutTooltip(ShortcutType.ADD_PEOPLE);
expect(pc_shortcut).toBe('Ctrl + Shift + K');
});
});
describe('electron', () => {
beforeEach(() => {
spyOn(Runtime, 'isDesktopApp').and.returnValue(true);
});
it('can create a beautified tooltip for webapp mac', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(true);
const mac_shortcut = Shortcut.getShortcutTooltip(ShortcutType.ADD_PEOPLE);
expect(mac_shortcut).toBe('K');
});
it('can create a beautified tooltip for webapp pc', () => {
spyOn(Runtime, 'isMacOS').and.returnValue(false);
const pc_shortcut = Shortcut.getShortcutTooltip(ShortcutType.ADD_PEOPLE);
expect(pc_shortcut).toBe('Ctrl + Shift + K');
});
});
});
describe('getBeautifiedShortcutMac', () => {
it('can create a beautified shortcut', () => {
const mac_shortcut = Shortcut.getBeautifiedShortcutMac('command + q');
expect(mac_shortcut).toBe('Q');
});
});
describe('get_beautified_shortcut_pc', () => {
it('can create a beautified shortcut', () => {
const pc_shortcut = Shortcut.getBeautifiedShortcutWin('alt + F4');
expect(pc_shortcut).toBe('Alt + F4');
});
});
});
```
|
Amos 9 is the ninth (and the last) chapter of the Book of Amos in the Hebrew Bible or the Old Testament of the Christian Bible. This book contains the prophecies attributed to the prophet Amos; in particular, the seventh, eighth, and ninth chapters contain visions and their explanations. It is a part of the Book of the Twelve Minor Prophets.
Text
The original text was written in Hebrew language. This chapter is divided into 15 verses.
Textual witnesses
Some early manuscripts containing the text of this chapter in Hebrew are of the Masoretic Text tradition, which includes the Codex Cairensis (895), the Petersburg Codex of the Prophets (916), and Codex Leningradensis (1008).
Fragments containing parts of this chapter were found among the Dead Sea Scrolls including 4Q82 (4QXIIg; 25 BCE) with extant verses 1, 5–6, 14–15; and Wadi Murabba'at (MurXII; 75–100 CE) with extant verses 1–15.
There is also a translation into Koine Greek known as the Septuagint, made in the last few centuries BCE. Extant ancient manuscripts of the Septuagint version include Codex Vaticanus (B; B; 4th century), Codex Alexandrinus (A; A; 5th century) and Codex Marchalianus (Q; Q; 6th century).
Verse 9
For, lo, I will command,
and I will sift the house of Israel among all nations,
like as corn is sifted in a sieve,
yet shall not the least grain fall upon the earth.
"Sift": The Israelites were to be tossed about through all nations as corn is shaken about in a sieve, in such a way, however, that while the chaff and dust (the wicked) fall through (perish), all the solid grains (the godly elect) remain (are preserved), (; ). So spiritual Israel's final safety is ensured (; ; ).
Verse 11
[The Lord says:] "In that day will I raise up the tabernacle of David that is fallen,
and close up the breaches thereof;
and I will raise up his ruins,
and I will build it as in the days of old:"
This verse is quoted by James, brother of Jesus () (mostly from the Greek translation) to confirm that the Church of God is open to all people, Jews or Gentiles.
"The tabernacle": (Hebrew: sukkah) or "hut", "tent" (as ); a "little house" ().
"Fallen...breaches...ruins" In the Talmud the Messiah (in Greek: "Christ") is called "the Son of the fallen." Amos heaps upon one another the words implying destruction, referring to the fall of David's kingdom into ruins by the Chaldeans, but the fallen "hut of David" will be "raised up", "'their (feminine form)' breaches" will be "closed up" (literally "walled up") and "'his' ruins," will be "built" up by God "that 'they' (masculine form; verse 12) may inherit". Using a variety of numbers and genders, this verse and the next one speak of one living whole, the 'Jewish Church', that once was "breached" in two by the great schism of Jeroboam, but will be reunited into one body, "as in the days of old", before the separation of the ten tribes, when all Israel worshiped as one. Interpreted spiritually, it foreshadows the rising of the universal Church of Christ from that of the Jews.
Verse 12
"that they may possess the remnant of Edom
and all the nations who are called by my name,"
declares the Lord who does this.
"Edom" from , Septuagint renders it as "mankind" (cf. Acts 15:17).
Verse 14
And I will bring again the captivity of my people of Israel,
and they shall build the waste cities, and inhabit them;
and they shall plant vineyards, and drink the wine thereof;
they shall also make gardens, and eat the fruit of them.
"And I will bring again the captivity of my people of Israel": This does not refer to the captivity of the Jews in Babylon, or the disposition by the Romans, when the Jews were dispersed among the nations again; but the captivity both of Judah and Israel that the Jews will be brought back, and delivered from it, to return to their own land, and possess it as long as it is a land; see ; as well as be freed from the bondage of Satan and the law, under which they have been detained some hundreds of years; but now shall be delivered into the glorious liberty of the children of God.
"build the waste cities": (; ).
See also
Related Bible parts: Amos 2, Amos 7, Amos 8, Acts 15
Notes
References
Sources
External links
Jewish
Amos 9 Hebrew with Parallel English
Amos 9 Hebrew with Rashi's Commentary
Christian
Amos 9 English Translation with Parallel Latin Vulgate
09
|
```javascript
Use the `apply` function to get the `min` or `max` of an array
Difference between **.call** and **.apply** methods
Anonymous functions
IIFE pattern
Method chaining
```
|
```java
package com.blankj.utilcode.util;
import com.blankj.utilcode.constant.RegexConstants;
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* <pre>
* author: Blankj
* blog : path_to_url
* time : 2016/08/16
* desc : test RegexUtils
* </pre>
*/
public class RegexUtilsTest extends BaseTest {
@Test
public void isMobileSimple() {
assertTrue(RegexUtils.isMobileSimple("11111111111"));
}
@Test
public void isMobileExact() {
assertFalse(RegexUtils.isMobileExact("11111111111"));
assertTrue(RegexUtils.isMobileExact("13888880000"));
assertTrue(RegexUtils.isMobileExact("12088880000", CollectionUtils.newArrayList("120")));
}
@Test
public void isTel() {
assertTrue(RegexUtils.isTel("033-88888888"));
assertTrue(RegexUtils.isTel("033-7777777"));
assertTrue(RegexUtils.isTel("0444-88888888"));
assertTrue(RegexUtils.isTel("0444-7777777"));
assertTrue(RegexUtils.isTel("033 88888888"));
assertTrue(RegexUtils.isTel("033 7777777"));
assertTrue(RegexUtils.isTel("0444 88888888"));
assertTrue(RegexUtils.isTel("0444 7777777"));
assertTrue(RegexUtils.isTel("03388888888"));
assertTrue(RegexUtils.isTel("0337777777"));
assertTrue(RegexUtils.isTel("044488888888"));
assertTrue(RegexUtils.isTel("04447777777"));
assertFalse(RegexUtils.isTel("133-88888888"));
assertFalse(RegexUtils.isTel("033-666666"));
assertFalse(RegexUtils.isTel("0444-999999999"));
}
@Test
public void isIDCard18() {
assertTrue(RegexUtils.isIDCard18("33698418400112523x"));
assertTrue(RegexUtils.isIDCard18("336984184001125233"));
assertFalse(RegexUtils.isIDCard18("336984184021125233"));
}
@Test
public void isIDCard18Exact() {
assertFalse(RegexUtils.isIDCard18Exact("33698418400112523x"));
assertTrue(RegexUtils.isIDCard18Exact("336984184001125233"));
assertFalse(RegexUtils.isIDCard18Exact("336984184021125233"));
}
@Test
public void isEmail() {
assertTrue(RegexUtils.isEmail("blankj@qq.com"));
assertFalse(RegexUtils.isEmail("blankj@qq"));
}
@Test
public void isURL() {
assertTrue(RegexUtils.isURL("path_to_url"));
assertFalse(RegexUtils.isURL("https:blank"));
}
@Test
public void isZh() {
assertTrue(RegexUtils.isZh(""));
assertFalse(RegexUtils.isZh("wo"));
}
@Test
public void isUsername() {
assertTrue(RegexUtils.isUsername("233333"));
assertFalse(RegexUtils.isUsername(""));
assertFalse(RegexUtils.isUsername("233333_"));
}
@Test
public void isDate() {
assertTrue(RegexUtils.isDate("2016-08-16"));
assertTrue(RegexUtils.isDate("2016-02-29"));
assertFalse(RegexUtils.isDate("2015-02-29"));
assertFalse(RegexUtils.isDate("2016-8-16"));
}
@Test
public void isIP() {
assertTrue(RegexUtils.isIP("255.255.255.0"));
assertFalse(RegexUtils.isIP("256.255.255.0"));
}
@Test
public void isMatch() {
assertTrue(RegexUtils.isMatch("\\d?", "1"));
assertFalse(RegexUtils.isMatch("\\d?", "a"));
}
@Test
public void getMatches() {
//
System.out.println(RegexUtils.getMatches("b.*j", "blankj blankj"));
//
System.out.println(RegexUtils.getMatches("b.*?j", "blankj blankj"));
}
@Test
public void getSplits() {
System.out.println(Arrays.asList(RegexUtils.getSplits("1 2 3", " ")));
}
@Test
public void getReplaceFirst() {
System.out.println(RegexUtils.getReplaceFirst("1 2 3", " ", ", "));
}
@Test
public void getReplaceAll() {
System.out.println(RegexUtils.getReplaceAll("1 2 3", " ", ", "));
}
}
```
|
GSX may refer to:
Businesses
GSX Techedu, a large Chinese online tutoring company
General Signal, a defunct American equipment manufacturer
Gibraltar Stock Exchange
Science and technology
Gsx (gene family), in animals
Graphics System Extension, a graphics library
Government Secure Extranet, United Kingdom
Television
Asurada GSX, a fictional racing car from Future GPX Cyber Formula
Music
Genre-Specific Xperience, an EP by electronic musician Fatima Al Qadiri
Transport and vehicles
Buick GSX, a muscle car
Gandhi Smarak Road railway station, in Maharashtra, India
Grand Strand Expressway, a proposed freeway in South Carolina
Mitsubishi Eclipse GSX, a sport compact car
Suzuki GSX series of sport touring motorcycles
Suzuki GSX-R series of sport motorcycles
|
```cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_ENV_PASSTHROUGH PATH)
set(VCPKG_BUILD_TYPE release)
set(VCPKG_CMAKE_SYSTEM_NAME MinGW)
```
|
```xml
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DatabaseSettingsWidgetMaintenance</class>
<widget class="QWidget" name="DatabaseSettingsWidgetMaintenance">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>669</width>
<height>395</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>0</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>20</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Manage Custom Icons</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<widget class="QListView" name="customIconsView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="movement">
<enum>QListView::Static</enum>
</property>
<property name="flow">
<enum>QListView::LeftToRight</enum>
</property>
<property name="isWrapping" stdset="0">
<bool>true</bool>
</property>
<property name="resizeMode">
<enum>QListView::Adjust</enum>
</property>
<property name="spacing">
<number>4</number>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="customIconButtonsHorizontalLayout">
<item>
<widget class="QPushButton" name="deleteButton">
<property name="text">
<string>Delete selected icon(s)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="purgeButton">
<property name="toolTip">
<string>Delete all custom icons not in use by any entry or group</string>
</property>
<property name="accessibleName">
<string>Delete all custom icons not in use by any entry or group</string>
</property>
<property name="text">
<string>Purge unused icons</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
```
|
```javascript
/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { isArray } from '../util/isArray';
import { fromArray } from './fromArray';
import { OuterSubscriber } from '../OuterSubscriber';
import { subscribeToResult } from '../util/subscribeToResult';
export function race() {
var observables = [];
for (var _i = 0; _i < arguments.length; _i++) {
observables[_i] = arguments[_i];
}
if (observables.length === 1) {
if (isArray(observables[0])) {
observables = observables[0];
}
else {
return observables[0];
}
}
return fromArray(observables, undefined).lift(new RaceOperator());
}
var RaceOperator = /*@__PURE__*/ (function () {
function RaceOperator() {
}
RaceOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new RaceSubscriber(subscriber));
};
return RaceOperator;
}());
export { RaceOperator };
var RaceSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(RaceSubscriber, _super);
function RaceSubscriber(destination) {
var _this = _super.call(this, destination) || this;
_this.hasFirst = false;
_this.observables = [];
_this.subscriptions = [];
return _this;
}
RaceSubscriber.prototype._next = function (observable) {
this.observables.push(observable);
};
RaceSubscriber.prototype._complete = function () {
var observables = this.observables;
var len = observables.length;
if (len === 0) {
this.destination.complete();
}
else {
for (var i = 0; i < len && !this.hasFirst; i++) {
var observable = observables[i];
var subscription = subscribeToResult(this, observable, observable, i);
if (this.subscriptions) {
this.subscriptions.push(subscription);
}
this.add(subscription);
}
this.observables = null;
}
};
RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
if (!this.hasFirst) {
this.hasFirst = true;
for (var i = 0; i < this.subscriptions.length; i++) {
if (i !== outerIndex) {
var subscription = this.subscriptions[i];
subscription.unsubscribe();
this.remove(subscription);
}
}
this.subscriptions = null;
}
this.destination.next(innerValue);
};
return RaceSubscriber;
}(OuterSubscriber));
export { RaceSubscriber };
//# sourceMappingURL=race.js.map
```
|
```shell
#!/usr/bin/env bash
# This script runs the given benchmark and compares the results against origin/master.
#
# USAGE:
# In order to trigger benchmarking for an open PR, post a comment like `/benchmark NAME` to
# the PR. The command will be acknowledged with a :rocket: reaction and when done a bot will
# publish the results to the same PR.
#
# This script can also be run locally inside the nix shell like so:
# `BENCHMARK_NAME=nofib ./scripts/ci-plutus-benchmark.sh`
#
# NOTES:
# The `cabal update` command below is neccessary because while the whole script is executed inside
# a nix shell, this environment does not provide the hackage record inside .cabal and we have to
# fetch/build this each time since we want to run this in a clean environment.
# The `jq` invocation below is necessary because we have to POST the PR comment as JSON data
# (see the curl command) meaning the script output has to be escaped first before we can insert it.
set -e
if [ -z "$BENCHMARK_NAME" ] ; then
echo "[ci-plutus-benchmark]: 'BENCHMARK_NAME' is not set, exiting."
exit 1
fi
if [ -z "$PR_NUMBER" ] ; then
echo "[ci-plutus-benchmark]: 'PR_NUMBER' is not set, probably running locally."
PR_NUMBER="[local]"
fi
if [ -z "$PR_BRANCH" ] ; then
echo "[ci-plutus-benchmark]: 'PR_BRANCH' is not set, probably running locally"
else
echo "[ci-plutus-benchmark]: 'PR_BRANCH' set to $PR_BRANCH, fetching origin ..."
git fetch origin
git checkout "$PR_BRANCH"
fi
PR_BRANCH_REF="$(git rev-parse --short HEAD)"
if [ -z "$(git merge-base HEAD origin/master)" ]; then
echo "The command 'git merge-base HEAD origin/master' returned an empty string."
echo "You probably need to 'git rebase --origin master' from your branch first."
exit 1
fi
echo "[ci-plutus-benchmark]: Processing benchmark comparison for benchmark '$BENCHMARK_NAME' on PR $PR_NUMBER"
echo "[ci-plutus-benchmark]: Running as user:"
whoami
echo "[ci-plutus-benchmark]: Updating cabal database ..."
cabal update
echo "[ci-plutus-benchmark]: Clearing caches with cabal clean ..."
cabal clean
echo "[ci-plutus-benchmark]: Running benchmark for PR branch at $PR_BRANCH_REF ..."
2>&1 cabal bench "$BENCHMARK_NAME" | tee bench-PR.log
echo "[ci-plutus-benchmark]: Switching branches ..."
git checkout "$(git merge-base HEAD origin/master)"
BASE_BRANCH_REF=$(git rev-parse --short HEAD)
echo "[ci-plutus-benchmark]: Clearing caches with cabal clean ..."
cabal clean
echo "[ci-plutus-benchmark]: Running benchmark for base branch at $BASE_BRANCH_REF ..."
2>&1 cabal bench "$BENCHMARK_NAME" | tee bench-base.log
git checkout "$PR_BRANCH_REF" # .. so we use the most recent version of the comparison script
echo "[ci-plutus-benchmark]: Comparing results ..."
{
# The blank line is important, otherwise Github doesn't render markdown in the body of the details element.
# See path_to_url for examples
cat <<EOF
Comparing benchmark results of '$BENCHMARK_NAME' on '$BASE_BRANCH_REF' (base) and '$PR_BRANCH_REF' (PR)
<details>
<summary>Results table</summary>
EOF
./plutus-benchmark/bench-compare-markdown bench-base.log bench-PR.log "${BASE_BRANCH_REF:0:7}" "${PR_BRANCH_REF:0:7}"
echo -e "</details>"
} > bench-compare-result.log
```
|
```c++
/**
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include <iostream>
#include <sstream>
#include "constants.h"
#include "constants_lua.h"
#include "lua_utils.h"
using torchcraft::lua::pushValue;
using torchcraft::lua::pushToTable;
using torchcraft::lua::sealTable;
namespace {
std::string fromCamelCaseToLower(const std::string& s) {
if (s == "MAX") {
return s;
}
std::ostringstream ss;
auto it = s.begin();
ss << char(tolower(*it++));
while (it != s.end()) {
if (isupper(*it)) {
ss << '_' << char(tolower(*it++));
} else {
ss << *it++;
}
}
return ss.str();
}
int wisBuilding(lua_State* L) {
int n = luaL_checkint(L, lua_gettop(L) > 1 ? 2 : 1);
auto id = torchcraft::BW::UnitType::_from_integral_nothrow(n);
if (!id) {
return luaL_error(L, "Invalid unit ID: %d", n);
}
lua_pushboolean(L, torchcraft::BW::isBuilding(*id));
return 1;
}
int wisWorker(lua_State* L) {
int n = luaL_checkint(L, lua_gettop(L) > 1 ? 2 : 1);
auto id = torchcraft::BW::UnitType::_from_integral_nothrow(n);
if (!id) {
return luaL_error(L, "Invalid unit ID: %d", n);
}
lua_pushboolean(L, torchcraft::BW::isWorker(*id));
return 1;
}
int wisMineralField(lua_State* L) {
int n = luaL_checkint(L, lua_gettop(L) > 1 ? 2 : 1);
auto id = torchcraft::BW::UnitType::_from_integral_nothrow(n);
if (!id) {
return luaL_error(L, "Invalid unit ID: %d", n);
}
lua_pushboolean(L, torchcraft::BW::isMineralField(*id));
return 1;
}
int wisGasGeyser(lua_State* L) {
int n = luaL_checkint(L, lua_gettop(L) > 1 ? 2 : 1);
auto id = torchcraft::BW::UnitType::_from_integral_nothrow(n);
if (!id) {
return luaL_error(L, "Invalid unit ID: %d", n);
}
lua_pushboolean(L, torchcraft::BW::isGasGeyser(*id));
return 1;
}
template <typename Enum>
void pushTable(lua_State* L) {
lua_newtable(L);
for (auto elem : Enum::_values()) {
lua_pushinteger(L, elem._to_integral());
lua_setfield(L, -2, elem._to_string());
lua_pushstring(L, elem._to_string());
lua_rawseti(L, -2, elem._to_integral());
}
sealTable(L);
}
template <typename Enum, typename F>
void pushTable(lua_State* L, F map) {
lua_newtable(L);
for (auto elem : Enum::_values()) {
lua_pushinteger(L, elem._to_integral());
auto mapped = map(elem._to_string());
lua_setfield(L, -2, mapped.c_str());
lua_pushstring(L, mapped.c_str());
lua_rawseti(L, -2, elem._to_integral());
}
sealTable(L);
}
template <typename Enum>
void pushVector(lua_State* L, std::vector<Enum> v) {
lua_newtable(L);
for (size_t i = 0; i < v.size(); i++) {
lua_pushinteger(L, v[i]._to_integral());
lua_rawseti(L, -2, i + 1);
}
sealTable(L);
}
template <typename T>
void pushStaticValues(lua_State* L, const T m[]) {
lua_newtable(L);
for (auto ut : torchcraft::BW::UnitType::_values()) {
pushValue(L, m[ut]);
lua_setfield(L, -2, ut._to_string());
pushValue(L, m[ut]);
lua_rawseti(L, -2, ut);
}
sealTable(L);
}
void pushMap(
lua_State* L,
std::unordered_map<torchcraft::BW::UnitType, int>& m) {
lua_newtable(L);
for (const auto& kv : m) {
pushValue(L, kv.second);
lua_rawseti(L, -2, kv.first._to_integral());
}
sealTable(L);
}
void pushStaticData(lua_State* L) {
lua_newtable(L);
pushStaticValues(L, torchcraft::BW::data::CanAttack);
lua_setfield(L, -2, "canAttack");
pushStaticValues(L, torchcraft::BW::data::DimensionRight);
lua_setfield(L, -2, "dimensionRight");
pushStaticValues(L, torchcraft::BW::data::Height);
lua_setfield(L, -2, "height");
pushStaticValues(L, torchcraft::BW::data::IsMineralField);
lua_setfield(L, -2, "isMineralField");
pushStaticValues(L, torchcraft::BW::data::CanProduce);
lua_setfield(L, -2, "canProduce");
pushStaticValues(L, torchcraft::BW::data::IsRefinery);
lua_setfield(L, -2, "isRefinery");
pushStaticValues(L, torchcraft::BW::data::IsResourceDepot);
lua_setfield(L, -2, "isResourceDepot");
pushStaticValues(L, torchcraft::BW::data::RegeneratesHP);
lua_setfield(L, -2, "regeneratesHP");
pushStaticValues(L, torchcraft::BW::data::IsCloakable);
lua_setfield(L, -2, "isCloakable");
pushStaticValues(L, torchcraft::BW::data::IsTwoUnitsInOneEgg);
lua_setfield(L, -2, "isTwoUnitsInOneEgg");
pushStaticValues(L, torchcraft::BW::data::IsSpellcaster);
lua_setfield(L, -2, "isSpellcaster");
pushStaticValues(L, torchcraft::BW::data::SupplyRequired);
lua_setfield(L, -2, "supplyRequired");
pushStaticValues(L, torchcraft::BW::data::AirWeapon);
lua_setfield(L, -2, "airWeapon");
pushStaticValues(L, torchcraft::BW::data::BuildScore);
lua_setfield(L, -2, "buildScore");
pushStaticValues(L, torchcraft::BW::data::MaxAirHits);
lua_setfield(L, -2, "maxAirHits");
pushStaticValues(L, torchcraft::BW::data::IsPowerup);
lua_setfield(L, -2, "isPowerup");
pushStaticValues(L, torchcraft::BW::data::IsBeacon);
lua_setfield(L, -2, "isBeacon");
pushStaticValues(L, torchcraft::BW::data::MineralPrice);
lua_setfield(L, -2, "mineralPrice");
pushStaticValues(L, torchcraft::BW::data::IsInvincible);
lua_setfield(L, -2, "isInvincible");
pushStaticValues(L, torchcraft::BW::data::RequiredTech);
lua_setfield(L, -2, "requiredTech");
pushStaticValues(L, torchcraft::BW::data::DimensionDown);
lua_setfield(L, -2, "dimensionDown");
pushStaticValues(L, torchcraft::BW::data::CanBuildAddon);
lua_setfield(L, -2, "canBuildAddon");
pushStaticValues(L, torchcraft::BW::data::DimensionLeft);
lua_setfield(L, -2, "dimensionLeft");
pushStaticValues(L, torchcraft::BW::data::ProducesLarva);
lua_setfield(L, -2, "producesLarva");
pushStaticValues(L, torchcraft::BW::data::Armor);
lua_setfield(L, -2, "armor");
pushStaticValues(L, torchcraft::BW::data::IsMechanical);
lua_setfield(L, -2, "isMechanical");
pushStaticValues(L, torchcraft::BW::data::IsBuilding);
lua_setfield(L, -2, "isBuilding");
pushStaticValues(L, torchcraft::BW::data::SupplyProvided);
lua_setfield(L, -2, "supplyProvided");
pushStaticValues(L, torchcraft::BW::data::SightRange);
lua_setfield(L, -2, "sightRange");
pushStaticValues(L, torchcraft::BW::data::GasPrice);
lua_setfield(L, -2, "gasPrice");
pushStaticValues(L, torchcraft::BW::data::MaxHitPoints);
lua_setfield(L, -2, "maxHitPoints");
pushStaticValues(L, torchcraft::BW::data::Width);
lua_setfield(L, -2, "width");
pushStaticValues(L, torchcraft::BW::data::TileWidth);
lua_setfield(L, -2, "tileWidth");
pushStaticValues(L, torchcraft::BW::data::IsHero);
lua_setfield(L, -2, "isHero");
pushStaticValues(L, torchcraft::BW::data::SeekRange);
lua_setfield(L, -2, "seekRange");
pushStaticValues(L, torchcraft::BW::data::BuildTime);
lua_setfield(L, -2, "buildTime");
pushStaticValues(L, torchcraft::BW::data::IsCritter);
lua_setfield(L, -2, "isCritter");
pushStaticValues(L, torchcraft::BW::data::RequiresPsi);
lua_setfield(L, -2, "requiresPsi");
pushStaticValues(L, torchcraft::BW::data::IsSpecialBuilding);
lua_setfield(L, -2, "isSpecialBuilding");
pushStaticValues(L, torchcraft::BW::data::GroundWeapon);
lua_setfield(L, -2, "groundWeapon");
pushStaticValues(L, torchcraft::BW::data::IsFlyer);
lua_setfield(L, -2, "isFlyer");
pushStaticValues(L, torchcraft::BW::data::Size);
lua_setfield(L, -2, "size");
pushStaticValues(L, torchcraft::BW::data::IsNeutral);
lua_setfield(L, -2, "isNeutral");
pushStaticValues(L, torchcraft::BW::data::MaxShields);
lua_setfield(L, -2, "maxShields");
pushStaticValues(L, torchcraft::BW::data::HasPermanentCloak);
lua_setfield(L, -2, "hasPermanentCloak");
pushStaticValues(L, torchcraft::BW::data::TopSpeed);
lua_setfield(L, -2, "topSpeed");
pushStaticValues(L, torchcraft::BW::data::TileHeight);
lua_setfield(L, -2, "tileHeight");
pushStaticValues(L, torchcraft::BW::data::IsRobotic);
lua_setfield(L, -2, "isRobotic");
pushStaticValues(L, torchcraft::BW::data::DimensionUp);
lua_setfield(L, -2, "dimensionUp");
pushStaticValues(L, torchcraft::BW::data::DestroyScore);
lua_setfield(L, -2, "destroyScore");
pushStaticValues(L, torchcraft::BW::data::SpaceProvided);
lua_setfield(L, -2, "spaceProvided");
pushStaticValues(L, torchcraft::BW::data::TileSize);
lua_setfield(L, -2, "tileSize");
pushStaticValues(L, torchcraft::BW::data::HaltDistance);
lua_setfield(L, -2, "haltDistance");
pushStaticValues(L, torchcraft::BW::data::IsAddon);
lua_setfield(L, -2, "isAddon");
pushStaticValues(L, torchcraft::BW::data::CanMove);
lua_setfield(L, -2, "canMove");
pushStaticValues(L, torchcraft::BW::data::IsFlyingBuilding);
lua_setfield(L, -2, "isFlyingBuilding");
pushStaticValues(L, torchcraft::BW::data::MaxEnergy);
lua_setfield(L, -2, "maxEnergy");
pushStaticValues(L, torchcraft::BW::data::IsDetector);
lua_setfield(L, -2, "isDetector");
pushStaticValues(L, torchcraft::BW::data::IsOrganic);
lua_setfield(L, -2, "isOrganic");
pushStaticValues(L, torchcraft::BW::data::SpaceRequired);
lua_setfield(L, -2, "spaceRequired");
pushStaticValues(L, torchcraft::BW::data::IsFlagBeacon);
lua_setfield(L, -2, "isFlagBeacon");
pushStaticValues(L, torchcraft::BW::data::IsWorker);
lua_setfield(L, -2, "isWorker");
pushStaticValues(L, torchcraft::BW::data::IsBurrowable);
lua_setfield(L, -2, "isBurrowable");
pushStaticValues(L, torchcraft::BW::data::CloakingTech);
lua_setfield(L, -2, "cloakingTech");
pushStaticValues(L, torchcraft::BW::data::IsResourceContainer);
lua_setfield(L, -2, "isResourceContainer");
pushStaticValues(L, torchcraft::BW::data::Acceleration);
lua_setfield(L, -2, "acceleration");
pushStaticValues(L, torchcraft::BW::data::IsSpell);
lua_setfield(L, -2, "isSpell");
pushStaticValues(L, torchcraft::BW::data::RequiresCreep);
lua_setfield(L, -2, "requiresCreep");
pushStaticValues(L, torchcraft::BW::data::ArmorUpgrade);
lua_setfield(L, -2, "armorUpgrade");
pushStaticValues(L, torchcraft::BW::data::MaxGroundHits);
lua_setfield(L, -2, "maxGroundHits");
pushStaticValues(L, torchcraft::BW::data::TurnRadius);
lua_setfield(L, -2, "turnRadius");
pushStaticValues(L, torchcraft::BW::data::GetRace);
lua_setfield(L, -2, "getRace");
}
} // namespace
namespace torchcraft {
void registerConstants(lua_State* L, int index) {
lua_pushvalue(L, index);
lua_newtable(L);
// Numeric constants
pushToTable(L, "xy_pixels_per_walktile", BW::XYPixelsPerWalktile);
pushToTable(L, "xy_pixels_per_buildtile", BW::XYPixelsPerBuildtile);
pushToTable(L, "xy_walktiles_per_buildtile", BW::XYWalktilesPerBuildtile);
pushToTable(
L, "hit_prob_ranged_uphill_doodad", BW::HitProbRangedUphillDoodad);
pushToTable(L, "hit_prob_ranged", BW::HitProbRanged);
pushTable<BW::Command>(L, fromCamelCaseToLower);
lua_setfield(L, -2, "commands");
pushTable<BW::OpenBWCommandType>(L);
lua_setfield(L, -2, "openbwcommandtypes");
pushTable<BW::UserCommandType>(L);
lua_setfield(L, -2, "usercommandtypes");
pushTable<BW::UnitCommandType>(L);
lua_setfield(L, -2, "unitcommandtypes");
pushTable<BW::Order>(L);
lua_setfield(L, -2, "orders");
pushTable<BW::TechType>(L);
lua_setfield(L, -2, "techtypes");
pushTable<BW::UpgradeType>(L);
lua_setfield(L, -2, "upgradetypes");
pushTable<BW::UnitType>(L);
lua_setfield(L, -2, "unittypes");
pushTable<BW::BulletType>(L);
lua_setfield(L, -2, "bullettypes");
pushTable<BW::WeaponType>(L);
lua_setfield(L, -2, "weapontypes");
pushTable<BW::UnitSize>(L);
lua_setfield(L, -2, "unitsizes");
pushTable<BW::DamageType>(L);
lua_setfield(L, -2, "dmgtypes");
pushTable<BW::Race>(L);
lua_setfield(L, -2, "races");
pushTable<BW::Color>(L);
lua_setfield(L, -2, "colors");
lua_newtable(L);
for (auto t : BW::UnitType::_values()) {
auto v = BW::unitProductions(t);
if (!v.empty()) {
pushVector(L, std::move(v));
lua_rawseti(L, -2, t._to_integral());
}
}
sealTable(L);
lua_setfield(L, -2, "produces");
lua_newtable(L);
for (auto t : BW::UnitType::_values()) {
for (auto prod : BW::unitProductions(t)) {
lua_pushinteger(L, t._to_integral());
lua_rawseti(L, -2, prod._to_integral());
}
}
sealTable(L);
lua_setfield(L, -2, "isproducedby");
lua_newtable(L);
for (auto t : BW::UnitCommandType::_values()) {
auto v = BW::commandToOrders(t);
if (!v.empty()) {
pushVector(L, std::move(v));
lua_rawseti(L, -2, t._to_integral());
}
}
sealTable(L);
lua_setfield(L, -2, "command2order");
lua_newtable(L);
for (auto t : BW::UnitCommandType::_values()) {
for (auto o : BW::commandToOrders(t)) {
lua_rawgeti(L, -1, o._to_integral());
if (lua_isnil(L, -1)) {
lua_pop(L, 1);
lua_newtable(L);
lua_rawseti(L, -2, o._to_integral());
lua_rawgeti(L, -1, o._to_integral());
}
auto size = lua_objlen(L, -1);
lua_pushinteger(L, t._to_integral());
lua_rawseti(L, -2, size + 1);
lua_pop(L, 1);
}
}
sealTable(L);
lua_setfield(L, -2, "order2command");
lua_pushcfunction(L, wisBuilding);
lua_setfield(L, -2, "isbuilding");
lua_pushcfunction(L, wisWorker);
lua_setfield(L, -2, "isworker");
lua_pushcfunction(L, wisMineralField);
lua_setfield(L, -2, "is_mineral_field");
lua_pushcfunction(L, wisGasGeyser);
lua_setfield(L, -2, "is_gas_geyser");
pushStaticData(L);
sealTable(L);
lua_setfield(L, -2, "staticdata");
// total_price
lua_newtable(L);
pushMap(L, torchcraft::BW::data::TotalMineralPrice);
lua_setfield(L, -2, "mineral");
pushMap(L, torchcraft::BW::data::TotalGasPrice);
lua_setfield(L, -2, "gas");
lua_setfield(L, -2, "total_price");
lua_setfield(L, -2, "const");
lua_pop(L, 1);
}
} // namespace torchcraft
```
|
```go
package metrics
import "sync/atomic"
// Gauges hold an int64 value that can be set arbitrarily.
type Gauge interface {
Snapshot() Gauge
Update(int64)
Value() int64
}
// GetOrRegisterGauge returns an existing Gauge or constructs and registers a
// new StandardGauge.
func GetOrRegisterGauge(name string, r Registry) Gauge {
if nil == r {
r = DefaultRegistry
}
return r.GetOrRegister(name, NewGauge).(Gauge)
}
// NewGauge constructs a new StandardGauge.
func NewGauge() Gauge {
if UseNilMetrics {
return NilGauge{}
}
return &StandardGauge{0}
}
// NewRegisteredGauge constructs and registers a new StandardGauge.
func NewRegisteredGauge(name string, r Registry) Gauge {
c := NewGauge()
if nil == r {
r = DefaultRegistry
}
r.Register(name, c)
return c
}
// NewFunctionalGauge constructs a new FunctionalGauge.
func NewFunctionalGauge(f func() int64) Gauge {
if UseNilMetrics {
return NilGauge{}
}
return &FunctionalGauge{value: f}
}
// NewRegisteredFunctionalGauge constructs and registers a new StandardGauge.
func NewRegisteredFunctionalGauge(name string, r Registry, f func() int64) Gauge {
c := NewFunctionalGauge(f)
if nil == r {
r = DefaultRegistry
}
r.Register(name, c)
return c
}
// GaugeSnapshot is a read-only copy of another Gauge.
type GaugeSnapshot int64
// Snapshot returns the snapshot.
func (g GaugeSnapshot) Snapshot() Gauge { return g }
// Update panics.
func (GaugeSnapshot) Update(int64) {
panic("Update called on a GaugeSnapshot")
}
// Value returns the value at the time the snapshot was taken.
func (g GaugeSnapshot) Value() int64 { return int64(g) }
// NilGauge is a no-op Gauge.
type NilGauge struct{}
// Snapshot is a no-op.
func (NilGauge) Snapshot() Gauge { return NilGauge{} }
// Update is a no-op.
func (NilGauge) Update(v int64) {}
// Value is a no-op.
func (NilGauge) Value() int64 { return 0 }
// StandardGauge is the standard implementation of a Gauge and uses the
// sync/atomic package to manage a single int64 value.
type StandardGauge struct {
value int64
}
// Snapshot returns a read-only copy of the gauge.
func (g *StandardGauge) Snapshot() Gauge {
return GaugeSnapshot(g.Value())
}
// Update updates the gauge's value.
func (g *StandardGauge) Update(v int64) {
atomic.StoreInt64(&g.value, v)
}
// Value returns the gauge's current value.
func (g *StandardGauge) Value() int64 {
return atomic.LoadInt64(&g.value)
}
// FunctionalGauge returns value from given function
type FunctionalGauge struct {
value func() int64
}
// Value returns the gauge's current value.
func (g FunctionalGauge) Value() int64 {
return g.value()
}
// Snapshot returns the snapshot.
func (g FunctionalGauge) Snapshot() Gauge { return GaugeSnapshot(g.Value()) }
// Update panics.
func (FunctionalGauge) Update(int64) {
panic("Update called on a FunctionalGauge")
}
```
|
Emilio Duhart Harosteguy (1917 in Temuco – January 2, 2006 in Ustaritz, Labort) was a Chilean architect, representative of modern architecture and considered to be one of the most relevant urbanists of the 20th century.
Duhart's work was profoundly influenced by Le Corbusier's and Walter Gropius' theories, with whom he collaborated in several projects.
Biography
Youth
Emilio Duhart's family immigrated from the French province of Labort, in the French Basque Country, to southern Chile. He lived in France during his infancy and basic education.
He started a relationship with Raquel Echeverría, who would later become his wife; they had four children and several grandchildren.
Professional career
In 1935, Duhart started his Architecture studies at the Pontifical Catholic University of Chile (PCUC), and graduated in 1941. In the same year he started working on rural populations in Chillán, affected by the 1939 earthquake.
In 1942 he moved to the United States, where he studied Architecture at Harvard University. In 1943 he graduated under the supervision of architects Walter Gropius and John M. Gauss. He later served as Gropius' assistant and as Konrad Waschmann's assistant at General Panel Corporation Prefabricated Housing. During this stay at Harvard, Duhart became acquainted with the Modern Architecture movement that would become a cornerstone in his career.
Career in Chile
Duhart returned to Chile at some point in the 40s, he worked along Sergio Larraín García-Moreno— founder of the Chilean Museum of Precolumbian Art,— in several architectural projects: housing, industrial buildings and urban planning, among others.
Besides his work as an architect, Duhart also worked in academia and union matters. In 1946 he was elected counselor at the National College of Architects in Chile, and in 1951 he returned to the PCUC to work as a teacher where he would later become director of the Urbanism, Housing and Planning department.
In 1952 Duhart received a scholarship at the Institut d'Urbanisme in the Sorbonne University, and during his stay he worked with Le Corbusier in several architectural projects at the Indian cities of Ahmedabad and Chandigarh. Duhart also studied at the Centre Technique du Bâtiment, in Paris.
References
Bibliography
External links
Photographic Repository of Chilean Architecture
1917 births
2006 deaths
Chilean architects
Harvard Graduate School of Design alumni
Pontifical Catholic University of Chile alumni
|
Tasveer is a Seattle-based South Asian social justice arts non-profit organization. It was founded by Rita Meher and Farah Nousheen in 2002.
Tasveer organizes events including film festivals, community speaking events, and open-mic nights to celebrate the voices of South Asian people through art and film.
The organization includes voices of South Asian countries like Afghanistan, Bangladesh, Bhutan, India, Maldives, Nepal, Pakistan, Sri Lanka, and their diasporas worldwide.
The organization also hosts Tasveer TV, an online streaming platform that curates South Asian independent films. Annual events include the Tasveer South Asian Film Festival and the Tasveer South Asian Literary Festival. During the pandemic, in 2020, multiple South Asian festivals were thinking about cancelling the events in US and Canada. However, Tasveer brought them together to host a bigger online global South Asian Film Festival under the name Coalition of South Asian Film Festivals (CoSAFF). In 2021, Tasveer merged its film festival and literary festival into one, known as Tasveer Festival.
Tasveer's mission is “To inspire social change through thought-provoking South Asian films, art, and storytelling”.
History
Tasveer was founded in 2002 in Seattle, US, shortly after the 9/11 event. It was founded by Rita Meher and Farah Nousheen who were tired of the hate and prejudice because of their South Asian identity and wanted to recast the harmful labels by providing a glimpse into the lives of South Asians through film, art, and storytelling. The word 'Tasveer' means ‘picture’ in Hindi and Urdu.
The organization hosted their first screening at The Elliot Bay Book Company in 2002 and the Tasveer South Asian Film Festival was launched in 2004.
Tasveer South Asian Film Festival 13th Edition (2018)
The 13th edition of Tasveer's Film festival had Pakistan as the country of focus and invited Sharmeen Obaid-Chinoy as a guest. Some of the films included A Girl in the River: The Price of Forgiveness, Look But With Love, Sarmad Masud’s My Pure Land, and Ali Osman Bajwa’s Gorakh Dhandh. The festival had the theme #knowMe and had Laila Kazmi as the program director.
Tasveer South Asian Film Festival 14th Edition (2019)
In 2019, Tasveer curated more than 60 films in all genres with a focus on LGBTQ issues and women's rights Some of the films included The Illegal, The Price of Free, A Monsoon Date, fest centerpiece, and The Sweet Requiem. The festival awarded Shabana Azmi with Tasveer Emerald Award and had Director Danish Renzu (In Search of America) and star Suraj Shama (Life of Pi) for a question-answer discussion with the audience.
CoSAFF 2020
There was no individual 15th edition of the festival in 2020. This year Tasveer merge with other festivals like the Vancouver fests; Mosaic International Festival in Toronto; Nepal America fest in Maryland; and the South Asian Film Festival of Montreal to create an online South Asian Film Festival called CoSAFF. The Tasveer Film Fund, which awarded grants to south Asian filmmakers in the US, was started in the year 2020.
2020 onwards
Tasveer continued to hold virtual events and screenings during Covid. They returned to holding live events in November 2022 with the 17th annual South Asian film festival. Screenings included The Round Lake, Elizabeth D. Costa's Bangla Surf Girls and Faraz Ali's Shoebox.
The Tasveer Film Fund Shorts Films track also works with Netflix as part of its Fund for Creative Equity initiative, to increase support for South Asian filmmakers developing short film projects, with up to $35,000 awarded in grants.
Rita Meher, managing Tasveer since 2007, continues to be Tasveer's Executive Director in Seattle. Farah Nousheen continues to be an active ally from Albuquerque, New Mexico, where she now lives with her family.
References
External links
Tasveer official website
Tasveer Festival website
South Asian diaspora
Indian film festivals
Non-profit organizations based in Seattle
|
Ramesh Chandappa Jigajinagi (born 28 June 1952) is an Indian politician from Karnataka and currently a member of Lok Sabha. He was Union Minister of State for Drinking Water and Sanitation in 2016. He was member of the Twelfth, Thirteenth, Fourteenth, Fifteenth and Sixteenth Lok Sabha. He was inducted into PM, Narendra Modi's government as a Minister of State for Drinking Water & Sanitation on July 5, 2016. He represents the Bijapur constituency (2019-2024) and is currently a member of the Bharatiya Janata Party which he joined in 2002. He has also been a member of Janata Dal and Ramakrishna Hegde's Vedike Party and Ram Vilas Paswan's Jan Shakti Party in 2001 when Hegde was planning to retire.
Political career
Ramesh Jigajinagi was born on 28 June 1952 in Atharga village of Bijapur District in Karnataka to Chandappa and Bhoramma Jigajinagi. He is married to Shoba and has two sons. He completed his graduation from BLDEA's New Arts College, Bijapur in the faculty of Arts and later earned his master's degree as well. Ramesh hails from a Scheduled Caste community and has been able to retain support in the areas of northern Karnataka, even after switching alliances and parties.
His electoral victory is significant, contesting and winning his seat against B. Shankaranand of the Indian National Congress'. Ramesh entered the 12th Lok Sabha with a margin of 1,31,238 votes.
Initially, he joined the undivided Janata Dal under the mentorship of Ramakrishna Hegde. He remained in the Janta Dal and was a staunch supporter of Ramakrishna Hegde. When Ramakrishna Hegde floated the Rashtreeya Nava Nirmana Vedike, Ramesh Jigajinagi was among the earliest sitting MLAs to support him and join the new party by resigning his ministership. Later, he joined Lok Shakti, a party formed by Ramakrishna Hegde and rejoined Janata Dal United after the merger of Lok Shakti with the former. After the death of his mentor, he joined the Bharatiya Janata Party.
Positions held
Member of Karnataka Legislative Assembly 1983- 1985, 1985-1989, 1994-1999 (3 terms)
Minister of State, Home Department in the Government of Karnataka 1983
Minister of State, Excise Department in the Government of Karnataka 1984-1985
Cabinet Minister for Social Welfare and Revenue in the Government of Karnataka 1996-1998
Member of the 12th Loksabha 1998-1999 (Winning Margin=131238). From Chikkodi.
Member of the 13th Loksabha 1999-2004 (Winning Margin=84590)
Member of the 14th Loksabha 2004-2009 (Winning Margin=43492), for BJP.
Member of the 15th Loksabha 2009-2014 (Winning Margin=42404) From Bijapur.
Member of the 16th Loksabha 2014- 2019 (Winning Margin=69819)
Member of the 17th Loksabha 2019 - (Winning Margin = 2,58,038)
He has served as the member in the following committees
Parliamentary Consultative Committee, Ministry of Finance
Parliamentary Committee on Absence of Members from the sittings of the House
Parliamentary Committee on Commerce
Parliamentary Committee on Home Affairs and its Sub-Committee on Personnel Policy of Central Para-Military Forces
Union Minister of State for Drinking Water & Sanitation 2016
See also
Members of Fourteenth Lok Sabha
Notes
External links
Ramesh Jigajinagi's home page on Lok Sabha's Website
References
1952 births
Bharatiya Janata Party politicians from Karnataka
Living people
India MPs 1998–1999
India MPs 1999–2004
India MPs 2004–2009
India MPs 2009–2014
People from Bijapur district, Karnataka
Lok Sabha members from Karnataka
India MPs 2014–2019
Janata Dal politicians
Janata Dal (United) politicians
Lok Janshakti Party politicians
Narendra Modi ministry
India MPs 2019–present
Lok Shakti politicians
|
Thomas Francis Eagleton (September 4, 1929 – March 4, 2007) was an American lawyer serving as a United States senator from Missouri, from 1968 to 1987. He was briefly the Democratic vice presidential nominee under George McGovern in 1972. He suffered from bouts of depression throughout his life, resulting in several hospitalizations, which were kept secret from the public. When they were revealed, it humiliated the McGovern campaign and Eagleton was forced to quit the race. He later became adjunct professor of public affairs at Washington University in St. Louis.
Early life and political career
Eagleton was born in St. Louis, Missouri, the son of Zitta Louise (Swanson) and Mark David Eagleton, a politician who had run for mayor. His paternal grandparents were Irish immigrants, and his mother had Swedish, Irish, French, and Austrian ancestry.
He graduated from St. Louis Country Day School, served in the U.S. Navy for two years, and graduated from Amherst College in 1950, where he was a member of Delta Kappa Epsilon fraternity (Sigma Chapter). He then attended Harvard Law School. Following his graduation in 1953, Eagleton practiced law at his father's firm and later became associated with Anheuser-Busch's legal department.
Eagleton married Barbara Ann Smith of St. Louis on January 26, 1956. A son, Terence, was born in 1959, and a daughter, Christin, was born in 1963.
He was elected circuit attorney of the City of St. Louis in 1956. During his tenure, he appeared on the TV show What's My Line? (episode #355) as "District Attorney of St. Louis". (He stumped the panel.) He was elected Missouri Attorney General in 1960, at the age of 31 (the youngest in the state's history). He was elected the 38th Lieutenant Governor of Missouri in 1964, and won a U.S. Senate seat in 1968, unseating incumbent Edward V. Long in the Democratic primary and narrowly defeating Congressman Thomas B. Curtis in the general election.
Eagleton suffered from depression; he checked himself into hospital three times between 1960 and 1966 for physical and nervous exhaustion, receiving electroconvulsive therapy (shock therapy) twice. He later received a diagnosis of bipolar II from Dr. Frederick K. Goodwin.
The hospitalizations, which were not widely publicized, had little effect on his political aspirations, although the St. Louis Post-Dispatch was to note, in 1972, immediately after his vice presidential nomination: "He had been troubled with gastric disturbances, which led to occasional hospitalizations. The stomach troubles have contributed to rumors that he had a drinking problem."
1972 presidential campaign
"Amnesty, abortion, and acid"
On April 25, 1972, as George McGovern won the Massachusetts Democratic primary, conservative journalist Robert Novak phoned Democratic politicians around the country. On April 27, 1972, Novak reported in a column his conversation with an unnamed Democratic senator about McGovern.
Novak quoted the senator as saying "The people don't know McGovern is for amnesty, abortion, and legalization of pot. Once middle America—Catholic middle America, in particular—finds this out, he's dead." Because of the column McGovern became known as the candidate of "amnesty, abortion, and acid," even though he only supported the decriminalization of marijuana and maintained that legalized abortion fell under the purview of states' rights.
On July 15, 2007, several months after Eagleton's death, Novak said on Meet the Press that the unnamed senator was Eagleton. Novak was accused in 1972 of manufacturing the quote, but stated that to rebut the criticism, he took Eagleton to lunch after the campaign and asked whether he could identify him as the source; the senator refused. "Oh, he had to run for re-election," said Novak, "the McGovernites would kill him if they knew he had said that." Political analyst Bob Shrum says that Eagleton would never have been selected as McGovern's running mate if it had been known at the time that Eagleton was the source of the quote. "Boy, do I wish he would have let you publish his name. Then he never would have been picked as vice president," said Shrum. "Because the two things, the two things that happened to George McGovern—two of the things that happened to him—were the label you put on him, number one, and number two, the Eagleton disaster. We had a messy convention, but he could have, I think in the end, carried eight or 10 states, remained politically viable. And Eagleton was one of the great train wrecks of all time."
Selection as vice-presidential nominee
After a large number of prominent Democrats declined to be McGovern's running mate, Senator Gaylord Nelson (who was among those who declined) suggested Eagleton. McGovern chose Eagleton after only a minimal background check, as had been customary for vice presidential selections at that time. Eagleton made no mention of his earlier hospitalizations, and in fact decided with his wife to keep them secret from McGovern while he was flying to his first meeting with McGovern.
Replacement on the ticket
On July 25, 1972, just over two weeks after the 1972 Democratic Convention, Eagleton admitted the truth of news reports that he had received electroshock therapy for clinical depression during the 1960s. McGovern initially said he would back Eagleton "1000 percent". Subsequently, McGovern consulted confidentially with preeminent psychiatrists, including Eagleton's own doctors, who advised him that a recurrence of Eagleton's depression was possible and could endanger the country should Eagleton become acting president. On August 1, nineteen days after being nominated, Eagleton withdrew at McGovern's request and, after a new search by McGovern, Thomas Eagleton was replaced by Sargent Shriver, former U.S. Ambassador to France, and former (founding) Director of the Peace Corps and the Office of Economic Opportunity.
A Time poll taken at the time found that 77 percent of the respondents said "Eagleton's medical record would not affect their vote." Nonetheless, the press made frequent references to his "shock therapy", and McGovern feared that this would detract from his campaign platform.
McGovern's failure to thoroughly vet Eagleton and his subsequent handling of the controversy gave occasion for the Republican campaign to raise serious questions about his judgment. In the general election, the Democratic ticket won only Massachusetts and the District of Columbia.
Re-election to Senate
Missouri returned Eagleton to the Senate in 1974; he won 60% of the popular vote against Thomas B. Curtis, who had been his opponent in 1968. In 1980, he was re-elected by a closer-than-expected margin over St. Louis County Executive Gene McNary.
During the 1980 election, Eagleton's niece Elizabeth Eagleton Weigand and lawyer Stephen Poludniak were arrested for blackmail after they threatened to spread false accusations that Eagleton was bisexual. Eagleton told reporters that the extorted money was to be turned over to the Church of Scientology. Poludniak and Weigand appealed the conviction all the way to the U.S. Supreme Court, arguing that they could not have gotten a fair trial because of "the massive publicity surrounding this case, coupled with the pre-existing sentiment in favor of Sen. Eagleton". The Court turned down the appeal.
Eagleton did not seek a fourth term in 1986. Former Republican Governor Kit Bond succeeded him in the Senate.
Senate career
In the Senate, Eagleton was active in matters dealing with foreign relations, intelligence, defense, education, health care, and the environment. He was instrumental to the Senate's passage of the Clean Air Act and the Clean Water Act, and sponsored the amendment that halted the bombing in Cambodia and effectively ended American involvement in the Vietnam War.
Notably, Eagleton was one of only three senators to oppose the nomination of Gerald Ford as Vice President in 1973. The other two senators voting no were William Hathaway of Maine, and Gaylord Nelson of Wisconsin.
Eagleton was one of the authors of The Hatch-Eagleton Amendment, introduced in the Senate on January 26, 1983 with Sen. Orrin Hatch (R), which stated that "A right to abortion is not secured by this Constitution."
Post-Senate career
In January 1987, Eagleton returned to Missouri as an attorney, political commentator, and professor at Washington University in St. Louis, where until his death he was professor of public affairs. Throughout his Washington University career, Eagleton taught courses in economics with former chairman of the Council of Economic Advisors Murray Weidenbaum and with history professor Henry W. Berger on the Vietnam War.
On July 23, 1996, Eagleton delivered a warm introductory speech for McGovern during a promotional tour for McGovern's book, Terry: My Daughter's Life-and-Death Struggle with Alcoholism, at The Library, Ltd., in St. Louis, Missouri. At that time, McGovern spoke favorably about Eagleton and reminisced about their short-lived presidential ticket in 1972.
During the 2000s, Eagleton served on the Council of Elders for the George and Eleanor McGovern Center for Leadership and Public Service at Dakota Wesleyan University.
In January 2001, he joined other Missouri Democrats to oppose the nomination of former governor and senator John Ashcroft for United States Attorney General. Eagleton was quoted in the official Judiciary Committee record: "John Danforth would have been my first choice. John Ashcroft would have been my last choice."
In 2005 and 2006, he co-taught a seminar on the US presidency and the Constitution with Joel Goldstein at Saint Louis University School of Law. He was also a partner in the St. Louis law firm Thompson Coburn and was a chief negotiator for a coalition of local business interests that lured the Los Angeles Rams football team to St. Louis. Eagleton authored three books on politics. Eagleton also strongly supported Democratic Senate candidate Claire McCaskill in 2006; McCaskill won, defeating incumbent Jim Talent.
Eagleton led a group, Catholics for Amendment 2, composed of prominent Catholics that challenged church leaders' opposition to embryonic stem cell research and to a proposed state constitutional amendment that would have protected such research in Missouri. The group e-mailed a letter to fellow Catholics explaining reasons for supporting Amendment 2. The amendment ensures that any federally approved stem cell research and treatments would be available in Missouri. "[T]he letter from Catholics for Amendment 2 said the group felt a moral obligation to respond to what it called misinformation, scare tactics and distortions being spread by opponents of the initiative, including the church."
Eagleton died in St. Louis on March 4, 2007, of heart and respiratory complications. Eagleton donated his body to medical science at Washington University. He wrote a farewell letter to his family and friends months before he died, citing that his dying wishes were for people to "go forth in love and peace—be kind to dogs—and vote Democratic".
Honors and awards
Eagleton threw out the ceremonial first pitch to end the pregame ceremonies of Game 5 of the 1985 World Series.
The 8th Circuit federal courthouse in St. Louis is named after Eagleton. Dedicated on September 11, 2000, it is named the Thomas F. Eagleton United States Courthose.
Eagleton has been honored with a star on the St. Louis Walk of Fame.
Personal life
Eagleton was a Roman Catholic. Eagleton was a practicing Catholic, and strongly opposed abortion despite his reputation as a liberal. His religion was one of the defining factors of his political career, as religion was an important political issue in Missouri. Eagleton's Catholicism increased his appeal to the working class of St. Louis and offset the "elitist stigma" of Eagleton's private school education. At the same time, the suburbs of Missouri were staunchly anti-Catholic, which proved a challenge during the 1960 election. Nevertheless, Eagleton became elected as the Missouri Attorney General.
Eagleton believed that the Catholic Church was "a vital part of American life, conscience[,] and thought". He described himself as "a Pope John XXIII and an Archbishop John L. May Catholic", and considered these two figures his religious mentors. Because of his religion and youth, Eagleton was often compared to President Kennedy; in 1972, St. Louis Post Dispatch wrote: "With his good looks, style, youth, liberal views and Catholic religion, Eagleton is the closest thing to a Kennedy Missouri has to offer". In his farewell letter from 2006, Eagleton wrote: "In the era of a Christian right, we seem to have merged God’s power into political power".
Eagleton married Barbara Ann Smith Eagleton in 1956, and the couple had two children together - a son and a daughter. Eagleton is survived by his wife.
See also
References
Further reading
Bormann, Ernest G. "The Eagleton affair: A fantasy theme analysis". Quarterly Journal of Speech 59.2 (1973): 143–159.
Dickerson, John. "One of the Great Train Wrecks of All Time". Slate online magazine podcast 6/10/15
Giglio, James N. Call Me Tom: The Life of Thomas F. Eagleton (University of Missouri Press; 2011) 328 pages
Giglio, James N. "The Eagleton Affair: Thomas Eagleton, George McGovern, and the 1972 Vice Presidential Nomination", Presidential Studies Quarterly, (2009) 39#4 pp. 647–676
Glasser, Joshua M. Eighteen-Day Running Mate: McGovern, Eagleton, and a Campaign in Crisis (Yale University Press, 2012). Comprehensive scholarly history
Hendrickson, Paul. "George McGovern & the Coldest Plunge", The Washington Post, September 28, 1983
Strout, Lawrence N. "Politics and mental illness: The campaigns of Thomas Eagleton and Lawton Chiles". Journal of American Culture 18.3 (1995): 67–73. .
Trent, Judith S., and Jimmie D. Trent. "The rhetoric of the challenger: George Stanley McGovern". Communication Studies 25#1 (1974): 11–18. .
White, Theodore. The Making of the President, 1972 (1973)
Time magazine—July 24, 1972 cover article
Time magazine—August 7, 1972 cover on withdrawal
"McGovern's First Crisis: The Eagleton Affair" Time August 7, 1972, cover story
"George McGovern Finally Finds a Veep" Time August 14, 1972, cover story
External links
|-
|-
|-
|-
|-
1929 births
1972 United States vice-presidential candidates
2007 deaths
20th-century American politicians
American legal scholars
American people of Austrian descent
American people of French descent
American people of Irish descent
American people of Swedish descent
Amherst College alumni
Candidates in the 1984 United States presidential election
Catholics from Missouri
Dakota Wesleyan University people
Democratic Party (United States) vice presidential nominees
Democratic Party United States senators from Missouri
Harvard Law School alumni
Lieutenant Governors of Missouri
Missouri Attorneys General
Missouri Democrats
Politicians from St. Louis County, Missouri
People with bipolar disorder
Politicians from St. Louis
Saint Louis University School of Law faculty
United States Navy officers
Washington University in St. Louis faculty
Mary Institute and St. Louis Country Day School alumni
|
Charlotte Fletcher-Scott ( Dobson, born 5 June 1986) is a British sailor who competed at the 2016 Summer Olympics and 2020 Summer Olympics.
Personal life
Dobson was born on 5 June 1986 in Glasgow, Scotland. She studied psychology at the University of Edinburgh. In August 2021 she married fellow olympic sailor Dylan Fletcher.
Sailing
Dobson was selected for the Scotland national squad at the age of 14. In 2001, she won a bronze medal at the Youth World Championship in the Laser Radial class; in 2002 and 2004 she won silver medals at the Championships. By 2005 she was ranked seventh in the ISAF world rankings and in 2007 finished tenth in the ISAF World Championships held in Portugal. She was shortlisted for the Great Britain team for the 2008 Summer Olympics in Beijing, China, but missed out on selection to Penny Clark.
In 2010, she took the silver medal at the Laser Radial European Championships held in Estonia. At the 2011 ISAF Sailing World Championships Dobson finished 16th in the women's Laser Radial event. She attempted to qualify for the 2012 Summer Olympics in the individual Laser Radial but was beaten to selection for the Great Britain team by Alison Young after Young finished ahead of her in the Olympic regatta at Hyères.
In 2013, she teamed up with Sophie Ainsworth to compete in the 49er FX classification. The pair won a bronze medal at the World Cup event in Mallorca. They then finished sixth at the 2014 49er European Championships held in Helsinki, Finland.
At the 2015 49er FX World Championships, held in San Isidro, Argentina, Dobson and Ainsworth finished in fifth place, four points behind the medal positions.
In March 2016, Dobson and Ainsworth were selected as part of the Great Britain team for the 2016 Summer Olympics to be held in Rio de Janeiro, Brazil, where they competed in the women's 49er FX event, which made its debut at the Games. In April at the Princess Sofia Trophy in Palma, Majorca the pair finished fifth in the opening race before suffering problems with their equipment in race two. They eventually placed sixth overall after taking second place in the final race. Later that month at the 49er European Championships in Barcelona, Spain, Ainsworth and Dobson were joint third after the second day of competition where they finished their three races, first, second and third. A victory in the final medal race meant they eventually finished ninth overall, and seventh among European boats.
Dobson who along with crew Saskia Tidey have represent Great Britain at the Sailing at the 2020 Summer Olympics in the Women's 49er FX class finishing 6th.
References
External links
1986 births
Living people
Scottish female sailors (sport)
Alumni of the University of Edinburgh
Sportspeople from Glasgow
Sailors at the 2016 Summer Olympics – 49er FX
Olympic sailors for Great Britain
Sailors at the 2020 Summer Olympics – 49er FX
|
Out of all of the forms of love magic that existed in the Greco-Roman world, the two most common were eros and philia. Unlike eros, which was more commonly used by men, philia magic was utilized by women and others who were considered to be social inferiors.
Since there was an emphasis on service to the state in Greco-Roman culture, these social inferiors felt like they were doing their country a service. If a woman was capable of repairing her broken marriage and improving her husband's interaction with the neighbors through magic, society was benefiting as a whole. Despite this protective purpose seen by women, philia spells were looked down on by men. They were a great source of anxiety because men saw them as tools used by the social inferiors to hijack power from the male-dominated hierarchy.
The use of spells
Through the use of spells, women were hoping to bring out the pleasant personal qualities of their significant others and make them increasingly submissive in order to strengthen their bond. The spells consisted of many objects found in the everyday life of a woman including narcotics, amulets, rings, knotted cords, and facial ointments. Although the violent and passionate images typically depicted in eros were not found in philia, it is important to remember that like eros, the ultimate purpose of philia magic was to take control of the victim.
Wine
Wine was considered to be the most basic love potion by the Greeks and had to be handled with as much care as any other spell. This was because the conjurer had to gauge the effectiveness of the serving sizes. The right amount of wine would lead to sexual arousal; too much would lead to impotence. Herbal aphrodisiacs and mood enhancers such as oleander, cyclamen, and mandrake were also used in combination with wine for enhancements.
Narcotics/Potions
The narcotics used in potions were designed to sedate men in progressive stages beginning with cheerfulness/ sexual arousal, progressing to the weakening of vitality, and finally ending with sleep. Potions were placed in one of two categories: irritants and those used to increase relaxation and affection. As with all narcotics, there was always a risk of severe harm or death being caused by accidental overdoses. The effects of the two potion categories were difficult to distinguish in small doses, but not in large amounts. Substantial doses of irritants caused cramping, pain, and insomnia while relaxants led to drowsiness and eventually a loss of consciousness.
Rings and gemstones
In the Cyranides, a Greek manual focusing on magical properties, there are descriptions of different gemstones that were thought to possess certain powers.
Dendrites – lead to the love of the gods and success in the world.
Sapphire – resulted in a victory in every lawsuit brought against you.
Aerizon – effective around leaders when placed within a gold ring.
There were many cases in Greek and Neo-Assyrian cultures where social inferiors would stand before their superiors armed only with a magical stone set in a ring. They were hoping that the rings would increase their goodwill and help them build favorable relationships with the hierarchy.
A little ring for success and for charm (charis) and for victory… The world has nothing better than this. For when you have it with you, you will always get whatever you ask from anybody. Besides, it calms the angers (orgai) of kings and master. Wearing it, whatever you may say to anyone, you will be believed, and you will be pleasing to everybody.
Notes
Ancient Greek religion
Magic (supernatural)
|
The women's 1500 metres event at the 1990 Commonwealth Games was held on 2 and 3 February at the Mount Smart Stadium in Auckland.
Medalists
Results
Heats
Qualification: First 5 of each heat (Q) and the next 2 fastest (q) qualified for the final.
Final
References
1500
1990
1990 in women's athletics
|
```java
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package org.graalvm.visualvm.lib.profiler;
/** A listener for results manager changes
*
* @author Tomas Hurka
* @author Ian Formanek
*/
public interface ResultsListener {
//~ Methods your_sha256_hash--------------------------------------------------
/** Called each time profiling results will become available for the first time using current instrumentation */
public void resultsAvailable();
/** Called when collected results buffer has been reset */
public void resultsReset();
}
```
|
```python
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.types.collections import StringCollection
from office365.sharepoint.migrationcenter.service.performance.throughput_data import (
ThroughputData,
)
class PerformanceDashboardData(ClientValue):
""""""
def __init__(
self, bottleneck_list=None, recommendation_list=None, throughput_trend=None
):
self.BottleneckList = StringCollection(bottleneck_list)
self.RecommendationList = StringCollection(recommendation_list)
self.ThroughputTrend = ClientValueCollection(ThroughputData, throughput_trend)
@property
def entity_type_name(self):
return "Microsoft.Online.SharePoint.MigrationCenter.Service.PerformanceDashboardData"
```
|
```smalltalk
using System.Threading.Tasks;
using SimplCommerce.Module.Core.Models;
using SimplCommerce.Module.Notifications.Models;
using SimplCommerce.Module.Notifications.Services;
namespace SimplCommerce.Module.Notifications.Notifiers
{
public class TestNotifier : ITestNotifier
{
private readonly INotificationPublisher _notificationPublisher;
public TestNotifier(INotificationPublisher notificationPublisher)
{
_notificationPublisher = notificationPublisher;
}
public async Task WelcomeToTheApplicationAsync(long userId)
{
// Publish to new user
await _notificationPublisher.PublishAsync(
"WelcomeToTheApplication",
new MessageNotificationData("Welcome to store."),
severity: NotificationSeverity.Success,
userIds: new[] { userId }
);
}
public async Task NewUserRegisteredAsync(User user)
{
var notificationData = new MessageNotificationData("New user registered.");
notificationData["userName"] = user.UserName;
notificationData["email"] = user.Email;
// Publish to all subscribed users
await _notificationPublisher.PublishAsync(NotificationDefinitions.Names.NewUserRegistered, notificationData);
}
//This is for test purposes
public async Task SendMessageAsync(long userId, string message, NotificationSeverity severity = NotificationSeverity.Info)
{
await _notificationPublisher.PublishAsync(
"SimpleMessage",
new MessageNotificationData(message),
severity: severity,
userIds: new[] { userId }
);
}
}
}
```
|
```c
/*
*
* This file is part of System Informer.
*
* Authors:
*
* wj32 2010
* dmex 2017-2023
*
*/
#include <phapp.h>
#include <settings.h>
typedef struct _COLUMNS_DIALOG_CONTEXT
{
HWND ControlHandle;
HFONT ControlFont;
ULONG Type;
PPH_LIST Columns;
HBRUSH BrushNormal;
HBRUSH BrushPushed;
HBRUSH BrushHot;
COLORREF TextColor;
HWND InactiveWindowHandle;
HWND ActiveWindowHandle;
HWND SearchInactiveHandle;
HWND SearchActiveHandle;
HWND HideWindowHandle;
HWND ShowWindowHandle;
HWND MoveUpHandle;
HWND MoveDownHandle;
PPH_LIST InactiveListArray;
PPH_LIST ActiveListArray;
} COLUMNS_DIALOG_CONTEXT, *PCOLUMNS_DIALOG_CONTEXT;
INT_PTR CALLBACK PhpColumnsDlgProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
VOID PhShowChooseColumnsDialog(
_In_ HWND ParentWindowHandle,
_In_ HWND ControlHandle,
_In_ ULONG Type
)
{
COLUMNS_DIALOG_CONTEXT context;
memset(&context, 0, sizeof(COLUMNS_DIALOG_CONTEXT));
context.ControlHandle = ControlHandle;
context.Type = Type;
if (Type == PH_CONTROL_TYPE_TREE_NEW)
context.Columns = PhCreateList(TreeNew_GetColumnCount(ControlHandle));
else
return;
PhDialogBox(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_CHOOSECOLUMNS),
ParentWindowHandle,
PhpColumnsDlgProc,
&context
);
PhDereferenceObject(context.Columns);
}
static int __cdecl PhpColumnsCompareDisplayIndexTn(
_In_ const void* Context,
_In_ const void *elem1,
_In_ const void *elem2
)
{
PPH_TREENEW_COLUMN column1 = *(PPH_TREENEW_COLUMN *)elem1;
PPH_TREENEW_COLUMN column2 = *(PPH_TREENEW_COLUMN *)elem2;
return uintcmp(column1->DisplayIndex, column2->DisplayIndex);
}
static int __cdecl PhpInactiveColumnsCompareNameTn(
_In_ const void* Context,
_In_ const void *elem1,
_In_ const void *elem2
)
{
PWSTR column1 = *(PWSTR *)elem1;
PWSTR column2 = *(PWSTR *)elem2;
return PhCompareStringZ(column1, column2, FALSE);
}
_Success_(return != ULONG_MAX)
static ULONG IndexOfStringInList(
_In_ PPH_LIST List,
_In_ PWSTR String
)
{
for (ULONG i = 0; i < List->Count; i++)
{
if (PhEqualStringZ(List->Items[i], String, FALSE))
return i;
}
return ULONG_MAX;
}
VOID PhpColumnsResetListBox(
_In_ HWND ListBoxHandle,
_In_ ULONG_PTR MatchHandle,
_In_ PPH_LIST Array,
_In_opt_ PVOID CompareFunction
)
{
SendMessage(ListBoxHandle, WM_SETREDRAW, FALSE, 0);
ListBox_ResetContent(ListBoxHandle);
if (CompareFunction)
qsort_s(Array->Items, Array->Count, sizeof(ULONG_PTR), CompareFunction, NULL);
if (!MatchHandle)
{
for (ULONG i = 0; i < Array->Count; i++)
{
ListBox_InsertString(ListBoxHandle, i, Array->Items[i]);
}
}
else
{
ULONG index = 0;
for (ULONG i = 0; i < Array->Count; i++)
{
PH_STRINGREF text;
PhInitializeStringRefLongHint(&text, Array->Items[i]);
if (PhSearchControlMatch(MatchHandle, &text))
{
ListBox_InsertString(ListBoxHandle, index, Array->Items[i]);
index++;
}
}
}
SendMessage(ListBoxHandle, WM_SETREDRAW, TRUE, 0);
}
VOID NTAPI PhpInactiveColumnsSearchControlCallback(
_In_ ULONG_PTR MatchHandle,
_In_opt_ PVOID Context
)
{
PCOLUMNS_DIALOG_CONTEXT context = Context;
assert(context);
PhpColumnsResetListBox(
context->InactiveWindowHandle,
MatchHandle,
context->InactiveListArray,
PhpInactiveColumnsCompareNameTn
);
}
VOID NTAPI PhpActiveColumnsSearchControlCallback(
_In_ ULONG_PTR MatchHandle,
_In_opt_ PVOID Context
)
{
PCOLUMNS_DIALOG_CONTEXT context = Context;
assert(context);
PhpColumnsResetListBox(
context->ActiveWindowHandle,
MatchHandle,
context->ActiveListArray,
NULL
);
}
INT_PTR CALLBACK PhpColumnsDlgProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
)
{
PCOLUMNS_DIALOG_CONTEXT context = NULL;
if (uMsg == WM_INITDIALOG)
{
context = (PCOLUMNS_DIALOG_CONTEXT)lParam;
PhSetWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT, context);
}
else
{
context = PhGetWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT);
}
if (!context)
return FALSE;
switch (uMsg)
{
case WM_INITDIALOG:
{
ULONG count;
ULONG total;
ULONG i;
PPH_LIST displayOrderList = NULL;
LONG dpiValue;
PhCenterWindow(hwndDlg, GetParent(hwndDlg));
PhSetApplicationWindowIcon(hwndDlg);
dpiValue = PhGetWindowDpi(hwndDlg);
context->InactiveWindowHandle = GetDlgItem(hwndDlg, IDC_INACTIVE);
context->ActiveWindowHandle = GetDlgItem(hwndDlg, IDC_ACTIVE);
context->SearchInactiveHandle = GetDlgItem(hwndDlg, IDC_SEARCH);
context->SearchActiveHandle = GetDlgItem(hwndDlg, IDC_FILTER);
context->HideWindowHandle = GetDlgItem(hwndDlg, IDC_HIDE);
context->ShowWindowHandle = GetDlgItem(hwndDlg, IDC_SHOW);
context->MoveUpHandle = GetDlgItem(hwndDlg, IDC_MOVEUP);
context->MoveDownHandle = GetDlgItem(hwndDlg, IDC_MOVEDOWN);
context->InactiveListArray = PhCreateList(1);
context->ActiveListArray = PhCreateList(1);
context->ControlFont = PhCreateMessageFont(dpiValue); // PhDuplicateFont(PhTreeWindowFont)
PhCreateSearchControl(
hwndDlg,
context->SearchInactiveHandle,
L"Inactive columns...",
PhpInactiveColumnsSearchControlCallback,
context
);
PhCreateSearchControl(
hwndDlg,
context->SearchActiveHandle,
L"Active columns...",
PhpActiveColumnsSearchControlCallback,
context
);
ListBox_SetItemHeight(context->InactiveWindowHandle, 0, PhGetDpi(16, dpiValue));
ListBox_SetItemHeight(context->ActiveWindowHandle, 0, PhGetDpi(16, dpiValue));
Button_Enable(context->HideWindowHandle, FALSE);
Button_Enable(context->ShowWindowHandle, FALSE);
Button_Enable(context->MoveUpHandle, FALSE);
Button_Enable(context->MoveDownHandle, FALSE);
if (PhGetIntegerSetting(L"EnableThemeSupport"))
{
context->BrushNormal = CreateSolidBrush(RGB(43, 43, 43));
context->BrushHot = CreateSolidBrush(RGB(128, 128, 128));
context->BrushPushed = CreateSolidBrush(RGB(153, 209, 255));
context->TextColor = RGB(0xff, 0xff, 0xff);
}
else
{
context->BrushNormal = GetSysColorBrush(COLOR_WINDOW);
context->BrushHot = CreateSolidBrush(RGB(145, 201, 247));
context->BrushPushed = CreateSolidBrush(RGB(153, 209, 255));
context->TextColor = GetSysColor(COLOR_WINDOWTEXT);
}
if (context->Type == PH_CONTROL_TYPE_TREE_NEW)
{
PH_TREENEW_COLUMN column;
count = 0;
total = TreeNew_GetColumnCount(context->ControlHandle);
i = 0;
displayOrderList = PhCreateList(total);
while (count < total)
{
if (TreeNew_GetColumn(context->ControlHandle, i, &column))
{
PPH_TREENEW_COLUMN copy;
if (column.Fixed)
{
i++;
total--;
continue;
}
copy = PhAllocateCopy(&column, sizeof(PH_TREENEW_COLUMN));
PhAddItemList(context->Columns, copy);
count++;
if (column.Visible)
{
PhAddItemList(displayOrderList, copy);
}
else
{
PhAddItemList(context->InactiveListArray, column.Text);
}
}
i++;
}
qsort_s(displayOrderList->Items, displayOrderList->Count, sizeof(PVOID), PhpColumnsCompareDisplayIndexTn, NULL);
}
PhpColumnsResetListBox(
context->InactiveWindowHandle,
0,
context->InactiveListArray,
PhpInactiveColumnsCompareNameTn
);
if (displayOrderList)
{
for (i = 0; i < displayOrderList->Count; i++)
{
if (context->Type == PH_CONTROL_TYPE_TREE_NEW)
{
PPH_TREENEW_COLUMN copy = displayOrderList->Items[i];
PhAddItemList(context->ActiveListArray, copy->Text);
ListBox_InsertString(context->ActiveWindowHandle, i, copy->Text);
}
}
PhDereferenceObject(displayOrderList);
}
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_INACTIVE, LBN_SELCHANGE), (LPARAM)context->InactiveWindowHandle);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ACTIVE, LBN_SELCHANGE), (LPARAM)context->ActiveWindowHandle);
PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhSetDialogFocus(hwndDlg, GetDlgItem(hwndDlg, IDCANCEL));
}
break;
case WM_DESTROY:
{
for (ULONG i = 0; i < context->Columns->Count; i++)
PhFree(context->Columns->Items[i]);
if (context->BrushNormal)
DeleteBrush(context->BrushNormal);
if (context->BrushHot)
DeleteBrush(context->BrushHot);
if (context->BrushPushed)
DeleteBrush(context->BrushPushed);
if (context->ControlFont)
DeleteFont(context->ControlFont);
if (context->InactiveListArray)
PhDereferenceObject(context->InactiveListArray);
if (context->ActiveListArray)
PhDereferenceObject(context->ActiveListArray);
PhRemoveWindowContext(hwndDlg, PH_WINDOW_CONTEXT_DEFAULT);
}
break;
case WM_DPICHANGED:
{
if (context->ControlFont) DeleteFont(context->ControlFont);
context->ControlFont = PhCreateMessageFont(LOWORD(wParam));
ListBox_SetItemHeight(context->InactiveWindowHandle, 0, PhGetDpi(16, LOWORD(wParam)));
ListBox_SetItemHeight(context->ActiveWindowHandle, 0, PhGetDpi(16, LOWORD(wParam)));
}
break;
case WM_COMMAND:
{
switch (GET_WM_COMMAND_ID(wParam, lParam))
{
case IDCANCEL:
EndDialog(hwndDlg, IDCANCEL);
break;
case IDOK:
{
#define ORDER_LIMIT 210
ULONG i;
INT orderArray[ORDER_LIMIT];
INT maxOrder;
#ifdef DEBUG
assert(TreeNew_GetColumnCount(context->ControlHandle) < ORDER_LIMIT); // bump ORDER_LIMIT macro (dmex)
#endif
memset(orderArray, 0, sizeof(orderArray));
maxOrder = 0;
if (context->Type == PH_CONTROL_TYPE_TREE_NEW)
{
// Apply visibility settings and build the order array.
TreeNew_SetRedraw(context->ControlHandle, FALSE);
for (i = 0; i < context->Columns->Count; i++)
{
PPH_TREENEW_COLUMN column = context->Columns->Items[i];
ULONG index;
index = IndexOfStringInList(context->ActiveListArray, column->Text);
column->Visible = index != ULONG_MAX;
TreeNew_SetColumn(context->ControlHandle, TN_COLUMN_FLAG_VISIBLE, column);
if (column->Visible && index < ORDER_LIMIT)
{
orderArray[index] = column->Id;
if ((ULONG)maxOrder < index + 1)
maxOrder = index + 1;
}
}
// Apply display order.
TreeNew_SetColumnOrderArray(context->ControlHandle, maxOrder, orderArray);
TreeNew_SetRedraw(context->ControlHandle, TRUE);
InvalidateRect(context->ControlHandle, NULL, FALSE);
}
EndDialog(hwndDlg, IDOK);
}
break;
case IDC_INACTIVE:
{
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
SendMessage(hwndDlg, WM_COMMAND, IDC_SHOW, 0);
}
break;
case LBN_SELCHANGE:
{
INT sel = ListBox_GetCurSel(context->InactiveWindowHandle);
EnableWindow(context->ShowWindowHandle, sel != LB_ERR);
}
break;
}
}
break;
case IDC_ACTIVE:
{
switch (HIWORD(wParam))
{
case LBN_DBLCLK:
{
SendMessage(hwndDlg, WM_COMMAND, IDC_HIDE, 0);
}
break;
case LBN_SELCHANGE:
{
INT sel = ListBox_GetCurSel(context->ActiveWindowHandle);
INT count = ListBox_GetCount(context->ActiveWindowHandle);
if (sel != LB_ERR)
{
EnableWindow(context->HideWindowHandle, sel != 0);
EnableWindow(context->MoveUpHandle, sel != 0);
EnableWindow(context->MoveDownHandle, sel != count - 1);
}
}
break;
}
}
break;
case IDC_SHOW:
{
INT sel;
INT count;
PPH_STRING string;
sel = ListBox_GetCurSel(context->InactiveWindowHandle);
count = ListBox_GetCount(context->InactiveWindowHandle);
if (sel != LB_ERR)
{
string = PhGetListBoxString(context->InactiveWindowHandle, sel);
if (!PhIsNullOrEmptyString(string))
{
ULONG index = IndexOfStringInList(context->InactiveListArray, string->Buffer);
if (index != ULONG_MAX)
{
PVOID item = context->InactiveListArray->Items[index];
PhRemoveItemsList(context->InactiveListArray, index, 1);
PhAddItemList(context->ActiveListArray, item);
ListBox_DeleteString(context->InactiveWindowHandle, sel);
ListBox_AddString(context->ActiveWindowHandle, item);
}
count--;
if (sel >= count - 1)
sel = count - 1;
if (sel != LB_ERR)
{
ListBox_SetCurSel(context->InactiveWindowHandle, sel);
}
}
}
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_INACTIVE, LBN_SELCHANGE), (LPARAM)context->InactiveWindowHandle);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ACTIVE, LBN_SELCHANGE), (LPARAM)context->ActiveWindowHandle);
}
break;
case IDC_HIDE:
{
INT sel;
INT count;
PPH_STRING string;
sel = ListBox_GetCurSel(context->ActiveWindowHandle);
count = ListBox_GetCount(context->ActiveWindowHandle);
if (sel != LB_ERR)
{
string = PhGetListBoxString(context->ActiveWindowHandle, sel);
if (!PhIsNullOrEmptyString(string))
{
ULONG index = IndexOfStringInList(context->ActiveListArray, string->Buffer);
if (index != ULONG_MAX)
{
PVOID item = context->ActiveListArray->Items[index];
// Remove from active array, insert into inactive
PhRemoveItemsList(context->ActiveListArray, index, 1);
PhAddItemList(context->InactiveListArray, item);
// Sort inactive list with new entry
qsort_s(context->InactiveListArray->Items, context->InactiveListArray->Count, sizeof(ULONG_PTR), PhpInactiveColumnsCompareNameTn, NULL);
// Find index of new entry in inactive list
ULONG lb_index = IndexOfStringInList(context->InactiveListArray, item);
// Delete from active list
ListBox_DeleteString(context->ActiveWindowHandle, sel);
// Add to list in the same position as the inactive list
ListBox_InsertString(context->InactiveWindowHandle, lb_index, item);
PhpColumnsResetListBox(context->InactiveWindowHandle, 0, context->InactiveListArray, PhpInactiveColumnsCompareNameTn);
}
count--;
if (sel >= count - 1)
sel = count - 1;
if (sel != LB_ERR)
{
ListBox_SetCurSel(context->ActiveWindowHandle, sel);
}
}
PhClearReference(&string);
}
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_INACTIVE, LBN_SELCHANGE), (LPARAM)context->InactiveWindowHandle);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ACTIVE, LBN_SELCHANGE), (LPARAM)context->ActiveWindowHandle);
}
break;
case IDC_MOVEUP:
{
INT sel;
INT count;
PPH_STRING string;
sel = ListBox_GetCurSel(context->ActiveWindowHandle);
count = ListBox_GetCount(context->ActiveWindowHandle);
if (sel != LB_ERR)
{
string = PhGetListBoxString(context->ActiveWindowHandle, sel);
if (!PhIsNullOrEmptyString(string))
{
ULONG index = IndexOfStringInList(context->ActiveListArray, string->Buffer);
if (index != ULONG_MAX)
{
PVOID item = context->ActiveListArray->Items[index];
PhRemoveItemsList(context->ActiveListArray, index, 1);
PhInsertItemList(context->ActiveListArray, index - 1, item);
ListBox_DeleteString(context->ActiveWindowHandle, sel);
sel -= 1;
ListBox_InsertString(context->ActiveWindowHandle, sel, item);
ListBox_SetCurSel(context->ActiveWindowHandle, sel);
EnableWindow(context->MoveUpHandle, sel != 0);
EnableWindow(context->MoveDownHandle, sel != count - 1);
}
}
PhClearReference(&string);
}
}
break;
case IDC_MOVEDOWN:
{
INT sel;
INT count;
PPH_STRING string;
sel = ListBox_GetCurSel(context->ActiveWindowHandle);
count = ListBox_GetCount(context->ActiveWindowHandle);
if (sel != LB_ERR && sel != count - 1)
{
string = PhGetListBoxString(context->ActiveWindowHandle, sel);
if (!PhIsNullOrEmptyString(string))
{
ULONG index = IndexOfStringInList(context->ActiveListArray, string->Buffer);
if (index != ULONG_MAX)
{
PVOID item = context->ActiveListArray->Items[index];
PhRemoveItemsList(context->ActiveListArray, index, 1);
PhInsertItemList(context->ActiveListArray, index + 1, item);
ListBox_DeleteString(context->ActiveWindowHandle, sel);
sel += 1;
ListBox_InsertString(context->ActiveWindowHandle, sel, item);
ListBox_SetCurSel(context->ActiveWindowHandle, sel);
EnableWindow(context->MoveUpHandle, sel != 0);
EnableWindow(context->MoveDownHandle, sel != count - 1);
}
}
PhClearReference(&string);
}
}
break;
}
}
break;
case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT drawInfo = (LPDRAWITEMSTRUCT)lParam;
if (
drawInfo->hwndItem == context->InactiveWindowHandle ||
drawInfo->hwndItem == context->ActiveWindowHandle
)
{
HDC bufferDc;
HBITMAP bufferBitmap;
HBITMAP oldBufferBitmap;
PPH_STRING string;
RECT bufferRect =
{
0, 0,
drawInfo->rcItem.right - drawInfo->rcItem.left,
drawInfo->rcItem.bottom - drawInfo->rcItem.top
};
BOOLEAN isSelected = (drawInfo->itemState & ODS_SELECTED) == ODS_SELECTED;
BOOLEAN isFocused = (drawInfo->itemState & ODS_FOCUS) == ODS_FOCUS;
if (drawInfo->itemID == LB_ERR)
break;
string = PhGetListBoxString(drawInfo->hwndItem, drawInfo->itemID);
if (PhIsNullOrEmptyString(string))
{
PhClearReference(&string);
break;
}
bufferDc = CreateCompatibleDC(drawInfo->hDC);
bufferBitmap = CreateCompatibleBitmap(drawInfo->hDC, bufferRect.right, bufferRect.bottom);
oldBufferBitmap = SelectBitmap(bufferDc, bufferBitmap);
SelectFont(bufferDc, context->ControlFont);
SetBkMode(bufferDc, TRANSPARENT);
if (isSelected || isFocused)
{
FillRect(bufferDc, &bufferRect, context->BrushHot);
//FrameRect(bufferDc, &bufferRect, GetStockBrush(BLACK_BRUSH));
SetTextColor(bufferDc, context->TextColor);
}
else
{
FillRect(bufferDc, &bufferRect, context->BrushNormal);
//FrameRect(bufferDc, &bufferRect, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
SetTextColor(bufferDc, context->TextColor);
}
bufferRect.left += 5;
DrawText(
bufferDc,
string->Buffer,
(UINT)string->Length / sizeof(WCHAR),
&bufferRect,
DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOCLIP
);
bufferRect.left -= 5;
BitBlt(
drawInfo->hDC,
drawInfo->rcItem.left,
drawInfo->rcItem.top,
drawInfo->rcItem.right,
drawInfo->rcItem.bottom,
bufferDc,
0,
0,
SRCCOPY
);
SelectBitmap(bufferDc, oldBufferBitmap);
DeleteBitmap(bufferBitmap);
DeleteDC(bufferDc);
PhClearReference(&string);
return TRUE;
}
}
break;
case WM_CTLCOLORBTN:
return HANDLE_WM_CTLCOLORBTN(hwndDlg, wParam, lParam, PhWindowThemeControlColor);
case WM_CTLCOLORDLG:
return HANDLE_WM_CTLCOLORDLG(hwndDlg, wParam, lParam, PhWindowThemeControlColor);
case WM_CTLCOLORSTATIC:
return HANDLE_WM_CTLCOLORSTATIC(hwndDlg, wParam, lParam, PhWindowThemeControlColor);
}
return FALSE;
}
```
|
```java
/*
*
*
* 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 io.etcd.jetcd.impl;
import java.util.concurrent.TimeUnit;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import io.etcd.jetcd.support.Errors;
import io.grpc.Status;
import io.grpc.StatusException;
import static org.assertj.core.api.Assertions.assertThat;
@Timeout(value = 30, unit = TimeUnit.SECONDS)
class UtilTest {
@Test
public void testAuthStoreExpired() {
Status authExpiredStatus = Status.INVALID_ARGUMENT
.withDescription(Errors.ERROR_AUTH_STORE_OLD);
Status status = Status.fromThrowable(new StatusException(authExpiredStatus));
assertThat(Errors.isAuthStoreExpired(status)).isTrue();
}
@Test
public void testAuthErrorIsNotRetryable() {
Status authErrorStatus = Status.UNAUTHENTICATED
.withDescription("etcdserver: invalid auth token");
Status status = Status.fromThrowable(new StatusException(authErrorStatus));
assertThat(Errors.isRetryable(status)).isTrue();
}
@Test
public void testUnavailableErrorIsRetryable() {
Status status = Status.fromThrowable(new StatusException(Status.UNAVAILABLE));
assertThat(Errors.isRetryable(status)).isTrue();
}
}
```
|
```javascript
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
function getDecimals(n) {
n = n + '';
var i = n.indexOf('.');
return (i == -1) ? 0 : n.length - i - 1;
}
function getVF(n, opt_precision) {
var v = opt_precision;
if (undefined === v) {
v = Math.min(getDecimals(n), 3);
}
var base = Math.pow(10, v);
var f = ((n * base) | 0) % base;
return {v: v, f: f};
}
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"a. m.",
"p. m."
],
"DAY": [
"diumenge",
"dilluns",
"dimarts",
"dimecres",
"dijous",
"divendres",
"dissabte"
],
"MONTH": [
"gener",
"febrer",
"mar\u00e7",
"abril",
"maig",
"juny",
"juliol",
"agost",
"setembre",
"octubre",
"novembre",
"desembre"
],
"SHORTDAY": [
"dg.",
"dl.",
"dt.",
"dc.",
"dj.",
"dv.",
"ds."
],
"SHORTMONTH": [
"gen.",
"feb.",
"mar\u00e7",
"abr.",
"maig",
"juny",
"jul.",
"ag.",
"set.",
"oct.",
"nov.",
"des."
],
"fullDate": "EEEE, d MMMM 'de' y",
"longDate": "d MMMM 'de' y",
"medium": "dd/MM/y H:mm:ss",
"mediumDate": "dd/MM/y",
"mediumTime": "H:mm:ss",
"short": "d/M/yy H:mm",
"shortDate": "d/M/yy",
"shortTime": "H:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"macFrac": 0,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "ca-ad",
"pluralCat": function (n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
```
|
```go
//go:build go1.16
// +build go1.16
package middleware
import "runtime"
func getNormalizedOSName() (os string) {
switch runtime.GOOS {
case "android":
os = "android"
case "linux":
os = "linux"
case "windows":
os = "windows"
case "darwin":
os = "macos"
case "ios":
os = "ios"
default:
os = "other"
}
return os
}
```
|
```c++
/// Source : path_to_url
/// Author : liuyubobobo
/// Time : 2018-06-21
#include <iostream>
#include <queue>
#include <cassert>
#include <unordered_set>
using namespace std;
/// Greedy + BFS
/// Time Complexity: O(2^n)
/// Space Complexity: O(2^n)
class Solution {
public:
int kSimilarity(string A, string B) {
assert(A.size() == B.size());
assert(A.size() > 0);
if(A.size() == 1){
assert(A[0] == B[0]);
return 0;
}
queue<pair<string, int>> q;
q.push(make_pair(A, 0));
unordered_set<string> visited;
visited.insert(A);
while(!q.empty()){
string curS = q.front().first;
int curStep = q.front().second;
if(curS == B)
return curStep;
q.pop();
int start = 0;
for( ; start < curS.size() ; start ++)
if(curS[start] != B[start])
break;
for(int i = start + 1 ; i < curS.size() ; i ++)
if(curS[i] == B[start]){
swap(curS[start], curS[i]);
if(visited.find(curS) == visited.end()){
visited.insert(curS);
q.push(make_pair(curS, curStep + 1));
}
swap(curS[start], curS[i]);
}
}
assert(false);
return -1;
}
};
int main() {
string A1 = "ab";
string B1 = "ba";
cout << Solution().kSimilarity(A1, B1) << endl;
// 1
string A2 = "abc";
string B2 = "bca";
cout << Solution().kSimilarity(A2, B2) << endl;
// 2
string A3 = "abac";
string B3 = "baca";
cout << Solution().kSimilarity(A3, B3) << endl;
// 2
string A4 = "aabc";
string B4 = "abca";
cout << Solution().kSimilarity(A4, B4) << endl;
// 2
string A5 = "abcdefabcdefabcdef";
string B5 = "edcfbebceafcfdabad";
cout << Solution().kSimilarity(A5, B5) << endl;
// 10
return 0;
}
```
|
The Ascents of James (Greek: Anabathmoi Iacobou) is the title of a lost work briefly described in a heresiology known as the Panarion (30.16.6–9), by Epiphanius of Salamis; it was used as a source for a polemic against a Jewish Christian sect known as the Ebionites. The document advocated the abolition of the Jewish sacrifices, esteemed James, the brother of Jesus as the leader of the Jerusalem church, and denigrated Paul of Tarsus as a Gentile and an opponent of Jewish Law.
A Jewish Christian source document thought to be embedded within the Pseudo-Clementine Recognitions (1.27 or 1.33–71) and conventionally referred to by modern scholars as the Ascents of James may be related to the otherwise lost work mentioned by Epiphanius. Distinguishing features of the text include an advocacy for the observance of Mosaic Law and the elimination of the Jewish sacrifices. Paul is portrayed as a "certain hostile person" who prevents James from converting the Jewish people to Christianity (1.70.1–8). The text recounts the salvation history of Israel from Abraham to Jesus from a Jewish Christian perspective. Jesus is depicted as the anticipated prophet-like-Moses who was sent by God to complete the work of Moses by abolishing the sacrifices in order to redeem Israel.
Notes
Citations
Sources
Further reading
2nd-century Christian texts
Ancient Christian texts
Jewish Christian literature
Lost religious texts
|
The Mount Carbon Brewery was a brewery located at 716 South Centre Street, Pottsville, Pennsylvania, (Actually Mount Carbon, Pennsylvania) and which ran from 1845 to 1976 under various owners and names. Their Motto was "A Mellow Brew from the Mountains".
Timeline
George Lauer circa 1845–1860. Orchard Brewery, so named for the Orchard section of Pottsville.
Frederick Lauer (Mauck Chunk & Jackson Sts) 18??-1877
Orchard Brewery 1877–1893. Operated by G. Lorenz Schmidt until his death.
A new brewery was built in 1886 in Mount Carbon by Lorenz Schmidt. Some facilities of the Orchard Brewery were used in the new Brewery.
Operated under Estate of Lorenz Schmidt, Mount Carbon Brewery (Main St, Mount Carbon) 1893–1906.
Schmidt Estate Brewing Co., Mount Carbon Brewery 1906-1908
Mellet & Nichter Brewing Co. 1908-1920
Prohibition in 1920-1933
Matthew Kelley, trading as Mt. Carbon Brewery 1933-1935
Mount Carbon Brewery, 1935-1976
Products
The following brand names were produced at the Mount Carbon Brewery. Production ceased in 1976 and brand licensing was sold to D. G. Yuengling & Son.
Mount Carbon Ale 1933 - 1951
Mount Carbon Beer 1933 - 1951
Double Pilsener Beer 1934 - 1938
Mount Carbon Half & Half 1934 - 1939
Mount Carbon Bock 1934 - 1941
Mount Carbon Münchner Style October Beer 1935 - 1941
Mount Carbon Lager Beer (Under Matthew Kelly)
Mount Carbon Pale Ale
M.C. Ale 1935 - 1943
M.C. Bock 1935 - 1943
M.C. Porter 1935 - 1943
M.C. Beer 1935 - 1943
M.C. De Luxe Pilsner Beer
Franklin Ale 1935 - 1945
Mount Carbon Porter 1935 - 1977
Bavarian Type [Premium] Beer 1941 - 1977, continued to be produced by D.G. Yuengling & Son until 1994.
Old German Beer 1942 - 1949, produced by D.G. Yuengling & Son until 1994.
Old Bohemian Beer 1942 - 1977
Dix Club Beer 1944 - 1947
Old Dutch Beer 1944 - 1949
Franklin Beer 1945 - 1948
Lord Salisbury Ale 1945 - 1975
Old Fashioned Beer 1947 - 1951
Club Society Beer 1953 - 1956
Bavarian Type Bock 1953 - 1977
See also
Mount Carbon, Pennsylvania, The old Mount Carbon Brewery.
References
Beer brewing companies based in Pennsylvania
Pottsville, Pennsylvania
|
Muschampia is a Palearctic genus of spread-winged skippers in the family Hesperiidae.
Species
These species belong to the genus Muschampia:
Muschampia alta (Schwingenschuss, 1942) Southern Italy, Balkan Peninsula
Muschampia antonia (Speyer, 1879) Central Asia, Kazakhstan, Afghanistan, north Tibet
Muschampia baeticus (Rambur, 1840)
Muschampia cribrellum (Eversmann, 1841) (spinose skipper)
Muschampia dravira (Moore, [1875])
Muschampia floccifera (Zeller, 1847)
Muschampia gigas (Bremer, 1864) east China, Amur Oblast
Muschampia kuenlunus (Grum-Grshimailo, 1893) Central Asia (Alay Mountains, west Pamirs, Tian-Shan).
Muschampia lavatherae (Esper, 1783)
Muschampia leuzeae (Oberthür, 1881)
Muschampia lutulentus (Grum-Grshimailo, 1887) Syria, Mesopotamia to Central Asia, Afghanistan
Muschampia mohammed (Oberthür, 1887)
Muschampia musta Evans, 1949 Afghanistan
Muschampia nobilis (Staudinger, 1882) Central Asian mountain ranges
Muschampia nomas (Lederer, 1855) Israel
Muschampia orientalis (Reverdin, 1913)
Muschampia plurimacula (Christoph, 1893) Hyrcania
Muschampia poggei (Lederer, 1858) Asia Minor, Mesopotamia to Middle East, Transcaucasia
Muschampia prometheus (Grum-Grshimailo, 1890) Central Asian mountain ranges
Muschampia proteides (F.Wagner,1929) Central Asia (Alai, Ghissarsky, Tian-Shan), Afghanistan
Muschampia proteus (Staudinger, 1886)
Muschampia protheon (Rambur, 1858) central China (Kuku-Noor), east Mongolia to Transbaikalia
Muschampia proto Ochsenheimer, 1808 (sage skipper)
Muschampia stauderi (Reverdin, 1913)
Muschampia staudingeri (Speyer, 1879) northeast Iran to Pamirs, Turkmenistan, Altai, west China
Muschampia tersa Evans, 1949 Transcaucasia, Iran, Iraq
Muschampia tessellum (Hübner, [1800-1803]) (tesselated skipper)
References
Natural History Museum Lepidoptera genus database
External links
Images representing Muschampia at Consortium for the Barcode of Life
Hesperiidae genera
Taxa named by J. W. Tutt
|
```xml
import { GraphQLEnumType, GraphQLInputObjectType, GraphQLType } from "graphql";
import { CompilerOptions } from "apollo-codegen-core/lib/compiler";
import { commentBlockContent } from "apollo-codegen-core/lib/utilities/printing";
import { sortEnumValues } from "apollo-codegen-core/lib/utilities/graphql";
import { createTypeFromGraphQLTypeFunction } from "./helpers";
import * as t from "@babel/types";
export type ObjectProperty = {
name: string;
description?: string | null | undefined;
type: t.TSType;
};
export default class TypescriptGenerator {
options: CompilerOptions;
typeFromGraphQLType: Function;
constructor(compilerOptions: CompilerOptions) {
this.options = compilerOptions;
this.typeFromGraphQLType =
createTypeFromGraphQLTypeFunction(compilerOptions);
}
public enumerationDeclaration(type: GraphQLEnumType) {
const { name, description } = type;
const enumMembers = sortEnumValues(type.getValues()).map(({ value }) => {
return t.TSEnumMember(t.identifier(value), t.stringLiteral(value));
});
const typeAlias = t.exportNamedDeclaration(
t.TSEnumDeclaration(t.identifier(name), enumMembers),
[]
);
if (description) {
typeAlias.leadingComments = [
{
type: "CommentBlock",
value: commentBlockContent(description),
} as t.CommentBlock,
];
}
return typeAlias;
}
public inputObjectDeclaration(inputObjectType: GraphQLInputObjectType) {
const { name, description } = inputObjectType;
const fieldMap = inputObjectType.getFields();
const fields: ObjectProperty[] = Object.keys(
inputObjectType.getFields()
).map((fieldName: string) => {
const field = fieldMap[fieldName];
return {
name: fieldName,
type: this.typeFromGraphQLType(field.type),
};
});
const inputType = t.exportNamedDeclaration(
this.interface(name, fields, {
keyInheritsNullability: true,
}),
[]
);
if (description) {
inputType.leadingComments = [
{
type: "CommentBlock",
value: commentBlockContent(description),
} as t.CommentBlock,
];
}
return inputType;
}
public typesForProperties(
fields: ObjectProperty[],
{
keyInheritsNullability = false,
}: {
keyInheritsNullability?: boolean;
} = {}
) {
return fields.map(({ name, description, type }) => {
const propertySignatureType = t.TSPropertySignature(
t.identifier(name),
t.TSTypeAnnotation(type)
);
// TODO: Check if this works
propertySignatureType.optional =
keyInheritsNullability && this.isNullableType(type);
if (this.options.useReadOnlyTypes) {
propertySignatureType.readonly = true;
}
if (description) {
propertySignatureType.leadingComments = [
{
type: "CommentBlock",
value: commentBlockContent(description),
} as t.CommentBlock,
];
}
return propertySignatureType;
});
}
public interface(
name: string,
fields: ObjectProperty[],
{
keyInheritsNullability = false,
}: {
keyInheritsNullability?: boolean;
} = {}
) {
return t.TSInterfaceDeclaration(
t.identifier(name),
undefined,
undefined,
t.TSInterfaceBody(
this.typesForProperties(fields, {
keyInheritsNullability,
})
)
);
}
public typeAliasGenericUnion(name: string, members: t.TSType[]) {
return t.TSTypeAliasDeclaration(
t.identifier(name),
undefined,
t.TSUnionType(members)
);
}
public exportDeclaration(declaration: t.Declaration) {
return t.exportNamedDeclaration(declaration, []);
}
public nameFromScopeStack(scope: string[]) {
return scope.join("_");
}
public makeNullableType(type: t.TSType) {
return t.TSUnionType([type, t.TSNullKeyword()]);
}
public isNullableType(type: t.TSType) {
return (
t.isTSUnionType(type) &&
type.types.some((type) => t.isTSNullKeyword(type))
);
}
public import(types: GraphQLType[], source: string) {
return t.importDeclaration(
types.map((type) =>
t.importSpecifier(
t.identifier(type.toString()),
t.identifier(type.toString())
)
),
t.stringLiteral(source)
);
}
}
```
|
Georg Anton Dassel (; 22 December 1852 – 8 March 1934) was a German industrialist, marble manufacturer, philanthropist and politician. Dassel was the majority owner of the Westphalian Marble Works (German: Westfälische Marmorwerke AG). He served several terms as a member of the Landtag Province of Westphalia for the Arnsberg district. In 1887, Dassel acquired the historic neoclassical Dassel Mansion (now an official landmark of Warstein and local museum), and renovated it to its current state. His eldest son, Georg, Jr., married Margarete 'Grete' Siepmann, a daughter of Hugo Siepmann.
Early life and education
Dassel was born on 22 December 1852 in Düsseldorf, Rhine Province, German Empire to Ludwig Anton Dassel (1822-1888) and Johanna Sophie Helene (née Buddeberg; 1827–1894). His paternal lineage is an offspring of the noble Dassel family. He attended the private school of Wilhelm Herchenbach and then completed the Realgymnasium in Düsseldorf. Between 1868 and 1870 he completed a commercial apprenticeship with I.P. Rittenhaus & Company, an international textile concern, active in Turkey, Africa and India.
Career
During the Franco-Prussian War, he led the company, after many of its male employees were drafted into the war. Between 1879 and 1881 he worked as an employee for a private bank in Düsseldorf. Since 1881, he has been active in the stone industry. He took a stake in a marble company and opened a grinding shop in Reichenbach, from which Deutsche Steinindustrie AG emerged. Finally, he became self-employed by taking over the operations of the Westfälische Marmorwerke AG in Allagen (“Victoriawerke”), which had been shut down for a number of years, and which he reopened in 1886. Acquisitions such as that of a competing plant in Borghausen (1894), Liethammer (1898) and the Syenit plant in Schönberg (1900) followed.
Politics
Dassel served as a member of the provincial legislature, Landtag of the Province of Westphalia from 1917 to 1919.
Personal life
Since 1880, Dassel has been married to Marie Karoline (née Hassenkamp; 1862–1931), with whom he had eight children;
Georg Dassel, Jr. (1881-1944), married Grete Siepmann, a daughter of Hugo Siepmann, owner and resident of Dassel Mansion from 1934 to 1944. Four sons; Georg Hugo Rolf (1922-1944), Klaus Dassel (1924-1985), Walter (1929-2017) and Bernd (1940-2001)
Paul Dassel (1882-1924), owner of quarry in Wallen, never married.
Else Dassel (1886-1968)
Hans Walter Dassel (1887-1929)
Arthur Christian Erich Dassel (1892-1956) mayor of Allagen (1945–56) and namesake of Erich-Dassel-Strasse, resided in Sichtigvor
Dassel died aged 81 at Dassel Mansion in Allagen, Germany.
References
German industrialists
German philanthropists
1852 births
1934 deaths
|
Jürgen Heuser (born 13 March 1953 in Barth, Mecklenburg-Vorpommern) is a German weightlifter.
In 1978, participating for the German Democratic Republic, he won the World Championship in Gettysburg, Pennsylvania. At the 1980 Summer Olympics in Moscow he won a silver medal in the +110 kg class.
References
External links
1953 births
Living people
People from Barth, Germany
German male weightlifters
Olympic weightlifters for East Germany
East German male weightlifters
Olympic silver medalists for East Germany
Weightlifters at the 1980 Summer Olympics
Olympic medalists in weightlifting
Medalists at the 1980 Summer Olympics
Sportspeople from Mecklenburg-Western Pomerania
|
```rust
//! This page documents some limitations that sled imposes on users.
//!
//! * The underlying pagecache can currently store 2^36 pages. Leaf nodes in the
//! `Tree` tend to split when they have more than 16 keys and values. This
//! means that sled can hold a little less than **4,294,967,296 total items**
//! (index nodes in the tree will also consume pages, but ideally far fewer
//! than 1%). This is easy to increase without requiring migration, as it is
//! entirely a runtime concern, but nobody has expressed any interest in this
//! being larger yet. Note to future folks who need to increase this: increase
//! the width of the Node1 type in the pagetable module, and correspondingly
//! increase the number of bits that are used to index into it. It's just a
//! simple wait-free grow-only 2-level pagetable.
//! * keys and values use `usize` for the length fields due to the way that Rust
//! uses `usize` for slice lengths, and will be limited to the target
//! platform's pointer width. On 64-bit machines, this will be 64 bits. On
//! 32-bit machines, it will be limited to `u32::max_value()`.
//! * Due to the 32-bit limitation on slice sizes on 32-bit architectures, we
//! currently do not support systems large enough for the snapshot file to
//! reach over 4gb. The snapshot file tends to be a small fraction of the
//! total db size, and it's likely we'll be able to implement a streaming
//! deserializer if this ever becomes an issue, but it seems unclear if anyone
//! will encounter this limitation.
```
|
```python
"""
Grants user access to web
"""
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.sharing.role_type import RoleType
from tests import (
test_client_credentials,
test_team_site_url,
test_user_principal_name_alt,
)
ctx = ClientContext(test_team_site_url).with_credentials(test_client_credentials)
result = ctx.web.add_role_assignment(
test_user_principal_name_alt, RoleType.Contributor
).execute_query()
print("Access has been granted")
```
|
```php
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* (at your option) any later version.
*
* @author PocketMine Team
* @link path_to_url
*
*
*/
declare(strict_types=1);
namespace pocketmine\phpstan\rules;
use PhpParser\Node;
use PhpParser\Node\Expr\BinaryOp;
use PhpParser\Node\Expr\BinaryOp\Identical;
use PhpParser\Node\Expr\BinaryOp\NotIdentical;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use PHPStan\Type\UnionType;
use PHPStan\Type\VerbosityLevel;
use pocketmine\utils\EnumTrait;
use function sprintf;
/**
* @phpstan-implements Rule<BinaryOp>
*/
class DisallowEnumComparisonRule implements Rule{
public function getNodeType() : string{
return BinaryOp::class;
}
public function processNode(Node $node, Scope $scope) : array{
if(!($node instanceof Identical) && !($node instanceof NotIdentical)){
return [];
}
$leftType = $scope->getType($node->left);
$rightType = $scope->getType($node->right);
$leftEnum = $this->checkForEnumTypes($leftType);
$rightEnum = $this->checkForEnumTypes($rightType);
if($leftEnum && $rightEnum){
return [RuleErrorBuilder::message(sprintf(
'Strict comparison using %s involving enum types %s and %s is not reliable.',
$node instanceof Identical ? '===' : '!==',
$leftType->describe(VerbosityLevel::value()),
$rightType->describe(VerbosityLevel::value())
))->build()];
}
return [];
}
private function checkForEnumTypes(Type $comparedType) : bool{
//TODO: what we really want to do here is iterate over the contained types, but there's no universal way to
//do that. This might break with other circumstances.
if($comparedType instanceof ObjectType){
$types = [$comparedType];
}elseif($comparedType instanceof UnionType){
$types = $comparedType->getTypes();
}else{
return false;
}
foreach($types as $containedType){
if(!($containedType instanceof ObjectType)){
continue;
}
$class = $containedType->getClassReflection();
if($class !== null && $class->hasTraitUse(EnumTrait::class)){
return true;
}
}
return false;
}
}
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.