text
stringlengths
1
22.8M
The Buenavista mine, historically known as the Cananea copper mine, is a large open pit copper mine located in the north-west of Mexico in Cananea, Sonora. It lies south of the international border near Nogales, Arizona. Buenavista mine represents one of the largest copper reserves in Mexico and in the world. As of 2013, it had estimated reserves of 36 million tonnes of ore grading 0.69% copper, 3.3% zinc and 33.4 million oz of silver. Cananea represents one of the largest copper reserves in Mexico and in the world, having estimated reserves of 4.52 billion tonnes of ore with a grade of 0.42% copper. History Greene Consolidated Copper Company (1896-1907) Copper has been mined at the site continuously as far back as 1899. The mine was originally owned by the American businessman William Cornell Greene. The mine was the location of the Cananea strike in 1906. Anaconda Copper (1907-1972) The mine was run for some time by the American company Anaconda Copper. Government of Mexico (1972-1990) The Mexican government mandated that ownership of the mining sector be gradually put into Mexican hands in 1961. Ownership was handed over to the company CIA Minera de Cananea SA in 1971, which was majority controlled by the Mexican government. Anaconda soon sold off its remaining minority interest. The privatization process began in 1988, but there were several failed auctions before the mine was successfully sold. In 1990, the state company was declared bankrupt. Grupo México (1990-present) In 1990, the Mexican government sold the mine to a joint bid by Mexicana de Cananea headed by Jorge Larrea, and the Belgian mining company Acec-Union Miniere. By 2003, the mine was run by Grupo México. Organized by the National Union of Mine and Metal Workers, about 1,200 workers on the mine went on strike demanding higher pay. The mine was reopened in 2010 after being closed for three years during a strike, and the mine was renamed the Buenavista mine. 2014 wastewater disaster In August 2014, a major ecological disaster took place at the mine when 40,000 cubic meters of wastewater spilled into the Bacanuchi and Sonora rivers. The wastewater carried sulfuric acid and it is believed to also have carried cyanide. The event prompted 88 schools to close temporarily. Mine officials have been criticized for not reporting the accident to the authorities until after 24 hours, when the residents had noticed the river water turned orange. In the wake of the disaster, Grupo México set up a $151 million clean up fund, while continuing operations. However, according to reports from El Informador, the fund was closed before 1% of funds were distributed to those affected, prompting pressure from the Office of the United Nations High Commissioner for Human Rights for full compensation. See also La Caridad Mine References Copper mines in Mexico Silver mines in Mexico Zinc mines in Mexico Tailings dam failures Dam failures in North America 2014 disasters in Mexico
Silakhor-e Sharqi Rural District () is in the Central District of Azna County, Lorestan province, Iran. Its capital is the village of Darband. At the National Census of 2006, its population was 8,171 in 1,763 households. There were 7,652 inhabitants in 2,004 households at the following census of 2011. At the most recent census of 2016, the population of the rural district was 7,152 in 2,086 households. The largest of its 20 villages was Darband, with 1,903 people. References Azna County Rural Districts of Lorestan Province Populated places in Lorestan Province Populated places in Azna County
Pantheism is the belief that the universe (or nature as the totality of everything) is identical with divinity, or that everything composes an all-encompassing, immanent God. Pantheists do not believe in a distinct personal or anthropomorphic god. List Nammalvar, one of the twelve Alvars. Vyasa, writer of Mahabharata. Laozi, name traditionally given to the writer of the Tao Te Ching, and considered the founder of philosophical Taoism. Heraclitus (c. 535 BCE–c. 475 BCE), pre-Socratic Greek philosopher, a native of the Greek city Ephesus, Ionia, on the coast of Asia Minor. He was of distinguished parentage. Little is known about his early life and education, but he regarded himself as self-taught and a pioneer of wisdom. From the lonely life he led, and still more from the riddling nature of his philosophy and his contempt for humankind in general, he was called "The Obscure" and the "Weeping Philosopher". The Stoics (founded early 3rd century BCE) are often considered pantheists for their belief that it is virtuous to maintain a will (called prohairesis) that is in accord with nature and for arguing that physical conceptions are adequate to explain the entire cosmos. Adi Shankara (788–820 CE), known for consolidating the doctrine of Advaita Vedānta. Johannes Scotus Eriugena (c. 815–c. 877), Irish theologian, Neoplatonist philosopher, and poet. Amalric of Bena (died c. 1204–1207), French theologian, father of medieval pantheism, after whom the Amalricians are named. Giordano Bruno (1548–1600), Italian Dominican friar, philosopher, mathematician and astronomer. He was burned at the stake for his pantheist views. Jakob Böhme (1575–1624), German philosopher, Christian mystic, and Lutheran Protestant theologian. Baruch Spinoza (1632–1677), Jewish-Dutch philosopher, has been called the "prophet" and "prince" of pantheism. John Toland (1670–1722), an Irish rationalist philosopher and freethinker, and occasional satirist, who wrote numerous books including the Pantheisticon. Gotthold Ephraim Lessing (1729–1781), German writer, philosopher, dramatist, publicist and art critic. His alleged confession of Spinozism led to what is known as the pantheism controversy of the 1780s. Late modern period Johann Wolfgang von Goethe (1749–1832), German writer, artist, and politician. His body of work includes epic and lyric poetry written in a variety of metres and styles; prose and verse dramas; memoirs; an autobiography; literary and aesthetic criticism; treatises on botany, anatomy, and colour; and four novels. In addition, numerous literary and scientific fragments, and over 10,000 letters written by him are extant, as are nearly 3,000 drawings. Georg Wilhelm Friedrich Hegel (1770–1831), German philosopher, one of the creators of German Idealism. Ludwig van Beethoven (1770–1827), German composer and pianist. A crucial figure in the transition between the Classical and Romantic eras in Western art music, he remains one of the most famous and influential of all composers. His best-known compositions include 9 symphonies, 5 concertos for piano, 32 piano sonatas, and 16 string quartets. He also composed other chamber music, choral works (including the celebrated Missa Solemnis), and songs. He has been labeled a deist as well. Caspar David Friedrich (1774–1840), German Romantic landscape painter. Friedrich Wilhelm Joseph Schelling (1775–1854), German philosopher. Hans Christian Ørsted (1777–1851), Danish physicist and chemist who discovered that electric currents create magnetic fields. Ralph Waldo Emerson (1803–1882), American essayist, lecturer, and poet, who led the transcendentalist movement of the mid-19th century. Alfred, Lord Tennyson (1809–1892), English poet. Tennyson praised Bruno and Spinoza on his deathbed, saying of Bruno, "His view of God is in some ways mine". Margaret Fuller (1810–1850), American journalist, editor, critic, translator, and women's rights advocate associated with the American transcendentalist movement. Otto von Bismarck (1815–1898), German statesman and diplomat, first Chancellor of the German Empire. Henry David Thoreau (1817–1862), American author, poet, philosopher, freemason, abolitionist, naturalist, tax resister, development critic, surveyor, historian, and leading transcendentalist. Walt Whitman (1819–1892), American poet, essayist and journalist. John Shertzer Hittell (1825–1901), American historian. Leo Tolstoy (1828–1910), Russian writer, philosophical essayist and pacifist. Robert G. Ingersoll (1833–1899), lawyer, Civil War veteran, political leader, orator, and notable agnostic. Ernst Haeckel (1834–1919), German zoologist, natural historian, and philosopher. Friedrich Nietzsche (1844–1900), German philosopher. While sometimes interpreted as a proponent of atheistic existentialism by his statements about God, the German philosopher Martin Heidegger says about Nietzsche's conception of divine: "Is Nietzsche here teaching a pan-theism", asks Heidegger. "If it were pantheism, we would first of all still have to ask what pan — the universe, the whole — and what theos — God — here mean. At all events, here we have a question! So, then, God is not dead? Yes and no! Yes, he is dead. But which God? The God of "morality," the Christian God is dead — the "Father" in whom we seek sanctuary, the "Personality" with whom we negotiate and bare our hearts, the "Judge" with whom we adjudicate, the "Paymaster" from whom we receive our virtues' reward, that God with whom we do business. Yet where is the mother who will take pay for loving her child? The God who is viewed in terms of morality, this God alone is meant when Nietzsche says "God is dead." He died because human beings murdered him. They murdered him when they reckoned his divine grandeur in terms of their petty needs for recompense, when they cut him down to their own size. That God fell from power because he was a "blunder" of human beings who negate themselves and negate life (Nietzsche by Martin Heidegger, VIII, 62). Von Douglas Burham notes, in light of Nietzsche, that "God exists entirely immanently to nature or the cosmos" and that Nietzsche opposed popular forms of atheism as mired by morality: "That is, a "religion of pity" captures the way in which an atheist, for example, surreptitiously retains a direct connection to Christianity through the continuing commitment to morality.". Nietzsche in the posthumously-published "The Will to Power" translated by Walter Kaufmann (philosopher) states Felix Klein (1849–1925), German mathematician. Nikola Tesla (1856–1943), the Serbian American inventor believed in aether (opposite essentially of gravity) being the source of all existence and energy, sometimes referred to as prana. or Qi in Chinese. Gustav Mahler (1860–1911), Romantic Austrian composer and one of the leading conductors of his generation. Vazha-Pshavela (1861–1915) Georgian poet and writer Luka Razikashvili, noted Georgian patriot and author of the highest calibre in the field of Georgian literature. Claude Debussy (1862–1918), French composer. Carl Gustav Jung (1875–1961), Swiss psychiatrist and psychotherapist who founded analytical psychology. Jung proposed and developed the concept of the collective unconscious from a pantheistic worldview. Janusz Korczak (1878–1942), Polish-Jewish educator, children's author, and pediatrician. Albert Einstein (1879–1955), German theoretical physicist, one of the most prolific intellects in human history, identified with Spinoza's God and called his own views on God "pantheistic". Einstein held a wavering view on pantheism and at times did not endorse it completely, making the statement in 1930, "I do not know if I can define myself as a pantheist. The problem involved is too vast for our limited minds." Instead, Einstein also frequently spoke of a more Cosmic Spirituality, a view where religion and science are partnered. Einstein rejected atheism. D. H. Lawrence (1885–1930), English novelist, poet, playwright, essayist, literary critic and painter. Robinson Jeffers (1887–1962), American poet, known for his work about the central California coast. Isidor Isaac Rabi (1898–1988), Galician-born American physicist and Nobel laureate, recognized in 1944 for his discovery of nuclear magnetic resonance, which is used in magnetic resonance imaging. He was also involved in the development of the cavity magnetron, which is used in microwave radar and microwave ovens. Leon Kelly (1901–1982), American painter and draftsman, most well known for his contributions to American Surrealism. Ansel Adams (1902–1984), American photographer and environmentalist. Alan Watts (1915–1973), British philosopher, writer, and speaker. Pete Seeger (1919–2014), American folk singer. Audrey Hepburn (1929–1993), British actress and humanitarian. Carl Sagan (1934–1996), American astronomer, author, and science communicator. Jose Mujica (1935–), Uruguay president. Alan Vega (1938–2016), American vocalist, primarily known for his work with electronic protopunk duo Suicide. John A. Leslie (1940–), Canadian philosopher and writer. Reinhold Messner (1944–), Italian mountaineer, explorer, and author. Paul Harrison (1945–), English journalist, author of several books and reports on environment and development, and the founder and president of the World Pantheist Movement. Michio Kaku (1947–), American theoretical physicist and science communicator. Chris Goodall (1955–), English businessman and author. Mark Rylance (1960–), English actor. Jadav Payeng (1963–), Indian environmentalist and forestry worker. James Hetfield (1963–), American lead vocalist, rhythm guitarist, co-founder and main songwriter of heavy metal band Metallica. That Vegan Teacher (1964–), Canadian animal rights activist. Elon Musk (1971–), entrepreneur and business magnate. Gaahl (1975–), Norwegian black metal vocalist and a painter. Groups Africa Chukwu Asia Advaita Taoism Vishistadvaita Shaktadvaita Trika Shaivism Australia Europe Peterburgian Vedism Adamites, a proto protestant sect Middle East Bektashi Sufis North America Religious Science See also Pandeism#Notable thinkers Pierre Teilhard de Chardin George Berkeley subjective idealism/'immaterialism' References External links Pantheist Index Pantheist Panorama Pantheist organizations Pantheists
```objective-c /* * The copyright in this software is being made available under the 2-clauses * party and contributor rights, including patent rights, and no such rights * are granted under this license. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef OPJ_CIO_H #define OPJ_CIO_H /** @file cio.h @brief Implementation of a byte input-output process (CIO) The functions in CIO.C have for goal to realize a byte input / output process. */ /** @defgroup CIO CIO - byte input-output stream */ /*@{*/ #include "opj_config_private.h" /* your_sha256_hash------- */ #if defined(OPJ_BIG_ENDIAN) #define opj_write_bytes opj_write_bytes_BE #define opj_read_bytes opj_read_bytes_BE #define opj_write_double opj_write_double_BE #define opj_read_double opj_read_double_BE #define opj_write_float opj_write_float_BE #define opj_read_float opj_read_float_BE #else #define opj_write_bytes opj_write_bytes_LE #define opj_read_bytes opj_read_bytes_LE #define opj_write_double opj_write_double_LE #define opj_read_double opj_read_double_LE #define opj_write_float opj_write_float_LE #define opj_read_float opj_read_float_LE #endif #define OPJ_STREAM_STATUS_OUTPUT 0x1U #define OPJ_STREAM_STATUS_INPUT 0x2U #define OPJ_STREAM_STATUS_END 0x4U #define OPJ_STREAM_STATUS_ERROR 0x8U /** Byte input-output stream. */ typedef struct opj_stream_private { /** * User data, be it files, ... The actual data depends on the type of the stream. */ void * m_user_data; /** * Pointer to function to free m_user_data (NULL at initialization) * when destroying the stream. If pointer is NULL the function is not * called and the m_user_data is not freed (even if non-NULL). */ opj_stream_free_user_data_fn m_free_user_data_fn; /** * User data length */ OPJ_UINT64 m_user_data_length; /** * Pointer to actual read function (NULL at the initialization of the cio. */ opj_stream_read_fn m_read_fn; /** * Pointer to actual write function (NULL at the initialization of the cio. */ opj_stream_write_fn m_write_fn; /** * Pointer to actual skip function (NULL at the initialization of the cio. * There is no seek function to prevent from back and forth slow procedures. */ opj_stream_skip_fn m_skip_fn; /** * Pointer to actual seek function (if available). */ opj_stream_seek_fn m_seek_fn; /** * Actual data stored into the stream if readed from. Data is read by chunk of fixed size. * you should never access this data directly. */ OPJ_BYTE * m_stored_data; /** * Pointer to the current read data. */ OPJ_BYTE * m_current_data; /** * FIXME DOC. */ OPJ_OFF_T(* m_opj_skip)(struct opj_stream_private *, OPJ_OFF_T, struct opj_event_mgr *); /** * FIXME DOC. */ OPJ_BOOL(* m_opj_seek)(struct opj_stream_private *, OPJ_OFF_T, struct opj_event_mgr *); /** * number of bytes containing in the buffer. */ OPJ_SIZE_T m_bytes_in_buffer; /** * The number of bytes read/written from the beginning of the stream */ OPJ_OFF_T m_byte_offset; /** * The size of the buffer. */ OPJ_SIZE_T m_buffer_size; /** * Flags to tell the status of the stream. * Used with OPJ_STREAM_STATUS_* defines. */ OPJ_UINT32 m_status; } opj_stream_private_t; /** @name Exported functions (see also openjpeg.h) */ /*@{*/ /* your_sha256_hash------- */ /** * Write some bytes to the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write * @param p_nb_bytes the number of bytes to write */ void opj_write_bytes_BE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes); /** * Reads some bytes from the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. * @param p_nb_bytes the nb bytes to read. * @return the number of bytes read or -1 if an error occurred. */ void opj_read_bytes_BE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes); /** * Write some bytes to the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write * @param p_nb_bytes the number of bytes to write * @return the number of bytes written or -1 if an error occurred */ void opj_write_bytes_LE(OPJ_BYTE * p_buffer, OPJ_UINT32 p_value, OPJ_UINT32 p_nb_bytes); /** * Reads some bytes from the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. * @param p_nb_bytes the nb bytes to read. * @return the number of bytes read or -1 if an error occurred. */ void opj_read_bytes_LE(const OPJ_BYTE * p_buffer, OPJ_UINT32 * p_value, OPJ_UINT32 p_nb_bytes); /** * Write some bytes to the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write */ void opj_write_double_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value); /*** * Write some bytes to the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write */ void opj_write_double_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT64 p_value); /** * Reads some bytes from the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. */ void opj_read_double_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value); /** * Reads some bytes from the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. */ void opj_read_double_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT64 * p_value); /** * Reads some bytes from the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. */ void opj_read_float_LE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value); /** * Reads some bytes from the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to read data from. * @param p_value pointer to the value that will store the data. */ void opj_read_float_BE(const OPJ_BYTE * p_buffer, OPJ_FLOAT32 * p_value); /** * Write some bytes to the given data buffer, this function is used in Little Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write */ void opj_write_float_LE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value); /*** * Write some bytes to the given data buffer, this function is used in Big Endian cpus. * @param p_buffer pointer the data buffer to write data to. * @param p_value the value to write */ void opj_write_float_BE(OPJ_BYTE * p_buffer, OPJ_FLOAT32 p_value); /** * Reads some bytes from the stream. * @param p_stream the stream to read data from. * @param p_buffer pointer to the data buffer that will receive the data. * @param p_size number of bytes to read. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes read, or -1 if an error occurred or if the stream is at the end. */ OPJ_SIZE_T opj_stream_read_data(opj_stream_private_t * p_stream, OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr); /** * Writes some bytes to the stream. * @param p_stream the stream to write data to. * @param p_buffer pointer to the data buffer holds the data to be writtent. * @param p_size number of bytes to write. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes writtent, or -1 if an error occurred. */ OPJ_SIZE_T opj_stream_write_data(opj_stream_private_t * p_stream, const OPJ_BYTE * p_buffer, OPJ_SIZE_T p_size, struct opj_event_mgr * p_event_mgr); /** * Writes the content of the stream buffer to the stream. * @param p_stream the stream to write data to. * @param p_event_mgr the user event manager to be notified of special events. * @return true if the data could be flushed, false else. */ OPJ_BOOL opj_stream_flush(opj_stream_private_t * p_stream, struct opj_event_mgr * p_event_mgr); /** * Skips a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes skipped, or -1 if an error occurred. */ OPJ_OFF_T opj_stream_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Tells the byte offset on the stream (similar to ftell). * * @param p_stream the stream to get the information from. * * @return the current position o fthe stream. */ OPJ_OFF_T opj_stream_tell(const opj_stream_private_t * p_stream); /** * Get the number of bytes left before the end of the stream (similar to cio_numbytesleft). * * @param p_stream the stream to get the information from. * * @return Number of bytes left before the end of the stream. */ OPJ_OFF_T opj_stream_get_number_byte_left(const opj_stream_private_t * p_stream); /** * Skips a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes skipped, or -1 if an error occurred. */ OPJ_OFF_T opj_stream_write_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Skips a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes skipped, or -1 if an error occurred. */ OPJ_OFF_T opj_stream_read_skip(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Skips a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return OPJ_TRUE if success, or OPJ_FALSE if an error occurred. */ OPJ_BOOL opj_stream_read_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Skips a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return the number of bytes skipped, or -1 if an error occurred. */ OPJ_BOOL opj_stream_write_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Seeks a number of bytes from the stream. * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. * @return true if the stream is seekable. */ OPJ_BOOL opj_stream_seek(opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); /** * Tells if the given stream is seekable. */ OPJ_BOOL opj_stream_has_seek(const opj_stream_private_t * p_stream); /** * FIXME DOC. */ OPJ_SIZE_T opj_stream_default_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data); /** * FIXME DOC. */ OPJ_SIZE_T opj_stream_default_write(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data); /** * FIXME DOC. */ OPJ_OFF_T opj_stream_default_skip(OPJ_OFF_T p_nb_bytes, void * p_user_data); /** * FIXME DOC. */ OPJ_BOOL opj_stream_default_seek(OPJ_OFF_T p_nb_bytes, void * p_user_data); /* your_sha256_hash------- */ /*@}*/ /*@}*/ #endif /* OPJ_CIO_H */ ```
```javascript import reduce from 'lodash/fp/reduce'; import * as actionTypes from '../../constants/actionTypes'; const initialState = { followings: [], activities: [], typeReposts: {}, typeTracks: {}, followers: [], favorites: [], }; export default function(state = initialState, action) { switch (action.type) { case actionTypes.MERGE_FOLLOWINGS: return mergeFollowings(state, action.followings); case actionTypes.REMOVE_FROM_FOLLOWINGS: return removeFromFollowings(state, action.userId); case actionTypes.MERGE_ACTIVITIES: return mergeActivities(state, action.activities); case actionTypes.MERGE_TRACK_TYPES_TRACK: return mergeTrackTypesTrack(state, action.tracks); case actionTypes.MERGE_TRACK_TYPES_REPOST: return mergeTrackTypesRepost(state, action.reposts); case actionTypes.MERGE_FOLLOWERS: return mergeFollowers(state, action.followers); case actionTypes.MERGE_FAVORITES: return mergeFavorites(state, action.favorites); case actionTypes.REMOVE_FROM_FAVORITES: return removeFromFavorites(state, action.trackId); case actionTypes.RESET_SESSION: return initialState; } return state; } function mergeFollowings(state, list) { return { ...state, followings: getConcatList(state.followings, list) }; } function mergeActivities(state, list) { return { ...state, activities: getConcatList(state.activities, list) }; } function mergeTrackTypesTrack(state, list) { const { typeTracks } = state; const mergeTypes = reduce(countByType, typeTracks); return { ...state, typeTracks: mergeTypes(list) }; } function mergeTrackTypesRepost(state, list) { const { typeReposts } = state; const mergeTypes = reduce(countByType, typeReposts); return { ...state, typeReposts: mergeTypes(list) }; } function countByType(result, value) { /* eslint-disable no-param-reassign */ result[value.id] = result[value.id] ? result[value.id] + 1 : 1; /* eslint-enable no-param-reassign */ return result; } function mergeFollowers(state, list) { return { ...state, followers: getConcatList(state.followers, list) }; } function mergeFavorites(state, list) { return { ...state, favorites: getConcatList(state.favorites, list) }; } function removeFromFollowings(state, userId) { const index = state.followings.indexOf(userId); return { ...state, followings: removeWithIndex(state.followings, index) }; } function removeFromFavorites(state, trackId) { const index = state.favorites.indexOf(trackId); return { ...state, favorites: removeWithIndex(state.favorites, index) }; } function removeWithIndex(list, index) { return [ ...list.slice(0, index), ...list.slice(index + 1) ]; } function getConcatList(currentList, concatList) { return [...currentList, ...concatList]; } ```
```c++ /*============================================================================= path_to_url file LICENSE_1_0.txt or copy at path_to_url =============================================================================*/ #ifndef BOOST_SPIRIT_TREE_PARSE_TREE_HPP #define BOOST_SPIRIT_TREE_PARSE_TREE_HPP #include <boost/spirit/home/classic/namespace.hpp> #include <boost/spirit/home/classic/tree/common.hpp> #include <boost/spirit/home/classic/core/scanner/scanner.hpp> #include <boost/spirit/home/classic/tree/parse_tree_fwd.hpp> /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN ////////////////////////////////// // pt_match_policy is simply an id so the correct specialization of tree_policy can be found. template < typename IteratorT, typename NodeFactoryT, typename T > struct pt_match_policy : public common_tree_match_policy< pt_match_policy<IteratorT, NodeFactoryT, T>, IteratorT, NodeFactoryT, pt_tree_policy< pt_match_policy<IteratorT, NodeFactoryT, T>, NodeFactoryT, T >, T > { typedef common_tree_match_policy< pt_match_policy<IteratorT, NodeFactoryT, T>, IteratorT, NodeFactoryT, pt_tree_policy< pt_match_policy<IteratorT, NodeFactoryT, T>, NodeFactoryT, T >, T > common_tree_match_policy_; pt_match_policy() { } template <typename PolicyT> pt_match_policy(PolicyT const & policies) : common_tree_match_policy_(policies) { } }; ////////////////////////////////// template <typename MatchPolicyT, typename NodeFactoryT, typename T> struct pt_tree_policy : public common_tree_tree_policy<MatchPolicyT, NodeFactoryT> { typedef typename MatchPolicyT::match_t match_t; typedef typename MatchPolicyT::iterator_t iterator_t; template<typename MatchAT, typename MatchBT> static void concat(MatchAT& a, MatchBT const& b) { BOOST_SPIRIT_ASSERT(a && b); std::copy(b.trees.begin(), b.trees.end(), std::back_insert_iterator<typename match_t::container_t>(a.trees)); } template <typename MatchT, typename Iterator1T, typename Iterator2T> static void group_match(MatchT& m, parser_id const& id, Iterator1T const& first, Iterator2T const& last) { if (!m) return; typedef typename NodeFactoryT::template factory<iterator_t> factory_t; typedef typename tree_match<iterator_t, NodeFactoryT, T>::container_t container_t; typedef typename container_t::iterator cont_iterator_t; match_t newmatch(m.length(), factory_t::create_node(first, last, false)); std::swap(newmatch.trees.begin()->children, m.trees); // set this node and all it's unset children's rule_id newmatch.trees.begin()->value.id(id); for (cont_iterator_t i = newmatch.trees.begin()->children.begin(); i != newmatch.trees.begin()->children.end(); ++i) { if (i->value.id() == 0) i->value.id(id); } m = newmatch; } template <typename FunctorT, typename MatchT> static void apply_op_to_match(FunctorT const& op, MatchT& m) { op(m); } }; namespace impl { template <typename IteratorT, typename NodeFactoryT, typename T> struct tree_policy_selector<pt_match_policy<IteratorT, NodeFactoryT, T> > { typedef pt_tree_policy< pt_match_policy<IteratorT, NodeFactoryT, T>, NodeFactoryT, T > type; }; } // namespace impl ////////////////////////////////// struct gen_pt_node_parser_gen; template <typename T> struct gen_pt_node_parser : public unary<T, parser<gen_pt_node_parser<T> > > { typedef gen_pt_node_parser<T> self_t; typedef gen_pt_node_parser_gen parser_generator_t; typedef unary_parser_category parser_category_t; gen_pt_node_parser(T const& a) : unary<T, parser<gen_pt_node_parser<T> > >(a) {} template <typename ScannerT> typename parser_result<self_t, ScannerT>::type parse(ScannerT const& scan) const { typedef typename ScannerT::iteration_policy_t iteration_policy_t; typedef typename ScannerT::match_policy_t::iterator_t iterator_t; typedef typename ScannerT::match_policy_t::factory_t factory_t; typedef pt_match_policy<iterator_t, factory_t> match_policy_t; typedef typename ScannerT::action_policy_t action_policy_t; typedef scanner_policies< iteration_policy_t, match_policy_t, action_policy_t > policies_t; return this->subject().parse(scan.change_policies(policies_t(scan))); } }; ////////////////////////////////// struct gen_pt_node_parser_gen { template <typename T> struct result { typedef gen_pt_node_parser<T> type; }; template <typename T> static gen_pt_node_parser<T> generate(parser<T> const& s) { return gen_pt_node_parser<T>(s.derived()); } template <typename T> gen_pt_node_parser<T> operator[](parser<T> const& s) const { return gen_pt_node_parser<T>(s.derived()); } }; ////////////////////////////////// const gen_pt_node_parser_gen gen_pt_node_d = gen_pt_node_parser_gen(); /////////////////////////////////////////////////////////////////////////////// // // Parse functions for parse trees // /////////////////////////////////////////////////////////////////////////////// template < typename NodeFactoryT, typename IteratorT, typename ParserT, typename SkipT > inline tree_parse_info<IteratorT, NodeFactoryT> pt_parse( IteratorT const& first_, IteratorT const& last, parser<ParserT> const& p, SkipT const& skip, NodeFactoryT const& /*dummy_*/ = NodeFactoryT()) { typedef skip_parser_iteration_policy<SkipT> iter_policy_t; typedef pt_match_policy<IteratorT, NodeFactoryT> pt_match_policy_t; typedef scanner_policies<iter_policy_t, pt_match_policy_t> scanner_policies_t; typedef scanner<IteratorT, scanner_policies_t> scanner_t; iter_policy_t iter_policy(skip); scanner_policies_t policies(iter_policy); IteratorT first = first_; scanner_t scan(first, last, policies); tree_match<IteratorT, NodeFactoryT> hit = p.derived().parse(scan); return tree_parse_info<IteratorT, NodeFactoryT>( first, hit, hit && (first == last), hit.length(), hit.trees); } template <typename IteratorT, typename ParserT, typename SkipT> inline tree_parse_info<IteratorT> pt_parse( IteratorT const& first, IteratorT const& last, parser<ParserT> const& p, SkipT const& skip) { typedef node_val_data_factory<nil_t> default_node_factory_t; return pt_parse(first, last, p, skip, default_node_factory_t()); } ////////////////////////////////// template <typename IteratorT, typename ParserT> inline tree_parse_info<IteratorT> pt_parse( IteratorT const& first_, IteratorT const& last, parser<ParserT> const& parser) { typedef pt_match_policy<IteratorT> pt_match_policy_t; IteratorT first = first_; scanner< IteratorT, scanner_policies<iteration_policy, pt_match_policy_t> > scan(first, last); tree_match<IteratorT> hit = parser.derived().parse(scan); return tree_parse_info<IteratorT>( first, hit, hit && (first == last), hit.length(), hit.trees); } ////////////////////////////////// template <typename CharT, typename ParserT, typename SkipT> inline tree_parse_info<CharT const*> pt_parse( CharT const* str, parser<ParserT> const& p, SkipT const& skip) { CharT const* last = str; while (*last) last++; return pt_parse(str, last, p, skip); } ////////////////////////////////// template <typename CharT, typename ParserT> inline tree_parse_info<CharT const*> pt_parse( CharT const* str, parser<ParserT> const& parser) { CharT const* last = str; while (*last) { last++; } return pt_parse(str, last, parser); } /////////////////////////////////////////////////////////////////////////////// BOOST_SPIRIT_CLASSIC_NAMESPACE_END }} // namespace BOOST_SPIRIT_CLASSIC_NS #endif ```
Walter A. Sheaffer (July 27, 1867 – June 19, 1946) was an American inventor and businessman who developed the first commercially successful lever-filling fountain pen and founded the W.A. Sheaffer Pen Company. Walter A. Sheaffer was born in Bloomfield, Davis County, Iowa, on July 27, 1867. His father, Jacob Sheaffer, moved to Bloomfield from Ottumwa, Iowa, after returning from California Gulch in 1854 and entered the jewelry business. At that time in Bloomfield, which was only a small town of several hundred people. He was the oldest child of Elizabeth and Jacob Royer Sheaffer, who had settled in Bloomfield in 1854 and established a jewelry store. Sheaffer dropped out of school and first started working as a printer's devil, then a grocery boy and in the summer he operated a peanut stand. He next worked at a jewelry store in Centerville, Iowa and later at a store in Unionville, Missouri. He returned to Bloomfield in 1888, to become a partner with his father in the family business. In 1906, Sheaffer purchased a jewelry store in Fort Madison, Iowa where he established the Sheaffer Jewelry and Music Co. on Second St. Inspired by the success of self-filling fountain pens—notably, Conklins—Sheaffer turned his attention to inventing a self-filling mechanism of his own. He received his first fountain pen patent in 1908, for a lever-filler, but did not put his design into production until 1912. The new business was incorporated at the end of January 1913 as the W.A. Sheaffer Pen Company; its success was rapid, and the jewelry store was soon sold. Within ten years, the company had joined the top rank of American pen manufacturers, and was advertising nationally. Sheaffer served as president of the company from 1913 to 1938. From 1938 until his death, he served as chairman of the board, while his son Craig Royer Sheaffer served as president. Sheaffer died in Fort Madison. See also Walter A. Sheaffer House References External links "Walter A. Sheaffer Life Story" (With many related photos). The Des Moines Register | Famous Iowans: Walter A. Sheaffer The New York Times | Walter Sheaffer, Manufacturer, 78, Founder of Company Making Fountain Pen Bearing His Name Dies in Iowa PenHero.com (Many photo illustrated reference articles and reviews on modern and vintage Sheaffer pens and large list of pen links in PenBookmarks section.) New Evidence for the Early History of the Sheaffer Pen Company: The First Sheaffer Pens 1867 births 1946 deaths 20th-century American inventors People from Bloomfield, Iowa People from Fort Madison, Iowa
Cook's River was an electoral district of the Legislative Assembly in the Australian state of New South Wales, created in 1941 and named after inner southwestern Sydney's Cooks River. It was abolished in 1973. History Cook's River was created by the 1940 redistribution, in which the district of Arncliffe was abolished, with Cook's River absorbing east Arncliffe and Rockdale absorbing the balance. Cook's River also included the suburbs of Erskinville, Mascot, St Peters and Tempe. Joseph Cahill was the member for Arncliffe and elected to contest Cook's River. Cook's River was abolished at the 1973 redistribution and was divided between Rockdale and the new district of Heffron. The member for Marrickville, Norm Ryan, stood aside so that Tom Cahill could contest that seat. Members for Cook's River Election results References Former electoral districts of New South Wales Constituencies established in 1941 1941 establishments in Australia Constituencies disestablished in 1973 1973 disestablishments in Australia
The Lure is a 1914 American silent drama film directed by Alice Guy Blaché starring James O'Neill, Fraunie Fraunholz, Kirah Markham, and Claire Whitney. The Lure was an adaptation of a controversial play by George Scarborough that gives a sympathetic depiction of social pressures leading women into prostitution. Cast James O'Neill Fraunie Fraunholz (credited as Fraunie Fraunholtz) Kirah Markham Claire Whitney Wallace Scott Bernard Daly Lola May Lucia Moore Preservation With no copies of The Lure listed in any film archives, it is a lost film. References External links 1914 films 1914 drama films Silent American drama films American films based on plays Films directed by Alice Guy-Blaché World Film Company films American silent feature films American black-and-white films 1910s American films Films shot in Fort Lee, New Jersey
Tekmen is the name of several places in Turkey: People Ece Tekmen (born 2002), Turkish women's footballer Places Tekmen, Bozyazı, a town in Bozyazı district of Mersin Province Tekmen, Osmancık, a village in Osmancık district of Çorum Province
```yaml description: Nuvoton, NPCX Pulse Width Modulator (PWM) node compatible: "nuvoton,npcx-pwm" include: [pwm-controller.yaml, base.yaml, pinctrl-device.yaml] properties: reg: required: true clocks: required: true pinctrl-0: required: true pinctrl-names: required: true pwm-channel: type: int description: | A index to indicate PWM module that generates a single PWM signal. Please don't overwrite it in the board-level DT driver. clock-bus: type: string description: | Select a specific input clock source for the PWM module. If this property doesn't exist, fallback to default value in clocks property. enum: - NPCX_CLOCK_BUS_APB2 - NPCX_CLOCK_BUS_LFCLK pwm-cells: - channel - period - flags ```
```prolog #! /usr/bin/env perl # # in the file LICENSE in the source distribution or at # path_to_url # ==================================================================== # # This module may be used under the terms of either the GNU General # distributed along with this module. For further details see # path_to_url~appro/camellia/. # ==================================================================== # Performance in cycles per processed byte (less is better) in # 'openssl speed ...' benchmark: # # AMD64 Core2 EM64T # -evp camellia-128-ecb 16.7 21.0 22.7 # + over gcc 3.4.6 +25% +5% 0% # # camellia-128-cbc 15.7 20.4 21.1 # # 128-bit key setup 128 216 205 cycles/key # + over gcc 3.4.6 +54% +39% +15% # # Numbers in "+" rows represent performance improvement over compiler # generated code. Key setup timings are impressive on AMD and Core2 # thanks to 64-bit operations being covertly deployed. Improvement on # EM64T, pre-Core2 Intel x86_64 CPU, is not as impressive, because it # apparently emulates some of 64-bit operations in [32-bit] microcode. $flavour = shift; $output = shift; if ($flavour =~ /\./) { $output = $flavour; undef $flavour; } $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/); $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or die "can't locate x86_64-xlate.pl"; open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""; *STDOUT=*OUT; sub hi() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1h/; $r; } sub lo() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1l/; $r =~ s/%[er]([sd]i)/%\1l/; $r =~ s/%(r[0-9]+)[d]?/%\1b/; $r; } $t0="%eax";$t1="%ebx";$t2="%ecx";$t3="%edx"; @S=("%r8d","%r9d","%r10d","%r11d"); $i0="%esi"; $i1="%edi"; $Tbl="%rbp"; # size optimization $inp="%r12"; $out="%r13"; $key="%r14"; $keyend="%r15"; $arg0d=$win64?"%ecx":"%edi"; # const unsigned int Camellia_SBOX[4][256]; # Well, sort of... Camellia_SBOX[0][] is interleaved with [1][], # and [2][] - with [3][]. This is done to minimize code size. $SBOX1_1110=0; # Camellia_SBOX[0] $SBOX4_4404=4; # Camellia_SBOX[1] $SBOX2_0222=2048; # Camellia_SBOX[2] $SBOX3_3033=2052; # Camellia_SBOX[3] sub Camellia_Feistel { my $i=@_[0]; my $seed=defined(@_[1])?@_[1]:0; my $scale=$seed<0?-8:8; my $j=($i&1)*2; my ($s0,$s1,$s2,$s3)=(@S[($j)%4],@S[($j+1)%4],@S[($j+2)%4],@S[($j+3)%4]); $code.=<<___; xor $s0,$t0 # t0^=key[0] xor $s1,$t1 # t1^=key[1] movz `&hi("$t0")`,$i0 # (t0>>8)&0xff movz `&lo("$t1")`,$i1 # (t1>>0)&0xff mov $SBOX3_3033($Tbl,$i0,8),$t3 # t3=SBOX3_3033[0] mov $SBOX1_1110($Tbl,$i1,8),$t2 # t2=SBOX1_1110[1] movz `&lo("$t0")`,$i0 # (t0>>0)&0xff shr \$16,$t0 movz `&hi("$t1")`,$i1 # (t1>>8)&0xff xor $SBOX4_4404($Tbl,$i0,8),$t3 # t3^=SBOX4_4404[0] shr \$16,$t1 xor $SBOX4_4404($Tbl,$i1,8),$t2 # t2^=SBOX4_4404[1] movz `&hi("$t0")`,$i0 # (t0>>24)&0xff movz `&lo("$t1")`,$i1 # (t1>>16)&0xff xor $SBOX1_1110($Tbl,$i0,8),$t3 # t3^=SBOX1_1110[0] xor $SBOX3_3033($Tbl,$i1,8),$t2 # t2^=SBOX3_3033[1] movz `&lo("$t0")`,$i0 # (t0>>16)&0xff movz `&hi("$t1")`,$i1 # (t1>>24)&0xff xor $SBOX2_0222($Tbl,$i0,8),$t3 # t3^=SBOX2_0222[0] xor $SBOX2_0222($Tbl,$i1,8),$t2 # t2^=SBOX2_0222[1] mov `$seed+($i+1)*$scale`($key),$t1 # prefetch key[i+1] mov `$seed+($i+1)*$scale+4`($key),$t0 xor $t3,$t2 # t2^=t3 ror \$8,$t3 # t3=RightRotate(t3,8) xor $t2,$s2 xor $t2,$s3 xor $t3,$s3 ___ } # void Camellia_EncryptBlock_Rounds( # int grandRounds, # const Byte plaintext[], # const KEY_TABLE_TYPE keyTable, # Byte ciphertext[]) $code=<<___; .text # V1.x API .globl Camellia_EncryptBlock .type Camellia_EncryptBlock,\@abi-omnipotent .align 16 Camellia_EncryptBlock: movl \$128,%eax subl $arg0d,%eax movl \$3,$arg0d adcl \$0,$arg0d # keyBitLength==128?3:4 jmp .Lenc_rounds .size Camellia_EncryptBlock,.-Camellia_EncryptBlock # V2 .globl Camellia_EncryptBlock_Rounds .type Camellia_EncryptBlock_Rounds,\@function,4 .align 16 .Lenc_rounds: Camellia_EncryptBlock_Rounds: push %rbx push %rbp push %r13 push %r14 push %r15 .Lenc_prologue: #mov %rsi,$inp # put away arguments mov %rcx,$out mov %rdx,$key shl \$6,%edi # process grandRounds lea .LCamellia_SBOX(%rip),$Tbl lea ($key,%rdi),$keyend mov 0(%rsi),@S[0] # load plaintext mov 4(%rsi),@S[1] mov 8(%rsi),@S[2] bswap @S[0] mov 12(%rsi),@S[3] bswap @S[1] bswap @S[2] bswap @S[3] call _x86_64_Camellia_encrypt bswap @S[0] bswap @S[1] bswap @S[2] mov @S[0],0($out) bswap @S[3] mov @S[1],4($out) mov @S[2],8($out) mov @S[3],12($out) mov 0(%rsp),%r15 mov 8(%rsp),%r14 mov 16(%rsp),%r13 mov 24(%rsp),%rbp mov 32(%rsp),%rbx lea 40(%rsp),%rsp .Lenc_epilogue: ret .size Camellia_EncryptBlock_Rounds,.-Camellia_EncryptBlock_Rounds .type _x86_64_Camellia_encrypt,\@abi-omnipotent .align 16 _x86_64_Camellia_encrypt: xor 0($key),@S[1] xor 4($key),@S[0] # ^=key[0-3] xor 8($key),@S[3] xor 12($key),@S[2] .align 16 .Leloop: mov 16($key),$t1 # prefetch key[4-5] mov 20($key),$t0 ___ for ($i=0;$i<6;$i++) { Camellia_Feistel($i,16); } $code.=<<___; lea 16*4($key),$key cmp $keyend,$key mov 8($key),$t3 # prefetch key[2-3] mov 12($key),$t2 je .Ledone and @S[0],$t0 or @S[3],$t3 rol \$1,$t0 xor $t3,@S[2] # s2^=s3|key[3]; xor $t0,@S[1] # s1^=LeftRotate(s0&key[0],1); and @S[2],$t2 or @S[1],$t1 rol \$1,$t2 xor $t1,@S[0] # s0^=s1|key[1]; xor $t2,@S[3] # s3^=LeftRotate(s2&key[2],1); jmp .Leloop .align 16 .Ledone: xor @S[2],$t0 # SwapHalf xor @S[3],$t1 xor @S[0],$t2 xor @S[1],$t3 mov $t0,@S[0] mov $t1,@S[1] mov $t2,@S[2] mov $t3,@S[3] .byte 0xf3,0xc3 # rep ret .size _x86_64_Camellia_encrypt,.-_x86_64_Camellia_encrypt # V1.x API .globl Camellia_DecryptBlock .type Camellia_DecryptBlock,\@abi-omnipotent .align 16 Camellia_DecryptBlock: movl \$128,%eax subl $arg0d,%eax movl \$3,$arg0d adcl \$0,$arg0d # keyBitLength==128?3:4 jmp .Ldec_rounds .size Camellia_DecryptBlock,.-Camellia_DecryptBlock # V2 .globl Camellia_DecryptBlock_Rounds .type Camellia_DecryptBlock_Rounds,\@function,4 .align 16 .Ldec_rounds: Camellia_DecryptBlock_Rounds: push %rbx push %rbp push %r13 push %r14 push %r15 .Ldec_prologue: #mov %rsi,$inp # put away arguments mov %rcx,$out mov %rdx,$keyend shl \$6,%edi # process grandRounds lea .LCamellia_SBOX(%rip),$Tbl lea ($keyend,%rdi),$key mov 0(%rsi),@S[0] # load plaintext mov 4(%rsi),@S[1] mov 8(%rsi),@S[2] bswap @S[0] mov 12(%rsi),@S[3] bswap @S[1] bswap @S[2] bswap @S[3] call _x86_64_Camellia_decrypt bswap @S[0] bswap @S[1] bswap @S[2] mov @S[0],0($out) bswap @S[3] mov @S[1],4($out) mov @S[2],8($out) mov @S[3],12($out) mov 0(%rsp),%r15 mov 8(%rsp),%r14 mov 16(%rsp),%r13 mov 24(%rsp),%rbp mov 32(%rsp),%rbx lea 40(%rsp),%rsp .Ldec_epilogue: ret .size Camellia_DecryptBlock_Rounds,.-Camellia_DecryptBlock_Rounds .type _x86_64_Camellia_decrypt,\@abi-omnipotent .align 16 _x86_64_Camellia_decrypt: xor 0($key),@S[1] xor 4($key),@S[0] # ^=key[0-3] xor 8($key),@S[3] xor 12($key),@S[2] .align 16 .Ldloop: mov -8($key),$t1 # prefetch key[4-5] mov -4($key),$t0 ___ for ($i=0;$i<6;$i++) { Camellia_Feistel($i,-8); } $code.=<<___; lea -16*4($key),$key cmp $keyend,$key mov 0($key),$t3 # prefetch key[2-3] mov 4($key),$t2 je .Lddone and @S[0],$t0 or @S[3],$t3 rol \$1,$t0 xor $t3,@S[2] # s2^=s3|key[3]; xor $t0,@S[1] # s1^=LeftRotate(s0&key[0],1); and @S[2],$t2 or @S[1],$t1 rol \$1,$t2 xor $t1,@S[0] # s0^=s1|key[1]; xor $t2,@S[3] # s3^=LeftRotate(s2&key[2],1); jmp .Ldloop .align 16 .Lddone: xor @S[2],$t2 xor @S[3],$t3 xor @S[0],$t0 xor @S[1],$t1 mov $t2,@S[0] # SwapHalf mov $t3,@S[1] mov $t0,@S[2] mov $t1,@S[3] .byte 0xf3,0xc3 # rep ret .size _x86_64_Camellia_decrypt,.-_x86_64_Camellia_decrypt ___ sub _saveround { my ($rnd,$key,@T)=@_; my $bias=int(@T[0])?shift(@T):0; if ($#T==3) { $code.=<<___; mov @T[1],`$bias+$rnd*8+0`($key) mov @T[0],`$bias+$rnd*8+4`($key) mov @T[3],`$bias+$rnd*8+8`($key) mov @T[2],`$bias+$rnd*8+12`($key) ___ } else { $code.=" mov @T[0],`$bias+$rnd*8+0`($key)\n"; $code.=" mov @T[1],`$bias+$rnd*8+8`($key)\n" if ($#T>=1); } } sub _loadround { my ($rnd,$key,@T)=@_; my $bias=int(@T[0])?shift(@T):0; $code.=" mov `$bias+$rnd*8+0`($key),@T[0]\n"; $code.=" mov `$bias+$rnd*8+8`($key),@T[1]\n" if ($#T>=1); } # shld is very slow on Intel EM64T family. Even on AMD it limits # instruction decode rate [because it's VectorPath] and consequently # performance... sub __rotl128 { my ($i0,$i1,$rot)=@_; if ($rot) { $code.=<<___; mov $i0,%r11 shld \$$rot,$i1,$i0 shld \$$rot,%r11,$i1 ___ } } # ... Implementing 128-bit rotate without shld gives 80% better # performance EM64T, +15% on AMD64 and only ~7% degradation on # Core2. This is therefore preferred. sub _rotl128 { my ($i0,$i1,$rot)=@_; if ($rot) { $code.=<<___; mov $i0,%r11 shl \$$rot,$i0 mov $i1,%r9 shr \$`64-$rot`,%r9 shr \$`64-$rot`,%r11 or %r9,$i0 shl \$$rot,$i1 or %r11,$i1 ___ } } { my $step=0; $code.=<<___; .globl Camellia_Ekeygen .type Camellia_Ekeygen,\@function,3 .align 16 Camellia_Ekeygen: push %rbx push %rbp push %r13 push %r14 push %r15 .Lkey_prologue: mov %edi,${keyend}d # put away arguments, keyBitLength mov %rdx,$out # keyTable mov 0(%rsi),@S[0] # load 0-127 bits mov 4(%rsi),@S[1] mov 8(%rsi),@S[2] mov 12(%rsi),@S[3] bswap @S[0] bswap @S[1] bswap @S[2] bswap @S[3] ___ &_saveround (0,$out,@S); # KL<<<0 $code.=<<___; cmp \$128,$keyend # check keyBitLength je .L1st128 mov 16(%rsi),@S[0] # load 128-191 bits mov 20(%rsi),@S[1] cmp \$192,$keyend je .L1st192 mov 24(%rsi),@S[2] # load 192-255 bits mov 28(%rsi),@S[3] jmp .L1st256 .L1st192: mov @S[0],@S[2] mov @S[1],@S[3] not @S[2] not @S[3] .L1st256: bswap @S[0] bswap @S[1] bswap @S[2] bswap @S[3] ___ &_saveround (4,$out,@S); # temp storage for KR! $code.=<<___; xor 0($out),@S[1] # KR^KL xor 4($out),@S[0] xor 8($out),@S[3] xor 12($out),@S[2] .L1st128: lea .LCamellia_SIGMA(%rip),$key lea .LCamellia_SBOX(%rip),$Tbl mov 0($key),$t1 mov 4($key),$t0 ___ &Camellia_Feistel($step++); &Camellia_Feistel($step++); $code.=<<___; xor 0($out),@S[1] # ^KL xor 4($out),@S[0] xor 8($out),@S[3] xor 12($out),@S[2] ___ &Camellia_Feistel($step++); &Camellia_Feistel($step++); $code.=<<___; cmp \$128,$keyend jne .L2nd256 lea 128($out),$out # size optimization shl \$32,%r8 # @S[0]|| shl \$32,%r10 # @S[2]|| or %r9,%r8 # ||@S[1] or %r11,%r10 # ||@S[3] ___ &_loadround (0,$out,-128,"%rax","%rbx"); # KL &_saveround (2,$out,-128,"%r8","%r10"); # KA<<<0 &_rotl128 ("%rax","%rbx",15); &_saveround (4,$out,-128,"%rax","%rbx"); # KL<<<15 &_rotl128 ("%r8","%r10",15); &_saveround (6,$out,-128,"%r8","%r10"); # KA<<<15 &_rotl128 ("%r8","%r10",15); # 15+15=30 &_saveround (8,$out,-128,"%r8","%r10"); # KA<<<30 &_rotl128 ("%rax","%rbx",30); # 15+30=45 &_saveround (10,$out,-128,"%rax","%rbx"); # KL<<<45 &_rotl128 ("%r8","%r10",15); # 30+15=45 &_saveround (12,$out,-128,"%r8"); # KA<<<45 &_rotl128 ("%rax","%rbx",15); # 45+15=60 &_saveround (13,$out,-128,"%rbx"); # KL<<<60 &_rotl128 ("%r8","%r10",15); # 45+15=60 &_saveround (14,$out,-128,"%r8","%r10"); # KA<<<60 &_rotl128 ("%rax","%rbx",17); # 60+17=77 &_saveround (16,$out,-128,"%rax","%rbx"); # KL<<<77 &_rotl128 ("%rax","%rbx",17); # 77+17=94 &_saveround (18,$out,-128,"%rax","%rbx"); # KL<<<94 &_rotl128 ("%r8","%r10",34); # 60+34=94 &_saveround (20,$out,-128,"%r8","%r10"); # KA<<<94 &_rotl128 ("%rax","%rbx",17); # 94+17=111 &_saveround (22,$out,-128,"%rax","%rbx"); # KL<<<111 &_rotl128 ("%r8","%r10",17); # 94+17=111 &_saveround (24,$out,-128,"%r8","%r10"); # KA<<<111 $code.=<<___; mov \$3,%eax jmp .Ldone .align 16 .L2nd256: ___ &_saveround (6,$out,@S); # temp storage for KA! $code.=<<___; xor `4*8+0`($out),@S[1] # KA^KR xor `4*8+4`($out),@S[0] xor `5*8+0`($out),@S[3] xor `5*8+4`($out),@S[2] ___ &Camellia_Feistel($step++); &Camellia_Feistel($step++); &_loadround (0,$out,"%rax","%rbx"); # KL &_loadround (4,$out,"%rcx","%rdx"); # KR &_loadround (6,$out,"%r14","%r15"); # KA $code.=<<___; lea 128($out),$out # size optimization shl \$32,%r8 # @S[0]|| shl \$32,%r10 # @S[2]|| or %r9,%r8 # ||@S[1] or %r11,%r10 # ||@S[3] ___ &_saveround (2,$out,-128,"%r8","%r10"); # KB<<<0 &_rotl128 ("%rcx","%rdx",15); &_saveround (4,$out,-128,"%rcx","%rdx"); # KR<<<15 &_rotl128 ("%r14","%r15",15); &_saveround (6,$out,-128,"%r14","%r15"); # KA<<<15 &_rotl128 ("%rcx","%rdx",15); # 15+15=30 &_saveround (8,$out,-128,"%rcx","%rdx"); # KR<<<30 &_rotl128 ("%r8","%r10",30); &_saveround (10,$out,-128,"%r8","%r10"); # KB<<<30 &_rotl128 ("%rax","%rbx",45); &_saveround (12,$out,-128,"%rax","%rbx"); # KL<<<45 &_rotl128 ("%r14","%r15",30); # 15+30=45 &_saveround (14,$out,-128,"%r14","%r15"); # KA<<<45 &_rotl128 ("%rax","%rbx",15); # 45+15=60 &_saveround (16,$out,-128,"%rax","%rbx"); # KL<<<60 &_rotl128 ("%rcx","%rdx",30); # 30+30=60 &_saveround (18,$out,-128,"%rcx","%rdx"); # KR<<<60 &_rotl128 ("%r8","%r10",30); # 30+30=60 &_saveround (20,$out,-128,"%r8","%r10"); # KB<<<60 &_rotl128 ("%rax","%rbx",17); # 60+17=77 &_saveround (22,$out,-128,"%rax","%rbx"); # KL<<<77 &_rotl128 ("%r14","%r15",32); # 45+32=77 &_saveround (24,$out,-128,"%r14","%r15"); # KA<<<77 &_rotl128 ("%rcx","%rdx",34); # 60+34=94 &_saveround (26,$out,-128,"%rcx","%rdx"); # KR<<<94 &_rotl128 ("%r14","%r15",17); # 77+17=94 &_saveround (28,$out,-128,"%r14","%r15"); # KA<<<77 &_rotl128 ("%rax","%rbx",34); # 77+34=111 &_saveround (30,$out,-128,"%rax","%rbx"); # KL<<<111 &_rotl128 ("%r8","%r10",51); # 60+51=111 &_saveround (32,$out,-128,"%r8","%r10"); # KB<<<111 $code.=<<___; mov \$4,%eax .Ldone: mov 0(%rsp),%r15 mov 8(%rsp),%r14 mov 16(%rsp),%r13 mov 24(%rsp),%rbp mov 32(%rsp),%rbx lea 40(%rsp),%rsp .Lkey_epilogue: ret .size Camellia_Ekeygen,.-Camellia_Ekeygen ___ } @SBOX=( 112,130, 44,236,179, 39,192,229,228,133, 87, 53,234, 12,174, 65, 35,239,107,147, 69, 25,165, 33,237, 14, 79, 78, 29,101,146,189, 134,184,175,143,124,235, 31,206, 62, 48,220, 95, 94,197, 11, 26, 166,225, 57,202,213, 71, 93, 61,217, 1, 90,214, 81, 86,108, 77, 139, 13,154,102,251,204,176, 45,116, 18, 43, 32,240,177,132,153, 223, 76,203,194, 52,126,118, 5,109,183,169, 49,209, 23, 4,215, 20, 88, 58, 97,222, 27, 17, 28, 50, 15,156, 22, 83, 24,242, 34, 254, 68,207,178,195,181,122,145, 36, 8,232,168, 96,252,105, 80, 170,208,160,125,161,137, 98,151, 84, 91, 30,149,224,255,100,210, 16,196, 0, 72,163,247,117,219,138, 3,230,218, 9, 63,221,148, 135, 92,131, 2,205, 74,144, 51,115,103,246,243,157,127,191,226, 82,155,216, 38,200, 55,198, 59,129,150,111, 75, 19,190, 99, 46, 233,121,167,140,159,110,188,142, 41,245,249,182, 47,253,180, 89, 120,152, 6,106,231, 70,113,186,212, 37,171, 66,136,162,141,250, 114, 7,185, 85,248,238,172, 10, 54, 73, 42,104, 60, 56,241,164, 64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158); sub S1110 { my $i=shift; $i=@SBOX[$i]; $i=$i<<24|$i<<16|$i<<8; sprintf("0x%08x",$i); } sub S4404 { my $i=shift; $i=($i<<1|$i>>7)&0xff; $i=@SBOX[$i]; $i=$i<<24|$i<<16|$i; sprintf("0x%08x",$i); } sub S0222 { my $i=shift; $i=@SBOX[$i]; $i=($i<<1|$i>>7)&0xff; $i=$i<<16|$i<<8|$i; sprintf("0x%08x",$i); } sub S3033 { my $i=shift; $i=@SBOX[$i]; $i=($i>>1|$i<<7)&0xff; $i=$i<<24|$i<<8|$i; sprintf("0x%08x",$i); } $code.=<<___; .align 64 .LCamellia_SIGMA: .long 0x3bcc908b, 0xa09e667f, 0x4caa73b2, 0xb67ae858 .long 0xe94f82be, 0xc6ef372f, 0xf1d36f1c, 0x54ff53a5 .long 0xde682d1d, 0x10e527fa, 0xb3e6c1fd, 0xb05688c2 .long 0, 0, 0, 0 .LCamellia_SBOX: ___ # tables are interleaved, remember? sub data_word { $code.=".long\t".join(',',@_)."\n"; } for ($i=0;$i<256;$i++) { &data_word(&S1110($i),&S4404($i)); } for ($i=0;$i<256;$i++) { &data_word(&S0222($i),&S3033($i)); } # void Camellia_cbc_encrypt (const void char *inp, unsigned char *out, # size_t length, const CAMELLIA_KEY *key, # unsigned char *ivp,const int enc); { $_key="0(%rsp)"; $_end="8(%rsp)"; # inp+len&~15 $_res="16(%rsp)"; # len&15 $ivec="24(%rsp)"; $_ivp="40(%rsp)"; $_rsp="48(%rsp)"; $code.=<<___; .globl Camellia_cbc_encrypt .type Camellia_cbc_encrypt,\@function,6 .align 16 Camellia_cbc_encrypt: cmp \$0,%rdx je .Lcbc_abort push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 .Lcbc_prologue: mov %rsp,%rbp sub \$64,%rsp and \$-64,%rsp # place stack frame just "above mod 1024" the key schedule, # this ensures that cache associativity suffices lea -64-63(%rcx),%r10 sub %rsp,%r10 neg %r10 and \$0x3C0,%r10 sub %r10,%rsp #add \$8,%rsp # 8 is reserved for callee's ra mov %rdi,$inp # inp argument mov %rsi,$out # out argument mov %r8,%rbx # ivp argument mov %rcx,$key # key argument mov 272(%rcx),${keyend}d # grandRounds mov %r8,$_ivp mov %rbp,$_rsp .Lcbc_body: lea .LCamellia_SBOX(%rip),$Tbl mov \$32,%ecx .align 4 .Lcbc_prefetch_sbox: mov 0($Tbl),%rax mov 32($Tbl),%rsi mov 64($Tbl),%rdi mov 96($Tbl),%r11 lea 128($Tbl),$Tbl loop .Lcbc_prefetch_sbox sub \$4096,$Tbl shl \$6,$keyend mov %rdx,%rcx # len argument lea ($key,$keyend),$keyend cmp \$0,%r9d # enc argument je .LCBC_DECRYPT and \$-16,%rdx and \$15,%rcx # length residue lea ($inp,%rdx),%rdx mov $key,$_key mov %rdx,$_end mov %rcx,$_res cmp $inp,%rdx mov 0(%rbx),@S[0] # load IV mov 4(%rbx),@S[1] mov 8(%rbx),@S[2] mov 12(%rbx),@S[3] je .Lcbc_enc_tail jmp .Lcbc_eloop .align 16 .Lcbc_eloop: xor 0($inp),@S[0] xor 4($inp),@S[1] xor 8($inp),@S[2] bswap @S[0] xor 12($inp),@S[3] bswap @S[1] bswap @S[2] bswap @S[3] call _x86_64_Camellia_encrypt mov $_key,$key # "rewind" the key bswap @S[0] mov $_end,%rdx bswap @S[1] mov $_res,%rcx bswap @S[2] mov @S[0],0($out) bswap @S[3] mov @S[1],4($out) mov @S[2],8($out) lea 16($inp),$inp mov @S[3],12($out) cmp %rdx,$inp lea 16($out),$out jne .Lcbc_eloop cmp \$0,%rcx jne .Lcbc_enc_tail mov $_ivp,$out mov @S[0],0($out) # write out IV residue mov @S[1],4($out) mov @S[2],8($out) mov @S[3],12($out) jmp .Lcbc_done .align 16 .Lcbc_enc_tail: xor %rax,%rax mov %rax,0+$ivec mov %rax,8+$ivec mov %rax,$_res .Lcbc_enc_pushf: pushfq cld mov $inp,%rsi lea 8+$ivec,%rdi .long 0x9066A4F3 # rep movsb popfq .Lcbc_enc_popf: lea $ivec,$inp lea 16+$ivec,%rax mov %rax,$_end jmp .Lcbc_eloop # one more time .align 16 .LCBC_DECRYPT: xchg $key,$keyend add \$15,%rdx and \$15,%rcx # length residue and \$-16,%rdx mov $key,$_key lea ($inp,%rdx),%rdx mov %rdx,$_end mov %rcx,$_res mov (%rbx),%rax # load IV mov 8(%rbx),%rbx jmp .Lcbc_dloop .align 16 .Lcbc_dloop: mov 0($inp),@S[0] mov 4($inp),@S[1] mov 8($inp),@S[2] bswap @S[0] mov 12($inp),@S[3] bswap @S[1] mov %rax,0+$ivec # save IV to temporary storage bswap @S[2] mov %rbx,8+$ivec bswap @S[3] call _x86_64_Camellia_decrypt mov $_key,$key # "rewind" the key mov $_end,%rdx mov $_res,%rcx bswap @S[0] mov ($inp),%rax # load IV for next iteration bswap @S[1] mov 8($inp),%rbx bswap @S[2] xor 0+$ivec,@S[0] bswap @S[3] xor 4+$ivec,@S[1] xor 8+$ivec,@S[2] lea 16($inp),$inp xor 12+$ivec,@S[3] cmp %rdx,$inp je .Lcbc_ddone mov @S[0],0($out) mov @S[1],4($out) mov @S[2],8($out) mov @S[3],12($out) lea 16($out),$out jmp .Lcbc_dloop .align 16 .Lcbc_ddone: mov $_ivp,%rdx cmp \$0,%rcx jne .Lcbc_dec_tail mov @S[0],0($out) mov @S[1],4($out) mov @S[2],8($out) mov @S[3],12($out) mov %rax,(%rdx) # write out IV residue mov %rbx,8(%rdx) jmp .Lcbc_done .align 16 .Lcbc_dec_tail: mov @S[0],0+$ivec mov @S[1],4+$ivec mov @S[2],8+$ivec mov @S[3],12+$ivec .Lcbc_dec_pushf: pushfq cld lea 8+$ivec,%rsi lea ($out),%rdi .long 0x9066A4F3 # rep movsb popfq .Lcbc_dec_popf: mov %rax,(%rdx) # write out IV residue mov %rbx,8(%rdx) jmp .Lcbc_done .align 16 .Lcbc_done: mov $_rsp,%rcx mov 0(%rcx),%r15 mov 8(%rcx),%r14 mov 16(%rcx),%r13 mov 24(%rcx),%r12 mov 32(%rcx),%rbp mov 40(%rcx),%rbx lea 48(%rcx),%rsp .Lcbc_abort: ret .size Camellia_cbc_encrypt,.-Camellia_cbc_encrypt .asciz "Camellia for x86_64 by <appro\@openssl.org>" ___ } # EXCEPTION_DISPOSITION handler (EXCEPTION_RECORD *rec,ULONG64 frame, # CONTEXT *context,DISPATCHER_CONTEXT *disp) if ($win64) { $rec="%rcx"; $frame="%rdx"; $context="%r8"; $disp="%r9"; $code.=<<___; .extern __imp_RtlVirtualUnwind .type common_se_handler,\@abi-omnipotent .align 16 common_se_handler: push %rsi push %rdi push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 pushfq lea -64(%rsp),%rsp mov 120($context),%rax # pull context->Rax mov 248($context),%rbx # pull context->Rip mov 8($disp),%rsi # disp->ImageBase mov 56($disp),%r11 # disp->HandlerData mov 0(%r11),%r10d # HandlerData[0] lea (%rsi,%r10),%r10 # prologue label cmp %r10,%rbx # context->Rip<prologue label jb .Lin_prologue mov 152($context),%rax # pull context->Rsp mov 4(%r11),%r10d # HandlerData[1] lea (%rsi,%r10),%r10 # epilogue label cmp %r10,%rbx # context->Rip>=epilogue label jae .Lin_prologue lea 40(%rax),%rax mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r13 mov -32(%rax),%r14 mov -40(%rax),%r15 mov %rbx,144($context) # restore context->Rbx mov %rbp,160($context) # restore context->Rbp mov %r13,224($context) # restore context->R13 mov %r14,232($context) # restore context->R14 mov %r15,240($context) # restore context->R15 .Lin_prologue: mov 8(%rax),%rdi mov 16(%rax),%rsi mov %rax,152($context) # restore context->Rsp mov %rsi,168($context) # restore context->Rsi mov %rdi,176($context) # restore context->Rdi jmp .Lcommon_seh_exit .size common_se_handler,.-common_se_handler .type cbc_se_handler,\@abi-omnipotent .align 16 cbc_se_handler: push %rsi push %rdi push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 pushfq lea -64(%rsp),%rsp mov 120($context),%rax # pull context->Rax mov 248($context),%rbx # pull context->Rip lea .Lcbc_prologue(%rip),%r10 cmp %r10,%rbx # context->Rip<.Lcbc_prologue jb .Lin_cbc_prologue lea .Lcbc_body(%rip),%r10 cmp %r10,%rbx # context->Rip<.Lcbc_body jb .Lin_cbc_frame_setup mov 152($context),%rax # pull context->Rsp lea .Lcbc_abort(%rip),%r10 cmp %r10,%rbx # context->Rip>=.Lcbc_abort jae .Lin_cbc_prologue # handle pushf/popf in Camellia_cbc_encrypt lea .Lcbc_enc_pushf(%rip),%r10 cmp %r10,%rbx # context->Rip<=.Lcbc_enc_pushf jbe .Lin_cbc_no_flag lea 8(%rax),%rax lea .Lcbc_enc_popf(%rip),%r10 cmp %r10,%rbx # context->Rip<.Lcbc_enc_popf jb .Lin_cbc_no_flag lea -8(%rax),%rax lea .Lcbc_dec_pushf(%rip),%r10 cmp %r10,%rbx # context->Rip<=.Lcbc_dec_pushf jbe .Lin_cbc_no_flag lea 8(%rax),%rax lea .Lcbc_dec_popf(%rip),%r10 cmp %r10,%rbx # context->Rip<.Lcbc_dec_popf jb .Lin_cbc_no_flag lea -8(%rax),%rax .Lin_cbc_no_flag: mov 48(%rax),%rax # $_rsp lea 48(%rax),%rax .Lin_cbc_frame_setup: mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r12 mov -32(%rax),%r13 mov -40(%rax),%r14 mov -48(%rax),%r15 mov %rbx,144($context) # restore context->Rbx mov %rbp,160($context) # restore context->Rbp mov %r12,216($context) # restore context->R12 mov %r13,224($context) # restore context->R13 mov %r14,232($context) # restore context->R14 mov %r15,240($context) # restore context->R15 .Lin_cbc_prologue: mov 8(%rax),%rdi mov 16(%rax),%rsi mov %rax,152($context) # restore context->Rsp mov %rsi,168($context) # restore context->Rsi mov %rdi,176($context) # restore context->Rdi .align 4 .Lcommon_seh_exit: mov 40($disp),%rdi # disp->ContextRecord mov $context,%rsi # context mov \$`1232/8`,%ecx # sizeof(CONTEXT) .long 0xa548f3fc # cld; rep movsq mov $disp,%rsi xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER mov 8(%rsi),%rdx # arg2, disp->ImageBase mov 0(%rsi),%r8 # arg3, disp->ControlPc mov 16(%rsi),%r9 # arg4, disp->FunctionEntry mov 40(%rsi),%r10 # disp->ContextRecord lea 56(%rsi),%r11 # &disp->HandlerData lea 24(%rsi),%r12 # &disp->EstablisherFrame mov %r10,32(%rsp) # arg5 mov %r11,40(%rsp) # arg6 mov %r12,48(%rsp) # arg7 mov %rcx,56(%rsp) # arg8, (NULL) call *__imp_RtlVirtualUnwind(%rip) mov \$1,%eax # ExceptionContinueSearch lea 64(%rsp),%rsp popfq pop %r15 pop %r14 pop %r13 pop %r12 pop %rbp pop %rbx pop %rdi pop %rsi ret .size cbc_se_handler,.-cbc_se_handler .section .pdata .align 4 .rva .LSEH_begin_Camellia_EncryptBlock_Rounds .rva .LSEH_end_Camellia_EncryptBlock_Rounds .rva .LSEH_info_Camellia_EncryptBlock_Rounds .rva .LSEH_begin_Camellia_DecryptBlock_Rounds .rva .LSEH_end_Camellia_DecryptBlock_Rounds .rva .LSEH_info_Camellia_DecryptBlock_Rounds .rva .LSEH_begin_Camellia_Ekeygen .rva .LSEH_end_Camellia_Ekeygen .rva .LSEH_info_Camellia_Ekeygen .rva .LSEH_begin_Camellia_cbc_encrypt .rva .LSEH_end_Camellia_cbc_encrypt .rva .LSEH_info_Camellia_cbc_encrypt .section .xdata .align 8 .LSEH_info_Camellia_EncryptBlock_Rounds: .byte 9,0,0,0 .rva common_se_handler .rva .Lenc_prologue,.Lenc_epilogue # HandlerData[] .LSEH_info_Camellia_DecryptBlock_Rounds: .byte 9,0,0,0 .rva common_se_handler .rva .Ldec_prologue,.Ldec_epilogue # HandlerData[] .LSEH_info_Camellia_Ekeygen: .byte 9,0,0,0 .rva common_se_handler .rva .Lkey_prologue,.Lkey_epilogue # HandlerData[] .LSEH_info_Camellia_cbc_encrypt: .byte 9,0,0,0 .rva cbc_se_handler ___ } $code =~ s/\`([^\`]*)\`/eval $1/gem; print $code; close STDOUT; ```
NFC stands for Near-field communication. Feature phones Smartphones A-H I-P Q-Z Tablet computers Smartwatches Apple Watch All Apple Watch versions, including from the original launched in 2015, are NFC-capable and support Apple Pay. List of NFC-enabled Wear OS devices Some Wear OS smartwatches have NFC capabilities for contactless payments via Google Pay or Samsung Pay. Video game controllers On 27 January 2012, Nintendo President Satoru Iwata announced in a briefing that the controller of the Wii U home console will have an installable NFC function. By installing this functionality, it will become possible to create cards and figurines that can electronically read and write data via noncontact NFC and to expand the new play format in the video game world. Adoption of this functionality will enable various other possibilities such as using it as a means of making micropayments. see more List of 3D-enabled mobile phones Projector phone References Near-field communication NFC-enabled mobile devices
```objective-c 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. ==============================================================================*/ #ifndef TENSORFLOW_CORE_PUBLIC_VERSION_H_ #define TENSORFLOW_CORE_PUBLIC_VERSION_H_ // TensorFlow uses semantic versioning, see path_to_url #define TF_MAJOR_VERSION 1 #define TF_MINOR_VERSION 4 #define TF_PATCH_VERSION 0 // TF_VERSION_SUFFIX is non-empty for pre-releases (e.g. "-alpha", "-alpha.1", // "-beta", "-rc", "-rc.1") #define TF_VERSION_SUFFIX "" #define TF_STR_HELPER(x) #x #define TF_STR(x) TF_STR_HELPER(x) // e.g. "0.5.0" or "0.6.0-alpha". #define TF_VERSION_STRING \ (TF_STR(TF_MAJOR_VERSION) "." TF_STR(TF_MINOR_VERSION) "." TF_STR( \ TF_PATCH_VERSION) TF_VERSION_SUFFIX) // TODO(josh11b): Public API functions for exporting the above. // GraphDef compatibility versions (the versions field in graph.proto). // // Each graph has producer and min_consumer versions, and each // consumer has its own version and a min_producer. In addition, graphs can // mark specific consumer versions as bad (to prevent bugs from executing). // A consumer will execute a graph if the consumer's version is at least the // graph's min_consumer, the graph's producer version is at least the consumer's // min_producer, and the consumer version isn't specifically disallowed by the // graph. // // By default, newly created graphs have producer version TF_GRAPH_DEF_VERSION // min_consumer TF_GRAPH_DEF_MIN_CONSUMER, and no other bad consumer versions. // // Version history: // // 0. Graphs created before GraphDef versioning // 1. First real version (2dec2015) // 2. adjust_contrast only takes float, doesn't perform clamping (11dec2015) // 3. Remove TileGrad, since it was equivalent to reduce_sum (30dec2015) // 4. When support for this version is removed, we can safely make AttrValue // parsing more strict with respect to empty list values (see // 111635679, 7jan2016). // 5. Graphs are wholly-validated during Session::Create() (7jan2016). // 6. TensorFlow is scalar strict within Google (27jan2016). // 7. Remove TopK in favor of TopKV2 (5feb2016). // 8. Replace RandomCrop from C++ with pure Python (5feb2016). // 9. Deprecate batch_norm_with_global_normalization (16feb2016). // 10. Deprecate conv3d_backprop_{filter,input} (10jun2016). // 11. Deprecate {batch}_self_adjoint_eig (3aug2016). // 12. Graph consumers understand the node_def field of FunctionDef (22aug2016). // 13. Deprecate multiple batch linear algebra ops (9sep2016). // 14. Deprecate batch_matrix_* ops. (10sep2016). // 15. Deprecate batch_fft_* ops. (14sep2016). // 16. Deprecate tensor_array (v1) ops in favor of v2 (10nov2016). // 17. Deprecate inv (11nov2016). // 17. Expose reverse_v2 (10nov2016) // 18. Add VariableV2 (30nov2016) // 19. Deprecated ops created by models moved out of core SkipGram, NegTrain. // (08dec2016) // 20. Catch all version 1.0 changes to Python API generation. SplitV is now // used for tf.split, ReverseV2 is now used by tf.reverse, ConcatV2 is // now used by tf.concat. Graphs use flooring // division and mod semantics. TensorArrayV3. (12dec2016) // Also considered the version for when it is required for reduction // ops' indices to be scalar or vector, and not higher rank. // Some earlier graph def versions allowed this. // 21. Dropped FunctionDef.Node support, switched to node_def introduced // in version 12. (11jan2017) // 22. Placeholder now can specify and enforce scalar and partial // shapes, particularly when restoring a graph from GraphDef // produced at version 22 or later. (04/10/2016) // 23. Remove NonMaxSuppression in favor of NonMaxSuppressionV2. // 24. Deprecate lookup ops (v1) ops in favor of v2 (30may2017) // 25. Deprecate stack (v1) ops in favor of v2 (2017/6/15). #define TF_GRAPH_DEF_VERSION_MIN_PRODUCER 0 #define TF_GRAPH_DEF_VERSION_MIN_CONSUMER 0 #define TF_GRAPH_DEF_VERSION 24 // Checkpoint compatibility versions (the versions field in SavedSliceMeta). // // The checkpoint versions have the same semantics as GraphDef versions, but the // numbering scheme is separate. We have no plans to ever deprecate checkpoint // versions, but it's good to have this in place in case we ever need to. // // Version history: // // 0. Checkpoints saved before checkpoint versioning. // 1. First real version (10feb2015). #define TF_CHECKPOINT_VERSION_MIN_PRODUCER 0 #define TF_CHECKPOINT_VERSION_MIN_CONSUMER 0 #define TF_CHECKPOINT_VERSION 1 /// Version query functions (defined in generated version_info.cc) // Host compiler version (declared elsewhere to be __VERSION__) extern const char* tf_compiler_version(); // The git commit designator when tensorflow was built // If no git repository, this will be "internal". extern const char* tf_git_version(); #endif // TENSORFLOW_CORE_PUBLIC_VERSION_H_ ```
Kurigram Stadium is located by the Kurigram-Chilmari Rd, Kurigram, Bangladesh. See also Stadiums in Bangladesh List of football stadiums in Bangladesh List of cricket grounds in Bangladesh References Football venues in Bangladesh Cricket grounds in Bangladesh
```swift import Foundation // MARK: - SplitItemMetrics // enum SplitItemMetrics { /// Sidebar Insets private static let sidebarTopInsetLegacy = CGFloat(52) private static let sidebarTopInsetBigSur = CGFloat(62) /// Editor: Content Insets private static let editorContentTopInsetLegacy = CGFloat(-10) // Standard (38pt) minus editorContentBottomInset private static let editorContentTopInsetBigSur = CGFloat.zero // Standard (48pt) minus editorContentBottomInset /// Sidebar Insets: Tags + Notes Lists /// static var sidebarTopInset: CGFloat { sidebarTopInsetBigSur } /// List Insets: Content / Top /// static var listContentTopInset: CGFloat { sidebarTopInset } /// List Insets: Content / Bottom /// static var listContentBottomInset: CGFloat { let bottomInsetBigSur: CGFloat = 10 return bottomInsetBigSur } /// List Insets: Scroller /// static var listScrollerTopInset: CGFloat { sidebarTopInset } /// Editor Insets: Content Top /// static var editorContentTopInset: CGFloat { editorContentTopInsetBigSur } /// Editor Insets: Content Bottom /// static var editorContentBottomInset = CGFloat(48) /// Editor Insets: Scroller /// static var editorScrollerTopInset: CGFloat { sidebarTopInset } /// Breadcrumbs Height! /// static let breadcrumbsViewHeight = CGFloat(28) /// Header Alpha Threshold: Alpha Visibility threshold after which the Blur should be enabled /// static let headerAlphaActiveThreshold = CGFloat(0.5) /// Header: Maximum Offset after which alpha should be set to (1.0) /// static let headerMaximumAlphaGradientOffset = CGFloat(14) /// Spacing required between the Window's Semaphore (Close / Minimize / Maximize) and the first View component /// static let toolbarSemaphorePaddingX = CGFloat(16) } ```
```smalltalk // ========================================================================== // Squidex Headless CMS // ========================================================================== // ========================================================================== using NodaTime; using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.TestHelpers; using Squidex.Infrastructure; using Squidex.Infrastructure.Validation; namespace Squidex.Domain.Apps.Entities.Schemas.DomainObject.Guards.FieldProperties; public class DateTimeFieldPropertiesTests : IClassFixture<TranslationsFixture> { [Fact] public void Should_not_add_error_if_sut_is_valid() { var sut = new DateTimeFieldProperties { MinValue = FutureDays(10), MaxValue = FutureDays(20), DefaultValue = FutureDays(15) }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); Assert.Empty(errors); } [Fact] public void Should_add_error_if_min_value_greater_than_max_value() { var sut = new DateTimeFieldProperties { MinValue = FutureDays(10), MaxValue = FutureDays(5) }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Max value must be greater than min value.", "MinValue", "MaxValue") }); } [Fact] public void Should_add_error_if_editor_is_not_valid() { var sut = new DateTimeFieldProperties { Editor = (DateTimeFieldEditor)123 }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Editor is not a valid value.", "Editor") }); } [Fact] public void Should_add_error_if_calculated_default_value_is_not_valid() { var sut = new DateTimeFieldProperties { CalculatedDefaultValue = (DateTimeCalculatedDefaultValue)123 }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Calculated default value is not a valid value.", "CalculatedDefaultValue") }); } [Fact] public void your_sha256_hashfined() { var sut = new DateTimeFieldProperties { CalculatedDefaultValue = DateTimeCalculatedDefaultValue.Now, DefaultValue = FutureDays(10) }; var errors = FieldPropertiesValidator.Validate(sut).ToList(); errors.Should().BeEquivalentTo( new List<ValidationError> { new ValidationError("Calculated default value and default value cannot be used together.", "CalculatedDefaultValue", "DefaultValue") }); } private static Instant FutureDays(int days) { return SystemClock.Instance.GetCurrentInstant().WithoutMs().Plus(Duration.FromDays(days)); } } ```
```html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_socket::send_low_watermark</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../basic_socket.html" title="basic_socket"> <link rel="prev" href="send_buffer_size.html" title="basic_socket::send_buffer_size"> <link rel="next" href="set_option.html" title="basic_socket::set_option"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> <td align="center"><a href="../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="path_to_url">People</a></td> <td align="center"><a href="path_to_url">FAQ</a></td> <td align="center"><a href="../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="send_buffer_size.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_socket.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="set_option.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="boost_asio.reference.basic_socket.send_low_watermark"></a><a class="link" href="send_low_watermark.html" title="basic_socket::send_low_watermark">basic_socket::send_low_watermark</a> </h4></div></div></div> <p> <span class="emphasis"><em>Inherited from socket_base.</em></span> </p> <p> <a class="indexterm" name="boost_asio.indexterm.basic_socket.send_low_watermark"></a> Socket option for the send low watermark. </p> <pre class="programlisting">typedef implementation_defined send_low_watermark; </pre> <p> Implements the SOL_SOCKET/SO_SNDLOWAT socket option. </p> <h6> <a name="boost_asio.reference.basic_socket.send_low_watermark.h0"></a> <span class="phrase"><a name="boost_asio.reference.basic_socket.send_low_watermark.examples"></a></span><a class="link" href="send_low_watermark.html#boost_asio.reference.basic_socket.send_low_watermark.examples">Examples</a> </h6> <p> Setting the option: </p> <pre class="programlisting">boost::asio::ip::tcp::socket socket(io_context); ... boost::asio::socket_base::send_low_watermark option(1024); socket.set_option(option); </pre> <p> Getting the current option value: </p> <pre class="programlisting">boost::asio::ip::tcp::socket socket(io_context); ... boost::asio::socket_base::send_low_watermark option; socket.get_option(option); int size = option.value(); </pre> <h6> <a name="boost_asio.reference.basic_socket.send_low_watermark.h1"></a> <span class="phrase"><a name="boost_asio.reference.basic_socket.send_low_watermark.requirements"></a></span><a class="link" href="send_low_watermark.html#boost_asio.reference.basic_socket.send_low_watermark.requirements">Requirements</a> </h6> <p> <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/basic_socket.hpp</code> </p> <p> <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code> </p> </div> <table xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> file LICENSE_1_0.txt or copy at <a href="path_to_url" target="_top">path_to_url </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="send_buffer_size.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_socket.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="set_option.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html> ```
The northern line is a railway line in Sri Lanka. Branching off the Main Line at Polgahawela Junction the line heads north through North Western, North Central and Northern provinces before terminating at the northern port of Kankesanthurai. The line is long and has 55 stations between Polgahawela Junction and Vavuniya. It is the longest railway line in Sri Lanka. The line opened in 1894. Major cities served by the line include Kurunegala, Anuradhapura, Vavuniya and Jaffna. The popular Yal Devi service operates on the line. The line was severely affected by the civil war and no services operated north of Vavuniya after 1990. Reconstruction of this section of the line commenced following the end of the civil war in 2009 and was fully completed in early 2015. History Construction The Jaffna Railway Commission report published in 1891 recommended the construction of a new railway line (now known as the northern line) from Polgahawela to Kurunegala and a survey of a line to Jaffna. The line would join the Main Line at Polgahawela Junction, allowing trains to run to the capital Colombo. Approval was given in 1892 and the new line to Kurunegala opened on 14 February 1894. Approval was given in December 1897 for the construction of the Northern Railway and an announcement was made in the Legislative Council in October 1899 that authorisation had been given for the construction of a railway line connecting the north with Colombo. Tenders for the construction of railway line from Kurunegala to Kankesanthurai were called in January 1900 and construction of the new line started at Kurunegala in April 1900. Construction of the Kankesanthurai-Chavakacheri section, including Jaffna, began in July 1900. This section was officially opened by Governor Sir J. W. Ridgeway on 11 March 1902. The Chavakacheri-Pallai section was opened on 5 September 1902. The northern railway line up to Anuradhapura was opened on 1 November 1904 and the construction of the line up to Medawachchiya was completed on 11 March 1905. The construction of the line was completed in the next few months and on 1 August 1905, the first train from Colombo arrived at Jaffna Railway Station. The journey took 13 hours and 20 minutes. The single track line between Kankesanthurai and Vavuniya had 16 stations and 12 sub-stations. Operational height An express train called Yarl Devi was introduced on the northern line on 23 April 1956, cutting the journey time between Jaffna and Colombo to 7 hours. The service flourished and Jaffna became the second largest station in the country. The Yarl Devi service was the largest revenue earner for Sri Lanka Railways. Eight passenger trains and six freight trains operated daily between Jaffna and Colombo. By the early 1980s six thousand people travelled daily on the northern line. War and partial closure The line's fortunes waned when the civil war started in 1983 - the government increased the number of soldiers stationed in the north, many of whom used the line to return to their homes in the south. Thus the Yarl Devi service became a target for Tamil militants as it passed through areas they controlled. It was blown up by Tamil Eelam Liberation Organization cadres near Murikandy, Mullaitivu District on the night of 19 January 1985, killing 34 people including 22 soldiers and destroying the tracks. The service was attacked again on 25 March 1986 between Puliyankulam and Vavuniya. The railway tracks were relaid by the Indian Peace Keeping Force and in August 1987 the Jaffna-Colombo rail services resumed. However, the deteriorating security meant that only a few people used the service. After the IPKF withdrew from Sri Lanka in 1990 the Liberation Tigers of Tamil Eelam took over most of the territory the IPKF had controlled, including Jaffna. In the middle of 1990 the truce between the LTTE and Sri Lankan government broke down and full-scale war erupted. Intense fighting took place in and around Jaffna as the Sri Lankan military tried to regain control of the area. Hundreds of civilians fleeing the fighting took refuge in Jaffna Railway Station. The station was bombed by the Sri Lanka Air Force (SLAF) on 9 August 1990, damaging 6 train carriages and killing eight people nearby. The station was bombed to a shell by the SLAF. On 13 June 1990 the Yarl Devi service rolled into Jaffna but it could not return to Colombo as the railway track had been destroyed (it would be the last rail service into Jaffna). The station was bombed again on 16 August 1990. In the next few years the entire track between Kankesanthurai and Vavuniya and abandoned railway coaches were removed by the Sri Lankan military and Tamil rebels for use as bunkers. Reconstruction The Sri Lankan government regained control of most of the Jaffna Peninsula, including Jaffna, in 1995 but no effort was made to rebuild the northern line or the stations along it. Following the end of the civil war in May 2009 the government initiated various projects to rebuild the northern line from Vavuniya to Kankesanthurai. The line between Vavuniya and Omanthai was rebuilt by the Sri Lankan military. Thandikulam railway station was re-opened on 6 June 2009 and Omanthai railway station was re-opened on 27 May 2011. The contract to reconstruct the line between Omanthai and Pallai was awarded to Ircon International, the Indian state-owned engineering and construction company. The project was to cost US$ 185 million and would be financed by a soft loan from the Indian government. In June 2011 an agreement was signed between Sri Lanka Railways and the Bank of Ceylon for the reconstruction of Jaffna Railway Station. The project was to cost LKR 89 million. In July 2011 it was announced that Ircon International had also been awarded the contract to reconstruct the line between Pallai and Kankesanthurai. The project was to cost US$ 150 million and would be financed by a loan from the Export-Import Bank of India. The reconstruction of the entire northern line had been expected to be completed by the end of 2013. The line between Omanthai and Kilinochchi was re-opened on 14 September 2013. The line between Kilinochchi and Pallai was re-opened on 4 March 2014. The line between Pallai and Jaffna was re-opened on 13 October 2014. The final stretch of the line, between Jaffna and Kankesanthurai, was re-opened on 2 January 2015. Route description The northern line consists of a main line running from Polgahawela to Kankesanturai and a short branch line to Mihintale. The route serves as a backbone for the country's rail services with other lines branching out from it. The Batticaloa line and the Mannar Line branch off from the northern line at Mahawa (Maho) and Medawachchiya, respectively, to serve Polonnaruwa, Trincomalee, Batticaloa, Mannar, and Talaimannar. The route mainly runs through open country, across the North Central plains. At Elephant Pass, it crosses the lagoon to enter the Jaffna peninsula. Services The northern line is mainly served by intercity trains connecting major cities. More than a dozen trains run on the line in each direction each day. Major named services that use the line include Yal Devi and Udaya Devi. Operators and service providers Sri Lanka Railways operates passenger services on the northern line, the most notable service on the line being the Yal Devi. ExpoRail operates a premium service on certain Sri Lanka Railways trains on the northern line, in partnership with Sri Lanka Railways. Infrastructure The northern line is entirely single track, except at stations. Track gauge is broad gauge. As train frequency increases, it is becoming increasingly challenging to operate trains running both direction on the single-line track. The stretch between Polgahawela and Maho is 70 km long, but only has five stations with the facility to let trains pass each other. To relieve this, SLR is planning to add a second line to dual track this portion of the line. As of June 2012, the feasibility study on this project had yet to begin. The northern line is not electrified, regular services run on diesel power. Current operating speed between Polgahawela and Omanthai is 80 km/h. The section from Omanthai to Kankesanturai is being rebuilt with a design speed of 120 km/h, significantly increasing operating speeds. Signalling South of Anuradhapura, the line currently operates on a lock-and-block signaling system. In 2011, the railways began a project to add electronic signalling to the rail lines in the north. The northern line between Anuradhapura and Kankesanturai would be given electronic signalling with centralized traffic control, interlocking colour light system with electrically operated points, and track detection system. Level crossings would also be connected to the signalling system, thus ensuring safety at crossings. References External links 1894 establishments in Ceylon 5 ft 6 in gauge railways in Sri Lanka Railway lines in Sri Lanka Railway lines opened in 1894 Rail transport in Jaffna District Rail transport in Kilinochchi District Rail transport in Mullaitivu District Rail transport in Vavuniya District Transport in North Central Province, Sri Lanka Transport in North Western Province, Sri Lanka
```objective-c // // Generated by class-dump 3.5 (64 bit). // // #import <WebDriverAgentLib/CDStructures.h> #import <WebDriverAgentLib/XCUIHitPointResult.h> #import <XCTest/XCUIElementAttributes.h> @class NSArray, NSDictionary, NSString, XCAccessibilityElement, XCUIApplication; @interface XCElementSnapshot : NSObject <XCUIElementAttributes, NSSecureCoding> { NSString *_identifier; id _value; NSString *_placeholderValue; BOOL _enabled; BOOL _selected; BOOL _isMainWindow; BOOL _hasKeyboardFocus; BOOL _hasFocus; XCUIApplication *_application; unsigned long long _generation; NSString *_title; NSString *_label; unsigned long long _elementType; long long _horizontalSizeClass; long long _verticalSizeClass; XCAccessibilityElement *_accessibilityElement; XCAccessibilityElement *_parentAccessibilityElement; XCElementSnapshot *_parent; NSArray *_children; unsigned long long _traits; NSArray *_userTestingAttributes; NSDictionary *_additionalAttributes; struct CGRect _frame; } @property BOOL hasFocus; // @synthesize hasFocus=_hasFocus; @property BOOL hasKeyboardFocus; // @synthesize hasKeyboardFocus=_hasKeyboardFocus; @property(copy) NSDictionary *additionalAttributes; // @synthesize additionalAttributes=_additionalAttributes; @property(copy) NSArray *userTestingAttributes; // @synthesize userTestingAttributes=_userTestingAttributes; @property unsigned long long traits; // @synthesize traits=_traits; @property BOOL isMainWindow; // @synthesize isMainWindow=_isMainWindow; @property(copy) NSArray *children; // @synthesize children=_children; @property XCElementSnapshot *parent; // @synthesize parent=_parent; @property(retain) XCAccessibilityElement *parentAccessibilityElement; // @synthesize parentAccessibilityElement=_parentAccessibilityElement; @property(retain) XCAccessibilityElement *accessibilityElement; // @synthesize accessibilityElement=_accessibilityElement; @property(readonly) NSArray *suggestedHitpoints; @property(readonly) struct CGRect visibleFrame; @property(readonly) XCElementSnapshot *scrollView; @property(readonly, copy) NSString *truncatedValueString; @property(readonly) long long depth; @property(readonly, copy) XCElementSnapshot *pathFromRoot; @property(readonly) BOOL isTopLevelTouchBarElement; @property(readonly) BOOL isTouchBarElement; @property(readonly, copy) NSString *sparseTreeDescription; @property(readonly, copy) NSString *compactDescription; @property(readonly, copy) NSString *pathDescription; @property(readonly) NSString *recursiveDescriptionIncludingAccessibilityElement; @property(readonly) NSString *recursiveDescription; @property(readonly, copy) NSArray *identifiers; @property(nonatomic) unsigned long long generation; // @synthesize generation=_generation; @property(nonatomic) XCUIApplication *application; // @synthesize application=_application; - (id)_uniquelyIdentifyingObjectiveCCode; - (id)_uniquelyIdentifyingSwiftCode; - (BOOL)_isAncestorOfElement:(id)arg1; - (BOOL)_isDescendantOfElement:(id)arg1; - (BOOL)_frameFuzzyMatchesElement:(id)arg1; - (BOOL)_fuzzyMatchesElement:(id)arg1; - (BOOL)_matchesElement:(id)arg1; - (BOOL)matchesTreeWithRoot:(id)arg1; - (void)mergeTreeWithSnapshot:(id)arg1; - (id)_childMatchingElement:(id)arg1; - (NSArray<XCElementSnapshot *> *)_allDescendants; - (BOOL)hasDescendantMatchingFilter:(CDUnknownBlockType)arg1; - (NSArray<XCElementSnapshot *> *)descendantsByFilteringWithBlock:(BOOL(^)(XCElementSnapshot *snapshot))block; - (id)elementSnapshotMatchingAccessibilityElement:(id)arg1; - (void)enumerateDescendantsUsingBlock:(void(^)(XCElementSnapshot *snapshot))block; - (id)recursiveDescriptionWithIndent:(id)arg1 includeAccessibilityElement:(BOOL)arg2; - (id)init; - (struct CGPoint)hostingAndOrientationTransformedPoint:(struct CGPoint)arg1; - (struct CGPoint)_transformPoint:(struct CGPoint)arg1 windowContextID:(id)arg2 windowDisplayID:(id)arg3; - (id)hitTest:(struct CGPoint)arg1; /*! DO NOT USE DIRECTLY! Please use fb_rootElement instead */ - (XCElementSnapshot *)_rootElement; /*! DO NOT USE DIRECTLY! Please use fb_rootElement instead */ - (XCElementSnapshot *)rootElement; /*! DO NOT USE DIRECTLY! Please use fb_hitPoint: instead */ @property(readonly) struct CGPoint hitPoint; - (XCUIHitPointResult *)hitPoint:(NSError **)error; @end ```
Julia Savarese (born 1926) is an American writer. She was born in New York City. After graduating summa cum laude from Hunter College in 1950, she worked as an editor for various publications. Her novels include The Weak and the Strong (1952), which tells the story of an Italian-American family living in New York during the Great Depression, and Final Proof (1971), a novel about the death of a publishing empire. She published several plays and received a Ford Foundation grant for playwriting. She also wrote for television, and in 1968 received the Hallmark Television Award. The Weak and the Strong was one of the earliest novels about growing up as the daughter of Italian immigrants; it defied the stereotypes of "happy-go-lucky" Italian family life. When it was first published, critics called it "bleak," "unrelenting," and "humorless." In The Dream Book: An Anthology of Writings by Italian American Women (1985), Helen Barolini suggests that this was largely due to critics' expectations of Italian-American writers, and of women in particular; for a male writer such as Pietro di Donato, or an established woman writer such as Flannery O'Connor, she writes, "that kind of unsentimentality would be verismo of the highest order." In 1974, Savarese was one of the few women included in Rose Basile Green's pioneering study of Italian-American writers. References External links 1926 births American writers of Italian descent American women novelists Hunter College alumni Possibly living people
Shels may refer to: *shels, rock band Shelbourne F.C., Irish football team
```java package com.brianway.java.nio.tutorial; import com.brianway.learning.java.nio.tutorial.BufferDemo; import org.junit.Assert; import org.junit.Test; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * @auther brian * @since 2019/6/18 23:24 */ public class ScatterTest { private String path = BufferDemo.class.getResource("/").getPath() + "scatter.txt"; @Test public void testScatteringReads() throws IOException { RandomAccessFile aFile = new RandomAccessFile(path, "rw"); FileChannel fc = aFile.getChannel(); //create buffer with capacity of 48 bytes ByteBuffer header = ByteBuffer.allocate(8); ByteBuffer body = ByteBuffer.allocate(1024); ByteBuffer[] bufferArray = {header, body}; long bytesRead = fc.read(bufferArray); // System.out.println(bytesRead); Assert.assertEquals(26, bytesRead); //print header System.out.println("---header(" + header.limit() + "bytes)---"); header.flip(); while (header.hasRemaining()) { // read 1 byte at a time System.out.print((char) header.get()); } header.clear(); // print body body.flip(); System.out.println("---body(" + body.limit() + "bytes)----"); while (body.hasRemaining()) { // read 1 byte at a time System.out.print((char) body.get()); } header.clear(); body.clear(); fc.close(); } } ```
The 2019 SLFA Island Cup was an association football cup competition for the island of Saint Lucia. The tournament began on 2 July 2019 and concluded on 21 December 2019. Gros Islet won the tournament. First Group Stage Standings Group A Group 1 1.Canaries 8 7 0 1 19- 7 21 Qualified 2.Vieux Fort South 8 5 1 2 17-13 16 Qualified 3.Roseau Valley 8 5 1 2 12- 9 16 Qualified 4.Gros Islet 8 4 2 2 21-15 14 Qualified - - - - - - - - - - - - - - - - - - - - - - - - - 5.Desruisseaux 8 4 2 2 12- 8 14 6.Micoud 8 4 1 3 15-10 13 7.Laborie 7 1 0 6 10-15 3 8.South Castries 7 1 0 6 7-15 3 9.Mon Repos 8 0 1 7 5-26 1 Group B 1.Marchand 7 4 3 0 9- 4 15 Qualified 2.Dennery 7 4 2 1 9- 5 14 Qualified 3.Central Castries 7 3 3 1 13- 8 12 Qualified 4.Mabouya Valley 7 3 2 2 8- 5 11 Qualified - - - - - - - - - - - - - - - - - - - - - - - - - 5.Babonneau 7 2 3 2 10- 9 10 6.La Clery 7 1 4 2 4- 7 7 7.Anse-la-Raye 7 0 3 4 6-13 3 8.Vieux Fort North 7 1 0 6 5-13 3 Results [Jul 24] Canaries 2-0 South Castries Mon Repos 0-5 Gros Islet [Jul 25] Roseau Valley 1-2 Vieux Fort South La Clery 1-2 Dennery [Jul 28] Micoud 1-2 Canaries Desruisseaux 2-1 South Castries Anse-la-Raye awd Vieux Fort North [awarded 0–3, Anse-la-Raye dns] Babonneau 0-1 Mabouya Valley [Aug 1] La Clery 2-0 Vieux Fort North Dennery 1-1 Central Castries [Aug 4] Mon Repos 1-3 Desruisseaux Marchand 1-0 Vieux Fort North Gros Islet 1-2 Roseau Valley [Aug 5] Anse-la Raye 1-1 Babonneau Mabouya Valley 0-0 La Clery Micoud 2-1 Laborie South Castries 1-4 Vieux Fort South [Aug 8] Vieux Fort North 0-1 Central Castries Dennery 0-0 Marchand South Castries 3-0 Mon Repos Canaries 0-3 Desruisseaux [Aug 11] Roseau Valley 1-0 Micoud Gros Islet 3-0 South Castries [possibly awarded] Mabouya Valley 5-2 Vieux Fort North Anse-la-Raye 2-3 Marchand [Aug 12] Desruisseaux 1-0 Laborie Vieux Fort South 0-1 Canaries Babonneau 2-1 Dennery La Clery 0-4 Central Castries [Aug 15] Roseau Valley 2-1 Desruisseaux La Clery 0-0 Marchand Micoud 2-1 South Castries Central Castries 2-2 Anse-la-Raye [Aug 18] Gros Islet 1-7 Canaries Roseau Valley 2-1 South Castries [Aug 19] Babonneau 3-0 Vieux Fort North Mon Repos 0-5 Micud Dennery 2-1 Anse-la-Raye [Aug 22] Central Castries 4-2 Babonneau Micoud 2-2 Gros Islet Marchand 1-0 Mabouya Valley Laborie awd Roseau Valley [awarded 0-3] [Aug 25] Canaries 3-2 Laborie Babonneau 1-1 La Clery [Aug 26] Vieux Fort South 3-1 Micoud Gros Islet 1-1 Desruisseaux [Aug 29] Canaries 1-0 Mon Repos Dennery 2-0 Mabouya Valley [Sep 1] Mon Repos 1-4 Laborie Gros Islet 5-1 Vieux Fort South [Sep 2] Anse-la-Reye 0-2 Mabouya Valley Central Castries 1-3 Marchand [Sep 5] Mon Repos 1-1 Roseau Valley Desruisseaux 1-1 Vieux Fort South [Sep 8] South Castries n/p Laborie [Sep 14] Vieux Fort South 2-1 Laborie Final Tables: Second Group Stage Known results [Oct 27] Marchand 3-0 Vieux Fort South Central Castries 2-3 Gros Islet [Dec 1] Canaries 0-1 Roseau Valley [Dec 8] Dennery 1-2 Mabouya Valley Final Table: 1.Gros Islet 7 5 1 1 15- 9 16 Qualified 2.Mabouya Valley 7 5 0 2 18-14 15 Qualified 3.Vieux Fort South 7 4 1 2 22-10 13 Qualified 4.Marchand 7 4 1 2 19-10 13 Qualified - - - - - - - - - - - - - - - - - - - - - - - - - 5.Roseau Valley 7 3 1 3 9-11 10 6.Dennery 7 1 3 3 7-13 6 7.Canaries 7 1 1 5 8-21 4 8.Central Castries 7 1 0 6 9-19 3 Semifinals [Dec 15] Vieux Fort South 3-0 Mabouya Valley [Dec 16] Gros Islet 1-1 Marchand [4-3 pen] Third Place Match [Dec 21] Mabouya Valley awd Marchand [awarded 3–0, Marchand dns] Final References Saint Lucia Saint Lucia
You Can Be The Stainless Steel Rat is a novel by Harry Harrison published in 1988. Plot summary You Can Be The Stainless Steel Rat is a novel in which the reader can move to numbered paragraphs like a gamebook. Reception Dave Langford reviewed You Can Be The Stainless Steel Rat for White Dwarf #73, and stated that "(Harrison), a talented and able writer, shows his versatility by effortlessly turning off these qualities...he cracks some good jokes, but literary ability seems irrelevant to these game books (look at the people who usually write them). Playability? Unless you get bored and go to sleep there's no way to lose, or to escape the linear 'plot' to which Harrison has merely added decorative, swiftly returning loops...My all-purpose review for such efforts is designed to appease the publishers: 'This one is a real page-turner!'" Reviews Science Fiction Chronicle References External links Biography entry of Harry Harrison 1988 novels
```c++ /* * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "Benchmark.h" #include "SkCanvas.h" #include "SkPath.h" #include "SkString.h" static void make_path(SkPath& path) { #include "BigPathBench.inc" } enum Align { kLeft_Align, kMiddle_Align, kRight_Align }; const char* gAlignName[] = { "left", "middle", "right" }; // Inspired by crbug.com/455429 class BigPathBench : public Benchmark { SkPath fPath; SkString fName; Align fAlign; bool fRound; public: BigPathBench(Align align, bool round) : fAlign(align), fRound(round) { fName.printf("bigpath_%s", gAlignName[fAlign]); if (round) { fName.append("_round"); } } protected: const char* onGetName() override { return fName.c_str(); } SkIPoint onGetSize() override { return SkIPoint::Make(640, 100); } void onPreDraw() override { make_path(fPath); } void onDraw(const int loops, SkCanvas* canvas) override { SkPaint paint; paint.setAntiAlias(true); paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeWidth(2); if (fRound) { paint.setStrokeJoin(SkPaint::kRound_Join); } this->setupPaint(&paint); const SkRect r = fPath.getBounds(); switch (fAlign) { case kLeft_Align: canvas->translate(-r.left(), 0); break; case kMiddle_Align: break; case kRight_Align: canvas->translate(640 - r.right(), 0); break; } for (int i = 0; i < loops; i++) { canvas->drawPath(fPath, paint); } } private: typedef Benchmark INHERITED; }; DEF_BENCH( return new BigPathBench(kLeft_Align, false); ) DEF_BENCH( return new BigPathBench(kMiddle_Align, false); ) DEF_BENCH( return new BigPathBench(kRight_Align, false); ) DEF_BENCH( return new BigPathBench(kLeft_Align, true); ) DEF_BENCH( return new BigPathBench(kMiddle_Align, true); ) DEF_BENCH( return new BigPathBench(kRight_Align, true); ) ```
Bassani Racing (previously known as RC3 Bassani and Full Time Bassani), currently competing as Oakberry Bassani Racing, is a Brazilian professional auto racing team based in Itu, São Paulo, currently competing in the F4 Brazilian Championship, having previously competed in the Stock Car Pro Series, F3 Sudamericana, and Formula Renault 2.0. Originally found in 2002 by Eduardo Bassani, Bassani Racing has competed in Formula 3 Sudamericana and Formula Renault 2.0 Brazil all with race winning success. The teams' first Stock Car Brasil appearance was in 2003. In 2005 team became co-ownership by Brazilian footballer Roberto Carlos as RC3 Bassani. The partnership ran until 2014. From 2017 until 2022 the team became a subsidiary of Full Time Sports and was renamed to Full Time Bassani. In 2023, the team was rebranded to Bassani Racing ahead of its debut in F4 Brazil. Timeline References External links Stock Car Brasil teams Auto racing teams established in 2002 Auto racing teams in Brazil Formula Renault teams
```php <?php namespace Laratrust\Console; use Illuminate\Console\Command; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Config; class MigrationCommand extends Command { /** * The console command name. * * @var string */ protected $name = 'laratrust:migration'; /** * The console command description. * * @var string */ protected $description = 'Creates a migration following the Laratrust specifications.'; /** * Suffix of the migration name. * * @var string */ protected $migrationSuffix = 'laratrust_setup_tables'; /** * Execute the console command. * * @return void */ public function handle() { $this->line(''); $this->info('Laratrust Migration Creation.'); if (Config::get('laratrust.teams.enabled')) { $this->comment('You are using the teams feature.'); } $this->line(''); $this->comment($this->generateMigrationMessage()); $existingMigrations = $this->alreadyExistingMigrations(); $defaultAnswer = true; if ($existingMigrations) { $this->line(''); $this->warn($this->getExistingMigrationsWarning($existingMigrations)); $defaultAnswer = false; } $this->line(''); if (! $this->confirm('Proceed with the migration creation?', $defaultAnswer)) { return; } $this->line(''); $this->line('Creating migration'); if ($this->createMigration()) { $this->info('Migration created successfully.'); } else { $this->error( "Couldn't create migration.\n". 'Check the write permissions within the database/migrations directory.' ); } $this->line(''); } /** * Create the migration. * * @return bool */ protected function createMigration() { $migrationPath = $this->getMigrationPath(); $output = $this->laravel->view ->make('laratrust::migration') ->with(['laratrust' => Config::get('laratrust')]) ->render(); if (! file_exists($migrationPath) && $fs = fopen($migrationPath, 'x')) { fwrite($fs, $output); fclose($fs); return true; } return false; } /** * Generate the message to display when running the * console command showing what tables are going * to be created. * * @return string */ protected function generateMigrationMessage() { $tables = Collection::make(Config::get('laratrust.tables')) ->reject(function ($value, $key) { return $key == 'teams' && ! Config::get('laratrust.teams.enabled'); }) ->sort(); return "A migration that creates {$tables->implode(', ')} " .'tables will be created in database/migrations directory'; } /** * Build a warning regarding possible duplication * due to already existing migrations. * * @param array $existingMigrations * @return string */ protected function getExistingMigrationsWarning(array $existingMigrations) { if (count($existingMigrations) > 1) { $base = "Laratrust migrations already exist.\nFollowing files were found: "; } else { $base = "Laratrust migration already exists.\nFollowing file was found: "; } return $base.array_reduce($existingMigrations, function ($carry, $fileName) { return $carry."\n - ".$fileName; }); } /** * Check if there is another migration * with the same suffix. * * @return array */ protected function alreadyExistingMigrations() { $matchingFiles = glob($this->getMigrationPath('*')); return array_map(function ($path) { return basename($path); }, $matchingFiles); } /** * Get the migration path. * * The date parameter is optional for ability * to provide a custom value or a wildcard. * * @param string|null $date * @return string */ protected function getMigrationPath($date = null) { $date = $date ?: date('Y_m_d_His'); return database_path("migrations/{$date}_{$this->migrationSuffix}.php"); } } ```
```go package handlers import ( "context" "errors" "fmt" abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" "github.com/cosmos/gogoproto/proto" consensusv1 "cosmossdk.io/api/cosmos/consensus/v1" appmanager "cosmossdk.io/core/app" "cosmossdk.io/core/store" "cosmossdk.io/core/transaction" "cosmossdk.io/server/v2/cometbft/mempool" ) type AppManager[T transaction.Tx] interface { ValidateTx(ctx context.Context, tx T) (appmanager.TxResult, error) Query(ctx context.Context, version uint64, request transaction.Msg) (response transaction.Msg, err error) } type DefaultProposalHandler[T transaction.Tx] struct { mempool mempool.Mempool[T] txSelector TxSelector[T] } func NewDefaultProposalHandler[T transaction.Tx](mp mempool.Mempool[T]) *DefaultProposalHandler[T] { return &DefaultProposalHandler[T]{ mempool: mp, txSelector: NewDefaultTxSelector[T](), } } func (h *DefaultProposalHandler[T]) PrepareHandler() PrepareHandler[T] { return func(ctx context.Context, app AppManager[T], txs []T, req proto.Message) ([]T, error) { abciReq, ok := req.(*abci.PrepareProposalRequest) if !ok { return nil, fmt.Errorf("expected abci.PrepareProposalRequest, invalid request type: %T,", req) } var maxBlockGas uint64 res, err := app.Query(ctx, 0, &consensusv1.QueryParamsRequest{}) if err != nil { return nil, err } paramsResp, ok := res.(*consensusv1.QueryParamsResponse) if !ok { return nil, fmt.Errorf("unexpected consensus params response type; expected: %T, got: %T", &consensusv1.QueryParamsResponse{}, res) } if b := paramsResp.GetParams().Block; b != nil { maxBlockGas = uint64(b.MaxGas) } defer h.txSelector.Clear() // If the mempool is nil or NoOp we simply return the transactions // requested from CometBFT, which, by default, should be in FIFO order. // // Note, we still need to ensure the transactions returned respect req.MaxTxBytes. _, isNoOp := h.mempool.(mempool.NoOpMempool[T]) if h.mempool == nil || isNoOp { for _, tx := range txs { stop := h.txSelector.SelectTxForProposal(ctx, uint64(abciReq.MaxTxBytes), maxBlockGas, tx) if stop { break } } return h.txSelector.SelectedTxs(ctx), nil } iterator := h.mempool.Select(ctx, txs) for iterator != nil { memTx := iterator.Tx() // NOTE: Since transaction verification was already executed in CheckTx, // which calls mempool.Insert, in theory everything in the pool should be // valid. But some mempool implementations may insert invalid txs, so we // check again. _, err := app.ValidateTx(ctx, memTx) if err != nil { err := h.mempool.Remove([]T{memTx}) if err != nil && !errors.Is(err, mempool.ErrTxNotFound) { return nil, err } } else { stop := h.txSelector.SelectTxForProposal(ctx, uint64(abciReq.MaxTxBytes), maxBlockGas, memTx) if stop { break } } iterator = iterator.Next() } return h.txSelector.SelectedTxs(ctx), nil } } func (h *DefaultProposalHandler[T]) ProcessHandler() ProcessHandler[T] { return func(ctx context.Context, app AppManager[T], txs []T, req proto.Message) error { // If the mempool is nil we simply return ACCEPT, // because PrepareProposal may have included txs that could fail verification. _, isNoOp := h.mempool.(mempool.NoOpMempool[T]) if h.mempool == nil || isNoOp { return nil } _, ok := req.(*abci.PrepareProposalRequest) if !ok { return fmt.Errorf("invalid request type: %T", req) } res, err := app.Query(ctx, 0, &consensusv1.QueryParamsRequest{}) if err != nil { return err } paramsResp, ok := res.(*consensusv1.QueryParamsResponse) if !ok { return fmt.Errorf("unexpected consensus params response type; expected: %T, got: %T", &consensusv1.QueryParamsResponse{}, res) } var maxBlockGas uint64 if b := paramsResp.GetParams().Block; b != nil { maxBlockGas = uint64(b.MaxGas) } var totalTxGas uint64 for _, tx := range txs { _, err := app.ValidateTx(ctx, tx) if err != nil { return fmt.Errorf("failed to validate tx: %w", err) } if maxBlockGas > 0 { gaslimit, err := tx.GetGasLimit() if err != nil { return errors.New("failed to get gas limit") } totalTxGas += gaslimit if totalTxGas > maxBlockGas { return fmt.Errorf("total tx gas %d exceeds max block gas %d", totalTxGas, maxBlockGas) } } } return nil } } // NoOpPrepareProposal defines a no-op PrepareProposal handler. It will always // return the transactions sent by the client's request. func NoOpPrepareProposal[T transaction.Tx]() PrepareHandler[T] { return func(ctx context.Context, app AppManager[T], txs []T, req proto.Message) ([]T, error) { return txs, nil } } // NoOpProcessProposal defines a no-op ProcessProposal Handler. It will always // return ACCEPT. func NoOpProcessProposal[T transaction.Tx]() ProcessHandler[T] { return func(context.Context, AppManager[T], []T, proto.Message) error { return nil } } // NoOpExtendVote defines a no-op ExtendVote handler. It will always return an // empty byte slice as the vote extension. func NoOpExtendVote() ExtendVoteHandler { return func(context.Context, store.ReaderMap, *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error) { return &abci.ExtendVoteResponse{VoteExtension: []byte{}}, nil } } // NoOpVerifyVoteExtensionHandler defines a no-op VerifyVoteExtension handler. It // will always return an ACCEPT status with no error. func NoOpVerifyVoteExtensionHandler() VerifyVoteExtensionhandler { return func(context.Context, store.ReaderMap, *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error) { return &abci.VerifyVoteExtensionResponse{Status: abci.VERIFY_VOTE_EXTENSION_STATUS_ACCEPT}, nil } } ```
Duplass Brothers Productions is an American independent film and television production company founded by Mark Duplass and Jay Duplass, two brothers who are also actors, directors, producers and writers. They have produced films such as The Puffy Chair (2005), Safety Not Guaranteed (2012), The One I Love (2014) and The Skeleton Twins (2014), and the HBO comedy-drama television series Togetherness (2015–2016) and Room 104 (2017-2020). History Duplass Brothers Productions was founded in 1996, with the release of the first film by brothers Jay Duplass and Mark Duplass. The company originally produced low-budget mumblecore films, but has since expanded to studio projects. In 2015, the Duplass Brothers expanded into television with their first series Togetherness, in which Mark also stars. In January 2015, Duplass Brothers Productions closed a four-picture deal with Netflix, involving financing from the company and, after a short theatrical run, the films being available to Netflix subscribers. In June 2015, Duplass Brothers Productions finalized a seven-picture distribution deal with The Orchard, releasing the Duplass-produced films theatrically prior to their Netflix release. Under the TV production arm Duplass Brothers Television, they signed a two-year overall deal with HBO in June 2015. In August 2016, Duplass Brothers announced another television project, Room 104, to air on HBO in 2017, which was quickly renewed for a second season. In 2018, it was announced the company had entered into a new four-picture deal with Netflix, which gave the streaming giant worldwide rights. Mel Eslyn was named president of Duplass Brothers Productions in 2017. Filmography Film Connect 5 (1996) The Puffy Chair (2006) Baghead (2008) Cyrus (2010) Jeff, Who Lives at Home (2011) Safety Not Guaranteed (2012) The Do-Deca-Pentathlon (2012) Bad Milo! (2013) The One I Love (2014) The Skeleton Twins (2014) Adult Beginners (2014) The Overnight (2015) Creep (2015) Tangerine (2015) 6 Years (2015) Manson Family Vacation (2015) The Bronze (2016) Blue Jay (2016) Rainbow Time (2016) Take Me (2017) Outside In (2017) Duck Butter (2018) Unlovable (2018) Paddleton (2019) Horse Girl (2020) Language Lessons (2021) 7 Days (2021) As of Yet (2021) Spin Me Round (2022) Shorts This Is John (2003) Scrapple (2004) The Intervention (2005) Television Togetherness (2015–16 for HBO) Animals. (2016–18 for HBO) Room 104 (2017–20 for HBO) Cinema Toast (2021– for Showtime) Somebody Somewhere (2021- for HBO) Documentaries Asperger's Are Us (2016) Wild Wild Country (2018) Evil Genius: The True Story of America's Most Diabolical Bank Heist (2018) On Tour with Asperger's Are Us (2019 for HBO) The Lady and the Dale (2021 for HBO) Not Going Quietly (2021) Sasquatch (2021 for Hulu) Last Stop Larrimah (2023) References External links "How an Unlikely Hollywood Juggernaut Came to Rule Netflix" on WIRED Magazine 1996 establishments in California American companies established in 1996 American independent film studios Companies based in Los Angeles Entertainment companies based in California Entertainment companies established in 1996 Film production companies of the United States Television production companies of the United States
```kotlin import org.gradle.api.* import org.gradle.api.tasks.* /** * Adds 'module_name.version' file to the project's JAR META-INF * for the better toolability. See #2941 */ object VersionFile { fun registerVersionFileTask(project: Project): TaskProvider<Task> { val versionFile = project.layout.buildDirectory.file("${project.name.replace('-', '_')}.version") val version = project.version.toString() return project.tasks.register("versionFileTask") { outputs.file(versionFile) doLast { versionFile.get().asFile.writeText(version) } } } fun fromVersionFile(target: AbstractCopyTask, versionFileTask: TaskProvider<Task>) { target.from(versionFileTask) { into("META-INF") } } } ```
```smalltalk using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using Volo.Abp.Options; namespace Microsoft.Extensions.DependencyInjection; public static class ServiceCollectionDynamicOptionsManagerExtensions { public static IServiceCollection AddAbpDynamicOptions<TOptions, TManager>(this IServiceCollection services) where TOptions : class where TManager : AbpDynamicOptionsManager<TOptions> { services.Replace(ServiceDescriptor.Scoped(typeof(IOptions<TOptions>), typeof(TManager))); services.Replace(ServiceDescriptor.Scoped(typeof(IOptionsSnapshot<TOptions>), typeof(TManager))); return services; } } ```
Bridge 5827 is a historic arch bridge in Zumbro Falls, Minnesota, United States, built in 1938 by the Works Progress Administration using a modular corrugated iron product called Multi Plate. It was listed on the National Register of Historic Places as the Bridge No. 5827–Zumbro Falls in 1998 for having state-level significance in the theme of engineering. It was nominated as an example of Minnesota's stone-faced Multi Plate bridges with particularly fine masonry. History Bridge 5827 is on Minnesota State Highway 60, 0.1 miles east of its intersection with U.S. Route 63. This bridge was built by the Works Progress Administration (WPA) in 1938 for an approximate cost of $2000. This bridge is an example of the labor-intensive New Deal work projects which promoted highway beautification and highlighted local craftsman skills and workmanship. The bridge is built on an Armco Culvert Manufacturers Association galvanized, corrugated-iron structure. Excellent masonry work covers the structure to result in a stoned-faced, multi-plate arch style bridge. Other examples include the nearby Zumbro Parkway Bridge, and Bridge No. 90646 in Minneapolis. See also List of bridges on the National Register of Historic Places in Minnesota National Register of Historic Places listings in Wabasha County, Minnesota References External links Bridge 5827–Minnesota Department of Transportation 1938 establishments in Minnesota Bridges completed in 1938 Buildings and structures in Wabasha County, Minnesota National Register of Historic Places in Wabasha County, Minnesota Road bridges on the National Register of Historic Places in Minnesota Transportation in Wabasha County, Minnesota Works Progress Administration in Minnesota Arch bridges in the United States Iron bridges in the United States
Susanne Stichler (born 17 August 1969 in Karlsruhe, Baden-Württemberg) is a German journalist and newscaster. Life She studied educational science at the University of Tübingen and worked as a trainee for a local radio station "Neckar-Alb Radio" in Reutlingen from 1991 to 1993. She went to Potsdam to "Fritz", a youth radio station, and then the public broadcaster for Brandenburg, ORB. Stichler then worked for the TV section of the public broadcaster for Hessen, Hessischer Rundfunk, in Frankfurt, from 1997 to 1999. From 1999, she hosted several magazines for the national broadcaster ZDF. Since 2004, she has been working for NDR. Her most prominent show there is Germany's most watched evening newscast, Tagesschau, for national broadcaster ARD. Stichler lives in Hamburg with her son Paul. References German television presenters German women television presenters German broadcast news analysts German women television journalists German television journalists 1969 births Living people Mass media people from Karlsruhe ARD (broadcaster) people Tagesschau (ARD) presenters and reporters ZDF people Norddeutscher Rundfunk people
MN1 is a gene found on human chromosome 22, with gene map locus 22q12.3-qter. Its official full name is meningioma (disrupted in balanced translocation) 1 because it is disrupted by a balanced translocation (4;22) in a meningioma. Function MN1 is a transcription coregulator that enhances or represses gene expression through direct or indirect interaction with the gene regulatory machinery. Reported interactions include the BAF (SWI/SNF) complex. RAC3 and p300. MN1 can act as a coactivator of several transcription factors, including RAR/RXR and the vitamin D receptor. In AML, MN1 binds to genomic sites enriched for binding motifs of ETS factors as well as hematopoietic transcription factors such as RUNX1, GATA2, HOXA cluster genes, and MEIS1. MN1 induces a hematopoietic stem and progenitor gene expression program centered on HOXA cluster genes, particularly HOXA9 and MEIS1 via its interaction with the BAF complex Clinical significance The translocation of MN1 was first reported in meningioma. A substantial percentage of primitive neuro-ectodermal tumors (PNET) have MN1 translocations Several different partners were described, although in many cases no fusion partner was identified. MN1 transloations also occur in up to 2% of acute myeloid leukemia (AML) Described fusion partners include ETV6, STAT3 and FLI1. About 50% of fusions are out of frame and result in high expression of MN1 via enhancer hijacking. High MN1 expression in AML and MDS is associated with poor outcome Mutations in this gene have been associated with cleft palate and an atypical form of rhombencephalosynapsis. References Further reading Transcription coregulators
María Baxa (born Marija Baksa, ; 15 April 1946 – 14 November 2019) was an Italian-Serbian film actress, mainly active in Italian cinema. Born in Osijek, Baxa made her film debut in Branko Čelović's Bokseri idu u raj, then moved to Italy where she became a popular starlet in Italian genre cinema, especially in commedia sexy all'italiana (sex comedies). In the late 1980s, Baxa left showbusiness to be an architect. Filmography References External links 1946 births 2019 deaths Serbian film actresses Italian film actresses People from Osijek Yugoslav expatriates in Italy Serbs of Croatia Italian people of Serbian descent
```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.pravega.shared.metrics; import com.google.common.collect.ImmutableSet; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.composite.CompositeMeterRegistry; import io.micrometer.prometheus.PrometheusMeterRegistry; import io.pravega.test.common.SerializedClassRunner; import io.pravega.test.common.TestUtils; import lombok.Cleanup; import lombok.extern.slf4j.Slf4j; import org.glassfish.grizzly.http.server.HttpServer; import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory; import org.glassfish.jersey.server.ResourceConfig; import org.junit.Test; import org.junit.runner.RunWith; import javax.ws.rs.core.Application; import javax.ws.rs.core.UriBuilder; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; import java.util.Set; import java.util.regex.Pattern; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @Slf4j @RunWith(SerializedClassRunner.class) public class PrometheusResourceTest { @Test public void testStatsProviderNoPrometheus() { MetricsConfig appConfig = MetricsConfig.builder() .with(MetricsConfig.ENABLE_STATISTICS, true) .with(MetricsConfig.ENABLE_STATSD_REPORTER, true) .build(); @Cleanup CompositeMeterRegistry localRegistry = new CompositeMeterRegistry(); @Cleanup StatsProvider statsProvider = new StatsProviderImpl(appConfig, localRegistry); statsProvider.start(); for (MeterRegistry registry : localRegistry.getRegistries()) { assertFalse(registry instanceof PrometheusMeterRegistry); } assertFalse(statsProvider.prometheusResource().isPresent()); statsProvider.close(); } @Test public void testScrape() throws Exception { MetricsConfig appConfig = MetricsConfig.builder() .with(MetricsConfig.ENABLE_STATISTICS, true) .with(MetricsConfig.ENABLE_PROMETHEUS, true) .build(); @Cleanup CompositeMeterRegistry localRegistry = new CompositeMeterRegistry(); @Cleanup StatsProvider statsProvider = new StatsProviderImpl(appConfig, localRegistry); statsProvider.start(); for (MeterRegistry registry : localRegistry.getRegistries()) { assertTrue(registry instanceof PrometheusMeterRegistry); } assertTrue(statsProvider.prometheusResource().isPresent()); ResourceConfig rc = ResourceConfig.forApplication(new PrometheusApplication(statsProvider)); URI baseUri = UriBuilder.fromUri("path_to_url") .port(TestUtils.getAvailableListenPort()) .build(); @Cleanup("shutdown") HttpServer server = GrizzlyHttpServerFactory.createHttpServer(baseUri, rc); Counter c = statsProvider.createStatsLogger("promtest").createCounter("promtestcounter"); c.add(1); HttpClient client = HttpClient.newBuilder() .connectTimeout(Duration.ofSeconds(5)) .build(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(baseUri + "prometheus")) .build(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); assertTrue(response.body().lines().anyMatch(x -> Pattern.matches("promtestcounter.*1\\.0", x))); server.shutdown(); } public static class PrometheusApplication extends Application { private StatsProvider statsProvider; PrometheusApplication(StatsProvider sp) { super(); this.statsProvider = sp; } @Override public Set<Object> getSingletons() { return ImmutableSet.of(this.statsProvider.prometheusResource().get()); } } } ```
Elzira de Fátima Borges Tavares Barros (born May 13, 1980 in Benguela), is a former Angolan handball player. Elzira represented Angola at the 2004 Summer Olympic Games in Athens, where Angola finished 9th. She also participated in the 2009 World Women's Handball Championship in Beijing. She participated at the 2011 World Women's Handball Championship in Brazil. She is married to Angolan basketball player Mílton Barros. She last played for Angolan side Primeiro de Agosto. References External links 1980 births Living people Sportspeople from Benguela Angolan female handball players Olympic handball players for Angola Handball players at the 2004 Summer Olympics African Games gold medalists for Angola African Games medalists in handball Competitors at the 2011 All-Africa Games
```go package helpers import ( "bytes" "compress/gzip" "context" "encoding/json" "fmt" "io" "net/http" "os" "strconv" "github.com/gruntwork-io/go-commons/errors" "github.com/hashicorp/go-getter/v2" ) func Fetch(ctx context.Context, req *http.Request, dst io.Writer) error { req.Header.Add("Accept-Encoding", "gzip") resp, err := (&http.Client{}).Do(req) if err != nil { return errors.WithStackTrace(err) } defer resp.Body.Close() //nolint:errcheck if resp.StatusCode != http.StatusOK { return fmt.Errorf("%s returned from %s", resp.Status, req.URL) } reader, err := ResponseReader(resp) if err != nil { return err } if written, err := getter.Copy(ctx, dst, reader); err != nil { return errors.WithStackTrace(err) } else if resp.ContentLength != -1 && written != resp.ContentLength { return errors.Errorf("incorrect response size: expected %d bytes, but got %d bytes", resp.ContentLength, written) } return nil } // FetchToFile downloads the file from the given `url` into the specified `dst` file. func FetchToFile(ctx context.Context, req *http.Request, dst string) error { file, err := os.Create(dst) if err != nil { return errors.WithStackTrace(err) } defer file.Close() //nolint:errcheck if err := Fetch(ctx, req, file); err != nil { return err } if err := file.Sync(); err != nil { return errors.WithStackTrace(err) } return nil } func ResponseReader(resp *http.Response) (io.ReadCloser, error) { // Check that the server actually sent compressed data switch resp.Header.Get("Content-Encoding") { case "gzip": reader, err := gzip.NewReader(resp.Body) if err != nil { return nil, err } resp.Header.Del("Content-Encoding") resp.Header.Del("Content-Length") resp.ContentLength = -1 resp.Uncompressed = true return reader, nil default: return resp.Body, nil } } func ResponseBuffer(resp *http.Response) (*bytes.Buffer, error) { reader, err := ResponseReader(resp) if err != nil { return nil, err } defer reader.Close() //nolint:errcheck buffer := new(bytes.Buffer) if _, err := buffer.ReadFrom(reader); err != nil { return nil, err } return buffer, nil } func DecodeJSONBody(resp *http.Response, value any) error { if resp.StatusCode != http.StatusOK { return nil } buffer, err := ResponseBuffer(resp) if err != nil { return err } decoder := json.NewDecoder(buffer) if err := decoder.Decode(value); err != nil { return err } resp.Body = io.NopCloser(buffer) return nil } func ModifyJSONBody(resp *http.Response, value any, fn func() error) error { if resp.StatusCode != http.StatusOK { return nil } buffer, err := ResponseBuffer(resp) if err != nil { return err } decoder := json.NewDecoder(buffer) if err := decoder.Decode(value); err != nil { return err } if fn == nil { return nil } if err := fn(); err != nil { return err } encoder := json.NewEncoder(buffer) if err := encoder.Encode(value); err != nil { return err } resp.Body = io.NopCloser(buffer) resp.ContentLength = int64(buffer.Len()) resp.Header.Set("Content-Length", strconv.Itoa(buffer.Len())) return nil } ```
```xml import { findByText } from '@testing-library/react'; import { getModelState } from '@proton/account/test'; import { MIME_TYPES } from '@proton/shared/lib/constants'; import { parseStringToDOM } from '@proton/shared/lib/helpers/dom'; import type { Attachment, Message } from '@proton/shared/lib/interfaces/mail/Message'; import { constructMime } from '../../../helpers/send/sendMimeBuilder'; import { addApiContact } from '../../../helpers/test/contact'; import { getAddressKeyCache, getStoredKey, releaseCryptoProxy, setupCryptoProxyForTesting, } from '../../../helpers/test/crypto'; import type { GeneratedKey } from '../../../helpers/test/helper'; import { addApiKeys, addApiMock, api, assertIcon, clearAll, encryptMessage, generateKeys, } from '../../../helpers/test/helper'; import { X_PM_HEADERS } from '../../../models/crypto'; import type { MessageKeys } from '../../../store/messages/messagesTypes'; import { addressID, body, getIframeRootDiv, localID, messageID, setup, subject } from './Message.test.helpers'; jest.setTimeout(20000); describe('MessageView encryption', () => { const toAddress = 'me@home.net'; const fromName = 'someone'; const fromAddress = 'someone@somewhere.net'; const otherAddress = 'other@somewhere.net'; let toKeys: GeneratedKey; let fromKeys: GeneratedKey; let otherKeys: GeneratedKey; let publicPrivateKey: MessageKeys; beforeAll(async () => { await setupCryptoProxyForTesting(); toKeys = await generateKeys('me', toAddress); fromKeys = await generateKeys('someone', fromAddress); otherKeys = await generateKeys('other', otherAddress); publicPrivateKey = { type: 'publicPrivate', publicKeys: toKeys.publicKeys, privateKeys: toKeys.privateKeys, }; }); afterAll(async () => { await releaseCryptoProxy(); }); afterEach(clearAll); describe('Decrypt and render', () => { it('html', async () => { addApiKeys(false, fromAddress, []); const encryptedBody = await encryptMessage(body, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ID: messageID, AddressID: addressID, Subject: subject, Sender: { Name: fromName, Address: fromAddress }, Body: encryptedBody, MIMEType: MIME_TYPES.DEFAULT, Attachments: [] as Attachment[], } as Message, })); const { open, container } = await setup( undefined, { conversationMode: true }, { preloadedState: { addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const iframeContent = await getIframeRootDiv(container); await findByText(iframeContent, body); }); it('plaintext', async () => { addApiKeys(false, fromAddress, []); const encryptedBody = await encryptMessage(body, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ID: messageID, AddressID: addressID, Subject: subject, Sender: { Name: fromName, Address: fromAddress }, Body: encryptedBody, MIMEType: MIME_TYPES.PLAINTEXT, Attachments: [] as Attachment[], } as Message, })); const { open, container } = await setup( undefined, {}, { preloadedState: { addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const iframeContent = await getIframeRootDiv(container); await findByText(iframeContent, body); }); it('multipart/mixed html', async () => { const message = { ID: messageID, AddressID: addressID, Subject: subject, Sender: { Name: fromName, Address: fromAddress }, MIMEType: MIME_TYPES.MIME, Attachments: [] as Attachment[], } as Message; addApiKeys(false, fromAddress, []); const mimeBody = await constructMime( { localID, data: message, messageDocument: { document: parseStringToDOM(body).body } }, publicPrivateKey, jest.fn(), jest.fn(), api, false ); const encryptedBody = await encryptMessage(mimeBody, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ...message, Body: encryptedBody }, })); const { open, container } = await setup( undefined, {}, { preloadedState: { addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const iframeContent = await getIframeRootDiv(container); await findByText(iframeContent, body); }); it('multipart/mixed plaintext', async () => { const message = { ID: messageID, AddressID: addressID, Subject: subject, Sender: { Name: fromName, Address: fromAddress }, MIMEType: MIME_TYPES.MIME, Attachments: [] as Attachment[], } as Message; addApiKeys(false, fromAddress, []); const mimeBody = await constructMime( { localID, data: { ...message, MIMEType: MIME_TYPES.PLAINTEXT }, messageDocument: { plainText: body } }, publicPrivateKey, jest.fn(), jest.fn(), api, false ); const encryptedBody = await encryptMessage(mimeBody, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ...message, Body: encryptedBody }, })); const { open, container } = await setup( undefined, {}, { preloadedState: { addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const iframeContent = await getIframeRootDiv(container); await findByText(iframeContent, body); }); }); describe('Signature verification', () => { it('verified sender internal', async () => { addApiKeys(true, fromAddress, [fromKeys]); addApiContact({ contactID: 'contactID', email: fromAddress, pinKey: fromKeys }, toKeys); const encryptedBody = await encryptMessage(body, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ID: messageID, AddressID: addressID, Sender: { Name: fromName, Address: fromAddress, }, Subject: subject, Body: encryptedBody, MIMEType: MIME_TYPES.DEFAULT, Attachments: [] as Attachment[], ParsedHeaders: { 'X-Pm-Origin': X_PM_HEADERS.INTERNAL, 'X-Pm-Content-Encryption': X_PM_HEADERS.END_TO_END, } as any, Time: new Date().getTime(), } as Message, })); const { open, findByTestId } = await setup( undefined, {}, { preloadedState: { userKeys: getModelState(getStoredKey(toKeys)), addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const icon = await findByTestId('encryption-icon'); assertIcon(icon, 'lock-check-filled', 'color-info'); }); it('verified sender external', async () => { addApiKeys(false, fromAddress, [fromKeys]); addApiContact({ contactID: 'contactID', email: fromAddress, pinKey: fromKeys }, toKeys); const message = { ID: messageID, AddressID: addressID, Sender: { Address: fromAddress, }, Subject: subject, MIMEType: MIME_TYPES.DEFAULT, Attachments: [] as Attachment[], ParsedHeaders: { 'X-Pm-Origin': X_PM_HEADERS.EXTERNAL, 'X-Pm-Content-Encryption': X_PM_HEADERS.END_TO_END, } as any, Time: new Date().getTime(), } as Message; const mimeBody = await constructMime( { localID, data: message, messageDocument: { document: parseStringToDOM(body).body } }, publicPrivateKey, jest.fn(), jest.fn(), api, false ); const encryptedBody = await encryptMessage(mimeBody, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ...message, Body: encryptedBody }, })); const { open, findByTestId } = await setup( undefined, {}, { preloadedState: { userKeys: getModelState(getStoredKey(toKeys)), addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const icon = await findByTestId('encryption-icon'); assertIcon(icon, 'lock-check-filled', 'color-success'); }); it('signature verification error', async () => { addApiKeys(true, fromAddress, []); addApiContact({ contactID: 'contactID', email: fromAddress, pinKey: otherKeys }, toKeys); const encryptedBody = await encryptMessage(body, fromKeys, toKeys); addApiMock(`mail/v4/messages/${messageID}`, () => ({ Message: { ID: messageID, AddressID: addressID, Sender: { Name: fromName, Address: fromAddress, }, Subject: subject, Body: encryptedBody, MIMEType: MIME_TYPES.DEFAULT, Attachments: [] as Attachment[], ParsedHeaders: { 'X-Pm-Origin': X_PM_HEADERS.INTERNAL, 'X-Pm-Content-Encryption': X_PM_HEADERS.END_TO_END, } as any, Time: new Date().getTime(), } as Message, })); const { open, findByTestId } = await setup( undefined, {}, { preloadedState: { userKeys: getModelState(getStoredKey(toKeys)), addressKeys: getAddressKeyCache(addressID, toKeys), }, } ); await open(); const icon = await findByTestId('encryption-icon'); assertIcon(icon, 'lock-exclamation-filled', 'color-info'); }); }); }); ```
Kırgıl () is a village in the Karakoçan District of Elazığ Province in Turkey. Its population is 56 (2021). The village is populated by Kurds of the Izol tribe. References Villages in Karakoçan District Kurdish settlements in Elazığ Province
```objective-c See the file COPYING for copying permission. */ #ifndef XmlTok_INCLUDED #define XmlTok_INCLUDED 1 #ifdef __cplusplus extern "C" { #endif /* The following token may be returned by XmlContentTok */ #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of illegal ]]> sequence */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; might be part of CRLF sequence */ #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 /* The following tokens are returned by XmlContentTok; some are also returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok. */ #define XML_TOK_START_TAG_WITH_ATTS 1 #define XML_TOK_START_TAG_NO_ATTS 2 #define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */ #define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4 #define XML_TOK_END_TAG 5 #define XML_TOK_DATA_CHARS 6 #define XML_TOK_DATA_NEWLINE 7 #define XML_TOK_CDATA_SECT_OPEN 8 #define XML_TOK_ENTITY_REF 9 #define XML_TOK_CHAR_REF 10 /* numeric character reference */ /* The following tokens may be returned by both XmlPrologTok and XmlContentTok. */ #define XML_TOK_PI 11 /* processing instruction */ #define XML_TOK_XML_DECL 12 /* XML decl or text decl */ #define XML_TOK_COMMENT 13 #define XML_TOK_BOM 14 /* Byte order mark */ /* The following tokens are returned only by XmlPrologTok */ #define XML_TOK_PROLOG_S 15 #define XML_TOK_DECL_OPEN 16 /* <!foo */ #define XML_TOK_DECL_CLOSE 17 /* > */ #define XML_TOK_NAME 18 #define XML_TOK_NMTOKEN 19 #define XML_TOK_POUND_NAME 20 /* #name */ #define XML_TOK_OR 21 /* | */ #define XML_TOK_PERCENT 22 #define XML_TOK_OPEN_PAREN 23 #define XML_TOK_CLOSE_PAREN 24 #define XML_TOK_OPEN_BRACKET 25 #define XML_TOK_CLOSE_BRACKET 26 #define XML_TOK_LITERAL 27 #define XML_TOK_PARAM_ENTITY_REF 28 #define XML_TOK_INSTANCE_START 29 /* The following occur only in element type declarations */ #define XML_TOK_NAME_QUESTION 30 /* name? */ #define XML_TOK_NAME_ASTERISK 31 /* name* */ #define XML_TOK_NAME_PLUS 32 /* name+ */ #define XML_TOK_COND_SECT_OPEN 33 /* <![ */ #define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */ #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */ #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */ #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ #define XML_TOK_COMMA 38 /* The following token is returned only by XmlAttributeValueTok */ #define XML_TOK_ATTRIBUTE_VALUE_S 39 /* The following token is returned only by XmlCdataSectionTok */ #define XML_TOK_CDATA_SECT_CLOSE 40 /* With namespace processing this is returned by XmlPrologTok for a name with a colon. */ #define XML_TOK_PREFIXED_NAME 41 #ifdef XML_DTD #define XML_TOK_IGNORE_SECT 42 #endif /* XML_DTD */ #ifdef XML_DTD #define XML_N_STATES 4 #else /* not XML_DTD */ #define XML_N_STATES 3 #endif /* not XML_DTD */ #define XML_PROLOG_STATE 0 #define XML_CONTENT_STATE 1 #define XML_CDATA_SECTION_STATE 2 #ifdef XML_DTD #define XML_IGNORE_SECTION_STATE 3 #endif /* XML_DTD */ #define XML_N_LITERAL_TYPES 2 #define XML_ATTRIBUTE_VALUE_LITERAL 0 #define XML_ENTITY_VALUE_LITERAL 1 /* The size of the buffer passed to XmlUtf8Encode must be at least this. */ #define XML_UTF8_ENCODE_MAX 4 /* The size of the buffer passed to XmlUtf16Encode must be at least this. */ #define XML_UTF16_ENCODE_MAX 2 typedef struct position { /* first line and first column are 0 not 1 */ XML_Size lineNumber; XML_Size columnNumber; } POSITION; typedef struct { const char *name; const char *valuePtr; const char *valueEnd; char normalized; } ATTRIBUTE; struct encoding; typedef struct encoding ENCODING; typedef int (PTRCALL *SCANNER)(const ENCODING *, const char *, const char *, const char **); struct encoding { SCANNER scanners[XML_N_STATES]; SCANNER literalScanners[XML_N_LITERAL_TYPES]; int (PTRCALL *sameName)(const ENCODING *, const char *, const char *); int (PTRCALL *nameMatchesAscii)(const ENCODING *, const char *, const char *, const char *); int (PTRFASTCALL *nameLength)(const ENCODING *, const char *); const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *); int (PTRCALL *getAtts)(const ENCODING *enc, const char *ptr, int attsMax, ATTRIBUTE *atts); int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr); int (PTRCALL *predefinedEntityName)(const ENCODING *, const char *, const char *); void (PTRCALL *updatePosition)(const ENCODING *, const char *ptr, const char *end, POSITION *); int (PTRCALL *isPublicId)(const ENCODING *enc, const char *ptr, const char *end, const char **badPtr); void (PTRCALL *utf8Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, char **toP, const char *toLim); void (PTRCALL *utf16Convert)(const ENCODING *enc, const char **fromP, const char *fromLim, unsigned short **toP, const unsigned short *toLim); int minBytesPerChar; char isUtf8; char isUtf16; }; /* Scan the string starting at ptr until the end of the next complete token, but do not scan past eptr. Return an integer giving the type of token. Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set. Return XML_TOK_PARTIAL when the string does not contain a complete token; nextTokPtr will not be set. Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr will be set to point to the character which made the token invalid. Otherwise the string starts with a valid token; nextTokPtr will be set to point to the character following the end of that token. Each data character counts as a single token, but adjacent data characters may be returned together. Similarly for characters in the prolog outside literals, comments and processing instructions. */ #define XmlTok(enc, state, ptr, end, nextTokPtr) \ (((enc)->scanners[state])(enc, ptr, end, nextTokPtr)) #define XmlPrologTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr) #define XmlContentTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr) #define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr) #ifdef XML_DTD #define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \ XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr) #endif /* XML_DTD */ /* This is used for performing a 2nd-level tokenization on the content of a literal that has already been returned by XmlTok. */ #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr)) #define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \ XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr) #define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2)) #define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \ (((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2)) #define XmlNameLength(enc, ptr) \ (((enc)->nameLength)(enc, ptr)) #define XmlSkipS(enc, ptr) \ (((enc)->skipS)(enc, ptr)) #define XmlGetAttributes(enc, ptr, attsMax, atts) \ (((enc)->getAtts)(enc, ptr, attsMax, atts)) #define XmlCharRefNumber(enc, ptr) \ (((enc)->charRefNumber)(enc, ptr)) #define XmlPredefinedEntityName(enc, ptr, end) \ (((enc)->predefinedEntityName)(enc, ptr, end)) #define XmlUpdatePosition(enc, ptr, end, pos) \ (((enc)->updatePosition)(enc, ptr, end, pos)) #define XmlIsPublicId(enc, ptr, end, badPtr) \ (((enc)->isPublicId)(enc, ptr, end, badPtr)) #define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim)) #define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \ (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim)) typedef struct { ENCODING initEnc; const ENCODING **encPtr; } INIT_ENCODING; int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncoding(void); const ENCODING *XmlGetUtf16InternalEncoding(void); int FASTCALL XmlUtf8Encode(int charNumber, char *buf); int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf); int XmlSizeOfUnknownEncoding(void); typedef int (XMLCALL *CONVERTER) (void *userData, const char *p); ENCODING * XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert, void *userData); int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingNamePtr, const ENCODING **namedEncodingPtr, int *standalonePtr); int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); const ENCODING *XmlGetUtf8InternalEncodingNS(void); const ENCODING *XmlGetUtf16InternalEncodingNS(void); ENCODING * XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert, void *userData); #ifdef __cplusplus } #endif #endif /* not XmlTok_INCLUDED */ ```
Cora Taylor Casselman (October 18, 1888 – September 6, 1964) was a Canadian federal politician. She was elected to represent the electoral district of Edmonton East in the House of Commons of Canada from 1941 to 1945. A member of the Liberal Party of Canada, she was the fourth woman ever elected to the House of Commons and the first from the province of Alberta. Casselman was elected to the House in a byelection on June 2, 1941, succeeding her late husband Frederick Casselman. She served until 1945, when she was defeated in the 1945 federal election by Social Credit candidate Patrick Harvey Ashby. On March 13, 1944, she became the first woman to be speaker in the House of Commons, albeit temporarily. She was part of the Canadian delegation at the founding of the United Nations. She later stood as an Alberta Liberal Party candidate in Edmonton in the 1955 provincial election in Alberta, but was not elected. References External links 1888 births 1964 deaths Members of the House of Commons of Canada from Alberta Liberal Party of Canada MPs People from Bruce County Canadian military personnel of World War I Women members of the House of Commons of Canada Women in Alberta politics Canadian female military personnel 20th-century Canadian women politicians
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\CloudBuild; class EmbeddedTask extends \Google\Model { /** * @var string[] */ public $annotations; protected $taskSpecType = TaskSpec::class; protected $taskSpecDataType = ''; /** * @param string[] */ public function setAnnotations($annotations) { $this->annotations = $annotations; } /** * @return string[] */ public function getAnnotations() { return $this->annotations; } /** * @param TaskSpec */ public function setTaskSpec(TaskSpec $taskSpec) { $this->taskSpec = $taskSpec; } /** * @return TaskSpec */ public function getTaskSpec() { return $this->taskSpec; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(EmbeddedTask::class, 'Google_Service_CloudBuild_EmbeddedTask'); ```
Islington (or Khokhovela) is a settlement in the Ehlanzeni District Municipality in the Mpumalanga Province of South Africa. It is located east of Acornhoek. See also List of populated places in South Africa References Populated places in the Bushbuckridge Local Municipality
```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 org.apache.traffic_control.traffic_router.core.loc; import org.apache.traffic_control.traffic_router.core.edge.InetRecord; import org.apache.traffic_control.traffic_router.core.util.CidrAddress; import org.apache.traffic_control.traffic_router.core.util.ComparableTreeSet; import org.junit.Before; import org.junit.Test; import java.util.ArrayList; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; public class FederationRegistryTest { private List<Federation> federations; @Before public void before() throws Exception { CidrAddress cidrAddress1 = CidrAddress.fromString("192.168.10.11/16"); CidrAddress cidrAddress2 = CidrAddress.fromString("192.168.20.22/24"); ComparableTreeSet<CidrAddress> cidrAddressesIpV4 = new ComparableTreeSet<CidrAddress>(); cidrAddressesIpV4.add(cidrAddress1); cidrAddressesIpV4.add(cidrAddress2); CidrAddress cidrAddress3 = CidrAddress.fromString("fdfe:dcba:9876:5::/64"); CidrAddress cidrAddress4 = CidrAddress.fromString("fd12:3456:789a:1::/64"); ComparableTreeSet<CidrAddress> cidrAddressesIpV6 = new ComparableTreeSet<CidrAddress>(); cidrAddressesIpV6.add(cidrAddress3); cidrAddressesIpV6.add(cidrAddress4); FederationMapping federationMapping = new FederationMapping("cname1", 1234, cidrAddressesIpV4, cidrAddressesIpV6); List<FederationMapping> federationMappings = new ArrayList<FederationMapping>(); federationMappings.add(federationMapping); Federation federation = new Federation("kable-town-01", federationMappings); federations = new ArrayList<Federation>(); federations.add(federation); } @Test public void itFindsMapping() throws Exception { FederationRegistry federationRegistry = new FederationRegistry(); federationRegistry.setFederations(federations); List<InetRecord> inetRecords = federationRegistry.findInetRecords("kable-town-01", CidrAddress.fromString("192.168.10.11/24")); assertThat(inetRecords, containsInAnyOrder(new InetRecord("cname1", 1234))); inetRecords = federationRegistry.findInetRecords("kable-town-01", CidrAddress.fromString("192.168.10.11/16")); assertThat(inetRecords, containsInAnyOrder(new InetRecord("cname1", 1234))); } } ```
```javascript import React from 'react'; /* * This file is auto-generated. Do not modify it manually! * Run 'yarn generate-icons' to update the icons react components. */ var __assign = (this && this.__assign) || function () { __assign = Object.assign || function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; export var IcClock = function (props) { return React.createElement( 'svg', __assign({ 'aria-hidden': 'true' }, props), React.createElement('path', { d: 'M11.354 11.354a.5.5 0 0 1-.708 0l-2.5-2.5A.5.5 0 0 1 8 8.5v-4a.5.5 0 0 1 1 0v3.793l2.354 2.353a.5.5 0 0 1 0 .708Z', }), React.createElement('path', { fillRule: 'evenodd', d: 'M16 8.5a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-1 0a6.5 6.5 0 1 1-13 0 6.5 6.5 0 0 1 13 0Z', }) ); }; ```
The TOZ-250 (ТОЗ-250) is a Soviet double-barreled combination gun. History On March 17, 1958, gunsmith designers K. I. Shekhvatov (К. И. Шехватов) and V. L. Chernopyatov (В. Л. Чернопятов) submitted to the Committee on Inventions and Discoveries of the Council of Ministers of the Soviet Union an application for the invention of a universal double-barreled combination gun for small and medium-sized game hunting. In the spring of 1965, information about the TOZ-250 was published. In August 1965 the public learned about preparations for the production of the first batch of guns of this model at the Tula Arms Plant (the cost of the gun at that time was estimated at 90-100 roubles). Later, the decision to manufacture TOZ-250 was cancelled and serial production of this gun has not been started. Design TOZ-250 is an over and under hammerless gun, with one barrel above the other. Both barrels are detachable. It was a semi-automatic weapon (16/70 gauge shotgun and .22 LR carbine equipped with detachable box magazine). To reduce the weight of the gun, the TOZ-250 receiver was made of light alloy, and its forearm, shoulder stock and trigger guard were made of plastic. Variants TOZ-250-5,6/16 (ТОЗ-250-5,6/16) - the only known version References Shotguns of the Soviet Union Semi-automatic rifles of the Soviet Union Tula Arms Plant products Trial and research firearms of the Soviet Union Combination guns .22 LR firearms
```go //go:build go1.18 // +build go1.18 // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. package armresources const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" moduleVersion = "v1.2.0" ) // AliasPathAttributes - The attributes of the token that the alias path is referring to. type AliasPathAttributes string const ( // AliasPathAttributesModifiable - The token that the alias path is referring to is modifiable by policies with 'modify' effect. AliasPathAttributesModifiable AliasPathAttributes = "Modifiable" // AliasPathAttributesNone - The token that the alias path is referring to has no attributes. AliasPathAttributesNone AliasPathAttributes = "None" ) // PossibleAliasPathAttributesValues returns the possible values for the AliasPathAttributes const type. func PossibleAliasPathAttributesValues() []AliasPathAttributes { return []AliasPathAttributes{ AliasPathAttributesModifiable, AliasPathAttributesNone, } } // AliasPathTokenType - The type of the token that the alias path is referring to. type AliasPathTokenType string const ( // AliasPathTokenTypeAny - The token type can be anything. AliasPathTokenTypeAny AliasPathTokenType = "Any" // AliasPathTokenTypeArray - The token type is array. AliasPathTokenTypeArray AliasPathTokenType = "Array" // AliasPathTokenTypeBoolean - The token type is boolean. AliasPathTokenTypeBoolean AliasPathTokenType = "Boolean" // AliasPathTokenTypeInteger - The token type is integer. AliasPathTokenTypeInteger AliasPathTokenType = "Integer" // AliasPathTokenTypeNotSpecified - The token type is not specified. AliasPathTokenTypeNotSpecified AliasPathTokenType = "NotSpecified" // AliasPathTokenTypeNumber - The token type is number. AliasPathTokenTypeNumber AliasPathTokenType = "Number" // AliasPathTokenTypeObject - The token type is object. AliasPathTokenTypeObject AliasPathTokenType = "Object" // AliasPathTokenTypeString - The token type is string. AliasPathTokenTypeString AliasPathTokenType = "String" ) // PossibleAliasPathTokenTypeValues returns the possible values for the AliasPathTokenType const type. func PossibleAliasPathTokenTypeValues() []AliasPathTokenType { return []AliasPathTokenType{ AliasPathTokenTypeAny, AliasPathTokenTypeArray, AliasPathTokenTypeBoolean, AliasPathTokenTypeInteger, AliasPathTokenTypeNotSpecified, AliasPathTokenTypeNumber, AliasPathTokenTypeObject, AliasPathTokenTypeString, } } // AliasPatternType - The type of alias pattern type AliasPatternType string const ( // AliasPatternTypeExtract - Extract is the only allowed value. AliasPatternTypeExtract AliasPatternType = "Extract" // AliasPatternTypeNotSpecified - NotSpecified is not allowed. AliasPatternTypeNotSpecified AliasPatternType = "NotSpecified" ) // PossibleAliasPatternTypeValues returns the possible values for the AliasPatternType const type. func PossibleAliasPatternTypeValues() []AliasPatternType { return []AliasPatternType{ AliasPatternTypeExtract, AliasPatternTypeNotSpecified, } } // AliasType - The type of the alias. type AliasType string const ( // AliasTypeMask - Alias value is secret. AliasTypeMask AliasType = "Mask" // AliasTypeNotSpecified - Alias type is unknown (same as not providing alias type). AliasTypeNotSpecified AliasType = "NotSpecified" // AliasTypePlainText - Alias value is not secret. AliasTypePlainText AliasType = "PlainText" ) // PossibleAliasTypeValues returns the possible values for the AliasType const type. func PossibleAliasTypeValues() []AliasType { return []AliasType{ AliasTypeMask, AliasTypeNotSpecified, AliasTypePlainText, } } // ChangeType - Type of change that will be made to the resource when the deployment is executed. type ChangeType string const ( // ChangeTypeCreate - The resource does not exist in the current state but is present in the desired state. The resource will // be created when the deployment is executed. ChangeTypeCreate ChangeType = "Create" // ChangeTypeDelete - The resource exists in the current state and is missing from the desired state. The resource will be // deleted when the deployment is executed. ChangeTypeDelete ChangeType = "Delete" // ChangeTypeDeploy - The resource exists in the current state and the desired state and will be redeployed when the deployment // is executed. The properties of the resource may or may not change. ChangeTypeDeploy ChangeType = "Deploy" // ChangeTypeIgnore - The resource exists in the current state and is missing from the desired state. The resource will not // be deployed or modified when the deployment is executed. ChangeTypeIgnore ChangeType = "Ignore" // ChangeTypeModify - The resource exists in the current state and the desired state and will be redeployed when the deployment // is executed. The properties of the resource will change. ChangeTypeModify ChangeType = "Modify" // ChangeTypeNoChange - The resource exists in the current state and the desired state and will be redeployed when the deployment // is executed. The properties of the resource will not change. ChangeTypeNoChange ChangeType = "NoChange" // ChangeTypeUnsupported - The resource is not supported by What-If. ChangeTypeUnsupported ChangeType = "Unsupported" ) // PossibleChangeTypeValues returns the possible values for the ChangeType const type. func PossibleChangeTypeValues() []ChangeType { return []ChangeType{ ChangeTypeCreate, ChangeTypeDelete, ChangeTypeDeploy, ChangeTypeIgnore, ChangeTypeModify, ChangeTypeNoChange, ChangeTypeUnsupported, } } // DeploymentMode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental // mode, resources are deployed without deleting existing resources that are not included in // the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included // in the template are deleted. Be careful when using Complete mode as you may // unintentionally delete resources. type DeploymentMode string const ( DeploymentModeComplete DeploymentMode = "Complete" DeploymentModeIncremental DeploymentMode = "Incremental" ) // PossibleDeploymentModeValues returns the possible values for the DeploymentMode const type. func PossibleDeploymentModeValues() []DeploymentMode { return []DeploymentMode{ DeploymentModeComplete, DeploymentModeIncremental, } } // ExpressionEvaluationOptionsScopeType - The scope to be used for evaluation of parameters, variables and functions in a // nested template. type ExpressionEvaluationOptionsScopeType string const ( ExpressionEvaluationOptionsScopeTypeInner ExpressionEvaluationOptionsScopeType = "Inner" ExpressionEvaluationOptionsScopeTypeNotSpecified ExpressionEvaluationOptionsScopeType = "NotSpecified" ExpressionEvaluationOptionsScopeTypeOuter ExpressionEvaluationOptionsScopeType = "Outer" ) // PossibleExpressionEvaluationOptionsScopeTypeValues returns the possible values for the ExpressionEvaluationOptionsScopeType const type. func PossibleExpressionEvaluationOptionsScopeTypeValues() []ExpressionEvaluationOptionsScopeType { return []ExpressionEvaluationOptionsScopeType{ ExpressionEvaluationOptionsScopeTypeInner, ExpressionEvaluationOptionsScopeTypeNotSpecified, ExpressionEvaluationOptionsScopeTypeOuter, } } // ExtendedLocationType - The extended location type. type ExtendedLocationType string const ( ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" ) // PossibleExtendedLocationTypeValues returns the possible values for the ExtendedLocationType const type. func PossibleExtendedLocationTypeValues() []ExtendedLocationType { return []ExtendedLocationType{ ExtendedLocationTypeEdgeZone, } } // OnErrorDeploymentType - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. type OnErrorDeploymentType string const ( OnErrorDeploymentTypeLastSuccessful OnErrorDeploymentType = "LastSuccessful" OnErrorDeploymentTypeSpecificDeployment OnErrorDeploymentType = "SpecificDeployment" ) // PossibleOnErrorDeploymentTypeValues returns the possible values for the OnErrorDeploymentType const type. func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { return []OnErrorDeploymentType{ OnErrorDeploymentTypeLastSuccessful, OnErrorDeploymentTypeSpecificDeployment, } } // PropertyChangeType - The type of property change. type PropertyChangeType string const ( // PropertyChangeTypeArray - The property is an array and contains nested changes. PropertyChangeTypeArray PropertyChangeType = "Array" // PropertyChangeTypeCreate - The property does not exist in the current state but is present in the desired state. The property // will be created when the deployment is executed. PropertyChangeTypeCreate PropertyChangeType = "Create" // PropertyChangeTypeDelete - The property exists in the current state and is missing from the desired state. It will be deleted // when the deployment is executed. PropertyChangeTypeDelete PropertyChangeType = "Delete" // PropertyChangeTypeModify - The property exists in both current and desired state and is different. The value of the property // will change when the deployment is executed. PropertyChangeTypeModify PropertyChangeType = "Modify" // PropertyChangeTypeNoEffect - The property will not be set or updated. PropertyChangeTypeNoEffect PropertyChangeType = "NoEffect" ) // PossiblePropertyChangeTypeValues returns the possible values for the PropertyChangeType const type. func PossiblePropertyChangeTypeValues() []PropertyChangeType { return []PropertyChangeType{ PropertyChangeTypeArray, PropertyChangeTypeCreate, PropertyChangeTypeDelete, PropertyChangeTypeModify, PropertyChangeTypeNoEffect, } } // ProviderAuthorizationConsentState - The provider authorization consent state. type ProviderAuthorizationConsentState string const ( ProviderAuthorizationConsentStateConsented ProviderAuthorizationConsentState = "Consented" ProviderAuthorizationConsentStateNotRequired ProviderAuthorizationConsentState = "NotRequired" ProviderAuthorizationConsentStateNotSpecified ProviderAuthorizationConsentState = "NotSpecified" ProviderAuthorizationConsentStateRequired ProviderAuthorizationConsentState = "Required" ) // PossibleProviderAuthorizationConsentStateValues returns the possible values for the ProviderAuthorizationConsentState const type. func PossibleProviderAuthorizationConsentStateValues() []ProviderAuthorizationConsentState { return []ProviderAuthorizationConsentState{ ProviderAuthorizationConsentStateConsented, ProviderAuthorizationConsentStateNotRequired, ProviderAuthorizationConsentStateNotSpecified, ProviderAuthorizationConsentStateRequired, } } // ProvisioningOperation - The name of the current provisioning operation. type ProvisioningOperation string const ( // ProvisioningOperationAction - The provisioning operation is action. ProvisioningOperationAction ProvisioningOperation = "Action" // ProvisioningOperationAzureAsyncOperationWaiting - The provisioning operation is waiting Azure async operation. ProvisioningOperationAzureAsyncOperationWaiting ProvisioningOperation = "AzureAsyncOperationWaiting" // ProvisioningOperationCreate - The provisioning operation is create. ProvisioningOperationCreate ProvisioningOperation = "Create" // ProvisioningOperationDelete - The provisioning operation is delete. ProvisioningOperationDelete ProvisioningOperation = "Delete" // ProvisioningOperationDeploymentCleanup - The provisioning operation is cleanup. This operation is part of the 'complete' // mode deployment. ProvisioningOperationDeploymentCleanup ProvisioningOperation = "DeploymentCleanup" // ProvisioningOperationEvaluateDeploymentOutput - The provisioning operation is evaluate output. ProvisioningOperationEvaluateDeploymentOutput ProvisioningOperation = "EvaluateDeploymentOutput" // ProvisioningOperationNotSpecified - The provisioning operation is not specified. ProvisioningOperationNotSpecified ProvisioningOperation = "NotSpecified" // ProvisioningOperationRead - The provisioning operation is read. ProvisioningOperationRead ProvisioningOperation = "Read" // ProvisioningOperationResourceCacheWaiting - The provisioning operation is waiting for resource cache. ProvisioningOperationResourceCacheWaiting ProvisioningOperation = "ResourceCacheWaiting" // ProvisioningOperationWaiting - The provisioning operation is waiting. ProvisioningOperationWaiting ProvisioningOperation = "Waiting" ) // PossibleProvisioningOperationValues returns the possible values for the ProvisioningOperation const type. func PossibleProvisioningOperationValues() []ProvisioningOperation { return []ProvisioningOperation{ ProvisioningOperationAction, ProvisioningOperationAzureAsyncOperationWaiting, ProvisioningOperationCreate, ProvisioningOperationDelete, ProvisioningOperationDeploymentCleanup, ProvisioningOperationEvaluateDeploymentOutput, ProvisioningOperationNotSpecified, ProvisioningOperationRead, ProvisioningOperationResourceCacheWaiting, ProvisioningOperationWaiting, } } // ProvisioningState - Denotes the state of provisioning. type ProvisioningState string const ( ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreated ProvisioningState = "Created" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleted ProvisioningState = "Deleted" ProvisioningStateDeleting ProvisioningState = "Deleting" ProvisioningStateFailed ProvisioningState = "Failed" ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" ProvisioningStateReady ProvisioningState = "Ready" ProvisioningStateRunning ProvisioningState = "Running" ProvisioningStateSucceeded ProvisioningState = "Succeeded" ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreated, ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateNotSpecified, ProvisioningStateReady, ProvisioningStateRunning, ProvisioningStateSucceeded, ProvisioningStateUpdating, } } // ResourceIdentityType - The identity type. type ResourceIdentityType string const ( ResourceIdentityTypeNone ResourceIdentityType = "None" ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" ) // PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type. func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return []ResourceIdentityType{ ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned, } } // TagsPatchOperation - The operation type for the patch API. type TagsPatchOperation string const ( // TagsPatchOperationDelete - The 'delete' option allows selectively deleting tags based on given names or name/value pairs. TagsPatchOperationDelete TagsPatchOperation = "Delete" // TagsPatchOperationMerge - The 'merge' option allows adding tags with new names and updating the values of tags with existing // names. TagsPatchOperationMerge TagsPatchOperation = "Merge" // TagsPatchOperationReplace - The 'replace' option replaces the entire set of existing tags with a new set. TagsPatchOperationReplace TagsPatchOperation = "Replace" ) // PossibleTagsPatchOperationValues returns the possible values for the TagsPatchOperation const type. func PossibleTagsPatchOperationValues() []TagsPatchOperation { return []TagsPatchOperation{ TagsPatchOperationDelete, TagsPatchOperationMerge, TagsPatchOperationReplace, } } // WhatIfResultFormat - The format of the What-If results type WhatIfResultFormat string const ( WhatIfResultFormatFullResourcePayloads WhatIfResultFormat = "FullResourcePayloads" WhatIfResultFormatResourceIDOnly WhatIfResultFormat = "ResourceIdOnly" ) // PossibleWhatIfResultFormatValues returns the possible values for the WhatIfResultFormat const type. func PossibleWhatIfResultFormatValues() []WhatIfResultFormat { return []WhatIfResultFormat{ WhatIfResultFormatFullResourcePayloads, WhatIfResultFormatResourceIDOnly, } } ```
Blink FM (Blink for short) was a local FM and Online radio station run by Wycombe Youth Action which used to broadcast to areas of South Buckinghamshire in the United Kingdom and online through their website - areas of FM broadcast reception included High Wycombe, Hazlemere, Downley, Beaconsfield, Penn and the northern area of Marlow. History FM RSL broadcasts From 2002 to 2010 (inclusive) the station used to broadcast under a Restricted Service Licence (RSL) on 87.9 FM every August 1–28. Since the last RSL in August 2010, the frequency has also been used by local radio station Wycombe Sound for a few of their RSLs, where older members from the Blink team often went to continue their radio career. Online broadcasting When the station stopped FM broadcasting, it moved to online broadcasting through their website. This broadcast was intermittently available from August 2010 when the last RSL broadcast ended until 2012. In late August 2012, volunteers at the station made the online broadcast available 24/7 through the Blink FM website. However, since Wycombe Youth Action moved building in early 2016, the station no longer broadcasts online and now appears to have become an abandoned project. Live events In 2015, the volunteer team also held two separate and popular music events live, coined Blink Live and Blink Live 2, to raise money to buy new equipment for the station. The money raised was given to Wycombe Youth Action who managed the radio station, its equipment and volunteers. Broadcast information Blink FM's studio was based in High Wycombe, last based at the Apollo Center, also the home of Wycombe Youth Action. The team used high quality mixing desks and microphones to present the show live, aided by Myriad studio playlist software to cue the music. When a volunteer presenter (often part of Wycombe Youth Action) wasn't live, studio software broadcast an automatically generated playlist 24/7. During the FM broadcasts, radios in the local area around Blink could tune it to 87.9 FM to listen to the station live. An online broadcast was also available for some of the station's history, available via their website. References External links Official Blink FM Website (Archived Copy) Wycombe Youth Action Website Wycombe Youth Action Blink FM Page Radio stations in Buckinghamshire Organisations based in Buckinghamshire Radio stations established in 2002
La Paulée de Meursault is a lunch celebrating the end of the grape harvest in Burgundy, France. Originally, the celebration included only winemakers, cellar workers, and the surrounding community. It has since evolved to become an international wine event, and an integral part of Les Trois Glorieuses, which also includes a charity auction held at the Hospices de Beaune and a formal dinner at the Clos de Vougeot. Approximately 700 people attend the lunch, held in the Château de Meursault. The event was formally organized in the mid-1920s by the Count Lafon and Jacques Prieur. Traditionally, the winemakers would compete to bring the best bottle of wine to impress their favorite clients. In the modern era, Dominique Lafon, grandson of Count Lafon, participates in and helps organize the event. Other Paulées Since 2000, Daniel Johnnes has been hosting La Paulée de New York and La Paulée de San Francisco, which have been officially recognized by the organizers of the original La Paulée de Meursault. A celebration of the greatest wines of Burgundy, Johnnes' version of La Paulée features seminars, tastings, and wine-paired dinners, culminating in the Saturday Grand Tasting and Gala Dinner. Financial Times has asserted that La Paulée "can reasonably be described as the greatest Bacchanalia on the face of the earth". Etymology The name "La Paulée" comes from the French word for sauté pan, poile. In its earliest incarnations, the post-harvest meal was so simple that it was cooked in a single poile. References External links Official website for La Paulée de New York History of Burgundy Burgundy wine Wine-related events Food and drink festivals in France Wine festivals
```java /* * This Source Code Form is subject to the terms of the Mozilla Public * file, You can obtain one at path_to_url */ package com.vaticle.typedb.core.concept.type; import com.vaticle.typedb.core.common.iterator.sorted.SortedIterator.Forwardable; import com.vaticle.typedb.core.common.parameters.Order; import com.vaticle.typedb.core.common.parameters.Concept.Existence; import com.vaticle.typedb.core.common.parameters.Concept.Transitivity; import com.vaticle.typedb.core.concept.thing.Entity; public interface EntityType extends ThingType { @Override EntityType getSupertype(); @Override Forwardable<? extends EntityType, Order.Asc> getSupertypes(); @Override Forwardable<? extends EntityType, Order.Asc> getSubtypes(); @Override Forwardable<? extends EntityType, Order.Asc> getSubtypes(Transitivity transitivity); @Override Forwardable<? extends Entity, Order.Asc> getInstances(); @Override Forwardable<? extends Entity, Order.Asc> getInstances(Transitivity transitivity); void setSupertype(EntityType superType); Entity create(); Entity create(Existence existence); } ```
```shell #!/usr/bin/env bash # # # 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. # general values export PATH=$PATH:$LAB_DIR/bin: export HOME=~ # gke cluster values export C1_NAME="cluster" export C1_ZONE="us-central1-b" export C1_NODES=1 export C1_SCOPE="cloud-platform" export PROJECT_NUMBER=$(gcloud projects describe ${PROJECT_ID} \ --format="value(projectNumber)") export WORKLOAD_POOL=${PROJECT_ID}.svc.id.goog export MESH_ID="proj-${PROJECT_NUMBER}" gcloud config set compute/zone C1_ZONE ```
Princess Jully (real name Lilian Auma Aoka) is a benga musician from Kenya. Early life Lilian Auma Aoka was born in the village of Makalda in South Nyanza, in southwestern part of Kenya. Her father died when she was one week old, leaving her mother, a small-scale farmer, as the family's provider. Lilian was the youngest of nine children (six survived infancy). Her grandmother, Benta Nyar Kanyamkago Nyagolima, was the first woman chief in Nyanza Province and a respected singer and musician. Lilian attended school through Form One, the first year of secondary school in Kenya. On being a female in her village society, Jully has said: "Then something unfortunate happened my mother could not afford to pay my school fees. To make matters worse, most people within my community had the notion that educating a girl was like watering someone else's field, so boys were given the first priority. I was lucky to go up to Form One at Bikira Girls' High School as many girls in my village did not get the same opportunity, but deep down I remained frustrated." Lilian became pregnant out of wedlock at a young age, and was rejected by the father. She soon thereafter met her husband, singer Julius Okumu (stage name Prince Jully), who accepted her pregnancy. After giving birth to her son Felix, she began to accompany Jully's band as a backup singer. Career She started as a back-up vocalist for Jolly Boys Band led by her husband Prince Jully (Julius Okumu). She originally used the name "Mbilia Bel" "because I thought my looks were similar to the Zairean singer." Prince Jully died in 1997 and subsequently Princess Jully took over the leadership of the band. Jolly Boys Band was already a popular in Kenya when Prince Jully was leading it, but under Princess Jully the group has been even more successful, particularly after the release of the "Dunia Mbaya" hit. She releases new music frequently. Her 19th album "Aneno Lek" was released in March 2007. The album was produced at the Ketebul Productions by Tabu Osusa. Her next album Wangni Wabiro was released in August 2007. The title song of the album was dedicated to the Orange Democratic Movement ahead of the 2007 General Election. The album was produced by Tedd Josiah of Blu Zebra Studios. She has also set up her own production house, Jully Productions, to promote emerging artists. She has toured various countries including Switzerland. In 2010 she released another album Joluo Migingo to Dhi, its title refers to the disputed Migingo Island. Princess Jully was part of the Divas of The Nile supergroup, that featured four Kenyan female musicians. The others were Suzzana Owiyo, Achieng Abura and Mercy Myra. The group performed at the Festival Mundial in Tilburg, Netherlands, in 2007. Awards Won: 2003 Kisima Music Awards - Benga Artiste of the Year References 20th-century Kenyan women singers Living people 21st-century Kenyan women singers Bandleaders Year of birth missing (living people)
```javascript //! moment.js locale configuration //! locale : romanian (ro) //! author : Vlad Gurdiga : path_to_url //! author : Valentin Agachi : path_to_url ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment) }(this, function (moment) { 'use strict'; function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { 'mm': 'minute', 'hh': 'ore', 'dd': 'zile', 'MM': 'luni', 'yy': 'ani' }, separator = ' '; if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { separator = ' de '; } return number + separator + format[key]; } var ro = moment.defineLocale('ro', { months : your_sha256_hashrie_octombrie_noiembrie_decembrie'.split('_'), monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), monthsParseExact: true, weekdays : 'duminic_luni_mari_miercuri_joi_vineri_smbt'.split('_'), weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sm'.split('_'), weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_S'.split('_'), longDateFormat : { LT : 'H:mm', LTS : 'H:mm:ss', L : 'DD.MM.YYYY', LL : 'D MMMM YYYY', LLL : 'D MMMM YYYY H:mm', LLLL : 'dddd, D MMMM YYYY H:mm' }, calendar : { sameDay: '[azi la] LT', nextDay: '[mine la] LT', nextWeek: 'dddd [la] LT', lastDay: '[ieri la] LT', lastWeek: '[fosta] dddd [la] LT', sameElse: 'L' }, relativeTime : { future : 'peste %s', past : '%s n urm', s : 'cteva secunde', m : 'un minut', mm : relativeTimeWithPlural, h : 'o or', hh : relativeTimeWithPlural, d : 'o zi', dd : relativeTimeWithPlural, M : 'o lun', MM : relativeTimeWithPlural, y : 'un an', yy : relativeTimeWithPlural }, week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } }); return ro; })); ```
```java #parse("File Header.java") #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end ```
Ein Leben für Ungarn (A Life for Hungary) are the memoirs of Nikolaus von Horthy (also known as Miklós Horthy), Regent of Hungary. They were published in German under the name of Nikolaus von Horthy when he was exiled in Portugal after World War II. In his memoirs, Horthy recounted personal experiences from his youth until the end of World War II. He also claimed that he tried to perform the best actions and appoint the best officials in his country, and documented what he saw as mistreatment of Hungary by some other countries in the aftermath of World War I. References Political autobiographies 1953 non-fiction books
Juan Ernesto Chamorro Chitán (born 18 November 1991 in Pupiales) is a Colombian cyclist. Palmares 2012 2nd Overall Tour de l'Avenir 10th Overall Tour de l'Ain 2013 1st Overall Ronde de l'Isard References 1991 births Living people Colombian male cyclists 21st-century Colombian people
Noureddine Smaïl (born 6 February 1987) is an Algerian-born French athlete who specialises in middle and long-distance tracks as well as cross country. Born in Relizane, Algeria, Smaïl moved to France at a young age and began competing for his adopted country in 2006, taking part in the 2006 European Cross Country Championships (finishing 11th in the junior race), and the 2006 World Junior Championships in Athletics (reaching the 5000 m final). The 2007 season saw significant improvement as he took the 5000 m gold at the 2007 European Athletics U23 Championships. His progress stalled however in the following year, as he only managed 64th place in the U23 section of the 2008 European Cross Country Championships. Smaïl enjoyed U23 success in 2009 as he won the 5000 m silver medal at the 2009 European Athletics U23 Championships and took the individual and team gold in the U23 race at the 2009 European Cross Country Championships. He also made progress in the senior ranks, reaching the 5000 m final at the 2009 European Team Championships and competing in his first major European senior championships: the 2009 European Athletics Indoor Championships. Personal bests 800 m : 1:54.56 (2004) 1000 m : 2:24.33 (2007) 1500 m : 3:47.6 (2006) 3000 m : 7:53.34 (2009) 5000 m : 13:38.22 (2008) 10 km : 32:38 (2005) 10 km : 28:56.57 (2014) track 3000 m steeplechase : 9:01.96 (2006) Competition record He is also a two-time French champion in the 5000 m References External links Profile from French Athletics Association 1987 births Living people Algerian emigrants to France French male middle-distance runners French male long-distance runners French male steeplechase runners People from Relizane
```javascript (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 'use strict'; var KEYWORDS = [ 'multipleOf', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'additionalItems', 'maxItems', 'minItems', 'uniqueItems', 'maxProperties', 'minProperties', 'required', 'additionalProperties', 'enum', 'format', 'const' ]; module.exports = function (metaSchema, keywordsJsonPointers) { for (var i=0; i<keywordsJsonPointers.length; i++) { metaSchema = JSON.parse(JSON.stringify(metaSchema)); var segments = keywordsJsonPointers[i].split('/'); var keywords = metaSchema; var j; for (j=1; j<segments.length; j++) keywords = keywords[segments[j]]; for (j=0; j<KEYWORDS.length; j++) { var key = KEYWORDS[j]; var schema = keywords[key]; if (schema) { keywords[key] = { anyOf: [ schema, { $ref: 'path_to_url#' } ] }; } } } return metaSchema; }; },{}],2:[function(require,module,exports){ 'use strict'; var Cache = module.exports = function Cache() { this._cache = {}; }; Cache.prototype.put = function Cache_put(key, value) { this._cache[key] = value; }; Cache.prototype.get = function Cache_get(key) { return this._cache[key]; }; Cache.prototype.del = function Cache_del(key) { delete this._cache[key]; }; Cache.prototype.clear = function Cache_clear() { this._cache = {}; }; },{}],3:[function(require,module,exports){ 'use strict'; //all requires must be explicit because browserify won't work with dynamic requires module.exports = { '$ref': require('../dotjs/ref'), allOf: require('../dotjs/allOf'), anyOf: require('../dotjs/anyOf'), const: require('../dotjs/const'), contains: require('../dotjs/contains'), dependencies: require('../dotjs/dependencies'), 'enum': require('../dotjs/enum'), format: require('../dotjs/format'), items: require('../dotjs/items'), maximum: require('../dotjs/_limit'), minimum: require('../dotjs/_limit'), maxItems: require('../dotjs/_limitItems'), minItems: require('../dotjs/_limitItems'), maxLength: require('../dotjs/_limitLength'), minLength: require('../dotjs/_limitLength'), maxProperties: require('../dotjs/_limitProperties'), minProperties: require('../dotjs/_limitProperties'), multipleOf: require('../dotjs/multipleOf'), not: require('../dotjs/not'), oneOf: require('../dotjs/oneOf'), pattern: require('../dotjs/pattern'), properties: require('../dotjs/properties'), propertyNames: require('../dotjs/propertyNames'), required: require('../dotjs/required'), uniqueItems: require('../dotjs/uniqueItems'), validate: require('../dotjs/validate') }; },{"../dotjs/_limit":13,"../dotjs/_limitItems":14,"../dotjs/_limitLength":15,"../dotjs/_limitProperties":16,"../dotjs/allOf":17,"../dotjs/anyOf":18,"../dotjs/const":19,"../dotjs/contains":20,"../dotjs/dependencies":22,"../dotjs/enum":23,"../dotjs/format":24,"../dotjs/items":25,"../dotjs/multipleOf":26,"../dotjs/not":27,"../dotjs/oneOf":28,"../dotjs/pattern":29,"../dotjs/properties":30,"../dotjs/propertyNames":31,"../dotjs/ref":32,"../dotjs/required":33,"../dotjs/uniqueItems":34,"../dotjs/validate":35}],4:[function(require,module,exports){ 'use strict'; var MissingRefError = require('./error_classes').MissingRef; module.exports = compileAsync; /** * Creates validating function for passed schema with asynchronous loading of missing schemas. * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. * @return {Promise} promise that resolves with a validating function. */ function compileAsync(schema, meta, callback) { /* eslint no-shadow: 0 */ /* global Promise */ /* jshint validthis: true */ var self = this; if (typeof this._opts.loadSchema != 'function') throw new Error('options.loadSchema should be a function'); if (typeof meta == 'function') { callback = meta; meta = undefined; } var p = loadMetaSchemaOf(schema).then(function () { var schemaObj = self._addSchema(schema, undefined, meta); return schemaObj.validate || _compileAsync(schemaObj); }); if (callback) { p.then( function(v) { callback(null, v); }, callback ); } return p; function loadMetaSchemaOf(sch) { var $schema = sch.$schema; return $schema && !self.getSchema($schema) ? compileAsync.call(self, { $ref: $schema }, true) : Promise.resolve(); } function _compileAsync(schemaObj) { try { return self._compile(schemaObj); } catch(e) { if (e instanceof MissingRefError) return loadMissingSchema(e); throw e; } function loadMissingSchema(e) { var ref = e.missingSchema; if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); var schemaPromise = self._loadingSchemas[ref]; if (!schemaPromise) { schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); schemaPromise.then(removePromise, removePromise); } return schemaPromise.then(function (sch) { if (!added(ref)) { return loadMetaSchemaOf(sch).then(function () { if (!added(ref)) self.addSchema(sch, ref, undefined, meta); }); } }).then(function() { return _compileAsync(schemaObj); }); function removePromise() { delete self._loadingSchemas[ref]; } function added(ref) { return self._refs[ref] || self._schemas[ref]; } } } } },{"./error_classes":5}],5:[function(require,module,exports){ 'use strict'; var resolve = require('./resolve'); module.exports = { Validation: errorSubclass(ValidationError), MissingRef: errorSubclass(MissingRefError) }; function ValidationError(errors) { this.message = 'validation failed'; this.errors = errors; this.ajv = this.validation = true; } MissingRefError.message = function (baseId, ref) { return 'can\'t resolve reference ' + ref + ' from id ' + baseId; }; function MissingRefError(baseId, ref, message) { this.message = message || MissingRefError.message(baseId, ref); this.missingRef = resolve.url(baseId, ref); this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); } function errorSubclass(Subclass) { Subclass.prototype = Object.create(Error.prototype); Subclass.prototype.constructor = Subclass; return Subclass; } },{"./resolve":8}],6:[function(require,module,exports){ 'use strict'; var util = require('./util'); var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/; var DAYS = [0,31,29,31,30,31,30,31,31,30,31,30,31]; var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; // uri-template: path_to_url var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; // For the source: path_to_url // For test cases: path_to_url // @todo Delete current URL in favour of the commented out URL rule when this issue is fixed path_to_url // var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; module.exports = formats; function formats(mode) { mode = mode == 'full' ? 'full' : 'fast'; return util.copy(formats[mode]); } formats.fast = { // date: path_to_url#section-5.6 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, // date-time: path_to_url#section-5.6 time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, // uri: path_to_url uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i, 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i, 'uri-template': URITEMPLATE, url: URL, // email (sources from jsen validator): // path_to_url#answer-8829363 // path_to_url#valid-e-mail-address (search for 'willful violation') email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, hostname: HOSTNAME, // optimized path_to_url ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, // optimized path_to_url ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, // uuid: path_to_url uuid: UUID, // JSON-pointer: path_to_url // uri fragment: path_to_url#appendix-A 'json-pointer': JSON_POINTER, // relative JSON-pointer: path_to_url 'relative-json-pointer': RELATIVE_JSON_POINTER }; formats.full = { date: date, time: time, 'date-time': date_time, uri: uri, 'uri-reference': URIREF, 'uri-template': URITEMPLATE, url: URL, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: hostname, ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, regex: regex, uuid: UUID, 'json-pointer': JSON_POINTER, 'relative-json-pointer': RELATIVE_JSON_POINTER }; function date(str) { // full-date from path_to_url#section-5.6 var matches = str.match(DATE); if (!matches) return false; var month = +matches[1]; var day = +matches[2]; return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; } function time(str, full) { var matches = str.match(TIME); if (!matches) return false; var hour = matches[1]; var minute = matches[2]; var second = matches[3]; var timeZone = matches[5]; return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); } var DATE_TIME_SEPARATOR = /t|\s/i; function date_time(str) { // path_to_url#section-5.6 var dateTime = str.split(DATE_TIME_SEPARATOR); return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); } function hostname(str) { // path_to_url#section-3.5 // path_to_url#section-2 return str.length <= 255 && HOSTNAME.test(str); } var NOT_URI_FRAGMENT = /\/|:/; function uri(str) { // path_to_url + optional protocol + required "." return NOT_URI_FRAGMENT.test(str) && URI.test(str); } var Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return false; try { new RegExp(str); return true; } catch(e) { return false; } } },{"./util":12}],7:[function(require,module,exports){ 'use strict'; var resolve = require('./resolve') , util = require('./util') , errorClasses = require('./error_classes') , stableStringify = require('fast-json-stable-stringify'); var validateGenerator = require('../dotjs/validate'); /** * Functions below are used inside compiled validations function */ var co = require('co'); var ucs2length = util.ucs2length; var equal = require('fast-deep-equal'); // this error is thrown by async schemas to return validation errors via exception var ValidationError = errorClasses.Validation; module.exports = compile; /** * Compiles schema to validation function * @this Ajv * @param {Object} schema schema object * @param {Object} root object with information about the root schema for this schema * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution * @param {String} baseId base ID for IDs in the schema * @return {Function} validation function */ function compile(schema, root, localRefs, baseId) { /* jshint validthis: true, evil: true */ /* eslint no-shadow: 0 */ var self = this , opts = this._opts , refVal = [ undefined ] , refs = {} , patterns = [] , patternsHash = {} , defaults = [] , defaultsHash = {} , customRules = []; root = root || { schema: schema, refVal: refVal, refs: refs }; var c = checkCompiling.call(this, schema, root, baseId); var compilation = this._compilations[c.index]; if (c.compiling) return (compilation.callValidate = callValidate); var formats = this._formats; var RULES = this.RULES; try { var v = localCompile(schema, root, localRefs, baseId); compilation.validate = v; var cv = compilation.callValidate; if (cv) { cv.schema = v.schema; cv.errors = null; cv.refs = v.refs; cv.refVal = v.refVal; cv.root = v.root; cv.$async = v.$async; if (opts.sourceCode) cv.source = v.source; } return v; } finally { endCompiling.call(this, schema, root, baseId); } function callValidate() { var validate = compilation.validate; var result = validate.apply(null, arguments); callValidate.errors = validate.errors; return result; } function localCompile(_schema, _root, localRefs, baseId) { var isRoot = !_root || (_root && _root.schema == _schema); if (_root.schema != root.schema) return compile.call(self, _schema, _root, localRefs, baseId); var $async = _schema.$async === true; var sourceCode = validateGenerator({ isTop: true, schema: _schema, isRoot: isRoot, baseId: baseId, root: _root, schemaPath: '', errSchemaPath: '#', errorPath: '""', MissingRefError: errorClasses.MissingRef, RULES: RULES, validate: validateGenerator, util: util, resolve: resolve, resolveRef: resolveRef, usePattern: usePattern, useDefault: useDefault, useCustomRule: useCustomRule, opts: opts, formats: formats, logger: self.logger, self: self }); sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + sourceCode; if (opts.processCode) sourceCode = opts.processCode(sourceCode); // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); var validate; try { var makeValidate = new Function( 'self', 'RULES', 'formats', 'root', 'refVal', 'defaults', 'customRules', 'co', 'equal', 'ucs2length', 'ValidationError', sourceCode ); validate = makeValidate( self, RULES, formats, root, refVal, defaults, customRules, co, equal, ucs2length, ValidationError ); refVal[0] = validate; } catch(e) { self.logger.error('Error compiling schema, function code:', sourceCode); throw e; } validate.schema = _schema; validate.errors = null; validate.refs = refs; validate.refVal = refVal; validate.root = isRoot ? validate : _root; if ($async) validate.$async = true; if (opts.sourceCode === true) { validate.source = { code: sourceCode, patterns: patterns, defaults: defaults }; } return validate; } function resolveRef(baseId, ref, isRoot) { ref = resolve.url(baseId, ref); var refIndex = refs[ref]; var _refVal, refCode; if (refIndex !== undefined) { _refVal = refVal[refIndex]; refCode = 'refVal[' + refIndex + ']'; return resolvedRef(_refVal, refCode); } if (!isRoot && root.refs) { var rootRefId = root.refs[ref]; if (rootRefId !== undefined) { _refVal = root.refVal[rootRefId]; refCode = addLocalRef(ref, _refVal); return resolvedRef(_refVal, refCode); } } refCode = addLocalRef(ref); var v = resolve.call(self, localCompile, root, ref); if (v === undefined) { var localSchema = localRefs && localRefs[ref]; if (localSchema) { v = resolve.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self, localSchema, root, localRefs, baseId); } } if (v === undefined) { removeLocalRef(ref); } else { replaceLocalRef(ref, v); return resolvedRef(v, refCode); } } function addLocalRef(ref, v) { var refId = refVal.length; refVal[refId] = v; refs[ref] = refId; return 'refVal' + refId; } function removeLocalRef(ref) { delete refs[ref]; } function replaceLocalRef(ref, v) { var refId = refs[ref]; refVal[refId] = v; } function resolvedRef(refVal, code) { return typeof refVal == 'object' || typeof refVal == 'boolean' ? { code: code, schema: refVal, inline: true } : { code: code, $async: refVal && refVal.$async }; } function usePattern(regexStr) { var index = patternsHash[regexStr]; if (index === undefined) { index = patternsHash[regexStr] = patterns.length; patterns[index] = regexStr; } return 'pattern' + index; } function useDefault(value) { switch (typeof value) { case 'boolean': case 'number': return '' + value; case 'string': return util.toQuotedString(value); case 'object': if (value === null) return 'null'; var valueStr = stableStringify(value); var index = defaultsHash[valueStr]; if (index === undefined) { index = defaultsHash[valueStr] = defaults.length; defaults[index] = value; } return 'default' + index; } } function useCustomRule(rule, schema, parentSchema, it) { var validateSchema = rule.definition.validateSchema; if (validateSchema && self._opts.validateSchema !== false) { var valid = validateSchema(schema); if (!valid) { var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); if (self._opts.validateSchema == 'log') self.logger.error(message); else throw new Error(message); } } var compile = rule.definition.compile , inline = rule.definition.inline , macro = rule.definition.macro; var validate; if (compile) { validate = compile.call(self, schema, parentSchema, it); } else if (macro) { validate = macro.call(self, schema, parentSchema, it); if (opts.validateSchema !== false) self.validateSchema(validate, true); } else if (inline) { validate = inline.call(self, it, rule.keyword, schema, parentSchema); } else { validate = rule.definition.validate; if (!validate) return; } if (validate === undefined) throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); var index = customRules.length; customRules[index] = validate; return { code: 'customRule' + index, validate: validate }; } } /** * Checks if the schema is currently compiled * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) */ function checkCompiling(schema, root, baseId) { /* jshint validthis: true */ var index = compIndex.call(this, schema, root, baseId); if (index >= 0) return { index: index, compiling: true }; index = this._compilations.length; this._compilations[index] = { schema: schema, root: root, baseId: baseId }; return { index: index, compiling: false }; } /** * Removes the schema from the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID */ function endCompiling(schema, root, baseId) { /* jshint validthis: true */ var i = compIndex.call(this, schema, root, baseId); if (i >= 0) this._compilations.splice(i, 1); } /** * Index of schema compilation in the currently compiled list * @this Ajv * @param {Object} schema schema to compile * @param {Object} root root object * @param {String} baseId base schema ID * @return {Integer} compilation index */ function compIndex(schema, root, baseId) { /* jshint validthis: true */ for (var i=0; i<this._compilations.length; i++) { var c = this._compilations[i]; if (c.schema == schema && c.root == root && c.baseId == baseId) return i; } return -1; } function patternCode(i, patterns) { return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');'; } function defaultCode(i) { return 'var default' + i + ' = defaults[' + i + '];'; } function refValCode(i, refVal) { return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];'; } function customRuleCode(i) { return 'var customRule' + i + ' = customRules[' + i + '];'; } function vars(arr, statement) { if (!arr.length) return ''; var code = ''; for (var i=0; i<arr.length; i++) code += statement(i, arr); return code; } },{"../dotjs/validate":35,"./error_classes":5,"./resolve":8,"./util":12,"co":40,"fast-deep-equal":41,"fast-json-stable-stringify":42}],8:[function(require,module,exports){ 'use strict'; var url = require('url') , equal = require('fast-deep-equal') , util = require('./util') , SchemaObject = require('./schema_obj') , traverse = require('json-schema-traverse'); module.exports = resolve; resolve.normalizeId = normalizeId; resolve.fullPath = getFullPath; resolve.url = resolveUrl; resolve.ids = resolveIds; resolve.inlineRef = inlineRef; resolve.schema = resolveSchema; /** * [resolve and compile the references ($ref)] * @this Ajv * @param {Function} compile reference to schema compilation funciton (localCompile) * @param {Object} root object with information about the root schema for the current schema * @param {String} ref reference to resolve * @return {Object|Function} schema object (if the schema can be inlined) or validation function */ function resolve(compile, root, ref) { /* jshint validthis: true */ var refVal = this._refs[ref]; if (typeof refVal == 'string') { if (this._refs[refVal]) refVal = this._refs[refVal]; else return resolve.call(this, compile, root, refVal); } refVal = refVal || this._schemas[ref]; if (refVal instanceof SchemaObject) { return inlineRef(refVal.schema, this._opts.inlineRefs) ? refVal.schema : refVal.validate || this._compile(refVal); } var res = resolveSchema.call(this, root, ref); var schema, v, baseId; if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } if (schema instanceof SchemaObject) { v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); } else if (schema !== undefined) { v = inlineRef(schema, this._opts.inlineRefs) ? schema : compile.call(this, schema, root, undefined, baseId); } return v; } /** * Resolve schema, its root and baseId * @this Ajv * @param {Object} root root object with properties schema, refVal, refs * @param {String} ref reference to resolve * @return {Object} object with properties schema, root, baseId */ function resolveSchema(root, ref) { /* jshint validthis: true */ var p = url.parse(ref, false, true) , refPath = _getFullPath(p) , baseId = getFullPath(this._getId(root.schema)); if (refPath !== baseId) { var id = normalizeId(refPath); var refVal = this._refs[id]; if (typeof refVal == 'string') { return resolveRecursive.call(this, root, refVal, p); } else if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); root = refVal; } else { refVal = this._schemas[id]; if (refVal instanceof SchemaObject) { if (!refVal.validate) this._compile(refVal); if (id == normalizeId(ref)) return { schema: refVal, root: root, baseId: baseId }; root = refVal; } else { return; } } if (!root.schema) return; baseId = getFullPath(this._getId(root.schema)); } return getJsonPointer.call(this, p, baseId, root.schema, root); } /* @this Ajv */ function resolveRecursive(root, ref, parsedRef) { /* jshint validthis: true */ var res = resolveSchema.call(this, root, ref); if (res) { var schema = res.schema; var baseId = res.baseId; root = res.root; var id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); return getJsonPointer.call(this, parsedRef, baseId, schema, root); } } var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); /* @this Ajv */ function getJsonPointer(parsedRef, baseId, schema, root) { /* jshint validthis: true */ parsedRef.hash = parsedRef.hash || ''; if (parsedRef.hash.slice(0,2) != '#/') return; var parts = parsedRef.hash.split('/'); for (var i = 1; i < parts.length; i++) { var part = parts[i]; if (part) { part = util.unescapeFragment(part); schema = schema[part]; if (schema === undefined) break; var id; if (!PREVENT_SCOPE_CHANGE[part]) { id = this._getId(schema); if (id) baseId = resolveUrl(baseId, id); if (schema.$ref) { var $ref = resolveUrl(baseId, schema.$ref); var res = resolveSchema.call(this, root, $ref); if (res) { schema = res.schema; root = res.root; baseId = res.baseId; } } } } } if (schema !== undefined && schema !== root.schema) return { schema: schema, root: root, baseId: baseId }; } var SIMPLE_INLINED = util.toHash([ 'type', 'format', 'pattern', 'maxLength', 'minLength', 'maxProperties', 'minProperties', 'maxItems', 'minItems', 'maximum', 'minimum', 'uniqueItems', 'multipleOf', 'required', 'enum' ]); function inlineRef(schema, limit) { if (limit === false) return false; if (limit === undefined || limit === true) return checkNoRef(schema); else if (limit) return countKeys(schema) <= limit; } function checkNoRef(schema) { var item; if (Array.isArray(schema)) { for (var i=0; i<schema.length; i++) { item = schema[i]; if (typeof item == 'object' && !checkNoRef(item)) return false; } } else { for (var key in schema) { if (key == '$ref') return false; item = schema[key]; if (typeof item == 'object' && !checkNoRef(item)) return false; } } return true; } function countKeys(schema) { var count = 0, item; if (Array.isArray(schema)) { for (var i=0; i<schema.length; i++) { item = schema[i]; if (typeof item == 'object') count += countKeys(item); if (count == Infinity) return Infinity; } } else { for (var key in schema) { if (key == '$ref') return Infinity; if (SIMPLE_INLINED[key]) { count++; } else { item = schema[key]; if (typeof item == 'object') count += countKeys(item) + 1; if (count == Infinity) return Infinity; } } } return count; } function getFullPath(id, normalize) { if (normalize !== false) id = normalizeId(id); var p = url.parse(id, false, true); return _getFullPath(p); } function _getFullPath(p) { var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : ''; return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'') + '#'; } var TRAILING_SLASH_HASH = /#\/?$/; function normalizeId(id) { return id ? id.replace(TRAILING_SLASH_HASH, '') : ''; } function resolveUrl(baseId, id) { id = normalizeId(id); return url.resolve(baseId, id); } /* @this Ajv */ function resolveIds(schema) { var schemaId = normalizeId(this._getId(schema)); var baseIds = {'': schemaId}; var fullPaths = {'': getFullPath(schemaId, false)}; var localRefs = {}; var self = this; traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (jsonPtr === '') return; var id = self._getId(sch); var baseId = baseIds[parentJsonPtr]; var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword; if (keyIndex !== undefined) fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex)); if (typeof id == 'string') { id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id); var refVal = self._refs[id]; if (typeof refVal == 'string') refVal = self._refs[refVal]; if (refVal && refVal.schema) { if (!equal(sch, refVal.schema)) throw new Error('id "' + id + '" resolves to more than one schema'); } else if (id != normalizeId(fullPath)) { if (id[0] == '#') { if (localRefs[id] && !equal(sch, localRefs[id])) throw new Error('id "' + id + '" resolves to more than one schema'); localRefs[id] = sch; } else { self._refs[id] = fullPath; } } } baseIds[jsonPtr] = baseId; fullPaths[jsonPtr] = fullPath; }); return localRefs; } },{"./schema_obj":10,"./util":12,"fast-deep-equal":41,"json-schema-traverse":43,"url":48}],9:[function(require,module,exports){ 'use strict'; var ruleModules = require('./_rules') , toHash = require('./util').toHash; module.exports = function rules() { var RULES = [ { type: 'number', rules: [ { 'maximum': ['exclusiveMaximum'] }, { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] }, { type: 'string', rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] }, { type: 'array', rules: [ 'maxItems', 'minItems', 'uniqueItems', 'contains', 'items' ] }, { type: 'object', rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames', { 'properties': ['additionalProperties', 'patternProperties'] } ] }, { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] } ]; var ALL = [ 'type' ]; var KEYWORDS = [ 'additionalItems', '$schema', '$id', 'id', 'title', 'description', 'default', 'definitions' ]; var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ]; RULES.all = toHash(ALL); RULES.types = toHash(TYPES); RULES.forEach(function (group) { group.rules = group.rules.map(function (keyword) { var implKeywords; if (typeof keyword == 'object') { var key = Object.keys(keyword)[0]; implKeywords = keyword[key]; keyword = key; implKeywords.forEach(function (k) { ALL.push(k); RULES.all[k] = true; }); } ALL.push(keyword); var rule = RULES.all[keyword] = { keyword: keyword, code: ruleModules[keyword], implements: implKeywords }; return rule; }); if (group.type) RULES.types[group.type] = group; }); RULES.keywords = toHash(ALL.concat(KEYWORDS)); RULES.custom = {}; return RULES; }; },{"./_rules":3,"./util":12}],10:[function(require,module,exports){ 'use strict'; var util = require('./util'); module.exports = SchemaObject; function SchemaObject(obj) { util.copy(obj, this); } },{"./util":12}],11:[function(require,module,exports){ 'use strict'; // path_to_url // path_to_url - punycode.ucs2.decode module.exports = function ucs2length(str) { var length = 0 , len = str.length , pos = 0 , value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xD800 && value <= 0xDBFF && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate } } return length; }; },{}],12:[function(require,module,exports){ 'use strict'; module.exports = { copy: copy, checkDataType: checkDataType, checkDataTypes: checkDataTypes, coerceToTypes: coerceToTypes, toHash: toHash, getProperty: getProperty, escapeQuotes: escapeQuotes, equal: require('fast-deep-equal'), ucs2length: require('./ucs2length'), varOccurences: varOccurences, varReplace: varReplace, cleanUpCode: cleanUpCode, finalCleanUpCode: finalCleanUpCode, schemaHasRules: schemaHasRules, schemaHasRulesExcept: schemaHasRulesExcept, toQuotedString: toQuotedString, getPathExpr: getPathExpr, getPath: getPath, getData: getData, unescapeFragment: unescapeFragment, unescapeJsonPointer: unescapeJsonPointer, escapeFragment: escapeFragment, escapeJsonPointer: escapeJsonPointer }; function copy(o, to) { to = to || {}; for (var key in o) to[key] = o[key]; return to; } function checkDataType(dataType, data, negate) { var EQUAL = negate ? ' !== ' : ' === ' , AND = negate ? ' || ' : ' && ' , OK = negate ? '!' : '' , NOT = negate ? '' : '!'; switch (dataType) { case 'null': return data + EQUAL + 'null'; case 'array': return OK + 'Array.isArray(' + data + ')'; case 'object': return '(' + OK + data + AND + 'typeof ' + data + EQUAL + '"object"' + AND + NOT + 'Array.isArray(' + data + '))'; case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + NOT + '(' + data + ' % 1)' + AND + data + EQUAL + data + ')'; default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; } } function checkDataTypes(dataTypes, data) { switch (dataTypes.length) { case 1: return checkDataType(dataTypes[0], data, true); default: var code = ''; var types = toHash(dataTypes); if (types.array && types.object) { code = types.null ? '(': '(!' + data + ' || '; code += 'typeof ' + data + ' !== "object")'; delete types.null; delete types.array; delete types.object; } if (types.number) delete types.integer; for (var t in types) code += (code ? ' && ' : '' ) + checkDataType(t, data, true); return code; } } var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); function coerceToTypes(optionCoerceTypes, dataTypes) { if (Array.isArray(dataTypes)) { var types = []; for (var i=0; i<dataTypes.length; i++) { var t = dataTypes[i]; if (COERCE_TO_TYPES[t]) types[types.length] = t; else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t; } if (types.length) return types; } else if (COERCE_TO_TYPES[dataTypes]) { return [dataTypes]; } else if (optionCoerceTypes === 'array' && dataTypes === 'array') { return ['array']; } } function toHash(arr) { var hash = {}; for (var i=0; i<arr.length; i++) hash[arr[i]] = true; return hash; } var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; var SINGLE_QUOTE = /'|\\/g; function getProperty(key) { return typeof key == 'number' ? '[' + key + ']' : IDENTIFIER.test(key) ? '.' + key : "['" + escapeQuotes(key) + "']"; } function escapeQuotes(str) { return str.replace(SINGLE_QUOTE, '\\$&') .replace(/\n/g, '\\n') .replace(/\r/g, '\\r') .replace(/\f/g, '\\f') .replace(/\t/g, '\\t'); } function varOccurences(str, dataVar) { dataVar += '[^0-9]'; var matches = str.match(new RegExp(dataVar, 'g')); return matches ? matches.length : 0; } function varReplace(str, dataVar, expr) { dataVar += '([^0-9])'; expr = expr.replace(/\$/g, '$$$$'); return str.replace(new RegExp(dataVar, 'g'), expr + '$1'); } var EMPTY_ELSE = /else\s*{\s*}/g , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g; function cleanUpCode(out) { return out.replace(EMPTY_ELSE, '') .replace(EMPTY_IF_NO_ELSE, '') .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))'); } var ERRORS_REGEXP = /[^v.]errors/g , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g , RETURN_VALID = 'return errors === 0;' , RETURN_TRUE = 'validate.errors = null; return true;' , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/ , RETURN_DATA_ASYNC = 'return data;' , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; function finalCleanUpCode(out, async) { var matches = out.match(ERRORS_REGEXP); if (matches && matches.length == 2) { out = async ? out.replace(REMOVE_ERRORS_ASYNC, '') .replace(RETURN_ASYNC, RETURN_DATA_ASYNC) : out.replace(REMOVE_ERRORS, '') .replace(RETURN_VALID, RETURN_TRUE); } matches = out.match(ROOTDATA_REGEXP); if (!matches || matches.length !== 3) return out; return out.replace(REMOVE_ROOTDATA, ''); } function schemaHasRules(schema, rules) { if (typeof schema == 'boolean') return !schema; for (var key in schema) if (rules[key]) return true; } function schemaHasRulesExcept(schema, rules, exceptKeyword) { if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not'; for (var key in schema) if (key != exceptKeyword && rules[key]) return true; } function toQuotedString(str) { return '\'' + escapeQuotes(str) + '\''; } function getPathExpr(currentPath, expr, jsonPointers, isNumber) { var path = jsonPointers // false by default ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')') : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\''); return joinPaths(currentPath, path); } function getPath(currentPath, prop, jsonPointers) { var path = jsonPointers // false by default ? toQuotedString('/' + escapeJsonPointer(prop)) : toQuotedString(getProperty(prop)); return joinPaths(currentPath, path); } var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function getData($data, lvl, paths) { var up, jsonPointer, data, matches; if ($data === '') return 'rootData'; if ($data[0] == '/') { if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data); jsonPointer = $data; data = 'rootData'; } else { matches = $data.match(RELATIVE_JSON_POINTER); if (!matches) throw new Error('Invalid JSON-pointer: ' + $data); up = +matches[1]; jsonPointer = matches[2]; if (jsonPointer == '#') { if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); return paths[lvl - up]; } if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); data = 'data' + ((lvl - up) || ''); if (!jsonPointer) return data; } var expr = data; var segments = jsonPointer.split('/'); for (var i=0; i<segments.length; i++) { var segment = segments[i]; if (segment) { data += getProperty(unescapeJsonPointer(segment)); expr += ' && ' + data; } } return expr; } function joinPaths (a, b) { if (a == '""') return b; return (a + ' + ' + b).replace(/' \+ '/g, ''); } function unescapeFragment(str) { return unescapeJsonPointer(decodeURIComponent(str)); } function escapeFragment(str) { return encodeURIComponent(escapeJsonPointer(str)); } function escapeJsonPointer(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } function unescapeJsonPointer(str) { return str.replace(/~1/g, '/').replace(/~0/g, '~'); } },{"./ucs2length":11,"fast-deep-equal":41}],13:[function(require,module,exports){ 'use strict'; module.exports = function generate__limit(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $isMax = $keyword == 'maximum', $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', $schemaExcl = it.schema[$exclusiveKeyword], $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, $op = $isMax ? '<' : '>', $notOp = $isMax ? '>' : '<', $errorKeyword = undefined; if ($isDataExcl) { var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), $exclusive = 'exclusive' + $lvl, $exclType = 'exclType' + $lvl, $exclIsNumber = 'exclIsNumber' + $lvl, $opExpr = 'op' + $lvl, $opStr = '\' + ' + $opExpr + ' + \''; out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; $schemaValueExcl = 'schemaExcl' + $lvl; out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; var $errorKeyword = $exclusiveKeyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; } else { var $exclIsNumber = typeof $schemaExcl == 'number', $opStr = $op; if ($exclIsNumber && $isData) { var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; } else { if ($exclIsNumber && $schema === undefined) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $schemaValue = $schemaExcl; $notOp += '='; } else { if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { $exclusive = true; $errorKeyword = $exclusiveKeyword; $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; $notOp += '='; } else { $exclusive = false; $opStr += '='; } } var $opExpr = '\'' + $opStr + '\''; out += ' if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; } } $errorKeyword = $errorKeyword || $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be ' + ($opStr) + ' '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } },{}],14:[function(require,module,exports){ 'use strict'; module.exports = function generate__limitItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxItems' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxItems') { out += 'more'; } else { out += 'less'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' items\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } },{}],15:[function(require,module,exports){ 'use strict'; module.exports = function generate__limitLength(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxLength' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } if (it.opts.unicode === false) { out += ' ' + ($data) + '.length '; } else { out += ' ucs2length(' + ($data) + ') '; } out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be '; if ($keyword == 'maxLength') { out += 'longer'; } else { out += 'shorter'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' characters\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } },{}],16:[function(require,module,exports){ 'use strict'; module.exports = function generate__limitProperties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $op = $keyword == 'maxProperties' ? '>' : '<'; out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; } out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; var $errorKeyword = $keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have '; if ($keyword == 'maxProperties') { out += 'more'; } else { out += 'less'; } out += ' than '; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + ($schema); } out += ' properties\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } },{}],17:[function(require,module,exports){ 'use strict'; module.exports = function generate_allOf(it, $keyword, $ruleType) { var out = ' '; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $currentBaseId = $it.baseId, $allSchemasEmpty = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if (it.util.schemaHasRules($sch, it.RULES.all)) { $allSchemasEmpty = false; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($breakOnError) { if ($allSchemasEmpty) { out += ' if (true) { '; } else { out += ' ' + ($closingBraces.slice(0, -1)) + ' '; } } out = it.util.cleanUpCode(out); return out; } },{}],18:[function(require,module,exports){ 'use strict'; module.exports = function generate_anyOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $noEmptySchema = $schema.every(function($sch) { return it.util.schemaHasRules($sch, it.RULES.all); }); if ($noEmptySchema) { var $currentBaseId = $it.baseId; out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; $closingBraces += '}'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should match some schema in anyOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } out = it.util.cleanUpCode(out); } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } },{}],19:[function(require,module,exports){ 'use strict'; module.exports = function generate_const(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (!$isData) { out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to constant\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } },{}],20:[function(require,module,exports){ 'use strict'; module.exports = function generate_contains(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId, $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($nonEmptySchema) { var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (' + ($nextValid) + ') break; } '; it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; } else { out += ' if (' + ($data) + '.length == 0) {'; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should contain a valid item\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; if ($nonEmptySchema) { out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; } if (it.opts.allErrors) { out += ' } '; } out = it.util.cleanUpCode(out); return out; } },{}],21:[function(require,module,exports){ 'use strict'; module.exports = function generate_custom(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $rule = this, $definition = 'definition' + $lvl, $rDef = $rule.definition, $closingBraces = ''; var $compile, $inline, $macro, $ruleValidate, $validateCode; if ($isData && $rDef.$data) { $validateCode = 'keywordValidate' + $lvl; var $validateSchema = $rDef.validateSchema; out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; } else { $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); if (!$ruleValidate) return; $schemaValue = 'validate.schema' + $schemaPath; $validateCode = $ruleValidate.code; $compile = $rDef.compile; $inline = $rDef.inline; $macro = $rDef.macro; } var $ruleErrs = $validateCode + '.errors', $i = 'i' + $lvl, $ruleErr = 'ruleErr' + $lvl, $asyncKeyword = $rDef.async; if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); if (!($inline || $macro)) { out += '' + ($ruleErrs) + ' = null;'; } out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if ($isData && $rDef.$data) { $closingBraces += '}'; out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; if ($validateSchema) { $closingBraces += '}'; out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; } } if ($inline) { if ($rDef.statements) { out += ' ' + ($ruleValidate.validate) + ' '; } else { out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; } } else if ($macro) { var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $ruleValidate.validate; $it.schemaPath = ''; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); it.compositeRule = $it.compositeRule = $wasComposite; out += ' ' + ($code); } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; out += ' ' + ($validateCode) + '.call( '; if (it.opts.passContext) { out += 'this'; } else { out += 'self'; } if ($compile || $rDef.schema === false) { out += ' , ' + ($data) + ' '; } else { out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; } out += ' , (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; var def_callRuleValidate = out; out = $$outStack.pop(); if ($rDef.errors === false) { out += ' ' + ($valid) + ' = '; if ($asyncKeyword) { out += '' + (it.yieldAwait); } out += '' + (def_callRuleValidate) + '; '; } else { if ($asyncKeyword) { $ruleErrs = 'customErrors' + $lvl; out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; } else { out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; } } } if ($rDef.modifying) { out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; } out += '' + ($closingBraces); if ($rDef.valid) { if ($breakOnError) { out += ' if (true) { '; } } else { out += ' if ( '; if ($rDef.valid === undefined) { out += ' !'; if ($macro) { out += '' + ($nextValid); } else { out += '' + ($valid); } } else { out += ' ' + (!$rDef.valid) + ' '; } out += ') { '; $errorKeyword = $rule.keyword; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } var def_customError = out; out = $$outStack.pop(); if ($inline) { if ($rDef.errors) { if ($rDef.errors != 'full') { out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } '; } } else { if ($rDef.errors === false) { out += ' ' + (def_customError) + ' '; } else { out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } } '; } } } else if ($macro) { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } } else { if ($rDef.errors === false) { out += ' ' + (def_customError) + ' '; } else { out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; '; if (it.opts.verbose) { out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; '; } out += ' } } else { ' + (def_customError) + ' } '; } } out += ' } '; if ($breakOnError) { out += ' else { '; } } return out; } },{}],22:[function(require,module,exports){ 'use strict'; module.exports = function generate_dependencies(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $schemaDeps = {}, $propertyDeps = {}, $ownProperties = it.opts.ownProperties; for ($property in $schema) { var $sch = $schema[$property]; var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; $deps[$property] = $sch; } out += 'var ' + ($errs) + ' = errors;'; var $currentErrorPath = it.errorPath; out += 'var missing' + ($lvl) + ';'; for (var $property in $propertyDeps) { $deps = $propertyDeps[$property]; if ($deps.length) { out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } if ($breakOnError) { out += ' && ( '; var arr1 = $deps; if (arr1) { var $propertyKey, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $propertyKey = arr1[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ')) { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { out += ' ) { '; var arr2 = $deps; if (arr2) { var $propertyKey, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $propertyKey = arr2[i2 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should have '; if ($deps.length == 1) { out += 'property ' + (it.util.escapeQuotes($deps[0])); } else { out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); } out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } out += ' } '; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } } it.errorPath = $currentErrorPath; var $currentBaseId = $it.baseId; for (var $property in $schemaDeps) { var $sch = $schemaDeps[$property]; if (it.util.schemaHasRules($sch, it.RULES.all)) { out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; } out += ') { '; $it.schema = $sch; $it.schemaPath = $schemaPath + it.util.getProperty($property); $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } },{}],23:[function(require,module,exports){ 'use strict'; module.exports = function generate_enum(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $i = 'i' + $lvl, $vSchema = 'schema' + $lvl; if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';'; } out += 'var ' + ($valid) + ';'; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }'; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be equal to one of the allowed values\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' }'; if ($breakOnError) { out += ' else { '; } return out; } },{}],24:[function(require,module,exports){ 'use strict'; module.exports = function generate_format(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); if (it.opts.format === false) { if ($breakOnError) { out += ' if (true) { '; } return out; } var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $unknownFormats = it.opts.unknownFormats, $allowUnknown = Array.isArray($unknownFormats); if ($isData) { var $format = 'format' + $lvl, $isObject = 'isObject' + $lvl, $formatType = 'formatType' + $lvl; out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { '; if (it.async) { out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; '; } out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' ('; if ($unknownFormats != 'ignore') { out += ' (' + ($schemaValue) + ' && !' + ($format) + ' '; if ($allowUnknown) { out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 '; } out += ') || '; } out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? '; if (it.async) { out += ' (async' + ($lvl) + ' ? ' + (it.yieldAwait) + ' ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) '; } else { out += ' ' + ($format) + '(' + ($data) + ') '; } out += ' : ' + ($format) + '.test(' + ($data) + '))))) {'; } else { var $format = it.formats[$schema]; if (!$format) { if ($unknownFormats == 'ignore') { it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); if ($breakOnError) { out += ' if (true) { '; } return out; } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) { if ($breakOnError) { out += ' if (true) { '; } return out; } else { throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); } } var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; var $formatType = $isObject && $format.type || 'string'; if ($isObject) { var $async = $format.async === true; $format = $format.validate; } if ($formatType != $ruleType) { if ($breakOnError) { out += ' if (true) { '; } return out; } if ($async) { if (!it.async) throw new Error('async format in sync schema'); var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { '; } else { out += ' if (! '; var $formatRef = 'formats' + it.util.getProperty($schema); if ($isObject) $formatRef += '.validate'; if (typeof $format == 'function') { out += ' ' + ($formatRef) + '(' + ($data) + ') '; } else { out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; } out += ') { '; } } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match format "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } return out; } },{}],25:[function(require,module,exports){ 'use strict'; module.exports = function generate_items(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $idx = 'i' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $currentBaseId = it.baseId; out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; if (Array.isArray($schema)) { var $additionalItems = it.schema.additionalItems; if ($additionalItems === false) { out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { $closingBraces += '}'; out += ' else { '; } } var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if (it.util.schemaHasRules($sch, it.RULES.all)) { out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; var $passData = $data + '[' + $i + ']'; $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); $it.dataPathArr[$dataNxt] = $i; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { $it.schema = $additionalItems; $it.schemaPath = it.schemaPath + '.additionalItems'; $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } else if (it.util.schemaHasRules($schema, it.RULES.all)) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); var $passData = $data + '[' + $idx + ']'; $it.dataPathArr[$dataNxt] = $idx; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } },{}],26:[function(require,module,exports){ 'use strict'; module.exports = function generate_multipleOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } out += 'var division' + ($lvl) + ';if ('; if ($isData) { out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; } out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; if (it.opts.multipleOfPrecision) { out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; } else { out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; } out += ' ) '; if ($isData) { out += ' ) '; } out += ' ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; if (it.opts.messages !== false) { out += ' , message: \'should be multiple of '; if ($isData) { out += '\' + ' + ($schemaValue); } else { out += '' + ($schemaValue) + '\''; } } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } },{}],27:[function(require,module,exports){ 'use strict'; module.exports = function generate_not(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; if (it.util.schemaHasRules($schema, it.RULES.all)) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.createErrors = false; var $allErrorsOption; if ($it.opts.allErrors) { $allErrorsOption = $it.opts.allErrors; $it.opts.allErrors = false; } out += ' ' + (it.validate($it)) + ' '; $it.createErrors = true; if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (' + ($nextValid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; if (it.opts.allErrors) { out += ' } '; } } else { out += ' var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should NOT be valid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if ($breakOnError) { out += ' if (false) { '; } } return out; } },{}],28:[function(require,module,exports){ 'use strict'; module.exports = function generate_oneOf(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; var $currentBaseId = $it.baseId; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var arr1 = $schema; if (arr1) { var $sch, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $sch = arr1[$i += 1]; if (it.util.schemaHasRules($sch, it.RULES.all)) { $it.schema = $sch; $it.schemaPath = $schemaPath + '[' + $i + ']'; $it.errSchemaPath = $errSchemaPath + '/' + $i; out += ' ' + (it.validate($it)) + ' '; $it.baseId = $currentBaseId; } else { out += ' var ' + ($nextValid) + ' = true; '; } if ($i) { out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; $closingBraces += '}'; } out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; } } it.compositeRule = $it.compositeRule = $wasComposite; out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'should match exactly one schema in oneOf\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; if (it.opts.allErrors) { out += ' } '; } return out; } },{}],29:[function(require,module,exports){ 'use strict'; module.exports = function generate_pattern(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); out += 'if ( '; if ($isData) { out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; } out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; if ($isData) { out += '' + ($schemaValue); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' } '; if (it.opts.messages !== false) { out += ' , message: \'should match pattern "'; if ($isData) { out += '\' + ' + ($schemaValue) + ' + \''; } else { out += '' + (it.util.escapeQuotes($schema)); } out += '"\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + (it.util.toQuotedString($schema)); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += '} '; if ($breakOnError) { out += ' else { '; } return out; } },{}],30:[function(require,module,exports){ 'use strict'; module.exports = function generate_properties(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl; var $schemaKeys = Object.keys($schema || {}), $pProperties = it.schema.patternProperties || {}, $pPropertyKeys = Object.keys($pProperties), $aProperties = it.schema.additionalProperties, $someProperties = $schemaKeys.length || $pPropertyKeys.length, $noAdditional = $aProperties === false, $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, $removeAdditional = it.opts.removeAdditional, $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; var $required = it.schema.required; if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); if (it.opts.patternGroups) { var $pgProperties = it.schema.patternGroups || {}, $pgPropertyKeys = Object.keys($pgProperties); } out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined;'; } if ($checkAdditional) { if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } if ($someProperties) { out += ' var isAdditional' + ($lvl) + ' = !(false '; if ($schemaKeys.length) { if ($schemaKeys.length > 5) { out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; } else { var arr1 = $schemaKeys; if (arr1) { var $propertyKey, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $propertyKey = arr1[i1 += 1]; out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; } } } } if ($pPropertyKeys.length) { var arr2 = $pPropertyKeys; if (arr2) { var $pProperty, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $pProperty = arr2[$i += 1]; out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; } } } if (it.opts.patternGroups && $pgPropertyKeys.length) { var arr3 = $pgPropertyKeys; if (arr3) { var $pgProperty, $i = -1, l3 = arr3.length - 1; while ($i < l3) { $pgProperty = arr3[$i += 1]; out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; } } } out += ' ); if (isAdditional' + ($lvl) + ') { '; } if ($removeAdditional == 'all') { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { var $currentErrorPath = it.errorPath; var $additionalProperty = '\' + ' + $key + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); } if ($noAdditional) { if ($removeAdditional) { out += ' delete ' + ($data) + '[' + ($key) + ']; '; } else { out += ' ' + ($nextValid) + ' = false; '; var $currErrSchemaPath = $errSchemaPath; $errSchemaPath = it.errSchemaPath + '/additionalProperties'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have additional properties\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { out += ' break; '; } } } else if ($additionalIsSchema) { if ($removeAdditional == 'failing') { out += ' var ' + ($errs) + ' = errors; '; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; it.compositeRule = $it.compositeRule = $wasComposite; } else { $it.schema = $aProperties; $it.schemaPath = it.schemaPath + '.additionalProperties'; $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } } } it.errorPath = $currentErrorPath; } if ($someProperties) { out += ' } '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } var $useDefaults = it.opts.useDefaults && !it.compositeRule; if ($schemaKeys.length) { var arr4 = $schemaKeys; if (arr4) { var $propertyKey, i4 = -1, l4 = arr4.length - 1; while (i4 < l4) { $propertyKey = arr4[i4 += 1]; var $sch = $schema[$propertyKey]; if (it.util.schemaHasRules($sch, it.RULES.all)) { var $prop = it.util.getProperty($propertyKey), $passData = $data + $prop, $hasDefault = $useDefaults && $sch.default !== undefined; $it.schema = $sch; $it.schemaPath = $schemaPath + $prop; $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { $code = it.util.varReplace($code, $nextData, $passData); var $useData = $passData; } else { var $useData = $nextData; out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; } if ($hasDefault) { out += ' ' + ($code) + ' '; } else { if ($requiredHash && $requiredHash[$propertyKey]) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = false; '; var $currentErrorPath = it.errorPath, $currErrSchemaPath = $errSchemaPath, $missingProperty = it.util.escapeQuotes($propertyKey); if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } $errSchemaPath = it.errSchemaPath + '/required'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } $errSchemaPath = $currErrSchemaPath; it.errorPath = $currentErrorPath; out += ' } else { '; } else { if ($breakOnError) { out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { ' + ($nextValid) + ' = true; } else { '; } else { out += ' if (' + ($useData) + ' !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ' ) { '; } } out += ' ' + ($code) + ' } '; } } if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } if ($pPropertyKeys.length) { var arr5 = $pPropertyKeys; if (arr5) { var $pProperty, i5 = -1, l5 = arr5.length - 1; while (i5 < l5) { $pProperty = arr5[i5 += 1]; var $sch = $pProperties[$pProperty]; if (it.util.schemaHasRules($sch, it.RULES.all)) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } '; if ($breakOnError) { out += ' else ' + ($nextValid) + ' = true; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } } } } } if (it.opts.patternGroups && $pgPropertyKeys.length) { var arr6 = $pgPropertyKeys; if (arr6) { var $pgProperty, i6 = -1, l6 = arr6.length - 1; while (i6 < l6) { $pgProperty = arr6[i6 += 1]; var $pgSchema = $pgProperties[$pgProperty], $sch = $pgSchema.schema; if (it.util.schemaHasRules($sch, it.RULES.all)) { $it.schema = $sch; $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; out += ' var pgPropCount' + ($lvl) + ' = 0; '; if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); var $passData = $data + '[' + $key + ']'; $it.dataPathArr[$dataNxt] = $key; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } if ($breakOnError) { out += ' if (!' + ($nextValid) + ') break; '; } out += ' } '; if ($breakOnError) { out += ' else ' + ($nextValid) + ' = true; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; $closingBraces += '}'; } var $pgMin = $pgSchema.minimum, $pgMax = $pgSchema.maximum; if ($pgMin !== undefined || $pgMax !== undefined) { out += ' var ' + ($valid) + ' = true; '; var $currErrSchemaPath = $errSchemaPath; if ($pgMin !== undefined) { var $limit = $pgMin, $reason = 'minimum', $moreOrLess = 'less'; out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($pgMax !== undefined) { out += ' else '; } } if ($pgMax !== undefined) { var $limit = $pgMax, $reason = 'maximum', $moreOrLess = 'more'; out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; } $errSchemaPath = $currErrSchemaPath; if ($breakOnError) { out += ' if (' + ($valid) + ') { '; $closingBraces += '}'; } } } } } } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } },{}],31:[function(require,module,exports){ 'use strict'; module.exports = function generate_propertyNames(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $errs = 'errs__' + $lvl; var $it = it.util.copy(it); var $closingBraces = ''; $it.level++; var $nextValid = 'valid' + $it.level; if (it.util.schemaHasRules($schema, it.RULES.all)) { $it.schema = $schema; $it.schemaPath = $schemaPath; $it.errSchemaPath = $errSchemaPath; var $key = 'key' + $lvl, $idx = 'idx' + $lvl, $i = 'i' + $lvl, $invalidName = '\' + ' + $key + ' + \'', $dataNxt = $it.dataLevel = it.dataLevel + 1, $nextData = 'data' + $dataNxt, $dataProperties = 'dataProperties' + $lvl, $ownProperties = it.opts.ownProperties, $currentBaseId = it.baseId; out += ' var ' + ($errs) + ' = errors; '; if ($ownProperties) { out += ' var ' + ($dataProperties) + ' = undefined; '; } if ($ownProperties) { out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; } else { out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; } out += ' var startErrs' + ($lvl) + ' = errors; '; var $passData = $key; var $wasComposite = it.compositeRule; it.compositeRule = $it.compositeRule = true; var $code = it.validate($it); $it.baseId = $currentBaseId; if (it.util.varOccurences($code, $nextData) < 2) { out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; } else { out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; } it.compositeRule = $it.compositeRule = $wasComposite; out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; return false; '; } } if ($breakOnError) { out += ' break; '; } out += ' } }'; } if ($breakOnError) { out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; } out = it.util.cleanUpCode(out); return out; } },{}],32:[function(require,module,exports){ 'use strict'; module.exports = function generate_ref(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $async, $refCode; if ($schema == '#' || $schema == '#/') { if (it.isRoot) { $async = it.async; $refCode = 'validate'; } else { $async = it.root.schema.$async === true; $refCode = 'root.refVal[0]'; } } else { var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); if ($refVal === undefined) { var $message = it.MissingRefError.message(it.baseId, $schema); if (it.opts.missingRefs == 'fail') { it.logger.error($message); var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; } if (it.opts.verbose) { out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } if ($breakOnError) { out += ' if (false) { '; } } else if (it.opts.missingRefs == 'ignore') { it.logger.warn($message); if ($breakOnError) { out += ' if (true) { '; } } else { throw new it.MissingRefError(it.baseId, $schema, $message); } } else if ($refVal.inline) { var $it = it.util.copy(it); $it.level++; var $nextValid = 'valid' + $it.level; $it.schema = $refVal.schema; $it.schemaPath = ''; $it.errSchemaPath = $schema; var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); out += ' ' + ($code) + ' '; if ($breakOnError) { out += ' if (' + ($nextValid) + ') { '; } } else { $async = $refVal.$async === true; $refCode = $refVal.code; } } if ($refCode) { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; if (it.opts.passContext) { out += ' ' + ($refCode) + '.call(this, '; } else { out += ' ' + ($refCode) + '( '; } out += ' ' + ($data) + ', (dataPath || \'\')'; if (it.errorPath != '""') { out += ' + ' + (it.errorPath); } var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; var __callValidate = out; out = $$outStack.pop(); if ($async) { if (!it.async) throw new Error('async schema referenced by sync schema'); if ($breakOnError) { out += ' var ' + ($valid) + '; '; } out += ' try { ' + (it.yieldAwait) + ' ' + (__callValidate) + '; '; if ($breakOnError) { out += ' ' + ($valid) + ' = true; '; } out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; '; if ($breakOnError) { out += ' ' + ($valid) + ' = false; '; } out += ' } '; if ($breakOnError) { out += ' if (' + ($valid) + ') { '; } } else { out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; if ($breakOnError) { out += ' else { '; } } } return out; } },{}],33:[function(require,module,exports){ 'use strict'; module.exports = function generate_required(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } var $vSchema = 'schema' + $lvl; if (!$isData) { if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { var $required = []; var arr1 = $schema; if (arr1) { var $property, i1 = -1, l1 = arr1.length - 1; while (i1 < l1) { $property = arr1[i1 += 1]; var $propertySch = it.schema.properties[$property]; if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { $required[$required.length] = $property; } } } } else { var $required = $schema; } } if ($isData || $required.length) { var $currentErrorPath = it.errorPath, $loopRequired = $isData || $required.length >= it.opts.loopRequired, $ownProperties = it.opts.ownProperties; if ($breakOnError) { out += ' var missing' + ($lvl) + '; '; if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } out += ' var ' + ($valid) + ' = true; '; if ($isData) { out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; if ($ownProperties) { out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += '; if (!' + ($valid) + ') break; } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } else { out += ' if ( '; var arr2 = $required; if (arr2) { var $propertyKey, $i = -1, l2 = arr2.length - 1; while ($i < l2) { $propertyKey = arr2[$i += 1]; if ($i) { out += ' || '; } var $prop = it.util.getProperty($propertyKey), $useData = $data + $prop; out += ' ( ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; } } out += ') { '; var $propertyPath = 'missing' + $lvl, $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; } } else { if ($loopRequired) { if (!$isData) { out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; } var $i = 'i' + $lvl, $propertyPath = 'schema' + $lvl + '[' + $i + ']', $missingProperty = '\' + ' + $propertyPath + ' + \''; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); } if ($isData) { out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; } out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; if ($isData) { out += ' } '; } } else { var arr3 = $required; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $prop = it.util.getProperty($propertyKey), $missingProperty = it.util.escapeQuotes($propertyKey), $useData = $data + $prop; if (it.opts._errorDataPathProperty) { it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); } out += ' if ( ' + ($useData) + ' === undefined '; if ($ownProperties) { out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; } out += ') { var err = '; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; if (it.opts.messages !== false) { out += ' , message: \''; if (it.opts._errorDataPathProperty) { out += 'is a required property'; } else { out += 'should have required property \\\'' + ($missingProperty) + '\\\''; } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; } } } } it.errorPath = $currentErrorPath; } else if ($breakOnError) { out += ' if (true) {'; } return out; } },{}],34:[function(require,module,exports){ 'use strict'; module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { var out = ' '; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; var $isData = it.opts.$data && $schema && $schema.$data, $schemaValue; if ($isData) { out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; $schemaValue = 'schema' + $lvl; } else { $schemaValue = $schema; } if (($schema || $isData) && it.opts.uniqueItems !== false) { if ($isData) { out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; } out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; if ($isData) { out += ' } '; } out += ' if (!' + ($valid) + ') { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; if (it.opts.messages !== false) { out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; } if (it.opts.verbose) { out += ' , schema: '; if ($isData) { out += 'validate.schema' + ($schemaPath); } else { out += '' + ($schema); } out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; if ($breakOnError) { out += ' else { '; } } else { if ($breakOnError) { out += ' if (true) { '; } } return out; } },{}],35:[function(require,module,exports){ 'use strict'; module.exports = function generate_validate(it, $keyword, $ruleType) { var out = ''; var $async = it.schema.$async === true, $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), $id = it.self._getId(it.schema); if (it.isTop) { if ($async) { it.async = true; var $es7 = it.opts.async == 'es7'; it.yieldAwait = $es7 ? 'await' : 'yield'; } out += ' var validate = '; if ($async) { if ($es7) { out += ' (async function '; } else { if (it.opts.async != '*') { out += 'co.wrap'; } out += '(function* '; } } else { out += ' (function '; } out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; if ($id && (it.opts.sourceCode || it.opts.processCode)) { out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; } } if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { var $keyword = 'false schema'; var $lvl = it.level; var $dataLvl = it.dataLevel; var $schema = it.schema[$keyword]; var $schemaPath = it.schemaPath + it.util.getProperty($keyword); var $errSchemaPath = it.errSchemaPath + '/' + $keyword; var $breakOnError = !it.opts.allErrors; var $errorKeyword; var $data = 'data' + ($dataLvl || ''); var $valid = 'valid' + $lvl; if (it.schema === false) { if (it.isTop) { $breakOnError = true; } else { out += ' var ' + ($valid) + ' = false; '; } var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; if (it.opts.messages !== false) { out += ' , message: \'boolean schema is false\' '; } if (it.opts.verbose) { out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } else { if (it.isTop) { if ($async) { out += ' return data; '; } else { out += ' validate.errors = null; return true; '; } } else { out += ' var ' + ($valid) + ' = true; '; } } if (it.isTop) { out += ' }); return validate; '; } return out; } if (it.isTop) { var $top = it.isTop, $lvl = it.level = 0, $dataLvl = it.dataLevel = 0, $data = 'data'; it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); it.baseId = it.baseId || it.rootId; delete it.isTop; it.dataPathArr = [undefined]; out += ' var vErrors = null; '; out += ' var errors = 0; '; out += ' if (rootData === undefined) rootData = data; '; } else { var $lvl = it.level, $dataLvl = it.dataLevel, $data = 'data' + ($dataLvl || ''); if ($id) it.baseId = it.resolve.url(it.baseId, $id); if ($async && !it.async) throw new Error('async schema in sync schema'); out += ' var errs_' + ($lvl) + ' = errors;'; } var $valid = 'valid' + $lvl, $breakOnError = !it.opts.allErrors, $closingBraces1 = '', $closingBraces2 = ''; var $errorKeyword; var $typeSchema = it.schema.type, $typeIsArray = Array.isArray($typeSchema); if ($typeIsArray && $typeSchema.length == 1) { $typeSchema = $typeSchema[0]; $typeIsArray = false; } if (it.schema.$ref && $refKeywords) { if (it.opts.extendRefs == 'fail') { throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); } else if (it.opts.extendRefs !== true) { $refKeywords = false; it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); } } if ($typeSchema) { if (it.opts.coerceTypes) { var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); } var $rulesGroup = it.RULES.types[$typeSchema]; if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type', $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; if ($coerceToTypes) { var $dataType = 'dataType' + $lvl, $coerced = 'coerced' + $lvl; out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; if (it.opts.coerceTypes == 'array') { out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; } out += ' var ' + ($coerced) + ' = undefined; '; var $bracesCoercion = ''; var arr1 = $coerceToTypes; if (arr1) { var $type, $i = -1, l1 = arr1.length - 1; while ($i < l1) { $type = arr1[$i += 1]; if ($i) { out += ' if (' + ($coerced) + ' === undefined) { '; $bracesCoercion += '}'; } if (it.opts.coerceTypes == 'array' && $type != 'array') { out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; } if ($type == 'string') { out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; } else if ($type == 'number' || $type == 'integer') { out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; if ($type == 'integer') { out += ' && !(' + ($data) + ' % 1)'; } out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; } else if ($type == 'boolean') { out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; } else if ($type == 'null') { out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; } else if (it.opts.coerceTypes == 'array' && $type == 'array') { out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; } } } out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } else { '; var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; out += ' ' + ($data) + ' = ' + ($coerced) + '; '; if (!$dataLvl) { out += 'if (' + ($parentData) + ' !== undefined)'; } out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; } else { var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } } out += ' } '; } } if (it.schema.$ref && !$refKeywords) { out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; if ($breakOnError) { out += ' } if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } else { if (it.opts.v5 && it.schema.patternGroups) { it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); } var arr2 = it.RULES; if (arr2) { var $rulesGroup, i2 = -1, l2 = arr2.length - 1; while (i2 < l2) { $rulesGroup = arr2[i2 += 1]; if ($shouldUseGroup($rulesGroup)) { if ($rulesGroup.type) { out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; } if (it.opts.useDefaults && !it.compositeRule) { if ($rulesGroup.type == 'object' && it.schema.properties) { var $schema = it.schema.properties, $schemaKeys = Object.keys($schema); var arr3 = $schemaKeys; if (arr3) { var $propertyKey, i3 = -1, l3 = arr3.length - 1; while (i3 < l3) { $propertyKey = arr3[i3 += 1]; var $sch = $schema[$propertyKey]; if ($sch.default !== undefined) { var $passData = $data + it.util.getProperty($propertyKey); out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { var arr4 = it.schema.items; if (arr4) { var $sch, $i = -1, l4 = arr4.length - 1; while ($i < l4) { $sch = arr4[$i += 1]; if ($sch.default !== undefined) { var $passData = $data + '[' + $i + ']'; out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; if (it.opts.useDefaults == 'shared') { out += ' ' + (it.useDefault($sch.default)) + ' '; } else { out += ' ' + (JSON.stringify($sch.default)) + ' '; } out += '; '; } } } } } var arr5 = $rulesGroup.rules; if (arr5) { var $rule, i5 = -1, l5 = arr5.length - 1; while (i5 < l5) { $rule = arr5[i5 += 1]; if ($shouldUseRule($rule)) { var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); if ($code) { out += ' ' + ($code) + ' '; if ($breakOnError) { $closingBraces1 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces1) + ' '; $closingBraces1 = ''; } if ($rulesGroup.type) { out += ' } '; if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { out += ' else { '; var $schemaPath = it.schemaPath + '.type', $errSchemaPath = it.errSchemaPath + '/type'; var $$outStack = $$outStack || []; $$outStack.push(out); out = ''; /* istanbul ignore else */ if (it.createErrors !== false) { out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' } '; if (it.opts.messages !== false) { out += ' , message: \'should be '; if ($typeIsArray) { out += '' + ($typeSchema.join(",")); } else { out += '' + ($typeSchema); } out += '\' '; } if (it.opts.verbose) { out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; } out += ' } '; } else { out += ' {} '; } var __err = out; out = $$outStack.pop(); if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ if (it.async) { out += ' throw new ValidationError([' + (__err) + ']); '; } else { out += ' validate.errors = [' + (__err) + ']; return false; '; } } else { out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; } out += ' } '; } } if ($breakOnError) { out += ' if (errors === '; if ($top) { out += '0'; } else { out += 'errs_' + ($lvl); } out += ') { '; $closingBraces2 += '}'; } } } } } if ($breakOnError) { out += ' ' + ($closingBraces2) + ' '; } if ($top) { if ($async) { out += ' if (errors === 0) return data; '; out += ' else throw new ValidationError(vErrors); '; } else { out += ' validate.errors = vErrors; '; out += ' return errors === 0; '; } out += ' }); return validate;'; } else { out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; } out = it.util.cleanUpCode(out); if ($top) { out = it.util.finalCleanUpCode(out, $async); } function $shouldUseGroup($rulesGroup) { var rules = $rulesGroup.rules; for (var i = 0; i < rules.length; i++) if ($shouldUseRule(rules[i])) return true; } function $shouldUseRule($rule) { return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); } function $ruleImplementsSomeKeyword($rule) { var impl = $rule.implements; for (var i = 0; i < impl.length; i++) if (it.schema[impl[i]] !== undefined) return true; } return out; } },{}],36:[function(require,module,exports){ 'use strict'; var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; var customRuleCode = require('./dotjs/custom'); module.exports = { add: addKeyword, get: getKeyword, remove: removeKeyword }; /** * Define custom keyword * @this Ajv * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. * @return {Ajv} this for method chaining */ function addKeyword(keyword, definition) { /* jshint validthis: true */ /* eslint no-shadow: 0 */ var RULES = this.RULES; if (RULES.keywords[keyword]) throw new Error('Keyword ' + keyword + ' is already defined'); if (!IDENTIFIER.test(keyword)) throw new Error('Keyword ' + keyword + ' is not a valid identifier'); if (definition) { if (definition.macro && definition.valid !== undefined) throw new Error('"valid" option cannot be used with macro keywords'); var dataType = definition.type; if (Array.isArray(dataType)) { var i, len = dataType.length; for (i=0; i<len; i++) checkDataType(dataType[i]); for (i=0; i<len; i++) _addRule(keyword, dataType[i], definition); } else { if (dataType) checkDataType(dataType); _addRule(keyword, dataType, definition); } var $data = definition.$data === true && this._opts.$data; if ($data && !definition.validate) throw new Error('$data support: "validate" function is not defined'); var metaSchema = definition.metaSchema; if (metaSchema) { if ($data) { metaSchema = { anyOf: [ metaSchema, { '$ref': 'path_to_url#' } ] }; } definition.validateSchema = this.compile(metaSchema, true); } } RULES.keywords[keyword] = RULES.all[keyword] = true; function _addRule(keyword, dataType, definition) { var ruleGroup; for (var i=0; i<RULES.length; i++) { var rg = RULES[i]; if (rg.type == dataType) { ruleGroup = rg; break; } } if (!ruleGroup) { ruleGroup = { type: dataType, rules: [] }; RULES.push(ruleGroup); } var rule = { keyword: keyword, definition: definition, custom: true, code: customRuleCode, implements: definition.implements }; ruleGroup.rules.push(rule); RULES.custom[keyword] = rule; } function checkDataType(dataType) { if (!RULES.types[dataType]) throw new Error('Unknown type ' + dataType); } return this; } /** * Get keyword * @this Ajv * @param {String} keyword pre-defined or custom keyword. * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. */ function getKeyword(keyword) { /* jshint validthis: true */ var rule = this.RULES.custom[keyword]; return rule ? rule.definition : this.RULES.keywords[keyword] || false; } /** * Remove keyword * @this Ajv * @param {String} keyword pre-defined or custom keyword. * @return {Ajv} this for method chaining */ function removeKeyword(keyword) { /* jshint validthis: true */ var RULES = this.RULES; delete RULES.keywords[keyword]; delete RULES.all[keyword]; delete RULES.custom[keyword]; for (var i=0; i<RULES.length; i++) { var rules = RULES[i].rules; for (var j=0; j<rules.length; j++) { if (rules[j].keyword == keyword) { rules.splice(j, 1); break; } } } return this; } },{"./dotjs/custom":21}],37:[function(require,module,exports){ 'use strict'; var META_SCHEMA_ID = 'path_to_url module.exports = function (ajv) { var defaultMeta = ajv._opts.defaultMeta; var metaSchemaRef = typeof defaultMeta == 'string' ? { $ref: defaultMeta } : ajv.getSchema(META_SCHEMA_ID) ? { $ref: META_SCHEMA_ID } : {}; ajv.addKeyword('patternGroups', { // implemented in properties.jst metaSchema: { type: 'object', additionalProperties: { type: 'object', required: [ 'schema' ], properties: { maximum: { type: 'integer', minimum: 0 }, minimum: { type: 'integer', minimum: 0 }, schema: metaSchemaRef }, additionalProperties: false } } }); ajv.RULES.all.properties.implements.push('patternGroups'); }; },{}],38:[function(require,module,exports){ module.exports={ "$schema": "path_to_url#", "$id": "path_to_url#", "description": "Meta-schema for $data reference (JSON-schema extension proposal)", "type": "object", "required": [ "$data" ], "properties": { "$data": { "type": "string", "anyOf": [ { "format": "relative-json-pointer" }, { "format": "json-pointer" } ] } }, "additionalProperties": false } },{}],39:[function(require,module,exports){ module.exports={ "$schema": "path_to_url#", "$id": "path_to_url#", "title": "Core schema meta-schema", "definitions": { "schemaArray": { "type": "array", "minItems": 1, "items": { "$ref": "#" } }, "nonNegativeInteger": { "type": "integer", "minimum": 0 }, "nonNegativeIntegerDefault0": { "allOf": [ { "$ref": "#/definitions/nonNegativeInteger" }, { "default": 0 } ] }, "simpleTypes": { "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] }, "stringArray": { "type": "array", "items": { "type": "string" }, "uniqueItems": true, "default": [] } }, "type": ["object", "boolean"], "properties": { "$id": { "type": "string", "format": "uri-reference" }, "$schema": { "type": "string", "format": "uri" }, "$ref": { "type": "string", "format": "uri-reference" }, "title": { "type": "string" }, "description": { "type": "string" }, "default": {}, "examples": { "type": "array", "items": {} }, "multipleOf": { "type": "number", "exclusiveMinimum": 0 }, "maximum": { "type": "number" }, "exclusiveMaximum": { "type": "number" }, "minimum": { "type": "number" }, "exclusiveMinimum": { "type": "number" }, "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "pattern": { "type": "string", "format": "regex" }, "additionalItems": { "$ref": "#" }, "items": { "anyOf": [ { "$ref": "#" }, { "$ref": "#/definitions/schemaArray" } ], "default": {} }, "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "uniqueItems": { "type": "boolean", "default": false }, "contains": { "$ref": "#" }, "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "required": { "$ref": "#/definitions/stringArray" }, "additionalProperties": { "$ref": "#" }, "definitions": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "properties": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "patternProperties": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "dependencies": { "type": "object", "additionalProperties": { "anyOf": [ { "$ref": "#" }, { "$ref": "#/definitions/stringArray" } ] } }, "propertyNames": { "$ref": "#" }, "const": {}, "enum": { "type": "array", "minItems": 1, "uniqueItems": true }, "type": { "anyOf": [ { "$ref": "#/definitions/simpleTypes" }, { "type": "array", "items": { "$ref": "#/definitions/simpleTypes" }, "minItems": 1, "uniqueItems": true } ] }, "format": { "type": "string" }, "allOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" }, "not": { "$ref": "#" } }, "default": {} } },{}],40:[function(require,module,exports){ /** * slice() reference. */ var slice = Array.prototype.slice; /** * Expose `co`. */ module.exports = co['default'] = co.co = co; /** * Wrap the given generator `fn` into a * function that returns a promise. * This is a separate function so that * every `co()` call doesn't create a new, * unnecessary closure. * * @param {GeneratorFunction} fn * @return {Function} * @api public */ co.wrap = function (fn) { createPromise.__generatorFunction__ = fn; return createPromise; function createPromise() { return co.call(this, fn.apply(this, arguments)); } }; /** * Execute the generator function or a generator * and return a promise. * * @param {Function} fn * @return {Promise} * @api public */ function co(gen) { var ctx = this; var args = slice.call(arguments, 1) // we wrap everything in a promise to avoid promise chaining, // which leads to memory leak errors. // see path_to_url return new Promise(function(resolve, reject) { if (typeof gen === 'function') gen = gen.apply(ctx, args); if (!gen || typeof gen.next !== 'function') return resolve(gen); onFulfilled(); /** * @param {Mixed} res * @return {Promise} * @api private */ function onFulfilled(res) { var ret; try { ret = gen.next(res); } catch (e) { return reject(e); } next(ret); } /** * @param {Error} err * @return {Promise} * @api private */ function onRejected(err) { var ret; try { ret = gen.throw(err); } catch (e) { return reject(e); } next(ret); } /** * Get the next value in the generator, * return a promise. * * @param {Object} ret * @return {Promise} * @api private */ function next(ret) { if (ret.done) return resolve(ret.value); var value = toPromise.call(ctx, ret.value); if (value && isPromise(value)) return value.then(onFulfilled, onRejected); return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + 'but the following object was passed: "' + String(ret.value) + '"')); } }); } /** * Convert a `yield`ed value into a promise. * * @param {Mixed} obj * @return {Promise} * @api private */ function toPromise(obj) { if (!obj) return obj; if (isPromise(obj)) return obj; if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); if ('function' == typeof obj) return thunkToPromise.call(this, obj); if (Array.isArray(obj)) return arrayToPromise.call(this, obj); if (isObject(obj)) return objectToPromise.call(this, obj); return obj; } /** * Convert a thunk to a promise. * * @param {Function} * @return {Promise} * @api private */ function thunkToPromise(fn) { var ctx = this; return new Promise(function (resolve, reject) { fn.call(ctx, function (err, res) { if (err) return reject(err); if (arguments.length > 2) res = slice.call(arguments, 1); resolve(res); }); }); } /** * Convert an array of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Array} obj * @return {Promise} * @api private */ function arrayToPromise(obj) { return Promise.all(obj.map(toPromise, this)); } /** * Convert an object of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Object} obj * @return {Promise} * @api private */ function objectToPromise(obj){ var results = new obj.constructor(); var keys = Object.keys(obj); var promises = []; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var promise = toPromise.call(this, obj[key]); if (promise && isPromise(promise)) defer(promise, key); else results[key] = obj[key]; } return Promise.all(promises).then(function () { return results; }); function defer(promise, key) { // predefine the key in the result results[key] = undefined; promises.push(promise.then(function (res) { results[key] = res; })); } } /** * Check if `obj` is a promise. * * @param {Object} obj * @return {Boolean} * @api private */ function isPromise(obj) { return 'function' == typeof obj.then; } /** * Check if `obj` is a generator. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGenerator(obj) { return 'function' == typeof obj.next && 'function' == typeof obj.throw; } /** * Check if `obj` is a generator function. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGeneratorFunction(obj) { var constructor = obj.constructor; if (!constructor) return false; if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; return isGenerator(constructor.prototype); } /** * Check for plain object. * * @param {Mixed} val * @return {Boolean} * @api private */ function isObject(val) { return Object == val.constructor; } },{}],41:[function(require,module,exports){ 'use strict'; module.exports = function equal(a, b) { if (a === b) return true; var arrA = Array.isArray(a) , arrB = Array.isArray(b) , i; if (arrA && arrB) { if (a.length != b.length) return false; for (i = 0; i < a.length; i++) if (!equal(a[i], b[i])) return false; return true; } if (arrA != arrB) return false; if (a && b && typeof a === 'object' && typeof b === 'object') { var keys = Object.keys(a); if (keys.length !== Object.keys(b).length) return false; var dateA = a instanceof Date , dateB = b instanceof Date; if (dateA && dateB) return a.getTime() == b.getTime(); if (dateA != dateB) return false; var regexpA = a instanceof RegExp , regexpB = b instanceof RegExp; if (regexpA && regexpB) return a.toString() == b.toString(); if (regexpA != regexpB) return false; for (i = 0; i < keys.length; i++) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = 0; i < keys.length; i++) if(!equal(a[keys[i]], b[keys[i]])) return false; return true; } return false; }; },{}],42:[function(require,module,exports){ 'use strict'; module.exports = function (data, opts) { if (!opts) opts = {}; if (typeof opts === 'function') opts = { cmp: opts }; var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; var cmp = opts.cmp && (function (f) { return function (node) { return function (a, b) { var aobj = { key: a, value: node[a] }; var bobj = { key: b, value: node[b] }; return f(aobj, bobj); }; }; })(opts.cmp); var seen = []; return (function stringify (node) { if (node && node.toJSON && typeof node.toJSON === 'function') { node = node.toJSON(); } if (node === undefined) return; if (typeof node == 'number') return isFinite(node) ? '' + node : 'null'; if (typeof node !== 'object') return JSON.stringify(node); var i, out; if (Array.isArray(node)) { out = '['; for (i = 0; i < node.length; i++) { if (i) out += ','; out += stringify(node[i]) || 'null'; } return out + ']'; } if (node === null) return 'null'; if (seen.indexOf(node) !== -1) { if (cycles) return JSON.stringify('__cycle__'); throw new TypeError('Converting circular structure to JSON'); } var seenIndex = seen.push(node) - 1; var keys = Object.keys(node).sort(cmp && cmp(node)); out = ''; for (i = 0; i < keys.length; i++) { var key = keys[i]; var value = stringify(node[key]); if (!value) continue; if (out) out += ','; out += JSON.stringify(key) + ':' + value; } seen.splice(seenIndex, 1); return '{' + out + '}'; })(data); }; },{}],43:[function(require,module,exports){ 'use strict'; var traverse = module.exports = function (schema, opts, cb) { if (typeof opts == 'function') { cb = opts; opts = {}; } _traverse(opts, cb, schema, '', schema); }; traverse.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true }; traverse.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }; traverse.propsKeywords = { definitions: true, properties: true, patternProperties: true, dependencies: true }; traverse.skipKeywords = { enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i=0; i<sch.length; i++) _traverse(opts, cb, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i); } } else if (key in traverse.propsKeywords) { if (sch && typeof sch == 'object') { for (var prop in sch) _traverse(opts, cb, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop); } } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) { _traverse(opts, cb, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema); } } } } function escapeJsonPtr(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } },{}],44:[function(require,module,exports){ (function (global){ /*! path_to_url v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*your_sha256_hash----------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see <path_to_url * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * path_to_url#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*your_sha256_hash----------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see <path_to_url * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define('punycode', function() { return punycode; }); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],45:[function(require,module,exports){ // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: path_to_url function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; },{}],46:[function(require,module,exports){ // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; },{}],47:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); },{"./decode":45,"./encode":46}],48:[function(require,module,exports){ // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; var punycode = require('punycode'); var util = require('./util'); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = require('querystring'); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: path_to_url var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " path_to_url \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // path_to_url => user:a@b host:c // path_to_url => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // path_to_url => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like path_to_url if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; },{"./util":49,"punycode":44,"querystring":47}],49:[function(require,module,exports){ 'use strict'; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; },{}],"ajv":[function(require,module,exports){ 'use strict'; var compileSchema = require('./compile') , resolve = require('./compile/resolve') , Cache = require('./cache') , SchemaObject = require('./compile/schema_obj') , stableStringify = require('fast-json-stable-stringify') , formats = require('./compile/formats') , rules = require('./compile/rules') , $dataMetaSchema = require('./$data') , patternGroups = require('./patternGroups') , util = require('./compile/util') , co = require('co'); module.exports = Ajv; Ajv.prototype.validate = validate; Ajv.prototype.compile = compile; Ajv.prototype.addSchema = addSchema; Ajv.prototype.addMetaSchema = addMetaSchema; Ajv.prototype.validateSchema = validateSchema; Ajv.prototype.getSchema = getSchema; Ajv.prototype.removeSchema = removeSchema; Ajv.prototype.addFormat = addFormat; Ajv.prototype.errorsText = errorsText; Ajv.prototype._addSchema = _addSchema; Ajv.prototype._compile = _compile; Ajv.prototype.compileAsync = require('./compile/async'); var customKeyword = require('./keyword'); Ajv.prototype.addKeyword = customKeyword.add; Ajv.prototype.getKeyword = customKeyword.get; Ajv.prototype.removeKeyword = customKeyword.remove; var errorClasses = require('./compile/error_classes'); Ajv.ValidationError = errorClasses.Validation; Ajv.MissingRefError = errorClasses.MissingRef; Ajv.$dataMetaSchema = $dataMetaSchema; var META_SCHEMA_ID = 'path_to_url var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; var META_SUPPORT_DATA = ['/properties']; /** * Creates validator instance. * Usage: `Ajv(opts)` * @param {Object} opts optional options * @return {Object} ajv instance */ function Ajv(opts) { if (!(this instanceof Ajv)) return new Ajv(opts); opts = this._opts = util.copy(opts) || {}; setLogger(this); this._schemas = {}; this._refs = {}; this._fragments = {}; this._formats = formats(opts.format); var schemaUriFormat = this._schemaUriFormat = this._formats['uri-reference']; this._schemaUriFormatFunc = function (str) { return schemaUriFormat.test(str); }; this._cache = opts.cache || new Cache; this._loadingSchemas = {}; this._compilations = []; this.RULES = rules(); this._getId = chooseGetId(opts); opts.loopRequired = opts.loopRequired || Infinity; if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; if (opts.serialize === undefined) opts.serialize = stableStringify; this._metaOpts = getMetaSchemaOptions(this); if (opts.formats) addInitialFormats(this); addDraft6MetaSchema(this); if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); addInitialSchemas(this); if (opts.patternGroups) patternGroups(this); } /** * Validate data using schema * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](path_to_url is used to serialize. * @this Ajv * @param {String|Object} schemaKeyRef key, ref or schema object * @param {Any} data to be validated * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). */ function validate(schemaKeyRef, data) { var v; if (typeof schemaKeyRef == 'string') { v = this.getSchema(schemaKeyRef); if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); } else { var schemaObj = this._addSchema(schemaKeyRef); v = schemaObj.validate || this._compile(schemaObj); } var valid = v(data); if (v.$async === true) return this._opts.async == '*' ? co(valid) : valid; this.errors = v.errors; return valid; } /** * Create validating function for passed schema. * @this Ajv * @param {Object} schema schema object * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. * @return {Function} validating function */ function compile(schema, _meta) { var schemaObj = this._addSchema(schema, undefined, _meta); return schemaObj.validate || this._compile(schemaObj); } /** * Adds schema to the instance. * @this Ajv * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. * @return {Ajv} this for method chaining */ function addSchema(schema, key, _skipValidation, _meta) { if (Array.isArray(schema)){ for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta); return this; } var id = this._getId(schema); if (id !== undefined && typeof id != 'string') throw new Error('schema id must be string'); key = resolve.normalizeId(key || id); checkUnique(this, key); this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true); return this; } /** * Add schema that will be used to validate other schemas * options in META_IGNORE_OPTIONS are alway set to false * @this Ajv * @param {Object} schema schema object * @param {String} key optional schema key * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema * @return {Ajv} this for method chaining */ function addMetaSchema(schema, key, skipValidation) { this.addSchema(schema, key, skipValidation, true); return this; } /** * Validate schema * @this Ajv * @param {Object} schema schema to validate * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid * @return {Boolean} true if schema is valid */ function validateSchema(schema, throwOrLogError) { var $schema = schema.$schema; if ($schema !== undefined && typeof $schema != 'string') throw new Error('$schema must be a string'); $schema = $schema || this._opts.defaultMeta || defaultMeta(this); if (!$schema) { this.logger.warn('meta-schema not available'); this.errors = null; return true; } var currentUriFormat = this._formats.uri; this._formats.uri = typeof currentUriFormat == 'function' ? this._schemaUriFormatFunc : this._schemaUriFormat; var valid; try { valid = this.validate($schema, schema); } finally { this._formats.uri = currentUriFormat; } if (!valid && throwOrLogError) { var message = 'schema is invalid: ' + this.errorsText(); if (this._opts.validateSchema == 'log') this.logger.error(message); else throw new Error(message); } return valid; } function defaultMeta(self) { var meta = self._opts.meta; self._opts.defaultMeta = typeof meta == 'object' ? self._getId(meta) || meta : self.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined; return self._opts.defaultMeta; } /** * Get compiled schema from the instance by `key` or `ref`. * @this Ajv * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). * @return {Function} schema validating function (with property `schema`). */ function getSchema(keyRef) { var schemaObj = _getSchemaObj(this, keyRef); switch (typeof schemaObj) { case 'object': return schemaObj.validate || this._compile(schemaObj); case 'string': return this.getSchema(schemaObj); case 'undefined': return _getSchemaFragment(this, keyRef); } } function _getSchemaFragment(self, ref) { var res = resolve.schema.call(self, { schema: {} }, ref); if (res) { var schema = res.schema , root = res.root , baseId = res.baseId; var v = compileSchema.call(self, schema, root, undefined, baseId); self._fragments[ref] = new SchemaObject({ ref: ref, fragment: true, schema: schema, root: root, baseId: baseId, validate: v }); return v; } } function _getSchemaObj(self, keyRef) { keyRef = resolve.normalizeId(keyRef); return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef]; } /** * Remove cached schema(s). * If no parameter is passed all schemas but meta-schemas are removed. * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. * @this Ajv * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object * @return {Ajv} this for method chaining */ function removeSchema(schemaKeyRef) { if (schemaKeyRef instanceof RegExp) { _removeAllSchemas(this, this._schemas, schemaKeyRef); _removeAllSchemas(this, this._refs, schemaKeyRef); return this; } switch (typeof schemaKeyRef) { case 'undefined': _removeAllSchemas(this, this._schemas); _removeAllSchemas(this, this._refs); this._cache.clear(); return this; case 'string': var schemaObj = _getSchemaObj(this, schemaKeyRef); if (schemaObj) this._cache.del(schemaObj.cacheKey); delete this._schemas[schemaKeyRef]; delete this._refs[schemaKeyRef]; return this; case 'object': var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef; this._cache.del(cacheKey); var id = this._getId(schemaKeyRef); if (id) { id = resolve.normalizeId(id); delete this._schemas[id]; delete this._refs[id]; } } return this; } function _removeAllSchemas(self, schemas, regex) { for (var keyRef in schemas) { var schemaObj = schemas[keyRef]; if (!schemaObj.meta && (!regex || regex.test(keyRef))) { self._cache.del(schemaObj.cacheKey); delete schemas[keyRef]; } } } /* @this Ajv */ function _addSchema(schema, skipValidation, meta, shouldAddSchema) { if (typeof schema != 'object' && typeof schema != 'boolean') throw new Error('schema should be object or boolean'); var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schema) : schema; var cached = this._cache.get(cacheKey); if (cached) return cached; shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; var id = resolve.normalizeId(this._getId(schema)); if (id && shouldAddSchema) checkUnique(this, id); var willValidate = this._opts.validateSchema !== false && !skipValidation; var recursiveMeta; if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema))) this.validateSchema(schema, true); var localRefs = resolve.ids.call(this, schema); var schemaObj = new SchemaObject({ id: id, schema: schema, localRefs: localRefs, cacheKey: cacheKey, meta: meta }); if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj; this._cache.put(cacheKey, schemaObj); if (willValidate && recursiveMeta) this.validateSchema(schema, true); return schemaObj; } /* @this Ajv */ function _compile(schemaObj, root) { if (schemaObj.compiling) { schemaObj.validate = callValidate; callValidate.schema = schemaObj.schema; callValidate.errors = null; callValidate.root = root ? root : callValidate; if (schemaObj.schema.$async === true) callValidate.$async = true; return callValidate; } schemaObj.compiling = true; var currentOpts; if (schemaObj.meta) { currentOpts = this._opts; this._opts = this._metaOpts; } var v; try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); } finally { schemaObj.compiling = false; if (schemaObj.meta) this._opts = currentOpts; } schemaObj.validate = v; schemaObj.refs = v.refs; schemaObj.refVal = v.refVal; schemaObj.root = v.root; return v; function callValidate() { var _validate = schemaObj.validate; var result = _validate.apply(null, arguments); callValidate.errors = _validate.errors; return result; } } function chooseGetId(opts) { switch (opts.schemaId) { case '$id': return _get$Id; case 'id': return _getId; default: return _get$IdOrId; } } /* @this Ajv */ function _getId(schema) { if (schema.$id) this.logger.warn('schema $id ignored', schema.$id); return schema.id; } /* @this Ajv */ function _get$Id(schema) { if (schema.id) this.logger.warn('schema id ignored', schema.id); return schema.$id; } function _get$IdOrId(schema) { if (schema.$id && schema.id && schema.$id != schema.id) throw new Error('schema $id is different from id'); return schema.$id || schema.id; } /** * Convert array of error message objects to string * @this Ajv * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used. * @param {Object} options optional options with properties `separator` and `dataVar`. * @return {String} human readable string with all errors descriptions */ function errorsText(errors, options) { errors = errors || this.errors; if (!errors) return 'No errors'; options = options || {}; var separator = options.separator === undefined ? ', ' : options.separator; var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; var text = ''; for (var i=0; i<errors.length; i++) { var e = errors[i]; if (e) text += dataVar + e.dataPath + ' ' + e.message + separator; } return text.slice(0, -separator.length); } /** * Add custom format * @this Ajv * @param {String} name format name * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) * @return {Ajv} this for method chaining */ function addFormat(name, format) { if (typeof format == 'string') format = new RegExp(format); this._formats[name] = format; return this; } function addDraft6MetaSchema(self) { var $dataSchema; if (self._opts.$data) { $dataSchema = require('./refs/$data.json'); self.addMetaSchema($dataSchema, $dataSchema.$id, true); } if (self._opts.meta === false) return; var metaSchema = require('./refs/json-schema-draft-06.json'); if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA); self.addMetaSchema(metaSchema, META_SCHEMA_ID, true); self._refs['path_to_url = META_SCHEMA_ID; } function addInitialSchemas(self) { var optsSchemas = self._opts.schemas; if (!optsSchemas) return; if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas); else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key); } function addInitialFormats(self) { for (var name in self._opts.formats) { var format = self._opts.formats[name]; self.addFormat(name, format); } } function checkUnique(self, id) { if (self._schemas[id] || self._refs[id]) throw new Error('schema with key or id "' + id + '" already exists'); } function getMetaSchemaOptions(self) { var metaOpts = util.copy(self._opts); for (var i=0; i<META_IGNORE_OPTIONS.length; i++) delete metaOpts[META_IGNORE_OPTIONS[i]]; return metaOpts; } function setLogger(self) { var logger = self._opts.logger; if (logger === false) { self.logger = {log: noop, warn: noop, error: noop}; } else { if (logger === undefined) logger = console; if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error)) throw new Error('logger must implement log, warn and error methods'); self.logger = logger; } } function noop() {} },{"./$data":1,"./cache":2,"./compile":7,"./compile/async":4,"./compile/error_classes":5,"./compile/formats":6,"./compile/resolve":8,"./compile/rules":9,"./compile/schema_obj":10,"./compile/util":12,"./keyword":36,"./patternGroups":37,"./refs/$data.json":38,"./refs/json-schema-draft-06.json":39,"co":40,"fast-json-stable-stringify":42}]},{},[])("ajv") }); ```
```java /** * <p> * <p> * path_to_url * <p> * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package com.justwayward.reader.view; import android.app.Activity; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; import android.widget.PopupWindow; import com.justwayward.reader.R; /** * @author yuyh. * @date 16/9/5. */ public class LoginPopupWindow extends PopupWindow implements View.OnTouchListener { private View mContentView; private Activity mActivity; private ImageView qq; private ImageView weibo; private ImageView wechat; LoginTypeListener listener; public LoginPopupWindow(Activity activity) { mActivity = activity; setWidth(ViewGroup.LayoutParams.MATCH_PARENT); setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); mContentView = LayoutInflater.from(activity).inflate(R.layout.layout_login_popup_window, null); setContentView(mContentView); qq = (ImageView) mContentView.findViewById(R.id.ivQQ); weibo = (ImageView) mContentView.findViewById(R.id.ivWeibo); wechat = (ImageView) mContentView.findViewById(R.id.ivWechat); qq.setOnTouchListener(this); weibo.setOnTouchListener(this); wechat.setOnTouchListener(this); setFocusable(true); setOutsideTouchable(true); setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00000000"))); setAnimationStyle(R.style.LoginPopup); setOnDismissListener(new OnDismissListener() { @Override public void onDismiss() { lighton(); } }); } private void scale(View v, boolean isDown) { if (v.getId() == qq.getId() || v.getId() == weibo.getId() || v.getId() == wechat.getId()) { if (isDown) { Animation testAnim = AnimationUtils.loadAnimation(mActivity, R.anim.scale_down); v.startAnimation(testAnim); } else { Animation testAnim = AnimationUtils.loadAnimation(mActivity, R.anim.scale_up); v.startAnimation(testAnim); } } if (!isDown && listener!=null) { switch (v.getId()) { case R.id.ivQQ: listener.onLogin(qq, "QQ"); break; } qq.postDelayed(new Runnable() { @Override public void run() { dismiss(); } }, 500); } } private void lighton() { WindowManager.LayoutParams lp = mActivity.getWindow().getAttributes(); lp.alpha = 1.0f; mActivity.getWindow().setAttributes(lp); } private void lightoff() { WindowManager.LayoutParams lp = mActivity.getWindow().getAttributes(); lp.alpha = 0.3f; mActivity.getWindow().setAttributes(lp); } @Override public void showAsDropDown(View anchor, int xoff, int yoff) { lightoff(); super.showAsDropDown(anchor, xoff, yoff); } @Override public void showAtLocation(View parent, int gravity, int x, int y) { lightoff(); super.showAtLocation(parent, gravity, x, y); } @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: scale(v, true); break; case MotionEvent.ACTION_UP: scale(v, false); break; } return false; } public interface LoginTypeListener { void onLogin(ImageView view, String type); } public void setLoginTypeListener(LoginTypeListener listener){ this.listener = listener; } } ```
```objective-c //===- func-id-helper.h - XRay Function ID Conversion Helpers -------------===// // // See path_to_url for license information. // //===your_sha256_hash------===// // // Defines helper tools dealing with XRay-generated function ids. // //===your_sha256_hash------===// #ifndef LLVM_TOOLS_LLVM_XRAY_FUNC_ID_HELPER_H #define LLVM_TOOLS_LLVM_XRAY_FUNC_ID_HELPER_H #include "llvm/ADT/DenseMap.h" #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/DebugInfo/Symbolize/Symbolize.h" #include <unordered_map> namespace llvm { namespace xray { // This class consolidates common operations related to Function IDs. class FuncIdConversionHelper { public: using FunctionAddressMap = std::unordered_map<int32_t, uint64_t>; private: std::string BinaryInstrMap; symbolize::LLVMSymbolizer &Symbolizer; const FunctionAddressMap &FunctionAddresses; mutable llvm::DenseMap<int32_t, std::string> CachedNames; public: FuncIdConversionHelper(std::string BinaryInstrMap, symbolize::LLVMSymbolizer &Symbolizer, const FunctionAddressMap &FunctionAddresses) : BinaryInstrMap(std::move(BinaryInstrMap)), Symbolizer(Symbolizer), FunctionAddresses(FunctionAddresses) {} // Returns the symbol or a string representation of the function id. std::string SymbolOrNumber(int32_t FuncId) const; // Returns the file and column from debug info for the given function id. std::string FileLineAndColumn(int32_t FuncId) const; }; } // namespace xray } // namespace llvm #endif // LLVM_TOOLS_LLVM_XRAY_FUNC_ID_HELPER_H ```
```javascript export function EmojiPicker () { return import(/* webpackChunkName: "emoji_picker" */'../../emoji/emoji_picker'); } export function Compose () { return import(/* webpackChunkName: "features/compose" */'../../compose'); } export function Notifications () { return import(/* webpackChunkName: "features/notifications_v1" */'../../notifications'); } export function Notifications_v2 () { return import(/* webpackChunkName: "features/notifications_v2" */'../../notifications_v2'); } export function NotificationsWrapper () { return import(/* webpackChunkName: "features/notifications" */'../../notifications_wrapper'); } export function HomeTimeline () { return import(/* webpackChunkName: "features/home_timeline" */'../../home_timeline'); } export function PublicTimeline () { return import(/* webpackChunkName: "features/public_timeline" */'../../public_timeline'); } export function CommunityTimeline () { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline'); } export function Firehose () { return import(/* webpackChunkName: "features/firehose" */'../../firehose'); } export function HashtagTimeline () { return import(/* webpackChunkName: "features/hashtag_timeline" */'../../hashtag_timeline'); } export function DirectTimeline() { return import(/* webpackChunkName: "features/direct_timeline" */'../../direct_timeline'); } export function ListTimeline () { return import(/* webpackChunkName: "features/list_timeline" */'../../list_timeline'); } export function Lists () { return import(/* webpackChunkName: "features/lists" */'../../lists'); } export function Status () { return import(/* webpackChunkName: "features/status" */'../../status'); } export function GettingStarted () { return import(/* webpackChunkName: "features/getting_started" */'../../getting_started'); } export function KeyboardShortcuts () { return import(/* webpackChunkName: "features/keyboard_shortcuts" */'../../keyboard_shortcuts'); } export function PinnedStatuses () { return import(/* webpackChunkName: "features/pinned_statuses" */'../../pinned_statuses'); } export function AccountTimeline () { return import(/* webpackChunkName: "features/account_timeline" */'../../account_timeline'); } export function AccountGallery () { return import(/* webpackChunkName: "features/account_gallery" */'../../account_gallery'); } export function Followers () { return import(/* webpackChunkName: "features/followers" */'../../followers'); } export function Following () { return import(/* webpackChunkName: "features/following" */'../../following'); } export function Reblogs () { return import(/* webpackChunkName: "features/reblogs" */'../../reblogs'); } export function Favourites () { return import(/* webpackChunkName: "features/favourites" */'../../favourites'); } export function FollowRequests () { return import(/* webpackChunkName: "features/follow_requests" */'../../follow_requests'); } export function FavouritedStatuses () { return import(/* webpackChunkName: "features/favourited_statuses" */'../../favourited_statuses'); } export function FollowedTags () { return import(/* webpackChunkName: "features/followed_tags" */'../../followed_tags'); } export function BookmarkedStatuses () { return import(/* webpackChunkName: "features/bookmarked_statuses" */'../../bookmarked_statuses'); } export function Blocks () { return import(/* webpackChunkName: "features/blocks" */'../../blocks'); } export function DomainBlocks () { return import(/* webpackChunkName: "features/domain_blocks" */'../../domain_blocks'); } export function Mutes () { return import(/* webpackChunkName: "features/mutes" */'../../mutes'); } export function MuteModal () { return import(/* webpackChunkName: "modals/mute_modal" */'../components/mute_modal'); } export function BlockModal () { return import(/* webpackChunkName: "modals/block_modal" */'../components/block_modal'); } export function DomainBlockModal () { return import(/* webpackChunkName: "modals/domain_block_modal" */'../components/domain_block_modal'); } export function ReportModal () { return import(/* webpackChunkName: "modals/report_modal" */'../components/report_modal'); } export function IgnoreNotificationsModal () { return import(/* webpackChunkName: "modals/domain_block_modal" */'../components/ignore_notifications_modal'); } export function MediaGallery () { return import(/* webpackChunkName: "status/media_gallery" */'../../../components/media_gallery'); } export function Video () { return import(/* webpackChunkName: "features/video" */'../../video'); } export function EmbedModal () { return import(/* webpackChunkName: "modals/embed_modal" */'../components/embed_modal'); } export function ListEditor () { return import(/* webpackChunkName: "features/list_editor" */'../../list_editor'); } export function ListAdder () { return import(/*webpackChunkName: "features/list_adder" */'../../list_adder'); } export function Tesseract () { return import(/*webpackChunkName: "tesseract" */'tesseract.js'); } export function Audio () { return import(/* webpackChunkName: "features/audio" */'../../audio'); } export function Directory () { return import(/* webpackChunkName: "features/directory" */'../../directory'); } export function Onboarding () { return import(/* webpackChunkName: "features/onboarding" */'../../onboarding'); } export function CompareHistoryModal () { return import(/*webpackChunkName: "modals/compare_history_modal" */'../components/compare_history_modal'); } export function Explore () { return import(/* webpackChunkName: "features/explore" */'../../explore'); } export function FilterModal () { return import(/*webpackChunkName: "modals/filter_modal" */'../components/filter_modal'); } export function InteractionModal () { return import(/*webpackChunkName: "modals/interaction_modal" */'../../interaction_modal'); } export function SubscribedLanguagesModal () { return import(/*webpackChunkName: "modals/subscribed_languages_modal" */'../../subscribed_languages_modal'); } export function ClosedRegistrationsModal () { return import(/*webpackChunkName: "modals/closed_registrations_modal" */'../../closed_registrations_modal'); } export function About () { return import(/*webpackChunkName: "features/about" */'../../about'); } export function PrivacyPolicy () { return import(/*webpackChunkName: "features/privacy_policy" */'../../privacy_policy'); } export function NotificationRequests () { return import(/*webpackChunkName: "features/notifications/requests" */'../../notifications/requests'); } export function NotificationRequest () { return import(/*webpackChunkName: "features/notifications/request" */'../../notifications/request'); } export function LinkTimeline () { return import(/*webpackChunkName: "features/link_timeline" */'../../link_timeline'); } ```
```xml <vector xmlns:android="path_to_url" android:width="128dp" android:height="128dp" android:viewportWidth="34" android:viewportHeight="34"> <path android:pathData="m31.6,25.4c-4.68,8.1 -15.03,10.87 -23.13,6.2 -8.1,-4.68 -10.87,-15.03 -6.2,-23.13 4.68,-8.1 15.03,-10.87 23.13,-6.2 8.1,4.68 10.87,15.03 6.2,23.13" android:fillColor="#ffdd55"/> <path android:pathData="M9.76,7.41L24.33,7.41A2.24,2.24 0,0 1,26.57 9.65L26.57,26.33A2.24,2.24 0,0 1,24.33 28.57L9.76,28.57A2.24,2.24 0,0 1,7.52 26.33L7.52,9.65A2.24,2.24 0,0 1,9.76 7.41z" android:strokeColor="#000" android:strokeWidth="2" android:strokeAlpha="0.2"/> <path android:pathData="M9.76,6.35L24.33,6.35A2.24,2.24 0,0 1,26.57 8.59L26.57,25.27A2.24,2.24 0,0 1,24.33 27.51L9.76,27.51A2.24,2.24 0,0 1,7.52 25.27L7.52,8.59A2.24,2.24 0,0 1,9.76 6.35z" android:strokeColor="#fff" android:fillColor="#495aad" android:strokeWidth="2"/> <path android:pathData="m11.76,21.16v-10.58h3.18c0,0 3.17,0 3.17,3.17 0,3.17 -3.17,3.17 -3.17,3.17h-3.18" android:strokeLineCap="square" android:strokeColor="#fff" android:strokeWidth="2"/> <path android:pathData="M16.74,22.22a4.55,4.55 0,1 0,9.11 0a4.55,4.55 0,1 0,-9.11 0z" android:strokeLineCap="round" android:strokeColor="#c84747" android:fillColor="#fff" android:strokeWidth="1.5" android:strokeLineJoin="round"/> <path android:pathData="m21.28,22.22 l2.37,1.15" android:strokeLineCap="round" android:strokeColor="#666" android:strokeWidth="1.5" android:strokeLineJoin="round"/> <path android:pathData="m21.28,18.67v3.55" android:strokeLineCap="round" android:strokeColor="#666" android:strokeWidth="1" android:strokeLineJoin="round"/> <path android:pathData="M20.49,22.22a0.79,0.79 0,1 0,1.58 0a0.79,0.79 0,1 0,-1.58 0z" android:fillColor="#444"/> </vector> ```
Diospyros muricata is a tree in the family Ebenaceae. It grows up to tall. The twigs are covered with short hairs. Inflorescences bear up to seven flowers. The fruits are ovoid, up to in diameter. The specific epithet is from the Latin meaning "rough with short, hard points", referring to the fruits. Habitat is lowland mixed dipterocarp forests from sea level to altitude. D. muricata is endemic to Borneo. References muricata Plants described in 1933 Endemic flora of Borneo Trees of Borneo
NightOwl Convenience Stores is a franchised system of convenience stores operating in Australia - predominantly in the state of Queensland. History The NightOwl, established by Don Halliwell and Rod Craig, opened in 1975 in the Brisbane suburb of Auchenflower. The store pre-dated 7-Eleven opening in Australia by 12 months. The store traded 24 hours a day, 7 days a week, offering an extensive range of traditional supermarket grocery items-together with fresh fruit, vegetables and hot bbq chickens. The store was popular with the growing student and yuppy community in the district. The business concept was franchised in 1987. In 1995, NightOwl was floated on the stock exchange and was bought out by Retail Services Limited in 1996. RSL is a diversified holdings group mainly based in the retail sector, this helped take NightOwl nationwide The NightOwl business was purchased by David Hodge in September 2001. The companies Senior Management was changed and the business was re-aligned with a new focus being placed upon growth. Store livery was modernised, multiple-site franchisees were encouraged within the business and investment in training was increased. Taking up the Chair of the 'Australasian Association of Convenience Stores' (AACS) for 2003 and 2004, NightOwl increased its profile within the industry and played host to regular AACS functions within Queensland. In 2007, the Franchise business was sold to Adam Adams and his company Think Convenience. Adam and his wife Katrina are also the owners of six NightOwl stores in Cairns and North Queensland. As part of a strategy to increase growth dynamically, Think Convenience has re-introduced the company store method of expansion used extensively by Retail Services and discontinued by David Hodge. In order to facilitate the development of new regions and states, company-owned and operated stores were established. In regions like Townsville in Queensland, this has ensured new growth where initially franchisees were not available. Once established in this new area, NightOwl can then encourage franchising using company stores as examples of the business system. See also List of franchises References External links The NightOwl Official website Australian companies established in 1975 Retail companies established in 1975 Convenience stores of Australia Companies based in Brisbane
```javascript const { assert, skip, test, module: describe } = require('qunit'); const { GPU } = require('../../src'); describe('internal: precision'); (GPU.isWebGLSupported ? test : skip)('WebGL Decimal Precision', () => { const gpu = new GPU({mode: 'webgl'}); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); const reflectValue = gpu.createKernel(function(a) { return a; }).setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { const newAddResult = reflectValue(addResult)[0]; assert.equal(newAddResult, addResult); addResult = newAddResult; } gpu.destroy(); }); (GPU.isWebGL2Supported ? test : skip)('WebGL2 Decimal Precision', () => { const gpu = new GPU({mode: 'webgl2'}); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); const reflectValue = gpu.createKernel(function(a) { return a; }).setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { const newAddResult = reflectValue(addResult)[0]; assert.equal(newAddResult, addResult); addResult = newAddResult; } gpu.destroy(); }); (GPU.isHeadlessGLSupported ? test : skip)('HeadlessGL Decimal Precision', () => { const gpu = new GPU({mode: 'headlessgl'}); const add = gpu.createKernel(function(a, b) { return a + b; }).setOutput([1]); let addResult = add(0.1, 0.2)[0]; assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); const reflectValue = gpu.createKernel(function(a) { return a; }).setOutput([1]); //Just for sanity's sake, recurse the value to see if it spirals out of control for (let i = 0; i < 100; i++) { const newAddResult = reflectValue(addResult)[0]; assert.equal(newAddResult, addResult); addResult = newAddResult; } gpu.destroy(); }); ```
Uzunköprü District is a district of the Edirne Province of Turkey. Its seat is the town of Uzunköprü. Its area is 1,185 km2, and its population is 59,351 (2022). Composition There are two municipalities in Uzunköprü District: Kırcasalih Uzunköprü There are 53 villages in Uzunköprü District: Alıç Altınyazı Aslıhan Balaban Balabankoru Başağıl Bayramlı Beykonak Bıldır Çakmak Çalıköy Çavuşlu Çiftlikköy Çobanpınar Danişment Değirmenci Dereköy Elmalı Eskiköy Gazihalil Gazimehmet Gemici Hamidiye Hamitli Harmanlı Hasanpınar Kadıköy Karabürçek Karapınar Karayayla Kavacık Kavakayazma Kiremitçisalih Kırkkavak Kırköy Kurdu Kurtbey Kurttepe Maksutlu Malkoç Meşeli Muhacırkadı Ömerbey Saçlımüsellim Salarlı Sazlımalkoç Sığırcılı Sipahi Süleymaniye Sultanşah Türkobası Turnacı Yağmurca References Districts of Edirne Province
Breakneck Battery is an artillery battery in the British Overseas Territory of Gibraltar. It is located on Ministry of Defence property at the Upper Rock Nature Reserve, north of Lord Airey's Battery. It is one of a dozen batteries in Gibraltar that had 9.2-inch (233.7 mm) guns installed around the turn of the twentieth century. The emplacement features a 9.2-inch Mark X breech-loading gun on a Mark V mounting. The battery was refurbished by 10 Signal Regiment in 2012 and 2016 whilst being on Ceremonial duties whilst the Gibraltar Regiment where on exercise and is one of three surviving 9.2-inch gun emplacements at the Upper Ridge of the Rock of Gibraltar. By the late twentieth century, the 9.2-inch guns in Gibraltar, Bermuda (also known affectionately as "the Rock", and the former site of a Royal Naval Dockyard, and once considered "the Gibraltar of the West"), Portugal, South Africa, and Australia were the remaining examples of an emplacement that at one point had been mounted at strategic locations across the British Empire. Early history Breakneck Battery is in Gibraltar, the British Overseas Territory at the southern end of the Iberian Peninsula. The artillery battery is located at the Upper Ridge of the Upper Rock Nature Reserve, on Ministry of Defence property. It is positioned north of Lord Airey's Battery on a site once known as Mount Misery, which was renamed in 1901. The name "Breakneck" was inspired by the nearby Breakneck Stairs which descend part way down the sheer cliff on which the battery stands, overlooking the Mediterranean Sea. The decision to mount 9.2-inch breech-loading guns on the emplacements in Gibraltar can be traced back to the explosion of one of the 38-ton, muzzle-loading guns on . After that explosion on 2 January 1879, a Committee on Ordnance was founded to analyze the United Kingdom's artillery and the direction that it would take. The committee was directed to address "the question of breech-loading guns and such other questions as may be brought before it." Following research and deliberations, the committee settled on rifled breech-loading guns, an improvement over the customary rifled muzzle-loading weapons. Although the 9.2-inch breech-loading weapon was initially employed as a naval gun, it eventually was used for coastal defence as well. It was effective in dealing with hostile warships and their associated long-range attacks. The 9.2-inch gun retained its importance in British coastal defence for more than half a century. The mounting of 9.2-inch guns on Gibraltar's batteries commenced in the 1890s. By 1914, Gibraltar boasted a total of fourteen of the 9.2-inch weapons on twelve batteries. Breakneck Battery had a 9.2 inch Mark X breech-loading gun installed on a Mark V mounting. The World War II photograph obtained of the battery (pictured at right) by Lieutenant G W Dallison in 1942 is now part of the War Office Second World War Official Collection of photographs. A shell store and bombproof shelter for the crew are located beneath the gun position, excavated from the solid rock. The gun itself originally had a steel shield in front of it to protect the crew from counter-battery fire but during the Second World War this was extended to form a steel enclosure open at the back, to provide some protection from shrapnel and bomb splinters. Recent history Gibraltar's surviving 9.2-inch guns were described in a 1981 issue of After The Battle magazine: Breakneck Battery is one of three surviving 9.2-inch gun emplacements at the Upper Ridge of the Rock, the others being O'Hara's Battery and Lord Airey's Battery. Of the three Upper Ridge emplacements, O'Hara's Battery is in the best condition. Breakneck was the first of the batteries to be decommissioned, in 1953. The two other batteries mentioned, Levant Battery and Spur Battery, both had their guns removed in the late twentieth century. The former was decommissioned in the 1970s and had its gun removed; the barrel now rests in a scrap yard. Other than three Mk. X variants still surviving in the "Gibraltar of the West", Bermuda (two at St. David's Battery; one at Fort Victoria), by 1981, the year that the gun at the latter emplacement, Spur Battery, was dismantled for transfer to England in Project Vitello, Gibraltar's 9.2-inch guns represented three of the 25 remaining examples of a weapon that had at one time been mounted at strategic locations across the British Empire and its allies. For years, the Upper Ridge batteries were an excluded area in Gibraltar, where entry by the public was considered a criminal offence. While Breakneck Battery is still closed to the public, O'Hara's Battery and Lord Airey's Battery were opened in May 2010. Members of the 4th Battalion, The Royal Regiment of Scotland (4 SCOTS), also known as The Highlanders, arrived in Gibraltar in early April 2012 to cover the responsibilities of the Royal Gibraltar Regiment, which was in the United Kingdom. In addition to training and guard duties, the soldiers participated in community projects, including refurbishing of the coastal artillery gun at Breakneck Battery. Upon the return of the Royal Gibraltar Regiment, the Highlanders left for their base in Sennelager, Germany. References External links Google map of Breakneck Battery Photograph of Lord Airey's Battery, with Breakneck Battery in background Maps of Gibraltar with battery positions, including Breakneck Battery Batteries in Gibraltar Coastal artillery
```javascript // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax // Test optimized versions of array and object literals. function TestOptimizedLiteral(create, verify) { %PrepareFunctionForOptimization(create); verify(create(1, 2, 3), 1, 2, 3); verify(create(3, 5, 7), 3, 5, 7); %OptimizeFunctionOnNextCall(create); verify(create(11, 23, 42), 11, 23, 42); } // Test shallow array literal. function create_arr_shallow(a, b, c) { return [0, a, 0, b, 0, c]; } function verify_arr_shallow(array, a, b, c) { assertSame(6, array.length); assertSame(0, array[0]); assertSame(a, array[1]); assertSame(0, array[2]); assertSame(b, array[3]); assertSame(0, array[4]); assertSame(c, array[5]); } TestOptimizedLiteral(create_arr_shallow, verify_arr_shallow); // Test nested array literal. function create_arr_nested(a, b, c) { return [[0, a], [b, c], [1, 2], 3]; } function verify_arr_nested(array, a, b, c) { assertSame(4, array.length); assertSame(2, array[0].length); assertSame(0, array[0][0]); assertSame(a, array[0][1]); assertSame(2, array[1].length); assertSame(b, array[1][0]); assertSame(c, array[1][1]); assertSame(2, array[2].length); assertSame(1, array[2][0]); assertSame(2, array[2][1]); assertSame(3, array[3]); } TestOptimizedLiteral(create_arr_nested, verify_arr_nested); // Test shallow object literal. function create_obj_shallow(a, b, c) { return { x:a, y:b, z:c, v:'foo', 9:'bar' }; } function verify_obj_shallow(object, a, b, c) { assertSame(a, object.x); assertSame(b, object.y); assertSame(c, object.z); assertSame('foo', object.v); assertSame('bar', object[9]); } TestOptimizedLiteral(create_obj_shallow, verify_obj_shallow); // Test nested object literal. function create_obj_nested(a, b, c) { return { x:{ v:a, w:b }, y:{ v:1, w:2 }, z:c, v:'foo', 9:'bar' }; } function verify_obj_nested(object, a, b, c) { assertSame(a, object.x.v); assertSame(b, object.x.w); assertSame(1, object.y.v); assertSame(2, object.y.w); assertSame(c, object.z); assertSame('foo', object.v); assertSame('bar', object[9]); } TestOptimizedLiteral(create_obj_nested, verify_obj_nested); // Test mixed array and object literal. function create_mixed_nested(a, b, c) { return { x:[1, 2], y:[a, b], z:c, v:{ v:'foo' }, 9:'bar' }; } function verify_mixed_nested(object, a, b, c) { assertSame(2, object.x.length); assertSame(1, object.x[0]); assertSame(2, object.x[1]); assertSame(2, object.y.length); assertSame(a, object.y[0]); assertSame(b, object.y[1]); assertSame(c, object.z); assertSame('foo', object.v.v); assertSame('bar', object[9]); } TestOptimizedLiteral(create_mixed_nested, verify_mixed_nested); ```
Wuxian () was a Chinese shaman, or Wu () who practiced divination, prayer, sacrifice, rainmaking, and healing in Chinese traditions dating back over 3,000 years. Wuxian lived in the Shang dynasty (c. 1600–1046 BC) of China, and served under king Tai Wu. He is considered one of the main ancient Chinese astronomers alongside more historical figures such as Gan De and Shi Shen, the latter two of whom lived during the Warring States (403–221 BC). He has also been represented as one of the "Three Astronomical Traditions" on the Dunhuang map which was made during the Tang dynasty (618–907). See also Li Sao Tai Wu References Ancient Chinese astronomers Shang dynasty people Year of birth unknown Year of death unknown
Wendell Cherry (September 25, 1935 – July 16, 1991) was an American lawyer, entrepreneur, art collector and patron. The company he co-founded, Humana, grew under his leadership to become the largest hospital operator in the United States. In the 1980s he also built one of the country's most important art collections. Life and career Cherry was born in 1935 in Horse Cave, a rural community in Kentucky, to a grocery wholesaler, Layman S. Cherry, and his wife, Geneva (born Spillman). He was a member of the Kappa Sigma Fraternity, studied business administration and graduated in 1957. He graduated with a Bachelor of Laws in 1959. During this time he worked as chief editor of the Kentucky Law Journal. Family Cherry first married Mary Elizabeth Baird. Then married interior designer Dorothy O'Connell, and lived in Louisville and New York. Sports promoter Cherry belonged in the 1960s to a group of citizens from Louisville, who supported Louisville native Cassius Clay (later known as Muhammad Ali) in his early heavyweight boxing career. He worked as a lawyer for the group, collecting money from the sponsors for Clay. Art collector The American art magazine Art & Antiques named Cherry in 1985 among the 100 most important art collectors of the United States. The reputation of his collection was not only because of the quality of the works, but also for the sometimes very high prices that he paid for these pictures and scored from subsequent sales. A record-breaking example of these works was Pablo Picasso's self-portrait Yo, Picasso. Cherry purchased the picture in 1981 at Sotheby's for $5.3 million, at the time the highest amount ever paid for a Picasso painting. Philanthropy Cherry was one of the driving forces in establishing The Kentucky Center for the Performing Arts in 1983. From 1980 to 1987, he led this institution as CEO (board chairman). In 1990, he acquired the painting Funeral of a Mummy by American painter Frederick Arthur Bridgman for the Speed Art Museum in Louisville, on whose board he was a member. In the field of academia, Cherry endowed the University of Kentucky College of Law with $100,000 for the H. Wendell Cherry Professor of Law. He also endowed two chairs dedicated to medicine at the School of Medicine, the Wendell Cherry Chair in Clinical Trial Research and The Wendell Cherry Chair in Cancer Translational Research. References Sources John E. Kleber: The Encyclopedia of Louisville. University Press of Kentucky, Lexington 200, . Sotheby's New York (Hrsg.): Property from the Estate of Wendell Cherry. Auctions Catalog Sale 6565, Sotheby's New York, New York 1994. 1935 births 1991 deaths American art collectors American patrons of the arts People from Hart County, Kentucky Businesspeople from Louisville, Kentucky University of Kentucky College of Law alumni University of Louisville faculty 20th-century American businesspeople
```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 org.thingsboard.server.dao.service; import com.datastax.oss.driver.api.core.uuid.Uuids; import com.fasterxml.jackson.databind.JsonNode; import org.junit.Assert; import org.junit.Test; import org.junit.jupiter.api.Assertions; import org.springframework.beans.factory.annotation.Autowired; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.id.WidgetTypeId; import org.thingsboard.server.common.data.widget.WidgetType; import org.thingsboard.server.common.data.widget.WidgetTypeDetails; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.exception.DataValidationException; import org.thingsboard.server.dao.model.ModelConstants; import org.thingsboard.server.dao.widget.WidgetTypeService; import org.thingsboard.server.dao.widget.WidgetsBundleService; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; @DaoSqlTest public class WidgetTypeServiceTest extends AbstractServiceTest { @Autowired WidgetsBundleService widgetsBundleService; @Autowired WidgetTypeService widgetTypeService; private IdComparator<WidgetType> idComparator = new IdComparator<>(); @Test public void testSaveWidgetType() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); Assert.assertNotNull(savedWidgetType); Assert.assertNotNull(savedWidgetType.getId()); Assert.assertNotNull(savedWidgetType.getFqn()); Assert.assertTrue(savedWidgetType.getCreatedTime() > 0); Assert.assertEquals(widgetType.getTenantId(), savedWidgetType.getTenantId()); Assert.assertEquals(widgetType.getName(), savedWidgetType.getName()); Assert.assertEquals(widgetType.getDescriptor(), savedWidgetType.getDescriptor()); savedWidgetType.setName("New Widget Type"); widgetTypeService.saveWidgetType(savedWidgetType); WidgetType foundWidgetType = widgetTypeService.findWidgetTypeById(tenantId, savedWidgetType.getId()); Assert.assertEquals(foundWidgetType.getName(), savedWidgetType.getName()); widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); } @Test public void testSaveWidgetTypeWithEmptyName() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); Assertions.assertThrows(DataValidationException.class, () -> { widgetTypeService.saveWidgetType(widgetType); }); } @Test public void testSaveWidgetTypeWithEmptyDescriptor() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{}", JsonNode.class)); Assertions.assertThrows(DataValidationException.class, () -> { widgetTypeService.saveWidgetType(widgetType); }); } @Test public void testSaveWidgetTypeWithInvalidTenant() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(TenantId.fromUUID(Uuids.timeBased())); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); Assertions.assertThrows(DataValidationException.class, () -> { widgetTypeService.saveWidgetType(widgetType); }); } @Test public void testUpdateWidgetTypeTenant() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); savedWidgetType.setTenantId(TenantId.fromUUID(ModelConstants.NULL_UUID)); try { Assertions.assertThrows(DataValidationException.class, () -> { widgetTypeService.saveWidgetType(savedWidgetType); }); } finally { widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); } } @Test public void testUpdateWidgetTypeFqn() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); savedWidgetType.setFqn("some_fqn"); try { Assertions.assertThrows(DataValidationException.class, () -> { widgetTypeService.saveWidgetType(savedWidgetType); }); } finally { widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); } } @Test public void testFindWidgetTypeById() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetTypeDetails savedWidgetType = widgetTypeService.saveWidgetType(widgetType); WidgetTypeDetails foundWidgetType = widgetTypeService.findWidgetTypeDetailsById(tenantId, savedWidgetType.getId()); Assert.assertNotNull(foundWidgetType); Assert.assertEquals(savedWidgetType, foundWidgetType); widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); } @Test public void testFindWidgetTypeByTenantIdAndFqn() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetType savedWidgetType = new WidgetType(widgetTypeService.saveWidgetType(widgetType)); WidgetType foundWidgetType = widgetTypeService.findWidgetTypeByTenantIdAndFqn(tenantId, savedWidgetType.getFqn()); Assert.assertNotNull(foundWidgetType); Assert.assertEquals(savedWidgetType, foundWidgetType); widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); } @Test public void testDeleteWidgetType() throws IOException { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type"); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); WidgetType savedWidgetType = widgetTypeService.saveWidgetType(widgetType); WidgetType foundWidgetType = widgetTypeService.findWidgetTypeById(tenantId, savedWidgetType.getId()); Assert.assertNotNull(foundWidgetType); widgetTypeService.deleteWidgetType(tenantId, savedWidgetType.getId()); foundWidgetType = widgetTypeService.findWidgetTypeById(tenantId, savedWidgetType.getId()); Assert.assertNull(foundWidgetType); } @Test public void testFindWidgetTypesByTenantIdAndWidgetsBundleId() throws IOException { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); widgetsBundle.setTitle("Widgets bundle"); WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle); List<WidgetType> widgetTypes = new ArrayList<>(); for (int i=0;i<121;i++) { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type " + i); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); widgetTypes.add(new WidgetType(widgetTypeService.saveWidgetType(widgetType))); } List<WidgetTypeId> widgetTypeIds = widgetTypes.stream().map(WidgetType::getId).collect(Collectors.toList()); widgetTypeService.updateWidgetsBundleWidgetTypes(tenantId, savedWidgetsBundle.getId(), widgetTypeIds); List<WidgetType> loadedWidgetTypes = widgetTypeService.findWidgetTypesByWidgetsBundleId(tenantId, savedWidgetsBundle.getId()); Collections.sort(widgetTypes, idComparator); Collections.sort(loadedWidgetTypes, idComparator); Assert.assertEquals(widgetTypes, loadedWidgetTypes); for (WidgetTypeId id : widgetTypeIds) { widgetTypeService.deleteWidgetType(tenantId, id); } loadedWidgetTypes = widgetTypeService.findWidgetTypesByWidgetsBundleId(tenantId, savedWidgetsBundle.getId()); Assert.assertTrue(loadedWidgetTypes.isEmpty()); widgetsBundleService.deleteWidgetsBundle(tenantId, savedWidgetsBundle.getId()); } @Test public void testDeleteAllTypesFromWidgetsBundle() { WidgetsBundle widgetsBundle = new WidgetsBundle(); widgetsBundle.setTenantId(tenantId); widgetsBundle.setTitle("Widgets bundle"); WidgetsBundle savedWidgetsBundle = widgetsBundleService.saveWidgetsBundle(widgetsBundle); List<WidgetType> widgetTypes = new ArrayList<>(); for (int i = 0; i < 5; i++) { WidgetTypeDetails widgetType = new WidgetTypeDetails(); widgetType.setTenantId(tenantId); widgetType.setName("Widget Type " + i); widgetType.setDescriptor(JacksonUtil.fromString("{ \"someKey\": \"someValue\" }", JsonNode.class)); widgetTypes.add(new WidgetType(widgetTypeService.saveWidgetType(widgetType))); } List<WidgetTypeId> widgetTypeIds = widgetTypes.stream().map(WidgetType::getId).collect(Collectors.toList()); widgetTypeService.updateWidgetsBundleWidgetTypes(tenantId, savedWidgetsBundle.getId(), widgetTypeIds); List<WidgetType> loadedWidgetTypes = widgetTypeService.findWidgetTypesByWidgetsBundleId(tenantId, savedWidgetsBundle.getId()); Assert.assertEquals(widgetTypes.size(), loadedWidgetTypes.size()); widgetTypeService.updateWidgetsBundleWidgetTypes(tenantId, savedWidgetsBundle.getId(), Collections.emptyList()); loadedWidgetTypes = widgetTypeService.findWidgetTypesByWidgetsBundleId(tenantId, savedWidgetsBundle.getId()); Assert.assertEquals(0, loadedWidgetTypes.size()); } } ```
Predrag "Peca" Brzaković (; 27 September 1964 – 14 September 2012) was a Serbian professional footballer who played as a goalkeeper. Club career After starting out at Radnički Beograd, Brzaković played for OFK Beograd in the Yugoslav Second League over the course of five seasons, before switching to Yugoslav First League side Vojvodina in the 1991 winter transfer window. He spent two years in Novi Sad before rejoining his parent club Radnički Beograd during the winter break of the 1992–93 season. Between 1995 and 1998, Brzaković made 99 appearances for Čukarički in the First League of FR Yugoslavia. He also played professionally in Cyprus and China. International career In April 1996, Brzaković was an unused substitute in FR Yugoslavia's 3–1 home victory over the Faroe Islands. Futsal career After retiring from football, Brzaković played futsal for Serbia's Marbo and Ekonomac, but also for Montenegro's Municipium. He represented Serbia at the 2007 UEFA Futsal Championship, aged 43. Death On 14 September 2012, Brzaković suddenly died due to a heart attack. Career statistics References External links 1964 births 2012 deaths Footballers from Belgrade Yugoslav men's footballers Serbia and Montenegro men's footballers Serbian men's footballers Men's association football goalkeepers OFK Beograd players FK Vojvodina players FK Radnički Beograd players FK Čukarički players Qingdao Hainiu F.C. (1990) players FK Zvezdara players Yugoslav Second League players Yugoslav First League players First League of Serbia and Montenegro players Serbia and Montenegro expatriate men's footballers Expatriate men's footballers in Cyprus Expatriate men's footballers in China Serbia and Montenegro expatriate sportspeople in Cyprus Serbia and Montenegro expatriate sportspeople in China Serbian men's futsal players Futsal goalkeepers
```java package cn.crap.controller.visitor; import cn.crap.adapter.ProjectAdapter; import cn.crap.dto.ProjectDTO; import cn.crap.enu.ProjectShowType; import cn.crap.model.ProjectPO; import cn.crap.query.ProjectQuery; import cn.crap.service.ProjectService; import cn.crap.utils.LoginUserHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import cn.crap.dto.LoginInfoDto; import cn.crap.framework.JsonResult; import cn.crap.framework.MyException; import cn.crap.framework.base.BaseController; import cn.crap.utils.Page; import java.util.List; @Controller("forntProjectController") @RequestMapping("/visitor/project") public class ProjectController extends BaseController{ @Autowired private ProjectService projectService; @RequestMapping("/list.do") @ResponseBody public JsonResult list(@ModelAttribute ProjectQuery query, @RequestParam(defaultValue="3") Integer projectShowType) throws MyException{ Page page= new Page(query); LoginInfoDto user = LoginUserHelper.getUser(); String userId = user.getId(); List<ProjectPO> models = null; // & if (ProjectShowType.CREATE_JOIN.getType() == projectShowType) { page.setAllRow(projectService.count(userId, false, query.getName())); models = projectService.query(userId, false, query.getName(), page); } // else if (ProjectShowType.JOIN.getType() == projectShowType) { page.setAllRow(projectService.count(userId, true, query.getName())); models = projectService.query(userId, true, query.getName(), page); } List<ProjectDTO> projectDtos = ProjectAdapter.getDTOS(models, null); page.setAllRow(projectService.count(query)); return new JsonResult().data(projectDtos).page(page); } } ```
Lee Todd (born 7 March 1972) is an English retired professional footballer who played as a defender. Playing career Todd started his career in 1988 as a junior with Hartlepool United with whom he stayed until 1990. In the summer of 1990 Todd transferred to Stockport County on a free transfer. Lee spent seven years at Stockport notching up a total of 226 league appearances including two promotions and a League Cup Semi-Final appearance. In 1997 Todd was bought by his former Stockport County manager Dave Jones who was now managing Southampton paying £850,000 for his services. During his time at Southampton he played just ten league games, which included playing the full 90 minutes as Southampton won 3–2 against Liverpool at Anfield. After spending a year in the Premier League, Todd moved on again in search of more regular football. This time it was to Bradford City for a fee of £250,000. Todd spent two years at Bradford City notching up only 15 league appearances. In September 1999, he spent a month out on loan at Walsall but was limited to just one start. In 2000 Todd moved on again this time to Rochdale on a free transfer where he spent three years until 2003. During this period Todd clocked up 50 league appearances and scored three goals for the club. In 2003 Todd moved on another free transfer to Mossley but spent only a month with the club before free transferring again this time to Stalybridge Celtic. References External links 1972 births Living people Footballers from Hartlepool English men's footballers Men's association football defenders Hartlepool United F.C. players Stockport County F.C. players Southampton F.C. players Bradford City A.F.C. players Walsall F.C. players Rochdale A.F.C. players Mossley A.F.C. players Stalybridge Celtic F.C. players English Football League players Premier League players
```shell #!/usr/bin/env bash CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=none # shellcheck source=../shell_config.sh . "$CURDIR"/../shell_config.sh function test_func() { ENGINE=$1 MAX_MEM=4096 echo "Testing $ENGINE" $CLICKHOUSE_CLIENT --query "DROP TABLE IF EXISTS log"; $CLICKHOUSE_CLIENT --query "CREATE TABLE log (x UInt64, y UInt64, z UInt64) ENGINE = $ENGINE"; while true; do MAX_MEM=$((2 * $MAX_MEM)) $CLICKHOUSE_CLIENT --query "INSERT INTO log SELECT number, number, number FROM numbers(1000000)" --max_memory_usage $MAX_MEM > "${CLICKHOUSE_TMP}"/insert_result 2>&1 RES=$? grep -o -F 'Memory limit' "${CLICKHOUSE_TMP}"/insert_result || cat "${CLICKHOUSE_TMP}"/insert_result $CLICKHOUSE_CLIENT --query "SELECT count(), sum(x + y + z) FROM log" > "${CLICKHOUSE_TMP}"/select_result 2>&1; cat "${CLICKHOUSE_TMP}"/select_result { [[ $RES -eq 0 ]] || [[ $MAX_MEM -gt 200000000 ]]; } && break; done $CLICKHOUSE_CLIENT --query "DROP TABLE log"; } test_func TinyLog | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)' test_func StripeLog | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)' test_func Log | grep -v -P '^(Memory limit|0\t0|[1-9]000000\t)' rm "${CLICKHOUSE_TMP}/insert_result" rm "${CLICKHOUSE_TMP}/select_result" ```
Manganese(II) sulfide is a chemical compound of manganese and sulfur. It occurs in nature as the mineral alabandite (isometric), rambergite (hexagonal), and recently found browneite (isometric, with sphalerite-type structure, extremely rare, known only from a meteorite). Synthesis Manganese(II) sulfide can be prepared by reacting a manganese(II) salt (such as manganese(II) chloride) with ammonium sulfide: + → 2 + MnS Properties The crystal structure of manganese(II) sulfide is similar to that of sodium chloride. The pink color of MnS likely results from poor coupling between the lowest energy unoccupied Mn orbitals, resulting in discrete states rather than a delocalized band. Thus the lowest energy band-to-band electronic transition requires very high energy (ultraviolet) photons. See also Alabandite, cubic MnS. Manganese disulfide, MnS2, also known as Manganese(IV) Sulfide Manganese(II) sulfate, MnSO4 Rambergite, hexagonal MnS. References Manganese(II) compounds Monosulfides Rock salt crystal structure
Diego Wong (born 19 August 1977) is a Cuban handball player. He competed in the men's tournament at the 2000 Summer Olympics. References External links 1977 births Living people Cuban male handball players Olympic handball players for Cuba Handball players at the 2000 Summer Olympics Place of birth missing (living people)
In linguistics, free variation is the phenomenon of two (or more) sounds or forms appearing in the same environment without a change in meaning and without being considered incorrect by native speakers. Sociolinguists argue that describing such variation as "free" is very often a misnomer, since variation between linguistic forms is usually constrained probabilistically by a range of systematic social and linguistic factors, not unconstrained as the term "free variation" suggests. The term remains in use in studies focused primarily on language as systems (e.g. phonology, morphology, syntax), however, since "[t]he fact that variation is 'free' does not imply that it is totally unpredictable, but only that no grammatical principles govern the distribution of variants." Effects When phonemes are in free variation, speakers are sometimes strongly aware of the fact (especially if such variation is noticeable only across a dialectal or sociolectal divide), and will note, for example, that tomato is pronounced differently in British and American English ( and respectively), or that either has two pronunciations that are distributed fairly randomly. However, only a very small proportion of English words show such variations. In the case of different realizations of the same phoneme, however, free variation is exceedingly common and, along with differing intonation patterns, variation in realization is the most important single feature in the characterization of regional accents. English's deep orthography and the language's wide variety of accents often cause confusion, even for native speakers, on how written words should be pronounced. That allows for a significant degree of free variation to occur in English. English examples Phonology The rhotic consonant is in a free variation between the alveolar approximant, retroflex approximant, alveolar flap and alveolar trill, although all of these save for the first one are considered dialectal and rare. Glottalization of voiceless stops in word-final position: for example, the word stop may be pronounced with a plain unaspirated , , or with a glottalized , , also called a glottal stop or glottal plosive. Pronunciation Pronunciation of many English words may vary depending on the dialect and the speaker. Although individual speakers may prefer one or the other pronunciation and one may be more common in some dialects than others, many forms can often be encountered within a single dialect and sometimes even within a single idiolect. In some words, some speakers might use a different vowel than the others. This includes words like: economics, which may pronounced with or in the first syllable, or data, which can be pronounced as either or .; either and neither, in which "ei" can be pronounced as either or , even by the same speaker.; some loanwords, especially of French and Latin origin, such as route, which can be pronounced as either (a more anglicized pronunciation) or (a pronunciation more akin to French); some proper names, especially geographic state names such as Colorado, which can be pronounced as either or . Pronouncing a word with a different consonant or using a completely different pronunciation is also sometimes found in English. This can be found in words like: schedule, which may be pronounced either with the consonant cluster or the sound. The former is more common in American English, the latter in British English; with /sk/ and /ʃ/ phonemically distinct in both varieties (e.g. scout/shout, skin/shin), identical spelling obscures the fact that different phonological structures underlie the phonetic contrast; some loanwords like guillotine which can be pronounced with either or . Grammar Years from 2010 onwards can be expressed in English as either, e.g., two thousand ten or twenty ten. See also Allomorph Allophone Complementary distribution Contrastive distribution Phoneme Sociolinguistics Variable rules analysis References Phonology
Medly Pharmacy was a digital pharmacy retail company founded in 2017 by Marg Patel. History Medly Pharmacy was firstly founded by Marg Patel when his life experiences taught him about the problems and inefficiencies about health and medical care. Due to this, he founded the company to leverage innovative technology to modernize pharmacy of the future. On December 16, 2020, Medly opened their three-story headquarters in Bushwick, Brooklyn, New York. Throughout most of 2022, Medly started to struggle a lot, by losing a lot of money, laying off more than half of its staff members, and closing most of its retail stores. Former employees stated that Medly's decline and collapse was because the company grew too quickly. On December 9, 2022, Medly filed for Chapter 11 bankruptcy protection. On February 9, 2023, Medly announced it would sell all remaining assets to Walgreens, and would shut down all remaining stores and operations after 6 years. References 2017 establishments in New York (state) American companies established in 2017 Pharmacies of the United States Retail companies established in 2017 Bushwick, Brooklyn Companies based in Brooklyn Companies that filed for Chapter 11 bankruptcy in 2022 Retail companies disestablished in 2023 2023 disestablishments in New York (state)
```javascript // path_to_url if (!Element.prototype.matches) Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; ```
John Terrence Slattery (January 6, 1878 – July 17, 1949) was a catcher and first baseman for the Boston Americans, Cleveland Naps, Chicago White Sox, St. Louis Cardinals, and the Washington Senators for parts of four seasons between 1901 and 1909. He was never used regularly, and some of his Major League stops were very short (he played only four games for the Naps). He went to college at Boston College and Fordham University. He was head baseball coach at Harvard from 1920 to 1923 and Boston College from 1924 to 1927. In 1928, he was convinced to lead the Boston Braves for a year, but his stint with the Braves lasted only 31 games, going 11–20. He resigned as manager and owner Emil Fuchs hired Rogers Hornsby to replace him. Slattery died in Boston, Massachusetts, at age 71. References External links 1878 births 1949 deaths Boston Americans players Cleveland Naps players Chicago White Sox players St. Louis Cardinals players Washington Senators (1901–1960) players Boston Braves managers Fordham Rams baseball players Boston College Eagles baseball coaches Boston College Eagles baseball players Harvard Crimson baseball coaches Major League Baseball catchers Toronto Maple Leafs (International League) players New Bedford Whalers (baseball) players New Bedford Browns players Norwich Witches players Amsterdam-Gloversville-Johnstown Jags players Columbus Senators players Milwaukee Brewers (minor league) players Kansas City Blues (baseball) players Johnstown Johnnies players Sioux City Packers players Oakland Oaks (baseball) players Lawrence Colts players Montreal Royals players Baseball players from Boston Shamokin (minor league baseball) players
```java package easymvp.compiler; /** * @author Saeed Masoumi (saeed@6thsolution.com) */ public enum ViewType { ACTIVITY, SUPPORT_ACTIVITY, FRAGMENT, SUPPORT_FRAGMENT, CUSTOM_VIEW, CONDUCTOR_CONTROLLER } ```
```c++ /* * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <AEGetQuoteResponse.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <IAEMessage.h> AEGetQuoteResponse::AEGetQuoteResponse() : m_response(NULL) { } AEGetQuoteResponse::AEGetQuoteResponse(aesm::message::Response::GetQuoteResponse& response) : m_response(NULL) { m_response = new aesm::message::Response::GetQuoteResponse(response); } AEGetQuoteResponse::AEGetQuoteResponse(uint32_t errorCode, uint32_t quoteLength, const uint8_t* quote, uint32_t qeReportLength, const uint8_t* qeReport) : m_response(NULL) { m_response = new aesm::message::Response::GetQuoteResponse(); m_response->set_errorcode(errorCode); if (quoteLength!= 0 && quote != NULL) m_response->set_quote(quote, quoteLength); if (qeReportLength!= 0 && qeReport != NULL) m_response->set_qe_report(qeReport, qeReportLength); } //copy constructor AEGetQuoteResponse::AEGetQuoteResponse(const AEGetQuoteResponse& other) : m_response(NULL) { if (other.m_response != NULL) m_response = new aesm::message::Response::GetQuoteResponse(*other.m_response); } AEGetQuoteResponse::~AEGetQuoteResponse() { ReleaseMemory(); } void AEGetQuoteResponse::ReleaseMemory() { if (m_response != NULL) { delete m_response; m_response = NULL; } } AEMessage* AEGetQuoteResponse::serialize() { AEMessage *ae_msg = NULL; aesm::message::Response msg; if (check()) { aesm::message::Response::GetQuoteResponse* mutableResp = msg.mutable_getquoteres(); mutableResp->CopyFrom(*m_response); if (msg.ByteSize() <= INT_MAX) { ae_msg = new AEMessage; ae_msg->size = (unsigned int)msg.ByteSize(); ae_msg->data = new char[ae_msg->size]; msg.SerializeToArray(ae_msg->data, ae_msg->size); } } return ae_msg; } bool AEGetQuoteResponse::inflateWithMessage(AEMessage* message) { aesm::message::Response msg; msg.ParseFromArray(message->data, message->size); if (msg.has_getquoteres() == false) return false; ReleaseMemory(); m_response = new aesm::message::Response::GetQuoteResponse(msg.getquoteres()); return true; } bool AEGetQuoteResponse::GetValues(uint32_t* errorCode, uint32_t quoteLength, uint8_t* quote, uint32_t qeReportLength, uint8_t* qeReport) const { if (m_response->has_quote() && quote != NULL) { if (m_response->quote().size() <= quoteLength) memcpy(quote, m_response->quote().c_str(), m_response->quote().size()); else return false; } if (m_response->has_qe_report() && qeReport != NULL) { if (m_response->qe_report().size() <= qeReportLength) memcpy(qeReport, m_response->qe_report().c_str(), m_response->qe_report().size()); else return false; } *errorCode = m_response->errorcode(); return true; } AEGetQuoteResponse& AEGetQuoteResponse::operator=(const AEGetQuoteResponse& other) { if (this == &other) return *this; ReleaseMemory(); if (other.m_response != NULL) { m_response = new aesm::message::Response::GetQuoteResponse(*other.m_response); } return *this; } bool AEGetQuoteResponse::check() { if (m_response == NULL) return false; return m_response->IsInitialized(); } ```
Ivan Đikić (born 28 May 1966) is a Croatian-German molecular biologist who is the Director of the Institute of Biochemistry II at Goethe University Frankfurt. Scientific career In 1991, he earned his MD degree from the Faculty of Medicine at the University of Zagreb. After finishing his medical studies, he continued to pursue his PhD thesis in molecular biology at the University of Zagreb and at the New York University School of Medicine until 1997. He continued to work as a postdoctoral fellow in the laboratory of Joseph Schlessinger in New York from 1995 to 1997 before starting his own group at the Ludwig Institute for Cancer Research in Uppsala (Sweden). In 2002, Đikić was appointed as a Professor at Goethe University Frankfurt. He followed in Werner Müller-Esterl's footsteps as Director of the Institute of Biochemistry II in 2009. In addition, Đikić was the first Scientific Director (2009–2013) of the Buchmann Institute for Molecular Life Sciences, a cross-faculty, interdisciplinary institute at Goethe University which was founded as part of the Cluster of Excellence Macromolecular Complexes. He is speaker of the Collaborative Research Center 1177 on selective autophagy, and speaker of the LOEWE program "Ubiquitin Networks". Đikić has an affiliation as Professor with the School of Medicine University of Split, where he established an outstation lab in Split University and transferring technologies to Croatia. In addition, Đikić has been recognized by one of the highest civilian honours, The Order of Duke Branimir, bestowed by the President of Croatia. Đikić is member of several academic societies, including the number of organizations including the European Molecular Biology Organization (since 2004), the World Academy of Art and Science (since 2008), German National Academy of Sciences Leopoldina (since 2010), the American Academy of Arts and Sciences (since 2019), the Croatian Academy of Medical Science, and the European Academy of Sciences. He is a member of the editorial board for Cell. Research Đikić's research focuses on deciphering molecular mechanisms of cellular signaling pathways, which have a high relevance to human diseases such as cancer, neurodegenerative disorders and inflammation. Early on, he started to focus on ubiquitin to understand how this modification controls multiple cellular functions, and managed to prove a concept of ubiquitin signal recognition by specialized domains serving as specific receptors. More recently, his team has revealed the functions of linear ubiquitin chains in pathogen defense and overall immune response. He expanded his research to the field of selective autophagy, recognizing the enormous impact of the LC3/GABARAP signaling network displaying striking mechanistic similarities to ubiquitin. One major focus is on the crosstalk between autophagy and endocytic machineries, and in this context he has gained fundamental insight in autophagic processes at the endoplasmic reticulum (ER-phagy). Education In 1998, Đikić initiated the series of Dubrovnik Cell Signalling Conferences, which has been sponsored by EMBO continuously since 2004. Moreover, he is actively involved in organization of EMBO Meetings (Ubiquitin Meetings in 2015, 2013; Autophagy Meeting 2011, Cellular Microbiology/Cell Biology Meeting in 2010, 2008), EMBO Courses (2012, 2010, 2008, 2006 on Ubiquitin/SUMO; 2010 on Ubiquitin & DNA damage) as well as Keystone and CSH Meetings. In July 2016, he was hosting the Frankfurt Conference on Ubiquitin and Autophagy together with Volker Dötsch, Hubert Serve and Heide Genau. Personal life He's married to Inga Đikić with whom he has three children. He's a Christian of Roman Catholic denomination and has stated publicly that he sees no conflict between science and religion. Honors and awards 1997–2003 Research Award, Boehringer Ingelheim Fonds Germany 2000–2004 Award of the Strategic Funds for Young Leaders, Sweden 2002 Lilla Fernström Award, Lund, Sweden 2006 AACR Award for Outstanding Achievement in Cancer Research, Washington, US 2006 Young Cancer Researcher Award, European Association for Cancer Research, Budapest, Hungary 2006 Binder Innovation Prize, German Society for Cell Biology, Braunschweig, Germany 2006 Biomedical Science Prize 2006, Glaxo-Smith-Kline-Foundation, Munich, Germany 2008 Award of the International Society of Blood Purification, Brijuni Islands 2008 City of Split Award – Annual Prize for Science, Croatia 2009 Sir Hans Krebs Prize, Medical Faculty Hannover, Hannover, Germany 2010 German Cancer Prize, DKG Berlin, Germany 2010–2015 European Research Council (ERC) Advanced Grant, Brüssel, Belgium 2010 Order of Duke Branimir for international promotion of Croatia 2013 Ernst Jung Prize for Medicine 2013, Jung Foundation for Science and Research, Hamburg, Germany 2013 Gottfried Wilhelm Leibniz Prize of the German Research Foundation, Bonn, Germany 2013 William C. Rose Award 2013, American Association for Molecular Biology and Biochemistry for outstanding achievements, Boston, US 2014/2015 Vallee Visiting Professorship, Harvard Medical School, Boston, US 2015 Member of the Academia Europaea 2019 American Academy of Arts & Sciences 2023 Louis-Jeantet Prize for Medicine References External links Bibliography at the United States National Library of Medicine Living people 1966 births Scientists from Zagreb 21st-century Croatian scientists American medical researchers Croatian biologists German molecular biologists School of Medicine, University of Zagreb alumni New York University Grossman School of Medicine alumni Croatian expatriates in Germany Croatian expatriates in the United States Members of Academia Europaea Members of the German National Academy of Sciences Leopoldina Members of the European Molecular Biology Organization
The Wilds Christian Association, Inc. is a Protestant Christian organization, based in Brevard, North Carolina. The organization was founded by a group of Christians at Bob Jones University who recognized the need for a Christian camp in the Southeastern United States. In 1967, the group purchased a property near Brevard, North Carolina and established The Wilds Christian Camp and Conference Center (commonly referred to as "The Wilds") about two years later. Today, The Wilds is one of the largest Christian camps in the United States. About 21,000 people attend annual retreats, while summer camp averages 1,100 to 1,200 campers per week. The Wilds of the Rockies opened in 1987 near Kremmling, Colorado, though the property was sold in 2004 and converted to a residential development. A third camp, The Wilds of New England, was established in Deering, New Hampshire in 2009. Additionally, CampsAbroad was founded in 2001, which is an international program assisting Christian camping ministries in 40 countries. The Wilds Christian Association is supported by more than 300 churches, and more than 250,000 campers have attended its summer camp programs. The Wilds has a year-round staff of forty and a summer staff of about 270. Beliefs The Wilds is a conservative, fundamentalist, Protestant organization. Although not affiliated with any denomination, many sponsors are Independent Baptist and Bible churches. The Wilds mission statement is succinctly stated in the camp verse: "Whether therefore ye eat, or drink, or whatsoever ye do, do all to the glory of God" (1 Corinthians 10:31). The Wilds seeks to evangelize non-Christian campers and encourage spiritual growth among Christian campers by combining Bible study, personal discipleship, and religious services with recreational activity. Camping ministries North Carolina The Wilds Christian Camp/Conference Center is located near Rosman, North Carolina (with a mailing address in Brevard). The camp property contains approximately of land through which Toxaway Creek flows. Four main waterfalls on the Toxaway are on The Wilds property and are common hiking destinations for campers. History In the late 1960s, a group of people recognized the need for a Christian camp in the Southeastern United States. In 1967, the group discovered the property in Transylvania County, North Carolina, and first incorporated as "Hemlock Hills Christian Association" because of the abundance of hemlock trees on the property. Then someone recalled Socrates' death from drinking hemlock, and they decided to call the camp "The Wilds," a reflection of Jesus having urged His disciples to rest awhile in a secluded place. (Mark 6:31) Although the group had few resources, they eventually obtained funds to purchase the 810-acre tract of land in Transylvania County, North Carolina. By 1969, The Wilds was established by Ken Hay, Walter Fremont, Joe Henson, and Carl D. Blyth Sr., who knew each other from their association at Bob Jones University. Facilities The camp is one of the largest Christian camps in the United States. During the summer, the camp averages between 1,100 and 1,200 campers each week. Throughout the rest of the year the camp hosts specialized retreats that attract 21,000 attendees annually. The campsite facilities include staff residences, an inn and chapel, dormitory and craft shop, cabins, dining hall, main office building, and a large multi-purpose building (used as an indoor basketball venue and a 1,300-seat auditorium). The property includes a man-made lake, Toxaway Creek and waterfalls, basketball courts, and athletic fields. There are also several leisure activities available such as a water slide, land trolley (zip-line), and a "Giant Swing." The Wilds' section of Toxaway Creek has several waterfalls, which are numbered going downstream. "The Shoals" First Falls Second Falls Third Falls Fourth Falls Colorado The Wilds of the Rockies opened in 1987 near Kremmling, Colorado and operated near Rabbit Ears Pass and Muddy Pass until it was closed in 2004 due to community issues. The Wilds sold the property to longtime supporters Jeff and Linda Peotter, and the property became a residential development. New Hampshire In 2007, camp operations began at The Wilds of New England at rented facilities. The Wilds purchased land by Lake Winnipesaukee, near Meredith, but securing permits was difficult and "the property, though beautiful, was near enough to the town to bring a number of disadvantages." In 2009, the Meredith property was sold, and The Wilds assumed the mortgage of another camp property in Deering, New Hampshire. In 2007, the Board appointed Rand Hummel, assistant director of The Wilds in North Carolina, as the director of The Wilds of New England. International CampsAbroad is a worldwide consulting program used by The Wilds to assist the cause of Christian camping around the world. The program is designed to help already established camps, as well as churches who want to start new camping ministries. Training and materials are provided to ministries at no charge, but The Wilds name is not used by these camping ministries outside the United States. Products The Wilds produces Bible study guides, topical studies, songbooks, recorded music, and books of activity ideas for church youth groups. The Wilds is noted for its recordings of conservative Christian music produced by camp staff. See also References Further reading Ken Collier and Ken Hay, All to the Glory of God (Taylors, SC: The Wilds Christian Association, 2009) External links The Wilds official website The Wilds (North Carolina) map The Wilds of New England Camps Abroad Publishing companies established in 1969 Christian fundamentalism Christian summer camps Christian publishing companies Christian record labels Companies based in South Carolina Transylvania County, North Carolina Privately held companies based in South Carolina Christian organizations established in 1969 Christianity in North Carolina Christianity in South Carolina Youth organizations based in North Carolina
The PAX Association () was a pro-communist Catholic organization created in 1947 in the People's Republic of Poland at the onset of the Stalinist period. The association published the Słowo Powszechne daily for almost fifty years between 1947 and 1993 with an average of 312 issues annually. The first editor-in-chief of Słowo Powszechne (circulation: 40,000) was Wojciech Kętrzyński (d. 1983) from KN, grandson of historian Wojciech Kętrzyński. In 1982 the newspaper adjusted its name to Słowo Powszechne: dziennik Stowarzyszenia PAX (the "PAX Association Daily"). The publication closed only when the PAX ceased to function in 1993, following the collapse of communism; however, the facsimile of the association was reestablished in 1993 under a different name: the Catholic association "Civitas Christiana". Notably, in 1953 the PAX gave its support to the Stalinist show trial of the Kraków Curia pronouncing death penalties for the Catholic priests accused of treason, and took over the publication of the Catholic weekly magazine Tygodnik Powszechny until the Polish October of 1956. Communist era Following the Soviet takeover, the PAX Association had been formed with the intention to undermine grass-roots support for the Roman Catholic Church in Stalinist Poland. Created by Bolesław Piasecki, it approved the trial and imprisonment of many Polish clergymen, among them Bishop Czesław Kaczmarek and Cardinal Stefan Wyszyński. PAX attempted to compete with the conservative clergy of the interwar era over public policy issues, especially after the arrest of hundreds of priests by the state security in early 1950s. The government gave it total control over the Polish branch of the Caritas relief organisation. According to Norman Davies PAX was an NKVD front organisation, set up to win over Polish Catholics to communism, and to break their links to the Vatican. It maintained a presence in the Sejm, winning, for example, five seats in the 1969 election. Reforms After 1956, together with many other similar government initiatives, it was toned down and took a more compromising position, in some regards even supporting the leniency for the anti-communist resistance in Poland, even though it firmly endorsed the communist government of the People's Republic of Poland until the fall of communism. After 1982 it was a member of the Patriotic Movement for National Rebirth. Throughout the decades after its creation and the death of Stalin, it continued to steadily lose power and influence, although it still exists in modern Poland. Notable members Bolesław Piasecki Janusz Zabłocki Jan Dobraczyński Tadeusz Mazowiecki References Organizations established in 1947 Polish People's Republic History of Poland (1989–present) History of Catholicism in Poland 1947 establishments in Poland National Democracy Christian socialism Left-wing nationalism
```c /* * * in the file LICENSE in the source distribution or at * path_to_url */ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/evp.h> #include <openssl/dsa.h> #ifndef OPENSSL_NO_STDIO int DSA_print_fp(FILE *fp, const DSA *x, int off) { BIO *b; int ret; if ((b = BIO_new(BIO_s_file())) == NULL) { DSAerr(DSA_F_DSA_PRINT_FP, ERR_R_BUF_LIB); return 0; } BIO_set_fp(b, fp, BIO_NOCLOSE); ret = DSA_print(b, x, off); BIO_free(b); return ret; } int DSAparams_print_fp(FILE *fp, const DSA *x) { BIO *b; int ret; if ((b = BIO_new(BIO_s_file())) == NULL) { DSAerr(DSA_F_DSAPARAMS_PRINT_FP, ERR_R_BUF_LIB); return 0; } BIO_set_fp(b, fp, BIO_NOCLOSE); ret = DSAparams_print(b, x); BIO_free(b); return ret; } #endif int DSA_print(BIO *bp, const DSA *x, int off) { EVP_PKEY *pk; int ret; pk = EVP_PKEY_new(); if (pk == NULL || !EVP_PKEY_set1_DSA(pk, (DSA *)x)) return 0; ret = EVP_PKEY_print_private(bp, pk, off, NULL); EVP_PKEY_free(pk); return ret; } int DSAparams_print(BIO *bp, const DSA *x) { EVP_PKEY *pk; int ret; pk = EVP_PKEY_new(); if (pk == NULL || !EVP_PKEY_set1_DSA(pk, (DSA *)x)) return 0; ret = EVP_PKEY_print_params(bp, pk, 4, NULL); EVP_PKEY_free(pk); return ret; } ```
Saanich ( ) is a district municipality on Vancouver Island in British Columbia, within the Greater Victoria area. The population was 117,735 at the 2021 census, making it the most populous municipality in the Capital Regional District and Vancouver Island, and the eighth-most populous in the province. The district adopted its name after the Saanich First Nation, meaning "emerging land" or "emerging people". The District acts as a bedroom community immediately to the north of Victoria, British Columbia. With an area of , it is the largest municipality in Greater Victoria. The municipality contains a wide variety of rural and urban landscapes and neighbourhoods stretching north to the Saanich Peninsula. Saanich is home to part of the University of Victoria which is bisected by the neighbouring district municipality of Oak Bay and to both campuses of Camosun College. The municipality's topography is undulating with many glacially scoured rock outcroppings. Elevations range from sea level to . The physical setting is greatly influenced by water. There are of freshwater lakes and of marine shoreline. History Saanich has been the home to First Nations people for thousands of years. Saanich is on the territory of the Lək̓ʷəŋən peoples known today as Songhees & Esquimalt Nations, the Malahat Nation and the Saanich Peoples. These Indigenous peoples have connections to the land and those traditions are carried on to this day. Non-Indigenous history begins with the arrival of the Hudson's Bay Company in the 1840s. The Craigflower Schoolhouse (originally called Maple Point School), the oldest surviving school building in Western Canada, was built on orders from Kenneth MacKenzie. He came from Scotland with his family in 1852, on the Hudson's Bay Company ship Norman Morison, to establish a farm for the Puget Sound Agricultural Company, a subsidiary of the Hudson's Bay Company. A school was needed for the children of farm employees, as well as those of arriving settlers. The Municipality of Saanich was incorporated on March 1, 1906. The Dominion Astrophysical Observatory telescope was designed by John Stanley Plaskett, an astronomer with the Department of the Interior in Ottawa. The reflecting telescope was the largest of its kind in the world when it was built, though this was only the case for a few short months in 1918. The District of Saanich contains a long shoreline with sandy beaches located at several ocean bays. Two of the beaches are Cadboro Bay Beach and Cordova Bay Beach. Cadboro Bay is known as the home of the "Cadborosaurus", a mythical cryptid. Saanich's notable parks include Mount Douglas Park, Mount Tolmie Park (with viewpoints), and Gyro Park. W̱SÁNEĆ peoples Groups The W̱SÁNEĆ (weh-saanich) peoples are represented by the Tsartlip (Sart-Lip), Pauquachin (Paw-Qua-Chin), Tsawout (Say-Out), Tseycum (Sigh-Come) and Malahat (Mal-a-hat) Nations. The W̱SÁNEĆ Leadership Council Society consists of three of theses Nations: Tsartlip, Tseycum and Tsawout. These W̱SÁNEĆ First Nations remain on their ancestral lands and continue to prosper today. Leadership Council On May 7, 2018, the W̱SÁNEĆ Leadership Council was created as a representation of the W̱SÁNEĆ First Nations to the Government. The creation of this council not only brought three Indigenous groups together, but it also established a legal governing body. With this council, came many proposals and projects to benefit the W̱SÁNEĆ First Nations. Includes: January 2018, the submission of a proposal for the Government of Canada to make the council a legal governing body (accepted). Submission of funding to the federal government's "National Rebuilding" program. Negotiations of a government to government project with the Capital Regional District. Language The W̱SÁNEĆ language or Saanich dialect is called SENĆOŦEN This dialect was revitalized by the late John Elliot, an important member of the W̱SÁNEĆ community and peoples. Climate Government The Saanich District Council is the governing body of the municipality of Saanich. The council consists of the Mayor and eight councillors. Mayor: Dean Murdock Councillors: Colin Plant, Susan Brice, Zac de Vries, Judy Brownoff, Mena Westhaver, Nathalie Chambers, Karen Harper, & Teale Phelps Bondaroff Neighbourhoods Saanich is divided into twelve local areas for planning purposes. In addition, there are a number of community associations in the municipality that represent neighbourhoods largely overlapping with the local areas. The Local Areas, and representative community associations, are listed below: Blenkinsop. A primarily rural community in a valley situated west of Mount Douglas. Represented by the Blenkinsop Valley Community Association. Cadboro Bay. A small village located at the eastern edge of Saanich, bordering on Oak Bay near the University of Victoria. The community also includes the upscale waterfront neighbourhood of Ten Mile Point. Represented by the Cadboro Bay Residents' Association. Carey. A suburban community located in western Saanich. Represented by the Residents Association of Strawberry Vale, Marigold and Glanford in the north, and the Mount View Colquitz Community Association in the south. Broadmead. Originally developed from Broadmead Farms, it was designed as an architecturally controlled area. The focus of the development was to incorporate homes into the landscape. Large trees could not be cut down to accommodate the homes. Most of the area is considered to be in an urban forest. It is situated near Highway 17 and ends a few blocks west of Cordova Bay Road. The community is represented by the Broadmead Area Residents' Association, BARA. Cordova Bay. A seaside community in northern Saanich. Represented by the Cordova Bay Association for Community Affairs. Gordon Head. A large suburban community to the north of the University of Victoria. Represented by the Gordon Head Residents' Association. North Quadra. A suburban community in the centre of the municipality. Represented by the North Quadra Community Association. Quadra. A large urban and suburban community surrounding the urban core of Saanich. Contains the Cedar Hill Golf Course and is represented by the Quadra Cedar Hill Community Association. Royal Oak. A suburban community at the rural edge of Saanich. Represented by the Royal Oak Community Association, Falaise Community Association, and the Broadmead Area Residents' Association. Rural Saanich. The largest Local Area by area, this part of Saanich is sparsely populated and mostly rural. Represented in part by the Prospect Lake and District Community Association. Saanich Core. The urban centre of the District of Saanich. Contains Uptown and the municipal hall. Represented by part of the Mount View Community Association and part of the Quadra Cedar Hill Community Association. Shelbourne. An urban and suburban community stretching between the City of Victoria and the University of Victoria. Represented by the Mount Tolmie Community Association and Camosun Community Association. Tillicum. An urban and suburban community along the Gorge in western Saanich. Represented by the Gorge Tillicum Community Association. Education The northeastern half of British Columbia's third-largest university, the University of Victoria campus, is in Saanich, while the southwestern portion is in neighbouring Oak Bay. Saanich is also home to both major campuses of Camosun College, the original Lansdowne campus, and the Interurban campus. Saanich is divided between two bordering school districts, School District 61 Greater Victoria and School District 63 Saanich. It is also the home of South Island Distance Education School. Demographics In the 2021 Canadian census conducted by Statistics Canada, Saanich had a population of 117,735 living in 48,048 of its 50,064 total private dwellings, a change of from its 2016 population of 114,148. With a land area of , it had a population density of in 2021. Ethnicity Note: Totals greater than 100% due to multiple origin responses. Religion According to the 2021 census, religious groups in Saanich included: Irreligion (66,460 persons or 57.5%) Christianity (38,645 persons or 33.5%) Sikhism (3,250 persons or 2.8%) Islam (1,855 persons or 1.6%) Buddhism (1,520 persons or 1.3%) Hinduism (1,370 persons or 1.2%) Judaism (760 persons or 0.7%) Indigenous spirituality (100 persons or 0.1%) Surrounding municipalities and communities See also Elk/Beaver Lake Regional Park Murder of Reena Virk Notes References External links Saanich Peninsula District municipalities in British Columbia Greater Victoria
```emacs lisp ;;; ps-def.el --- XEmacs and Emacs definitions for ps-print -*- lexical-binding: t -*- ;; Author: Vinicius Jose Latorre <viniciusjl.gnu@gmail.com> ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) ;; Vinicius Jose Latorre <viniciusjl.gnu@gmail.com> ;; Keywords: wp, print, PostScript ;; X-URL: path_to_url ;; Package: ps-print ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; (at your option) any later version. ;; GNU Emacs 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 GNU Emacs. If not, see <path_to_url ;;; Commentary: ;; See ps-print.el for documentation. ;;; Code: (eval-and-compile (unless (fboundp 'declare-function) (defmacro declare-function (&rest _r)))) (declare-function ps-plot-with-face "ps-print" (from to face)) (declare-function ps-plot-string "ps-print" (string)) (defvar ps-bold-faces) ; in ps-print.el (defvar ps-italic-faces) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; XEmacs Definitions (cond ((featurep 'xemacs) ; XEmacs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ps-bdf (defvar installation-directory nil) (defvar coding-system-for-read) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ps-mule (or (fboundp 'charset-dimension) (defun charset-dimension (_charset) 1)) ; ascii (or (fboundp 'char-width) (defun char-width (_char) 1)) ; ascii (or (fboundp 'encode-char) (defun encode-char (ch _ccs) ch)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ps-print ;; GNU Emacs (or (fboundp 'line-beginning-position) (defun line-beginning-position (&optional n) (save-excursion (and n (/= n 1) (forward-line (1- n))) (beginning-of-line) (point)))) ;; GNU Emacs (or (fboundp 'find-composition) (defalias 'find-composition 'ignore)) (defun ps-xemacs-color-name (color) (if (color-specifier-p color) (color-name color) color)) (defalias 'ps-mark-active-p 'region-active-p) (defun ps-face-foreground-name (face) (ps-xemacs-color-name (face-foreground face))) (defun ps-face-background-name (face) (ps-xemacs-color-name (face-background face))) (defalias 'ps-frame-parameter 'frame-property) ;; Return t if the device (which can be changed during an emacs session) ;; can handle colors. (defun ps-color-device () (eq (device-class) 'color)) (defun ps-mapper (extent list) (nconc list (list (list (extent-start-position extent) 'push extent) (list (extent-end-position extent) 'pull extent))) nil) (defun ps-extent-sorter (a b) (< (extent-priority a) (extent-priority b))) (defun ps-xemacs-face-kind-p (face kind kind-regex) (let* ((frame-font (or (face-font-instance face) (face-font-instance 'default))) (kind-cons (and frame-font (assq kind (font-instance-properties frame-font)))) (kind-spec (cdr-safe kind-cons)) (case-fold-search t)) (and kind-spec (string-match kind-regex kind-spec)))) ;; to avoid XEmacs compilation gripes (defvar coding-system-for-write) (defvar buffer-file-coding-system) (and (fboundp 'find-coding-system) (or (funcall 'find-coding-system 'raw-text-unix) (funcall 'copy-coding-system 'no-conversion-unix 'raw-text-unix))) (defun ps-color-values (x-color) (let ((color (ps-xemacs-color-name x-color))) (cond ((fboundp 'x-color-values) (funcall 'x-color-values color)) ((and (fboundp 'color-instance-rgb-components) (ps-color-device)) (funcall 'color-instance-rgb-components (if (color-instance-p x-color) x-color (make-color-instance color)))) (t (error "No available function to determine X color values"))))) (defun ps-face-bold-p (face) (or (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold") (memq face ps-bold-faces))) ; Kludge-compatible (defun ps-face-italic-p (face) (or (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o") (ps-xemacs-face-kind-p face 'SLANT "i\\|o") (memq face ps-italic-faces))) ; Kludge-compatible (defalias 'ps-face-strikeout-p 'ignore) (defalias 'ps-face-overline-p 'ignore) (defalias 'ps-face-box-p 'ignore) ;; XEmacs will have to make do with %s (princ) for floats. (defvar ps-color-format "%s %s %s") (defvar ps-float-format "%s ") (defun ps-generate-postscript-with-faces1 (from to) ;; Generate some PostScript. (let ((face 'default) (position to) ;; XEmacs ;; Build the list of extents... (a (cons 'dummy nil)) record type extent extent-list) (map-extents 'ps-mapper nil from to a) (setq a (sort (cdr a) 'car-less-than-car) extent-list nil) ;; Loop through the extents... (while a (setq record (car a) position (car record) record (cdr record) type (car record) record (cdr record) extent (car record)) ;; Plot up to this record. ;; XEmacs 19.12: for some reason, we're getting into a ;; situation in which some of the records have ;; positions less than 'from'. Since we've narrowed ;; the buffer, this'll generate errors. This is a hack, ;; but don't call ps-plot-with-face unless from > point-min. (and (>= from (point-min)) (ps-plot-with-face from (min position (point-max)) face)) (cond ((eq type 'push) (and (extent-face extent) (setq extent-list (sort (cons extent extent-list) 'ps-extent-sorter)))) ((eq type 'pull) (setq extent-list (sort (delq extent extent-list) 'ps-extent-sorter)))) (setq face (if extent-list (extent-face (car extent-list)) 'default) from position a (cdr a))) (ps-plot-with-face from to face))) ) (t ; Emacs ;; Do nothing )) ; end cond featurep ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Emacs Definitions (cond ((featurep 'xemacs) ; XEmacs ;; Do nothing ) (t ; Emacs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ps-print (defun ps-mark-active-p () mark-active) (defun ps-face-foreground-name (face) (face-foreground face nil t)) (defun ps-face-background-name (face) (face-background face nil t)) (defalias 'ps-frame-parameter 'frame-parameter) ;; Return t if the device (which can be changed during an emacs session) can ;; handle colors. This function is not yet implemented for GNU emacs. (defun ps-color-device () (if (fboundp 'color-values) (funcall 'color-values "Green") t)) (defun ps-color-values (x-color) (cond ((fboundp 'color-values) (funcall 'color-values x-color)) ((fboundp 'x-color-values) (funcall 'x-color-values x-color)) (t (error "No available function to determine X color values")))) (defun ps-face-bold-p (face) (or (face-bold-p face) (memq face ps-bold-faces))) (defun ps-face-italic-p (face) (or (face-italic-p face) (memq face ps-italic-faces))) (defun ps-face-strikeout-p (face) (eq (face-attribute face :strike-through) t)) (defun ps-face-overline-p (face) (eq (face-attribute face :overline) t)) (defun ps-face-box-p (face) (not (memq (face-attribute face :box) '(nil unspecified)))) ;; Emacs understands the %f format; we'll use it to limit color RGB values ;; to three decimals to cut down some on the size of the PostScript output. (defvar ps-color-format "%0.3f %0.3f %0.3f") (defvar ps-float-format "%0.3f ") (defun ps-generate-postscript-with-faces1 (from to) ;; Generate some PostScript. (let ((face 'default) (position to) ;; Emacs (property-change from) (overlay-change from) before-string after-string) (while (< from to) (and (< property-change to) ; Don't search for property change ; unless previous search succeeded. (setq property-change (next-property-change from nil to))) (and (< overlay-change to) ; Don't search for overlay change ; unless previous search succeeded. (setq overlay-change (min (next-overlay-change from) to))) (setq position (min property-change overlay-change) before-string nil after-string nil) (setq face (cond ((invisible-p from) 'emacs--invisible--face) ((get-char-property from 'face)) (t 'default))) ;; Plot up to this record. (and before-string (ps-plot-string before-string)) (ps-plot-with-face from position face) (and after-string (ps-plot-string after-string)) (setq from position)) (ps-plot-with-face from to face))) )) ; end cond featurep ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'ps-def) ;;; ps-def.el ends here ```
```shell #!/bin/bash -eu # # # 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. # ################################################################################ # Move seed corpus and dictionary. mv $SRC/{*.zip,*.dict} $OUT mkdir build && cd build cmake ../ -DBUILD_SHARED_LIBS=OFF make $CC $CFLAGS -c ../test/fuzzers/fuzz-mdhtml.c -I../src $CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-mdhtml.o -o $OUT/fuzz-mdhtml \ ./src/libmd4c-html.a ./src/libmd4c.a ```
California is the third album by Gianna Nannini and was released in 1979. The album, a rock record - with the single "America" – took her straight to the top of the charts in Germany and Northern Europe in 1980. The album went platinum in Italy and gold in Germany, Switzerland and Austria. Track listing All songs by Gianna Nannini except as noted. "America" – 4:20 "California" – 8:14 "Good Bye My Heart" – 6:19 "Io e Bobby McGee" (Cover version of "Me and Bobby McGee") (Kris Kristofferson / Fred Foster / Gianna Nannini) - 4:38 "Sognami" – 4:01 "La lupa e le stelle" – 4:08 "Lei" – 5:44 Personnel Walter Calloni - Drums, Percussion Dino d'Antonio - Bass Kris Kristofferson - Composer Gianna Nannini - Composer, Piano, Primary Artist, Vocals Mauro Paoluzzi - Composer, Guitar Claudio Pascoli - Saxophone - Keyboards Michelangelo Romano - Producer External links Gianna Nannini homepage 1979 albums Gianna Nannini albums
Lewis James Kerr (born 25 March 1990) is a British speedway rider from Snettisham in England. Speedway career Kerr took up speedway in late 2009, and made his competitive debut in June the following year for King's Lynn Young Stars' in the National League Knock-Out Cup. Initially named as the team's number 8, towards the end of the season, having averaged almost 6 points per match in National League matches, he was named in the main seven places in the team. He was again named in the team for the 2011 and 2012 seasons. In 2012 he rode in the Premier League as a guest replacement for Plymouth Devils, Somerset Rebels and Leicester Lions, and in November 2012 he was named in a doubling up role in the Lions team for 2013, sharing the number seven position with Lewis Blackbird, while continuing to ride for King's Lynn in the National League. He was released before the start of the season after being offered a full-time reserve position with Newcastle Diamonds for the 2013 Premier League speedway season. He rode for both Newcastle and King's Lynn in 2014. While racing for Newcastle in 2015, Kerr suffered an almost career-ending crash in a meeting at Peterborough. He was hit by Australian Josh Grajczonek in the third heat, which forced him to go through the fence into a metal gate. He was treated for head injuries at the track for over one hour, before being airlifted to Addenbrooke's Hospital. He was placed into a medically induced coma for three days, before finally waking and breathing on his own. After recovering he raced for Lakeside, Ipswich and Scunthorpe in 2016 and then Scunthorpe, Somerset and Poole in 2017. In 2017, he made the final of the British Speedway Championship for the first time, finishing 11th. In 2018, he resigned for King's Lynn as well as appearing for Glasgow and reached the final of the British Championship again. During 2019 he signed for Eastbourne for the SGB Championship 2019, while remaining at King's Lynn in the highest league and he finished in 5th place at the 2019 British Speedway Championship. The highlight of a lost 2020 season due to COVID-19 pandemic was a 10th placed finish in the 2020 British Speedway Championship. In 2021, he rode for the King's Lynn Stars in the SGB Premiership 2021 and the Eastbourne Eagles in the SGB Championship 2021. When the Eagles withdrew from the league due to financial issues Kerr joined the Redcar Bears for the remainder of the 2021 season. Kerr had a testimonial meeting at King's Lynn Speedway on 20 March 2022, for ten years service to speedway. During 2022, he initially rode for King's Lynn before signing for Sheffield in the SGB Premiership 2022. He also continued to ride for the Redcar Bears in the SGB Championship 2022 and won the 2022 SGB Championship Pairs Championship for Redcar, with Charles Wright. He also helped Sheffield win the League Cup and reach the Play off final. In 2023, Kerr re-signed for the Sheffield Tigers in the SGB Premiership, where he won the league title. He also signed for Oxford Cheetahs in the SGB Championship 2023. Personal life Lewis married Jessica Day on 6 December 2014. References 1990 births Living people English motorcycle racers British speedway riders Sportspeople from King's Lynn Eastbourne Eagles riders Glasgow Tigers riders Ipswich Witches riders King's Lynn Stars riders Lakeside Hammers riders Newcastle Diamonds riders Oxford Cheetahs riders Plymouth Devils riders Poole Pirates riders Redcar Bears riders Scunthorpe Scorpions riders Sheffield Tigers riders Somerset Rebels riders
```python from rx.core import Observable, AnonymousObservable from rx.internal import extensionmethod @extensionmethod(Observable) def some(self, predicate=None): """Determines whether some element of an observable sequence satisfies a condition if present, else if some items are in the sequence. Example: result = source.some() result = source.some(lambda x: x > 3) Keyword arguments: predicate -- A function to test each element for a condition. Returns {Observable} an observable sequence containing a single element determining whether some elements in the source sequence pass the test in the specified predicate if given, else if some items are in the sequence. """ source = self def subscribe(observer): def on_next(_): observer.on_next(True) observer.on_completed() def on_error(): observer.on_next(False) observer.on_completed() return source.subscribe(on_next, observer.on_error, on_error) return source.filter(predicate).some() if predicate else AnonymousObservable(subscribe) ```
```javascript import { marked } from 'marked'; import { isAbsolutePath, getPath, getParentPath } from '../router/util.js'; import { isFn, cached, isPrimitive } from '../util/core.js'; import { tree as treeTpl } from './tpl.js'; import { genTree } from './gen-tree.js'; import { slugify } from './slugify.js'; import { emojify } from './emojify.js'; import { getAndRemoveConfig, removeAtag, getAndRemoveDocsifyIgnoreConfig, } from './utils.js'; import { imageCompiler } from './compiler/image.js'; import { highlightCodeCompiler } from './compiler/code.js'; import { paragraphCompiler } from './compiler/paragraph.js'; import { taskListCompiler } from './compiler/taskList.js'; import { taskListItemCompiler } from './compiler/taskListItem.js'; import { linkCompiler } from './compiler/link.js'; const cachedLinks = {}; const compileMedia = { markdown(url) { return { url, }; }, mermaid(url) { return { url, }; }, iframe(url, title) { return { html: `<iframe src="${url}" ${ title || 'width=100% height=400' }></iframe>`, }; }, video(url, title) { return { html: `<video src="${url}" ${title || 'controls'}>Not Support</video>`, }; }, audio(url, title) { return { html: `<audio src="${url}" ${title || 'controls'}>Not Support</audio>`, }; }, code(url, title) { let lang = url.match(/\.(\w+)$/); lang = title || (lang && lang[1]); if (lang === 'md') { lang = 'markdown'; } return { url, lang, }; }, }; export class Compiler { constructor(config, router) { this.config = config; this.router = router; this.cacheTree = {}; this.toc = []; this.cacheTOC = {}; this.linkTarget = config.externalLinkTarget || '_blank'; this.linkRel = this.linkTarget === '_blank' ? config.externalLinkRel || 'noopener' : ''; this.contentBase = router.getBasePath(); this.renderer = this._initRenderer(); let compile; const mdConf = config.markdown || {}; if (isFn(mdConf)) { compile = mdConf(marked, this.renderer); } else { marked.setOptions( Object.assign(mdConf, { renderer: Object.assign(this.renderer, mdConf.renderer), }), ); compile = marked; } this._marked = compile; this.compile = text => { let isCached = true; // FIXME: this is not cached. const result = cached(_ => { isCached = false; let html = ''; if (!text) { return text; } if (isPrimitive(text)) { html = compile(text); } else { html = compile.parser(text); } html = config.noEmoji ? html : emojify(html, config.nativeEmoji); slugify.clear(); return html; })(text); const curFileName = this.router.parse().file; if (isCached) { this.toc = this.cacheTOC[curFileName]; } else { this.cacheTOC[curFileName] = [...this.toc]; } return result; }; } /** * Pulls content from file and renders inline on the page as a embedded item. * * This allows you to embed different file types on the returned * page. * The basic format is: * ``` * [filename](_media/example.md ':include') * ``` * * @param {string} href The href to the file to embed in the page. * @param {string} title Title of the link used to make the embed. * * @return {type} Return value description. */ compileEmbed(href, title) { const { str, config } = getAndRemoveConfig(title); let embed; title = str; if (config.include) { if (!isAbsolutePath(href)) { href = getPath( this.contentBase, getParentPath(this.router.getCurrentPath()), href, ); } let media; if (config.type && (media = compileMedia[config.type])) { embed = media.call(this, href, title); embed.type = config.type; } else { let type = 'code'; if (/\.(md|markdown)/.test(href)) { type = 'markdown'; } else if (/\.mmd/.test(href)) { type = 'mermaid'; } else if (/\.html?/.test(href)) { type = 'iframe'; } else if (/\.(mp4|ogg)/.test(href)) { type = 'video'; } else if (/\.mp3/.test(href)) { type = 'audio'; } embed = compileMedia[type].call(this, href, title); embed.type = type; } embed.fragment = config.fragment; return embed; } } _matchNotCompileLink(link) { const links = this.config.noCompileLinks || []; for (const n of links) { const re = cachedLinks[n] || (cachedLinks[n] = new RegExp(`^${n}$`)); if (re.test(link)) { return link; } } } _initRenderer() { const renderer = new marked.Renderer(); const { linkTarget, linkRel, router, contentBase } = this; const _self = this; const origin = {}; /** * Render anchor tag * @link path_to_url#overriding-renderer-methods * @param {String} tokens the content tokens * @param {Number} depth Type of heading (h<level> tag) * @returns {String} Heading element */ origin.heading = renderer.heading = function ({ tokens, depth }) { const text = this.parser.parseInline(tokens); let { str, config } = getAndRemoveConfig(text); const nextToc = { depth, title: str }; const { content, ignoreAllSubs, ignoreSubHeading } = getAndRemoveDocsifyIgnoreConfig(str); str = content.trim(); nextToc.title = removeAtag(str); nextToc.ignoreAllSubs = ignoreAllSubs; nextToc.ignoreSubHeading = ignoreSubHeading; const slug = slugify(config.id || str); const url = router.toURL(router.getCurrentPath(), { id: slug }); nextToc.slug = url; _self.toc.push(nextToc); // Note: tabindex="-1" allows programmatically focusing on heading // elements after navigation. This is preferred over focusing on the link // within the heading because it matches the focus behavior of screen // readers when navigating page content. return `<h${depth} id="${slug}" tabindex="-1"><a href="${url}" data-id="${slug}" class="anchor"><span>${str}</span></a></h${depth}>`; }; origin.code = highlightCodeCompiler({ renderer }); origin.link = linkCompiler({ renderer, router, linkTarget, linkRel, compilerClass: _self, }); origin.paragraph = paragraphCompiler({ renderer }); origin.image = imageCompiler({ renderer, contentBase, router }); origin.list = taskListCompiler({ renderer }); origin.listitem = taskListItemCompiler({ renderer }); renderer.origin = origin; return renderer; } /** * Compile sidebar, it uses _sidebar.md ( or specific file) or the content's headings toc to render sidebar. * @param {String} text Text content from the sidebar file, maybe empty * @param {Number} level Type of heading (h<level> tag) * @returns {String} Sidebar element */ sidebar(text, level) { const { toc } = this; const currentPath = this.router.getCurrentPath(); let html = ''; // compile sidebar from _sidebar.md if (text) { return this.compile(text); } // compile sidebar from content's headings toc for (let i = 0; i < toc.length; i++) { if (toc[i].ignoreSubHeading) { const deletedHeaderLevel = toc[i].depth; toc.splice(i, 1); // Remove headers who are under current header for ( let j = i; j < toc.length && deletedHeaderLevel < toc[j].depth; j++ ) { toc.splice(j, 1) && j-- && i++; } i--; } } const tree = this.cacheTree[currentPath] || genTree(toc, level); html = treeTpl(tree); this.cacheTree[currentPath] = tree; return html; } /** * When current content redirect to a new path file, clean pre content headings toc */ resetToc() { this.toc = []; } /** * Compile sub sidebar * @param {Number} level Type of heading (h<level> tag) * @returns {String} Sub-sidebar element */ subSidebar(level) { const currentPath = this.router.getCurrentPath(); const { cacheTree, toc } = this; toc[0] && toc[0].ignoreAllSubs && toc.splice(0); // remove the first heading from the toc if it is a top-level heading toc[0] && toc[0].depth === 1 && toc.shift(); for (let i = 0; i < toc.length; i++) { toc[i].ignoreSubHeading && toc.splice(i, 1) && i--; } const tree = cacheTree[currentPath] || genTree(toc, level); cacheTree[currentPath] = tree; this.toc = []; return treeTpl(tree); } /** * Compile the text to generate HTML heading element based on the level * @param {*} text Text content, for now it is only from the _sidebar.md file * @param {*} level Type of heading (h<level> tag), for now it is always 1 * @returns */ header(text, level) { const tokenHeading = { type: 'heading', raw: text, depth: level, text: text, tokens: [{ type: 'text', raw: text, text: text }], }; return this.renderer.heading(tokenHeading); } /** * Compile cover page * @param {Text} text Text content * @returns {String} Cover page */ cover(text) { const cacheToc = this.toc.slice(); const html = this.compile(text); this.toc = cacheToc.slice(); return html; } } ```
Alejandro Fernández (born 2 April 1959) is a Mexican sports shooter. He competed in the men's trap event at the 1996 Summer Olympics. References 1959 births Living people Mexican male sport shooters Olympic shooters for Mexico Shooters at the 1996 Summer Olympics People from Xalapa 20th-century Mexican people
The Eighth Amendment to the Constitution of Pakistan (Urdu: آئین پاکستان میں آٹھویں ترمیم) allowed the President to unilaterally dissolve the National Assembly and elected governments. The National Assembly of Pakistan amended the Constitution of Pakistan in 1985 and the law stayed on the books until its repeal in 1997. The bill was passed in the absence of the elected Parliament. The eighth amendment was drafted and later enforced by the technocratic-military government of General Zia-ul-Haq. The eighth amendment changed Pakistan's system of government from a parliamentary democracy to a semi-presidential system. The eighth amendment strengthened the authority of the President and also granted additional powers to dismiss the elected Prime Minister's government. These powers included the right, expressed in sub-section 2(b) inserted into Article 58, to dissolve the National Assembly (but not the Senate) if, in his or her opinion, "a situation has arisen in which the Government of the Federation cannot be carried on in accordance with the provisions of the Constitution and an appeal to the electorate is necessary." (Constitution of Pakistan, Article 58) with the consequence of dismissing the Prime Minister and his or her Cabinet. Text The Eighth Amendment, besides making a number of other changes to the Constitution, introduced the following clause into Article 58 of the Constitution: Effect on democracy General Zia-ul-Haq first used the amendment to dismiss Prime Minister Mohammad Khan Junejo for alleged corruption in May 1988. The prime minister had wanted to roll back Zia's authority. In 1988, Benazir Bhutto pledged to abolish the amendment in her election manifesto. The amendment stayed on the books however, because she did not have a sufficient number of seats in 1988 and again in 1993. From 1988 to 1996, President Ghulaam Ishaq Khan made extensive use of the eight amendment and the Article 58 2(b) to dissolve the National Assembly. President Khan used the amendment to dismiss the elected governments of Prime Ministers Benazir Bhutto and Nawaz Sharif. President Khan first used the VIII Amendment on August 6, 1990, against Bhutto on alleged cases of nepotism and the corruption. In 1993, President Ishaq Khan again used this amendment to dismiss the people-elected government of Prime Minister Nawaz Sharif. In the second instance, Prime Minister Nawaz Sharif was reinstated as prime minister by the Supreme Court, but the resulting stalemate ended with the resignations of both Khan and Sharif. The use of Article 58 2(b) was almost exclusively justified by the president as necessary, for the removal of corrupt governments that, it was asserted, had lost the confidence of the people. Elections were held each time that caused the ruling party to lose its majority or plurality in the National Assembly. It was again used in 1996 by President Farooq Ahmad Khan Leghari against his own party leader Prime Minister Benazir Bhutto in November 1996. In 1997, the Thirteenth Amendment was passed, stripping the president of the power to dissolve the National Assembly and call for new elections, effectively reducing the presidency to a ceremonial figurehead. Pakistan's democracy provides no means for the people to directly recall members of Parliament before the end of their terms. Consequently, the Thirteenth and Fourteenth Amendments had the effect of removing the institutional checks and balances on the Prime Minister's power, by giving him or her immunity from being legally dismissed. The power of the president's office was partially restored by the Seventeenth Amendment. The power to dissolve the National Assembly and dismiss the Prime Minister is now subject to Supreme Court approval. In 2010, the Eighteenth Amendment was passed by Parliament of Pakistan reverting the 17th Amendment at an effective and immediate course. Eighth Amendment as a compromise In general discourse, the Eighth Amendment has become synonymous with Article 58 2(b), which in turn is considered to be the provision that introduced the presidential power to dissolve the National Assembly. However, the Eighth Amendment was in fact a compromise between the Parliament elected in the non-party elections of 1985 and then President Gen. Zia-ul-Haq. Prior to the 1985 election, over a period of six years, Gen. Zia-ul-Haq had already made numerous amendments to the Constitution of 1973 through various Constitution Amendment Orders, the most significant being the Revival of Constitution of 1973 Order (President's Order No. 14 of 1985). That Order had in fact granted to the President even more discretion in dissolving the National Assembly. Clause (2) added to Article 58 by that Order stated: "The President may also dissolve the National Assembly in his discretion where, in his opinion, an appeal to the electorate is necessary." Note that the test of the constitutional functioning of the government was not required for the President to dissolve the National Assembly. It must also be stated that the Eighth Amendment also caused the elected Parliament to endorse all Orders made by Gen. Zia-ul-Haq by substituting the Article 270A introduced by President's Order No. 14 of 1985 by a slightly modified version, preserving the text declaring the validity of all of his actions, including his takeover of July 5, 1977 and subsequent constitutional amendments. It is not clear whether this explicit parliamentary approval was required for Gen. Zia's amendments to obtain legal validity, but it appears that Gen. Zia considered it desirable to obtain this approval and thus chose to compromise by watering down some of the presidential powers his amendments had granted. See also Zia-ul-Haq's Islamization Separation of powers Nawaz Sharif Pervez Musharraf References 08 1985 in law Military government of Pakistan (1977–1988)
The men's pole vault event at the 2002 World Junior Championships in Athletics was held in Kingston, Jamaica, at National Stadium on 19 and 21 July. Medalists Results Final 21 July Qualifications 19 Jul Group A Group B Participation According to an unofficial count, 22 athletes from 16 countries participated in the event. References Pole vault Pole vault at the World Athletics U20 Championships
Players and pairs who neither have high enough rankings nor receive wild cards may participate in a qualifying tournament held one week before the annual Wimbledon Tennis Championships. Seeds Éric Winogradsky (second round) Dan Cassidy (first round) Sammy Giammalva (qualified) Matt Anger (qualifying competition, lucky loser) Martin Laurendeau (qualified) Zeeshan Ali (qualified) Danilo Marcelino (qualifying competition) Grant Connell (second round) Udo Riglewski (first round) Niclas Kroon (second round) Broderick Dyke (second round) Nicklas Kulti (qualifying competition) Kelly Jones (qualified) Andrei Olhovskiy (first round) Peter Nyborg (first round) Joey Rive (qualified) Guillaume Raoux (first round) Cyril Suk (second round) Tobias Svantesson (qualifying competition) n/a Ricardo Acuña (first round) Kent Kinnear (qualifying competition) Bret Garnett (qualified) Michael Robertson (qualified) Philippe Pech (first round) Steve Guy (qualifying competition) Alexandre Hocevar (first round) Fernando Roese (qualifying competition) Peter Doohan (second round) Scott Warner (qualified) Patrick Baur (qualified) Srinivasan Vasudevan (first round) Qualifiers Patrick Baur Ronnie Båthman Sammy Giammalva Scott Warner Martin Laurendeau Zeeshan Ali Greg Holmes Bill Scanlon Bret Garnett Michael Robertson Todd Woodbridge Bryan Shelton Kelly Jones Henrik Holm Nick Fulwood Joey Rive Lucky loser Matt Anger Qualifying draw First qualifier Second qualifier Third qualifier Fourth qualifier Fifth qualifier Sixth qualifier Seventh qualifier Eighth qualifier Ninth qualifier Tenth qualifier Eleventh qualifier Twelfth qualifier Thirteenth qualifier Fourteenth qualifier Fifteenth qualifier Sixteenth qualifier External links 1989 Wimbledon Championships – Men's draws and results at the International Tennis Federation Men's Singles Qualifying Wimbledon Championship by year – Men's singles qualifying